diff --git a/android/app/src/main/java/top/ourfor/app/iplayx/page/Router.java b/android/app/src/main/java/top/ourfor/app/iplayx/page/Router.java index 537808b..15b6f8b 100644 --- a/android/app/src/main/java/top/ourfor/app/iplayx/page/Router.java +++ b/android/app/src/main/java/top/ourfor/app/iplayx/page/Router.java @@ -128,6 +128,7 @@ public void pushPage(int id, Map params) { page.viewWillDisappear(); val newPage = makePage(id); pageId.put(newPage, id); + assert newPage != null; newPage.create(container.getContext(), params); pages.push(newPage); val view = newPage.view(); diff --git a/android/app/src/main/java/top/ourfor/app/iplayx/page/login/LoginPage.java b/android/app/src/main/java/top/ourfor/app/iplayx/page/login/LoginPage.java index 16df946..a04d394 100644 --- a/android/app/src/main/java/top/ourfor/app/iplayx/page/login/LoginPage.java +++ b/android/app/src/main/java/top/ourfor/app/iplayx/page/login/LoginPage.java @@ -82,7 +82,7 @@ public class LoginPage extends BottomSheetDialogFragment implements OneDriveActi ); LoginPageBinding binding = null; - boolean isFragment = false; + boolean isPage = false; @Setter public boolean isDialogModel = false; @Setter @@ -100,7 +100,7 @@ public class LoginPage extends BottomSheetDialogFragment implements OneDriveActi public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); binding = LoginPageBinding.inflate(inflater, container, false); - isFragment = container != null; + isPage = false; val actionBar = XGET(ActionBar.class); if (!isDialogModel) { XGET(NavigationTitleBar.class).setNavTitle(R.string.login); @@ -119,7 +119,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c void setup(LayoutInflater inflater, ViewGroup container) { binding = LoginPageBinding.inflate(inflater, container, false); - isFragment = container != null; val actionBar = XGET(ActionBar.class); if (!isDialogModel) { XGET(NavigationTitleBar.class).setNavTitle(R.string.login); @@ -302,7 +301,7 @@ private void loginToEmby(String remake, String server, String username, String p val action = XGET(SiteUpdateAction.class); action.onSiteUpdate(); Toast.makeText(context, "Login success", Toast.LENGTH_SHORT).show(); - if (isFragment) { + if (isPage) { XGET(Navigator.class).popPage(); } else { dismiss(); @@ -342,7 +341,7 @@ private void loginToJellyfin(String remake, String server, String username, Stri val action = XGET(SiteUpdateAction.class); action.onSiteUpdate(); Toast.makeText(context, "Login success", Toast.LENGTH_SHORT).show(); - if (isFragment) { + if (isPage) { XGET(Navigator.class).popPage(); } else { dismiss(); @@ -586,6 +585,7 @@ public View view() { @Override public void create(Context context, Map params) { this.context = context; + this.isPage = true; setup(LayoutInflater.from(context), null); } } diff --git a/android/app/src/main/java/top/ourfor/app/iplayx/view/video/PlayerCommentView.java b/android/app/src/main/java/top/ourfor/app/iplayx/view/video/PlayerCommentView.java index b507122..e7c8770 100644 --- a/android/app/src/main/java/top/ourfor/app/iplayx/view/video/PlayerCommentView.java +++ b/android/app/src/main/java/top/ourfor/app/iplayx/view/video/PlayerCommentView.java @@ -138,7 +138,9 @@ public void onAnimationStart(Animator animation) { @Override public void onAnimationEnd(Animator animation) { view.setVisibility(View.GONE); - ((ViewGroup) view.getParent()).removeView(view); + val superview = view.getParent(); + if (superview == null) return; + ((ViewGroup) superview).removeView(view); recycleView((TextView) view); } diff --git a/android/app/src/main/res/drawable/bg_spinner.xml b/android/app/src/main/res/drawable/bg_spinner.xml new file mode 100644 index 0000000..bc59682 --- /dev/null +++ b/android/app/src/main/res/drawable/bg_spinner.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/layout/player_config_panel.xml b/android/app/src/main/res/layout/player_config_panel.xml index 3ece7e1..f249335 100644 --- a/android/app/src/main/res/layout/player_config_panel.xml +++ b/android/app/src/main/res/layout/player_config_panel.xml @@ -28,6 +28,7 @@ app:layout_constraintTop_toBottomOf="@id/video_label" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" + android:background="@drawable/bg_spinner" />