Skip to content

Commit

Permalink
implemented notification with customization
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayChaurasia98 authored and surinder-tsys committed Feb 8, 2024
1 parent 9e6ac2c commit f22270e
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,17 @@ class NotificationsActivity : DrawerActivity(), NotificationsContract.View {
Snackbar.LENGTH_INDEFINITE
)
} else {
val pushValue = arbitraryDataProvider.getValue(accountName, PushUtils.KEY_PUSH)
// NMC Note -> Need to disable this error message for now as we will configure our
// own push notification server later not now
// once we will configure our server we will uncomment the below code.
/* val pushValue = arbitraryDataProvider.getValue(accountName, PushUtils.KEY_PUSH)
if (pushValue.isEmpty()) {
snackbar = Snackbar.make(
binding.emptyList.emptyListView,
R.string.push_notifications_temp_error,
Snackbar.LENGTH_INDEFINITE
)
}
}*/
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ public void setButtons(NotificationViewHolder holder, Notification notification)
}
});

viewThemeUtils.material.colorMaterialButtonPrimaryFilled(button);
//NMC Customization
button.setBackgroundColor(ResourcesCompat.getColor(resources,
R.color.shared_with_me_color, null));
button.setTextColor(ResourcesCompat.getColor(resources,
R.color.white, null));
holder.binding.buttons.addView(button);
} else {
overflowActions.add(action);
Expand All @@ -231,8 +235,12 @@ public void setButtons(NotificationViewHolder holder, Notification notification)
moreButton.setBackgroundColor(ResourcesCompat.getColor(resources,
android.R.color.transparent,
null));
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(moreButton);

//NMC Customization
moreButton.setBackgroundColor(ResourcesCompat.getColor(resources,
android.R.color.transparent,
null));
moreButton.setTextColor(ResourcesCompat.getColor(resources,
R.color.shared_with_me_color, null));
moreButton.setAllCaps(false);

moreButton.setText(R.string.more);
Expand Down Expand Up @@ -274,12 +282,16 @@ public void setButtons(NotificationViewHolder holder, Notification notification)
final MaterialButton button = new MaterialButton(notificationsActivity);

if (action.primary) {
viewThemeUtils.material.colorMaterialButtonPrimaryFilled(button);
button.setBackgroundColor(ResourcesCompat.getColor(resources,
R.color.shared_with_me_color, null));
button.setTextColor(ResourcesCompat.getColor(resources,
R.color.white, null));
} else {
button.setBackgroundColor(ResourcesCompat.getColor(resources,
android.R.color.transparent,
null));
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(button);
button.setTextColor(ResourcesCompat.getColor(resources,
R.color.shared_with_me_color, null));
}

button.setAllCaps(false);
Expand Down
18 changes: 13 additions & 5 deletions app/src/main/res/drawable/ic_notification.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<vector android:height="24dp" android:tint="#333333"
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="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="@color/notification_icon_color"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M21.25,17.25C19.6384,15.6405 18.6407,13.5179 18.43,11.25L18.27,9.5C18.0256,6.7093 15.9678,4.4152 13.22,3.87C13.665,3.2479 13.5706,2.3905 13.0009,1.8801C12.4313,1.3697 11.5687,1.3697 10.9991,1.8801C10.4294,2.3905 10.335,3.2479 10.78,3.87C8.0322,4.4152 5.9744,6.7093 5.73,9.5L5.57,11.255C5.3593,13.5229 4.3616,15.6455 2.75,17.255L2.75,17.255L2.75,19.755L8.25,19.755C8.245,19.8383 8.245,19.9217 8.25,20.005C8.25,22.0761 9.9289,23.755 12,23.755C14.0711,23.755 15.75,22.0761 15.75,20.005C15.755,19.9217 15.755,19.8383 15.75,19.755L21.25,19.755L21.25,17.25ZM14.25,20C14.25,21.2426 13.2426,22.25 12,22.25C10.7574,22.25 9.75,21.2426 9.75,20C9.7534,19.9162 9.7617,19.8328 9.775,19.75L14.225,19.75C14.2383,19.8328 14.2466,19.9162 14.25,20Z"
android:strokeWidth="1"
android:fillColor="#191919"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/notification_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:paddingBottom="@dimen/standard_quarter_padding"
android:textColor="@color/secondary_text_color"
android:textSize="@dimen/text_size_13sp"
tools:text="@string/placeholder_sentence" />
Expand All @@ -98,7 +99,7 @@
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_quarter_margin"
android:layout_marginTop="@dimen/alternate_half_margin"
android:layout_marginEnd="@dimen/notification_list_item_grid_layout_left_start_margin"
android:columnCount="3"
android:gravity="start"
Expand Down
67 changes: 67 additions & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<color name="nc_grey">#222222</color>
<color name="icon_on_nc_grey">#ffffff</color>

<!-- Notification Colors -->
<color name="notification_icon_color">@color/grey_30</color>

<!-- Multiselect backgrounds -->
<color name="action_mode_background">@color/appbar</color>
<color name="selected_item_background">#373535</color>
Expand All @@ -48,4 +51,68 @@
<!-- App bar -->
<color name="appbar">#1E1E1E</color>
<color name="fontAppbar">@android:color/white</color>

<!-- NMC Colors -->
<color name="icon_color">#FFFFFF</color>
<color name="sort_text_color">@color/grey_30</color>
<color name="list_icon_color">@color/grey_30</color>
<color name="warning_icon_color">#CCCCCC</color>
<color name="divider_color">@color/grey_70</color>
<color name="spinner_bg_color">@color/grey_80</color>
<color name="refresh_layout_bg_color">#2D2D2D</color>
<color name="primary_button_disabled_color">@color/grey_70</color>
<color name="toolbar_divider_color">@color/grey_70</color>

<!-- Snackbar Colors -->
<color name="snackbar_bg_color">@color/grey_80</color>
<color name="snackbar_txt_color">@color/grey_0</color>

<!-- Alert Dialog Colors -->
<color name="alert_bg_color">@color/grey_80</color>
<color name="alert_txt_color">@color/grey_0</color>

<!-- NavigationView colors -->
<color name="nav_selected_bg_color">@color/grey_60</color>
<color name="nav_txt_unselected_color">@color/grey_0</color>
<color name="nav_txt_selected_color">@color/grey_0</color>
<color name="nav_icon_unselected_color">@color/grey_30</color>
<color name="nav_icon_selected_color">#FFFFFF</color>
<color name="nav_divider_color">@color/grey_30</color>
<color name="nav_bg_color">@color/grey_80</color>
<color name="drawer_quota_txt_color">#FFFFFF</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">@color/grey_80</color>
<color name="bottom_sheet_icon_color">@color/grey_30</color>
<color name="bottom_sheet_txt_color">@color/grey_0</color>

<!-- Popup Menu Colors -->
<color name="popup_menu_bg">@color/grey_80</color>
<color name="popup_menu_txt_color">@color/grey_0</color>
<color name="overflow_bg_color">@color/grey_80</color>

<!-- Switch Compat Colors -->
<color name="switch_thumb_disabled">@color/grey_70</color>
<color name="switch_track_disabled">@color/grey_60</color>

<!-- Checkbox Colors -->
<color name="checkbox_checked_disabled">@color/grey_70</color>
<color name="checkbox_unchecked_disabled">@color/grey_70</color>

<!-- Share Colors -->
<color name="share_title_txt_color">#FFFFFF</color>
<color name="share_subtitle_txt_color">@color/grey_30</color>
<color name="share_info_txt_color">@color/grey_0</color>
<color name="share_search_border_color">@color/grey_0</color>
<color name="share_btn_txt_color">@color/grey_0</color>
<color name="share_list_item_txt_color">@color/grey_0</color>
<color name="share_disabled_txt_color">@color/grey_60</color>
<color name="share_txt_color">@color/grey_0</color>
<color name="share_et_divider">#FFFFFF</color>

<!-- Scan Colors -->
<color name="scan_doc_bg_color">#121212</color>
<color name="scan_text_color">@color/grey_0</color>
<color name="scan_edit_bottom_color">@color/grey_80</color>
<color name="scan_count_bg_color">@color/grey_80</color>
</resources>
92 changes: 92 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<color name="grey_600">#666666</color>
<color name="grey_800_transparent">#CC000000</color>

<!-- Notification Colors -->
<color name="notification_icon_color">#191919</color>

<!-- level colors for info notifications/visualisations -->
<color name="infolevel_warning">#e9322d</color>

Expand Down Expand Up @@ -82,4 +85,93 @@
<color name="appbar">@android:color/white</color>
<color name="fontAppbar">#666666</color>
<color name="fontSecondaryAppbar">#A5A5A5</color>

<!-- NMC Colors -->
<color name="icon_color">#191919</color>
<color name="sort_text_color">@color/primary</color>
<color name="list_icon_color">#191919</color>
<color name="warning_icon_color">#191919</color>
<color name="divider_color">@color/grey_30</color>
<color name="spinner_bg_color">@android:color/white</color>
<color name="refresh_layout_bg_color">#FFFFFF</color>
<color name="primary_button_disabled_color">@color/grey_0</color>
<color name="toolbar_divider_color">#CCCCCC</color>
<color name="et_highlight_color">#77c4ff</color>
<color name="white_trans_70">#B3FFFFFF</color>
<color name="progress_bar_background">@color/grey_10</color>

<!-- Grey Colors -->
<color name="dark_grey">#101010</color>
<color name="grey_0">#F2F2F2</color>
<color name="grey_10">#E5E5E5</color>
<color name="grey_30">#B2B2B2</color>
<color name="grey_60">#666666</color>
<color name="grey_70">#4C4C4C</color>
<color name="grey_80">#333333</color>

<!-- Snackbar Colors -->
<color name="snackbar_bg_color">@color/design_snackbar_background_color</color>
<color name="snackbar_txt_color">@color/white</color>

<!-- Alert Dialog Colors -->
<color name="alert_bg_color">#FFFFFF</color>
<color name="alert_txt_color">#191919</color>

<!-- NavigationView colors -->
<color name="nav_selected_bg_color">@color/grey_0</color>
<color name="nav_txt_unselected_color">#191919</color>
<color name="nav_txt_selected_color">@color/primary</color>
<color name="nav_icon_unselected_color">#191919</color>
<color name="nav_icon_selected_color">@color/primary</color>
<color name="nav_divider_color">@color/grey_30</color>
<color name="nav_bg_color">@color/white</color>
<color name="drawer_quota_txt_color">#191919</color>

<!-- Bottom Sheet Colors -->
<color name="bottom_sheet_bg_color">#FFFFFF</color>
<color name="bottom_sheet_icon_color">#191919</color>
<color name="bottom_sheet_txt_color">#191919</color>

<!-- Popup Menu Colors -->
<color name="popup_menu_bg">#FFFFFF</color>
<color name="popup_menu_txt_color">#191919</color>
<color name="overflow_bg_color">#FFFFFF</color>

<!-- Switch Compat Colors -->
<color name="switch_thumb_checked_enabled">@color/primary</color>
<color name="switch_track_checked_enabled">#F399C7</color>
<color name="switch_thumb_unchecked_enabled">#FFFFFF</color>
<color name="switch_track_unchecked_enabled">@color/grey_30</color>
<color name="switch_thumb_disabled">@color/grey_10</color>
<color name="switch_track_disabled">@color/grey_0</color>

<!-- Checkbox Colors -->
<color name="checkbox_checked_enabled">@color/primary</color>
<color name="checkbox_unchecked_enabled">@color/grey_30</color>
<color name="checkbox_checked_disabled">@color/grey_30</color>
<color name="checkbox_unchecked_disabled">#CCCCCC</color>

<!-- Share Colors -->
<color name="share_title_txt_color">#191919</color>
<color name="share_subtitle_txt_color">@color/grey_30</color>
<color name="share_info_txt_color">#191919</color>
<color name="share_search_border_color">#191919</color>
<color name="share_btn_txt_color">#191919</color>
<color name="share_list_item_txt_color">#191919</color>
<color name="share_disabled_txt_color">@color/grey_30</color>
<color name="share_txt_color">#191919</color>
<color name="share_et_divider">#000000</color>
<color name="share_warning_txt_color">#191919</color>
<color name="sharing_warning_bg_color">#F6E5EB</color>
<color name="sharing_warning_border_color">#C16F81</color>
<color name="share_color">#0D39DF</color>
<color name="shared_with_me_color">#0099ff</color>

<!-- Scan Colors -->
<color name="scan_doc_bg_color">@color/grey_0</color>
<color name="scan_text_color">#191919</color>
<color name="scan_edit_bottom_color">@color/grey_0</color>
<color name="scan_count_bg_color">@color/grey_30</color>
<color name="neptune">#77b6bb</color>
<color name="neptune_50">#5077b6bb</color>
</resources>
31 changes: 31 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="grid_recyclerview_padding">4dp</dimen>
<dimen name="list_item_icons_size">16dp</dimen>
<dimen name="grid_item_icons_size">24dp</dimen>
<dimen name="media_grid_item_rv_spacing">6dp</dimen>
<dimen name="txt_size_18sp">18sp</dimen>
<dimen name="txt_size_15sp">15sp</dimen>
<dimen name="crop_corner_size">15dp</dimen>
<dimen name="edit_scan_bottom_bar_height">56dp</dimen>
<dimen name="standard_folders_grid_item_size">86dp</dimen>
<dimen name="standard_files_grid_item_size">80dp</dimen>
<dimen name="txt_size_11sp">11sp</dimen>
<dimen name="share_row_icon_size">30dp</dimen>
<dimen name="create_link_button_height">55dp</dimen>
<dimen name="note_et_height">258dp</dimen>
<dimen name="txt_size_17sp">17sp</dimen>
<dimen name="share_exp_date_divider_margin">20dp</dimen>
<dimen name="privacy_btn_width">160dp</dimen>
<dimen name="privacy_icon_size">50dp</dimen>
<dimen name="login_btn_width">150dp</dimen>
<dimen name="login_btn_height">55dp</dimen>
<dimen name="login_btn_bottom_margin">48dp</dimen>
<dimen name="login_btn_bottom_margin_land">48dp</dimen>
<dimen name="login_btn_bottom_margin_small_screen">24dp</dimen>
<dimen name="shared_with_me_icon_size">26dp</dimen>
<dimen name="txt_size_20sp">20sp</dimen>
<dimen name="notification_row_item_height">145dp</dimen>
<dimen name="button_stroke_width">1dp</dimen>
<dimen name="txt_size_13sp">13sp</dimen>
</resources>

0 comments on commit f22270e

Please sign in to comment.