mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 04:05:36 +00:00
three layout types (main screens)
- normal devices (phones) -> portrait mode - large devices (e.g. 7" tablets) -> landscape mode, but uses a phone layout - xlarge devices (e.g. 10" tablets) -> landscape mode, uses the original layout
This commit is contained in:
+12
-3
@@ -74,10 +74,19 @@ public class AppUtils {
|
||||
}
|
||||
|
||||
public boolean isTablet() {
|
||||
return is7inch() || is10inch();
|
||||
}
|
||||
|
||||
public boolean is7inch() {
|
||||
int screenLayout = mContext.getResources().getConfiguration().screenLayout;
|
||||
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && (
|
||||
((screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) || (
|
||||
(screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE)));
|
||||
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB &&
|
||||
((screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE));
|
||||
}
|
||||
|
||||
public boolean is10inch() {
|
||||
int screenLayout = mContext.getResources().getConfiguration().screenLayout;
|
||||
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB &&
|
||||
((screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE));
|
||||
}
|
||||
|
||||
public boolean isPhoneLand() {
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ public class RacingActivity extends SessionActivity implements RaceListCallbacks
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
if (toolbar != null) {
|
||||
if (AppUtils.with(this).isTablet()) {
|
||||
if (AppUtils.with(this).is10inch()) {
|
||||
setOverflowIcon();
|
||||
toolbar.setMinimumHeight(getResources().getDimensionPixelSize(R.dimen.biggerActionBarSize));
|
||||
}
|
||||
|
||||
+1
-1
@@ -199,7 +199,7 @@ public class LoginListViews extends LoggableDialogFragment implements View.OnCli
|
||||
|
||||
public void close() {
|
||||
if (mFrame != null && mFrame.getLayoutParams() != null) {
|
||||
if (!AppUtils.with(getActivity()).isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
if (!AppUtils.with(getActivity()).is10inch() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
if (mLayouts != null) {
|
||||
for (View view : mLayouts) {
|
||||
setVisibility(view, View.VISIBLE);
|
||||
|
||||
+1
-1
@@ -209,7 +209,7 @@ public class MorePanelFragment extends BasePanelFragment {
|
||||
}
|
||||
|
||||
private void uncheckMarker(View view) {
|
||||
if (!AppUtils.with(getActivity()).isTablet()) {
|
||||
if (!AppUtils.with(getActivity()).is10inch()) {
|
||||
if (!view.equals(mStartMode)) {
|
||||
setMarkerLevel(mStartMode, R.id.start_mode_marker, LEVEL_NORMAL);
|
||||
}
|
||||
|
||||
+1
-1
@@ -248,7 +248,7 @@ public class SetupPanelFragment extends BasePanelFragment {
|
||||
}
|
||||
|
||||
if (!view.equals(mStartProcedureMore)) {
|
||||
if (AppUtils.with(getActivity()).isTablet()) {
|
||||
if (AppUtils.with(getActivity()).is10inch()) {
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.race_panel_extra);
|
||||
if (mExtraLayout != null && fragment != null) {
|
||||
mExtraLayout.setVisibility(View.GONE);
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ public class MoreFlagsFragment extends BaseFragment implements MoreFlagItemClick
|
||||
|
||||
switch (getArguments().getInt(START_MODE, 0)) {
|
||||
case 0: // Race-State: Running -> Start Finishing
|
||||
if (AppUtils.with(getActivity()).isTablet()) {
|
||||
if (AppUtils.with(getActivity()).is10inch()) {
|
||||
if (header != null) {
|
||||
header.setOnClickListener(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user