Flatten hierarchy of the DailySudokuActivity's portrait mode layout

This commit is contained in:
uykek 2020-07-18 15:43:17 +02:00
parent 8027b8b409
commit 110013f8ca

View file

@ -1,29 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.drawerlayout.widget.DrawerLayout android:id="@+id/drawer_layout_main"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout5"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/linearLayout10"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:statusBarBackground="?attr/colorPrimary">
<LinearLayout
android:id="@+id/linearLayout6"
<View
android:id="@+id/view3"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:background="?attr/colorPrimary"
android:foregroundGravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/linearLayout11"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:weightSum="5"
app:layout_constraintBottom_toTopOf="@+id/view3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar">
<ImageView
android:id="@+id/statistic_image"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/view"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RatingBar
android:id="@+id/first_diff_bar"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/main_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:numStars="4"
android:scaleX="1.5"
android:scaleY="1.5"
app:layout_constraintBottom_toBottomOf="@+id/view"
app:layout_constraintEnd_toEndOf="@+id/statistic_image"
app:layout_constraintStart_toStartOf="@+id/statistic_image"
app:layout_constraintTop_toBottomOf="@+id/statistic_image"
app:layout_constraintVertical_bias="0.50" />
<TextView
android:id="@+id/first_diff_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|center_horizontal"
android:text="diffi"
android:textSize="22sp"
app:layout_constraintBottom_toTopOf="@+id/first_diff_bar"
app:layout_constraintEnd_toEndOf="@+id/first_diff_bar"
app:layout_constraintStart_toStartOf="@+id/first_diff_bar"
app:layout_constraintTop_toBottomOf="@+id/statistic_image"
app:layout_constraintVertical_bias="1.0" />
<View
android:id="@+id/view"
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:foregroundGravity="center_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/daily_number_of_hints"
app:layout_constraintBottom_toBottomOf="@+id/statistic_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.25"
app:layout_constraintStart_toStartOf="@id/view"
app:layout_constraintTop_toTopOf="@+id/statistic_image"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/numb_of_hints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
app:layout_constraintBottom_toBottomOf="@+id/statistic_image"
app:layout_constraintEnd_toEndOf="@+id/textView4"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/textView4"
app:layout_constraintTop_toBottomOf="@+id/textView4"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/number_of_completed_games"
app:layout_constraintBottom_toTopOf="@+id/textView6"
app:layout_constraintEnd_toEndOf="@+id/numb_of_hints"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/numb_of_hints"
app:layout_constraintTop_toBottomOf="@+id/textView4" />
<TextView
android:id="@+id/numb_of_total_games"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
app:layout_constraintBottom_toBottomOf="@+id/statistic_image"
app:layout_constraintEnd_toEndOf="@+id/textView5"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/textView5"
app:layout_constraintTop_toBottomOf="@+id/textView5"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/total_of_time"
app:layout_constraintBottom_toTopOf="@+id/numb_of_total_time"
app:layout_constraintEnd_toEndOf="@+id/numb_of_total_games"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/numb_of_total_games"
app:layout_constraintTop_toTopOf="@+id/statistic_image"
app:layout_constraintVertical_bias="1.0" />
<TextView
android:id="@+id/numb_of_total_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
app:layout_constraintBottom_toBottomOf="@+id/statistic_image"
app:layout_constraintEnd_toEndOf="@+id/textView6"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/textView6"
app:layout_constraintTop_toBottomOf="@+id/numb_of_total_games"
app:layout_constraintVertical_bias="1.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:theme="@style/AppTheme.AppBarOverlay">
android:theme="@style/AppTheme.AppBarOverlay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@ -38,212 +206,31 @@
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:weightSum="10"
tools:context="org.secuso.privacyfriendlysudoku.ui.StatsActivity$PlaceholderFragment">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:weightSum="5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="2.0"
android:orientation="vertical">
<ImageView
android:id="@+id/statistic_image"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_horizontal"
android:layout_weight="1.0"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2.5"
android:gravity="center_horizontal">
<RatingBar
android:id="@+id/first_diff_bar"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/first_diff_text"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:numStars="4"
android:scaleX="1.5"
android:scaleY="1.5" />
<TextView
android:id="@+id/first_diff_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center|center_horizontal"
android:text="diffi"
android:textSize="22sp" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:minHeight="5dp">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center_vertical"
android:layout_marginTop="0dp"
android:layout_marginBottom="50dp"
android:background="?attr/colorPrimary"
android:foregroundGravity="center_vertical" />
</RelativeLayout>
<LinearLayout
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical"
android:paddingTop="0dp"
android:weightSum="6">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="top"
android:layout_marginRight="0dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="0dp"
android:weightSum="10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="0dp"
android:layout_weight="2"
android:text="@string/daily_number_of_hints" />
<TextView
android:id="@+id/numb_of_hints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="0dp"
android:layout_weight="1"
android:text="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="center"
android:text="@string/number_of_completed_games" />
<TextView
android:id="@+id/numb_of_total_games"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="2"
android:text="@string/total_of_time" />
<TextView
android:id="@+id/numb_of_total_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="0" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:paddingTop="@dimen/activity_horizontal_margin"
android:weightSum="6">
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0">
<View
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:background="?attr/colorPrimary"
android:foregroundGravity="center_vertical" />
</LinearLayout>
<ListView
android:id="@+id/sudoku_list"
android:layout_width="fill_parent"
android:layout_height="270dp"
android:layout_weight="6" />
</LinearLayout>
</LinearLayout>
android:layout_height="0dp"
android:layout_weight="6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view3" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginRight="25dp"
android:layout_marginBottom="290dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:clickable="true"
android:onClick="onClick"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/view3"
app:layout_constraintEnd_toEndOf="@+id/view3"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appbar"
app:layout_constraintVertical_bias="1.0"
app:srcCompat="@android:drawable/ic_media_play" />
@ -253,10 +240,12 @@
android:layout_height="0dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/linearLayout6"
app:layout_constraintTop_toBottomOf="@+id/linearLayout6" >
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent">
</androidx.viewpager.widget.ViewPager>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.drawerlayout.widget.DrawerLayout>