Skip to content

Commit 51ae555

Browse files
committed
AppUtils: use SummaryAdapter from OneplusUI
1 parent fccf54b commit 51ae555

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

app/src/main/java/it/dhd/oxygencustomizer/utils/AppUtils.java

+16-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.ArrayList;
2525
import java.util.List;
2626

27+
import it.dhd.oneplusui.appcompat.dialog.adapter.SummaryAdapter;
2728
import it.dhd.oxygencustomizer.BuildConfig;
2829
import it.dhd.oxygencustomizer.R;
2930
import it.dhd.oxygencustomizer.xposed.utils.BootLoopProtector;
@@ -42,18 +43,29 @@ public static boolean isAppInstalled(Context context, String packageName) {
4243
}
4344

4445
public static void restartScopes(Context context, String[] scopes) {
45-
String[] list = new String[]{
46+
CharSequence[] list = new String[]{
4647
context.getString(R.string.restart_module),
4748
context.getString(R.string.restart_page_scope)
4849
};
50+
SummaryAdapter mAdapter = new SummaryAdapter(context, false, true, list, null, null);
4951

5052
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
51-
builder.setItems(list, (dialog, which) -> {
53+
builder.setAdapter(mAdapter, (dialog, which) -> {
5254
switch (which) {
53-
case 0 -> restartAllScope(context);
54-
case 1 -> restartAllScope(scopes);
55+
case 0:
56+
restartAllScope(context);
57+
break;
58+
case 1:
59+
restartAllScope(scopes);
60+
break;
5561
}
5662
});
63+
// builder.setItems(list, (dialog, which) -> {
64+
// switch (which) {
65+
// case 0 -> restartAllScope(context);
66+
// case 1 -> restartAllScope(scopes);
67+
// }
68+
// });
5769
builder.show();
5870
}
5971

0 commit comments

Comments
 (0)