Skip to content

Commit 61ca19d

Browse files
committed
adding a setting item for changing the font size
1 parent affba64 commit 61ca19d

File tree

3 files changed

+54
-7
lines changed

3 files changed

+54
-7
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ android {
5858
}
5959

6060
dependencies {
61-
implementation 'com.simplemobiletools:commons:5.22.19'
61+
implementation 'com.simplemobiletools:commons:5.22.20'
6262
implementation 'com.github.Stericson:RootTools:df729dcb13'
6363
implementation 'com.github.Stericson:RootShell:1.6'
6464
implementation 'com.alexvasilkov:gesture-views:2.5.2'

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

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import android.os.Bundle
55
import android.view.Menu
66
import com.simplemobiletools.commons.dialogs.ChangeDateTimeFormatDialog
77
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
8+
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
89
import com.simplemobiletools.commons.dialogs.SecurityDialog
9-
import com.simplemobiletools.commons.extensions.beVisibleIf
10-
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
11-
import com.simplemobiletools.commons.extensions.handleHiddenFolderPasswordProtection
12-
import com.simplemobiletools.commons.extensions.updateTextColors
13-
import com.simplemobiletools.commons.helpers.PROTECTION_FINGERPRINT
14-
import com.simplemobiletools.commons.helpers.SHOW_ALL_TABS
10+
import com.simplemobiletools.commons.extensions.*
11+
import com.simplemobiletools.commons.helpers.*
12+
import com.simplemobiletools.commons.models.RadioItem
1513
import com.simplemobiletools.filemanager.pro.R
1614
import com.simplemobiletools.filemanager.pro.extensions.config
1715
import com.simplemobiletools.filemanager.pro.helpers.RootHelpers
@@ -31,6 +29,7 @@ class SettingsActivity : SimpleActivity() {
3129
setupUseEnglish()
3230
setupManageFavorites()
3331
setupChangeDateTimeFormat()
32+
setupFontSize()
3433
setupShowHidden()
3534
setupHiddenItemPasswordProtection()
3635
setupAppPasswordProtection()
@@ -83,6 +82,22 @@ class SettingsActivity : SimpleActivity() {
8382
}
8483
}
8584

85+
private fun setupFontSize() {
86+
settings_font_size.text = getFontSizeText()
87+
settings_font_size_holder.setOnClickListener {
88+
val items = arrayListOf(
89+
RadioItem(FONT_SIZE_SMALL, getString(R.string.small)),
90+
RadioItem(FONT_SIZE_MEDIUM, getString(R.string.medium)),
91+
RadioItem(FONT_SIZE_LARGE, getString(R.string.large)),
92+
RadioItem(FONT_SIZE_EXTRA_LARGE, getString(R.string.extra_large)))
93+
94+
RadioGroupDialog(this@SettingsActivity, items, config.fontSize) {
95+
config.fontSize = it as Int
96+
settings_font_size.text = getFontSizeText()
97+
}
98+
}
99+
}
100+
86101
private fun setupShowHidden() {
87102
settings_show_hidden.isChecked = config.showHidden
88103
settings_show_hidden_holder.setOnClickListener {

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,38 @@
9999

100100
</RelativeLayout>
101101

102+
<RelativeLayout
103+
android:id="@+id/settings_font_size_holder"
104+
android:layout_width="match_parent"
105+
android:layout_height="wrap_content"
106+
android:layout_marginTop="@dimen/medium_margin"
107+
android:background="?attr/selectableItemBackground"
108+
android:paddingLeft="@dimen/normal_margin"
109+
android:paddingTop="@dimen/activity_margin"
110+
android:paddingRight="@dimen/normal_margin"
111+
android:paddingBottom="@dimen/activity_margin">
112+
113+
<com.simplemobiletools.commons.views.MyTextView
114+
android:id="@+id/settings_font_size_label"
115+
android:layout_width="match_parent"
116+
android:layout_height="wrap_content"
117+
android:layout_centerVertical="true"
118+
android:layout_toStartOf="@+id/settings_font_size"
119+
android:paddingLeft="@dimen/medium_margin"
120+
android:paddingRight="@dimen/medium_margin"
121+
android:text="@string/font_size"/>
122+
123+
<com.simplemobiletools.commons.views.MyTextView
124+
android:id="@+id/settings_font_size"
125+
android:layout_width="wrap_content"
126+
android:layout_height="wrap_content"
127+
android:layout_alignParentEnd="true"
128+
android:layout_marginEnd="@dimen/medium_margin"
129+
android:background="@null"
130+
android:clickable="false"/>
131+
132+
</RelativeLayout>
133+
102134
<View
103135
android:id="@+id/visibility_divider"
104136
android:layout_width="match_parent"

0 commit comments

Comments
 (0)