diff options
author | cyBerta <cyberta@riseup.net> | 2019-08-03 19:09:26 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-08-03 19:09:26 +0200 |
commit | e45a11bb75d81ed4c395e4a1a9a80226a85b8742 (patch) | |
tree | 601eefd198f7a735c2546b00e3bf85d7e61e17af /app/src/main/res/layout | |
parent | 37f9cf65b3267f081c4b80c62240fc7754a30325 (diff) |
rewrite Navigation drawer - improves layout on small screens, fixes switch entry UI bug
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/f_drawer_main.xml | 142 |
1 files changed, 94 insertions, 48 deletions
diff --git a/app/src/main/res/layout/f_drawer_main.xml b/app/src/main/res/layout/f_drawer_main.xml index b04d7b87..e4862ca8 100644 --- a/app/src/main/res/layout/f_drawer_main.xml +++ b/app/src/main/res/layout/f_drawer_main.xml @@ -1,70 +1,116 @@ -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" + android:layout_width="match_parent" android:background="@color/colorBackground" tools:context="se.leap.bitmaskclient.drawer.NavigationDrawerFragment" android:clickable="true" - android:focusable="true"> + android:focusable="true" + android:fillViewport="true" + > - <FrameLayout - android:layout_width="match_parent" - android:layout_height="150dp"> - <android.support.v7.widget.AppCompatImageView - android:id="@+id/background" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:adjustViewBounds="false" - android:cropToPadding="false" - android:scaleType="fitXY" - app:srcCompat="@drawable/background_drawer" /> - - <android.support.v7.widget.AppCompatImageView - android:id="@+id/foreground" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scaleType="centerInside" - app:srcCompat="@drawable/drawer_logo" /> - </FrameLayout> - <RelativeLayout + <LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="wrap_content" + android:orientation="vertical" + > - <ListView - android:id="@+id/accountList" + <FrameLayout android:layout_width="match_parent" + android:layout_height="150dp"> + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/background" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:adjustViewBounds="false" + android:cropToPadding="false" + android:scaleType="fitXY" + app:srcCompat="@drawable/background_drawer" /> + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/foreground" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="centerInside" + app:srcCompat="@drawable/drawer_logo" /> + </FrameLayout> + + <se.leap.bitmaskclient.views.IconTextEntry + android:id="@+id/account" android:layout_height="wrap_content" - android:isScrollContainer="false" + android:layout_width="wrap_content" /> - <View - android:id="@+id/divider" - android:layout_below="@id/accountList" - android:layout_width="match_parent" - android:layout_height="1px" - android:background="@android:color/darker_gray" + <se.leap.bitmaskclient.views.IconTextEntry + android:id="@+id/switch_provider" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + app:text="@string/switch_provider_menu_option" + app:icon="@drawable/ic_switch_provider_36" + android:visibility="gone" /> - <FrameLayout + <Space android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + /> + + <se.leap.bitmaskclient.views.IconSwitchEntry + android:id="@+id/bridges_switch" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignTop="@id/divider" - android:layout_alignParentBottom="true" - > - <ListView - android:id="@+id/settingsList" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - /> - </FrameLayout> + app:text="@string/nav_drawer_obfuscated_connection" + app:icon="@drawable/ic_bridge_36" + android:visibility="gone" + /> + + <se.leap.bitmaskclient.views.IconSwitchEntry + android:id="@+id/battery_switch" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:text="@string/save_battery" + app:icon="@drawable/ic_battery_36" + /> + + <se.leap.bitmaskclient.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:icon="@drawable/ic_always_on_36" + android:visibility="gone" + /> + <se.leap.bitmaskclient.views.IconTextEntry + android:id="@+id/donate" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:text="@string/donate_title" + app:icon="@drawable/ic_donate_36" + android:visibility="gone" + /> + + <se.leap.bitmaskclient.views.IconTextEntry + android:id="@+id/log" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:text="@string/log_fragment_title" + app:icon="@drawable/ic_log_36" + /> + + <se.leap.bitmaskclient.views.IconTextEntry + android:id="@+id/about" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:text="@string/about_fragment_title" + app:icon="@drawable/ic_about_36" + /> - </RelativeLayout> + </LinearLayout> -</LinearLayout>
\ No newline at end of file +</ScrollView> |