master
M66B 2 months ago
parent c177a6a142
commit 3693693fdc

@ -252,8 +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 fold6 = Helper.isFold6();
boolean close_pane = prefs.getBoolean("close_pane", !duo && !fold6);
boolean canFold = Helper.canFold(this);
boolean close_pane = prefs.getBoolean("close_pane", !duo && !canFold);
boolean nav_categories = prefs.getBoolean("nav_categories", false);
// 1=small, 2=normal, 3=large, 4=xlarge
@ -279,7 +279,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (content_pane != null) {
// Special: Surface Duo
if (duo || fold6) {
if (duo || canFold) {
View content_frame = findViewById(R.id.content_frame);
ViewGroup.LayoutParams lparam = content_frame.getLayoutParams();
if (lparam instanceof LinearLayout.LayoutParams) {

@ -493,6 +493,7 @@ public class DebugHelper {
sb.append(String.format("Density 1dp=%f\r\n", density));
sb.append(String.format("Resolution: %.2f x %.2f dp\r\n", dim.x / density, dim.y / density));
//sb.append(String.format("Max. texture: %d px\r\n", Helper.getMaxTextureSize()));
sb.append(String.format("Foldable: %b\r\n", Helper.canFold(context)));
Configuration config = context.getResources().getConfiguration();

@ -1728,6 +1728,16 @@ public class Helper {
return (Build.DEVICE != null) && Build.DEVICE.matches(".+_cheets|cheets_.+");
}
static boolean canFold(Context context) {
try {
PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_HINGE_ANGLE);
} catch (Throwable ex) {
Log.e(ex);
return false;
}
}
static boolean isWatch(Context context) {
if (isSmartwatch == null)
isSmartwatch = _isWatch(context);

Loading…
Cancel
Save