Added support for Galaxy Z Fold6

master
M66B 2 months ago
parent ae9b84ccdb
commit 657d89f014

@ -252,7 +252,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
" portrait rows=" + portrait2 + " cols=" + portrait2c + " min=" + portrait_min_size +
" landscape cols=" + landscape + " min=" + landscape_min_size);
boolean duo = Helper.isSurfaceDuo();
boolean close_pane = prefs.getBoolean("close_pane", !duo);
boolean fold6 = Helper.isFold6();
boolean close_pane = prefs.getBoolean("close_pane", !duo && !fold6);
boolean nav_categories = prefs.getBoolean("nav_categories", false);
// 1=small, 2=normal, 3=large, 4=xlarge
@ -278,16 +279,18 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (content_pane != null) {
// Special: Surface Duo
if (duo) {
if (duo || fold6) {
View content_frame = findViewById(R.id.content_frame);
ViewGroup.LayoutParams lparam = content_frame.getLayoutParams();
if (lparam instanceof LinearLayout.LayoutParams) {
((LinearLayout.LayoutParams) lparam).weight = 1; // 50/50
content_frame.setLayoutParams(lparam);
}
if (duo) {
// https://docs.microsoft.com/en-us/dual-screen/android/duo-dimensions
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();

@ -1719,6 +1719,10 @@ public class Helper {
return ("Microsoft".equalsIgnoreCase(Build.MANUFACTURER) && "Surface Duo 2".equals(Build.MODEL));
}
static boolean isFold6() {
return ("Samsung".equalsIgnoreCase(Build.MANUFACTURER) && "SM-F956U1".equals(Build.MODEL));
}
static boolean isArc() {
// https://github.com/google/talkback/blob/master/utils/src/main/java/com/google/android/accessibility/utils/FeatureSupport.java
return (Build.DEVICE != null) && Build.DEVICE.matches(".+_cheets|cheets_.+");

Loading…
Cancel
Save