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

Commit 5dbee77

Browse files
committed
Fix Androidacy url management bug + add gitlab monochrome icon.
1 parent c95e84f commit 5dbee77

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

app/src/main/java/com/fox2code/mmm/module/ActionButtonType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public void update(Chip button, ModuleHolder moduleHolder) {
3838
@Override
3939
public void doAction(Chip button, ModuleHolder moduleHolder) {
4040
String notesUrl = moduleHolder.repoModule.notesUrl;
41-
if (notesUrl.startsWith("https://api.androidacy.com/magisk/readme/?module=") ||
42-
notesUrl.startsWith("https://www.androidacy.com/")) {
41+
if (AndroidacyUtil.isAndroidacyLink(notesUrl)) {
4342
IntentHelper.openUrlAndroidacy(button.getContext(), notesUrl, false,
4443
moduleHolder.repoModule.moduleInfo.name,
4544
moduleHolder.getMainModuleConfig());
@@ -85,8 +84,7 @@ public void doAction(Chip button, ModuleHolder moduleHolder) {
8584
String updateZipUrl = moduleHolder.getUpdateZipUrl();
8685
if (updateZipUrl == null) return;
8786
// Androidacy manage the selection between download and install
88-
if (updateZipUrl.startsWith("https://www.androidacy.com/") ||
89-
updateZipUrl.startsWith("https://api.androidacy.com/magisk/info/?module=")) {
87+
if (AndroidacyUtil.isAndroidacyLink(updateZipUrl)) {
9088
IntentHelper.openUrlAndroidacy(
9189
button.getContext(), updateZipUrl, true,
9290
moduleInfo.name, moduleInfo.config);
@@ -248,6 +246,8 @@ public static int supportIconForUrl(String url) {
248246
icon = R.drawable.ic_baseline_discord_24;
249247
} else if (url.startsWith("https://github.com/")) {
250248
icon = R.drawable.ic_github;
249+
} else if (url.startsWith("https://gitlab.com/")) {
250+
icon = R.drawable.ic_gitlab;
251251
} else if (url.startsWith("https://forum.xda-developers.com/")) {
252252
icon = R.drawable.ic_xda;
253253
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="24dp"
4+
android:height="24dp"
5+
android:viewportWidth="25"
6+
android:viewportHeight="25"
7+
android:tint="?attr/colorControlNormal">
8+
<path
9+
android:fillColor="@android:color/white"
10+
android:pathData="m24.507 9.5-0.034-0.09L21.082 0.562a0.896 0.896 0 0 0-1.694 0.091l-2.29 7.01H7.825L5.535 0.653a0.898 0.898 0 0 0-1.694-0.09L 0.451 9.411 0.416 9.5a6.297 6.297 0 0 0 2.09 7.278l0.012 0.01 0.03 0.022 5.16 3.867 2.56 1.935 1.554 1.176a1.051 1.051 0 0 0 1.268 0l1.555-1.176 2.56-1.935 5.197-3.89 0.014-0.01A6.297 6.297 0 0 0 24.507 9.5Z" />
11+
</vector>

0 commit comments

Comments
 (0)