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) {
ViewGroup parent = ((ViewGroup) view.getParent());
parent.addView(emptyView);
if (parent instanceof RelativeLayout) {
RelativeLayout.LayoutParams layoutParams =
(RelativeLayout.LayoutParams) emptyView.getLayoutParams();
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
emptyView.setLayoutParams(layoutParams);
while (parent != null) {
if (parent instanceof RelativeLayout) {
parent.addView(emptyView);
RelativeLayout.LayoutParams layoutParams =
(RelativeLayout.LayoutParams) emptyView.getLayoutParams();
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
emptyView.setLayoutParams(layoutParams);
break;
}
parent = (ViewGroup) parent.getParent();
}
}