Skip to content

Commit

Permalink
Notification icon customization.
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed Jun 9, 2023
1 parent 1ba8c3e commit 971a77e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,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 @@ -230,8 +234,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
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.os.HandlerThread;
import android.os.Process;

import com.owncloud.android.R;
import com.owncloud.android.utils.theme.ViewThemeUtils;

import java.security.SecureRandom;
Expand Down Expand Up @@ -63,7 +64,8 @@ private NotificationUtils() {
*/
public static NotificationCompat.Builder newNotificationBuilder(Context context, final ViewThemeUtils viewThemeUtils) {
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
viewThemeUtils.androidx.themeNotificationCompatBuilder(context, builder);
//NMC Customization
builder.setColor(context.getResources().getColor(R.color.primary, null));
return builder;
}

Expand Down
8 changes: 3 additions & 5 deletions app/src/main/res/layout/notification_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/notification_row_item_height"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="@dimen/standard_padding"
android:paddingTop="@dimen/standard_padding"
Expand Down Expand Up @@ -60,9 +59,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="@dimen/txt_size_16sp"
android:ellipsize="end"
android:textColor="@color/text_color"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="@color/text_color"
android:textSize="@dimen/txt_size_16sp"
Expand Down Expand Up @@ -93,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 @@ -101,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
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

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

<!-- standard material color definitions -->

Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="splash_image_size">116dp</dimen>
<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_14sp">14sp</dimen>
<dimen name="txt_size_16sp">16sp</dimen>
<dimen name="txt_size_18sp">18sp</dimen>
<dimen name="txt_size_15sp">15sp</dimen>
<dimen name="crop_corner_size">15dp</dimen>
Expand Down

0 comments on commit 971a77e

Please sign in to comment.