Switch to lineair layout for two column mode

pull/162/head
M66B 6 years ago
parent ddbe3e8b37
commit e58a6019a6

@ -82,7 +82,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
private String startup; private String startup;
private View view; private View view;
private Group grpPane;
private View content_separator;
private View content_pane;
private DrawerLayout drawerLayout; private DrawerLayout drawerLayout;
private ActionBarDrawerToggle drawerToggle; private ActionBarDrawerToggle drawerToggle;
private ScrollView drawerContainer; private ScrollView drawerContainer;
@ -135,7 +138,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
grpPane = findViewById(R.id.grpPane); content_separator = findViewById(R.id.content_separator);
content_pane = findViewById(R.id.content_pane);
drawerLayout = findViewById(R.id.drawer_layout); drawerLayout = findViewById(R.id.drawer_layout);
drawerLayout.setScrimColor(Helper.resolveColor(this, R.attr.colorDrawerScrim)); drawerLayout.setScrimColor(Helper.resolveColor(this, R.attr.colorDrawerScrim));
@ -422,6 +426,11 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
// Initialize // Initialize
if (content_pane != null) {
content_separator.setVisibility(View.GONE);
content_pane.setVisibility(View.GONE);
}
if (getSupportFragmentManager().getFragments().size() == 0 && if (getSupportFragmentManager().getFragments().size() == 0 &&
!getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) !getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT))
init(); init();
@ -608,9 +617,10 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
drawerLayout.closeDrawer(drawerContainer); drawerLayout.closeDrawer(drawerContainer);
drawerToggle.setDrawerIndicatorEnabled(count == 1); drawerToggle.setDrawerIndicatorEnabled(count == 1);
if (grpPane != null) { if (content_pane != null) {
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.content_pane); Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.content_pane);
grpPane.setVisibility(fragment == null ? View.GONE : View.VISIBLE); content_separator.setVisibility(fragment == null ? View.GONE : View.VISIBLE);
content_pane.setVisibility(fragment == null ? View.GONE : View.VISIBLE);
} }
} }
} }
@ -1029,11 +1039,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
fragment.setArguments(args); fragment.setArguments(args);
int pane; int pane;
if (grpPane == null) if (content_pane == null)
pane = R.id.content_frame; pane = R.id.content_frame;
else { else {
pane = R.id.content_pane; pane = R.id.content_pane;
grpPane.setVisibility(View.VISIBLE); content_separator.setVisibility(View.VISIBLE);
content_pane.setVisibility(View.VISIBLE);
args.putBoolean("pane", true); args.putBoolean("pane", true);
} }

@ -6,44 +6,30 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ActivityView"> tools:context=".ActivityView">
<androidx.constraintlayout.widget.ConstraintLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="horizontal">
<FrameLayout <FrameLayout
android:id="@+id/content_frame" android:id="@+id/content_frame"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_constraintEnd_toStartOf="@+id/content_separator" android:layout_weight="1"
app:layout_constraintHorizontal_weight="1" app:layout_constraintEnd_toStartOf="@+id/content_separator" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View <View
android:id="@+id/content_separator" android:id="@+id/content_separator"
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator" />
app:layout_constraintEnd_toStartOf="@+id/content_pane"
app:layout_constraintStart_toEndOf="@id/content_frame"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout <FrameLayout
android:id="@+id/content_pane" android:id="@+id/content_pane"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent" android:layout_weight="1" />
app:layout_constraintHorizontal_weight="1" </LinearLayout>
app:layout_constraintStart_toEndOf="@id/content_separator"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpPane"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="gone"
app:constraint_referenced_ids="content_separator,content_pane" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ScrollView <ScrollView
android:id="@+id/drawer_container" android:id="@+id/drawer_container"

Loading…
Cancel
Save