1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Refactoring

This commit is contained in:
M66B 2020-11-15 13:34:52 +01:00
parent 692c7deb4f
commit 051f2eb124
2 changed files with 10 additions and 6 deletions

View file

@ -171,10 +171,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Log.i("Orientation=" + config.orientation + " normal=" + normal +
" landscape=" + landscape + "/" + landscape3);
boolean portrait = (config.orientation == ORIENTATION_PORTRAIT || !normal || !landscape);
view = LayoutInflater.from(this).inflate(portrait
? (portrait2 ? R.layout.activity_view_portrait_split : R.layout.activity_view_portrait)
: R.layout.activity_view_landscape, null);
int viewId;
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;
view = LayoutInflater.from(this).inflate(viewId, null);
setContentView(view);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@ -184,7 +186,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
content_separator = findViewById(R.id.content_separator);
content_pane = findViewById(R.id.content_pane);
if ((portrait ? portrait2 : !landscape3) && Helper.isFoldable()) {
if (Helper.isFoldable() &&
(viewId == R.layout.activity_view_portrait_split ||
viewId == R.layout.activity_view_landscape_split)) {
View content_frame = findViewById(R.id.content_frame);
ViewGroup.LayoutParams lparam = content_frame.getLayoutParams();
if (lparam instanceof LinearLayout.LayoutParams) {
@ -243,7 +247,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
int drawerWidth;
DisplayMetrics dm = getResources().getDisplayMetrics();
if (portrait || !landscape3) {
if (viewId != R.layout.activity_view_landscape_split || !landscape3) {
int actionBarHeight;
TypedValue tv = new TypedValue();
if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))