Fixed episodes page no longer shows empty view (#4573)

This commit is contained in:
Nikhil Aggarwal 2020-10-28 13:45:18 +05:30 committed by GitHub
parent 885362e5eb
commit 15ba3f8f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -84,12 +84,16 @@ public class EmptyViewHandler {
private void addToParentView(View view) { private void addToParentView(View view) {
ViewGroup parent = ((ViewGroup) view.getParent()); ViewGroup parent = ((ViewGroup) view.getParent());
parent.addView(emptyView); while (parent != null) {
if (parent instanceof RelativeLayout) { if (parent instanceof RelativeLayout) {
RelativeLayout.LayoutParams layoutParams = parent.addView(emptyView);
(RelativeLayout.LayoutParams) emptyView.getLayoutParams(); RelativeLayout.LayoutParams layoutParams =
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE); (RelativeLayout.LayoutParams) emptyView.getLayoutParams();
emptyView.setLayoutParams(layoutParams); layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
emptyView.setLayoutParams(layoutParams);
break;
}
parent = (ViewGroup) parent.getParent();
} }
} }