mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Added support for split screen
This commit is contained in:
parent
d38ffb3117
commit
3d3e943522
2 changed files with 14 additions and 0 deletions
|
@ -44,6 +44,7 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -183,6 +184,15 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
content_separator = findViewById(R.id.content_separator);
|
||||
content_pane = findViewById(R.id.content_pane);
|
||||
|
||||
if (!portrait && !landscape3 && Helper.isSplitScreen()) {
|
||||
View content_frame = findViewById(R.id.content_frame);
|
||||
ViewGroup.LayoutParams lparam = content_frame.getLayoutParams();
|
||||
if (lparam instanceof LinearLayout.LayoutParams) {
|
||||
((LinearLayout.LayoutParams) lparam).weight = 1;
|
||||
content_frame.setLayoutParams(lparam);
|
||||
}
|
||||
}
|
||||
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
|
||||
final ViewGroup childContent = (ViewGroup) drawerLayout.getChildAt(0);
|
||||
|
|
|
@ -677,6 +677,10 @@ public class Helper {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static boolean isSplitScreen() {
|
||||
return ("Microsoft".equalsIgnoreCase(Build.MANUFACTURER) && "Surface Duo".equals(Build.MODEL));
|
||||
}
|
||||
|
||||
// Graphics
|
||||
|
||||
static int dp2pixels(Context context, int dp) {
|
||||
|
|
Loading…
Reference in a new issue