From 6a49ff4cf7e3d9bd1934d7c85c120275b0070604 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 10 Mar 2020 11:27:37 +0100 Subject: [PATCH] fix #46, allow changing the font size --- .../filemanager/pro/adapters/ItemsAdapter.kt | 17 +++++++++++++++++ .../filemanager/pro/fragments/ItemsFragment.kt | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt index 1c1096c1..4e3a7e55 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt @@ -12,6 +12,7 @@ import android.graphics.drawable.Drawable import android.graphics.drawable.Icon import android.graphics.drawable.LayerDrawable import android.net.Uri +import android.util.TypedValue import android.view.Menu import android.view.View import android.view.ViewGroup @@ -61,11 +62,15 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList() private var storedTextColor = 0 + private var storedFontSize = 0 lateinit var mView: View @@ -92,6 +93,12 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb storedTextColor = newTextColor } + val configFontSize = context!!.config.fontSize + if (storedFontSize != configFontSize) { + getRecyclerAdapter()?.updateFontSizes() + storedFontSize = configFontSize + } + mView.items_fastscroller.updateBubbleColors() mView.items_fastscroller.allowBubbleDisplay = true if (!isFirstResume) { @@ -109,6 +116,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb private fun storeStateVariables() { context!!.config.apply { storedTextColor = textColor + storedFontSize = fontSize } }