summaryrefslogtreecommitdiffhomepage
path: root/android/app/src
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson90@gmail.com>2023-09-22 09:15:02 +0200
committerDavid Göransson <david.goransson90@gmail.com>2023-09-27 08:23:26 +0200
commitd47222a317bbb4915f4493dc7c5b82c76c206ad3 (patch)
tree0979f1c678973d5aaaa2a4091705eda8734742e5 /android/app/src
parent08a74bc5857076e7dc2eb3963c49ec775cedb688 (diff)
downloadmullvadvpn-d47222a317bbb4915f4493dc7c5b82c76c206ad3.tar.xz
mullvadvpn-d47222a317bbb4915f4493dc7c5b82c76c206ad3.zip
Remove old login screen views
Diffstat (limited to 'android/app/src')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryAdapter.kt38
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryHolder.kt37
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountInput.kt184
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt221
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLoginBorder.kt108
-rw-r--r--android/app/src/main/res/layout/account_history_entry.xml22
-rw-r--r--android/app/src/main/res/layout/account_input.xml22
-rw-r--r--android/app/src/main/res/layout/account_login.xml16
-rw-r--r--android/app/src/main/res/layout/account_login_border.xml59
-rw-r--r--android/app/src/main/res/layout/login.xml103
10 files changed, 0 insertions, 810 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryAdapter.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryAdapter.kt
deleted file mode 100644
index e60d9c406f..0000000000
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryAdapter.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-package net.mullvad.mullvadvpn.ui.widget
-
-import android.view.LayoutInflater
-import android.view.ViewGroup
-import androidx.recyclerview.widget.RecyclerView.Adapter
-import kotlin.properties.Delegates.observable
-import net.mullvad.mullvadvpn.R
-import net.mullvad.mullvadvpn.util.SegmentedTextFormatter
-
-class AccountHistoryAdapter : Adapter<AccountHistoryHolder>() {
- private val formatter =
- SegmentedTextFormatter(' ').apply {
- isValidInputCharacter = { character -> '0' <= character && character <= '9' }
- }
-
- var accountHistory by observable<String?>(null) { _, _, _ -> notifyDataSetChanged() }
-
- var onSelectEntry: ((String) -> Unit)? = null
- var onRemoveEntry: (() -> Unit)? = null
- var onChildFocusChanged: ((String, Boolean) -> Unit)? = null
-
- override fun onCreateViewHolder(parentView: ViewGroup, type: Int): AccountHistoryHolder {
- val inflater = LayoutInflater.from(parentView.context)
- val view = inflater.inflate(R.layout.account_history_entry, parentView, false)
-
- return AccountHistoryHolder(view, formatter).apply {
- onSelect = { account -> onSelectEntry?.invoke(account) }
- onRemove = { _ -> onRemoveEntry?.invoke() }
- onFocusChanged = { account, hasFocus -> onChildFocusChanged?.invoke(account, hasFocus) }
- }
- }
-
- override fun onBindViewHolder(holder: AccountHistoryHolder, position: Int) {
- holder.accountToken = accountHistory ?: ""
- }
-
- override fun getItemCount() = if (accountHistory !== null) 1 else 0
-}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryHolder.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryHolder.kt
deleted file mode 100644
index 20685a0ca3..0000000000
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountHistoryHolder.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-package net.mullvad.mullvadvpn.ui.widget
-
-import android.view.View
-import android.widget.TextView
-import androidx.recyclerview.widget.RecyclerView.ViewHolder
-import kotlin.properties.Delegates.observable
-import net.mullvad.mullvadvpn.R
-import net.mullvad.mullvadvpn.util.SegmentedTextFormatter
-
-class AccountHistoryHolder(view: View, private val formatter: SegmentedTextFormatter) :
- ViewHolder(view) {
- private val label: TextView = view.findViewById(R.id.label)
-
- var accountToken by observable("") { _, _, account -> label.text = formatter.format(account) }
-
- var onSelect: ((String) -> Unit)? = null
- var onRemove: ((String) -> Unit)? = null
- var onFocusChanged: ((String, Boolean) -> Unit)? = null
-
- init {
- view.findViewById<View>(R.id.remove).apply {
- setOnClickListener { onRemove?.invoke(accountToken) }
-
- setOnFocusChangeListener { _, hasFocus ->
- onFocusChanged?.invoke(accountToken, hasFocus)
- }
- }
-
- label.apply {
- setOnClickListener { onSelect?.invoke(accountToken) }
-
- setOnFocusChangeListener { _, hasFocus ->
- onFocusChanged?.invoke(accountToken, hasFocus)
- }
- }
- }
-}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountInput.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountInput.kt
deleted file mode 100644
index 11759d469e..0000000000
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountInput.kt
+++ /dev/null
@@ -1,184 +0,0 @@
-package net.mullvad.mullvadvpn.ui.widget
-
-import android.content.Context
-import android.text.Editable
-import android.text.TextWatcher
-import android.text.method.DigitsKeyListener
-import android.text.style.MetricAffectingSpan
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import android.view.View
-import android.view.View.OnFocusChangeListener
-import android.widget.EditText
-import android.widget.ImageButton
-import android.widget.LinearLayout
-import kotlin.properties.Delegates.observable
-import net.mullvad.mullvadvpn.R
-import net.mullvad.mullvadvpn.ui.LoginState
-import net.mullvad.mullvadvpn.util.SegmentedInputFormatter
-import net.mullvad.mullvadvpn.util.setOnEnterOrDoneAction
-import net.mullvad.talpid.util.EventNotifier
-
-const val MIN_ACCOUNT_TOKEN_LENGTH = 10
-
-class AccountInput : LinearLayout {
- private val disabledTextColor = context.getColor(R.color.white)
- private val enabledTextColor = context.getColor(R.color.blue)
- private val errorTextColor = context.getColor(R.color.red)
-
- private val container =
- context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).let { service ->
- val inflater = service as LayoutInflater
-
- inflater.inflate(R.layout.account_input, this)
- }
-
- private val inputWatcher =
- object : TextWatcher {
- override fun beforeTextChanged(
- text: CharSequence,
- start: Int,
- count: Int,
- after: Int
- ) {}
-
- override fun onTextChanged(text: CharSequence, start: Int, before: Int, count: Int) {}
-
- override fun afterTextChanged(text: Editable) {
- removeFormattingSpans(text)
- setButtonEnabled(text.length >= MIN_ACCOUNT_TOKEN_LENGTH)
- onTextChanged.notify(text.toString())
- }
- }
-
- val input =
- container.findViewById<EditText>(R.id.login_input).apply {
- addTextChangedListener(inputWatcher)
- setOnEnterOrDoneAction(::login)
-
- onFocusChangeListener = OnFocusChangeListener { view, inputHasFocus ->
- hasFocus = inputHasFocus && view.isEnabled
- }
-
- // Manually initializing the `DigitsKeyListener` allows spaces to be used and still
- // keeps
- // the input type as a number so that the correct software keyboard type is shown
- keyListener = DigitsKeyListener.getInstance("01234567890 ")
-
- SegmentedInputFormatter(this, ' ').apply {
- isValidInputCharacter = { character -> '0' <= character && character <= '9' }
- }
- }
-
- private val button =
- container.findViewById<ImageButton>(R.id.login_button).apply {
- setOnClickListener { login() }
- }
-
- val onFocusChanged = EventNotifier(false)
- private var hasFocus by onFocusChanged.notifiable()
-
- val onTextChanged = EventNotifier("")
-
- var loginState by
- observable(LoginState.Initial) { _, _, state ->
- when (state) {
- LoginState.Initial -> initialState()
- LoginState.InProgress -> loggingInState()
- LoginState.Success -> successState()
- LoginState.Failure -> failureState()
- }
- }
-
- var onLogin: ((String) -> Unit)? = null
-
- constructor(context: Context) : super(context)
-
- constructor(context: Context, attributes: AttributeSet) : super(context, attributes)
-
- constructor(
- context: Context,
- attributes: AttributeSet,
- defaultStyleAttribute: Int
- ) : super(context, attributes, defaultStyleAttribute)
-
- init {
- orientation = HORIZONTAL
-
- setButtonEnabled(false)
- }
-
- fun loginWith(accountNumber: String) {
- input.setText(accountNumber)
- onLogin?.invoke(accountNumber)
- }
-
- private fun login() {
- onLogin?.invoke(input.text.replace(Regex("[^0-9]"), ""))
- }
-
- private fun initialState() {
- input.apply {
- setTextColor(enabledTextColor)
- isEnabled = true
- isFocusableInTouchMode = true
- visibility = View.VISIBLE
- }
-
- button.visibility = View.VISIBLE
- setButtonEnabled(input.text.length >= MIN_ACCOUNT_TOKEN_LENGTH)
- }
-
- private fun loggingInState() {
- input.apply {
- setTextColor(disabledTextColor)
- isEnabled = false
- isFocusable = false
- visibility = View.VISIBLE
- }
-
- button.visibility = View.GONE
- setButtonEnabled(false)
- }
-
- private fun successState() {
- input.apply {
- setTextColor(disabledTextColor)
- isEnabled = false
- isFocusable = false
- visibility = View.VISIBLE
- }
-
- button.visibility = View.GONE
- setButtonEnabled(false)
- }
-
- private fun failureState() {
- button.visibility = View.VISIBLE
- setButtonEnabled(true)
-
- input.apply {
- setTextColor(errorTextColor)
- isEnabled = true
- isFocusableInTouchMode = true
- visibility = View.VISIBLE
- requestFocus()
- }
- }
-
- private fun setButtonEnabled(enabled: Boolean) {
- button.apply {
- if (enabled != isEnabled) {
- isEnabled = enabled
- isClickable = enabled
- isFocusable = enabled
- }
- }
- }
-
- private fun removeFormattingSpans(text: Editable) {
- for (span in text.getSpans(0, text.length, MetricAffectingSpan::class.java)) {
- text.removeSpan(span)
- }
- }
-}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
deleted file mode 100644
index 82dc8b6451..0000000000
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
+++ /dev/null
@@ -1,221 +0,0 @@
-package net.mullvad.mullvadvpn.ui.widget
-
-import android.animation.ValueAnimator
-import android.app.Activity
-import android.content.Context
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import android.view.View.OnLayoutChangeListener
-import android.view.inputmethod.InputMethodManager
-import android.widget.RelativeLayout
-import androidx.recyclerview.widget.LinearLayoutManager
-import androidx.recyclerview.widget.RecyclerView
-import kotlin.properties.Delegates.observable
-import net.mullvad.mullvadvpn.R
-import net.mullvad.mullvadvpn.ui.ListItemDividerDecoration
-import net.mullvad.mullvadvpn.ui.LoginState
-import net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder.BorderState
-import net.mullvad.mullvadvpn.util.Debouncer
-
-class AccountLogin : RelativeLayout {
- companion object {
- private val MAX_ACCOUNT_HISTORY_ENTRIES = 3
- }
-
- fun setAccountToken(accountToken: String) {
- input.input.setText(accountToken)
- }
-
- private val focusDebouncer =
- Debouncer(false).apply { listener = { hasFocus -> focused = hasFocus } }
-
- private val container =
- context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).let { service ->
- val inflater = service as LayoutInflater
-
- inflater.inflate(R.layout.account_login, this)
- }
-
- private val border: AccountLoginBorder = container.findViewById(R.id.border)
- private val accountHistoryList: RecyclerView = container.findViewById(R.id.history)
- private val input: AccountInput = container.findViewById(R.id.input)
-
- private val historyAdapter =
- AccountHistoryAdapter().apply {
- onSelectEntry = { account -> input.loginWith(account) }
- onChildFocusChanged = { _, hasFocus -> focusDebouncer.rawValue = hasFocus }
- }
-
- private val dividerHeight = resources.getDimensionPixelSize(R.dimen.account_history_divider)
- private val historyEntryHeight =
- resources.getDimensionPixelSize(R.dimen.account_history_entry_height)
-
- private val historyAnimation =
- ValueAnimator.ofInt(0, 0).apply {
- addUpdateListener { animation -> updateHeight(animation.animatedValue as Int) }
-
- duration = 350
- }
-
- private val maxHeight: Int
- get() = MAX_ACCOUNT_HISTORY_ENTRIES * (historyEntryHeight + dividerHeight)
-
- private val expandedHeight: Int
- get() = collapsedHeight + (historyHeight ?: 0)
-
- private var historyHeight by
- observable<Int?>(null) { _, oldHistoryHeight, newHistoryHeight ->
- if (newHistoryHeight != oldHistoryHeight) {
- historyAnimation.setIntValues(collapsedHeight, expandedHeight)
- reposition()
- }
- }
-
- private var collapsedHeight by
- observable(resources.getDimensionPixelSize(R.dimen.account_login_input_height)) {
- _,
- oldCollapsedHeight,
- newCollapsedHeight ->
- if (newCollapsedHeight != oldCollapsedHeight) {
- historyAnimation.setIntValues(newCollapsedHeight, expandedHeight)
- reposition()
- }
- }
-
- private var focused by
- observable(false) { _, _, hasFocus ->
- updateBorder()
- shouldShowAccountHistory = hasFocus
-
- if (!hasFocus) {
- hideKeyboard()
- }
- }
-
- private var shouldShowAccountHistory by
- observable(false) { _, isShown, show ->
- if (isShown != show) {
- if (show) {
- historyAnimation.start()
- } else {
- historyAnimation.reverse()
- }
- }
- }
-
- val hasFocus
- get() = focused
-
- var accountHistory by
- observable<String?>(null) { _, _, history ->
- if (history != null) {
- historyHeight = historyEntryHeight + dividerHeight
- historyAdapter.accountHistory = history
- } else {
- historyHeight = 0
- }
- }
-
- var state: LoginState by
- observable(LoginState.Initial) { _, _, newState ->
- input.loginState = newState
-
- updateBorder()
- }
-
- var onLogin: ((String) -> Unit)?
- get() = input.onLogin
- set(value) {
- input.onLogin = value
- }
-
- var onClearHistory: (() -> Unit)?
- get() = historyAdapter.onRemoveEntry
- set(value) {
- historyAdapter.onRemoveEntry = value
- }
-
- constructor(context: Context) : super(context)
-
- constructor(context: Context, attributes: AttributeSet) : super(context, attributes)
-
- constructor(
- context: Context,
- attributes: AttributeSet,
- defaultStyleAttribute: Int
- ) : super(context, attributes, defaultStyleAttribute)
-
- init {
- border.elevation = elevation + 0.1f
-
- input.apply {
- onFocusChanged.subscribe(this) { hasFocus -> focusDebouncer.rawValue = hasFocus }
-
- onTextChanged.subscribe(this) { _ ->
- if (state == LoginState.Failure) {
- state = LoginState.Initial
- }
- }
-
- addOnLayoutChangeListener(
- OnLayoutChangeListener { _, _, top, _, bottom, _, _, _, _ ->
- collapsedHeight = bottom - top
- }
- )
- }
-
- accountHistoryList.apply {
- layoutManager = LinearLayoutManager(context)
- adapter = historyAdapter
-
- addItemDecoration(
- ListItemDividerDecoration(
- topOffset = resources.getDimensionPixelSize(R.dimen.account_history_divider)
- )
- )
- }
-
- historyAnimation.setIntValues(collapsedHeight, expandedHeight)
- }
-
- fun onDestroy() {
- input.onFocusChanged.unsubscribe(this)
- input.onTextChanged.unsubscribe(this)
- }
-
- private fun updateBorder() {
- if (state == LoginState.Failure) {
- border.borderState = BorderState.ERROR
- } else if (focused) {
- border.borderState = BorderState.FOCUSED
- } else {
- border.borderState = BorderState.UNFOCUSED
- }
- }
-
- private fun updateHeight(height: Int) {
- val layoutParams = container.layoutParams as MarginLayoutParams
-
- layoutParams.height = height
- layoutParams.bottomMargin = maxHeight - height
-
- container.layoutParams = layoutParams
- }
-
- private fun reposition() {
- historyAnimation.cancel()
-
- if (shouldShowAccountHistory) {
- updateHeight(expandedHeight)
- } else {
- updateHeight(collapsedHeight)
- }
- }
-
- private fun hideKeyboard() {
- val inputManagerId = Activity.INPUT_METHOD_SERVICE
- val inputManager = context.getSystemService(inputManagerId) as InputMethodManager
-
- inputManager.hideSoftInputFromWindow(windowToken, 0)
- }
-}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLoginBorder.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLoginBorder.kt
deleted file mode 100644
index 553ce7a4cf..0000000000
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLoginBorder.kt
+++ /dev/null
@@ -1,108 +0,0 @@
-package net.mullvad.mullvadvpn.ui.widget
-
-import android.content.Context
-import android.graphics.drawable.Drawable
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import android.widget.ImageView
-import android.widget.RelativeLayout
-import androidx.core.content.res.ResourcesCompat
-import net.mullvad.mullvadvpn.R
-
-class AccountLoginBorder : RelativeLayout {
- enum class BorderState {
- UNFOCUSED,
- FOCUSED,
- ERROR
- }
-
- // The horizontal and vertical drawables are identical, but they must be separate objects
- // because the view that uses them changes the bounds of the drawable. If they are shared
- // between the horizontal and vertical views either the drawable becomes a vertical line or a
- // horizontal line, and as a consequence either the horizontal or the vertical borders don't
- // show correctly, respectively.
- private class StateDrawables(
- val corner: Drawable?,
- val horizontalBorder: Drawable?,
- val verticalBorder: Drawable?
- )
-
- private val unfocusedDrawables =
- StateDrawables(
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_corner, null),
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_border, null),
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_border, null)
- )
-
- private val focusedDrawables =
- StateDrawables(
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_corner_focused, null),
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_border_focused, null),
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_border_focused, null)
- )
-
- private val errorDrawables =
- StateDrawables(
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_corner_error, null),
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_border_error, null),
- ResourcesCompat.getDrawable(resources, R.drawable.account_login_border_error, null)
- )
-
- private val container =
- context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).let { service ->
- val inflater = service as LayoutInflater
-
- inflater.inflate(R.layout.account_login_border, this)
- }
-
- private val topLeftCorner: ImageView = container.findViewById(R.id.top_left_corner)
- private val topRightCorner: ImageView = container.findViewById(R.id.top_right_corner)
- private val bottomLeftCorner: ImageView = container.findViewById(R.id.bottom_left_corner)
- private val bottomRightCorner: ImageView = container.findViewById(R.id.bottom_right_corner)
-
- private val topBorder: ImageView = container.findViewById(R.id.top_border)
- private val leftBorder: ImageView = container.findViewById(R.id.left_border)
- private val rightBorder: ImageView = container.findViewById(R.id.right_border)
- private val bottomBorder: ImageView = container.findViewById(R.id.bottom_border)
-
- var borderState = BorderState.UNFOCUSED
- set(value) {
- field = value
-
- when (value) {
- BorderState.UNFOCUSED -> setBorder(unfocusedDrawables)
- BorderState.FOCUSED -> setBorder(focusedDrawables)
- BorderState.ERROR -> setBorder(errorDrawables)
- }
- }
-
- constructor(context: Context) : super(context)
-
- constructor(context: Context, attributes: AttributeSet) : super(context, attributes)
-
- constructor(
- context: Context,
- attributes: AttributeSet,
- defaultStyleAttribute: Int
- ) : super(context, attributes, defaultStyleAttribute)
-
- constructor(
- context: Context,
- attributes: AttributeSet,
- defaultStyleAttribute: Int,
- defaultStyleResource: Int
- ) : super(context, attributes, defaultStyleAttribute, defaultStyleResource)
-
- private fun setBorder(drawables: StateDrawables) {
- topLeftCorner.setImageDrawable(drawables.corner)
- topRightCorner.setImageDrawable(drawables.corner)
- bottomLeftCorner.setImageDrawable(drawables.corner)
- bottomRightCorner.setImageDrawable(drawables.corner)
-
- leftBorder.setImageDrawable(drawables.verticalBorder)
- rightBorder.setImageDrawable(drawables.verticalBorder)
-
- topBorder.setImageDrawable(drawables.horizontalBorder)
- bottomBorder.setImageDrawable(drawables.horizontalBorder)
- }
-}
diff --git a/android/app/src/main/res/layout/account_history_entry.xml b/android/app/src/main/res/layout/account_history_entry.xml
deleted file mode 100644
index 19ae478349..0000000000
--- a/android/app/src/main/res/layout/account_history_entry.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/account_history_entry_height">
- <TextView android:id="@+id/label"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:focusable="true"
- android:nextFocusRight="@id/remove"
- android:background="@drawable/account_history_entry_background"
- android:paddingHorizontal="12dp"
- android:gravity="center_vertical"
- android:textColor="@color/blue80"
- android:textSize="@dimen/text_medium_plus"
- android:textStyle="bold" />
- <ImageButton android:id="@+id/remove"
- android:layout_width="@dimen/account_history_entry_height"
- android:layout_height="@dimen/account_history_entry_height"
- android:layout_gravity="end"
- android:nextFocusLeft="@id/remove"
- android:background="?android:attr/selectableItemBackground"
- android:src="@drawable/account_history_remove" />
-</FrameLayout>
diff --git a/android/app/src/main/res/layout/account_input.xml b/android/app/src/main/res/layout/account_input.xml
deleted file mode 100644
index 96aa3c7c46..0000000000
--- a/android/app/src/main/res/layout/account_input.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <EditText android:id="@+id/login_input"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:paddingHorizontal="12dp"
- android:background="@drawable/account_input_background"
- android:singleLine="true"
- android:imeOptions="flagNoPersonalizedLearning"
- android:textCursorDrawable="@drawable/text_input_cursor"
- android:hint="@string/login_hint"
- android:textColorHint="@color/blue40"
- android:textColor="@color/blue"
- android:textSize="@dimen/text_medium_plus"
- android:textStyle="bold" />
- <ImageButton android:id="@+id/login_button"
- android:layout_width="48dp"
- android:layout_height="match_parent"
- android:layout_weight="0"
- android:background="@drawable/login_button_background"
- android:src="@drawable/login_button_arrow" />
-</merge>
diff --git a/android/app/src/main/res/layout/account_login.xml b/android/app/src/main/res/layout/account_login.xml
deleted file mode 100644
index 5ada635027..0000000000
--- a/android/app/src/main/res/layout/account_login.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder android:id="@+id/border"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true" />
- <net.mullvad.mullvadvpn.ui.widget.AccountInput android:id="@+id/input"
- android:layout_width="match_parent"
- android:layout_height="@dimen/account_login_input_height"
- android:layout_alignParentTop="true"
- android:orientation="horizontal" />
- <androidx.recyclerview.widget.RecyclerView android:id="@+id/history"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/input" />
-</merge>
diff --git a/android/app/src/main/res/layout/account_login_border.xml b/android/app/src/main/res/layout/account_login_border.xml
deleted file mode 100644
index dab613ca57..0000000000
--- a/android/app/src/main/res/layout/account_login_border.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- corners -->
- <ImageView android:id="@+id/top_left_corner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentStart="true"
- android:src="@drawable/account_login_corner" />
- <ImageView android:id="@+id/top_right_corner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentEnd="true"
- android:rotation="90"
- android:src="@drawable/account_login_corner" />
- <ImageView android:id="@+id/bottom_right_corner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentEnd="true"
- android:rotation="180"
- android:src="@drawable/account_login_corner" />
- <ImageView android:id="@+id/bottom_left_corner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentStart="true"
- android:rotation="270"
- android:src="@drawable/account_login_corner" />
- <!-- sides -->
- <ImageView android:id="@+id/left_border"
- android:layout_width="@dimen/account_login_border_width"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_below="@id/top_left_corner"
- android:layout_above="@id/bottom_left_corner"
- android:src="@drawable/account_login_border" />
- <ImageView android:id="@+id/right_border"
- android:layout_width="@dimen/account_login_border_width"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_below="@id/top_right_corner"
- android:layout_above="@id/bottom_right_corner"
- android:src="@drawable/account_login_border" />
- <ImageView android:id="@+id/top_border"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/account_login_border_width"
- android:layout_toStartOf="@id/top_right_corner"
- android:layout_toEndOf="@id/top_left_corner"
- android:layout_alignParentTop="true"
- android:src="@drawable/account_login_border" />
- <ImageView android:id="@+id/bottom_border"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/account_login_border_width"
- android:layout_toStartOf="@id/bottom_right_corner"
- android:layout_toEndOf="@id/bottom_left_corner"
- android:layout_alignParentBottom="true"
- android:src="@drawable/account_login_border" />
-</merge>
diff --git a/android/app/src/main/res/layout/login.xml b/android/app/src/main/res/layout/login.xml
deleted file mode 100644
index 526dab3ca1..0000000000
--- a/android/app/src/main/res/layout/login.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:mullvad="http://schemas.android.com/apk/res-auto"
- android:id="@+id/scroll_area"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fillViewport="true">
- <LinearLayout android:id="@+id/contents"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:nextFocusForward="@id/login_input"
- android:nextFocusDown="@id/login_input"
- android:descendantFocusability="beforeDescendants">
- <requestFocus />
- <net.mullvad.mullvadvpn.ui.widget.HeaderBar android:id="@+id/header_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <LinearLayout android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:paddingHorizontal="@dimen/side_margin"
- android:paddingVertical="24dp">
- <Space android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
- <FrameLayout android:layout_width="48dp"
- android:layout_height="48dp"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="30dp">
- <ProgressBar android:id="@+id/logging_in_status"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:indeterminate="true"
- android:indeterminateOnly="true"
- android:indeterminateDuration="600"
- android:indeterminateDrawable="@drawable/icon_spinner"
- android:visibility="gone" />
- <ImageView android:id="@+id/logged_in_status"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:src="@drawable/icon_success"
- android:visibility="gone" />
- <ImageView android:id="@+id/login_fail_status"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:src="@drawable/icon_fail"
- android:visibility="gone" />
- </FrameLayout>
- <TextView android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:layout_marginBottom="7dp"
- android:gravity="start"
- android:textColor="@color/white"
- android:textSize="@dimen/text_huge"
- android:textStyle="bold"
- android:text="@string/login_title" />
- <TextView android:id="@+id/subtitle"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:layout_marginBottom="8dp"
- android:gravity="start"
- android:textColor="@color/white80"
- android:textSize="@dimen/text_small"
- android:text="@string/login_description" />
- <net.mullvad.mullvadvpn.ui.widget.AccountLogin android:id="@+id/account_login"
- android:layout_width="match_parent"
- android:layout_height="@dimen/account_history_entry_height" />
- <Space android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="3" />
- </LinearLayout>
- <LinearLayout android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:orientation="vertical"
- android:paddingHorizontal="@dimen/side_margin"
- android:paddingBottom="@dimen/screen_vertical_margin"
- android:paddingTop="@dimen/button_separation"
- android:background="@color/darkBlue">
- <TextView android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
- android:gravity="start"
- android:textColor="@color/white80"
- android:textSize="@dimen/text_small"
- android:text="@string/dont_have_an_account" />
- <net.mullvad.mullvadvpn.ui.widget.Button android:id="@+id/create_account"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- mullvad:buttonColor="blue"
- mullvad:text="@string/create_account" />
- </LinearLayout>
- </LinearLayout>
-</ScrollView>