use round widget corners at the config screen

This commit is contained in:
tibbi 2020-05-28 18:16:36 +02:00
parent 4d80fb4347
commit 8c04934ed4
2 changed files with 21 additions and 11 deletions

View File

@ -14,6 +14,7 @@ import com.simplemobiletools.clock.helpers.MyWidgetDateTimeProvider
import com.simplemobiletools.clock.helpers.getPassedSeconds
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
import kotlinx.android.synthetic.main.widget_config_date_time.*
@ -131,8 +132,8 @@ class WidgetDateTimeConfigureActivity : SimpleActivity() {
private fun updateBackgroundColor() {
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
config_background.applyColorFilter(mBgColor)
config_save.setBackgroundColor(mBgColor)
config_date_time_wrapper.setBackgroundColor(mBgColor)
}
private val bgSeekbarChangeListener = object : SeekBar.OnSeekBarChangeListener {

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/config_date_time_holder"
android:layout_width="match_parent"
@ -14,6 +13,16 @@
android:layout_height="wrap_content"
android:paddingBottom="@dimen/small_margin">
<ImageView
android:id="@+id/config_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/config_date"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:src="@drawable/widget_round_background" />
<TextView
android:id="@+id/config_time"
android:layout_width="match_parent"
@ -21,7 +30,7 @@
android:gravity="center_horizontal"
android:includeFontPadding="false"
android:textSize="@dimen/widget_time_text_size_small"
tools:text="00:00"/>
tools:text="00:00" />
<TextView
android:id="@+id/config_date"
@ -32,14 +41,14 @@
android:includeFontPadding="false"
android:paddingBottom="@dimen/small_margin"
android:textSize="@dimen/normal_text_size"
tools:text="Mon, 1 January"/>
tools:text="Mon, 1 January" />
</RelativeLayout>
<ImageView
android:id="@+id/config_bg_color"
android:layout_width="@dimen/widget_colorpicker_size"
android:layout_height="@dimen/widget_colorpicker_size"
android:layout_above="@+id/config_text_color"/>
android:layout_above="@+id/config_text_color" />
<RelativeLayout
android:id="@+id/config_bg_seekbar_holder"
@ -47,7 +56,7 @@
android:layout_height="match_parent"
android:layout_alignTop="@+id/config_bg_color"
android:layout_alignBottom="@+id/config_bg_color"
android:layout_toRightOf="@+id/config_bg_color"
android:layout_toEndOf="@+id/config_bg_color"
android:background="@android:color/white">
<com.simplemobiletools.commons.views.MySeekBar
@ -56,26 +65,26 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"/>
android:paddingRight="@dimen/activity_margin" />
</RelativeLayout>
<ImageView
android:id="@+id/config_text_color"
android:layout_width="@dimen/widget_colorpicker_size"
android:layout_height="@dimen/widget_colorpicker_size"
android:layout_alignParentBottom="true"/>
android:layout_alignParentBottom="true" />
<Button
android:id="@+id/config_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:fontFamily="sans-serif-light"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:text="@string/ok"
android:textColor="@android:color/white"
android:textSize="@dimen/big_text_size"/>
android:textSize="@dimen/big_text_size" />
</RelativeLayout>