diff --git a/app/src/main/java/io/github/chipppppppppp/lime/Main.java b/app/src/main/java/io/github/chipppppppppp/lime/Main.java index 5c35fb3f..d9b359b3 100644 --- a/app/src/main/java/io/github/chipppppppppp/lime/Main.java +++ b/app/src/main/java/io/github/chipppppppppp/lime/Main.java @@ -1,5 +1,7 @@ package io.github.chipppppppppp.lime; +import java.lang.reflect.Method; + import android.app.Activity; import android.app.Application; import android.app.Notification; @@ -9,9 +11,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.drawable.Drawable; -import android.graphics.drawable.GradientDrawable; import android.net.Uri; import android.support.customtabs.CustomTabsIntent; import android.view.Gravity; @@ -21,7 +20,6 @@ import android.webkit.WebView; import android.widget.Button; import android.widget.FrameLayout; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.Switch; @@ -29,9 +27,6 @@ import android.app.AndroidAppHelper; import android.content.res.XModuleResources; - -import java.lang.reflect.Method; - import de.robv.android.xposed.IXposedHookInitPackageResources; import de.robv.android.xposed.IXposedHookLoadPackage; import de.robv.android.xposed.IXposedHookZygoteInit; @@ -62,6 +57,7 @@ private LimeOption(String name, int id, boolean checked) { public LimeOption deleteVoom = new LimeOption("delete_voom", R.string.switch_delete_voom, true); public LimeOption deleteWallet = new LimeOption("delete_wallet", R.string.switch_delete_wallet, true); + public LimeOption deleteNewsOrCall = new LimeOption("delete_news_or_call", R.string.switch_delete_news_or_call, true); public LimeOption distributeEvenly = new LimeOption("distribute_evenly", R.string.switch_distribute_evenly, true); public LimeOption deleteIconLabels = new LimeOption("delete_icon_labels", R.string.switch_delete_icon_labels, true); public LimeOption deleteAds = new LimeOption("delete_ads", R.string.switch_delete_ads, true); @@ -71,7 +67,7 @@ private LimeOption(String name, int id, boolean checked) { public LimeOption openInBrowser = new LimeOption("open_in_browser", R.string.switch_open_in_browser, false); public LimeOption preventMarkAsRead = new LimeOption("prevent_mark_as_read", R.string.switch_prevent_mark_as_read, false); public LimeOption preventUnsendMessage = new LimeOption("prevent_unsend_message", R.string.switch_prevent_unsend_message, false); - public static final int size = 11; + public static final int size = 12; LimeOption getByIndex(int idx) { switch (idx) { @@ -80,22 +76,24 @@ LimeOption getByIndex(int idx) { case 1: return deleteWallet; case 2: - return distributeEvenly; + return deleteNewsOrCall; case 3: - return deleteIconLabels; + return distributeEvenly; case 4: - return deleteAds; + return deleteIconLabels; case 5: - return deleteRecommendation; + return deleteAds; case 6: - return deleteReplyMute; + return deleteRecommendation; case 7: - return redirectWebView; + return deleteReplyMute; case 8: - return openInBrowser; + return redirectWebView; case 9: - return preventMarkAsRead; + return openInBrowser; case 10: + return preventMarkAsRead; + case 11: return preventUnsendMessage; default: throw new IllegalArgumentException("Invalid index: " + idx); @@ -242,6 +240,18 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { activity.findViewById(walletSpacerResId).setVisibility(View.GONE); } } + if (limeOptions.deleteNewsOrCall.checked) { + int newsResId = activity.getResources().getIdentifier("bnb_news", "id", activity.getPackageName()); + activity.findViewById(newsResId).setVisibility(View.GONE); + int callResId = activity.getResources().getIdentifier("bnb_call", "id", activity.getPackageName()); + activity.findViewById(callResId).setVisibility(View.GONE); + if (limeOptions.distributeEvenly.checked) { + int newsSpacerResId = activity.getResources().getIdentifier("bnb_news_spacer", "id", activity.getPackageName()); + activity.findViewById(newsSpacerResId).setVisibility(View.GONE); + int callSpacerResId = activity.getResources().getIdentifier("bnb_call_spacer", "id", activity.getPackageName()); + activity.findViewById(callSpacerResId).setVisibility(View.GONE); + } + } } }); diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 385f31ed..1ca7bffd 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -12,6 +12,7 @@ アプリの再起動が必要です VOOM アイコンを削除 ウォレットアイコンを削除 + ニュースまたは通話アイコンを削除 ボトムバーのアイコンを均等に配置 ボトムバーのアイコンのラベルを削除 広告を削除 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 65d46c3b..3b73ec6d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,7 +11,8 @@ OK You need to restart the app Delete the VOOM icon - Delete the Wallet icon + Delete the wallet icon + Delete the news or call icon Distribute the icons on the bottom bar evenly Delete the icon labels on the bottom bar Delete ads