diff options
author | cyberta <cyberta@riseup.net> | 2021-11-25 02:14:08 +0000 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2021-11-25 02:14:08 +0000 |
commit | 5a2ff7c85f13fe2e875e4ca7ec4192df0e896d01 (patch) | |
tree | e74b21e0b9e24b5b8774598142b343aa56a7070c /app/src/main/res/layout | |
parent | 68ca9c827da3c3fad9e70c74960f113560fd6711 (diff) | |
parent | 6fb2050aaf6e992bf96d41c5f6b19f5c1a3771c3 (diff) |
Merge branch 'preferences_ui' into 'master'
Preferences ui
See merge request leap/bitmask_android!145
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/f_drawer_main.xml | 73 | ||||
-rw-r--r-- | app/src/main/res/layout/f_settings.xml | 105 | ||||
-rw-r--r-- | app/src/main/res/layout/v_icon_text_list_item.xml | 105 | ||||
-rw-r--r-- | app/src/main/res/layout/v_switch_list_item.xml | 140 |
4 files changed, 239 insertions, 184 deletions
diff --git a/app/src/main/res/layout/f_drawer_main.xml b/app/src/main/res/layout/f_drawer_main.xml index 65179857..bd7e66ae 100644 --- a/app/src/main/res/layout/f_drawer_main.xml +++ b/app/src/main/res/layout/f_drawer_main.xml @@ -50,13 +50,12 @@ app:text="@string/switch_provider_menu_option" app:icon="@drawable/ic_switch_provider_36" android:visibility="gone" + tools:visibility="visible" /> <View android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" - android:minHeight="20dp" + android:layout_height="20dp" android:background="@color/black800_high_transparent" /> @@ -69,35 +68,6 @@ app:icon="@drawable/ic_battery_36" /> - <se.leap.bitmaskclient.base.views.IconSwitchEntry - android:id="@+id/bridges_switch" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:text="@string/nav_drawer_obfuscated_connection" - app:subtitle="@string/nav_drawer_subtitle_obfuscated_connection" - app:icon="@drawable/ic_bridge_36" - android:visibility="gone" - /> - - <se.leap.bitmaskclient.base.views.IconTextEntry - android:id="@+id/always_on_vpn" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:text="@string/always_on_vpn" - app:subtitle="@string/subtitle_always_on_vpn" - app:icon="@drawable/ic_always_on_36" - android:visibility="gone" - /> - - <se.leap.bitmaskclient.base.views.IconTextEntry - android:id="@+id/exclude_apps" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:text="@string/exclude_apps_fragment_title" - app:icon="@drawable/ic_shield_remove_grey600_36dp" - android:visibility="gone" - /> - <se.leap.bitmaskclient.base.views.IconTextEntry android:id="@+id/manualGatewaySelection" app:text="@string/gateway_selection_title" @@ -105,50 +75,21 @@ app:icon="@drawable/ic_web" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:visibility="gone" - /> - - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/show_experimental_features" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/show_experimental" - android:textColor="@color/colorPrimaryDark" - android:paddingTop="6dp" - android:paddingBottom="6dp" - android:gravity="center" - android:background="@color/black800_high_transparent" - /> - - <se.leap.bitmaskclient.base.views.IconSwitchEntry - android:id="@+id/enableIPv6Firewall" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:text="@string/ipv6Firewall" - app:subtitle="@string/require_root" - app:icon="@drawable/ic_cancel" - android:visibility="gone" - tools:visibility="visible" + android:visibility="visible" /> <se.leap.bitmaskclient.base.views.IconTextEntry - android:id="@+id/tethering" - android:layout_width="wrap_content" + android:id="@+id/advancedSettings" + app:icon="@drawable/ic_cog" android:layout_height="wrap_content" - app:text="@string/tethering" - app:subtitle="@string/require_root" - app:icon="@drawable/ic_access_point_36" - android:visibility="gone" - tools:visibility="visible" + android:layout_width="wrap_content" + app:text="@string/advanced_settings" /> <View - android:id="@+id/experimental_features_footer" android:layout_width="match_parent" android:layout_height="20dp" android:background="@color/black800_high_transparent" - android:visibility="gone" - tools:visibility="visible" /> <se.leap.bitmaskclient.base.views.IconTextEntry diff --git a/app/src/main/res/layout/f_settings.xml b/app/src/main/res/layout/f_settings.xml new file mode 100644 index 00000000..6e0e2eb2 --- /dev/null +++ b/app/src/main/res/layout/f_settings.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="@dimen/stdpadding" + > + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/general_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@style/TextAppearance.AppCompat.Title" + android:text="@string/vpn_settings" + android:paddingTop="@dimen/activity_margin" + /> + + <se.leap.bitmaskclient.base.views.IconTextEntry + android:id="@+id/always_on_vpn" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:text="@string/always_on_vpn" + app:subtitle="@string/subtitle_always_on_vpn" + app:icon="@drawable/ic_always_on_36" + android:visibility="visible" + /> + + <se.leap.bitmaskclient.base.views.IconTextEntry + android:id="@+id/exclude_apps" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:text="@string/exclude_apps_fragment_title" + app:icon="@drawable/ic_shield_remove_grey600_36dp" + android:visibility="visible" + /> + + <!-- <se.leap.bitmaskclient.base.views.IconSwitchEntry + android:id="@+id/prefer_udp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:text="@string/prefer_udp" + app:subtitle="@string/prefer_udp_subtitle" + app:icon="@drawable/ic_multiple_stop" + app:singleLine="false" + /> + --> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/circumvention_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@style/TextAppearance.AppCompat.Title" + android:text="@string/censorship_circumvention" + android:paddingTop="@dimen/activity_margin" + /> + <se.leap.bitmaskclient.base.views.IconSwitchEntry + android:id="@+id/bridges_switch" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:text="@string/nav_drawer_obfuscated_connection" + app:subtitle="@string/nav_drawer_subtitle_obfuscated_connection" + app:icon="@drawable/ic_bridge_36" + app:singleLine="false" + /> + + <se.leap.bitmaskclient.base.views.IconSwitchEntry + android:id="@+id/use_snowflake" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:icon="@drawable/ic_snowflake" + app:text="@string/use_snowflake" + app:subtitle="@string/snowflake_description" + app:singleLine="false" + /> + + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/experimental_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@style/TextAppearance.AppCompat.Title" + android:text="@string/experimental_features" + android:paddingTop="@dimen/activity_margin" + /> + + + <se.leap.bitmaskclient.base.views.IconSwitchEntry + android:id="@+id/enableIPv6Firewall" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:text="@string/ipv6Firewall" + app:subtitle="@string/require_root" + app:icon="@drawable/ic_cancel" + /> + + <se.leap.bitmaskclient.base.views.IconTextEntry + android:id="@+id/tethering" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:text="@string/tethering" + app:subtitle="@string/require_root" + app:icon="@drawable/ic_access_point_36" + /> + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/v_icon_text_list_item.xml b/app/src/main/res/layout/v_icon_text_list_item.xml index 06b70a2e..d183864d 100644 --- a/app/src/main/res/layout/v_icon_text_list_item.xml +++ b/app/src/main/res/layout/v_icon_text_list_item.xml @@ -1,62 +1,67 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/item_container" - android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_height="wrap_content" android:layout_width="match_parent" - android:orientation="horizontal" + android:orientation="vertical" xmlns:tools="http://schemas.android.com/tools"> - - <ImageView - android:id="@+id/material_icon" - android:layout_width="?android:attr/listPreferredItemHeightSmall" - android:layout_height="?android:attr/listPreferredItemHeightSmall" - android:layout_gravity="center" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" - android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" - tools:src="@drawable/ic_add_circle_outline_grey600_24dp" - /> - <androidx.appcompat.widget.AppCompatTextView - android:id="@android:id/text1" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceListItemSmall" - 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_toEndOf="@id/material_icon" - android:layout_toRightOf="@+id/material_icon" - android:layout_above="@+id/subtitle" - /> + android:orientation="horizontal"> + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/material_icon" + android:layout_width="?android:attr/listPreferredItemHeightSmall" + android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_gravity="center" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + tools:src="@drawable/ic_add_circle_outline_grey600_24dp" + /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_gravity="center_vertical" + android:paddingTop="@dimen/compact_padding" + android:paddingBottom="@dimen/compact_padding" + > + <androidx.appcompat.widget.AppCompatTextView + android:id="@android:id/text1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceListItemSmall" + 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" + tools:text="TEST" + /> - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/subtitle" - android:layout_width="match_parent" - 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" - /> + <androidx.appcompat.widget.AppCompatTextView + android:id="@+id/subtitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:singleLine="false" + android:ellipsize="end" + 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" + tools:text="some more text \n sdflksdfd" + android:visibility="gone" + tools:visibility="visible" + /> + </LinearLayout> + </LinearLayout> <View android:layout_width="match_parent" android:layout_height="1px" android:background="@android:color/darker_gray" - android:layout_alignParentBottom="true" /> -</RelativeLayout> +</LinearLayout> 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 5bd4de1b..3ba37b81 100644 --- a/app/src/main/res/layout/v_switch_list_item.xml +++ b/app/src/main/res/layout/v_switch_list_item.xml @@ -1,85 +1,89 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/item_container" android:layout_height="wrap_content" android:layout_width="match_parent" + android:orientation="vertical" > + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + > - <androidx.appcompat.widget.AppCompatImageView - android:id="@+id/material_icon" - 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" /> - - <LinearLayout - android:id="@+id/textContainer" - android:orientation="vertical" - android:gravity="center_vertical" - 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:minHeight="?android:attr/listPreferredItemHeightSmall" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/title" - android:layout_width="wrap_content" + <LinearLayout + android:layout_width="match_parent" 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" /> + android:orientation="horizontal" + android:layout_toStartOf="@+id/option_switch" + android:layout_toLeftOf="@+id/option_switch" + > + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/material_icon" + android:layout_width="?android:attr/listPreferredItemHeightSmall" + android:layout_height="?android:attr/listPreferredItemHeightSmall" + android:layout_gravity="center" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + tools:src="@drawable/ic_add_circle_outline_grey600_24dp" /> - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/subtitle" + <LinearLayout + android:id="@+id/textContainer" + android:orientation="vertical" + android:layout_gravity="center_vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="@dimen/compact_padding" + android:paddingBottom="@dimen/compact_padding" + > + <androidx.appcompat.widget.AppCompatTextView + 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="Test" /> + + <androidx.appcompat.widget.AppCompatTextView + 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" + android:singleLine="false" + android:ellipsize="end" + tools:text="sdlfkjsdf \n lksdfj \lksjflksdjf " + tools:visibility="visible" /> + </LinearLayout> + </LinearLayout> + <androidx.appcompat.widget.SwitchCompat + android:id="@+id/option_switch" 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:background="?android:attr/activatedBackgroundIndicator" + android:checked="false" 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="wrap_content" - android:layout_height="wrap_content" - 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:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:paddingRight="?android:attr/listPreferredItemPaddingRight" - android:textAppearance="?android:attr/textAppearanceListItemSmall" - tools:text="" /> - + android:textAppearance="?android:attr/textAppearanceListItemSmall" + android:visibility="visible" + android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + tools:text="" /> + </RelativeLayout> <View android:layout_width="match_parent" android:layout_height="1px" android:background="@android:color/darker_gray" - android:layout_alignBottom="@id/textContainer" /> -</RelativeLayout>
\ No newline at end of file +</LinearLayout>
\ No newline at end of file |