Merge pull request #847 from FineFindus/fix/honor-group-divider-upstream
fix: disable GroupDivider on Honor's MagicOS
This commit is contained in:
@@ -687,7 +687,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
notifications.setTitle(getString(relationship.notifying ? R.string.disable_new_post_notifications : R.string.enable_new_post_notifications, account.getDisplayUsername()));
|
notifications.setTitle(getString(relationship.notifying ? R.string.disable_new_post_notifications : R.string.enable_new_post_notifications, account.getDisplayUsername()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.P && !UiUtils.isEMUI()){
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.P && !UiUtils.isEMUI() && !UiUtils.isMagic()){
|
||||||
menu.setGroupDividerEnabled(true);
|
menu.setGroupDividerEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,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 && !UiUtils.isEMUI())
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.P && !UiUtils.isEMUI() && !UiUtils.isMagic())
|
||||||
optionsMenu.getMenu().setGroupDividerEnabled(true);
|
optionsMenu.getMenu().setGroupDividerEnabled(true);
|
||||||
optionsMenu.setOnMenuItemClickListener(menuItem->{
|
optionsMenu.setOnMenuItemClickListener(menuItem->{
|
||||||
Account account=item.user;
|
Account account=item.user;
|
||||||
|
|||||||
@@ -809,6 +809,10 @@ public class UiUtils{
|
|||||||
return !TextUtils.isEmpty(getSystemProperty("ro.build.version.emui"));
|
return !TextUtils.isEmpty(getSystemProperty("ro.build.version.emui"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isMagic() {
|
||||||
|
return !TextUtils.isEmpty(getSystemProperty("ro.build.version.magic"));
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user