Fixed layout for configure screen item.

This commit is contained in:
GaidamakUA 2016-04-04 12:52:49 +03:00
parent 318c9e1bf4
commit c9540d7af8
4 changed files with 102 additions and 73 deletions

View file

@ -1,47 +1,47 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout android:id="@+id/dashboard"
android:id="@+id/dashboard" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" > android:visibility="gone">
<include <include
android:id="@+id/init_progress" android:id="@+id/init_progress"
layout="@layout/application_loading" layout="@layout/application_loading"
android:visibility="gone" /> android:visibility="gone"/>
<LinearLayout <LinearLayout
android:id="@+id/animateContent" android:id="@+id/animateContent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" > android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="@dimen/dashboard_land_width" android:layout_width="@dimen/dashboard_land_width"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:background="#70000000"
android:background="#70000000"> android:orientation="vertical">
<include layout="@layout/dashboard_toolbar" /> <include layout="@layout/dashboard_toolbar"/>
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView <com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/main_scroll" android:id="@+id/main_scroll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_gravity="start"
android:fadeScrollbars="true" > android:fadeScrollbars="true">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" > android:orientation="vertical">
<LinearLayout <LinearLayout
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" /> android:orientation="vertical"/>
</LinearLayout> </LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView> </com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
@ -50,25 +50,25 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start" android:layout_gravity="start"
android:visibility="gone" > android:visibility="gone">
<net.osmand.plus.views.controls.DynamicListView <net.osmand.plus.views.controls.DynamicListView
android:id="@+id/dash_list_view" android:id="@+id/dash_list_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:fadeScrollbars="true" > android:divider="@null"
</net.osmand.plus.views.controls.DynamicListView> android:fadeScrollbars="true"/>
<TextView <TextView
android:id="@+id/emptyTextView" android:id="@+id/emptyTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center"
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:clickable="true"
android:gravity="center"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp" android:paddingRight="16dp"
android:clickable="true"
android:textSize="@dimen/default_list_text_size_large" android:textSize="@dimen/default_list_text_size_large"
android:visibility="gone"/> android:visibility="gone"/>
@ -78,7 +78,7 @@
<FrameLayout <FrameLayout
android:id="@+id/map_part_dashboard" android:id="@+id/map_part_dashboard"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" > android:layout_height="fill_parent">
<Button <Button
android:id="@+id/map_download_button" android:id="@+id/map_download_button"
@ -86,7 +86,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/shared_string_download" android:text="@string/shared_string_download"
android:visibility="gone" /> android:visibility="gone"/>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>

View file

@ -1,36 +1,37 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout
android:id="@+id/dashboard" android:id="@+id/dashboard"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" > android:visibility="gone">
<include <include
android:id="@+id/init_progress" android:id="@+id/init_progress"
layout="@layout/application_loading" layout="@layout/application_loading"
android:visibility="gone" /> android:visibility="gone"/>
<FrameLayout <FrameLayout
android:id="@+id/animateContent" android:id="@+id/animateContent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" > android:layout_height="match_parent">
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView <com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/main_scroll" android:id="@+id/main_scroll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fadeScrollbars="true" > android:fadeScrollbars="true">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" > android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/map_part_dashboard" android:id="@+id/map_part_dashboard"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="@dimen/dashboard_map_top_padding" > android:layout_height="@dimen/dashboard_map_top_padding">
<Button <Button
android:id="@+id/map_download_button" android:id="@+id/map_download_button"
@ -38,14 +39,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/shared_string_download" android:text="@string/shared_string_download"
android:visibility="gone" /> android:visibility="gone"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" /> android:orientation="vertical"/>
</LinearLayout> </LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView> </com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
@ -53,7 +54,7 @@
android:id="@+id/dash_list_view_layout" android:id="@+id/dash_list_view_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" > android:visibility="gone">
<LinearLayout <LinearLayout
android:id="@+id/dash_list_background" android:id="@+id/dash_list_background"
@ -68,9 +69,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="100dp" android:layout_marginTop="100dp"
android:gravity="center"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp" android:paddingRight="16dp"
android:gravity="center"
android:textSize="@dimen/default_list_text_size_large" android:textSize="@dimen/default_list_text_size_large"
android:visibility="gone"/> android:visibility="gone"/>
@ -80,8 +81,8 @@
android:id="@+id/dash_list_view" android:id="@+id/dash_list_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fadeScrollbars="true" > android:divider="@null"
</net.osmand.plus.views.controls.DynamicListView> android:fadeScrollbars="true"/>
</FrameLayout> </FrameLayout>
<include layout="@layout/dashboard_toolbar"/> <include layout="@layout/dashboard_toolbar"/>

