Skip to content

Commit

Permalink
Make icon show in launcher in first install
Browse files Browse the repository at this point in the history
Better for make first setup or just decide keep or not icon in launcher
WSTxda committed Jan 15, 2024
1 parent aca6cb1 commit 9ddf3c2
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -366,19 +366,19 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- microG Settings shown in Launcher -->
<!-- microG Settings hide in Launcher -->
<activity-alias
android:name="org.microg.gms.ui.SettingsActivityLauncher"
android:enabled="false"
android:exported="true"
android:targetActivity="org.microg.gms.ui.MainSettingsActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity-alias>

Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ class SettingsFragment : ResourceSettingsFragment() {
findPreference<SwitchPreference>(PREF_CAST_HIDE_LAUNCHER_ICON)?.apply {
setOnPreferenceChangeListener { _, newValue ->
pm.setComponentEnabledSetting(
ComponentName.createRelative(requireActivity(), "org.microg.gms.ui.SettingsActivityLauncher"),
ComponentName.createRelative(requireActivity(), "org.microg.gms.ui.MainSettingsActivity"),
when (newValue) {
true -> PackageManager.COMPONENT_ENABLED_STATE_DISABLED
else -> PackageManager.COMPONENT_ENABLED_STATE_ENABLED
8 changes: 5 additions & 3 deletions play-services-core/src/main/res/xml/preferences_start.xml
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@
android:targetClass="org.microg.gms.ui.SelfCheckFragment$AsActivity"
android:targetPackage="@string/var_pref_start_gms_package" />
</Preference>
<PreferenceCategory android:layout="@layout/preference_category_no_label" android:key="prefcat_google_services">
<PreferenceCategory android:layout="@layout/preference_category_no_label"
android:key="prefcat_google_services">
<Preference
android:icon="@drawable/ic_add_account"
android:key="pref_accounts"
@@ -43,9 +44,10 @@
android:key="pref_hide_launcher_icon"
android:icon="@drawable/ic_hide_launcher_icon"
android:title="@string/pref_hide_launcher_icon"
android:defaultValue="true"/>
android:defaultValue="false"/>
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_category_no_label" android:key="prefcat_footer">
<PreferenceCategory android:layout="@layout/preference_category_no_label"
android:key="prefcat_footer">
<Preference
android:icon="@drawable/ic_developer"
android:summary="@string/developer"

0 comments on commit 9ddf3c2

Please sign in to comment.