diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewAdapter.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewAdapter.kt index 454161b5c..f70c700d5 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewAdapter.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewAdapter.kt @@ -8,9 +8,7 @@ import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.commons.R import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.baseConfig -import com.simplemobiletools.commons.extensions.getContrastColor -import com.simplemobiletools.commons.extensions.getProperPrimaryColor +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.interfaces.MyActionModeCallback import com.simplemobiletools.commons.views.MyRecyclerView @@ -19,11 +17,11 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc protected val baseConfig = activity.baseConfig protected val resources = activity.resources!! protected val layoutInflater = activity.layoutInflater - protected var primaryColor = baseConfig.primaryColor + protected var textColor = activity.getProperTextColor() + protected var backgroundColor = activity.getProperBackgroundColor() + protected var rawPrimaryColor = baseConfig.primaryColor protected var properPrimaryColor = activity.getProperPrimaryColor() protected var contrastColor = properPrimaryColor.getContrastColor() - protected var textColor = baseConfig.textColor - protected var backgroundColor = baseConfig.backgroundColor protected var actModeCallback: MyActionModeCallback protected var selectedKeys = LinkedHashSet() protected var positionOffset = 0 @@ -271,7 +269,7 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc } fun updatePrimaryColor(primaryColor: Int) { - this.primaryColor = primaryColor + this.rawPrimaryColor = primaryColor properPrimaryColor = activity.getProperPrimaryColor() contrastColor = properPrimaryColor.getContrastColor() } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewListAdapter.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewListAdapter.kt index 10dd33f3f..875e9f154 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewListAdapter.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewListAdapter.kt @@ -9,9 +9,7 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.commons.R import com.simplemobiletools.commons.activities.BaseSimpleActivity -import com.simplemobiletools.commons.extensions.baseConfig -import com.simplemobiletools.commons.extensions.getContrastColor -import com.simplemobiletools.commons.extensions.getProperPrimaryColor +import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.interfaces.MyActionModeCallback import com.simplemobiletools.commons.views.MyRecyclerView @@ -25,11 +23,11 @@ abstract class MyRecyclerViewListAdapter( protected val baseConfig = activity.baseConfig protected val resources = activity.resources!! protected val layoutInflater = activity.layoutInflater - protected var primaryColor = baseConfig.primaryColor - protected var primaryPrimaryColor = activity.getProperPrimaryColor() - protected var contrastColor = primaryPrimaryColor.getContrastColor() - protected var textColor = baseConfig.textColor - protected var backgroundColor = baseConfig.backgroundColor + protected var textColor = activity.getProperTextColor() + protected var backgroundColor = activity.getProperBackgroundColor() + protected var rawPrimaryColor = baseConfig.primaryColor + protected var properPrimaryColor = activity.getProperPrimaryColor() + protected var contrastColor = properPrimaryColor.getContrastColor() protected var actModeCallback: MyActionModeCallback protected var selectedKeys = LinkedHashSet() protected var positionOffset = 0 @@ -276,9 +274,9 @@ abstract class MyRecyclerViewListAdapter( } fun updatePrimaryColor(primaryColor: Int) { - this.primaryColor = primaryColor - primaryPrimaryColor = activity.getProperPrimaryColor() - contrastColor = primaryPrimaryColor.getContrastColor() + this.rawPrimaryColor = primaryColor + properPrimaryColor = activity.getProperPrimaryColor() + contrastColor = properPrimaryColor.getContrastColor() } fun updateBackgroundColor(backgroundColor: Int) { diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/CallConfirmationDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/CallConfirmationDialog.kt index a8782aa53..3385ec7d3 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/CallConfirmationDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/CallConfirmationDialog.kt @@ -5,7 +5,7 @@ import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.R import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.applyColorFilter -import com.simplemobiletools.commons.extensions.baseConfig +import com.simplemobiletools.commons.extensions.getProperTextColor import com.simplemobiletools.commons.extensions.setupDialogStuff import kotlinx.android.synthetic.main.dialog_call_confirmation.view.* @@ -13,7 +13,7 @@ class CallConfirmationDialog(val activity: BaseSimpleActivity, val callee: Strin private var view = activity.layoutInflater.inflate(R.layout.dialog_call_confirmation, null) init { - view.call_confirm_phone.applyColorFilter(activity.baseConfig.textColor) + view.call_confirm_phone.applyColorFilter(activity.getProperTextColor()) AlertDialog.Builder(activity) .setNegativeButton(R.string.cancel, null) .create().apply { diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt index 82e855b92..65a7c4b87 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt @@ -140,7 +140,7 @@ class ColorPickerDialog( } } - val textColor = baseConfig.textColor + val textColor = activity.getProperTextColor() val builder = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok) { dialog, which -> confirmNewColor() } .setNegativeButton(R.string.cancel) { dialog, which -> dialogDismissed() } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt index 3972d9cb7..cc5db53f6 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/FilePickerDialog.kt @@ -100,7 +100,7 @@ class FilePickerDialog( (layoutParams as CoordinatorLayout.LayoutParams).bottomMargin = secondaryFabBottomMargin } - mDialogView.filepicker_placeholder.setTextColor(activity.baseConfig.textColor) + mDialogView.filepicker_placeholder.setTextColor(activity.getProperTextColor()) mDialogView.filepicker_fastscroller.updateColors(activity.getProperPrimaryColor()) mDialogView.filepicker_fab_show_hidden.apply { beVisibleIf(!showHidden && canAddShowHiddenButton) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt index 4eabf371c..241db4c56 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/PropertiesDialog.kt @@ -341,8 +341,8 @@ class PropertiesDialog() { } mInflater.inflate(R.layout.item_property, mPropertyView, false).apply { - property_value.setTextColor(mActivity.baseConfig.textColor) - property_label.setTextColor(mActivity.baseConfig.textColor) + property_value.setTextColor(mActivity.getProperTextColor()) + property_label.setTextColor(mActivity.getProperTextColor()) property_label.text = mResources.getString(labelId) property_value.text = value diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/RenameDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/RenameDialog.kt index d4ef91309..c7a33d0a2 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/RenameDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/RenameDialog.kt @@ -28,7 +28,7 @@ class RenameDialog(val activity: BaseSimpleActivity, val paths: ArrayList diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/views/PinTab.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/views/PinTab.kt index c80b405a9..24c417daa 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/views/PinTab.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/views/PinTab.kt @@ -36,7 +36,7 @@ class PinTab(context: Context, attrs: AttributeSet) : RelativeLayout(context, at pin_9.setOnClickListener { addNumber("9") } pin_c.setOnClickListener { clear() } pin_ok.setOnClickListener { confirmPIN() } - pin_ok.applyColorFilter(context.baseConfig.textColor) + pin_ok.applyColorFilter(context.getProperTextColor()) } override fun initTab(