diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-19 17:08:15 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-19 17:08:15 -0700 |
commit | a3b5b647e2651c9768a4056852aff36074590e94 (patch) | |
tree | 4398fd2f27dfda32d26c21d71ed0af746061bdc6 /app/src/main/res | |
parent | 382433780c3f4403723a78e409cb161c9fad5034 (diff) | |
download | frost-a3b5b647e2651c9768a4056852aff36074590e94.tar.gz frost-a3b5b647e2651c9768a4056852aff36074590e94.tar.bz2 frost-a3b5b647e2651c9768a4056852aff36074590e94.zip |
Created notification badges
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/badge_background.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/drawable/splash_screen.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/view_badged_icon.xml | 54 |
3 files changed, 61 insertions, 4 deletions
diff --git a/app/src/main/res/drawable/badge_background.xml b/app/src/main/res/drawable/badge_background.xml new file mode 100644 index 00000000..9dfc3cf0 --- /dev/null +++ b/app/src/main/res/drawable/badge_background.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@android:id/background"> + <shape> + <corners android:radius="10dp" /> + <solid android:color="@color/facebook_blue" /> + </shape> + </item> +</layer-list>
\ No newline at end of file diff --git a/app/src/main/res/drawable/splash_screen.xml b/app/src/main/res/drawable/splash_screen.xml index 49085412..58469632 100644 --- a/app/src/main/res/drawable/splash_screen.xml +++ b/app/src/main/res/drawable/splash_screen.xml @@ -4,7 +4,7 @@ android:opacity="opaque"> <!-- The background color, preferably the same as your normal theme --> <item android:drawable="@color/splashBackground"/> - <!-- Your product logo - 288px x 288px color version of your app icon --> + <!-- Your product logo - 288px x 288px color version of your app badgeImage --> <item android:bottom="@dimen/splash_logo"> <bitmap android:gravity="center" diff --git a/app/src/main/res/layout/view_badged_icon.xml b/app/src/main/res/layout/view_badged_icon.xml index d8fb3247..cc6b16cc 100644 --- a/app/src/main/res/layout/view_badged_icon.xml +++ b/app/src/main/res/layout/view_badged_icon.xml @@ -1,6 +1,54 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout - xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent"> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="50dp"> + + <android.support.constraint.Guideline + android:id="@+id/g_v_c" + android:layout_width="1dp" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.5" + tools:layout_editor_absoluteX="192dp" + tools:layout_editor_absoluteY="0dp" /> + + <android.support.constraint.Guideline + android:id="@+id/g_h_c" + android:layout_width="wrap_content" + android:layout_height="1dp" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.5" + tools:layout_editor_absoluteX="0dp" + tools:layout_editor_absoluteY="256dp" /> + + <ImageView + android:id="@+id/badge_image" + android:layout_width="20dp" + android:layout_height="20dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.5" /> + + <TextView + android:id="@+id/badge_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center" + android:paddingEnd="5dp" + android:paddingStart="5dp" + android:textSize="12sp" + android:visibility="gone" + app:layout_constraintBottom_toTopOf="@+id/g_h_c" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0" + app:layout_constraintStart_toEndOf="@id/g_v_c" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="1" + tools:layout_editor_absoluteX="8dp" /> </android.support.constraint.ConstraintLayout>
\ No newline at end of file |