change the buttons from circles to squircles or rectangles

This commit is contained in:
tibbi 2023-01-04 10:45:44 +01:00
parent 350b46027f
commit 08e57b27e8
5 changed files with 9 additions and 20 deletions

View File

@ -63,7 +63,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:a6032f9c07'
implementation 'com.github.SimpleMobileTools:Simple-Commons:48be8434c3'
implementation 'me.grantland:autofittextview:0.2.1'
implementation 'net.objecthunter:exp4j:0.4.8'

View File

@ -16,6 +16,8 @@ import com.simplemobiletools.calculator.extensions.updateWidgets
import com.simplemobiletools.calculator.helpers.*
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.LICENSE_AUTOFITTEXTVIEW
import com.simplemobiletools.commons.helpers.LOWER_ALPHA_INT
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA_INT
import com.simplemobiletools.commons.models.FAQItem
import com.simplemobiletools.commons.models.Release
import kotlinx.android.synthetic.main.activity_main.*
@ -92,13 +94,13 @@ class MainActivity : SimpleActivity(), Calculator {
vibrateOnButtonPress = config.vibrateOnButtonPress
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.background = ResourcesCompat.getDrawable(resources, R.drawable.button_circular_background, theme)
it.background?.alpha = 90
it.background = ResourcesCompat.getDrawable(resources, R.drawable.pill_background, theme)
it.background?.alpha = MEDIUM_ALPHA_INT
}
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 = 20
it.background = ResourcesCompat.getDrawable(resources, R.drawable.pill_background, theme)
it.background?.alpha = LOWER_ALPHA_INT
}
}

View File

@ -21,7 +21,7 @@ class SettingsActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
updateMaterialActivityViews(settings_coordinator, settings_holder)
updateMaterialActivityViews(settings_coordinator, settings_holder, useTransparentNavigation = true, useTopSearchMenu = false)
setupMaterialScrollListener(settings_nested_scrollview, settings_toolbar)
}

View File

@ -77,7 +77,7 @@ class WidgetConfigureActivity : SimpleActivity() {
updateBackgroundColor()
mTextColor = config.widgetTextColor
if (mTextColor == resources.getInteger(R.integer.default_widget_text_color) && config.isUsingSystemTheme) {
if (mTextColor == resources.getColor(R.color.default_widget_text_color) && config.isUsingSystemTheme) {
mTextColor = resources.getColor(R.color.you_primary_color, theme)
}

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorPrimaryDark">
<item android:id="@+id/button_circular_background_holder">
<layer-list>
<item android:id="@+id/button_circular_background_shape">
<shape android:shape="oval">
<solid android:color="?attr/colorPrimary" />
</shape>
</item>
</layer-list>
</item>
</ripple>