Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstefan-niedermann <info@niedermann.it>2019-12-14 00:20:31 +0300
committerstefan-niedermann <info@niedermann.it>2019-12-14 00:20:31 +0300
commit72fd49a31c2ed298e9f9ee58afcaf8097236dd99 (patch)
treef3f845ed3fcd1d00c2fb33783938332003c9ea56 /app/src/main/res
parent1e90cad2b2a8cfed31eed5e5ce5fe0fcb82f9e74 (diff)
#230 Background synchronization
Make setting to en/disable the background sync (Off, 15 Minutes, 1 Hour, 6 Hours)
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml6
-rw-r--r--app/src/main/res/values/setup.xml20
-rw-r--r--app/src/main/res/values/strings.xml5
-rw-r--r--app/src/main/res/xml/settings.xml12
4 files changed, 41 insertions, 2 deletions
diff --git a/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml b/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml
new file mode 100644
index 000000000..1c3b9a41c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml
@@ -0,0 +1,6 @@
+<vector android:autoMirrored="true" android:height="24dp"
+ android:tint="#757575" android:viewportHeight="24.0"
+ android:viewportWidth="24.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillAlpha=".3" android:fillColor="#FF000000" android:pathData="M12.01,21.49L23.64,7c-0.45,-0.34 -4.93,-4 -11.64,-4C5.28,3 0.81,6.66 0.36,7l11.63,14.49 0.01,0.01 0.01,-0.01z"/>
+ <path android:fillColor="#FF000000" android:pathData="M3.53,10.95l8.46,10.54 0.01,0.01 0.01,-0.01 8.46,-10.54C20.04,10.62 16.81,8 12,8c-4.81,0 -8.04,2.62 -8.47,2.95z"/>
+</vector>
diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml
index f25e3291b..e9b860fba 100644
--- a/app/src/main/res/values/setup.xml
+++ b/app/src/main/res/values/setup.xml
@@ -6,6 +6,26 @@
<string name="pref_key_wifi_only" translatable="false">wifiOnly</string>
<string name="pref_key_dark_theme" translatable="false">darkTheme</string>
+ <string name="pref_key_background_sync" translatable="false">backgroundSync</string>
+
+ <string name="pref_value_background_sync_off">off</string>
+ <string name="pref_value_background_15_minutes">15_minutes</string>
+ <string name="pref_value_background_1_hour">1_hour</string>
+ <string name="pref_value_background_6_hours">6_hours</string>
+
+ <string-array name="background_sync_entries">
+ <item>@string/simple_off</item>
+ <item>@string/minutes_15</item>
+ <item>@string/hour_1</item>
+ <item>@string/hours_6</item>
+ </string-array>
+
+ <string-array name="background_sync_values">
+ <item>@string/pref_value_background_sync_off</item>
+ <item>@string/pref_value_background_15_minutes</item>
+ <item>@string/pref_value_background_1_hour</item>
+ <item>@string/pref_value_background_6_hours</item>
+ </string-array>
<!-- To be concatenated with the account id -->
<string name="shared_preference_last_board_for_account_" translatable="false">it.niedermann.nextcloud.deck.last_board_for_account_</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d571b42cd..35d8f2eb5 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -130,6 +130,7 @@
<string name="simple_rename">Rename</string>
<string name="simple_settings">Settings</string>
<string name="settings_theme_title">Dark theme</string>
+ <string name="settings_background_sync">Background synchronization</string>
<string name="pref_value_wifi_and_mobile">Sync on Wi-Fi and mobile data</string>
<string name="pref_value_wifi_only">Sync only on Wi-Fi</string>
<string name="pref_value_theme_light">Light</string>
@@ -149,4 +150,8 @@
<string name="delete_attachment">Delete %1$s</string>
<string name="no_content">No content yet</string>
<string name="last_background_sync">Last background sync:</string>
+ <string name="simple_off">Off</string>
+ <string name="minutes_15">15 Minutes</string>
+ <string name="hour_1">1 Hour</string>
+ <string name="hours_6">6 Hours</string>
</resources>
diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml
index 98a7220fa..6a24dce9e 100644
--- a/app/src/main/res/xml/settings.xml
+++ b/app/src/main/res/xml/settings.xml
@@ -3,14 +3,22 @@
<SwitchPreference
android:defaultValue="@string/pref_value_wifi_and_mobile"
- android:icon="@drawable/ic_sync_grey600_24dp"
+ android:icon="@drawable/ic_network_wifi_grey600_24dp"
android:key="@string/pref_key_wifi_only"
android:title="@string/pref_value_wifi_only" />
+ <ListPreference
+ android:defaultValue="@string/minutes_15"
+ android:entries="@array/background_sync_entries"
+ android:entryValues="@array/background_sync_values"
+ android:icon="@drawable/ic_sync_grey600_24dp"
+ android:key="@string/pref_key_background_sync"
+ android:summary="%s"
+ android:title="@string/settings_background_sync" />
+
<SwitchPreference
android:defaultValue="@string/pref_value_theme_light"
android:icon="@drawable/ic_brightness_2_grey600_24dp"
android:key="@string/pref_key_dark_theme"
android:title="@string/settings_theme_title" />
-
</PreferenceScreen>