Skip to content

Commit 2a48dab

Browse files
committed
fix: Shortcut context menu icon background abnormality when added to the launcher in the new version
1 parent 1bc6dc7 commit 2a48dab

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

library/hook/src/main/java/com/sevtinge/hyperceiler/hook/module/rules/home/other/FreeformShortcutMenu.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
import com.sevtinge.hyperceiler.hook.R;
4040
import com.sevtinge.hyperceiler.hook.module.base.BaseHook;
41+
import com.sevtinge.hyperceiler.hook.utils.api.ProjectApi;
4142

4243
import java.util.ArrayList;
4344
import java.util.List;
@@ -168,7 +169,7 @@ class ItemConfigurer {
168169
void configure(Object instance, int titleResId, String drawableName) {
169170
if (instance == null) return;
170171
callMethod(instance, "setShortTitle", modRes.getString(titleResId));
171-
int resId = mContext.getResources().getIdentifier(drawableName, "drawable", mContext.getPackageName());
172+
int resId = modRes.getIdentifier(drawableName, "drawable", ProjectApi.mAppModulePkg);
172173
Drawable d = resId != 0 ? ContextCompat.getDrawable(mContext, resId) : null;
173174
if (d != null) {
174175
Drawable wrapped = DrawableCompat.wrap(d).mutate();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:height="28dp"
4+
android:width="28dp"
5+
android:viewportWidth="28.0"
6+
android:viewportHeight="28.0">
7+
<group>
8+
<clip-path android:pathData="M0,0h28v28h-28z" />
9+
<path
10+
android:fillColor="#FF000000"
11+
android:pathData="M3.75,13.95C3.75,13.635 3.75,13.478 3.812,13.358C3.865,13.252 3.951,13.166 4.057,13.112C4.177,13.05 4.335,13.05 4.649,13.05L13.05,13.05L13.05,4.65C13.05,4.335 13.05,4.177 13.111,4.057C13.165,3.951 13.252,3.866 13.357,3.812C13.478,3.751 13.635,3.75 13.949,3.75L14.051,3.75C14.366,3.75 14.523,3.751 14.644,3.812C14.749,3.866 14.835,3.952 14.889,4.057C14.95,4.177 14.95,4.335 14.95,4.65L14.95,13.05L23.351,13.05C23.665,13.05 23.823,13.05 23.943,13.112C24.049,13.166 24.135,13.252 24.188,13.358C24.25,13.478 24.25,13.635 24.25,13.95L24.25,14.051C24.25,14.366 24.25,14.524 24.188,14.644C24.135,14.749 24.049,14.835 23.943,14.889C23.823,14.95 23.665,14.951 23.351,14.951L14.95,14.951L14.95,23.351C14.95,23.666 14.95,23.823 14.889,23.944C14.835,24.049 14.749,24.135 14.644,24.189C14.523,24.25 14.366,24.25 14.051,24.25L13.949,24.25C13.635,24.25 13.478,24.25 13.357,24.189C13.252,24.135 13.165,24.049 13.111,23.944C13.05,23.823 13.05,23.666 13.05,23.351L13.05,14.951L4.649,14.951C4.335,14.951 4.177,14.95 4.057,14.889C3.951,14.835 3.865,14.749 3.812,14.644C3.75,14.524 3.75,14.366 3.75,14.051L3.75,13.95Z"
12+
android:fillAlpha="0.8" />
13+
</group>
14+
</vector>
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:height="28dp"
4+
android:width="28dp"
5+
android:viewportWidth="28.0"
6+
android:viewportHeight="28.0">
7+
<path
8+
android:fillColor="#FF000000"
9+
android:pathData="M16.39,3.246C18.592,3.246 19.694,3.246 20.538,3.668C21.313,4.055 21.941,4.683 22.328,5.458C22.75,6.302 22.75,7.404 22.75,9.607L22.75,17.886C22.75,20.088 22.75,21.19 22.328,22.034C21.941,22.809 21.313,23.437 20.538,23.824C19.694,24.246 18.592,24.246 16.39,24.246L11.61,24.246C9.408,24.246 8.306,24.246 7.462,23.824C6.687,23.437 6.059,22.809 5.672,22.034C5.25,21.19 5.25,20.088 5.25,17.886L5.25,9.607C5.25,7.404 5.25,6.302 5.672,5.458C6.059,4.683 6.687,4.055 7.462,3.668C8.306,3.246 9.408,3.246 11.61,3.246L16.39,3.246ZM10.707,5.046C9.441,5.046 8.808,5.047 8.322,5.289C7.877,5.512 7.516,5.873 7.293,6.318C7.05,6.804 7.05,7.437 7.05,8.703L7.05,18.789C7.05,20.056 7.05,20.688 7.293,21.174C7.516,21.619 7.877,21.981 8.322,22.203C8.808,22.446 9.441,22.446 10.707,22.446L17.293,22.446C18.559,22.446 19.192,22.446 19.678,22.203C20.123,21.981 20.484,21.619 20.707,21.174C20.95,20.688 20.95,20.056 20.95,18.789L20.95,8.703C20.95,7.437 20.949,6.804 20.707,6.318C20.484,5.873 20.123,5.512 19.678,5.289C19.192,5.047 18.559,5.046 17.293,5.046L10.707,5.046ZM16.765,6.85C17.59,6.85 18.004,6.85 18.32,7.008C18.611,7.153 18.847,7.388 18.992,7.679C19.15,7.995 19.15,8.409 19.15,9.234L19.15,14.765C19.15,15.59 19.15,16.004 18.992,16.32C18.847,16.611 18.611,16.846 18.32,16.991C18.004,17.149 17.59,17.149 16.765,17.149L14.635,17.149C13.809,17.149 13.396,17.149 13.079,16.991C12.789,16.846 12.553,16.611 12.408,16.32C12.25,16.004 12.25,15.59 12.25,14.765L12.25,9.234C12.25,8.409 12.25,7.995 12.408,7.679C12.553,7.389 12.789,7.153 13.079,7.008C13.396,6.85 13.809,6.85 14.635,6.85L16.765,6.85ZM15.004,8.65C14.674,8.65 14.508,8.65 14.382,8.713C14.266,8.771 14.171,8.865 14.113,8.982C14.05,9.108 14.05,9.274 14.05,9.604L14.05,14.396C14.05,14.726 14.05,14.891 14.113,15.018C14.171,15.134 14.266,15.228 14.382,15.286C14.509,15.349 14.674,15.35 15.004,15.35L16.396,15.35C16.726,15.35 16.892,15.349 17.019,15.286C17.135,15.228 17.229,15.134 17.287,15.018C17.35,14.891 17.35,14.726 17.35,14.396L17.35,9.604C17.35,9.274 17.35,9.108 17.287,8.982C17.229,8.866 17.135,8.771 17.019,8.713C16.892,8.65 16.726,8.65 16.396,8.65L15.004,8.65Z"
10+
android:fillAlpha="0.8" />
11+
</vector>

0 commit comments

Comments
 (0)