Skip to content

Commit

Permalink
MBX-3508: fix naming and update notification style
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Sozinov committed Jul 15, 2024
1 parent 8a371e5 commit 408dc84
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ internal object PushNotificationManager {
defaultActivity = defaultActivity,
)
.setNotificationStyle(
context =context,
context = context,
image = image,
title = title,
text = text,
Expand Down Expand Up @@ -639,13 +639,13 @@ internal object PushNotificationManager {
block = {
setStyle(NotificationCompat.DecoratedCustomViewStyle())
setCustomContentView(
RemoteViews(context.packageName, R.layout.notification_custom_text).apply {
RemoteViews(context.packageName, R.layout.mindbox_notification_custom_text).apply {
setTextViewText(R.id.text_view_title, title)
setTextViewText(R.id.text_view_content, text)
setImageViewBitmap(R.id.image_view_large_icon, image)
})
setCustomBigContentView(
RemoteViews(context.packageName, R.layout.notification_custom_text_with_image).apply {
RemoteViews(context.packageName, R.layout.mindbox_notification_custom_text_with_image).apply {
setTextViewText(R.id.text_view_title, title)
setTextViewText(R.id.text_view_content, text)
setImageViewBitmap(R.id.image_view_picture, image)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
style="@style/TextAppearance.Compat.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:layout_marginEnd="@dimen/mindbox_notification_content_margin_end"
android:layout_toStartOf="@+id/image_view_large_icon"
android:singleLine="true" />

Expand All @@ -19,14 +19,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text_view_title"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:layout_marginEnd="@dimen/mindbox_notification_content_margin_end"
android:layout_marginTop="@dimen/mindbox_notification_content_margin_top"
android:layout_toStartOf="@+id/image_view_large_icon"
android:singleLine="true"/>

<ImageView
android:id="@+id/image_view_large_icon"
android:layout_width="@dimen/notification_large_icon_size"
android:layout_height="@dimen/notification_large_icon_size"
android:layout_width="@dimen/mindbox_notification_large_icon_size"
android:layout_height="@dimen/mindbox_notification_large_icon_size"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:scaleType="centerCrop" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<TextView
android:id="@+id/text_view_title"
style="@style/TextAppearance.Compat.Notification.Title"
android:textSize="@dimen/mindbox_notification_expanded_title_text_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:singleLine="false" />

<TextView
Expand All @@ -18,16 +18,17 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text_view_title"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:lineSpacingExtra="@dimen/notification_line_spacing_extra"
android:layout_marginTop="@dimen/mindbox_notification_content_margin_top"
android:layout_marginEnd="@dimen/mindbox_notification_content_margin_end"
android:lineSpacingExtra="@dimen/mindbox_notification_line_spacing_extra"
android:maxLines="@integer/collapsed_push_notification_content_max_lines" />

<ImageView
android:id="@+id/image_view_picture"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text_view_content"
android:layout_marginTop="@dimen/notification_expanded_image_margin_top"
android:layout_marginTop="@dimen/mindbox_notification_expanded_image_margin_top"
android:adjustViewBounds="true"
android:scaleType="fitCenter" />
</RelativeLayout>
11 changes: 6 additions & 5 deletions sdk/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="notification_content_margin_end">16dp</dimen>
<dimen name="notification_large_icon_size">36dp</dimen>
<dimen name="notification_subtext_size">13sp</dimen>
<dimen name="notification_line_spacing_extra">3sp</dimen>
<dimen name="notification_expanded_image_margin_top">13dp</dimen>
<dimen name="mindbox_notification_content_margin_end">14dp</dimen>
<dimen name="mindbox_notification_large_icon_size">48dp</dimen>
<dimen name="mindbox_notification_expanded_title_text_size">13sp</dimen>
<dimen name="mindbox_notification_line_spacing_extra">3sp</dimen>
<dimen name="mindbox_notification_expanded_image_margin_top">13dp</dimen>
<dimen name="mindbox_notification_content_margin_top">4dp</dimen>
</resources>

0 comments on commit 408dc84

Please sign in to comment.