diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-10-30 17:25:43 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-12-10 12:55:06 +0000 |
| commit | 0d52e029b1e481dac99d01ea1ab7a00ac8b34a00 (patch) | |
| tree | 0ea7bacf085fb6a61ea5c5242b970780a120fc04 /android/src | |
| parent | 92a92998c16758e5e426d5d97b66d9b397fc107c (diff) | |
| download | mullvadvpn-0d52e029b1e481dac99d01ea1ab7a00ac8b34a00.tar.xz mullvadvpn-0d52e029b1e481dac99d01ea1ab7a00ac8b34a00.zip | |
Add custom DNS footer message to the list
Diffstat (limited to 'android/src')
6 files changed, 24 insertions, 5 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt index e0eac7e702..139730d4b7 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsAdapter.kt @@ -6,13 +6,13 @@ import android.view.ViewGroup import net.mullvad.mullvadvpn.R class CustomDnsAdapter : Adapter<CustomDnsItemHolder>() { - override fun getItemCount() = 0 + override fun getItemCount() = 1 override fun onCreateViewHolder(parentView: ViewGroup, type: Int): CustomDnsItemHolder { val inflater = LayoutInflater.from(parentView.context) - val view = inflater.inflate(R.layout.app_list_item, parentView, false) + val view = inflater.inflate(R.layout.custom_dns_footer, parentView, false) - return CustomDnsItemHolder(view) + return CustomDnsFooterHolder(view) } override fun onBindViewHolder(holder: CustomDnsItemHolder, position: Int) {} diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsFooterHolder.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsFooterHolder.kt new file mode 100644 index 0000000000..d09beffbce --- /dev/null +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsFooterHolder.kt @@ -0,0 +1,5 @@ +package net.mullvad.mullvadvpn.ui.customdns + +import android.view.View + +class CustomDnsFooterHolder(view: View) : CustomDnsItemHolder(view) diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsItemHolder.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsItemHolder.kt index 2a6204f1d2..3276737e5d 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsItemHolder.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/customdns/CustomDnsItemHolder.kt @@ -3,4 +3,4 @@ package net.mullvad.mullvadvpn.ui.customdns import android.support.v7.widget.RecyclerView.ViewHolder import android.view.View -class CustomDnsItemHolder(view: View) : ViewHolder(view) +abstract class CustomDnsItemHolder(view: View) : ViewHolder(view) diff --git a/android/src/main/res/layout/advanced_header.xml b/android/src/main/res/layout/advanced_header.xml index 5711e0df0a..5b582645d0 100644 --- a/android/src/main/res/layout/advanced_header.xml +++ b/android/src/main/res/layout/advanced_header.xml @@ -2,7 +2,6 @@ xmlns:mullvad="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="@dimen/screen_vertical_margin" android:orientation="vertical" android:gravity="left"> <TextView android:id="@+id/expanded_title" diff --git a/android/src/main/res/layout/custom_dns_footer.xml b/android/src/main/res/layout/custom_dns_footer.xml new file mode 100644 index 0000000000..c939eebb7f --- /dev/null +++ b/android/src/main/res/layout/custom_dns_footer.xml @@ -0,0 +1,14 @@ +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center"> + <TextView android:id="@+id/name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingHorizontal="@dimen/cell_footer_horizontal_padding" + android:paddingBottom="@dimen/screen_vertical_margin" + android:paddingTop="@dimen/cell_footer_top_padding" + android:textColor="@color/white60" + android:textSize="@dimen/text_small" + android:text="@string/custom_dns_footer" /> +</FrameLayout> diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml index f39e93bba0..6d1c858164 100644 --- a/android/src/main/res/values/strings.xml +++ b/android/src/main/res/values/strings.xml @@ -164,6 +164,7 @@ <string name="split_tunneling_description">Split tunneling makes it possible to select which applications should not be routed through the VPN tunnel.</string> <string name="enable">Enable</string> + <string name="custom_dns_footer">Enable to add at least one DNS server.</string> <string name="exclude_applications">Exclude applications</string> <string name="account_url">https://mullvad.net/en/account</string> <string name="wg_key_url">https://mullvad.net/en/account/ports</string> |
