Changes to the layout

1.) Increase the number of stars to 4
2.) Creation of the button "Start DailySudoku"
3.) Positioning of the individual elements in the layout
This commit is contained in:
ErikWaegerle 2020-05-26 01:13:13 +02:00
parent 5d620829c4
commit b41ff4b238

View file

@ -1,14 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:statusBarBackground="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:orientation="vertical">
app:statusBarBackground="?attr/colorPrimary">
<LinearLayout
android:id="@+id/linearLayout6"
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">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
@ -22,24 +30,23 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:clipChildren="false"
app:layout_scrollFlags="enterAlways">
app:layout_scrollFlags="enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay">
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
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"
android:orientation="vertical"
tools:context="org.secuso.privacyfriendlysudoku.ui.StatsActivity$PlaceholderFragment">
<LinearLayout
@ -48,76 +55,140 @@
android:layout_weight="4"
android:weightSum="5">
<ImageView
android:id="@+id/statistic_image"
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="1.8"
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|start|center_horizontal|left"
android:layout_weight="2.0"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="3.0"
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_gravity="start|right|center_horizontal"
android:numStars="4"
android:rating="2" />
<TextView
android:id="@+id/first_diff_text"
android:layout_width="42dp"
android:layout_height="30dp"
android:gravity="bottom|center|center_horizontal"
android:text="diffi"
android:textSize="22dp" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:foregroundGravity="center_vertical"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:background="@color/colorPrimary"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginTop="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_horizontal_margin"/>
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:background="@color/colorPrimary"
android:foregroundGravity="center_vertical" />
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_width="2dp"
android:layout_height="fill_parent"
android:weightSum="6"
android:layout_weight="2"
android:orientation="vertical"
android:paddingTop="@dimen/activity_horizontal_margin">
android:paddingTop="@dimen/activity_horizontal_margin"
android:weightSum="6">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
android:orientation="vertical"
android:paddingTop="@dimen/activity_horizontal_margin"
android:weightSum="6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/number_of_hints"
android:layout_weight="1"/>
android:layout_marginBottom="0dp"
android:layout_weight="1"
android:text="@string/number_of_hints" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="0"
android:id="@+id/numb_of_hints"
android:layout_weight="1"/>
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:text="@string/number_of_games"
android:layout_weight="1"/>
android:layout_weight="1"
android:text="@string/number_of_games" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="0"
android:id="@+id/numb_of_total_games"
android:layout_weight="1"/>
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:text="@string/total_of_time"
android:layout_weight="1"/>
android:layout_weight="1"
android:text="@string/total_of_time" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="0"
android:id="@+id/numb_of_total_time"
android:layout_weight="1"/>
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>
@ -125,15 +196,16 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_weight="1.0">
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_gravity="center_vertical"
android:foregroundGravity="center_vertical"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:background="@color/colorPrimary" />
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:background="@color/colorPrimary"
android:foregroundGravity="center_vertical" />
</LinearLayout>
@ -141,8 +213,8 @@
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:weightSum="4"
android:orientation="vertical">
android:orientation="vertical"
android:weightSum="4">
<!-- ### first row -->
<LinearLayout
android:layout_width="match_parent"
@ -162,7 +234,6 @@
android:layout_width="180dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
</RelativeLayout>
@ -172,20 +243,68 @@
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="3"
android:layout_gravity="center"
android:id="@+id/first_diff_bar"
android:layout_below="@+id/first_diff_text"
style="?android:attr/ratingBarStyleSmall"/>
<TextView
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="diffi"
android:layout_below="@+id/first_diff_text"
android:layout_centerHorizontal="false"
android:numStars="4" />
<TextView
android:id="@+id/first_diff_text"
android:gravity="center_vertical"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="diffi" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_marginLeft="1dp"
android:layout_weight="1"
android:gravity="right|center_vertical">
<TextView
android:id="@+id/first_min_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time" />
<TextView
android:id="@+id/first_min_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/first_min_text"
android:gravity="center_vertical"
android:text="0" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:weightSum="3">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_marginTop="10dp"
android:layout_weight="0.7"
android:gravity="center_vertical">
<ImageView
android:id="@+id/statistic_image2"
android:layout_width="180dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
</RelativeLayout>
<RelativeLayout
@ -193,18 +312,111 @@
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
<RatingBar
android:id="@+id/first_diff_bar"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time"
android:id="@+id/first_min_text"/>
android:layout_below="@+id/first_diff_text"
android:layout_gravity="center"
android:numStars="4" />
<TextView
android:id="@+id/first_diff_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/first_min_time"
android:gravity="center_vertical"
android:layout_below="@+id/first_min_text"/>
android:text="diffi" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="right|center_vertical">
<TextView
android:id="@+id/first_min_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time" />
<TextView
android:id="@+id/first_min_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/first_min_text"
android:gravity="center_vertical"
android:text="0" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:weightSum="3">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_marginTop="10dp"
android:layout_weight="0.7"
android:gravity="center_vertical">
<ImageView
android:id="@+id/statistic_image2"
android:layout_width="180dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<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_gravity="center"
android:numStars="4" />
<TextView
android:id="@+id/first_diff_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="diffi" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="right|center_vertical">
<TextView
android:id="@+id/first_min_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time" />
<TextView
android:id="@+id/first_min_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/first_min_text"
android:gravity="center_vertical"
android:text="0" />
</RelativeLayout>
</LinearLayout>
@ -237,181 +449,77 @@
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="3"
android:layout_gravity="center"
android:id="@+id/second_diff_bar"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/second_diff_text"
style="?android:attr/ratingBarStyleSmall"/>
android:layout_gravity="center"
android:numStars="4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="diffi"
android:id="@+id/second_diff_text"
android:gravity="center_vertical"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="diffi" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
android:gravity="right|center_vertical">
<TextView
android:id="@+id/second_min_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time"
android:id="@+id/second_min_text"/>
android:text="@string/min_time" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/second_min_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/second_min_text"
android:gravity="center_vertical"
android:layout_below="@+id/second_min_text"/>
android:text="0" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.7"
android:gravity="center_vertical">
<ImageView
android:id="@+id/statistic_image7"
android:layout_width="180dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="3"
android:layout_gravity="center"
android:id="@+id/third_diff_bar"
android:layout_below="@+id/third_diff_text"
style="?android:attr/ratingBarStyleSmall"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="diffi"
android:id="@+id/third_diff_text"
android:gravity="center_vertical"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time"
android:id="@+id/third_min_text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/third_min_time"
android:gravity="center_vertical"
android:layout_below="@+id/third_min_text"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.7"
android:gravity="center_vertical">
<ImageView
android:id="@+id/statistic_image8"
android:layout_width="180dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_weight="0.7"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="3"
android:layout_gravity="center"
android:id="@+id/fourth_diff_bar"
android:layout_below="@+id/fourth_diff_text"
style="?android:attr/ratingBarStyleSmall"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="diffi"
android:id="@+id/fourth_diff_text"
android:gravity="center_vertical"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/min_time"
android:id="@+id/fourth_min_text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/fourth_min_time"
android:gravity="center_vertical"
android:layout_below="@+id/fourth_min_text"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="30dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="290dp"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@android:drawable/ic_media_play" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/main_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
android:layout_width="wrap_content"
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" >
</androidx.viewpager.widget.ViewPager>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>