Skip to content

Commit

Permalink
Revert "[VXP]: delete IO redirect UI."
Browse files Browse the repository at this point in the history
This reverts commit 8fa50f0
  • Loading branch information
tiann committed Jun 29, 2018
1 parent 3bf8d01 commit 3f84f0c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
Expand Down Expand Up @@ -140,6 +141,16 @@ private void showContextMenu(AppManageInfo appManageInfo, View anchor) {
}
PopupMenu popupMenu = new PopupMenu(this, anchor);
popupMenu.inflate(R.menu.app_manage_menu);
MenuItem redirectMenu = popupMenu.getMenu().findItem(R.id.action_redirect);

try {
final String packageName = appManageInfo.pkgName;
final int userId = appManageInfo.userId;
boolean virtualStorageEnable = VirtualStorageManager.get().isVirtualStorageEnable(packageName, userId);
redirectMenu.setTitle(virtualStorageEnable ? R.string.app_manage_redirect_off : R.string.app_manage_redirect_on);
} catch (Throwable e) {
redirectMenu.setVisible(false);
}

popupMenu.setOnMenuItemClickListener(item -> {
switch (item.getItemId()) {
Expand All @@ -149,6 +160,9 @@ private void showContextMenu(AppManageInfo appManageInfo, View anchor) {
case R.id.action_repair:
showRepairDialog(appManageInfo);
break;
case R.id.action_redirect:
showStorageRedirectDialog(appManageInfo);
break;
}
return false;
});
Expand Down
5 changes: 5 additions & 0 deletions VirtualApp/app/src/main/res/menu/app_manage_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@
android:title="@string/app_manage_repair"
app:showAsAction="always" />

<item
android:id="@+id/action_redirect"
android:orderInCategory="100"
android:title="@string/app_manage_redirect_on"
app:showAsAction="withText" />
</menu>

0 comments on commit 3f84f0c

Please sign in to comment.