From 612f7a18164e037877c638006620e77f9c61f2d0 Mon Sep 17 00:00:00 2001 From: ourfor Date: Tue, 10 Dec 2024 18:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20crash=20(login=20page)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../top/ourfor/app/iplayx/page/login/LoginPage.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 943837f..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 @@ -36,7 +36,6 @@ import lombok.extern.slf4j.Slf4j; import lombok.val; import top.ourfor.app.iplayx.R; -import top.ourfor.app.iplayx.action.DispatchAction; import top.ourfor.app.iplayx.action.SiteUpdateAction; import top.ourfor.app.iplayx.api.alist.AlistApi; import top.ourfor.app.iplayx.api.cloud189.Cloud189Api; @@ -83,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 @@ -101,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); @@ -120,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); @@ -303,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(); @@ -343,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(); @@ -587,7 +585,7 @@ public View view() { @Override public void create(Context context, Map params) { this.context = context; - this.isFragment = true; + this.isPage = true; setup(LayoutInflater.from(context), null); } }