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,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dashboard"
<FrameLayout android:id="@+id/dashboard"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@ -20,8 +20,8 @@
<LinearLayout
android:layout_width="@dimen/dashboard_land_width"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#70000000">
android:background="#70000000"
android:orientation="vertical">
<include layout="@layout/dashboard_toolbar"/>
@ -57,18 +57,18 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/bg_color"
android:fadeScrollbars="true" >
</net.osmand.plus.views.controls.DynamicListView>
android:divider="@null"
android:fadeScrollbars="true"/>
<TextView
android:id="@+id/emptyTextView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="?attr/bg_color"
android:clickable="true"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:clickable="true"
android:textSize="@dimen/default_list_text_size_large"
android:visibility="gone"/>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout
android:id="@+id/dashboard"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@ -68,9 +69,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center"
android:textSize="@dimen/default_list_text_size_large"
android:visibility="gone"/>
@ -80,8 +81,8 @@
android:id="@+id/dash_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadeScrollbars="true" >
</net.osmand.plus.views.controls.DynamicListView>
android:divider="@null"
android:fadeScrollbars="true"/>
</FrameLayout>
<include layout="@layout/dashboard_toolbar"/>

View file

@ -1,37 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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="wrap_content"
android:background="?attr/bg_color"
android:minHeight="60dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
tools:layout_height="60dp">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
tools:src="@drawable/ic_action_gabout_dark"/>
<FrameLayout
android:id="@+id/text_wrapper"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center">
<LinearLayout
android:id="@+id/text_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
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">
<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"
@ -46,22 +53,41 @@
android:textSize="@dimen/default_desc_text_size"
tools:text="Some title text"/>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
</FrameLayout>
<android.support.v7.widget.AppCompatImageView
android:id="@+id/secondary_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_margin="16dp"
android:layout_toLeftOf="@+id/toggle_item"
android:layout_toStartOf="@+id/toggle_item"
tools:src="@drawable/ic_action_gabout_dark"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/toggle_item"
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: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);
listEmptyTextView.setBackgroundColor(backgroundColor);
}
if (visibleType != DashboardType.WAYPOINTS && visibleType != DashboardType.MAP_MARKERS
&& visibleType != DashboardType.MAP_MARKERS_SELECTION) {
if (visibleType != DashboardType.WAYPOINTS
&& visibleType != DashboardType.MAP_MARKERS
&& visibleType != DashboardType.MAP_MARKERS_SELECTION
&& visibleType != DashboardType.CONFIGURE_SCREEN) {
listView.setDivider(dividerDrawable);
listView.setDividerHeight(dpToPx(1f));
} else {