add rounded corners at the widgets

This commit is contained in:
tibbi
2020-05-04 20:15:15 +02:00
parent 47d796c498
commit 85736661df
9 changed files with 148 additions and 145 deletions

View File

@@ -17,6 +17,7 @@ import com.simplemobiletools.calendar.pro.models.ListItem
import com.simplemobiletools.calendar.pro.models.ListSection
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_list.*
@@ -128,7 +129,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
private fun updateBgColor() {
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
config_events_list.setBackgroundColor(mBgColor)
config_events_list.background.applyColorFilter(mBgColor)
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
config_save.setBackgroundColor(mBgColor)
}

View File

@@ -146,7 +146,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
private fun updateBgColor() {
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
config_calendar.setBackgroundColor(mBgColor)
config_calendar.background.applyColorFilter(mBgColor)
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
config_save.setBackgroundColor(mBgColor)
}

View File

@@ -34,7 +34,7 @@ class MyWidgetListProvider : AppWidgetProvider() {
val appWidgetManager = AppWidgetManager.getInstance(context)
appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach {
val views = RemoteViews(context.packageName, R.layout.widget_event_list).apply {
setBackgroundColor(R.id.widget_event_list_holder, context.config.widgetBgColor)
applyColorFilter(R.id.widget_event_list_background, context.config.widgetBgColor)
setTextColor(R.id.widget_event_list_empty, textColor)
setTextSize(R.id.widget_event_list_empty, fontSize)

View File

@@ -172,7 +172,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
val views = RemoteViews(context.packageName, R.layout.fragment_month_widget)
views.setText(R.id.top_value, month)
views.setBackgroundColor(R.id.calendar_holder, context.config.widgetBgColor)
views.applyColorFilter(R.id.widget_month_background, context.config.widgetBgColor)
views.setTextColor(R.id.top_value, textColor)
views.setTextSize(R.id.top_value, largerFontSize)

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/calendar_events_list_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/calendar_events_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin"/>
</RelativeLayout>

View File

@@ -1,12 +1,21 @@
<?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/calendar_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/medium_margin">
<ImageView
android:id="@+id/widget_month_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:src="@drawable/widget_round_background" />
<ImageView
android:id="@+id/top_left_arrow"
style="@style/ArrowStyle"

View File

@@ -1,10 +1,10 @@
<?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/month_calendar_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/widget_round_background"
android:paddingTop="@dimen/medium_margin">
<include layout="@layout/top_navigation" />

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:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/config_list_holder"
android:layout_width="match_parent"
@@ -14,6 +13,7 @@
android:layout_height="match_parent"
android:layout_above="@+id/config_bg_color"
android:layout_marginBottom="@dimen/activity_margin"
android:background="@drawable/widget_round_background"
android:clipToPadding="false"
android:divider="@null"
android:paddingStart="@dimen/activity_margin"
@@ -30,8 +30,8 @@
android:id="@+id/config_bg_seekbar_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/config_bg_color"
android:layout_alignTop="@+id/config_bg_color"
android:layout_alignBottom="@+id/config_bg_color"
android:layout_toEndOf="@+id/config_bg_color"
android:background="@android:color/white">
@@ -54,8 +54,8 @@
android:id="@+id/config_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:fontFamily="sans-serif-light"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"

View File

@@ -1,11 +1,20 @@
<?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/widget_event_list_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/widget_event_list_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/widget_event_list"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:src="@drawable/widget_round_background" />
<TextView
android:id="@+id/widget_event_list_today"
android:layout_width="match_parent"