Set ranks in case cannot show all

This commit is contained in:
topjohnwu 2018-04-22 14:03:10 +08:00
parent 920fc5ae99
commit 267395bfa2

View File

@ -46,6 +46,7 @@ public class ShortcutReceiver extends BroadcastReceiver {
.setAction(Intent.ACTION_VIEW) .setAction(Intent.ACTION_VIEW)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK))
.setIcon(Icon.createWithResource(mm, R.drawable.sc_superuser)) .setIcon(Icon.createWithResource(mm, R.drawable.sc_superuser))
.setRank(0)
.build()); .build());
} }
if (Shell.rootAccess() && mm.magiskVersionCode >= Const.MAGISK_VER.UNIFIED if (Shell.rootAccess() && mm.magiskVersionCode >= Const.MAGISK_VER.UNIFIED
@ -57,6 +58,7 @@ public class ShortcutReceiver extends BroadcastReceiver {
.setAction(Intent.ACTION_VIEW) .setAction(Intent.ACTION_VIEW)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK))
.setIcon(Icon.createWithResource(mm, R.drawable.sc_magiskhide)) .setIcon(Icon.createWithResource(mm, R.drawable.sc_magiskhide))
.setRank(1)
.build()); .build());
} }
if (!mm.prefs.getBoolean(Const.Key.COREONLY, false) && if (!mm.prefs.getBoolean(Const.Key.COREONLY, false) &&
@ -68,6 +70,7 @@ public class ShortcutReceiver extends BroadcastReceiver {
.setAction(Intent.ACTION_VIEW) .setAction(Intent.ACTION_VIEW)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK))
.setIcon(Icon.createWithResource(mm, R.drawable.sc_extension)) .setIcon(Icon.createWithResource(mm, R.drawable.sc_extension))
.setRank(3)
.build()); .build());
shortCuts.add(new ShortcutInfo.Builder(mm, "downloads") shortCuts.add(new ShortcutInfo.Builder(mm, "downloads")
.setShortLabel(mm.getString(R.string.download)) .setShortLabel(mm.getString(R.string.download))
@ -76,6 +79,7 @@ public class ShortcutReceiver extends BroadcastReceiver {
.setAction(Intent.ACTION_VIEW) .setAction(Intent.ACTION_VIEW)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)) .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK))
.setIcon(Icon.createWithResource(mm, R.drawable.sc_cloud_download)) .setIcon(Icon.createWithResource(mm, R.drawable.sc_cloud_download))
.setRank(2)
.build()); .build());
} }
return shortCuts; return shortCuts;