diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-06-21 22:33:00 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-06-24 17:31:05 +0000 |
| commit | c0bf2cf124e87da6298311b7e4ddc05ca768d854 (patch) | |
| tree | 6a36a5bdded5d9feeb963ea76549e58f7e407f0d | |
| parent | 92d0b55b89876b935c86ee59d38b3804892cb3da (diff) | |
| download | mullvadvpn-c0bf2cf124e87da6298311b7e4ddc05ca768d854.tar.xz mullvadvpn-c0bf2cf124e87da6298311b7e4ddc05ca768d854.zip | |
Hide chevron when normal label is shown
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/SwitchLocationButton.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/SwitchLocationButton.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/SwitchLocationButton.kt index c09de452b9..4c89bc259e 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/SwitchLocationButton.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/SwitchLocationButton.kt @@ -5,6 +5,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.Job +import android.graphics.drawable.Drawable import android.view.View import android.widget.Button @@ -13,6 +14,7 @@ import net.mullvad.mullvadvpn.relaylist.RelayItem class SwitchLocationButton(val parentView: View) { private val button: Button = parentView.findViewById(R.id.switch_location) + private val chevron: Drawable = button.compoundDrawables[2] private var updateJob: Job? = null @@ -53,6 +55,7 @@ class SwitchLocationButton(val parentView: View) { private fun showLabel() { button.setText(R.string.switch_location) + button.setCompoundDrawables(null, null, null, null) } private fun showLocation() { @@ -62,6 +65,7 @@ class SwitchLocationButton(val parentView: View) { showLabel() } else { button.setText(locationName) + button.setCompoundDrawables(null, null, chevron, null) } } } |