View file

@ -1,67 +1,93 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" <RelativeLayout
android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" xmlns:tools="http://schemas.android.com/tools"
android:background="?attr/bg_color" android:layout_width="match_parent"
android:minHeight="60dp" android:layout_height="wrap_content"
android:orientation="horizontal" android:background="?attr/bg_color"
android:paddingLeft="16dp" android:minHeight="60dp"
android:paddingRight="16dp"> tools:layout_height="60dp">
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginBottom="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
tools:src="@drawable/ic_action_gabout_dark"/> tools:src="@drawable/ic_action_gabout_dark"/>
<FrameLayout <LinearLayout
android:id="@+id/text_wrapper" android:id="@+id/text_wrapper"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_centerVertical="true"
android:gravity="center"> android:layout_gravity="center_vertical"
android:layout_toEndOf="@+id/icon"
android:layout_toLeftOf="@+id/secondary_icon"
android:layout_toRightOf="@+id/icon"
android:layout_toStartOf="@+id/secondary_icon"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:minHeight="60dp"
android:orientation="vertical">
<LinearLayout <View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<android.support.v7.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:textSize="@dimen/default_list_text_size"
android:orientation="vertical"> tools:text="Some title text"/>
<android.support.v7.widget.AppCompatTextView <android.support.v7.widget.AppCompatTextView
android:id="@+id/title" android:id="@+id/description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_desc_text_size"
tools:text="Some title text"/> tools:text="Some title text"/>
<android.support.v7.widget.AppCompatTextView <View
android:id="@+id/description" android:layout_width="0dp"
android:layout_width="match_parent" android:layout_height="0dp"
android:layout_height="wrap_content" android:layout_weight="1"/>
android:textSize="@dimen/default_desc_text_size" </LinearLayout>
tools:text="Some title text"/>
</LinearLayout>
</FrameLayout>
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:id="@+id/secondary_icon" android:id="@+id/secondary_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_margin="16dp" android:layout_margin="16dp"
android:layout_toLeftOf="@+id/toggle_item"
android:layout_toStartOf="@+id/toggle_item"
tools:src="@drawable/ic_action_gabout_dark"/> tools:src="@drawable/ic_action_gabout_dark"/>
<android.support.v7.widget.SwitchCompat <android.support.v7.widget.SwitchCompat
android:id="@+id/toggle_item" android:id="@+id/toggle_item"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:focusable="false"/> android:focusable="false"/>
</LinearLayout> <View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/text_wrapper"
android:layout_alignStart="@+id/text_wrapper"
android:background="?attr/divider_color"/>
</RelativeLayout>

View file

@ -861,8 +861,10 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
// listView.setBackgroundColor(backgroundColor); // listView.setBackgroundColor(backgroundColor);
listEmptyTextView.setBackgroundColor(backgroundColor); listEmptyTextView.setBackgroundColor(backgroundColor);
} }
if (visibleType != DashboardType.WAYPOINTS && visibleType != DashboardType.MAP_MARKERS if (visibleType != DashboardType.WAYPOINTS
&& visibleType != DashboardType.MAP_MARKERS_SELECTION) { && visibleType != DashboardType.MAP_MARKERS
&& visibleType != DashboardType.MAP_MARKERS_SELECTION
&& visibleType != DashboardType.CONFIGURE_SCREEN) {
listView.setDivider(dividerDrawable); listView.setDivider(dividerDrawable);
listView.setDividerHeight(dpToPx(1f)); listView.setDividerHeight(dpToPx(1f));
} else { } else {