mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
add rounded corners at the widgets
This commit is contained in:
@@ -17,6 +17,7 @@ import com.simplemobiletools.calendar.pro.models.ListItem
|
|||||||
import com.simplemobiletools.calendar.pro.models.ListSection
|
import com.simplemobiletools.calendar.pro.models.ListSection
|
||||||
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||||
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||||
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
|
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
|
||||||
import kotlinx.android.synthetic.main.widget_config_list.*
|
import kotlinx.android.synthetic.main.widget_config_list.*
|
||||||
@@ -128,7 +129,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun updateBgColor() {
|
private fun updateBgColor() {
|
||||||
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
||||||
config_events_list.setBackgroundColor(mBgColor)
|
config_events_list.background.applyColorFilter(mBgColor)
|
||||||
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
|
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
|
||||||
config_save.setBackgroundColor(mBgColor)
|
config_save.setBackgroundColor(mBgColor)
|
||||||
}
|
}
|
||||||
|
@@ -146,7 +146,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
|
|||||||
|
|
||||||
private fun updateBgColor() {
|
private fun updateBgColor() {
|
||||||
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha)
|
||||||
config_calendar.setBackgroundColor(mBgColor)
|
config_calendar.background.applyColorFilter(mBgColor)
|
||||||
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
|
config_bg_color.setFillWithStroke(mBgColor, Color.BLACK)
|
||||||
config_save.setBackgroundColor(mBgColor)
|
config_save.setBackgroundColor(mBgColor)
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ class MyWidgetListProvider : AppWidgetProvider() {
|
|||||||
val appWidgetManager = AppWidgetManager.getInstance(context)
|
val appWidgetManager = AppWidgetManager.getInstance(context)
|
||||||
appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach {
|
appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach {
|
||||||
val views = RemoteViews(context.packageName, R.layout.widget_event_list).apply {
|
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)
|
setTextColor(R.id.widget_event_list_empty, textColor)
|
||||||
setTextSize(R.id.widget_event_list_empty, fontSize)
|
setTextSize(R.id.widget_event_list_empty, fontSize)
|
||||||
|
|
||||||
|
@@ -172,7 +172,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
|
|||||||
val views = RemoteViews(context.packageName, R.layout.fragment_month_widget)
|
val views = RemoteViews(context.packageName, R.layout.fragment_month_widget)
|
||||||
views.setText(R.id.top_value, month)
|
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.setTextColor(R.id.top_value, textColor)
|
||||||
views.setTextSize(R.id.top_value, largerFontSize)
|
views.setTextSize(R.id.top_value, largerFontSize)
|
||||||
|
@@ -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>
|
|
@@ -1,12 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/calendar_holder"
|
android:id="@+id/calendar_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:padding="@dimen/medium_margin">
|
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
|
<ImageView
|
||||||
android:id="@+id/top_left_arrow"
|
android:id="@+id/top_left_arrow"
|
||||||
style="@style/ArrowStyle"
|
style="@style/ArrowStyle"
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/month_calendar_holder"
|
android:id="@+id/month_calendar_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/widget_round_background"
|
||||||
android:paddingTop="@dimen/medium_margin">
|
android:paddingTop="@dimen/medium_margin">
|
||||||
|
|
||||||
<include layout="@layout/top_navigation" />
|
<include layout="@layout/top_navigation" />
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/config_list_holder"
|
android:id="@+id/config_list_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -14,6 +13,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_above="@+id/config_bg_color"
|
android:layout_above="@+id/config_bg_color"
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
android:layout_marginBottom="@dimen/activity_margin"
|
||||||
|
android:background="@drawable/widget_round_background"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:paddingStart="@dimen/activity_margin"
|
android:paddingStart="@dimen/activity_margin"
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
android:id="@+id/config_bg_seekbar_holder"
|
android:id="@+id/config_bg_seekbar_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignBottom="@+id/config_bg_color"
|
|
||||||
android:layout_alignTop="@+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:layout_toEndOf="@+id/config_bg_color"
|
||||||
android:background="@android:color/white">
|
android:background="@android:color/white">
|
||||||
|
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
android:id="@+id/config_save"
|
android:id="@+id/config_save"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
android:fontFamily="sans-serif-light"
|
android:fontFamily="sans-serif-light"
|
||||||
android:paddingStart="@dimen/activity_margin"
|
android:paddingStart="@dimen/activity_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
@@ -1,11 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/widget_event_list_holder"
|
android:id="@+id/widget_event_list_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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
|
<TextView
|
||||||
android:id="@+id/widget_event_list_today"
|
android:id="@+id/widget_event_list_today"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Reference in New Issue
Block a user