From 2969314cc9fec78c19c482aff81fb89f1e6df3f9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 22 Oct 2017 21:34:29 +0200 Subject: [PATCH] properly update all elements if some colors change --- app/build.gradle | 2 +- .../filemanager/activities/MainActivity.kt | 2 +- .../filemanager/fragments/ItemsFragment.kt | 15 ++++++++------- app/src/main/res/layout/items_fragment.xml | 1 - 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5b2b81df..e6267f0f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.30.9' + compile 'com.simplemobiletools:commons:2.30.10' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt index f9b3767b..5118af4f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt @@ -176,7 +176,7 @@ class MainActivity : SimpleActivity() { } } else { fragment.breadcrumbs.removeBreadcrumb() - openPath(fragment.breadcrumbs.lastItem.path) + openPath(fragment.breadcrumbs.getLastItem().path) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt index 94cac535..82be9717 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt @@ -13,10 +13,7 @@ import android.view.View import android.view.ViewGroup import android.webkit.MimeTypeMap import com.simplemobiletools.commons.dialogs.StoragePickerDialog -import com.simplemobiletools.commons.extensions.deleteFiles -import com.simplemobiletools.commons.extensions.getFilenameExtension -import com.simplemobiletools.commons.extensions.getFilenameFromPath -import com.simplemobiletools.commons.extensions.toast +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.models.FileDirItem import com.simplemobiletools.commons.views.Breadcrumbs import com.simplemobiletools.commons.views.MyScalableRecyclerView @@ -67,11 +64,15 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum refreshItems() } - if (storedTextColor != config.textColor) { + context.updateTextColors(mView as ViewGroup) + mView.items_fastscroller.updateHandleColor() + val newColor = config.textColor + if (storedTextColor != newColor) { storedItems = ArrayList() - (items_list.adapter as ItemsAdapter).updateTextColor(config.textColor) + (items_list.adapter as ItemsAdapter).updateTextColor(newColor) + mView.breadcrumbs.updateColor(newColor) refreshItems() - storedTextColor = config.textColor + storedTextColor = newColor } } diff --git a/app/src/main/res/layout/items_fragment.xml b/app/src/main/res/layout/items_fragment.xml index 57f561c3..e39d695f 100644 --- a/app/src/main/res/layout/items_fragment.xml +++ b/app/src/main/res/layout/items_fragment.xml @@ -50,7 +50,6 @@ android:background="@drawable/fastscroller_handle_vertical"/> -