Removed normal screen limitations

This commit is contained in:
M66B
2021-08-10 09:23:05 +02:00
parent 73e824c3ec
commit cbb39fa46f
6 changed files with 49 additions and 30 deletions

View File

@@ -175,20 +175,19 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
startup = prefs.getString("startup", "unified");
Configuration config = getResources().getConfiguration();
final boolean normal = config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL);
final boolean portrait2 = prefs.getBoolean("portrait2", false);
final boolean portrait2c = prefs.getBoolean("portrait2c", false);
final boolean portrait3 = prefs.getBoolean("portrait3", false);
final boolean landscape = prefs.getBoolean("landscape", true);
final boolean landscape3 = prefs.getBoolean("landscape3", true);
Log.i("Orientation=" + config.orientation + " normal=" + normal +
Log.i("Orientation=" + config.orientation +
" portrait 2=" + portrait2 + " 2c=" + portrait2c + " nav=" + portrait3 +
" landscape 2=" + landscape + " nav=" + landscape3);
int viewId;
if (config.orientation == ORIENTATION_PORTRAIT && portrait2c)
viewId = R.layout.activity_view_landscape_split;
else if (config.orientation == ORIENTATION_PORTRAIT || !(normal && landscape))
else if (config.orientation == ORIENTATION_PORTRAIT || !landscape)
viewId = (portrait2 ? R.layout.activity_view_portrait_split : R.layout.activity_view_portrait);
else
viewId = R.layout.activity_view_landscape_split;
@@ -235,9 +234,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Log.i("Drawer opened");
owner.start();
if (normal &&
((portrait3 && config.orientation == Configuration.ORIENTATION_PORTRAIT) ||
(landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE))) {
if (((portrait3 && config.orientation == Configuration.ORIENTATION_PORTRAIT) ||
(landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE))) {
drawerLayout.setDrawerLockMode(LOCK_MODE_LOCKED_OPEN);
childContent.setPaddingRelative(childDrawer.getLayoutParams().width, 0, 0, 0);
}
@@ -252,9 +250,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
else
owner.stop();
if (normal &&
((portrait3 && config.orientation == Configuration.ORIENTATION_PORTRAIT) ||
(landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE)))
if (((portrait3 && config.orientation == Configuration.ORIENTATION_PORTRAIT) ||
(landscape3 && config.orientation == Configuration.ORIENTATION_LANDSCAPE)))
childContent.setPaddingRelative(
Math.round(slideOffset * childDrawer.getLayoutParams().width), 0, 0, 0);
}