diff options
author | Allan Wang <me@allanwang.ca> | 2019-04-25 15:14:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 15:14:10 -0700 |
commit | 4f3e44b7b9678dce48e7d322af72429b5f447acc (patch) | |
tree | ff913af0ff20f5d415428ac231372da13b9a6639 /app/src/main/res | |
parent | f0f95295bdb2b853aa6262ec4bed2353ce326eee (diff) | |
parent | 00e04ce269197053a8cd8ae522c95629541181a1 (diff) | |
download | frost-4f3e44b7b9678dce48e7d322af72429b5f447acc.tar.gz frost-4f3e44b7b9678dce48e7d322af72429b5f447acc.tar.bz2 frost-4f3e44b7b9678dce48e7d322af72429b5f447acc.zip |
Merge pull request #1365 from AllanWang/room
Room
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/notification_widget_preview.xml | 48 | ||||
-rw-r--r-- | app/src/main/res/layout/widget_notification_item.xml | 46 | ||||
-rw-r--r-- | app/src/main/res/layout/widget_notifications.xml | 31 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 12 | ||||
-rw-r--r-- | app/src/main/res/xml/frost_changelog.xml | 12 | ||||
-rw-r--r-- | app/src/main/res/xml/notification_widget_info.xml | 10 |
7 files changed, 160 insertions, 1 deletions
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..a03fd362 --- /dev/null +++ b/app/src/main/res/drawable/notification_widget_preview.xml @@ -0,0 +1,48 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="30dp" + android:height="40dp" + android:viewportWidth="300" + android:viewportHeight="400"> + <path + android:pathData="M0,0h300v400H0V0z" + android:fillColor="#fafafa"/> + <path + android:pathData="M0,0h300v50H0V0z" + android:fillColor="@color/facebook_blue"/> + <path + android:pathData="M65,170a20,20 0,1 1,-40 0,20 20,0 0,1 40,0z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,150h184v11H85v-11z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,179h146v11H85v-11z" + android:fillColor="#DE000000"/> + <path + android:pathData="M65,95a20,20 0,1 1,-40 0,20 20,0 0,1 40,0z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,75h184v11H85V75z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,104h146v11H85v-11z" + android:fillColor="#DE000000"/> + <path + android:pathData="M65,245a20,20 0,1 1,-40 0,20 20,0 0,1 40,0z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,225h184v11H85v-11z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,254h146v11H85v-11z" + android:fillColor="#DE000000"/> + <path + android:pathData="M65,320a20,20 0,1 1,-40 0,20 20,0 0,1 40,0z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,300h184v11H85v-11z" + android:fillColor="#DE000000"/> + <path + android:pathData="M85,329h146v11H85v-11z" + android:fillColor="#DE000000"/> +</vector> diff --git a/app/src/main/res/layout/widget_notification_item.xml b/app/src/main/res/layout/widget_notification_item.xml new file mode 100644 index 00000000..f36f2766 --- /dev/null +++ b/app/src/main/res/layout/widget_notification_item.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/item_frame" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:selectableItemBackground" + android:orientation="horizontal" + android:paddingStart="@dimen/kau_activity_horizontal_margin" + android:paddingTop="@dimen/kau_activity_vertical_margin" + android:paddingEnd="@dimen/kau_activity_horizontal_margin" + android:paddingBottom="@dimen/kau_activity_vertical_margin"> + + <ImageView + android:id="@+id/item_avatar" + android:layout_width="@dimen/avatar_image_size" + android:layout_height="@dimen/avatar_image_size" /> + + <!-- + Unlike the actual notification panel, + we do not show thumbnails, and we limit the title length + --> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/kau_padding_normal" + android:layout_weight="1" + android:orientation="vertical"> + + <TextView + android:id="@+id/item_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="end" + android:lines="2" /> + + <TextView + android:id="@+id/item_date" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ellipsize="end" + android:lines="1" + android:textSize="12sp" /> + + </LinearLayout> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/widget_notifications.xml b/app/src/main/res/layout/widget_notifications.xml new file mode 100644 index 00000000..4c42be85 --- /dev/null +++ b/app/src/main/res/layout/widget_notifications.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/widget_layout_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <LinearLayout + android:id="@+id/widget_layout_toolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:paddingStart="@dimen/kau_padding_small" + android:paddingEnd="@dimen/kau_padding_small"> + + <ImageView + android:id="@+id/img_frost" + android:layout_width="@dimen/toolbar_icon_size" + android:layout_height="@dimen/toolbar_icon_size" + android:layout_gravity="center_vertical" + android:layout_margin="@dimen/kau_padding_small" + android:background="?android:selectableItemBackgroundBorderless" /> + + </LinearLayout> + + <ListView + android:id="@+id/widget_notification_list" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 713bd1b4..847e74cb 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -9,4 +9,6 @@ <dimen name="tab_bar_height">50dp</dimen> <dimen name="intro_bar_height">64dp</dimen> <dimen name="badge_icon_size">20dp</dimen> + + <dimen name="toolbar_icon_size">24dp</dimen> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5fd35613..0c2e625c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -62,4 +62,16 @@ <string name="no_new_notifications">No new notifications found</string> + <string name="today">Today</string> + <string name="yesterday">Today</string> + <!-- + Template used to display human readable string; + For instance: + Today at 1:23 PM + Mar 13 at 9:00 AM + + The first element is the day, and the second element is the time + --> + <string name="time_template">%1s at %2s</string> + </resources> diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index 1895e46f..560b1111 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -6,12 +6,22 @@ <item text="" /> --> + <version title="v2.3.0" /> + <item text="Converted internals of Facebook data storage; auto migration will only work from 2.2.x to 2.3.x" /> + <item text="Added notification widget" /> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <item text="" /> + <version title="v2.2.4" /> <item text="Show top bar to allow sharing posts" /> <item text="Fix unmuting videos when autoplay is enabled" /> <item text="Add shortcut to toggle autoplay in settings > behaviour" /> <item text="Update theme" /> - <item text="" /> <version title="v2.2.3" /> <item text="Add ability to hide stories" /> diff --git a/app/src/main/res/xml/notification_widget_info.xml b/app/src/main/res/xml/notification_widget_info.xml new file mode 100644 index 00000000..c14bbfb2 --- /dev/null +++ b/app/src/main/res/xml/notification_widget_info.xml @@ -0,0 +1,10 @@ +<?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:minWidth="180dp" + android:minHeight="250dp" + android:previewImage="@drawable/notification_widget_preview" /> |