Refactor, cleanup, backstack works

This commit is contained in:
d8ahazard
2016-09-23 16:22:11 -05:00
parent 3706b53e65
commit 3de13a4d9e
25 changed files with 242 additions and 138 deletions
@@ -55,7 +55,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
if (null == view) {
LayoutInflater layoutInflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = layoutInflater.inflate(R.layout.app_list_row, null);
view = layoutInflater.inflate(R.layout.list_item_app, null);
}
ApplicationInfo applicationInfo = appsList.get(position);
@@ -81,7 +81,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
if (null == view) {
LayoutInflater layoutInflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = layoutInflater.inflate(R.layout.app_list_row, null);
view = layoutInflater.inflate(R.layout.list_item_app, null);
}
ApplicationInfo applicationInfo = appsList.get(position);
if (null != applicationInfo) {
@@ -97,9 +97,9 @@ public class Utils {
return Boolean.parseBoolean(ret.get(0));
}
public static boolean autoRootEnabled(Context context) {
public static boolean autoToggleEnabled(Context context) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
Log.d("Magisk", "AutoRootEnableCheck is " + preferences.getBoolean("autoRootEnable", false));
Logger.dh("Utils: AutoRootEnableCheck is " + preferences.getBoolean("autoRootEnable", false));
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("autoRootEnable", false);
}
@@ -232,7 +232,7 @@ public class Utils {
int mIcon;
switch (mRootsState) {
case 2:
mLabelString = "Auto-root";
mLabelString = mContext.getString(R.string.auto_toggle);
mIcon = mAutoRootIcon;
intent = autoBroadcast;
break;
@@ -360,7 +360,7 @@ public class Utils {
// 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root
public static int CheckRootsState(Context mContext) {
if (autoRootEnabled(mContext)) {
if (autoToggleEnabled(mContext)) {
return 2;
} else {
if (rootEnabled()) {