Add switch to options menu

This commit is contained in:
Alexander Sytnyk 2017-08-16 14:16:40 +03:00
parent a96b271702
commit e2dcab77c6
2 changed files with 35 additions and 4 deletions

View file

@ -212,6 +212,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingEnd="12dp"
@ -266,6 +267,7 @@
android:layout_marginTop="8dp"
android:background="@drawable/btn_round_blue"
android:drawableLeft="@drawable/ic_action_plus"
android:ellipsize="end"
android:maxLines="1"
android:minHeight="36dp"
android:paddingLeft="8dp"

View file

@ -48,15 +48,44 @@
android:layout_marginRight="24dp"
tools:src="@drawable/ic_action_snap_to_road"/>
<TextView
<android.support.v7.widget.SwitchCompat
android:id="@+id/snap_to_road_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/snap_to_road_icon"
android:layout_toLeftOf="@id/snap_to_road_switch"
android:layout_toRightOf="@id/snap_to_road_icon"
android:layout_toStartOf="@id/snap_to_road_switch"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="@string/snap_to_road"
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
<TextView
android:id="@+id/snap_to_road_enabled_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shared_string_enabled"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
android:visibility="gone"
tools:visibility="visible"/>
</LinearLayout>
</RelativeLayout>
<View