From 9ea94cbd09c430bcfb6328e278bde857ee1fe32c Mon Sep 17 00:00:00 2001 From: A117870935 Date: Mon, 24 Apr 2023 11:47:04 +0530 Subject: [PATCH] Login related customization. --- app/src/debug/res/values/setup.xml | 6 ++++++ .../authentication/AuthenticatorActivity.java | 12 +++++++++++- .../owncloud/android/ui/activity/DrawerActivity.java | 3 ++- app/src/main/res/values/setup.xml | 2 +- app/src/release/res/values/setup.xml | 5 +++++ 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 app/src/debug/res/values/setup.xml create mode 100644 app/src/release/res/values/setup.xml diff --git a/app/src/debug/res/values/setup.xml b/app/src/debug/res/values/setup.xml new file mode 100644 index 000000000000..046f7830a774 --- /dev/null +++ b/app/src/debug/res/values/setup.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java b/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java index 2d127b3f03f6..f879c3a30be8 100644 --- a/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/app/src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -539,7 +539,13 @@ public boolean onKeyDown(int keyCode, KeyEvent event) { if (accountSetupWebviewBinding != null && event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_BACK) { if (accountSetupWebviewBinding.loginWebview.canGoBack()) { - accountSetupWebviewBinding.loginWebview.goBack(); + // NMC-2602 Fix + // On back press "Webpage not available" error comes + // because login urls doesn't maintain the backstack hierarchy + // to solve it we are recreating the activity with the actual login url + // if user presses back from other urls which is not first or login url + // it will recreate the activity else it will finish the activity + recreate(); } else { finish(); } @@ -577,6 +583,10 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) { public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); + //scroll to top when url loads + //because directly loading Telekom login page it scrolls down automatically + view.scrollTo(0,0); + accountSetupWebviewBinding.loginWebviewProgressBar.setVisibility(View.GONE); accountSetupWebviewBinding.loginWebview.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index 9d6e8704c323..9300a8449983 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java @@ -1215,7 +1215,8 @@ protected void onStop() { @Subscribe(threadMode = ThreadMode.MAIN) public void onAccountRemovedEvent(AccountRemovedEvent event) { - restart(); + //NMC customization + finish(); } /** diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml index 3b6c7532937e..7df313292095 100644 --- a/app/src/main/res/values/setup.xml +++ b/app/src/main/res/values/setup.xml @@ -65,7 +65,7 @@ #7fC0E3 - true + false false diff --git a/app/src/release/res/values/setup.xml b/app/src/release/res/values/setup.xml new file mode 100644 index 000000000000..a4600f0ff88a --- /dev/null +++ b/app/src/release/res/values/setup.xml @@ -0,0 +1,5 @@ + + + + https://magentacloud.de/index.php/login/flow + \ No newline at end of file