Skip to content

Commit

Permalink
Merge pull request #80569 from m4gr3d/show_in_app_library_settings_main
Browse files Browse the repository at this point in the history
Add export setting to control whether to show the Godot app in the app library
  • Loading branch information
akien-mga committed Aug 16, 2023
2 parents 04c2bc5 + 63d47dc commit 6c3735c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions platform/android/doc_classes/EditorExportPlatformAndroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@
<member name="package/show_in_android_tv" type="bool" setter="" getter="">
If [code]true[/code], this app will show in Android TV launcher UI.
</member>
<member name="package/show_in_app_library" type="bool" setter="" getter="">
If [code]true[/code], this app will show in the device's app library.
[b]Note:[/b] This is [code]true[/code] by default.
</member>
<member name="package/signed" type="bool" setter="" getter="">
If [code]true[/code], package signing is enabled.
</member>
Expand Down
1 change: 1 addition & 0 deletions platform/android/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,7 @@ void EditorExportPlatformAndroid::get_export_options(List<ExportOption> *r_optio
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/retain_data_on_uninstall"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/exclude_from_recents"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/show_in_android_tv"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/show_in_app_library"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/show_as_launcher_app"), false));

r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icon_option, PROPERTY_HINT_FILE, "*.png"), ""));
Expand Down
8 changes: 6 additions & 2 deletions platform/android/export/gradle_export_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ String _get_activity_tag(const Ref<EditorExportPlatform> &p_export_platform, con

manifest_activity_text += " <intent-filter>\n"
" <action android:name=\"android.intent.action.MAIN\" />\n"
" <category android:name=\"android.intent.category.LAUNCHER\" />\n";
" <category android:name=\"android.intent.category.DEFAULT\" />\n";

bool show_in_app_library = p_preset->get("package/show_in_app_library");
if (show_in_app_library) {
manifest_activity_text += " <category android:name=\"android.intent.category.LAUNCHER\" />\n";
}

bool uses_leanback_category = p_preset->get("package/show_in_android_tv");
if (uses_leanback_category) {
Expand All @@ -279,7 +284,6 @@ String _get_activity_tag(const Ref<EditorExportPlatform> &p_export_platform, con
bool uses_home_category = p_preset->get("package/show_as_launcher_app");
if (uses_home_category) {
manifest_activity_text += " <category android:name=\"android.intent.category.HOME\" />\n";
manifest_activity_text += " <category android:name=\"android.intent.category.DEFAULT\" />\n";
}

manifest_activity_text += " </intent-filter>\n";
Expand Down
1 change: 1 addition & 0 deletions platform/android/java/app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
1 change: 1 addition & 0 deletions platform/android/java/editor/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down

0 comments on commit 6c3735c

Please sign in to comment.