From 489c4f93bbc6c5b7c4d86af0c7c7554b444eaeb2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 21 Dec 2022 21:16:05 +0100 Subject: [PATCH] properly center texts in buttons --- .../calculator/activities/MainActivity.kt | 6 +-- .../activities/WidgetConfigureActivity.kt | 6 +-- .../drawable/button_circular_background.xml | 2 +- .../main/res/layout-land/activity_main.xml | 42 +++++++++---------- app/src/main/res/layout/view_calculator.xml | 42 +++++++++---------- app/src/main/res/values/integers.xml | 2 +- app/src/main/res/values/styles.xml | 1 + 7 files changed, 50 insertions(+), 51 deletions(-) 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 f7744a96..60c70b49 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt @@ -91,16 +91,14 @@ class MainActivity : SimpleActivity(), Calculator { vibrateOnButtonPress = config.vibrateOnButtonPress - val properPrimaryColor = 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(properPrimaryColor) it.background = ResourcesCompat.getDrawable(resources, R.drawable.button_circular_background, theme) - it.background?.alpha = 200 + it.background?.alpha = 90 } arrayOf(btn_0, btn_1, btn_2, btn_3, btn_4, btn_5, btn_6, btn_7, btn_8, btn_9).forEach { it.background = ResourcesCompat.getDrawable(resources, R.drawable.button_circular_background, theme) - it.background?.alpha = 80 + it.background?.alpha = 20 } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/WidgetConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/WidgetConfigureActivity.kt index 226f2f94..ec59b4b5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/WidgetConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/WidgetConfigureActivity.kt @@ -6,9 +6,9 @@ import android.content.Intent import android.content.res.ColorStateList import android.graphics.Color import android.os.Bundle -import android.widget.Button import android.widget.RemoteViews import android.widget.SeekBar +import android.widget.TextView import com.simplemobiletools.calculator.R import com.simplemobiletools.calculator.extensions.config import com.simplemobiletools.calculator.helpers.MyWidgetProvider @@ -140,8 +140,8 @@ class WidgetConfigureActivity : SimpleActivity() { config_save.setTextColor(getProperPrimaryColor().getContrastColor()) viewIds.forEach { - (findViewById