Added option for two columns in portrait mode

This commit is contained in:
M66B
2021-08-10 08:55:34 +02:00
parent 0dcbe6430d
commit 73e824c3ec
5 changed files with 48 additions and 8 deletions

View File

@@ -177,16 +177,18 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
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 +
" portrait=" + portrait2 + "/" + portrait3 +
" landscape=" + landscape + "/" + landscape3);
Log.i("Orientation=" + config.orientation + " normal=" + normal +
" portrait 2=" + portrait2 + " 2c=" + portrait2c + " nav=" + portrait3 +
" landscape 2=" + landscape + " nav=" + landscape3);
int viewId;
if (config.orientation == ORIENTATION_PORTRAIT || !normal || !landscape)
if (config.orientation == ORIENTATION_PORTRAIT && portrait2c)
viewId = R.layout.activity_view_landscape_split;
else if (config.orientation == ORIENTATION_PORTRAIT || !(normal && landscape))
viewId = (portrait2 ? R.layout.activity_view_portrait_split : R.layout.activity_view_portrait);
else
viewId = R.layout.activity_view_landscape_split;