use rounded corners at the widget background

This commit is contained in:
tibbi
2020-04-20 13:02:41 +02:00
parent b48e3432df
commit ae0ac64278
5 changed files with 21 additions and 18 deletions

View File

@ -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 {

View File

@ -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() {
}
}
}
}
}