Skip to content

Commit

Permalink
Add resources of new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Super12138 committed Jan 20, 2024
1 parent f27df2c commit 527c2e4
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/src/main/kotlin/cn/super12138/todo/logic/Repository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ object Repository {
fun getPreferenceString(context: Context, key: String, defaultValue: String) =
SPHelper.getPreferenceString(context, key, defaultValue)


/**
* 获取应用设置的布尔值
*/
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/backup_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,3L4.99,3c-1.11,0 -1.98,0.9 -1.98,2L3,19c0,1.1 0.88,2 1.99,2L19,21c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,15h-4c0,1.66 -1.35,3 -3,3s-3,-1.34 -3,-3L4.99,15L4.99,5L19,5v10zM16,10h-2L14,7h-4v3L8,10l4,4 4,-4z" />
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/restore_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,3L4.99,3c-1.11,0 -1.98,0.9 -1.98,2L3,19c0,1.1 0.88,2 1.99,2L19,21c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,15h-4c0,1.66 -1.35,3 -3,3s-3,-1.34 -3,-3L4.99,15L4.99,5L19,5v10zM8,11h2v3h4v-3h2l-4,-4 -4,4z" />
</vector>
4 changes: 4 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@
<string name="secure_mode_summary">开启后任何人将不能对待办列表进行截屏</string>
<string name="need_restart_app">重启应用后生效</string>
<string name="restart_app_now">立即重启</string>
<string name="backup">备份数据库</string>
<string name="backup_summary">备份待办数据库</string>
<string name="restore">恢复数据库</string>
<string name="restore_summary">恢复先前备份过的待办数据库</string>
</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@
<string name="secure_mode_summary">When it opens anybody cannot take screenshot for to do list</string>
<string name="need_restart_app">Effective after restarting the app</string>
<string name="restart_app_now">Restart now</string>
<string name="backup">Backup database</string>
<string name="backup_summary">Backup to-do database</string>
<string name="restore">Restore database</string>
<string name="restore_summary">Restore the previously backed up to-do database</string>
</resources>
16 changes: 13 additions & 3 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory app:title="@string/appearance">
<ListPreference
android:icon="@drawable/dark_mode_24"
android:defaultValue="0"
android:entries="@array/appearance"
android:entryValues="@array/appearance_value"
android:icon="@drawable/dark_mode_24"
android:key="dark_mode"
android:title="@string/dark_mode"
app:summary="@string/dark_mode_summary" />
Expand All @@ -24,8 +24,18 @@
android:icon="@drawable/screenshot_24"
app:defaultValue="false"
app:key="secure_mode"
app:title="@string/secure_mode"
app:summary="@string/secure_mode_summary" />
app:summary="@string/secure_mode_summary"
app:title="@string/secure_mode" />
<Preference
android:icon="@drawable/backup_24"
app:key="backupDB"
app:summary="@string/backup_summary"
app:title="@string/backup" />
<Preference
android:icon="@drawable/restore_24"
app:key="restoreDB"
app:summary="@string/restore_summary"
app:title="@string/restore" />
</PreferenceCategory>

<PreferenceCategory android:title="@string/others">
Expand Down

0 comments on commit 527c2e4

Please sign in to comment.