summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-09-17 15:48:10 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-09-25 11:43:22 +0000
commit56062813d5233b0f6647a080208d3cafcd4bf1bf (patch)
tree0e8c4587f3c24005cf0b425e489e5e64719d3ed4 /android/src
parent3597ff1a62962cd7c1f3ace0bac9c931430a6325 (diff)
downloadmullvadvpn-56062813d5233b0f6647a080208d3cafcd4bf1bf.tar.xz
mullvadvpn-56062813d5233b0f6647a080208d3cafcd4bf1bf.zip
Keep account login static when removing entries
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
}