Adapting the activity_main_menu.xml
A CheckBox was inserted here, as this is better than a button in our case. Finally, the Checkbox was set up as a circle (vector file).
This commit is contained in:
parent
5668b2a33f
commit
77520b0d72
1 changed files with 212 additions and 199 deletions
|
@ -8,223 +8,236 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
tools:context="tu_darmstadt.sudoku.ui.MainActivity"
|
tools:context="tu_darmstadt.sudoku.ui.MainActivity"
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_width="match_parent">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
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">
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent">
|
||||||
android:orientation="vertical"
|
|
||||||
android:weightSum="10"
|
|
||||||
android:id="@+id/main_content"
|
|
||||||
style="?android:buttonBarStyle"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layoutDirection="ltr"
|
|
||||||
android:layout_weight="4">
|
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
|
||||||
android:id="@+id/scroller"
|
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
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">
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/arrow_left"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:srcCompat="@drawable/ic_keyboard_arrow_left_black_24dp"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:padding="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:onClick="onClick"/>
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/arrow_right"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:srcCompat="@drawable/ic_keyboard_arrow_right_black_24dp"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:padding="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:onClick="onClick"/>
|
|
||||||
</RelativeLayout>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0px"
|
|
||||||
android:layout_weight="6"
|
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
|
||||||
tools:context="tu_darmstadt.sudoku.ui.MainActivity"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:weightSum="8"
|
android:weightSum="10"
|
||||||
android:divider="#000"
|
android:id="@+id/main_content"
|
||||||
android:baselineAligned="false"
|
style="?android:buttonBarStyle"
|
||||||
android:gravity="center_horizontal">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<TextView
|
<RelativeLayout
|
||||||
android:id="@+id/difficultyText"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:text="@string/difficulty_easy"
|
|
||||||
android:textSize="@dimen/main_text_difficulty"/>
|
|
||||||
|
|
||||||
<RatingBar
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:id="@+id/difficultyBar"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:clickable="true"
|
|
||||||
android:numStars="3"
|
|
||||||
android:rating="1"
|
|
||||||
android:stepSize="1"
|
|
||||||
style="@style/RatingBar"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:textColor="?attr/lightestFontColor"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginLeft="@dimen/main_button_padding"
|
android:layoutDirection="ltr"
|
||||||
android:layout_marginRight="@dimen/main_button_padding"
|
android:layout_weight="4">
|
||||||
android:text="@string/new_game"
|
|
||||||
android:textStyle="normal"
|
|
||||||
android:textSize="@dimen/text_size"
|
|
||||||
android:id="@+id/playButton"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:clickable="false"
|
|
||||||
android:elevation="10dp"
|
|
||||||
android:background="@drawable/standalone_button"/>
|
|
||||||
|
|
||||||
<Button
|
<androidx.viewpager.widget.ViewPager
|
||||||
android:textColor="?attr/lightestFontColor"
|
android:id="@+id/scroller"
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginLeft="@dimen/main_button_padding"
|
|
||||||
android:layout_marginRight="@dimen/main_button_padding"
|
|
||||||
android:text="@string/menu_continue_game"
|
|
||||||
android:textStyle="normal"
|
|
||||||
android:textSize="@dimen/text_size"
|
|
||||||
android:id="@+id/continueButton"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:capitalize="none"
|
|
||||||
android:clickable="false"
|
|
||||||
android:background="@drawable/standalone_button"/>
|
|
||||||
|
|
||||||
<!-- <Button
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="coachMark"
|
|
||||||
android:visibility="visible"
|
|
||||||
android:onClick="coachMark"/> -->
|
|
||||||
<!--
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="2"
|
|
||||||
android:weightSum="2">
|
|
||||||
<Button
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="30dp"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
android:layout_marginRight="1dp"
|
|
||||||
android:text="@string/menu_highscore"
|
<ImageView
|
||||||
|
android:id="@+id/arrow_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_keyboard_arrow_left_black_24dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:onClick="onClick"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/arrow_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srcCompat="@drawable/ic_keyboard_arrow_right_black_24dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:onClick="onClick"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0px"
|
||||||
|
android:layout_weight="6"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
tools:context="tu_darmstadt.sudoku.ui.MainActivity"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:weightSum="8"
|
||||||
|
android:divider="#000"
|
||||||
|
android:baselineAligned="false"
|
||||||
|
android:gravity="center_horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/difficultyText"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:text="@string/difficulty_easy"
|
||||||
|
android:textSize="@dimen/main_text_difficulty"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/circleButton"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:button="@drawable/create_game_src" />
|
||||||
|
|
||||||
|
<RatingBar
|
||||||
|
android:id="@+id/difficultyBar"
|
||||||
|
style="@style/RatingBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:clickable="true"
|
||||||
|
android:numStars="3"
|
||||||
|
android:rating="0.5"
|
||||||
|
android:stepSize="1" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:textColor="?attr/lightestFontColor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginLeft="@dimen/main_button_padding"
|
||||||
|
android:layout_marginRight="@dimen/main_button_padding"
|
||||||
|
android:text="@string/new_game"
|
||||||
android:textStyle="normal"
|
android:textStyle="normal"
|
||||||
android:id="@+id/highscoreButton"
|
android:textSize="@dimen/text_size"
|
||||||
|
android:id="@+id/playButton"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_weight="1"
|
android:layout_weight="3"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:clickable="false"
|
||||||
|
android:elevation="10dp"
|
||||||
|
android:background="@drawable/standalone_button"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:textColor="?attr/lightestFontColor"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginLeft="@dimen/main_button_padding"
|
||||||
|
android:layout_marginRight="@dimen/main_button_padding"
|
||||||
|
android:text="@string/menu_continue_game"
|
||||||
|
android:textStyle="normal"
|
||||||
|
android:textSize="@dimen/text_size"
|
||||||
|
android:id="@+id/continueButton"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="3"
|
||||||
android:onClick="onClick"
|
android:onClick="onClick"
|
||||||
android:capitalize="none"
|
android:capitalize="none"
|
||||||
android:clickable="false"/>
|
android:clickable="false"
|
||||||
<Button
|
android:background="@drawable/standalone_button"/>
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
<!-- <Button
|
||||||
android:layout_marginLeft="1dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/menu_settings"
|
android:text="coachMark"
|
||||||
android:textStyle="normal"
|
android:visibility="visible"
|
||||||
android:id="@+id/settingsButton"
|
android:onClick="coachMark"/> -->
|
||||||
android:layout_gravity="center_horizontal"
|
<!--
|
||||||
android:layout_weight="1"
|
<LinearLayout
|
||||||
android:onClick="onClick"
|
android:layout_width="match_parent"
|
||||||
android:capitalize="none"
|
android:layout_height="0dp"
|
||||||
android:clickable="false"/>
|
android:layout_weight="2"
|
||||||
|
android:weightSum="2">
|
||||||
|
<Button
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
|
android:layout_marginRight="1dp"
|
||||||
|
android:text="@string/menu_highscore"
|
||||||
|
android:textStyle="normal"
|
||||||
|
android:id="@+id/highscoreButton"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:capitalize="none"
|
||||||
|
android:clickable="false"/>
|
||||||
|
<Button
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="1dp"
|
||||||
|
android:layout_marginRight="30dp"
|
||||||
|
android:text="@string/menu_settings"
|
||||||
|
android:textStyle="normal"
|
||||||
|
android:id="@+id/settingsButton"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:capitalize="none"
|
||||||
|
android:clickable="false"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:weightSum="2">
|
||||||
|
<Button
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
|
android:layout_marginRight="1dp"
|
||||||
|
android:text="@string/menu_about"
|
||||||
|
android:textStyle="normal"
|
||||||
|
android:id="@+id/aboutButton"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:capitalize="none"
|
||||||
|
android:clickable="false"/>
|
||||||
|
<Button
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="1dp"
|
||||||
|
android:layout_marginRight="30dp"
|
||||||
|
android:text="@string/menu_help"
|
||||||
|
android:textStyle="normal"
|
||||||
|
android:id="@+id/helpButton"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:onClick="onClick"
|
||||||
|
android:capitalize="none"
|
||||||
|
android:clickable="false"/>
|
||||||
|
</LinearLayout>
|
||||||
|
-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="2"
|
|
||||||
android:weightSum="2">
|
|
||||||
<Button
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginLeft="30dp"
|
|
||||||
android:layout_marginRight="1dp"
|
|
||||||
android:text="@string/menu_about"
|
|
||||||
android:textStyle="normal"
|
|
||||||
android:id="@+id/aboutButton"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:capitalize="none"
|
|
||||||
android:clickable="false"/>
|
|
||||||
<Button
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginLeft="1dp"
|
|
||||||
android:layout_marginRight="30dp"
|
|
||||||
android:text="@string/menu_help"
|
|
||||||
android:textStyle="normal"
|
|
||||||
android:id="@+id/helpButton"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:capitalize="none"
|
|
||||||
android:clickable="false"/>
|
|
||||||
</LinearLayout>
|
|
||||||
-->
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.navigation.NavigationView
|
<com.google.android.material.navigation.NavigationView
|
||||||
android:id="@+id/nav_view_main"
|
android:id="@+id/nav_view_main"
|
||||||
|
|
Loading…
Reference in a new issue