From 3ea2c1cca1e65d4e3c6f9e00b9f8fd06498d1185 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Wed, 26 Jul 2023 04:21:49 +0800 Subject: [PATCH] feat: add setting entry item icon --- .../java/cc/ioctl/hook/SettingEntryHook.java | 5 ++--- .../mipmap-xxhdpi/ic_qauxv_entry_item_day.png | Bin 0 -> 4489 bytes .../mipmap-xxhdpi/ic_qauxv_entry_item_night.png | Bin 0 -> 4201 bytes 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_qauxv_entry_item_day.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_qauxv_entry_item_night.png diff --git a/app/src/main/java/cc/ioctl/hook/SettingEntryHook.java b/app/src/main/java/cc/ioctl/hook/SettingEntryHook.java index 151742f61a..e3a92f9db1 100644 --- a/app/src/main/java/cc/ioctl/hook/SettingEntryHook.java +++ b/app/src/main/java/cc/ioctl/hook/SettingEntryHook.java @@ -25,7 +25,6 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static io.github.qauxv.util.Initiator.load; -import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -52,6 +51,7 @@ import io.github.qauxv.fragment.FuncStatusDetailsFragment; import io.github.qauxv.hook.BasePersistBackgroundHook; import io.github.qauxv.lifecycle.Parasitics; +import io.github.qauxv.ui.ResUtils; import io.github.qauxv.util.Initiator; import io.github.qauxv.util.LicenseStatus; import io.github.qauxv.util.Log; @@ -127,8 +127,7 @@ private void injectSettingEntryForMainSettingConfigProvider() throws ReflectiveO Class kItemProcessorGroup = result.get(0).getClass(); Constructor ctor = kItemProcessorGroup.getDeclaredConstructor(List.class, CharSequence.class, CharSequence.class); Parasitics.injectModuleResources(ctx.getResources()); - @SuppressLint("DiscouragedApi") - int resId = ctx.getResources().getIdentifier("qui_tuning", "drawable", ctx.getPackageName()); + int resId = ResUtils.isInNightMode() ? R.mipmap.ic_qauxv_entry_item_night : R.mipmap.ic_qauxv_entry_item_day; Object entryItem = ctorSimpleItemProcessor.newInstance(ctx, R.id.setting2Activity_settingEntryItem, "QAuxiliary", resId); Class thatFunction0 = setOnClickListener.getParameterTypes()[0]; Object theUnit = thatFunction0.getClassLoader().loadClass("kotlin.Unit").getField("INSTANCE").get(null); diff --git a/app/src/main/res/mipmap-xxhdpi/ic_qauxv_entry_item_day.png b/app/src/main/res/mipmap-xxhdpi/ic_qauxv_entry_item_day.png new file mode 100644 index 0000000000000000000000000000000000000000..4e83ba01560ef70612de8ad6f9c8d5604c252dfc GIT binary patch literal 4489 zcmbVQ30PA}w!UEzMNm=1Cp%ZFb?T(Pr1*Hd z8|p982LQm3L8tjbPx{m~eHwK4A1HE%9y5gWAPE4>oHupBfMX}%0HFH^ml-Gx^zx*D z0zQVt7KC#!@q8hK1^~y^@j@2J<46(VoJejg6*+kI8WO=}Q;{3(yl`GZS56d{zD>;W z+vd##xA8zS8@bvE;TTVW2>2W+3lYzciIq^|smRZ~6sSGbjYT3pL!>+^(s{}tBGAhR z;VKYw5cU`x8pPr35e{Swn-$Ii!^2l12si>Bi?hYzZP7R!g-E8@+9JMwkdQesJA&d% zTl>`*^hQNSNu@#x78@5AhlwL%1mZ|6o=hfVaRe-ZfQArgNkXiY6_1XUSbk%maU`Ia zE0l5tv4|-~R=7YWr6M7zUwq&TzthG_zQzfP7&e|I#NsiyDW5(A+2D7aP$rJ~Y@7{Z zIWZhQCsrzfu=wv-VU$2BkVFao1NHaee=-2Y*30X=jX%}G=YKaLk-BY#-1r)hKSfKJ z2|^Cmmm?9##309QDY1!AT^5c6%Ne7;FW5C|AsgtZq7;(VJ=6M(X*B$%52Wkaw9AjI*%^2l~}EHWXSfM${LWHgHnQL>1j z1KK_uA3xeyqdkF5jIpOP8^5clUwqm%5&*?*9fm7RpiUgE>HU+2d~aUjzFk|kfvNCXkmIF^{>90|qlFXSQiKgpM{w*GhVe{C_psQP#D|B|== zKk;8f14gl8BRNo^#UiKN!A@1AFAIb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^Zfl7!u`pPhTU~*x7N~h7J_52(Ddl{uRkqZuGnGRe9zKE7I&GEeyy}% z`-e&Rq#k_p!{DyD$A}vaonv)&bWmRo{(k9%J-^*h^1Qz6a(4bt$soLXLBPdLi;vc( zhMsodw;MkeLk@WnBkF~)kFS8AiXTSzWchA(_Dt}OHtiId#k3VZE6*KUnNab5&d!qI z7p47PWb$>2ba~P{5wJQV1|JSG&~LREPGA~&UiCXYZojvoLR-`l@_bpwlM9)Yt3KAD zyG+_W43W*ovmbT}ZmElH(-FuTS;uN1a2e787LVn|+bvlEnCl4beVK7U>+hrniAW1Q zyI6-Evp{aj$nGXJ94u^m)kVKjZ;lwXSFhTDHmWdg&Yv&@u*ya= zX+8KR)VA4kPh4AUZeF!YR#)Ob{VZH<9`Fg?9iSj)`ld1(HhSD6)|i>^IC5CKJ8zK! zUZ{zkCs)-R@$$%zGqu*~@EXzrT2kw>j#N}}k0(FrD}UV~66Md)8_HQw6An}dD|lJH z@K2R%1FH_7$(HvZl5$E5#(x70WMJAh*1KMZ0&A4z{W cp}tv7dTf>(dioJ_>dz8}n>Ve%Wy`LA0Dz=fP5=M^ literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xxhdpi/ic_qauxv_entry_item_night.png b/app/src/main/res/mipmap-xxhdpi/ic_qauxv_entry_item_night.png new file mode 100644 index 0000000000000000000000000000000000000000..d5ed1cff599c3a221f52909f4a65da1c6bfc2d7b GIT binary patch literal 4201 zcmbVQ3p|tU-@j+dp>n1kRC60`wAqHSIfY>pLJ~`uZCDPQZRQa1>ZvA&rwv6RUU^VP zr74uulhdQ365%O2Dk=R56`tPd^m(55{lBOG{rOz?ecjjfy}rN0_51zq>vLy%d%3Mq z)>Q@oU=4*#@|8Ww%S~~m?7rhogPZK3#32Xr0AQ8oa)SWJi`N0b3O$xz06)OfgGgt` zplJ+t7!#cs!;zr@z}6v=L!(DA`LHl%1S{4KoNBoW!dMJDaHpjw#*^dBjAW6MxynV;n5fr9fQHctO#fZE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