Skip to content

Commit

Permalink
Merge pull request #157 from SDP-Rock-Paper-Scissors/feat/better_ui
Browse files Browse the repository at this point in the history
Feat/better UI
  • Loading branch information
gaetschwartz authored Jun 2, 2022
2 parents 144fef9 + c10ac80 commit ac00d98
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 104 deletions.
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/button_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="@color/dark_tertiary2" />
<solid android:color="?colorSurface" />
<corners android:radius="12dp" />
</shape>
</item>
<item android:state_pressed="false">
<shape>
<solid android:color="@color/tertiary2" />
<solid android:color="?colorSurfaceVariant" />
<corners android:radius="12dp" />
</shape>
</item>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/secondary_button_selector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="@color/light_secondary" />
<solid android:color="?colorSurfaceVariant" />
<corners android:radius="12dp" />
</shape>
</item>
<item android:state_pressed="false">
<shape>
<solid android:color="@color/secondary" />
<solid android:color="?colorSurfaceVariant" />
<corners android:radius="12dp" />
</shape>
</item>
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/fragment_friends.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
android:id="@+id/fragment_friends"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/primary"
tools:context=".ui.friends.FriendsFragment">

<ImageButton
Expand All @@ -17,6 +16,7 @@
android:src="@drawable/search_vector"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="?colorPrimary"
tools:ignore="SpeakableTextPresentCheck" />

<TextView
Expand All @@ -25,10 +25,9 @@
android:layout_height="54dp"
android:layout_marginTop="3dp"
android:background="@drawable/rounded_corners"
android:backgroundTint="@color/tertiary2"
android:gravity="center"
android:text="@string/friends"
android:textColor="@color/secondary"
android:textColor="?colorOnSurface"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/addButton"
Expand Down
113 changes: 74 additions & 39 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/fragment_home"
android:layout_width="match_parent"
Expand All @@ -8,77 +9,111 @@
tools:context=".ui.home.HomeFragment">

<TextView
android:id="@+id/text_home"
style="@style/TextAppearance.Material3.HeadlineLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/online"
android:textAlignment="center"
android:layout_marginBottom="8dp"
android:text="@string/rock_paper_scissors"
android:textAlignment="textStart"
android:textSize="20sp" />

<Button
android:id="@+id/button_play_1_games_online"
<TextView
style="@style/TextAppearance.Material3.HeadlineSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/play_one_game"
android:textSize="15sp" />
android:text="@string/online"
android:textAlignment="textStart"
android:textSize="20sp" />

<Button
android:id="@+id/button_play_5_games_online"
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/play_five_games"
android:textSize="15sp" />
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp">

<com.google.android.material.button.MaterialButton
android:id="@+id/button_play_1_games_offline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
android:text="@string/play_one_game"
android:textSize="15sp"
app:cornerRadius="32dp"
app:icon="@drawable/playgame_vector" />

<com.google.android.material.button.MaterialButton
android:id="@+id/button_play_5_games_offline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
android:text="@string/play_five_games"
android:textSize="15sp"
app:cornerRadius="32dp"
app:icon="@drawable/playgame_vector" />
</LinearLayout>
</HorizontalScrollView>

<TextView
android:id="@+id/text_home2"
style="@style/TextAppearance.Material3.HeadlineSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/offline"
android:textAlignment="center"
android:textAlignment="textStart"
android:textSize="20sp" />

<Button
android:id="@+id/button_play_1_games_offline"
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/play_one_game"
android:textSize="15sp" />
android:layout_height="wrap_content">

<Button
android:id="@+id/button_play_5_games_offline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/play_five_games"
android:textSize="15sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp">

<com.google.android.material.button.MaterialButton
android:id="@+id/button_play_1_games_online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
android:text="@string/play_one_game"
android:textSize="15sp"
app:cornerRadius="32dp"
app:icon="@drawable/playgame_vector" />

<com.google.android.material.button.MaterialButton
android:id="@+id/button_play_5_games_online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
android:text="@string/play_five_games"
android:textSize="15sp"
app:cornerRadius="32dp"
app:icon="@drawable/playgame_vector" />
</LinearLayout>
</HorizontalScrollView>


<TextView
android:id="@+id/text_new_game"
style="@style/TextAppearance.Material3.HeadlineLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/add_new_game"
android:textAlignment="center"
android:layout_marginBottom="8dp"
android:text="@string/tic_tac_toe"
android:textAlignment="textStart"
android:textSize="20sp" />

<Button
Expand All @@ -88,7 +123,7 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/tic_tac_toe"
android:text="@string/new_game"
android:textSize="15sp" />


Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/layout/fragment_info_page_.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/statsText"
Expand Down Expand Up @@ -82,7 +82,7 @@
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:text="Stats"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/statsCardView"
app:layout_constraintEnd_toEndOf="parent"
Expand Down Expand Up @@ -112,7 +112,7 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:text="Win Rate"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/globalRankingText_infoPage"
Expand All @@ -128,7 +128,7 @@
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:text="Ranking (Global)"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/localRankingText_infoPage"
Expand All @@ -141,7 +141,7 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:text="Ranking (Local)"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/globalRankingText_infoPage"
app:layout_constraintStart_toStartOf="@+id/tournamentWonText_infoPage"
Expand All @@ -154,7 +154,7 @@
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:text="Tournaments Won"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gamesPlayedText_infoPage"
Expand All @@ -168,7 +168,7 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:text="Games Won"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/winRateText_infoPage"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -181,7 +181,7 @@
android:layout_marginStart="5dp"
android:layout_marginBottom="4dp"
android:text="Games Played"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/gamesWonText_infoPage"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -197,7 +197,7 @@
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:text="Match History"
android:textColor="@color/tertiary2"
android:textColor="?colorTertiary"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/matchHistoryScrollView"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/res/layout/friend_card2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/friendCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/secondary"
app:cardBackgroundColor="?colorSurfaceVariant"
app:cardCornerRadius="12sp"
app:cardElevation="15dp"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -28,7 +28,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="RPSKing88"
android:textColor="@color/tertiary2"
android:textColor="?colorOnSurface"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/onlineImage"
Expand Down Expand Up @@ -67,7 +67,8 @@
android:src="@drawable/challenge_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:tint="?colorPrimary" />

<ImageButton
android:id="@+id/infoButton"
Expand All @@ -80,7 +81,8 @@
android:src="@drawable/info_vector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/playButton"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:tint="?colorPrimary" />

<TextView
android:id="@+id/winRateText"
Expand All @@ -90,7 +92,7 @@
android:lines="3"
android:maxLines="3"
android:text="Win Rate: 63.3%"
android:textColor="@color/tertiary2"
android:textColor="?colorOnSurface"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/infoButton"
Expand All @@ -104,7 +106,7 @@
android:lines="3"
android:maxLines="3"
android:text="Games Played: 120"
android:textColor="@color/tertiary2"
android:textColor="?colorOnSurface"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/gamesWonText"
app:layout_constraintEnd_toStartOf="@+id/infoButton"
Expand All @@ -117,7 +119,7 @@
android:lines="3"
android:maxLines="3"
android:text="Games Won: 76"
android:textColor="@color/tertiary2"
android:textColor="?colorOnSurface"
android:textSize="10sp"
app:layout_constraintBottom_toTopOf="@+id/winRateText"
app:layout_constraintEnd_toStartOf="@+id/infoButton"
Expand Down
20 changes: 0 additions & 20 deletions app/src/main/res/values/colors.xml

This file was deleted.

Loading

0 comments on commit ac00d98

Please sign in to comment.