Merge pull request #286 from herou/widget_hot_fixes

-fixed, text gets cut on widget
This commit is contained in:
Tibor Kaputa 2019-07-24 22:49:46 +02:00 committed by GitHub
commit 51b5de1935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -29,7 +29,7 @@ class MyWidgetProvider : AppWidgetProvider() {
Thread {
context.widgetsDB.getWidgets().forEach {
val views = RemoteViews(context.packageName, R.layout.widget)
views.setBackgroundColor(R.id.notes_widget_holder, context.config.widgetBgColor)
views.setBackgroundColor(R.id.frame_widget, context.config.widgetBgColor)
setupAppOpenIntent(context, views, R.id.notes_widget_holder, it)
Intent(context, WidgetService::class.java).apply {
@ -57,4 +57,4 @@ class MyWidgetProvider : AppWidgetProvider() {
}
}.start()
}
}
}

View File

@ -1,14 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notes_widget_holder"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_widget"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/notes_widget_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:divider="@null"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/notes_widget_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
</FrameLayout>