mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-14 05:47:07 -08:00
Refactor, cleanup, backstack works
This commit is contained in:
@@ -10,7 +10,6 @@ import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -47,12 +46,28 @@ public class AutoRootFragment extends ListFragment {
|
||||
}
|
||||
|
||||
view.setPadding(horizontalMargin, actionBarHeight, horizontalMargin, verticalMargin);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initializeElements();
|
||||
super.onResume();
|
||||
getActivity().setTitle("Auto-toggle");
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initializeElements() {
|
||||
listView = getListView();
|
||||
packageManager = getActivity().getPackageManager();
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
@@ -68,13 +83,6 @@ public class AutoRootFragment extends ListFragment {
|
||||
new LoadApplications().execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
new LoadApplications().execute();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||
Logger.dh("Click");
|
||||
@@ -128,7 +136,6 @@ public class AutoRootFragment extends ListFragment {
|
||||
public class CustomComparator implements Comparator<ApplicationInfo> {
|
||||
@Override
|
||||
public int compare(ApplicationInfo o1, ApplicationInfo o2) {
|
||||
packageManager = getActivity().getPackageManager();
|
||||
return o1.loadLabel(packageManager).toString().compareToIgnoreCase(o2.loadLabel(packageManager).toString());
|
||||
}
|
||||
}
|
||||
@@ -140,7 +147,7 @@ public class AutoRootFragment extends ListFragment {
|
||||
protected Void doInBackground(Void... params) {
|
||||
applist = checkForLaunchIntent(packageManager.getInstalledApplications(PackageManager.GET_META_DATA));
|
||||
listadaptor = new ApplicationAdapter(getActivity(),
|
||||
R.layout.app_list_row, applist);
|
||||
R.layout.list_item_app, applist);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user