diff --git a/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/AppDrawerX.java b/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/AppDrawerX.java index 036519e..1a544c7 100644 --- a/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/AppDrawerX.java +++ b/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/AppDrawerX.java @@ -643,69 +643,6 @@ public class AppDrawerX extends Dashboard implements EditTextIme.OnEditTextImeLi addAppsFromPage(mDrawerPage, items, mAllDrawerPageIDs); Collections.sort(items, Utils.sItemComparatorByLastUpdateTime); break; - - case Utils.LAYOUT_MODE_RUNNING: - all_items = new ArrayList(); - items = new ArrayList(); - addAppsFromPage(mDrawerPage, all_items, mAllDrawerPageIDs); - am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); -// pm = getPackageManager(); - List running = am.getRunningAppProcesses(); - for (ActivityManager.RunningAppProcessInfo info : running) { - -// if(info.importance==ActivityManager.RunningAppProcessInfo.IMPORTANCE_EMPTY) continue; -// if(info.importance==ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE) continue; -// if(info.importance==ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND) continue; - for (String pkg : info.pkgList) { - Item i = findItemByComponent(all_items, pkg, null); - if (i != null && findItemByComponent(items, pkg, null) == null) { - items.add(i); - } - -// try { -// ApplicationInfo ai = pm.getApplicationInfo(pkg, 0); -// Bitmap icon = ((BitmapDrawable)pm.getApplicationIcon(ai)).getBitmap(); -// String label = pm.getApplicationLabel(ai).toString(); -// Item i = findItemByComponent(items, pkg); -// if(i==null) { -// Shortcut s = new Shortcut(); -// Intent intent = new Intent(); -// intent.setComponent(new ComponentName(pkg, "")); -// s.init(this, Utils.findFreeItemId(items, Utils.APP_DRAWER_PAGE), new Rect(), null, label, intent, mPageConfig); -// s.buildView(this, icon_dir, icon); -// items.add(s); -// } -// } catch (Exception e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } - -// Log.i("XXX", info+" "+pkg); -// Item i = findItemByComponent(all_items, pkg); -// if(i == null) { -// // TODO add dummy item ? -// } else { -// items.add(i); -// } - } - } -// List running = am.getRunningTasks(100); -// for(ActivityManager.RunningTaskInfo info : running) { -// Item i = findItemByComponent(all_items, info.baseActivity.getPackageName()); -// if(i == null) { -// // TODO add dummy item ? -// } else { -// items.add(i); -// } -// } - for (Item i : all_items) { - if (!(i instanceof Shortcut)) { - items.add(i); - } - } - - Collections.sort(items, Utils.sItemComparatorByNameAsc); - break; } @@ -754,11 +691,6 @@ public class AppDrawerX extends Dashboard implements EditTextIme.OnEditTextImeLi icon_text = "T"; label_res_id = R.string.mi_mode_recently_updated; break; - - case Utils.LAYOUT_MODE_RUNNING: - icon_text = "S"; - label_res_id = R.string.mi_mode_running; - break; } mModeIcon.setText(icon_text); ((TextView) findViewById(R.id.drawer_mode_value)).setText(label_res_id); @@ -1190,8 +1122,6 @@ public class AppDrawerX extends Dashboard implements EditTextIme.OnEditTextImeLi addBubbleItem(R.id.mi_mode_recent_apps, R.string.mi_mode_recent_apps); if (hasMode(Utils.LAYOUT_MODE_RECENTLY_UPDATED)) addBubbleItem(R.id.mi_mode_recently_updated, R.string.mi_mode_recently_updated); - if (hasMode(Utils.LAYOUT_MODE_RUNNING)) - addBubbleItem(R.id.mi_mode_running, R.string.mi_mode_running); } else { super.configureBubbleForContainer(mode, il); } @@ -1337,7 +1267,7 @@ public class AppDrawerX extends Dashboard implements EditTextIme.OnEditTextImeLi break; case R.id.mi_es_refresh: - if (mLayoutMode == Utils.LAYOUT_MODE_RECENT_APPS || mLayoutMode == Utils.LAYOUT_MODE_RUNNING) { + if (mLayoutMode == Utils.LAYOUT_MODE_RECENT_APPS) { setLayoutMode(mLayoutMode, true); } else { refreshAppDrawerItems(true); @@ -1377,11 +1307,6 @@ public class AppDrawerX extends Dashboard implements EditTextIme.OnEditTextImeLi setLayoutModeAnimated(Utils.LAYOUT_MODE_RECENTLY_UPDATED); break; - case R.id.mi_mode_running: - if (mEditMode) leaveEditMode(); - setLayoutModeAnimated(Utils.LAYOUT_MODE_RUNNING); - break; - case R.id.mi_hide_unhide: ArrayList itemViews = getActionItemViews(); mUndoStack.storeGroupStart(); @@ -1416,15 +1341,7 @@ public class AppDrawerX extends Dashboard implements EditTextIme.OnEditTextImeLi if (LLApp.get().isFreeVersion()) { LLApp.get().showFeatureLockedDialog(this); } else { - // use super class behavior but in addition, trigger a refresh if in running view - mHandler.postDelayed(new Runnable() { - @Override - public void run() { - if (mLayoutMode == Utils.LAYOUT_MODE_RUNNING) { - setLayoutMode(Utils.LAYOUT_MODE_RUNNING, true); - } - } - }, 2000); + // use super class behavior super.onClick(v); } break; diff --git a/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/Customize.java b/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/Customize.java index c91e47e..77328f0 100644 --- a/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/Customize.java +++ b/app/llx/app/src/main/java/net/pierrox/lightning_launcher/activities/Customize.java @@ -492,7 +492,6 @@ public class Customize extends ResourceWrapperActivity implements private LLPreferenceCheckBox mPGADModeFrequentlyUsed; private LLPreferenceCheckBox mPGADModeRecentApps; private LLPreferenceCheckBox mPGADModeRecentlyUpdated; - private LLPreferenceCheckBox mPGADModeRunning; private LLPreference mPGMisc; private LLPreferenceList mPGMiscScreenOrientation; private LLPreferenceCheckBox mPGMiscSwapItems; @@ -1629,7 +1628,6 @@ public class Customize extends ResourceWrapperActivity implements mPreferencesPageADModes.add(mPGADModeByName = new LLPreferenceCheckBox(this, 0, R.string.mi_mode_by_name, 0, Utils.hasAppDrawerMode(modes, Utils.LAYOUT_MODE_BY_NAME), null)); mPreferencesPageADModes.add(mPGADModeFrequentlyUsed = new LLPreferenceCheckBox(this, 0, R.string.mi_mode_frequently_used, 0, Utils.hasAppDrawerMode(modes, Utils.LAYOUT_MODE_FREQUENTLY_USED), null)); mPreferencesPageADModes.add(mPGADModeRecentlyUpdated = new LLPreferenceCheckBox(this, 0, R.string.mi_mode_recently_updated, 0, Utils.hasAppDrawerMode(modes, Utils.LAYOUT_MODE_RECENTLY_UPDATED), null)); - mPreferencesPageADModes.add(mPGADModeRunning = new LLPreferenceCheckBox(this, 0, R.string.mi_mode_running, 0, Utils.hasAppDrawerMode(modes, Utils.LAYOUT_MODE_RUNNING), null)); } if ((!is_folder_page && !is_embedded_folder_page) || mSystemConfig.expertMode) { @@ -2034,7 +2032,6 @@ public class Customize extends ResourceWrapperActivity implements modes |= (1 << Utils.LAYOUT_MODE_RECENT_APPS); if (mPGADModeRecentlyUpdated.isChecked()) modes |= (1 << Utils.LAYOUT_MODE_RECENTLY_UPDATED); - if (mPGADModeRunning.isChecked()) modes |= (1 << Utils.LAYOUT_MODE_RUNNING); return modes; } diff --git a/app/llx/core/src/main/java/net/pierrox/lightning_launcher/data/Utils.java b/app/llx/core/src/main/java/net/pierrox/lightning_launcher/data/Utils.java index c46c568..4b4507e 100644 --- a/app/llx/core/src/main/java/net/pierrox/lightning_launcher/data/Utils.java +++ b/app/llx/core/src/main/java/net/pierrox/lightning_launcher/data/Utils.java @@ -111,8 +111,7 @@ public class Utils { public static final int LAYOUT_MODE_FREQUENTLY_USED = 2; public static final int LAYOUT_MODE_RECENT_APPS = 3; public static final int LAYOUT_MODE_RECENTLY_UPDATED = 4; - public static final int LAYOUT_MODE_RUNNING = 5; - public static final int LAYOUT_MODE_LAST = LAYOUT_MODE_RUNNING; + public static final int LAYOUT_MODE_LAST = LAYOUT_MODE_RECENTLY_UPDATED; public static final Collator sItemNameCollator = Collator.getInstance(Locale.getDefault()); public static final Comparator sItemComparatorByNameAsc = new Comparator() { diff --git a/app/llx/core/src/main/res/values/strings.xml b/app/llx/core/src/main/res/values/strings.xml index f7a6800..75cf132 100644 --- a/app/llx/core/src/main/res/values/strings.xml +++ b/app/llx/core/src/main/res/values/strings.xml @@ -525,7 +525,6 @@ Recently launched Recently updated Used often -Currently running Edit layout Refresh Settingsā€¦