add lost marker divider & fix coordinate widget divider

This commit is contained in:
Dmitriy Ruban 2019-11-26 16:08:47 +02:00
parent 3519ff0a57
commit d0ecffd4da
3 changed files with 79 additions and 8 deletions

View file

@ -0,0 +1,54 @@
<?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="wrap_content"
android:background="?attr/bg_color"
android:minHeight="60dp"
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_marginStart="@dimen/bottom_sheet_content_margin"
android:layout_marginLeft="@dimen/bottom_sheet_content_margin"
tools:src="@drawable/ic_action_gabout_dark" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="@dimen/bottom_sheet_content_margin"
android:layout_toStartOf="@+id/toggle_item"
android:layout_toLeftOf="@+id/toggle_item"
android:layout_toEndOf="@+id/icon"
android:layout_toRightOf="@+id/icon"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="Some title text" />
<android.support.v7.widget.SwitchCompat
android:id="@+id/toggle_item"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/bottom_sheet_content_margin"
android:layout_marginRight="@dimen/bottom_sheet_content_margin"
android:focusable="false" />
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignStart="@+id/icon"
android:layout_alignLeft="@+id/icon"
android:layout_alignParentBottom="true"
android:background="?attr/dashboard_divider" />
</RelativeLayout>

View file

@ -1,19 +1,23 @@
<?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="54dp"
android:orientation="horizontal">
tools:layout_height="54dp">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_weight="1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/description"
android:layout_toStartOf="@+id/description"
android:layout_margin="@dimen/bottom_sheet_content_margin"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="Some title text"/>
@ -22,9 +26,21 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_margin="16dp"
android:layout_margin="@dimen/bottom_sheet_content_margin"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:gravity="center_vertical"
android:textColor="?colorAccent"
android:textColor="?attr/colorAccent"
tools:text="topbar"/>
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_alignStart="@+id/title"
android:layout_alignLeft="@+id/title"
android:layout_alignParentBottom="true"
android:background="?attr/dashboard_divider" />
</RelativeLayout>

View file

@ -344,7 +344,8 @@ public class MapWidgetRegistry {
cm.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.coordinates_widget, map)
.setIcon(R.drawable.ic_action_coordinates_widget)
.setSelected(settings.SHOW_COORDINATES_WIDGET.get())
.setListener(new ApearanceItemClickListener(settings.SHOW_COORDINATES_WIDGET, map)).createItem());
.setListener(new ApearanceItemClickListener(settings.SHOW_COORDINATES_WIDGET, map))
.setLayout(R.layout.list_item_icon_and_switch).createItem());
cm.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_markers, map)
.setDescription(settings.MAP_MARKERS_MODE.get().toHumanString(map))
.setListener(new ContextMenuAdapter.ItemClickListener() {