fix: use built-in appkit empty view styles entry and remove hack to apply colors to the empty view texts

This commit is contained in:
LucasGGamerM
2023-09-29 16:22:56 -03:00
parent 232d2e7e6d
commit 23843e9002
2 changed files with 8 additions and 11 deletions

View File

@@ -40,19 +40,10 @@ public abstract class MastodonRecyclerFragment<T> extends BaseRecyclerFragment<T
@CallSuper
public void onViewCreated(View view, Bundle savedInstanceState){
super.onViewCreated(view, savedInstanceState);
if (getParentFragment() instanceof HasElevationOnScrollListener elevator)
list.addOnScrollListener(elevator.getElevationOnScrollListener());
else if(wantsElevationOnScrollEffect())
if(wantsElevationOnScrollEffect())
list.addOnScrollListener(elevationOnScrollListener=new ElevationOnScrollListener((FragmentRootLinearLayout) view, getViewsForElevationEffect()));
if(refreshLayout!=null)
if(refreshLayout!=null){
setRefreshLayoutColors(refreshLayout);
// 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));
}
}
}