updating commons

This commit is contained in:
tibbi 2022-06-07 09:47:39 +02:00
parent f7e6b64a52
commit 0b61b08525
5 changed files with 15 additions and 19 deletions

View File

@ -62,7 +62,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:f5664f6db4' implementation 'com.github.SimpleMobileTools:Simple-Commons:faa6a972c2'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
} }

View File

@ -54,19 +54,19 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (mStoredTextColor != config.textColor) { if (mStoredTextColor != getProperTextColor()) {
getGridAdapter()?.updateTextColor(config.textColor) getGridAdapter()?.updateTextColor(getProperTextColor())
} }
if (mStoredPrimaryColor != config.primaryColor) { if (mStoredPrimaryColor != getProperPrimaryColor()) {
getGridAdapter()?.apply { getGridAdapter()?.apply {
updatePrimaryColor(config.primaryColor) updatePrimaryColor()
notifyDataSetChanged() notifyDataSetChanged()
} }
} }
updateTextColors(coordinator_layout) updateTextColors(coordinator_layout)
launchers_fastscroller.updateColors(getAdjustedPrimaryColor()) launchers_fastscroller.updateColors(getProperPrimaryColor())
} }
override fun onPause() { override fun onPause() {
@ -242,10 +242,8 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
} }
private fun storeStateVariables() { private fun storeStateVariables() {
config.apply { mStoredPrimaryColor = getProperPrimaryColor()
mStoredPrimaryColor = primaryColor mStoredTextColor = getProperTextColor()
mStoredTextColor = textColor
}
} }
override fun refreshItems() { override fun refreshItems() {

View File

@ -25,11 +25,11 @@ class SettingsActivity : SimpleActivity() {
updateTextColors(settings_holder) updateTextColors(settings_holder)
arrayOf(settings_color_customization_label, settings_general_settings_label).forEach { arrayOf(settings_color_customization_label, settings_general_settings_label).forEach {
it.setTextColor(getAdjustedPrimaryColor()) it.setTextColor(getProperPrimaryColor())
} }
arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach { arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach {
it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor()) it.background.applyColorFilter(getProperBackgroundColor().getContrastColor())
} }
} }

View File

@ -6,17 +6,15 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.applauncher.R import com.simplemobiletools.applauncher.R
import com.simplemobiletools.applauncher.extensions.config
import com.simplemobiletools.applauncher.models.AppLauncher import com.simplemobiletools.applauncher.models.AppLauncher
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor import com.simplemobiletools.commons.extensions.getProperPrimaryColor
import com.simplemobiletools.commons.extensions.getProperTextColor
import kotlinx.android.synthetic.main.item_add_launcher.view.* import kotlinx.android.synthetic.main.item_add_launcher.view.*
import java.util.*
class AddLaunchersAdapter(activity: Activity, val allLaunchers: ArrayList<AppLauncher>, val shownLaunchers: ArrayList<AppLauncher>) : class AddLaunchersAdapter(activity: Activity, val allLaunchers: ArrayList<AppLauncher>, val shownLaunchers: ArrayList<AppLauncher>) :
RecyclerView.Adapter<AddLaunchersAdapter.ViewHolder>() { RecyclerView.Adapter<AddLaunchersAdapter.ViewHolder>() {
private val config = activity.config private var textColor = activity.getProperTextColor()
private var textColor = config.textColor private var adjustedPrimaryColor = activity.getProperPrimaryColor()
private var adjustedPrimaryColor = activity.getAdjustedPrimaryColor()
private var selectedKeys = HashSet<Int>() private var selectedKeys = HashSet<Int>()
init { init {

View File

@ -191,7 +191,7 @@ class LaunchersAdapter(
} }
if (isSelected) { if (isSelected) {
launcher_check?.background?.applyColorFilter(adjustedPrimaryColor) launcher_check?.background?.applyColorFilter(properPrimaryColor)
} }
launcher_label.isVisible = activity.config.showAppName launcher_label.isVisible = activity.config.showAppName