Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
hotfix for custom icon changing, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
hundeva committed May 16, 2018
1 parent 52056a7 commit 0f200c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ buildscript {

allprojects {
ext {
version_name = "1.1.1"
version_code = 16
version_name = "1.1.2"
version_code = 17

compile_sdk_version = 27
min_sdk_version = 21
Expand Down
19 changes: 14 additions & 5 deletions src/com/hdeva/launcher/LeanSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Pair;

import com.android.launcher3.Utilities;
Expand Down Expand Up @@ -340,11 +341,19 @@ public static Pair<String, Integer> getCustomIcon(Context context, ComponentName
}

public static void setCustomIcon(Context context, String forComponent, String iconPack, int iconResId) {
Utilities.getCustomIconPrefs(context)
.edit()
.putString(String.format(CUSTOM_ICON_PACK_KEY_TEMPLATE, forComponent), iconPack)
.putInt(String.format(CUSTOM_ICON_RES_KEY_TEMPLATE, forComponent), iconResId)
.apply();
if (TextUtils.isEmpty(forComponent)) {
return;
}

ComponentName componentName = ComponentName.unflattenFromString(forComponent);

if (componentName != null) {
Utilities.getCustomIconPrefs(context)
.edit()
.putString(String.format(CUSTOM_ICON_PACK_KEY_TEMPLATE, componentName.flattenToString()), iconPack)
.putInt(String.format(CUSTOM_ICON_RES_KEY_TEMPLATE, componentName.flattenToString()), iconResId)
.apply();
}
}

private static SharedPreferences prefs(Context context) {
Expand Down

0 comments on commit 0f200c1

Please sign in to comment.