Skip to content

Commit 872bc17

Browse files
committed
add subsections to settings
1 parent 3ba41af commit 872bc17

File tree

2 files changed

+90
-13
lines changed

2 files changed

+90
-13
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/activities/SettingsActivity.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import android.content.Intent
44
import android.os.Bundle
55
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
66
import com.simplemobiletools.commons.dialogs.SecurityDialog
7-
import com.simplemobiletools.commons.extensions.beVisibleIf
8-
import com.simplemobiletools.commons.extensions.handleHiddenFolderPasswordProtection
9-
import com.simplemobiletools.commons.extensions.updateTextColors
10-
import com.simplemobiletools.commons.extensions.useEnglishToggled
7+
import com.simplemobiletools.commons.extensions.*
118
import com.simplemobiletools.commons.helpers.PROTECTION_FINGERPRINT
129
import com.simplemobiletools.commons.helpers.SHOW_ALL_TABS
1310
import com.simplemobiletools.filemanager.R
@@ -34,6 +31,14 @@ class SettingsActivity : SimpleActivity() {
3431
setupShowInfoBubble()
3532
setupEnableRootAccess()
3633
updateTextColors(settings_holder)
34+
setupSectionColors()
35+
}
36+
37+
private fun setupSectionColors() {
38+
val adjustedPrimaryColor = getAdjustedPrimaryColor()
39+
arrayListOf(visibility_label, file_operations_label, scrolling_label, security_label).forEach {
40+
it.setTextColor(adjustedPrimaryColor)
41+
}
3742
}
3843

