fix(recycler-empty-view): make the textViews in the empty views follow the color themes

This commit is contained in:
LucasGGamerM 2023-09-25 11:10:37 -03:00
parent cc86edf276
commit a168a0226b
1 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,10 @@ package org.joinmastodon.android.fragments;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toolbar;
import org.joinmastodon.android.R;
@ -43,6 +47,14 @@ public abstract class MastodonRecyclerFragment<T> extends BaseRecyclerFragment<T
refreshLayout.setProgressBackgroundColorSchemeColor(UiUtils.alphaBlendColors(colorBackground, colorPrimary, 0.11f));
refreshLayout.setColorSchemeColors(colorPrimary);
}
// This is to set the color of the 'This list is empty'
for (int i=0; i < ((LinearLayout) emptyView).getChildCount(); i++) {
View v = ((LinearLayout) emptyView).getChildAt(i);
if(v instanceof TextView) {
((TextView) v).setTextColor(UiUtils.getThemeColor(getContext(), android.R.attr.textColorSecondary));
}
}
}
@Override