Browse Source

Implement theming of 2-action notification item's buttons

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 years ago
parent
commit
d94f9acd11

+ 4 - 7
app/src/main/java/com/owncloud/android/ui/adapter/NotificationListAdapter.java

@@ -266,15 +266,12 @@ public class NotificationListAdapter extends RecyclerView.Adapter<NotificationLi
                 final MaterialButton button = new MaterialButton(notificationsActivity);
                 final MaterialButton button = new MaterialButton(notificationsActivity);
 
 
                 if (action.primary) {
                 if (action.primary) {
-                    button.setBackgroundColor(ResourcesCompat.getColor(resources,
-                                                                       R.color.notification_action_btn_color, null));
-                    button.setTextColor(ResourcesCompat.getColor(resources,
-                                                                 R.color.white, null));
+                    viewThemeUtils.material.colorMaterialButtonPrimaryFilled(button);
                 } else {
                 } else {
                     button.setBackgroundColor(ResourcesCompat.getColor(resources,
                     button.setBackgroundColor(ResourcesCompat.getColor(resources,
-                                                                       android.R.color.transparent, null));
-                    button.setTextColor(ResourcesCompat.getColor(resources,
-                                                                 R.color.notification_action_btn_color, null));
+                                                                       android.R.color.transparent,
+                                                                       null));
+                    viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(button);
                 }
                 }
 
 
                 button.setAllCaps(false);
                 button.setAllCaps(false);

+ 3 - 3
app/src/main/res/layout/notification_list_item.xml

@@ -69,7 +69,7 @@
                 android:id="@+id/dismiss"
                 android:id="@+id/dismiss"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                app:tint="@color/notification_sublime_color"
+                app:tint="@color/secondary_text_color"
                 android:src="@drawable/ic_close"
                 android:src="@drawable/ic_close"
                 android:contentDescription="@string/dismiss_notification_description" />
                 android:contentDescription="@string/dismiss_notification_description" />
         </LinearLayout>
         </LinearLayout>
@@ -79,7 +79,7 @@
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:ellipsize="end"
             android:ellipsize="end"
-            android:textColor="@color/notification_sublime_color"
+            android:textColor="@color/secondary_text_color"
             android:textSize="@dimen/txt_size_14sp"
             android:textSize="@dimen/txt_size_14sp"
             tools:text="@string/placeholder_sentence"
             tools:text="@string/placeholder_sentence"
             android:textAppearance="?android:attr/textAppearanceListItem"/>
             android:textAppearance="?android:attr/textAppearanceListItem"/>
@@ -101,7 +101,7 @@
             android:ellipsize="end"
             android:ellipsize="end"
             android:textSize="@dimen/text_size_13sp"
             android:textSize="@dimen/text_size_13sp"
             tools:text="@string/placeholder_sentence"
             tools:text="@string/placeholder_sentence"
-            android:textColor="@color/notification_sublime_color"/>
+            android:textColor="@color/secondary_text_color"/>
 
 
     </LinearLayout>
     </LinearLayout>
 
 

+ 0 - 2
app/src/main/res/values/colors.xml

@@ -33,8 +33,6 @@
     <color name="transparent">#00000000</color>
     <color name="transparent">#00000000</color>
     <color name="secondary_text_color">#666666</color>
     <color name="secondary_text_color">#666666</color>
     <color name="highlight_textColor_Warning">#e53935</color>
     <color name="highlight_textColor_Warning">#e53935</color>
-    <color name="notification_action_btn_color">#0099ff</color>
-    <color name="notification_sublime_color">#666666</color>
 
 
     <!-- Colors -->
     <!-- Colors -->
     <color name="standard_grey">#757575</color>
     <color name="standard_grey">#757575</color>