mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-10-23 21:25:54 +03:00
Merge branch 'master' into 831-room
This commit is contained in:
commit
1a0e99fd4d
5 changed files with 18 additions and 7 deletions
|
@ -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;
|
||||
|
@ -66,8 +64,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)) {
|
||||
|
@ -93,8 +91,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);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@ public class GridItemDecoration extends SectionItemDecoration {
|
|||
final int spanIndex = lp.getSpanIndex();
|
||||
|
||||
// First row gets some spacing at the top
|
||||
if (position < spanCount && position < adapter.getFirstPositionOfViewType(ItemAdapter.TYPE_SECTION)) {
|
||||
final int firstSectionPosition = adapter.getFirstPositionOfViewType(ItemAdapter.TYPE_SECTION);
|
||||
if (position < spanCount && (firstSectionPosition < 0 || position < firstSectionPosition)) {
|
||||
outRect.top = gutter;
|
||||
}
|
||||
|
||||
|
|
5
app/src/main/res/color/grid_item_background_selector.xml
Normal file
5
app/src/main/res/color/grid_item_background_selector.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?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>
|
1
fastlane/metadata/android/en-US/changelogs/3002004.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/3002004.txt
Normal file
|
@ -0,0 +1 @@
|
|||
- 🐞 Grid view: no padding top on first line in some cases (#890)
|
1
fastlane/metadata/android/en-US/changelogs/3002005.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/3002005.txt
Normal file
|
@ -0,0 +1 @@
|
|||
- 🏷 Category label in grid view doesn't take highlight background colour upon selection (#945)
|
Loading…
Reference in a new issue