Skip to content

Commit

Permalink
Settings Page Icons (#59)
Browse files Browse the repository at this point in the history
* Add protections to catch empty and whitespace names

* Reduce character limit to 15

* Add icons to Settings page and reposition settings icon on toolbar
  • Loading branch information
askariya authored Sep 1, 2024
1 parent 760c053 commit 8336300
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 10 deletions.
1 change: 1 addition & 0 deletions Artwork/ic_custom_name.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Artwork/ic_general_settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Artwork/ic_round_limit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/ic_custom_name.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="489dp"
android:height="339dp"
android:viewportWidth="366.75"
android:viewportHeight="254.25">
<group>
<clip-path
android:pathData="M68.12,40.27L297.69,40.27L297.69,212.27L68.12,212.27ZM68.12,40.27"/>
<path
android:pathData="M278.56,40.27L87.25,40.27C76.73,40.27 68.12,48.88 68.12,59.38L68.12,193.15C68.12,203.66 76.73,212.27 87.25,212.27L278.56,212.27C289.08,212.27 297.69,203.66 297.69,193.15L297.69,59.38C297.69,48.88 289.08,40.27 278.56,40.27ZM135.08,78.49C145.66,78.49 154.21,87.05 154.21,97.61C154.21,108.16 145.66,116.71 135.08,116.71C124.5,116.71 115.95,108.16 115.95,97.61C115.95,87.05 124.5,78.49 135.08,78.49ZM173.34,174.05L96.82,174.05L96.82,154.94C96.82,144.39 105.39,135.84 115.95,135.84L154.21,135.82C164.79,135.82 173.34,144.38 173.34,154.93ZM269,174.05L192.47,174.05L192.47,154.93L269,154.93ZM269,135.82L192.47,135.82L192.47,116.71L269,116.71ZM269,97.61L173.34,97.61L173.34,78.49L269,78.49ZM269,97.61"
android:fillColor="@color/color_secondary_variant2"
android:fillType="nonZero"/>
</group>
</vector>
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/ic_general_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="489dp"
android:height="339dp"
android:viewportWidth="366.75"
android:viewportHeight="254.25">
<group>
<clip-path
android:pathData="M68.12,29.07L297.69,29.07L297.69,223.5L68.12,223.5ZM68.12,29.07"/>
<path
android:pathData="M211.5,199.54C213.96,204.07 218.03,209.99 223.48,211.05C227.12,211.77 229.84,211.04 230.95,215.57C232.38,221.38 229.6,223.33 224.32,223.34L145.02,223.35C142.92,223.35 140.75,223.46 138.66,223.34C134.35,223.09 133.43,215.36 135.67,212.63C139.13,208.41 145.55,216.01 154.6,198.3C155.05,197.41 155.47,195.79 156.06,195.11L84.12,194.85C81.93,194.85 79.5,195.07 77.34,194.73L77.12,194.69C72.29,193.95 68.27,189.47 68.12,184.57L68.12,39.1C68.16,37.91 68.53,36.59 69.02,35.51C71.77,29.52 77.4,29.33 82.9,29.32L91.65,29.3L280.98,29.29C283.37,29.29 285.88,29.13 288.24,29.36C293.48,29.87 297.51,35.03 297.56,40.11L297.58,179.89C297.58,181.77 297.69,183.72 297.46,185.58C296.99,189.48 293.35,193.83 289.36,194.54C286.38,195.07 283.17,194.84 280.15,194.84L209.27,194.98C209.67,195.52 209.76,196.02 210.04,196.62ZM77.88,38.69L77.69,165.13L287.23,165.12L287.95,45.07C287.95,37.22 288.77,38.68 280.27,38.68ZM182.62,175.24C172.91,176.43 174.53,188.18 182.95,188.84C192.06,187.79 191.23,174.68 182.62,175.24ZM182.62,175.24"
android:fillColor="@color/color_secondary_variant2"
android:fillType="nonZero"/>
</group>
<path
android:pathData="M185.8,154.52L180.15,154.55C179.28,154.52 178.19,154.5 177.39,154.14L176.83,153.9C172.23,151.75 175.63,143.18 170.39,141.28L161.96,137.82C158.93,138.73 152.54,144.96 150.3,143.99C148.43,143.18 141.8,135.95 141.23,134.01C140.62,131.96 145.57,124.3 146.77,122.2C145.93,120.69 145.15,119.12 144.47,117.52C143.05,114.2 143.31,113.12 139.46,112.24L134.54,111.13C128.82,109.57 129.69,108.37 129.69,103.38C129.69,101.68 129.13,96.82 130.2,95.48C132.12,93.09 139.7,91.96 142.63,91.5L146.67,81.54L141.94,72.98C141.44,71.93 140.72,70.67 141.09,69.48C141.93,66.73 148.4,61.69 151.07,60.38C152.8,61.07 154.31,62.07 155.87,63.07L161.82,66.95C165.28,65.48 168.58,63.97 172.15,62.75C172.55,62.62 172.53,61.88 172.63,61.51L173.73,56.8C174.61,52.66 174.91,50.46 179.57,50.25L186.19,50.27C187.09,50.28 188.47,50.11 189.29,50.52C193.09,52.39 191.47,61.78 194.11,63.06C195.89,63.93 197.88,64.42 199.74,65.09L203.11,66.29C204.37,66.73 204.2,66.69 205.39,66L210.46,62.83C211.96,61.89 213.92,60.28 215.73,61.19C217.79,62.23 223.95,67.45 224.61,69.68C225.15,71.5 223.38,73.83 222.58,75.35L218.88,82.12C220.65,84.89 221.81,88.25 222.82,91.36L228.95,92.65C235.52,94.16 235.87,94.35 235.87,100.18C235.87,112.29 235.89,109.71 223.8,112.52C222.56,112.81 222.48,114.08 222.02,115.15C221.05,117.45 219.86,119.53 218.56,121.65C219.77,124.08 225.41,131.96 224.29,134.45C223.03,137.26 217.17,142.97 214.56,144.06C210.43,142.86 207.72,139.73 204.01,137.84C203.37,137.97 193.34,141.94 193.3,142C193.18,142.16 193.05,142.86 193,143.07L191.63,149.29C190.71,153 189.73,154.3 185.8,154.52ZM181.42,81.23C175.72,81.67 170.5,84.02 166.75,88.43C154.48,102.83 166.07,124.45 184.44,123.11C190.7,122.4 195.58,119.64 199.54,114.69C210.32,101.18 199.1,79.44 181.42,81.23ZM181.42,81.23"
android:fillColor="@color/color_secondary_variant2"
android:fillType="nonZero"/>
</vector>
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/ic_round_limit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="489dp"
android:height="339dp"
android:viewportWidth="366.75"
android:viewportHeight="254.25">
<group>
<clip-path
android:pathData="M98.13,29.45L267.88,29.45L267.88,223.13L98.13,223.13ZM98.13,29.45"/>
<path
android:pathData="M193.36,58.22L193.36,43.66L205.2,43.66C209.11,43.66 212.3,40.48 212.3,36.57C212.3,32.66 209.11,29.51 205.2,29.51L167.36,29.51C163.44,29.51 160.25,32.7 160.25,36.61C160.25,40.52 163.44,43.7 167.36,43.7L179.19,43.7L179.19,58.1C136.34,61.12 102.37,96.89 102.37,140.44C102.37,186 139.49,223.06 185.13,223.06C230.76,223.06 267.88,186 267.88,140.44C267.88,97.7 235.16,62.37 193.36,58.22ZM191.02,142.57L191.02,72.25C226.08,75.23 253.7,104.67 253.7,140.44C253.7,153.1 250.23,165 244.17,175.2ZM105.93,92.09C104.11,92.09 102.29,91.41 100.92,90.04C98.13,87.25 98.13,82.78 100.92,80.04L123.41,57.57C126.2,54.79 130.68,54.79 133.43,57.57C136.21,60.36 136.21,64.83 133.43,67.57L110.93,90.04C109.56,91.41 107.74,92.09 105.93,92.09ZM105.93,92.09"
android:fillColor="@color/color_secondary_variant2"
android:fillType="nonZero"/>
</group>
</vector>
13 changes: 6 additions & 7 deletions app/src/main/res/menu/toolbar_menu.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/settings_button"
android:icon="@drawable/ic_settings"
android:title="@string/title_settings"
app:showAsAction="always" />

<item
android:id="@+id/save_game_button"
android:icon="@drawable/ic_save"
Expand All @@ -20,6 +13,12 @@
android:title="@string/label_load_game"
app:showAsAction="always" />

<item
android:id="@+id/settings_button"
android:icon="@drawable/ic_settings"
android:title="@string/title_settings"
app:showAsAction="always" />

<item
android:id="@+id/submit_button"
android:icon="@null"
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">

<PreferenceCategory app:title="@string/general_header">
<PreferenceCategory app:title="@string/general_header"
app:icon="@drawable/ic_general_settings">
<SwitchPreferenceCompat
app:key="show-scoreboard-on-submit"
app:summaryOn="@string/show_score_switch_summary_on"
Expand All @@ -9,7 +10,8 @@
app:defaultValue="true"/>
</PreferenceCategory>

<PreferenceCategory app:title="@string/round_limit_header">
<PreferenceCategory app:title="@string/round_limit_header"
app:icon="@drawable/ic_round_limit">
<SwitchPreferenceCompat
app:key="round-limit"
app:summaryOn="@string/round_limit_summary_on"
Expand All @@ -26,7 +28,8 @@
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>

<PreferenceCategory app:title="@string/custom_names_header">
<PreferenceCategory app:title="@string/custom_names_header"
app:icon="@drawable/ic_custom_name">
<SwitchPreferenceCompat
app:key="custom-names"
app:summaryOn="@string/custom_names_summary_on"
Expand Down

0 comments on commit 8336300

Please sign in to comment.