Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Commit 7573399

Browse files
author
Elise Richards
committed
929: Soft pan layout when clicking on fxa password field to open keyboard (#1018)
* Soft pan layout when clicking on fxa password field to open keyboard. * Reset soft input to previous value when the view is destroyed.
1 parent b953b0f commit 7573399

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.externalNativeBuild
88
/site
99
.idea/assetWizardSettings.xml
10+
.idea/codeStyles/Project.xml
1011
.idea/gradle.xml
1112
.idea/caches
1213
.idea/navEditor.xml

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ configurations.all { config ->
8484
dependencies {
8585
implementation fileTree(dir: 'libs', include: ['*.jar'])
8686
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
87-
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
87+
implementation 'androidx.appcompat:appcompat:1.1.0'
8888
implementation 'androidx.cardview:cardview:1.0.0'
89-
implementation 'com.google.android.material:material:1.1.0-alpha09'
89+
implementation 'com.google.android.material:material:1.2.0-alpha01'
9090
implementation "androidx.recyclerview:recyclerview:$recyclerview_version"
9191
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
9292
implementation 'androidx.exifinterface:exifinterface:1.0.0'

app/src/main/java/mozilla/lockbox/view/FxALoginFragment.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import android.os.Bundle
1212
import android.view.LayoutInflater
1313
import android.view.View
1414
import android.view.ViewGroup
15+
import android.view.WindowManager
1516
import android.webkit.CookieManager
1617
import android.webkit.WebResourceRequest
1718
import android.webkit.WebView
@@ -30,6 +31,7 @@ import mozilla.lockbox.support.isDebug
3031
@ExperimentalCoroutinesApi
3132
class FxALoginFragment : BackableFragment(), FxALoginView {
3233
private var errorHelper = NetworkErrorHelper()
34+
private val inputMode = activity?.window?.attributes?.softInputMode
3335

3436
override var webViewRedirect: ((url: Uri?) -> Boolean) = { _ -> false }
3537

@@ -40,13 +42,21 @@ class FxALoginFragment : BackableFragment(), FxALoginView {
4042
savedInstanceState: Bundle?
4143
): View? {
4244
presenter = FxALoginPresenter(this)
45+
4346
val view = inflater.inflate(R.layout.fragment_fxa_login, container, false)
4447
view.webView.settings.domStorageEnabled = true
4548
view.webView.settings.javaScriptEnabled = true
4649
CookieManager.getInstance().setAcceptCookie(true)
50+
activity?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
51+
4752
return view
4853
}
4954

55+
override fun onPause() {
56+
super.onPause()
57+
activity?.window?.setSoftInputMode(inputMode ?: WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
58+
}
59+
5060
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
5161
super.onViewCreated(view, savedInstanceState)
5262

0 commit comments

Comments
 (0)