Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use regular icon for launcher by default #1079

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* New Features:
* Wear OS app
([#1068](https://github.com/Automattic/pocket-casts-android/pull/1068)).
* Updates
Use regular Pocket Casts app icon by default, and allow pride icon to still be selected.
([#1079](https://github.com/Automattic/pocket-casts-android/pull/1079)).

7.40
-----
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {

release {
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher_pride_2023",
appIcon: "@mipmap/ic_launcher",
gitHash: "",
sentryDsn: project.pocketcastsSentryDsn
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class AppIcon @Inject constructor(
);

companion object {
fun fromString(value: String, default: AppIconType = PRIDE_2023): AppIconType {
fun fromString(value: String, default: AppIconType = DEFAULT): AppIconType {
return AppIconType.values().find { it.id == value } ?: default
}
}
Expand All @@ -194,8 +194,8 @@ class AppIcon @Inject constructor(
val allAppIconTypes = AppIconType.values()

private fun getAppIconFromPreferences(): AppIconType {
val appIconId: String = sharedPreferences.getString(PREFERENCE_APPICON, AppIconType.PRIDE_2023.id) ?: AppIconType.PRIDE_2023.id
return AppIconType.fromString(appIconId, AppIconType.PRIDE_2023)
val appIconId: String = sharedPreferences.getString(PREFERENCE_APPICON, AppIconType.DEFAULT.id) ?: AppIconType.PRIDE_2023.id
return AppIconType.fromString(appIconId, AppIconType.DEFAULT)
}

private fun setAppIconToPreferences(appIconType: AppIconType) {
Expand All @@ -210,7 +210,7 @@ class AppIcon @Inject constructor(
AppIconType.values().forEach { iconType ->
val componentName = ComponentName(componentPackage, "$classPath${iconType.aliasName}")
// If we are using the default icon we just switch every alias off
val enabledFlag = if (selectedIconType == iconType && selectedIconType != AppIconType.PRIDE_2023) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED
val enabledFlag = if (selectedIconType == iconType && selectedIconType != AppIconType.DEFAULT) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED
context.packageManager.setComponentEnabledSetting(componentName, enabledFlag, PackageManager.DONT_KILL_APP)
}
}
Expand Down