diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-03-17 23:01:29 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-03-18 12:44:17 +0000 |
| commit | d781fd757d9030aa266a366e0d713a4bf2dd879a (patch) | |
| tree | 3c72477ff1a8d1e238277ea23a399df94770e645 /android | |
| parent | 597de0aec48bd2338dfeef14fa870d799b212065 (diff) | |
| download | mullvadvpn-d781fd757d9030aa266a366e0d713a4bf2dd879a.tar.xz mullvadvpn-d781fd757d9030aa266a366e0d713a4bf2dd879a.zip | |
Allow changing the dialog message
Diffstat (limited to 'android')
3 files changed, 6 insertions, 2 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/AdvancedFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/AdvancedFragment.kt index c4dd7b267b..9512b0a130 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/AdvancedFragment.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/AdvancedFragment.kt @@ -137,7 +137,7 @@ class AdvancedFragment : ServiceDependentFragment(OnNoService.GoBack) { detachBackButtonHandler() transaction.addToBackStack(null) - ConfirmDnsDialogFragment(confirmation) + ConfirmDnsDialogFragment(R.string.confirm_public_dns, confirmation) .show(transaction, null) val result = confirmation.await() diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConfirmDnsDialogFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConfirmDnsDialogFragment.kt index ef2aa1667b..054323a314 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConfirmDnsDialogFragment.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/ConfirmDnsDialogFragment.kt @@ -9,11 +9,13 @@ import android.view.View import android.view.ViewGroup import android.view.ViewGroup.LayoutParams import android.widget.Button +import android.widget.TextView import androidx.fragment.app.DialogFragment import kotlinx.coroutines.CompletableDeferred import net.mullvad.mullvadvpn.R class ConfirmDnsDialogFragment @JvmOverloads constructor( + private val message: Int = R.string.confirm_public_dns, private var confirmation: CompletableDeferred<Boolean>? = null ) : DialogFragment() { override fun onCreateView( @@ -23,6 +25,8 @@ class ConfirmDnsDialogFragment @JvmOverloads constructor( ): View { val view = inflater.inflate(R.layout.confirm_dns, container, false) + view.findViewById<TextView>(R.id.message).setText(message) + view.findViewById<Button>(R.id.back_button).setOnClickListener { activity?.onBackPressed() } diff --git a/android/src/main/res/layout/confirm_dns.xml b/android/src/main/res/layout/confirm_dns.xml index 2471f2d533..f271d1aa6e 100644 --- a/android/src/main/res/layout/confirm_dns.xml +++ b/android/src/main/res/layout/confirm_dns.xml @@ -20,7 +20,7 @@ android:layout_marginTop="16dp" android:textColor="@color/white80" android:textSize="@dimen/text_small" - android:text="@string/confirm_public_dns" /> + android:text="" /> <Button android:id="@+id/confirm_button" android:layout_marginVertical="@dimen/button_separation" android:text="@string/add_anyway" |
