Loading res/menu/activity.xml +4 −0 Original line number Diff line number Diff line Loading @@ -80,5 +80,9 @@ android:title="@string/menu_inspect" android:visible="false" app:showAsAction="never"/> <item android:id="@+id/option_menu_launcher" android:visible="false" app:showAsAction="never"/> </group> </menu> src/com/android/documentsui/AbstractActionHandler.java +16 −0 Original line number Diff line number Diff line Loading @@ -21,9 +21,11 @@ import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.SharedMinimal.DEBUG; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentSender; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.database.Cursor; import android.net.Uri; Loading Loading @@ -452,6 +454,20 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA mActivity.getWindow().setStatusBarColor(colors[1]); } @Override public void switchLauncherIcon() { PackageManager pm = mActivity.getPackageManager(); if (pm != null) { final boolean enalbled = Shared.isLauncherEnabled(mActivity); ComponentName component = new ComponentName( mActivity.getPackageName(), Shared.LAUNCHER_TARGET_CLASS); pm.setComponentEnabledSetting(component, enalbled ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED : PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } } @Override public void cutToClipboard() { throw new UnsupportedOperationException("Cut not supported!"); Loading src/com/android/documentsui/ActionHandler.java +5 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,11 @@ public interface ActionHandler { void showSortDialog(); /** * Switch launch icon show/hide status. */ void switchLauncherIcon(); /** * Allow action handler to be initialized in a new scope. * @return this Loading src/com/android/documentsui/BaseActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -477,6 +477,10 @@ public abstract class BaseActivity getInjector().actions.showSortDialog(); return true; case R.id.option_menu_launcher: getInjector().actions.switchLauncherIcon(); return true; case R.id.sub_menu_grid: setViewMode(State.MODE_GRID); return true; Loading src/com/android/documentsui/MenuManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public abstract class MenuManager { updateDebug(mOptionMenu.findItem(R.id.option_menu_debug)); updateInspect(mOptionMenu.findItem(R.id.option_menu_inspect)); updateSort(mOptionMenu.findItem(R.id.option_menu_sort)); updateLauncher(mOptionMenu.findItem(R.id.option_menu_launcher)); Menus.disableHiddenItems(mOptionMenu); mSearchManager.updateMenu(); Loading Loading @@ -364,6 +365,10 @@ public abstract class MenuManager { open.setVisible(false); } protected void updateLauncher(MenuItem launcher) { launcher.setVisible(false); } protected abstract void updateSelectAll(MenuItem selectAll); protected abstract void updateSelectAll(MenuItem selectAll, SelectionDetails selectionDetails); protected abstract void updateDeselectAll( Loading Loading
res/menu/activity.xml +4 −0 Original line number Diff line number Diff line Loading @@ -80,5 +80,9 @@ android:title="@string/menu_inspect" android:visible="false" app:showAsAction="never"/> <item android:id="@+id/option_menu_launcher" android:visible="false" app:showAsAction="never"/> </group> </menu>
src/com/android/documentsui/AbstractActionHandler.java +16 −0 Original line number Diff line number Diff line Loading @@ -21,9 +21,11 @@ import static com.android.documentsui.base.DocumentInfo.getCursorString; import static com.android.documentsui.base.SharedMinimal.DEBUG; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentSender; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.database.Cursor; import android.net.Uri; Loading Loading @@ -452,6 +454,20 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA mActivity.getWindow().setStatusBarColor(colors[1]); } @Override public void switchLauncherIcon() { PackageManager pm = mActivity.getPackageManager(); if (pm != null) { final boolean enalbled = Shared.isLauncherEnabled(mActivity); ComponentName component = new ComponentName( mActivity.getPackageName(), Shared.LAUNCHER_TARGET_CLASS); pm.setComponentEnabledSetting(component, enalbled ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED : PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } } @Override public void cutToClipboard() { throw new UnsupportedOperationException("Cut not supported!"); Loading
src/com/android/documentsui/ActionHandler.java +5 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,11 @@ public interface ActionHandler { void showSortDialog(); /** * Switch launch icon show/hide status. */ void switchLauncherIcon(); /** * Allow action handler to be initialized in a new scope. * @return this Loading
src/com/android/documentsui/BaseActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -477,6 +477,10 @@ public abstract class BaseActivity getInjector().actions.showSortDialog(); return true; case R.id.option_menu_launcher: getInjector().actions.switchLauncherIcon(); return true; case R.id.sub_menu_grid: setViewMode(State.MODE_GRID); return true; Loading
src/com/android/documentsui/MenuManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public abstract class MenuManager { updateDebug(mOptionMenu.findItem(R.id.option_menu_debug)); updateInspect(mOptionMenu.findItem(R.id.option_menu_inspect)); updateSort(mOptionMenu.findItem(R.id.option_menu_sort)); updateLauncher(mOptionMenu.findItem(R.id.option_menu_launcher)); Menus.disableHiddenItems(mOptionMenu); mSearchManager.updateMenu(); Loading Loading @@ -364,6 +365,10 @@ public abstract class MenuManager { open.setVisible(false); } protected void updateLauncher(MenuItem launcher) { launcher.setVisible(false); } protected abstract void updateSelectAll(MenuItem selectAll); protected abstract void updateSelectAll(MenuItem selectAll, SelectionDetails selectionDetails); protected abstract void updateDeselectAll( Loading