Merge pull request #732 from FineFindus/fix/invisible-menu

fix: disable group divider on EMUI
This commit is contained in:
Gregory K 2023-11-08 22:35:22 +03:00 committed by GitHub
commit 7baf25869a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -136,7 +136,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
optionsMenu=new PopupMenu(activity, more); optionsMenu=new PopupMenu(activity, more);
optionsMenu.inflate(R.menu.post); optionsMenu.inflate(R.menu.post);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.P) if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.P && !UiUtils.isEMUI())
optionsMenu.getMenu().setGroupDividerEnabled(true); optionsMenu.getMenu().setGroupDividerEnabled(true);
optionsMenu.setOnMenuItemClickListener(menuItem->{ optionsMenu.setOnMenuItemClickListener(menuItem->{
Account account=item.user; Account account=item.user;

View File

@ -685,6 +685,10 @@ public class UiUtils{
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.code")); 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){ public static int alphaBlendColors(int color1, int color2, float alpha){
float alpha0=1f-alpha; float alpha0=1f-alpha;
int r=Math.round(((color1 >> 16) & 0xFF)*alpha0+((color2 >> 16) & 0xFF)*alpha); int r=Math.round(((color1 >> 16) & 0xFF)*alpha0+((color2 >> 16) & 0xFF)*alpha);