From e89bc7cf485c6955566c486893a4e4baa0a8e4b4 Mon Sep 17 00:00:00 2001 From: Shin-NiL Date: Fri, 23 Apr 2021 18:57:44 -0300 Subject: [PATCH] Update for Godot 3.3 --- demo/export_presets.cfg | 45 +++++++++---------- demo/main.tscn | 1 + share-plugin/.idea/compiler.xml | 6 +++ share-plugin/.idea/gradle.xml | 1 + share-plugin/.idea/misc.xml | 2 +- share-plugin/build.gradle | 2 +- share-plugin/godotshare/build.gradle | 4 +- .../plugin/android/godotshare/GodotShare.java | 11 ++--- .../gradle/wrapper/gradle-wrapper.properties | 4 +- 9 files changed, 40 insertions(+), 36 deletions(-) create mode 100644 share-plugin/.idea/compiler.xml diff --git a/demo/export_presets.cfg b/demo/export_presets.cfg index 218beb1..1d3c350 100644 --- a/demo/export_presets.cfg +++ b/demo/export_presets.cfg @@ -8,51 +8,50 @@ export_filter="all_resources" include_filter="" exclude_filter="" export_path="" -patch_list=PoolStringArray( ) script_export_mode=1 script_encryption_key="" [preset.0.options] -graphics/32_bits_framebuffer=true -xr_features/xr_mode=0 -xr_features/degrees_of_freedom=0 -xr_features/hand_tracking=0 -xr_features/focus_awareness=false -one_click_deploy/clear_previous_install=true custom_template/debug="" custom_template/release="" custom_template/use_custom_build=true +custom_template/export_format=0 plugins/GodotShare=true -command_line/extra_args="" +architectures/armeabi-v7a=true +architectures/arm64-v8a=false +architectures/x86=true +architectures/x86_64=false +keystore/debug="" +keystore/debug_user="" +keystore/debug_password="" +keystore/release="" +keystore/release_user="" +keystore/release_password="" +one_click_deploy/clear_previous_install=true version/code=1 version/name="1.0" package/unique_name="org.godotengine.$genname" package/name="" package/signed=true +launcher_icons/main_192x192="" +launcher_icons/adaptive_foreground_432x432="" +launcher_icons/adaptive_background_432x432="" +graphics/32_bits_framebuffer=true +graphics/opengl_debug=false +xr_features/xr_mode=0 +xr_features/degrees_of_freedom=0 +xr_features/hand_tracking=0 +xr_features/focus_awareness=false screen/immersive_mode=true -screen/orientation=0 screen/support_small=true screen/support_normal=true screen/support_large=true screen/support_xlarge=true -screen/opengl_debug=false -launcher_icons/main_192x192="" -launcher_icons/adaptive_foreground_432x432="" -launcher_icons/adaptive_background_432x432="" -keystore/debug="" -keystore/debug_user="" -keystore/debug_password="" -keystore/release="" -keystore/release_user="" -keystore/release_password="" +command_line/extra_args="" apk_expansion/enable=false apk_expansion/SALT="" apk_expansion/public_key="" -architectures/armeabi-v7a=true -architectures/arm64-v8a=false -architectures/x86=false -architectures/x86_64=false permissions/custom_permissions=PoolStringArray( ) permissions/access_checkin_properties=false permissions/access_coarse_location=false diff --git a/demo/main.tscn b/demo/main.tscn index 7a2fa97..f9b6520 100644 --- a/demo/main.tscn +++ b/demo/main.tscn @@ -10,4 +10,5 @@ margin_right = 720.0 margin_bottom = 671.0 text = "SHARE CAPTURE" script = ExtResource( 1 ) + [connection signal="pressed" from="share_btn" to="share_btn" method="_on_share_btn_pressed"] diff --git a/share-plugin/.idea/compiler.xml b/share-plugin/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/share-plugin/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/share-plugin/.idea/gradle.xml b/share-plugin/.idea/gradle.xml index 7f44481..8124294 100644 --- a/share-plugin/.idea/gradle.xml +++ b/share-plugin/.idea/gradle.xml @@ -16,6 +16,7 @@ diff --git a/share-plugin/.idea/misc.xml b/share-plugin/.idea/misc.xml index dfd2c79..19aa6a5 100644 --- a/share-plugin/.idea/misc.xml +++ b/share-plugin/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/share-plugin/build.gradle b/share-plugin/build.gradle index f0da79b..6185ba7 100644 --- a/share-plugin/build.gradle +++ b/share-plugin/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:4.1.3' // NOTE: Do not place your application dependencies here; they belong diff --git a/share-plugin/godotshare/build.gradle b/share-plugin/godotshare/build.gradle index 1a67b30..7b76a4f 100644 --- a/share-plugin/godotshare/build.gradle +++ b/share-plugin/godotshare/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 16 targetSdkVersion 29 - versionCode 1 - versionName "1.0" + versionCode 3 + versionName "3.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' diff --git a/share-plugin/godotshare/src/main/java/shinnil/godot/plugin/android/godotshare/GodotShare.java b/share-plugin/godotshare/src/main/java/shinnil/godot/plugin/android/godotshare/GodotShare.java index d877313..ebb7914 100644 --- a/share-plugin/godotshare/src/main/java/shinnil/godot/plugin/android/godotshare/GodotShare.java +++ b/share-plugin/godotshare/src/main/java/shinnil/godot/plugin/android/godotshare/GodotShare.java @@ -8,6 +8,7 @@ import org.godotengine.godot.Godot; import org.godotengine.godot.plugin.GodotPlugin; +import org.godotengine.godot.plugin.UsedByGodot; import java.io.File; import java.util.Arrays; @@ -21,9 +22,10 @@ public class GodotShare extends GodotPlugin { public GodotShare(Godot godot) { super(godot); - activity = godot; + activity = godot.getActivity(); } + @UsedByGodot public void shareText(String title, String subject, String text) { Log.d(TAG, "shareText called"); Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); @@ -33,6 +35,7 @@ public void shareText(String title, String subject, String text) { activity.startActivity(Intent.createChooser(sharingIntent, title)); } + @UsedByGodot public void sharePic(String path, String title, String subject, String text) { Log.d(TAG, "sharePic called"); @@ -60,10 +63,4 @@ public void sharePic(String path, String title, String subject, String text) { public String getPluginName() { return "GodotShare"; } - - @NonNull - @Override - public List getPluginMethods() { - return Arrays.asList("sharePic", "shareText"); - } } diff --git a/share-plugin/gradle/wrapper/gradle-wrapper.properties b/share-plugin/gradle/wrapper/gradle-wrapper.properties index f7a7a18..3d2a13a 100644 --- a/share-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/share-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jun 29 09:13:34 BRT 2020 +#Fri Apr 23 18:42:14 BRT 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip