diff options
3 files changed, 25 insertions, 18 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SelectLocationFragment.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SelectLocationFragment.kt index 5b95c9d296..3a04eab410 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SelectLocationFragment.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/SelectLocationFragment.kt @@ -19,6 +19,7 @@ import net.mullvad.mullvadvpn.relaylist.RelayItem import net.mullvad.mullvadvpn.relaylist.RelayItemDividerDecoration import net.mullvad.mullvadvpn.relaylist.RelayList import net.mullvad.mullvadvpn.relaylist.RelayListAdapter +import net.mullvad.mullvadvpn.util.AdapterWithHeader class SelectLocationFragment : ServiceDependentFragment(OnNoService.GoToLaunchScreen) { private lateinit var relayListAdapter: RelayListAdapter @@ -77,7 +78,7 @@ class SelectLocationFragment : ServiceDependentFragment(OnNoService.GoToLaunchSc private fun configureRelayList(relayList: RecyclerView) { relayList.apply { layoutManager = LinearLayoutManager(context!!) - adapter = relayListAdapter + adapter = AdapterWithHeader(relayListAdapter, R.layout.select_location_header) addItemDecoration(RelayItemDividerDecoration(context!!)) } diff --git a/android/src/main/res/layout/select_location.xml b/android/src/main/res/layout/select_location.xml index 50c1d10643..284880c410 100644 --- a/android/src/main/res/layout/select_location.xml +++ b/android/src/main/res/layout/select_location.xml @@ -12,23 +12,6 @@ android:padding="12dp" android:background="?android:attr/selectableItemBackground" android:src="@drawable/icon_close" /> - <TextView android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="0" - android:layout_marginVertical="4dp" - android:layout_marginHorizontal="24dp" - android:textColor="@color/white" - android:textSize="32sp" - android:textStyle="bold" - android:text="@string/select_location" /> - <TextView android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="0" - android:layout_marginHorizontal="24dp" - android:layout_marginBottom="24dp" - android:textColor="@color/white60" - android:textSize="13sp" - android:text="@string/select_location_description" /> <ViewSwitcher android:id="@+id/relay_list_container" android:layout_width="match_parent" android:layout_height="0dp" diff --git a/android/src/main/res/layout/select_location_header.xml b/android/src/main/res/layout/select_location_header.xml new file mode 100644 index 0000000000..f7bdd1aa2d --- /dev/null +++ b/android/src/main/res/layout/select_location_header.xml @@ -0,0 +1,23 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:gravity="left"> + <TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="0" + android:layout_marginVertical="4dp" + android:layout_marginHorizontal="24dp" + android:textColor="@color/white" + android:textSize="32sp" + android:textStyle="bold" + android:text="@string/select_location" /> + <TextView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="0" + android:layout_marginHorizontal="24dp" + android:layout_marginBottom="24dp" + android:textColor="@color/white60" + android:textSize="13sp" + android:text="@string/select_location_description" /> +</LinearLayout> |
