aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-07-02 10:59:53 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-07-02 10:59:53 +0000
commit9a4edde8fb5550b5caa66eeaba4e686a6b1ff442 (patch)
tree2fa363d68d03164031aa40dbe41580a84a184b3f /app/src/main/res
parent3a72c5a1f8f37010459794a4c6e80e0141030907 (diff)
downloadinfinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.tar
infinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.tar.gz
infinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.tar.bz2
infinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.tar.lz
infinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.tar.xz
infinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.tar.zst
infinity-for-reddit-9a4edde8fb5550b5caa66eeaba4e686a6b1ff442.zip
Add an option to change time format. Properly show message time in ViewPrivateMessagesActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/res/values/arrays.xml50
-rw-r--r--app/src/main/res/values/strings.xml1
-rw-r--r--app/src/main/res/xml/interface_preference.xml7
-rw-r--r--app/src/main/res/xml/time_format_preferences.xml16
4 files changed, 70 insertions, 4 deletions
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 3efd7c75..2d8cdce0 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -168,4 +168,54 @@
<item>4</item>
<item>5</item>
</string-array>
+
+ <string-array name="settings_time_format">
+ <item>Jan 2, 2020, 01:00</item>
+ <item>Jan 2, 2020, 01:00 PM</item>
+ <item>2 Jan, 2020, 01:00</item>
+ <item>2 Jan, 2020, 01:00 PM</item>
+ <item>1/2/2020 01:00 (Month first)</item>
+ <item>1/2/2020 01:00 PM (Month first)</item>
+ <item>2/1/2020 01:00 (Day first)</item>
+ <item>2/1/2020 01:00 PM (Day first)</item>
+ <item>2020/1/2 01:00 (Month first)</item>
+ <item>2020/1/2 01:00 PM (Month first)</item>
+ <item>1-2-2020 01:00 (Month first)</item>
+ <item>1-2-2020 01:00 PM (Month first)</item>
+ <item>2-1-2020 01:00 (Day first)</item>
+ <item>2-1-2020 01:00 PM (Day first)</item>
+ <item>2020-1-2 01:00 (Month first)</item>
+ <item>2020-1-2 01:00 PM (Month first)</item>
+ <item>1.2.2020 01:00 (Month first)</item>
+ <item>1.2.2020 01:00 PM (Month first)</item>
+ <item>2.1.2020 01:00 (Day first)</item>
+ <item>2.1.2020 01:00 PM (Day first)</item>
+ <item>2020.1.2 01:00 (Month first)</item>
+ <item>2020.1.2 01:00 PM (Month first)</item>
+ </string-array>
+
+ <string-array name="settings_time_format_values">
+ <item>MMM d, yyyy, HH:mm</item>
+ <item>MMM d, yyyy, hh:mm a</item>
+ <item>d MMM yyyy, HH:mm</item>
+ <item>d MMM yyyy, hh:mm a</item>
+ <item>M/d/yyyy HH:mm</item>
+ <item>M/d/yyyy hh:mm a</item>
+ <item>d/M/yyyy HH:mm</item>
+ <item>d/M/yyyy hh:mm a</item>
+ <item>yyyy/M/d HH:mm</item>
+ <item>yyyy/M/d hh:mm a</item>
+ <item>M-d-yyyy HH:mm</item>
+ <item>M-d-yyyy hh:mm a</item>
+ <item>d-M-yyyy HH:mm</item>
+ <item>d-M-yyyy hh:mm a</item>
+ <item>yyyy-M-d HH:mm</item>
+ <item>yyyy-M-d hh:mm a</item>
+ <item>M.d.yyyy HH:mm</item>
+ <item>M.d.yyyy hh:mm a</item>
+ <item>d.M.yyyy HH:mm</item>
+ <item>d.M.yyyy hh:mm a</item>
+ <item>yyyy.M.d HH:mm</item>
+ <item>yyyy.M.d hh:mm a</item>
+ </string-array>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 5d78d9d8..8c874679 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -355,6 +355,7 @@
<string name="settings_comment_toolbar_hidden">Comment Toolbar Hidden by Default</string>
<string name="settings_show_absolute_number_of_votes_title">Show Absolute Number of Votes</string>
<string name="settings_show_elapsed_time">Show Elapsed Time in Posts and Comments</string>
+ <string name="settings_time_format_title">Time Format</string>
<string name="settings_default_post_layout">Default Post Layout</string>
<string name="settings_show_divider_in_compact_layout">Show Divider in Compact Layout</string>
<string name="settings_show_thumbnail_on_the_right_in_compact_layout">Show Thumbnail on the Right in Compact Layout</string>
diff --git a/app/src/main/res/xml/interface_preference.xml b/app/src/main/res/xml/interface_preference.xml
index d2525eb6..900ee84d 100644
--- a/app/src/main/res/xml/interface_preference.xml
+++ b/app/src/main/res/xml/interface_preference.xml
@@ -27,10 +27,9 @@
app:key="vote_buttons_on_the_right"
app:title="@string/settings_vote_buttons_on_the_right_title" />
- <SwitchPreference
- app:defaultValue="false"
- app:key="show_elapsed_time"
- app:title="@string/settings_show_elapsed_time" />
+ <Preference
+ app:title="@string/settings_time_format_title"
+ app:fragment="ml.docilealligator.infinityforreddit.Settings.TimeFormatPreferenceFragment" />
<ListPreference
app:defaultValue="0"
diff --git a/app/src/main/res/xml/time_format_preferences.xml b/app/src/main/res/xml/time_format_preferences.xml
new file mode 100644
index 00000000..a6080d32
--- /dev/null
+++ b/app/src/main/res/xml/time_format_preferences.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="show_elapsed_time"
+ app:title="@string/settings_show_elapsed_time" />
+
+ <ListPreference
+ app:defaultValue="MMM d, yyyy, HH:mm"
+ app:entries="@array/settings_time_format"
+ app:entryValues="@array/settings_time_format_values"
+ app:key="time_format"
+ app:title="@string/settings_time_format_title"
+ app:useSimpleSummaryProvider="true" />
+</PreferenceScreen> \ No newline at end of file