Loading app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java +9 −6 Original line number Diff line number Diff line Loading @@ -3,8 +3,6 @@ package it.niedermann.owncloud.notes.main.items; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.BackgroundColorSpan; Loading Loading @@ -65,8 +63,8 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { noteCategory.setVisibility(showCategory && !category.isEmpty() ? View.VISIBLE : View.GONE); noteCategory.setText(category); @ColorInt int categoryForeground; @ColorInt int categoryBackground; @ColorInt final int categoryForeground; @ColorInt final int categoryBackground; if (isDarkThemeActive) { if (ColorUtil.INSTANCE.isColorDark(mainColor)) { Loading @@ -92,8 +90,13 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { noteCategory.setTextColor(categoryForeground); if (noteCategory instanceof Chip) { ((Chip) noteCategory).setChipStrokeColor(ColorStateList.valueOf(categoryBackground)); ((Chip) noteCategory).setChipBackgroundColor(ColorStateList.valueOf(isDarkThemeActive ? categoryBackground : Color.TRANSPARENT)); final Chip chip = (Chip) noteCategory; chip.setChipStrokeColor(ColorStateList.valueOf(categoryBackground)); if(isDarkThemeActive) { chip.setChipBackgroundColor(ColorStateList.valueOf(categoryBackground)); } else { chip.setChipBackgroundColorResource(R.color.grid_item_background_selector); } } else { DrawableCompat.setTint(noteCategory.getBackground(), categoryBackground); } Loading app/src/main/res/color/grid_item_background_selector.xml 0 → 100644 +5 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- Same as grid_item_background_selector in res/drawable, but can be applied as BackgroundColorResource --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/bg_highlighted" android:state_selected="true" /> <item android:color="@android:color/transparent" /> </selector> Loading
app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java +9 −6 Original line number Diff line number Diff line Loading @@ -3,8 +3,6 @@ package it.niedermann.owncloud.notes.main.items; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.BackgroundColorSpan; Loading Loading @@ -65,8 +63,8 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { noteCategory.setVisibility(showCategory && !category.isEmpty() ? View.VISIBLE : View.GONE); noteCategory.setText(category); @ColorInt int categoryForeground; @ColorInt int categoryBackground; @ColorInt final int categoryForeground; @ColorInt final int categoryBackground; if (isDarkThemeActive) { if (ColorUtil.INSTANCE.isColorDark(mainColor)) { Loading @@ -92,8 +90,13 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { noteCategory.setTextColor(categoryForeground); if (noteCategory instanceof Chip) { ((Chip) noteCategory).setChipStrokeColor(ColorStateList.valueOf(categoryBackground)); ((Chip) noteCategory).setChipBackgroundColor(ColorStateList.valueOf(isDarkThemeActive ? categoryBackground : Color.TRANSPARENT)); final Chip chip = (Chip) noteCategory; chip.setChipStrokeColor(ColorStateList.valueOf(categoryBackground)); if(isDarkThemeActive) { chip.setChipBackgroundColor(ColorStateList.valueOf(categoryBackground)); } else { chip.setChipBackgroundColorResource(R.color.grid_item_background_selector); } } else { DrawableCompat.setTint(noteCategory.getBackground(), categoryBackground); } Loading
app/src/main/res/color/grid_item_background_selector.xml 0 → 100644 +5 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- Same as grid_item_background_selector in res/drawable, but can be applied as BackgroundColorResource --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/bg_highlighted" android:state_selected="true" /> <item android:color="@android:color/transparent" /> </selector>