mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-19 13:34:00 +02:00
Set item group text color to workaround an Android bug
This commit is contained in:
@@ -145,6 +145,9 @@ public class FragmentAccounts extends FragmentBase {
|
||||
rvAccount.addItemDecoration(itemDecorator);
|
||||
}
|
||||
|
||||
int textColorSecondary = Helper.resolveColor(getContext(), android.R.attr.textColorSecondary);
|
||||
int textColorTertiary = Helper.resolveColor(getContext(), android.R.attr.textColorTertiary);
|
||||
|
||||
DividerItemDecoration categoryDecorator = new DividerItemDecoration(getContext(), llm.getOrientation()) {
|
||||
@Override
|
||||
public void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
@@ -196,6 +199,9 @@ public class FragmentAccounts extends FragmentBase {
|
||||
TextView tvCategory = header.findViewById(R.id.tvCategory);
|
||||
TextView tvDate = header.findViewById(R.id.tvDate);
|
||||
|
||||
tvCategory.setTextColor(textColorSecondary);
|
||||
tvDate.setTextColor(textColorTertiary);
|
||||
|
||||
if (cards) {
|
||||
View vSeparator = header.findViewById(R.id.vSeparator);
|
||||
vSeparator.setVisibility(View.GONE);
|
||||
|
||||
@@ -217,6 +217,9 @@ public class FragmentFolders extends FragmentBase {
|
||||
}
|
||||
|
||||
if (unified) {
|
||||
int textColorSecondary = Helper.resolveColor(getContext(), android.R.attr.textColorSecondary);
|
||||
int textColorTertiary = Helper.resolveColor(getContext(), android.R.attr.textColorTertiary);
|
||||
|
||||
DividerItemDecoration categoryDecorator = new DividerItemDecoration(getContext(), llm.getOrientation()) {
|
||||
@Override
|
||||
public void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
@@ -268,6 +271,9 @@ public class FragmentFolders extends FragmentBase {
|
||||
TextView tvCategory = header.findViewById(R.id.tvCategory);
|
||||
TextView tvDate = header.findViewById(R.id.tvDate);
|
||||
|
||||
tvCategory.setTextColor(textColorSecondary);
|
||||
tvDate.setTextColor(textColorTertiary);
|
||||
|
||||
if (cards) {
|
||||
View vSeparator = header.findViewById(R.id.vSeparator);
|
||||
vSeparator.setVisibility(View.GONE);
|
||||
|
||||
@@ -92,6 +92,9 @@ public class FragmentIdentities extends FragmentBase {
|
||||
rvIdentity.addItemDecoration(itemDecorator);
|
||||
}
|
||||
|
||||
int textColorSecondary = Helper.resolveColor(getContext(), android.R.attr.textColorSecondary);
|
||||
int textColorTertiary = Helper.resolveColor(getContext(), android.R.attr.textColorTertiary);
|
||||
|
||||
DividerItemDecoration categoryDecorator = new DividerItemDecoration(getContext(), llm.getOrientation()) {
|
||||
@Override
|
||||
public void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
@@ -143,6 +146,9 @@ public class FragmentIdentities extends FragmentBase {
|
||||
TextView tvCategory = header.findViewById(R.id.tvCategory);
|
||||
TextView tvDate = header.findViewById(R.id.tvDate);
|
||||
|
||||
tvCategory.setTextColor(textColorSecondary);
|
||||
tvDate.setTextColor(textColorTertiary);
|
||||
|
||||
if (cards) {
|
||||
View vSeparator = header.findViewById(R.id.vSeparator);
|
||||
vSeparator.setVisibility(View.GONE);
|
||||
|
||||
@@ -677,11 +677,17 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
rvMessage.addItemDecoration(itemDecorator);
|
||||
}
|
||||
|
||||
int textColorSecondary = Helper.resolveColor(getContext(), android.R.attr.textColorSecondary);
|
||||
int textColorTertiary = Helper.resolveColor(getContext(), android.R.attr.textColorTertiary);
|
||||
|
||||
View inGroup = view.findViewById(R.id.inGroup);
|
||||
TextView tvFixedCategory = inGroup.findViewById(R.id.tvCategory);
|
||||
TextView tvFixedDate = inGroup.findViewById(R.id.tvDate);
|
||||
View vFixedSeparator = inGroup.findViewById(R.id.vSeparator);
|
||||
|
||||
tvFixedCategory.setTextColor(textColorSecondary);
|
||||
tvFixedDate.setTextColor(textColorTertiary);
|
||||
|
||||
String sort = prefs.getString(getSort(getContext(), viewType, type), "time");
|
||||
inGroup.setVisibility(date_fixed && "time".equals(sort) ? View.INVISIBLE : View.GONE);
|
||||
tvFixedCategory.setVisibility(View.GONE);
|
||||
@@ -774,6 +780,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
View header = inflater.inflate(R.layout.item_group, null, false);
|
||||
TextView tvCategory = header.findViewById(R.id.tvCategory);
|
||||
TextView tvDate = header.findViewById(R.id.tvDate);
|
||||
|
||||
tvCategory.setTextColor(textColorSecondary);
|
||||
tvDate.setTextColor(textColorTertiary);
|
||||
|
||||
tvCategory.setVisibility(ch ? View.VISIBLE : View.GONE);
|
||||
tvDate.setVisibility(dh ? View.VISIBLE : View.GONE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user