Don't scroll to top when navigating back/forward in WebView

This commit is contained in:
arkon
2020-12-10 09:15:09 -05:00
parent b6e246c6b2
commit 8ffd3a8ed2
3 changed files with 23 additions and 14 deletions
@@ -21,8 +21,6 @@ class MyAnimeListLoginActivity : BaseWebViewActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
title = getString(R.string.login)
if (bundle == null) {
binding.webview.webViewClient = object : WebViewClientCompat() {
override fun shouldOverrideUrlCompat(view: WebView, url: String): Boolean {
@@ -68,9 +66,10 @@ class MyAnimeListLoginActivity : BaseWebViewActivity() {
companion object {
fun newIntent(context: Context): Intent {
val intent = Intent(context, MyAnimeListLoginActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
return intent
return Intent(context, MyAnimeListLoginActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
putExtra(TITLE_KEY, context.getString(R.string.login))
}
}
}
}