Open markers list in full screen
This commit is contained in:
parent
75c7dfe949
commit
0b86ae8643
3 changed files with 129 additions and 124 deletions
|
@ -14,118 +14,133 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical"
|
||||
tools:background="@drawable/bg_bottom_menu_dark">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/snap_to_road_progress_bar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
<ImageView
|
||||
android:id="@+id/plan_route_shadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bg_shadow_onmap"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/up_down_row"
|
||||
android:id="@+id/background_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/measurement_tool_up_down_row_height"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/bg_color_dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/up_down_icon"
|
||||
android:layout_width="wrap_content"
|
||||
<ProgressBar
|
||||
android:id="@+id/snap_to_road_progress_bar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/bottom_sheet_content_margin"
|
||||
android:layout_marginLeft="@dimen/bottom_sheet_content_margin"
|
||||
android:layout_marginRight="@dimen/bottom_sheet_content_margin"
|
||||
android:layout_marginStart="@dimen/bottom_sheet_content_margin"
|
||||
android:background="@null"
|
||||
tools:src="@drawable/ic_action_arrow_down"/>
|
||||
android:minHeight="0dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/up_down_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/measurement_tool_up_down_row_height"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markers_distance_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/measurement_tool_text_margin_small"
|
||||
android:layout_marginLeft="@dimen/measurement_tool_text_margin"
|
||||
android:layout_marginRight="@dimen/measurement_tool_text_margin_small"
|
||||
android:layout_marginStart="@dimen/measurement_tool_text_margin"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||
tools:text="1.39 km,"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markers_time_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="~ 45 min."/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markers_count_text_view"
|
||||
<ImageView
|
||||
android:id="@+id/up_down_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/measurement_tool_text_margin"
|
||||
android:layout_marginStart="@dimen/measurement_tool_text_margin"
|
||||
android:layout_marginEnd="@dimen/bottom_sheet_content_margin"
|
||||
android:layout_marginLeft="@dimen/bottom_sheet_content_margin"
|
||||
android:layout_marginRight="@dimen/bottom_sheet_content_margin"
|
||||
android:layout_marginStart="@dimen/bottom_sheet_content_margin"
|
||||
android:background="@null"
|
||||
tools:src="@drawable/ic_action_arrow_down"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markers_distance_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/measurement_tool_text_margin_small"
|
||||
android:layout_marginLeft="@dimen/measurement_tool_text_margin"
|
||||
android:layout_marginRight="@dimen/measurement_tool_text_margin_small"
|
||||
android:layout_marginStart="@dimen/measurement_tool_text_margin"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||
tools:text="1.39 km,"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markers_time_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="~ 45 min."/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/markers_count_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/measurement_tool_text_margin"
|
||||
android:layout_marginStart="@dimen/measurement_tool_text_margin"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"
|
||||
tools:text="3 markers"/>
|
||||
</LinearLayout>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/select_all_button"
|
||||
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:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"
|
||||
tools:text="3 markers"/>
|
||||
android:paddingEnd="@dimen/measurement_tool_text_button_padding_small"
|
||||
android:paddingLeft="@dimen/measurement_tool_text_button_padding"
|
||||
android:paddingRight="@dimen/measurement_tool_text_button_padding_small"
|
||||
android:paddingStart="@dimen/measurement_tool_text_button_padding"
|
||||
android:text="@string/shared_string_select_all"
|
||||
android:textColor="?attr/color_dialog_buttons"
|
||||
osmand:textAllCapsCompat="true"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/select_all_button"
|
||||
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="@dimen/measurement_tool_text_button_padding_small"
|
||||
android:paddingLeft="@dimen/measurement_tool_text_button_padding"
|
||||
android:paddingRight="@dimen/measurement_tool_text_button_padding_small"
|
||||
android:paddingStart="@dimen/measurement_tool_text_button_padding"
|
||||
android:text="@string/shared_string_select_all"
|
||||
android:textColor="?attr/color_dialog_buttons"
|
||||
osmand:textAllCapsCompat="true"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/markers_list_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/measurement_tool_points_list_container_height"
|
||||
android:background="@color/ctx_menu_info_view_bg_dark">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/markers_recycler_view"
|
||||
<FrameLayout
|
||||
android:id="@+id/markers_list_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="@dimen/measurement_tool_points_list_container_height"
|
||||
android:background="@color/ctx_menu_info_view_bg_dark">
|
||||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
</FrameLayout>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/markers_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/map_hud_bottom_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
|
@ -223,6 +224,7 @@
|
|||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragments_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
|
|
@ -157,18 +157,14 @@ public class PlanRouteFragment extends Fragment {
|
|||
}
|
||||
|
||||
if (portrait) {
|
||||
AndroidUtils.setBackground(mapActivity, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
|
||||
mainView.findViewById(R.id.background_view).setBackgroundResource(nightMode ? R.color.bg_color_dark : R.color.bg_color_light);
|
||||
|
||||
((ImageView) mainView.findViewById(R.id.up_down_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_up));
|
||||
|
||||
mainView.findViewById(R.id.up_down_row).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (!markersListOpened) {
|
||||
showMarkersList();
|
||||
} else {
|
||||
hideMarkersList();
|
||||
}
|
||||
showHideMarkersList();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -337,7 +333,7 @@ public class PlanRouteFragment extends Fragment {
|
|||
super.onDestroyView();
|
||||
exitPlanRouteMode();
|
||||
if (markersListOpened) {
|
||||
hideMarkersList();
|
||||
showHideMarkersList();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -604,30 +600,22 @@ public class PlanRouteFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
//todo create one method
|
||||
private void showMarkersList() {
|
||||
private void showHideMarkersList() {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null && portrait) {
|
||||
markersListOpened = true;
|
||||
mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(View.GONE);
|
||||
((ImageView) mainView.findViewById(R.id.up_down_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_down));
|
||||
View listContainer = mainView.findViewById(R.id.markers_list_container);
|
||||
if (listContainer != null) {
|
||||
listContainer.getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
markersListOpened = !markersListOpened;
|
||||
int height = markersListOpened ? ViewGroup.LayoutParams.MATCH_PARENT : ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
int listHeight = markersListOpened ? ViewGroup.LayoutParams.MATCH_PARENT : closedListContainerHeight;
|
||||
int visibility = markersListOpened ? View.GONE : View.VISIBLE;
|
||||
Drawable arrow = getContentIcon(markersListOpened ? R.drawable.ic_action_arrow_down : R.drawable.ic_action_arrow_up);
|
||||
|
||||
private void hideMarkersList() {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null && portrait) {
|
||||
markersListOpened = false;
|
||||
mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(View.VISIBLE);
|
||||
((ImageView) mainView.findViewById(R.id.up_down_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_up));
|
||||
View listContainer = mainView.findViewById(R.id.markers_list_container);
|
||||
if (listContainer != null) {
|
||||
listContainer.getLayoutParams().height = closedListContainerHeight;
|
||||
}
|
||||
((ImageView) mainView.findViewById(R.id.up_down_icon)).setImageDrawable(arrow);
|
||||
mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(visibility);
|
||||
mapActivity.findViewById(R.id.map_hud_bottom_container).getLayoutParams().height = height;
|
||||
mapActivity.findViewById(R.id.fragments_container).getLayoutParams().height = height;
|
||||
mainView.findViewById(R.id.markers_list_container).getLayoutParams().height = listHeight;
|
||||
mainView.findViewById(R.id.plan_route_shadow).setVisibility(visibility);
|
||||
mainView.getLayoutParams().height = height;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -682,8 +670,8 @@ public class PlanRouteFragment extends Fragment {
|
|||
}
|
||||
|
||||
public boolean quit(boolean hideMarkersListFirst) {
|
||||
if (portrait && markersListOpened && hideMarkersListFirst) {
|
||||
hideMarkersList();
|
||||
if (markersListOpened && hideMarkersListFirst) {
|
||||
showHideMarkersList();
|
||||
return false;
|
||||
} else {
|
||||
dismiss(getMapActivity());
|
||||
|
@ -692,8 +680,8 @@ public class PlanRouteFragment extends Fragment {
|
|||
}
|
||||
|
||||
private void dismiss(MapActivity activity) {
|
||||
if (portrait && markersListOpened) {
|
||||
hideMarkersList();
|
||||
if (markersListOpened) {
|
||||
showHideMarkersList();
|
||||
}
|
||||
planRouteContext.setFragmentVisible(false);
|
||||
activity.getSupportFragmentManager().beginTransaction().remove(this).commitAllowingStateLoss();
|
||||
|
|
Loading…
Reference in a new issue