Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.28] Login #175

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/src/debug/res/values/setup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- webview_login_url should be empty in debug mode to show login url input screen
this will be useful in switching the environments during testing -->
<string name="webview_login_url" translatable="false" />
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,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();
}
Expand Down Expand Up @@ -457,6 +463,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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ protected void onNewIntent(Intent intent) {
protected void onRestart() {
Log_OC.v(TAG, "onRestart() start");
super.onRestart();
mixinRegistry.onRestart();
//Fix of NMC-2303 and NMC-2441
if (enableAccountHandling) {
mixinRegistry.onRestart();
}
}

private void onThemeSettingsModeChanged() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,8 @@ protected void onStop() {

@Subscribe(threadMode = ThreadMode.MAIN)
public void onAccountRemovedEvent(AccountRemovedEvent event) {
restart();
//NMC customization
finish();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<color name="login_text_hint_color">#7fC0E3</color>

<!-- Multiaccount support -->
<bool name="multiaccount_support">true</bool>
<bool name="multiaccount_support">false</bool>

<!-- Drawer options -->
<bool name="recently_modified_enabled">false</bool>
Expand Down
5 changes: 5 additions & 0 deletions app/src/release/res/values/setup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- webview_login_url prod -->
<string name="webview_login_url" translatable="false" >https://magentacloud.de/index.php/login/flow</string>
</resources>