Added Surface Duo 2 support

This commit is contained in:
M66B 2023-04-29 20:39:04 +02:00
parent 03a1e598d1
commit 8fe9f6c555
2 changed files with 15 additions and 2 deletions

View File

@ -280,7 +280,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
content_frame.setLayoutParams(lparam);
}
// https://docs.microsoft.com/en-us/dual-screen/android/duo-dimensions
content_separator.getLayoutParams().width = Helper.dp2pixels(this, 34);
int seam = (Helper.isSurfaceDuo2() ? 26 : 34);
content_separator.getLayoutParams().width = Helper.dp2pixels(this, seam);
} else {
int column_width = prefs.getInt("column_width", 67);
ViewGroup.LayoutParams lparam = content_pane.getLayoutParams();

View File

@ -1472,7 +1472,19 @@ public class Helper {
}
static boolean isSurfaceDuo() {
return ("Microsoft".equalsIgnoreCase(Build.MANUFACTURER) && "Surface Duo".equals(Build.MODEL));
return (isSurfaceDuo2() ||
("Microsoft".equalsIgnoreCase(Build.MANUFACTURER) && "Surface Duo".equals(Build.MODEL)));
}
static boolean isSurfaceDuo2() {
/*
Brand: surface
Manufacturer: Microsoft
Model: Surface Duo 2
Product: duo2
Device: duo2
*/
return ("Microsoft".equalsIgnoreCase(Build.MANUFACTURER) && "Surface Duo 2".equals(Build.MODEL));
}
static boolean isArc() {