3944
private fun setupCustomizeColors() {

app/src/main/res/layout/activity_settings.xml

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@
6969

7070
</RelativeLayout>
7171

72+
<View
73+
android:id="@+id/visibility_divider"
74+
android:layout_width="match_parent"
75+
android:layout_height="1px"
76+
android:background="@color/divider_grey"
77+
android:importantForAccessibility="no"/>
78+
79+
<com.simplemobiletools.commons.views.MyTextView
80+
android:id="@+id/visibility_label"
81+
android:layout_width="wrap_content"
82+
android:layout_height="wrap_content"
83+
android:layout_marginLeft="@dimen/big_margin"
84+
android:layout_marginStart="@dimen/big_margin"
85+
android:layout_marginTop="@dimen/activity_margin"
86+
android:text="@string/visibility"
87+
android:textAllCaps="true"
88+
android:textSize="@dimen/smaller_text_size"/>
89+
7290
<RelativeLayout
7391
android:id="@+id/settings_show_hidden_holder"
7492
android:layout_width="match_parent"
@@ -89,63 +107,117 @@
89107

90108
</RelativeLayout>
91109

110+
<View
111+
android:id="@+id/file_operations_divider"
112+
android:layout_width="match_parent"
113+
android:layout_height="1px"
114+
android:background="@color/divider_grey"
115+
android:importantForAccessibility="no"/>
116+
117+
<com.simplemobiletools.commons.views.MyTextView
118+
android:id="@+id/file_operations_label"
119+
android:layout_width="wrap_content"
120+
android:layout_height="wrap_content"
121+
android:layout_marginLeft="@dimen/big_margin"
122+
android:layout_marginStart="@dimen/big_margin"
123+
android:layout_marginTop="@dimen/activity_margin"
124+
android:text="@string/file_operations"
125+
android:textAllCaps="true"
126+
android:textSize="@dimen/smaller_text_size"/>
127+
92128
<RelativeLayout
93-
android:id="@+id/settings_password_protection_holder"
129+
android:id="@+id/settings_keep_last_modified_holder"
94130
android:layout_width="match_parent"
95131
android:layout_height="wrap_content"
96132
android:layout_marginTop="@dimen/medium_margin"
97133
android:background="?attr/selectableItemBackground"
98134
android:padding="@dimen/activity_margin">
99135

100136
<com.simplemobiletools.commons.views.MySwitchCompat
101-
android:id="@+id/settings_password_protection"
137+
android:id="@+id/settings_keep_last_modified"
102138
android:layout_width="match_parent"
103139
android:layout_height="wrap_content"
104140
android:background="@null"
105141
android:clickable="false"
106142
android:paddingLeft="@dimen/medium_margin"
107143
android:paddingStart="@dimen/medium_margin"
108-
android:text="@string/password_protect_hidden_items"/>
144+
android:text="@string/keep_last_modified"/>
109145

110146
</RelativeLayout>
111147

148+
<View
149+
android:id="@+id/scrolling_divider"
150+
android:layout_width="match_parent"
151+
android:layout_height="1px"
152+
android:background="@color/divider_grey"
153+
android:importantForAccessibility="no"/>
154+
155+
<com.simplemobiletools.commons.views.MyTextView
156+
android:id="@+id/scrolling_label"
157+
android:layout_width="wrap_content"
158+
android:layout_height="wrap_content"
159+
android:layout_marginLeft="@dimen/big_margin"
160+
android:layout_marginStart="@dimen/big_margin"
161+
android:layout_marginTop="@dimen/activity_margin"
162+
android:text="@string/scrolling"
163+
android:textAllCaps="true"
164+
android:textSize="@dimen/smaller_text_size"/>
165+
112166
<RelativeLayout
113-
android:id="@+id/settings_keep_last_modified_holder"
167+
android:id="@+id/settings_show_info_bubble_holder"
114168
android:layout_width="match_parent"
115169
android:layout_height="wrap_content"
116170
android:layout_marginTop="@dimen/medium_margin"
117171
android:background="?attr/selectableItemBackground"
118172
android:padding="@dimen/activity_margin">
119173

120174
<com.simplemobiletools.commons.views.MySwitchCompat
121-
android:id="@+id/settings_keep_last_modified"
175+
android:id="@+id/settings_show_info_bubble"
122176
android:layout_width="match_parent"
123177
android:layout_height="wrap_content"
124178
android:background="@null"
125179
android:clickable="false"
126180
android:paddingLeft="@dimen/medium_margin"
127181
android:paddingStart="@dimen/medium_margin"
128-
android:text="@string/keep_last_modified"/>
182+
android:text="@string/show_info_bubble"/>
129183

130184
</RelativeLayout>
131185

186+
<View
187+
android:id="@+id/security_divider"
188+
android:layout_width="match_parent"
189+
android:layout_height="1px"
190+
android:background="@color/divider_grey"
191+
android:importantForAccessibility="no"/>
192+
193+
<com.simplemobiletools.commons.views.MyTextView
194+
android:id="@+id/security_label"
195+
android:layout_width="wrap_content"
196+
android:layout_height="wrap_content"
197+
android:layout_marginLeft="@dimen/big_margin"
198+
android:layout_marginStart="@dimen/big_margin"
199+
android:layout_marginTop="@dimen/activity_margin"
200+
android:text="@string/security"
201+
android:textAllCaps="true"
202+
android:textSize="@dimen/smaller_text_size"/>
203+
132204
<RelativeLayout
133-
android:id="@+id/settings_show_info_bubble_holder"
205+
android:id="@+id/settings_password_protection_holder"
134206
android:layout_width="match_parent"
135207
android:layout_height="wrap_content"
136208
android:layout_marginTop="@dimen/medium_margin"
137209
android:background="?attr/selectableItemBackground"
138210
android:padding="@dimen/activity_margin">
139211

140212
<com.simplemobiletools.commons.views.MySwitchCompat
141-
android:id="@+id/settings_show_info_bubble"
213+
android:id="@+id/settings_password_protection"
142214
android:layout_width="match_parent"
143215
android:layout_height="wrap_content"
144216
android:background="@null"
145217
android:clickable="false"
146218
android:paddingLeft="@dimen/medium_margin"
147219
android:paddingStart="@dimen/medium_margin"
148-
android:text="@string/show_info_bubble"/>
220+
android:text="@string/password_protect_hidden_items"/>
149221

150222
</RelativeLayout>
151223

0 commit comments

Comments
 (0)