summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt9
1 files changed, 8 insertions, 1 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 1d1d2cb4e9..3cc2935c21 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
@@ -19,6 +19,10 @@ import net.mullvad.mullvadvpn.ui.LoginState
import net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder.BorderState
class AccountLogin : RelativeLayout {
+ companion object {
+ private val MAX_ACCOUNT_HISTORY_ENTRIES = 3
+ }
+
private val container =
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).let { service ->
val inflater = service as LayoutInflater
@@ -46,6 +50,9 @@ class AccountLogin : RelativeLayout {
duration = 350
}
+ private val maxHeight: Int
+ get() = MAX_ACCOUNT_HISTORY_ENTRIES * (historyEntryHeight + dividerHeight)
+
private val expandedHeight: Int
get() = collapsedHeight + historyHeight
@@ -177,7 +184,7 @@ class AccountLogin : RelativeLayout {
val layoutParams = container.layoutParams as MarginLayoutParams
layoutParams.height = height
- layoutParams.bottomMargin = expandedHeight - height
+ layoutParams.bottomMargin = maxHeight - height
container.layoutParams = layoutParams
}