mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
use rounded corners at the widget background
This commit is contained in:
@ -78,12 +78,7 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||
mTextColor = extras?.getInt(CUSTOMIZED_WIDGET_TEXT_COLOR) ?: config.widgetTextColor
|
||||
}
|
||||
|
||||
if (mBgColor == 1) {
|
||||
mBgColor = Color.BLACK
|
||||
mBgAlpha = .2f
|
||||
} else {
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
||||
}
|
||||
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
|
||||
|
||||
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
||||
config_bg_seekbar.apply {
|
||||
|
@ -7,8 +7,8 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.widget.RemoteViews
|
||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.getLaunchIntent
|
||||
import com.simplemobiletools.commons.extensions.setBackgroundColor
|
||||
import com.simplemobiletools.commons.helpers.WIDGET_TEXT_COLOR
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import com.simplemobiletools.notes.pro.R
|
||||
@ -31,7 +31,7 @@ class MyWidgetProvider : AppWidgetProvider() {
|
||||
for (widgetId in appWidgetIds) {
|
||||
val widget = context.widgetsDB.getWidgetWithWidgetId(widgetId) ?: continue
|
||||
val views = RemoteViews(context.packageName, R.layout.widget)
|
||||
views.setBackgroundColor(R.id.notes_widget_holder, widget.widgetBgColor)
|
||||
views.applyColorFilter(R.id.notes_widget_background, widget.widgetBgColor)
|
||||
setupAppOpenIntent(context, views, R.id.notes_widget_holder, widget)
|
||||
|
||||
Intent(context, WidgetService::class.java).apply {
|
||||
@ -60,4 +60,4 @@ class MyWidgetProvider : AppWidgetProvider() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user