24
24
import java .util .ArrayList ;
25
25
import java .util .List ;
26
26
27
+ import it .dhd .oneplusui .appcompat .dialog .adapter .SummaryAdapter ;
27
28
import it .dhd .oxygencustomizer .BuildConfig ;
28
29
import it .dhd .oxygencustomizer .R ;
29
30
import it .dhd .oxygencustomizer .xposed .utils .BootLoopProtector ;
@@ -42,18 +43,29 @@ public static boolean isAppInstalled(Context context, String packageName) {
42
43
}
43
44
44
45
public static void restartScopes (Context context , String [] scopes ) {
45
- String [] list = new String []{
46
+ CharSequence [] list = new String []{
46
47
context .getString (R .string .restart_module ),
47
48
context .getString (R .string .restart_page_scope )
48
49
};
50
+ SummaryAdapter mAdapter = new SummaryAdapter (context , false , true , list , null , null );
49
51
50
52
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder (context );
51
- builder .setItems ( list , (dialog , which ) -> {
53
+ builder .setAdapter ( mAdapter , (dialog , which ) -> {
52
54
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 ;
55
61
}
56
62
});
63
+ // builder.setItems(list, (dialog, which) -> {
64
+ // switch (which) {
65
+ // case 0 -> restartAllScope(context);
66
+ // case 1 -> restartAllScope(scopes);
67
+ // }
68
+ // });
57
69
builder .show ();
58
70
}
59
71
0 commit comments