diff options
author | cyBerta <cyberta@riseup.net> | 2021-03-22 18:49:19 +0100 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2021-04-22 22:53:01 +0200 |
commit | ff5188d7de1df36c5d71d309a08d290560e9d337 (patch) | |
tree | d4f3aa7ccfc8a41ad38a6c9a21413aa33f49f537 /app/src/main/res | |
parent | 95174abcb87af9d07465cda5c23cc35e1987b6d9 (diff) |
initial draft for gateway selection on Android
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable-hdpi/ic_map_marker_star_black_36dp.png | bin | 0 -> 919 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-mdpi/ic_map_marker_star_black_36dp.png | bin | 0 -> 645 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xhdpi/ic_map_marker_star_black_36dp.png | bin | 0 -> 1182 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xxhdpi/ic_map_marker_star_black_36dp.png | bin | 0 -> 1809 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xxxhdpi/ic_map_marker_star_black_36dp.png | bin | 0 -> 2284 bytes | |||
-rw-r--r-- | app/src/main/res/layout-xlarge/v_switch_list_item.xml | 93 | ||||
-rw-r--r-- | app/src/main/res/layout/f_drawer_main.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/layout/f_gateway_selection.xml | 99 | ||||
-rw-r--r-- | app/src/main/res/layout/v_select_text_list_item.xml | 63 | ||||
-rw-r--r-- | app/src/main/res/layout/v_switch_list_item.xml | 97 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 6 |
11 files changed, 279 insertions, 88 deletions
diff --git a/app/src/main/res/drawable-hdpi/ic_map_marker_star_black_36dp.png b/app/src/main/res/drawable-hdpi/ic_map_marker_star_black_36dp.png Binary files differnew file mode 100644 index 00000000..0d395564 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/ic_map_marker_star_black_36dp.png diff --git a/app/src/main/res/drawable-mdpi/ic_map_marker_star_black_36dp.png b/app/src/main/res/drawable-mdpi/ic_map_marker_star_black_36dp.png Binary files differnew file mode 100644 index 00000000..3065f57e --- /dev/null +++ b/app/src/main/res/drawable-mdpi/ic_map_marker_star_black_36dp.png diff --git a/app/src/main/res/drawable-xhdpi/ic_map_marker_star_black_36dp.png b/app/src/main/res/drawable-xhdpi/ic_map_marker_star_black_36dp.png Binary files differnew file mode 100644 index 00000000..57016c8c --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/ic_map_marker_star_black_36dp.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_map_marker_star_black_36dp.png b/app/src/main/res/drawable-xxhdpi/ic_map_marker_star_black_36dp.png Binary files differnew file mode 100644 index 00000000..3f0cdaba --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/ic_map_marker_star_black_36dp.png diff --git a/app/src/main/res/drawable-xxxhdpi/ic_map_marker_star_black_36dp.png b/app/src/main/res/drawable-xxxhdpi/ic_map_marker_star_black_36dp.png Binary files differnew file mode 100644 index 00000000..a4afda4d --- /dev/null +++ b/app/src/main/res/drawable-xxxhdpi/ic_map_marker_star_black_36dp.png diff --git a/app/src/main/res/layout-xlarge/v_switch_list_item.xml b/app/src/main/res/layout-xlarge/v_switch_list_item.xml index 3fa2ac7d..02e52d6d 100644 --- a/app/src/main/res/layout-xlarge/v_switch_list_item.xml +++ b/app/src/main/res/layout-xlarge/v_switch_list_item.xml @@ -1,7 +1,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/item_container" - android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_height="wrap_content" android:layout_width="match_parent" > @@ -10,68 +10,75 @@ android:layout_width="?android:attr/listPreferredItemHeight" android:layout_height="?android:attr/listPreferredItemHeight" android:layout_gravity="center" + android:layout_alignTop="@+id/textContainer" + android:layout_alignBottom="@+id/textContainer" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - tools:src="@drawable/ic_add_circle_outline_grey600_24dp" - /> + tools:src="@drawable/ic_add_circle_outline_grey600_24dp" /> - <TextView - android:id="@android:id/text1" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:textAppearance="?android:attr/textAppearanceListItem" + <LinearLayout + android:id="@+id/textContainer" + android:orientation="vertical" android:gravity="center_vertical" - android:maxLines="1" - android:ellipsize="end" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:minHeight="?android:attr/listPreferredItemHeight" - tools:text="TEST" + android:layout_toStartOf="@+id/option_switch" + android:layout_toLeftOf="@+id/option_switch" android:layout_toEndOf="@id/material_icon" android:layout_toRightOf="@+id/material_icon" - android:layout_above="@+id/subtitle" - /> - - <TextView - android:id="@+id/subtitle" + android:minHeight="?android:attr/listPreferredItemHeight" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_vertical" - android:maxLines="1" - android:ellipsize="end" - android:layout_alignParentBottom="true" - android:textAppearance="?android:attr/textAppearanceSmall" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:paddingBottom="4dp" - tools:text="TEST" - android:visibility="gone" - android:layout_toEndOf="@id/material_icon" - android:layout_toRightOf="@+id/material_icon" - /> + android:layout_height="wrap_content"> + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:maxLines="1" + android:ellipsize="end" + android:gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:textAppearance="?android:attr/textAppearanceListItem" + tools:text=".,m.,msdflksdjflksjdflkjsdflksdlsdflkj lskjdf lkjsdf lkjsdf fsdls" /> + + <TextView + android:id="@+id/subtitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:textAppearance="?android:attr/textAppearanceSmall" + android:visibility="gone" + tools:text="ldflkjdfglkjdfglksjdflksjdf lksjddf lkjsdfl kjlkjsdf lkjsdfl kjsdlfkj lkj sdflk lkjsdlfdkjsdlfkj " + tools:visibility="visible" /> + </LinearLayout> + <androidx.appcompat.widget.SwitchCompat android:id="@+id/option_switch" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceListItem" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_alignTop="@id/textContainer" + android:layout_alignBottom="@id/textContainer" + android:background="?android:attr/activatedBackgroundIndicator" + android:checked="false" android:gravity="center_vertical" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:background="?android:attr/activatedBackgroundIndicator" - android:minHeight="?android:attr/listPreferredItemHeight" - android:checked="false" + android:textAppearance="?android:attr/textAppearanceListItem" tools:text="" /> + <View android:layout_width="match_parent" android:layout_height="1px" android:background="@android:color/darker_gray" - android:layout_alignParentBottom="true" + android:layout_alignBottom="@id/textContainer" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/f_drawer_main.xml b/app/src/main/res/layout/f_drawer_main.xml index d2729998..15dd0425 100644 --- a/app/src/main/res/layout/f_drawer_main.xml +++ b/app/src/main/res/layout/f_drawer_main.xml @@ -98,6 +98,15 @@ android:visibility="gone" /> + <se.leap.bitmaskclient.base.views.IconTextEntry + android:id="@+id/manualGatewaySelection" + app:text="@string/gateway_selection_title" + app:subtitle="@string/gateway_selection_best_location" + app:icon="@drawable/ic_map_marker_star_black_36dp" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + /> + <TextView android:id="@+id/show_experimental_features" android:layout_width="match_parent" diff --git a/app/src/main/res/layout/f_gateway_selection.xml b/app/src/main/res/layout/f_gateway_selection.xml new file mode 100644 index 00000000..f96b9c08 --- /dev/null +++ b/app/src/main/res/layout/f_gateway_selection.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" + tools:context=".base.fragments.GatewaySelectionFragment"> + + <LinearLayout + android:id="@+id/current_location_container" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone" + tools:visibility="visible" + > + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/current_location_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" + android:paddingTop="@dimen/activity_vertical_margin" + android:paddingStart="@dimen/activity_horizontal_margin" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingEnd="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingBottom="@dimen/activity_vertical_margin" + android:text="@string/vpn_securely_routed" /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/current_location" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center" + android:textAppearance="?android:attr/textAppearanceLarge" + android:paddingTop="@dimen/activity_vertical_margin" + android:paddingStart="@dimen/activity_horizontal_margin" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingEnd="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingBottom="@dimen/activity_vertical_margin" + tools:text="Paris" /> + + </LinearLayout> + + + + <se.leap.bitmaskclient.base.views.IconSwitchEntry + android:id="@+id/automatic_gateway_switch" + android:layout_below="@id/current_location_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="@dimen/stdpadding" + android:paddingStart="@dimen/stdpadding" + android:paddingLeft="@dimen/stdpadding" + android:paddingEnd="@dimen/stdpadding" + android:paddingRight="@dimen/stdpadding" + app:text="@string/gateway_selection_automatic" + app:subtitle="@string/gateway_selection_warning" + app:icon="@drawable/ic_map_marker_star_black_36dp" + /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/gatewaySelection_list" + android:layout_below="@id/automatic_gateway_switch" + android:layout_above="@+id/vpn_button_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="@dimen/stdpadding" + android:paddingLeft="@dimen/stdpadding" + android:paddingRight="@dimen/stdpadding" + android:paddingEnd="@dimen/stdpadding" + android:paddingBottom="@dimen/activity_vertical_margin" + android:visibility="gone" + tools:visibility="visible" + android:scrollbars="vertical" + > + + </androidx.recyclerview.widget.RecyclerView> + + <LinearLayout + android:id="@+id/vpn_button_container" + android:orientation="horizontal" + android:gravity="end" + android:layout_alignParentBottom="true" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="@dimen/activity_margin" + > + <androidx.appcompat.widget.AppCompatButton + android:id="@+id/vpn_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:text="@string/vpn.button.turn.on" /> + </LinearLayout> + + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/v_select_text_list_item.xml b/app/src/main/res/layout/v_select_text_list_item.xml new file mode 100644 index 00000000..07187016 --- /dev/null +++ b/app/src/main/res/layout/v_select_text_list_item.xml @@ -0,0 +1,63 @@ +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/item_container" + android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_width="match_parent" + android:orientation="horizontal" + xmlns:tools="http://schemas.android.com/tools"> + + <!-- views are composed right to left --> + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/checked_icon" + android:layout_width="?android:attr/listPreferredItemHeightSmall" + android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_gravity="center" + android:padding="10dp" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + tools:src="@drawable/ic_check_bold" + android:visibility="visible" + tools:visibility="visible" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/quality" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceListItem" + android:gravity="center_vertical" + android:paddingStart="@dimen/standard_margin" + android:paddingLeft="@dimen/standard_margin" + android:paddingEnd="@dimen/standard_margin" + android:paddingRight="@dimen/standard_margin" + android:minHeight="?android:attr/listPreferredItemHeightSmall" + android:layout_toLeftOf="@id/checked_icon" + android:layout_toStartOf="@id/checked_icon" + tools:text="GOOD" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/location" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentLeft="true" + android:layout_toStartOf="@id/quality" + android:layout_toLeftOf="@id/quality" + android:ellipsize="end" + android:gravity="center_vertical" + android:minHeight="?android:attr/listPreferredItemHeightLarge" + android:paddingStart="@dimen/standard_margin" + android:paddingLeft="@dimen/standard_margin" + android:paddingEnd="@dimen/standard_margin" + android:paddingRight="@dimen/standard_margin" + android:textAppearance="?android:attr/textAppearanceListItem" + android:textStyle="bold" + tools:text="Paris" /> + + <View + android:layout_width="match_parent" + android:layout_height="1px" + android:background="@android:color/darker_gray" + android:layout_alignParentBottom="true" + /> +</RelativeLayout> diff --git a/app/src/main/res/layout/v_switch_list_item.xml b/app/src/main/res/layout/v_switch_list_item.xml index b595e7ce..1686a99d 100644 --- a/app/src/main/res/layout/v_switch_list_item.xml +++ b/app/src/main/res/layout/v_switch_list_item.xml @@ -1,7 +1,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/item_container" - android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_height="wrap_content" android:layout_width="match_parent" > @@ -10,69 +10,76 @@ android:layout_width="?android:attr/listPreferredItemHeightSmall" android:layout_height="?android:attr/listPreferredItemHeightSmall" android:layout_gravity="center" + android:layout_alignTop="@+id/textContainer" + android:layout_alignBottom="@+id/textContainer" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - tools:src="@drawable/ic_add_circle_outline_grey600_24dp" - /> + tools:src="@drawable/ic_add_circle_outline_grey600_24dp" /> - <TextView - android:id="@android:id/text1" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:textAppearance="?android:attr/textAppearanceListItemSmall" + <LinearLayout + android:id="@+id/textContainer" + android:orientation="vertical" android:gravity="center_vertical" - android:maxLines="1" - android:ellipsize="end" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:minHeight="?android:attr/listPreferredItemHeightSmall" - tools:text="TEST" + android:layout_toStartOf="@+id/option_switch" + android:layout_toLeftOf="@+id/option_switch" android:layout_toEndOf="@id/material_icon" android:layout_toRightOf="@+id/material_icon" - android:layout_above="@+id/subtitle" - /> - - <TextView - android:id="@+id/subtitle" + android:minHeight="?android:attr/listPreferredItemHeightSmall" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_vertical" - android:maxLines="1" - android:ellipsize="end" - android:layout_alignParentBottom="true" - android:textAppearance="?android:attr/textAppearanceSmall" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:paddingBottom="4dp" - tools:text="TEST" - android:visibility="gone" - android:layout_toEndOf="@id/material_icon" - android:layout_toRightOf="@+id/material_icon" - /> + android:layout_height="wrap_content"> + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:ellipsize="end" + android:singleLine="true" + android:gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:textAppearance="?android:attr/textAppearanceListItemSmall" + tools:text=".,m.,msdflksdjflksjdflkjsdflksdlsdflkj lskjdf lkjsdf lkjsdf fsdls" /> + + <TextView + android:id="@+id/subtitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:paddingBottom="2dp" + android:textAppearance="?android:attr/textAppearanceSmall" + android:visibility="gone" + android:singleLine="true" + android:ellipsize="end" + tools:text="sdlfkjsdf lksdjdf lkj sdldfk jlkj sdf lkj lskdjf sedflkjsdlfjk" + tools:visibility="visible" /> + </LinearLayout> + <androidx.appcompat.widget.SwitchCompat android:id="@+id/option_switch" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceListItemSmall" + android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" + android:layout_alignTop="@id/textContainer" + android:layout_alignBottom="@id/textContainer" + android:background="?android:attr/activatedBackgroundIndicator" + android:checked="false" android:gravity="center_vertical" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:background="?android:attr/activatedBackgroundIndicator" - android:minHeight="?android:attr/listPreferredItemHeightSmall" - android:checked="false" + android:textAppearance="?android:attr/textAppearanceListItemSmall" tools:text="" /> <View android:layout_width="match_parent" android:layout_height="1px" android:background="@android:color/darker_gray" - android:layout_alignParentBottom="true" + android:layout_alignBottom="@id/textContainer" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 000effc7..e883b974 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -149,4 +149,10 @@ <string name="version_update_error_pgp_verification">PGP verification error. Ignoring download.</string> <string name="version_update_error">Update failed.</string> <string name="version_update_error_permissions">No permissions to install app.</string> + <string name="gateway_selection_title">Select location</string> + <string name="gateway_selection_warning">%s will find the best connection for you.</string> + <string name="gateway_selection_best_location">Location with best connection</string> + <string name="gateway_selection_automatic">Automatic</string> + <string name="gateway_selection_current_location">Your traffic is currently routed through: </string> + </resources> |