aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt4
-rw-r--r--app/src/main/res/drawable/ic_refresh_24dp.xml5
-rw-r--r--app/src/main/res/drawable/notification_widget_preview.xml49
-rw-r--r--app/src/main/res/xml/notification_widget_info.xml10
4 files changed, 56 insertions, 12 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt
index 57cc4fe1..594da00a 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/widgets/NotificationWidget.kt
@@ -45,7 +45,6 @@ import com.pitchedapps.frost.glide.FrostGlide
import com.pitchedapps.frost.glide.GlideApp
import com.pitchedapps.frost.services.NotificationContent
import com.pitchedapps.frost.services.NotificationType
-import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.toReadableTime
import org.koin.standalone.KoinComponent
@@ -100,7 +99,6 @@ class NotificationWidget : AppWidgetProvider() {
private const val NOTIF_WIDGET_TYPE = "notif_widget_type"
private const val NOTIF_WIDGET_USER_ID = "notif_widget_user_id"
-private const val NOTIF_WIDGET_USER_COOKIE = "notif_widget_user_id"
private fun RemoteViews.setBackgroundColor(@IdRes viewId: Int, @ColorInt color: Int) {
setInt(viewId, "setBackgroundColor", color)
@@ -157,7 +155,6 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) :
private fun loadNotifications() {
content = notifDao.selectNotificationsSync(userId, type.channelId)
- L._d { "Updated notif widget with ${content.size} items" }
}
override fun onCreate() {
@@ -176,7 +173,6 @@ class NotificationWidgetDataProvider(val context: Context, val intent: Intent) :
override fun getViewAt(position: Int): RemoteViews {
val views = RemoteViews(context.packageName, R.layout.widget_notification_item)
val notif = content[position]
- L._d { "View $position $notif" }
views.setBackgroundColor(R.id.item_frame, Prefs.nativeBgColor(notif.unread))
views.setTextColor(R.id.item_content, Prefs.textColor)
views.setTextViewText(R.id.item_content, notif.text)
diff --git a/app/src/main/res/drawable/ic_refresh_24dp.xml b/app/src/main/res/drawable/ic_refresh_24dp.xml
deleted file mode 100644
index cc2d1e04..00000000
--- a/app/src/main/res/drawable/ic_refresh_24dp.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<vector android:height="24dp" android:tint="#FFFFFF"
- android:viewportHeight="24.0" android:viewportWidth="24.0"
- android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
- <path android:fillColor="#FF000000" android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
-</vector>
diff --git a/app/src/main/res/drawable/notification_widget_preview.xml b/app/src/main/res/drawable/notification_widget_preview.xml
new file mode 100644
index 00000000..a4ead7d0
--- /dev/null
+++ b/app/src/main/res/drawable/notification_widget_preview.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@id/intro_phone"
+ android:drawable="@drawable/intro_phone_case" />
+ <item
+ android:id="@id/intro_phone_screen"
+ android:drawable="@drawable/intro_phone_screen" />
+ <item
+ android:id="@+id/intro_phone_nav"
+ android:bottom="10dp"
+ android:left="3dp"
+ android:right="23dp"
+ android:top="50dp">
+ <shape>
+ <solid android:color="#f0f" />
+ </shape>
+ </item>
+ <item
+ android:id="@+id/intro_phone_header"
+ android:bottom="110dp"
+ android:left="3dp"
+ android:right="23dp"
+ android:top="10dp">
+ <shape>
+ <solid android:color="#f00" />
+ </shape>
+ </item>
+ <item
+ android:id="@+id/intro_phone_avatar_1"
+ android:bottom="130dp"
+ android:left="8dp"
+ android:right="67dp"
+ android:top="15dp">
+ <shape android:shape="oval">
+ <solid android:color="#f0f" />
+ </shape>
+ </item>
+ <item
+ android:id="@+id/intro_phone_avatar_2"
+ android:bottom="135dp"
+ android:left="53dp"
+ android:right="27dp"
+ android:top="15dp">
+ <shape android:shape="oval">
+ <solid android:color="#f0f" />
+ </shape>
+ </item>
+</layer-list> \ No newline at end of file
diff --git a/app/src/main/res/xml/notification_widget_info.xml b/app/src/main/res/xml/notification_widget_info.xml
index 2b8b4fb5..c14bbfb2 100644
--- a/app/src/main/res/xml/notification_widget_info.xml
+++ b/app/src/main/res/xml/notification_widget_info.xml
@@ -1,6 +1,10 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?><!--
+For sizing see:
+https://developer.android.com/guide/practices/ui_guidelines/widget_design.html#anatomy_determining_size
+-->
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialKeyguardLayout="@layout/widget_notifications"
android:initialLayout="@layout/widget_notifications"
- android:minHeight="110dp"
- android:minWidth="180dp"/>
+ android:minWidth="180dp"
+ android:minHeight="250dp"
+ android:previewImage="@drawable/notification_widget_preview" />