Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 4ce22b2

Browse files
committed
Make error messages about magisk or root redirect to Magisk GitHub
1 parent f9e9559 commit 4ce22b2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

app/src/main/java/com/fox2code/mmm/NotificationType.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ public boolean shouldRemove() {
3131
return !MainApplication.isShowcaseMode();
3232
}
3333
},
34-
NO_ROOT(R.string.fail_root_magisk, R.drawable.ic_baseline_numbers_24) {
34+
NO_ROOT(R.string.fail_root_magisk, R.drawable.ic_baseline_numbers_24, v -> {
35+
IntentHelper.openUrl(v.getContext(), "https://github.com/topjohnwu/Magisk");
36+
}) {
3537
@Override
3638
public boolean shouldRemove() {
3739
return InstallerInitializer.peekMagiskPath() != null;
3840
}
3941
},
40-
MAGISK_OUTDATED(R.string.magisk_outdated, R.drawable.ic_baseline_update_24) {
42+
MAGISK_OUTDATED(R.string.magisk_outdated, R.drawable.ic_baseline_update_24, v -> {
43+
IntentHelper.openUrl(v.getContext(), "https://github.com/topjohnwu/Magisk");
44+
}) {
4145
@Override
4246
public boolean shouldRemove() {
4347
return InstallerInitializer.peekMagiskPath() == null ||
@@ -128,7 +132,11 @@ public boolean shouldRemove() {
128132
public final boolean special;
129133

130134
NotificationType(@StringRes int textId, int iconId) {
131-
this(textId, iconId, R.attr.colorError, R.attr.colorOnPrimary); //R.attr.colorOnError);
135+
this(textId, iconId, R.attr.colorError, R.attr.colorOnPrimary);
136+
}
137+
138+
NotificationType(@StringRes int textId, int iconId, View.OnClickListener onClickListener) {
139+
this(textId, iconId, R.attr.colorError, R.attr.colorOnPrimary, onClickListener);
132140
}
133141

134142
NotificationType(@StringRes int textId, int iconId, int backgroundAttr, int foregroundAttr) {

0 commit comments

Comments
 (0)