diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 655030ea..77e91fe4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,14 +25,17 @@ android:theme="@style/AppTheme"> @@ -42,8 +45,9 @@ + android:parentActivityName=".activities.MainActivity"> @@ -53,16 +57,19 @@ @@ -76,6 +83,7 @@ @@ -89,6 +97,7 @@ @@ -102,6 +111,7 @@ @@ -115,6 +125,7 @@ @@ -128,6 +139,7 @@ @@ -141,6 +153,7 @@ @@ -154,6 +167,7 @@ @@ -167,6 +181,7 @@ @@ -180,6 +195,7 @@ @@ -193,6 +209,7 @@ @@ -206,6 +223,7 @@ @@ -219,6 +237,7 @@ @@ -232,6 +251,7 @@ @@ -245,6 +265,7 @@ @@ -258,6 +279,7 @@ @@ -270,6 +292,7 @@ @@ -283,6 +306,7 @@ @@ -296,6 +320,7 @@ @@ -309,6 +334,7 @@ diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt index 2ed886db..87fa5a4f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt @@ -60,7 +60,7 @@ class MainActivity : SimpleActivity(), Calculator { AutofitHelper.create(result) AutofitHelper.create(formula) storeStateVariables() - updateViewColors(calculator_holder, config.textColor) + updateViewColors(calculator_holder, getProperTextColor()) checkWhatsNewDialog() checkAppOnSDCard() } @@ -68,7 +68,7 @@ class MainActivity : SimpleActivity(), Calculator { override fun onResume() { super.onResume() if (storedTextColor != config.textColor) { - updateViewColors(calculator_holder, config.textColor) + updateViewColors(calculator_holder, getProperTextColor()) } if (config.preventPhoneFromSleeping) { @@ -77,7 +77,7 @@ class MainActivity : SimpleActivity(), Calculator { vibrateOnButtonPress = config.vibrateOnButtonPress - val adjustedPrimaryColor = getAdjustedPrimaryColor() + val adjustedPrimaryColor = getProperPrimaryColor() arrayOf(btn_percent, btn_power, btn_root, btn_clear, btn_reset, btn_divide, btn_multiply, btn_plus, btn_minus, btn_equals, btn_decimal).forEach { it.setTextColor(adjustedPrimaryColor) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt index 40f8b920..901d06db 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/SettingsActivity.kt @@ -34,7 +34,7 @@ class SettingsActivity : SimpleActivity() { } arrayOf(settings_color_customization_holder, settings_general_settings_holder).forEach { - it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor()) + it.background.applyColorFilter(getProperBackgroundColor().getContrastColor()) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/adapters/HistoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/adapters/HistoryAdapter.kt index f38c0b83..1d2d468e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/adapters/HistoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/adapters/HistoryAdapter.kt @@ -5,16 +5,16 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.simplemobiletools.calculator.R import com.simplemobiletools.calculator.activities.SimpleActivity -import com.simplemobiletools.calculator.extensions.config import com.simplemobiletools.calculator.helpers.CalculatorImpl import com.simplemobiletools.calculator.models.History import com.simplemobiletools.commons.extensions.copyToClipboard +import com.simplemobiletools.commons.extensions.getProperTextColor import kotlinx.android.synthetic.main.history_view.view.* class HistoryAdapter(val activity: SimpleActivity, val items: List, val calc: CalculatorImpl, val itemClick: () -> Unit) : RecyclerView.Adapter() { - private var textColor = activity.config.textColor + private var textColor = activity.getProperTextColor() override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val view = activity.layoutInflater.inflate(R.layout.history_view, parent, false)