Add borders for the controls

This commit is contained in:
Alex 2017-08-11 17:35:36 +03:00
parent 4f85af5b10
commit 6714afb316
2 changed files with 61 additions and 49 deletions

View file

@ -137,30 +137,39 @@
android:src="@drawable/bg_shadow_onmap"/>
</FrameLayout>
<RelativeLayout
<LinearLayout
android:id="@+id/measure_mode_controls"
android:layout_width="match_parent"
android:layout_height="52dp">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/options_button"
android:layout_width="wrap_content"
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:paddingEnd="12dp"
android:paddingLeft="16dp"
android:paddingRight="12dp"
android:paddingStart="16dp"
android:text="@string/shared_string_options"
android:textColor="?attr/color_dialog_buttons"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"/>
android:layout_weight="1">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/options_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingEnd="12dp"
android:paddingLeft="16dp"
android:paddingRight="12dp"
android:paddingStart="16dp"
android:text="@string/shared_string_options"
android:textColor="?attr/color_dialog_buttons"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"/>
</FrameLayout>
<LinearLayout
android:id="@+id/redo_undo_container"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_centerHorizontal="true">
android:layout_weight="1"
android:gravity="center_horizontal">
<ImageButton
android:id="@+id/undo_point_button"
@ -189,24 +198,37 @@
tools:src="@drawable/ic_action_redo_dark"/>
</LinearLayout>
<Button
android:id="@+id/add_point_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/btn_round_blue"
android:drawableLeft="@drawable/ic_action_plus"
android:minHeight="36dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="@string/shared_string_add"
android:textColor="@color/color_white"/>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:id="@+id/add_point_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/btn_round_blue"
android:drawableLeft="@drawable/ic_action_plus"
android:maxLines="1"
android:minHeight="36dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="@string/shared_string_add"
android:textColor="@color/color_white"/>
</FrameLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/move_point_mode_controls"
android:layout_width="match_parent"
android:layout_height="52dp"
android:visibility="gone">
<Button
android:id="@+id/apply_point_button"
@ -224,8 +246,7 @@
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="@string/shared_string_apply"
android:textColor="@color/color_white"
android:visibility="gone"/>
android:textColor="@color/color_white"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/cancel_point_button"
@ -239,7 +260,6 @@
android:paddingStart="16dp"
android:text="@string/shared_string_cancel"
android:textColor="?attr/color_dialog_buttons"
android:visibility="gone"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium"/>
</RelativeLayout>

View file

@ -402,15 +402,11 @@ public class MeasurementToolFragment extends Fragment {
R.id.measurement_distance_text_view,
R.id.measurement_points_text_view,
R.id.up_down_button,
R.id.options_button,
R.id.undo_point_button,
R.id.redo_point_button,
R.id.add_point_button);
R.id.measure_mode_controls);
mark(View.VISIBLE,
R.id.move_point_icon,
R.id.move_point_text,
R.id.cancel_point_button,
R.id.apply_point_button);
R.id.move_point_mode_controls);
}
private void exitMovePointMode() {
@ -418,17 +414,13 @@ public class MeasurementToolFragment extends Fragment {
mark(View.GONE,
R.id.move_point_icon,
R.id.move_point_text,
R.id.cancel_point_button,
R.id.apply_point_button);
R.id.move_point_mode_controls);
mark(View.VISIBLE,
R.id.ruler_icon,
R.id.measurement_distance_text_view,
R.id.measurement_points_text_view,
R.id.up_down_button,
R.id.options_button,
R.id.undo_point_button,
R.id.redo_point_button,
R.id.add_point_button);
R.id.measure_mode_controls);
}
private void hidePointsListIfNoPoints() {