Skip to content

Commit

Permalink
chore(settings): add icon for preferences item in top page
Browse files Browse the repository at this point in the history
Also : Upgrade dependency `fragment-ktx` to 1.3.0
  • Loading branch information
WhiredPlanck committed Jul 4, 2021
1 parent a482c71 commit 314efb9
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dependencies {
implementation "androidx.core:core-ktx:1.3.2"
implementation "androidx.appcompat:appcompat:1.3.0"
implementation "androidx.preference:preference-ktx:1.1.1"
implementation "androidx.fragment:fragment-ktx:1.2.4"
implementation "androidx.fragment:fragment-ktx:1.3.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2'
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_action_deploy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12c0,5.52 4.48,10 10,10s10,-4.48 10,-10C22,6.48 17.52,2 12,2zM16.54,15.85l-0.69,0.69c-0.39,0.39 -1.02,0.39 -1.41,0l-3.05,-3.05c-1.22,0.43 -2.64,0.17 -3.62,-0.81c-1.11,-1.11 -1.3,-2.79 -0.59,-4.1l2.35,2.35l1.41,-1.41L8.58,7.17c1.32,-0.71 2.99,-0.52 4.1,0.59c0.98,0.98 1.24,2.4 0.81,3.62l3.05,3.05C16.93,14.82 16.93,15.46 16.54,15.85z"
android:fillType="evenOdd"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_pref_input_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#828282"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM19,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.11,0 2,-0.9 2,-2L21,5c0,-1.1 -0.89,-2 -2,-2zM17.25,12c0,0.23 -0.02,0.46 -0.05,0.68l1.48,1.16c0.13,0.11 0.17,0.3 0.08,0.45l-1.4,2.42c-0.09,0.15 -0.27,0.21 -0.43,0.15l-1.74,-0.7c-0.36,0.28 -0.76,0.51 -1.18,0.69l-0.26,1.85c-0.03,0.17 -0.18,0.3 -0.35,0.3h-2.8c-0.17,0 -0.32,-0.13 -0.35,-0.29l-0.26,-1.85c-0.43,-0.18 -0.82,-0.41 -1.18,-0.69l-1.74,0.7c-0.16,0.06 -0.34,0 -0.43,-0.15l-1.4,-2.42c-0.09,-0.15 -0.05,-0.34 0.08,-0.45l1.48,-1.16c-0.03,-0.23 -0.05,-0.46 -0.05,-0.69s0.02,-0.46 0.05,-0.68l-1.48,-1.16c-0.13,-0.11 -0.17,-0.3 -0.08,-0.45l1.4,-2.42c0.09,-0.15 0.27,-0.21 0.43,-0.15l1.74,0.7c0.36,-0.28 0.76,-0.51 1.18,-0.69l0.26,-1.85c0.03,-0.17 0.18,-0.3 0.35,-0.3h2.8c0.17,0 0.32,0.13 0.35,0.29l0.26,1.85c0.43,0.18 0.82,0.41 1.18,0.69l1.74,-0.7c0.16,-0.06 0.34,0 0.43,0.15l1.4,2.42c0.09,0.15 0.05,0.34 -0.08,0.45l-1.48,1.16c0.03,0.23 0.05,0.46 0.05,0.69z"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_pref_keyboard_preference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#828282"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M3,18c0,0.55 0.45,1 1,1h5v-2L4,17c-0.55,0 -1,0.45 -1,1zM3,6c0,0.55 0.45,1 1,1h9L13,5L4,5c-0.55,0 -1,0.45 -1,1zM13,20v-1h7c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-7v-1c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1zM7,10v1L4,11c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h3v1c0,0.55 0.45,1 1,1s1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1zM21,12c0,-0.55 -0.45,-1 -1,-1h-9v2h9c0.55,0 1,-0.45 1,-1zM16,9c0.55,0 1,-0.45 1,-1L17,7h3c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-3L17,4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v4c0,0.55 0.45,1 1,1z"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_pref_other.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#828282"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M6,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_pref_schema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#828282"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M4,14h2c0.55,0 1,-0.45 1,-1v-2c0,-0.55 -0.45,-1 -1,-1L4,10c-0.55,0 -1,0.45 -1,1v2c0,0.55 0.45,1 1,1zM4,19h2c0.55,0 1,-0.45 1,-1v-2c0,-0.55 -0.45,-1 -1,-1L4,15c-0.55,0 -1,0.45 -1,1v2c0,0.55 0.45,1 1,1zM4,9h2c0.55,0 1,-0.45 1,-1L7,6c0,-0.55 -0.45,-1 -1,-1L4,5c-0.55,0 -1,0.45 -1,1v2c0,0.55 0.45,1 1,1zM9,14h10c0.55,0 1,-0.45 1,-1v-2c0,-0.55 -0.45,-1 -1,-1L9,10c-0.55,0 -1,0.45 -1,1v2c0,0.55 0.45,1 1,1zM9,19h10c0.55,0 1,-0.45 1,-1v-2c0,-0.55 -0.45,-1 -1,-1L9,15c-0.55,0 -1,0.45 -1,1v2c0,0.55 0.45,1 1,1zM8,6v2c0,0.55 0.45,1 1,1h10c0.55,0 1,-0.45 1,-1L20,6c0,-0.55 -0.45,-1 -1,-1L9,5c-0.55,0 -1,0.45 -1,1z"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_pref_theme_color.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#828282"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z"/>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/ic_pref_other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-hdpi/ic_pref_schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_pref_other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/ic_pref_schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_pref_other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/ic_pref_schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_pref_other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/ic_pref_schema.png
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 app/src/main/res/menu/preference_main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/preference__menu_deploy"
android:title="@string/pref_deploy"
android:icon="@drawable/ic_action_deploy"
app:showAsAction="ifRoom" />
<item android:id="@+id/preference__menu_help"
android:title="@string/pref_help" />
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,25 @@
<Preference android:key="pref_schemas"
android:order="4"
android:title="@string/pref_schemas"
app:icon="@drawable/ic_pref_schema"
android:summary="@string/pref_schemas_summary"/>

<Preference android:key="pref_keyboard"
android:order="5"
android:title="@string/pref_keyboard"
app:icon="@drawable/ic_pref_keyboard_preference"
android:fragment="com.osfans.trime.settings.fragments.KeyboardFragment"/>

<Preference android:key="pref_keyboard_appearance"
android:order="6"
android:title="@string/pref_keyboard_appearance"
app:icon="@drawable/ic_pref_theme_color"
android:fragment="com.osfans.trime.settings.fragments.AppearanceFragment"/>

<Preference android:key="pref_input"
android:order="8"
android:title="@string/pref_input"
app:icon="@drawable/ic_pref_input_config"
android:fragment="com.osfans.trime.settings.fragments.InputFragment"/>

<!-- <Preference android:key="pref_deploy" android:order="16"
Expand All @@ -65,6 +69,7 @@
<Preference android:key="pref_other"
android:order="17"
android:title="@string/pref_other"
app:icon="@drawable/ic_pref_other"
android:fragment="com.osfans.trime.settings.fragments.OtherFragment"/>

<!-- <PreferenceScreen android:key="pref_help" android:order="32" android:title="@string/pref_help">
Expand Down

0 comments on commit 314efb9

Please sign in to comment.