mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 02:21:37 +01:00
Enable compact view on narrow screens
This commit is contained in:
@@ -22,8 +22,10 @@ package eu.faircode.email;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.Display;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -73,6 +75,13 @@ public class ActivityMain extends AppCompatActivity implements FragmentManager.O
|
||||
}
|
||||
}.execute(this, new Bundle(), "main:accounts");
|
||||
} else {
|
||||
// Enable compact view on narrow screens
|
||||
Display display = getWindowManager().getDefaultDisplay();
|
||||
Point size = new Point();
|
||||
display.getSize(size);
|
||||
if (size.x < 1080)
|
||||
prefs.edit().putBoolean("compact", true).apply();
|
||||
|
||||
setTheme(R.style.AppThemeLight);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Reference in New Issue
Block a user