Browse Source

Merge branch 'lukeswitz-settings_layout_fix'

n8fr8 7 months ago
parent
commit
a419ec79a1
2 changed files with 44 additions and 15 deletions
  1. 5 1
      build.gradle
  2. 39 14
      src/main/res/xml/settings.xml

+ 5 - 1
build.gradle

@@ -133,11 +133,15 @@ android {
133 133
     }
134 134
 }
135 135
 
136
+configurations {
137
+    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
138
+}
139
+
136 140
 dependencies {
137 141
     implementation 'androidx.appcompat:appcompat:1.0.2'
138 142
     implementation 'androidx.cardview:cardview:1.0.0'
139 143
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
140
-    implementation 'androidx.preference:preference:1.0.0'
144
+    implementation 'androidx.preference:preference:1.1.0-alpha03'
141 145
     implementation 'androidx.multidex:multidex:2.0.1'
142 146
     implementation 'androidx.annotation:annotation:1.0.1'
143 147
     implementation 'com.google.android.material:material:1.0.0'

+ 39 - 14
src/main/res/xml/settings.xml

@@ -1,11 +1,14 @@
1
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
1
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:app="http://schemas.android.com/apk/res-auto">
2 3
 
3 4
 
4 5
     <Preference
6
+        app:iconSpaceReserved="false"
5 7
         android:key="config_delay_time"
6 8
         android:title="@string/timer_delay_label" />
7 9
 
8 10
     <EditTextPreference
11
+        app:iconSpaceReserved="false"
9 12
         android:dialogLayout="@layout/pref_dialog_edit_text"
10 13
         android:dialogMessage="@string/config_storage_page_hint"
11 14
         android:key="config_base_storage"
@@ -16,24 +19,32 @@
16 19
         />
17 20
 
18 21
     <Preference
22
+        app:iconSpaceReserved="false"
19 23
         android:key="config_battery_optimizations"
20 24
         android:title="@string/disable_battery_opt_title"
21 25
         android:summary="@string/disable_battery_opt_summary"/>
22 26
 
23
-    <PreferenceCategory android:title="@string/video_settings">
27
+    <PreferenceCategory
28
+        app:iconSpaceReserved="false"
29
+        android:title="@string/video_settings">
24 30
         <Preference
31
+            app:iconSpaceReserved="false"
25 32
             android:key="config_video_length"
26 33
             android:title="@string/config_video_length_label" />
27 34
 
28 35
         <SwitchPreference
36
+            app:iconSpaceReserved="false"
29 37
             android:defaultValue="false"
30 38
             android:key="@string/video_active_preference_key"
31 39
             android:title="@string/video_monitoring"/>
32 40
     </PreferenceCategory>
33 41
 
34
-    <PreferenceCategory android:title="@string/sensors">
42
+    <PreferenceCategory
43
+        app:iconSpaceReserved="false"
44
+        android:title="@string/sensors">
35 45
 
36 46
         <ListPreference
47
+            app:iconSpaceReserved="false"
37 48
             android:entries="@array/camera"
38 49
             android:entryValues="@array/camera_alias"
39 50
             android:key="camera"
@@ -41,28 +52,34 @@
41 52
             android:title="@string/camera_prompt" />
42 53
 
43 54
         <Preference
55
+            app:iconSpaceReserved="false"
44 56
             android:key="camera_sensitivity"
45 57
             android:title="@string/camera_sensitivity" />
46 58
 
47 59
         <Preference
60
+            app:iconSpaceReserved="false"
48 61
             android:key="config_sound"
49 62
             android:title="@string/microphone_sensitivity" />
50 63
 
51 64
         <Preference
65
+            app:iconSpaceReserved="false"
52 66
             android:key="config_movement"
53 67
             android:title="@string/accelerometer_prompt" />
54 68
 
55
-
56 69
     </PreferenceCategory>
57
-    <PreferenceCategory android:title="@string/label_notifications">
70
+
71
+    <PreferenceCategory
72
+        app:iconSpaceReserved="false"
73
+        android:title="@string/label_notifications">
58 74
 
59 75
         <SwitchPreference
76
+            app:iconSpaceReserved="false"
60 77
             android:defaultValue="false"
61 78
             android:key="remote_notification_active"
62 79
             android:title="@string/remote_notification_label" />
63 80
 
64 81
         <EditTextPreference
65
-            style="@style/AppPreference.DialogPreferenceSave"
82
+            app:iconSpaceReserved="false"
66 83
             android:dialogLayout="@layout/pref_dialog_edit_text_hint"
67 84
             android:dialogMessage="@string/sms_dialog_message"
68 85
             android:inputType="phone"
@@ -71,7 +88,7 @@
71 88
             android:title="@string/phone_number" />
72 89
 
73 90
         <EditTextPreference
74
-            style="@style/AppPreference.DialogPreferenceRegister"
91
+            app:iconSpaceReserved="false"
75 92
             android:dialogLayout="@layout/pref_dialog_edit_text_hint_signal"
76 93
             android:dialogMessage="@string/register_signal_desc"
77 94
             android:inputType="phone"
@@ -80,7 +97,7 @@
80 97
             android:title="@string/signal_number" />
81 98
 
82 99
         <EditTextPreference
83
-            style="@style/AppPreference.DialogPreferenceVerify"
100
+            app:iconSpaceReserved="false"
84 101
             android:dialogLayout="@layout/pref_dialog_edit_text"
85 102
             android:dialogMessage="@string/enter_verification"
86 103
             android:inputType="number"
@@ -89,25 +106,27 @@
89 106
             android:title="@string/verify_signal" />
90 107
 
91 108
         <EditTextPreference
92
-            style="@style/AppPreference.DialogPreferenceSave"
109
+            app:iconSpaceReserved="false"
93 110
             android:dialogLayout="@layout/pref_dialog_edit_text"
94 111
             android:dialogMessage="@string/notification_time_dialog"
95 112
             android:inputType="number"
96 113
             android:key="notification_time"
97 114
             android:summary="@string/notification_time_summary"
98
-            android:title="@string/notification_time"
99
-            />
115
+            android:title="@string/notification_time" />
100 116
 
101 117
     </PreferenceCategory>
102
-    <PreferenceCategory android:title="@string/hearbeat_monitor">
118
+    <PreferenceCategory
119
+        app:iconSpaceReserved="false"
120
+        android:title="@string/hearbeat_monitor">
103 121
 
104 122
         <SwitchPreference
123
+            app:iconSpaceReserved="false"
105 124
             android:defaultValue="false"
106 125
             android:key="heartbeat_monitor_active"
107 126
             android:title="@string/hearbeat_monitor_enable" />
108 127
 
109 128
         <EditTextPreference
110
-            style="@style/AppPreference.DialogPreferenceSave"
129
+            app:iconSpaceReserved="false"
111 130
             android:dialogLayout="@layout/pref_dialog_edit_text"
112 131
             android:dialogMessage="@string/heartbeat_time_dialog"
113 132
             android:inputType="number"
@@ -116,6 +135,7 @@
116 135
             android:title="@string/hearbeat_monitor_summary"/>
117 136
 
118 137
         <EditTextPreference
138
+            app:iconSpaceReserved="false"
119 139
             android:dialogLayout="@layout/pref_dialog_edit_text"
120 140
             android:dialogMessage="@string/hearbeat_message_dialog"
121 141
             android:inputType="text"
@@ -124,15 +144,19 @@
124 144
             android:summary="@string/hearbeat_message_summary" />
125 145
 
126 146
     </PreferenceCategory>
127
-    <PreferenceCategory android:title="@string/remote_access">
147
+    <PreferenceCategory
148
+        app:iconSpaceReserved="false"
149
+        android:title="@string/remote_access">
128 150
 
129 151
         <SwitchPreference
152
+            app:iconSpaceReserved="false"
130 153
             android:defaultValue="false"
131 154
             android:key="remote_access_active"
132 155
             android:summary="@string/remote_access_label"
133 156
             android:title="@string/remote_access" />
134 157
 
135 158
         <EditTextPreference
159
+            app:iconSpaceReserved="false"
136 160
             android:dialogLayout="@layout/pref_dialog_edit_text"
137 161
             android:dialogMessage="@string/remote_access_hint"
138 162
             android:key="remote_access_onion"
@@ -140,6 +164,7 @@
140 164
             android:title="@string/service_address" />
141 165
 
142 166
         <EditTextPreference
167
+            app:iconSpaceReserved="false"
143 168
             android:dialogLayout="@layout/pref_dialog_edit_password"
144 169
             android:dialogMessage="@string/remote_access_credential_hint"
145 170
             android:inputType="textPassword"