add optional text shadow to widget for better readability

This commit is contained in:
tibbi
2018-03-12 00:01:20 +01:00
parent 3b5bf64066
commit c1feb66b91
11 changed files with 116 additions and 2 deletions

View File

@ -22,7 +22,8 @@ class MyWidgetDateTimeProvider : AppWidgetProvider() {
private fun performUpdate(context: Context) {
val appWidgetManager = AppWidgetManager.getInstance(context)
appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach {
RemoteViews(context.packageName, R.layout.widget_date_time).apply {
val layout = if (context.config.useTextShadow) R.layout.widget_date_time_with_shadow else R.layout.widget_date_time
RemoteViews(context.packageName, layout).apply {
updateTexts(context, this)
updateColors(context, this)
appWidgetManager.updateAppWidget(it, this)