summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt16
1 files changed, 10 insertions, 6 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
index 5aa4ebbd88..7bc2c33076 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
@@ -35,12 +35,7 @@ class AccountLogin : RelativeLayout {
private val historyAnimation = ValueAnimator.ofInt(0, 0).apply {
addUpdateListener { animation ->
- val layoutParams = container.layoutParams as MarginLayoutParams
-
- layoutParams.height = animation.animatedValue as Int
- layoutParams.bottomMargin = expandedHeight - value
-
- container.layoutParams = layoutParams
+ updateHeight(animation.animatedValue as Int)
}
duration = 350
@@ -168,6 +163,15 @@ class AccountLogin : RelativeLayout {
}
}
+ private fun updateHeight(height: Int) {
+ val layoutParams = container.layoutParams as MarginLayoutParams
+
+ layoutParams.height = height
+ layoutParams.bottomMargin = expandedHeight - height
+
+ container.layoutParams = layoutParams
+ }
+
private fun hideKeyboard() {
val inputManagerId = Activity.INPUT_METHOD_SERVICE
val inputManager = context.getSystemService(inputManagerId) as InputMethodManager