IconManager manifest inject

This commit is contained in:
gdlbo
2022-07-07 19:18:02 +03:00
parent eb659dd453
commit 4498d231ad
4 changed files with 110 additions and 31 deletions
@@ -23,21 +23,7 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment{
prefs();
}
public boolean apply(Preference preference, Object obj){
if((Boolean) obj){
componentSwitcher("VTIconDefault", false);
componentSwitcher("VTIconVK", true);
} else {
componentSwitcher("VTIconDefault", true);
componentSwitcher("VTIconVK", false);
}
ToastUtils.a(Globals.getString("iconapplying"));
return true;
}
private void prefs(){
findPreference("iconvk").setOnPreferenceChangeListener(new a());
findPreference("navbar").setOnPreferenceClickListener(new restart());
}
@@ -48,11 +34,4 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment{
return true;
}
}
public class a implements Preference.OnPreferenceChangeListener{
@Override
public boolean onPreferenceChange(Preference preference, Object obj){
return ThemesFragment.this.apply(preference, obj);
}
}
}
@@ -58,10 +58,10 @@ public class IconManager{
if(getCurrComponent == iconComponent + appNameComponent || availablecomponentsList.get(iconComponent + appNameComponent) == null) return; // check if current component is equal to custom value or if custom value is not exist
componentSwitcher("id." + getCurrComponent, false); // disable current component to prevent conflict with custom value
componentSwitcher("id" + getCurrComponent, false); // disable current component to prevent conflict with custom value
edit().putInt("component_enabled", iconComponent + appNameComponent).commit(); // save custom value
componentSwitcher("id." + iconComponent + appNameComponent, true); // enable custom value
componentSwitcher("id" + iconComponent + appNameComponent, true); // enable custom value
}
}