mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
minor code cleanup
This commit is contained in:
@@ -47,15 +47,18 @@ class WidgetDateConfigureActivity : SimpleActivity() {
|
||||
|
||||
private fun initVariables() {
|
||||
mBgColor = config.widgetBgColor
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
||||
|
||||
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
||||
config_bg_seekbar.progress = (mBgAlpha * 100).toInt()
|
||||
updateBackgroundColor()
|
||||
config_bg_seekbar.onSeekBarChangeListener { progress ->
|
||||
mBgAlpha = progress / 100.toFloat()
|
||||
config_bg_seekbar.apply {
|
||||
progress = (mBgAlpha * 100).toInt()
|
||||
|
||||
onSeekBarChangeListener { progress ->
|
||||
mBgAlpha = progress / 100f
|
||||
updateBackgroundColor()
|
||||
}
|
||||
}
|
||||
updateBackgroundColor()
|
||||
|
||||
mTextColor = config.widgetTextColor
|
||||
if (mTextColor == resources.getColor(R.color.default_widget_text_color) && config.isUsingSystemTheme) {
|
||||
|
@@ -74,15 +74,18 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
||||
|
||||
private fun initVariables() {
|
||||
mBgColor = config.widgetBgColor
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
||||
|
||||
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
||||
config_bg_seekbar.progress = (mBgAlpha * 100).toInt()
|
||||
updateBackgroundColor()
|
||||
config_bg_seekbar.onSeekBarChangeListener { progress ->
|
||||
mBgAlpha = progress / 100.toFloat()
|
||||
config_bg_seekbar.apply {
|
||||
progress = (mBgAlpha * 100).toInt()
|
||||
|
||||
onSeekBarChangeListener { progress ->
|
||||
mBgAlpha = progress / 100f
|
||||
updateBackgroundColor()
|
||||
}
|
||||
}
|
||||
updateBackgroundColor()
|
||||
|
||||
mTextColor = config.widgetTextColor
|
||||
if (mTextColor == resources.getColor(R.color.default_widget_text_color) && config.isUsingSystemTheme) {
|
||||
|
@@ -64,15 +64,18 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
|
||||
|
||||
private fun initVariables() {
|
||||
mBgColor = config.widgetBgColor
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
||||
|
||||
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
||||
config_bg_seekbar.progress = (mBgAlpha * 100).toInt()
|
||||
updateBackgroundColor()
|
||||
config_bg_seekbar.onSeekBarChangeListener { progress ->
|
||||
mBgAlpha = progress / 100.toFloat()
|
||||
config_bg_seekbar.apply {
|
||||
progress = (mBgAlpha * 100).toInt()
|
||||
|
||||
onSeekBarChangeListener { progress ->
|
||||
mBgAlpha = progress / 100f
|
||||
updateBackgroundColor()
|
||||
}
|
||||
}
|
||||
updateBackgroundColor()
|
||||
|
||||
mTextColor = config.widgetTextColor
|
||||
if (mTextColor == resources.getColor(R.color.default_widget_text_color) && config.isUsingSystemTheme) {
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/config_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
@@ -11,8 +10,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/activity_margin"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
android:layout_margin="@dimen/activity_margin">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/config_date_time_wrapper"
|
||||
|
@@ -10,8 +10,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/activity_margin"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
android:layout_margin="@dimen/activity_margin">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/period_picker_holder"
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/config_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -10,8 +9,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/activity_margin"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
android:layout_margin="@dimen/activity_margin">
|
||||
|
||||
<include
|
||||
android:id="@+id/config_calendar"
|
||||
|
Reference in New Issue
Block a user