fix: disable group divider on EMUI

Fixes an issues, where the forth menu item does not show up, when the divider is enabled on EMUI devices
This commit is contained in:
FineFindus 2023-03-10 19:41:45 +01:00
parent 7ea42c8403
commit 2efdf09333
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
2 changed files with 5 additions and 1 deletions

View File

@ -358,7 +358,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab
addListsToOverflowMenu();
addHashtagsToOverflowMenu();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && !UiUtils.isEMUI()) {
m.setGroupDividerEnabled(true);
}
}

View File

@ -1143,6 +1143,10 @@ public class UiUtils {
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.code"));
}
public static boolean isEMUI() {
return !TextUtils.isEmpty(getSystemProperty("ro.build.version.emui"));
}
public static int alphaBlendColors(int color1, int color2, float alpha) {
float alpha0 = 1f - alpha;
int r = Math.round(((color1 >> 16) & 0xFF) * alpha0 + ((color2 >> 16) & 0xFF) * alpha);