1.) Creating a Daily Sudoku Activity XML

2.) Adaptation of the layout
3.) Inserting the app and toolbar into the layout
4.) Use the layout of fragment_stats.xml
5.) Adaptation and modification of the layout see Mockup 3
This commit is contained in:
ErikWaegerle 2020-05-25 20:12:50 +02:00
parent e10746822d
commit dd9a66eb8c

View file

@ -0,0 +1,417 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:statusBarBackground="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:orientation="vertical">
<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">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
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">
</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:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:weightSum="10"
android:orientation="vertical"
tools:context="org.secuso.privacyfriendlysudoku.ui.StatsActivity$PlaceholderFragment">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:weightSum="5">
<ImageView
android:id="@+id/statistic_image"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:layout_weight="1.8"
android:adjustViewBounds="true"
android:src="@drawable/icon_default_9x9" />
<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_marginTop="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_horizontal_margin"/>
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:weightSum="6"
android:layout_weight="2"
android:orientation="vertical"
android:paddingTop="@dimen/activity_horizontal_margin">
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<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" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:weightSum="4"
android:orientation="vertical">
<!-- ### first row -->
<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:layout_weight="2"
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/first_diff_bar"
android:layout_below="@+id/first_diff_text"
style="?android:attr/ratingBarStyleSmall"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="diffi"
android:id="@+id/first_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/first_min_text"/>
<TextView
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"/>
</RelativeLayout>
</LinearLayout>
<!-- ### second row -->
<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_weight="0.7"
android:gravity="center_vertical">
<ImageView
android:id="@+id/statistic_image6"
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/second_diff_bar"
android:layout_below="@+id/second_diff_text"
style="?android:attr/ratingBarStyleSmall"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="diffi"
android:id="@+id/second_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/second_min_text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:id="@+id/second_min_time"
android:gravity="center_vertical"
android:layout_below="@+id/second_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_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>
<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" />
</LinearLayout>