Merge pull request #9697 from osmandapp/plan_route_fixes
Plan route fixes first part
This commit is contained in:
commit
5a64dcbc84
8 changed files with 142 additions and 91 deletions
|
@ -1,9 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
|
@ -12,9 +17,9 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/content_padding"
|
android:paddingStart="@dimen/content_padding"
|
||||||
android:paddingLeft="@dimen/content_padding"
|
android:paddingLeft="@dimen/content_padding"
|
||||||
|
android:paddingTop="@dimen/measurement_tool_menu_title_padding_top"
|
||||||
android:paddingEnd="@dimen/content_padding"
|
android:paddingEnd="@dimen/content_padding"
|
||||||
android:paddingRight="@dimen/content_padding"
|
android:paddingRight="@dimen/content_padding"
|
||||||
android:paddingTop="@dimen/measurement_tool_menu_title_padding_top"
|
|
||||||
android:paddingBottom="@dimen/measurement_tool_menu_title_padding_bottom"
|
android:paddingBottom="@dimen/measurement_tool_menu_title_padding_bottom"
|
||||||
android:text="@string/plan_route_open_existing_track"
|
android:text="@string/plan_route_open_existing_track"
|
||||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||||
|
@ -38,23 +43,24 @@
|
||||||
android:id="@+id/folder_list"
|
android:id="@+id/folder_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="@dimen/content_padding"
|
|
||||||
android:paddingRight="@dimen/content_padding"
|
|
||||||
android:paddingStart="@dimen/content_padding"
|
|
||||||
android:paddingEnd="@dimen/content_padding"
|
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="@dimen/content_padding"
|
||||||
|
android:paddingLeft="@dimen/content_padding"
|
||||||
|
android:paddingEnd="@dimen/content_padding"
|
||||||
|
android:paddingRight="@dimen/content_padding"
|
||||||
tools:itemCount="3"
|
tools:itemCount="3"
|
||||||
tools:orientation="horizontal"
|
|
||||||
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
tools:listitem="@layout/point_editor_icon_category_item" />
|
tools:listitem="@layout/point_editor_icon_category_item"
|
||||||
|
tools:orientation="horizontal" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/gpx_track_list"
|
android:id="@+id/gpx_track_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:itemCount="1"
|
tools:itemCount="1"
|
||||||
tools:listitem="@layout/gpx_track_select_item">
|
tools:listitem="@layout/gpx_track_select_item" />
|
||||||
|
|
||||||
</androidx.recyclerview.widget.RecyclerView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
|
@ -1,9 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -12,17 +17,17 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingStart="@dimen/content_padding"
|
android:paddingStart="@dimen/content_padding"
|
||||||
android:paddingLeft="@dimen/content_padding"
|
android:paddingLeft="@dimen/content_padding"
|
||||||
|
android:paddingTop="@dimen/bottom_sheet_title_padding_top"
|
||||||
android:paddingEnd="@dimen/content_padding"
|
android:paddingEnd="@dimen/content_padding"
|
||||||
android:paddingRight="@dimen/content_padding"
|
android:paddingRight="@dimen/content_padding"
|
||||||
android:paddingTop="@dimen/bottom_sheet_title_padding_top"
|
|
||||||
android:paddingBottom="@dimen/bottom_sheet_title_padding_bottom">
|
android:paddingBottom="@dimen/bottom_sheet_title_padding_bottom">
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
android:id="@+id/last_edited"
|
android:id="@+id/last_edited"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/plan_route_last_edited"
|
|
||||||
android:letterSpacing="@dimen/description_letter_spacing"
|
android:letterSpacing="@dimen/description_letter_spacing"
|
||||||
|
android:text="@string/plan_route_last_edited"
|
||||||
android:textColor="?attr/active_color_basic"
|
android:textColor="?attr/active_color_basic"
|
||||||
android:textSize="@dimen/default_desc_text_size"
|
android:textSize="@dimen/default_desc_text_size"
|
||||||
osmand:typeface="@string/font_roboto_medium" />
|
osmand:typeface="@string/font_roboto_medium" />
|
||||||
|
@ -35,7 +40,8 @@
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:itemCount="1"
|
tools:itemCount="1"
|
||||||
tools:listitem="@layout/gpx_track_select_item">
|
tools:listitem="@layout/gpx_track_select_item" />
|
||||||
|
|
||||||
</androidx.recyclerview.widget.RecyclerView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
|
@ -11,8 +11,26 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<include layout="@layout/context_menu_top_shadow" />
|
<include layout="@layout/context_menu_top_shadow" />
|
||||||
|
|
||||||
|
<include
|
||||||
|
layout="@layout/plan_route_progress_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/gpx_approximation_top_shadow_all"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/bottom_container"
|
android:id="@+id/bottom_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -36,8 +54,6 @@
|
||||||
|
|
||||||
</net.osmand.plus.LockableScrollView>
|
</net.osmand.plus.LockableScrollView>
|
||||||
|
|
||||||
<include layout="@layout/plan_route_progress_bar"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -66,6 +66,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
|
||||||
private View view;
|
private View view;
|
||||||
private OnLayoutChangeListener containerLayoutListener;
|
private OnLayoutChangeListener containerLayoutListener;
|
||||||
private View topShadow;
|
private View topShadow;
|
||||||
|
private ViewGroup topView;
|
||||||
private View bottomScrollView;
|
private View bottomScrollView;
|
||||||
private LinearLayout cardsContainer;
|
private LinearLayout cardsContainer;
|
||||||
private FrameLayout bottomContainer;
|
private FrameLayout bottomContainer;
|
||||||
|
@ -167,6 +168,11 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
|
||||||
return mainView;
|
return mainView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public ViewGroup getTopView() {
|
||||||
|
return topView;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isNightMode() {
|
public boolean isNightMode() {
|
||||||
return nightMode;
|
return nightMode;
|
||||||
}
|
}
|
||||||
|
@ -290,7 +296,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
|
||||||
final int touchSlop = vc.getScaledTouchSlop();
|
final int touchSlop = vc.getScaledTouchSlop();
|
||||||
|
|
||||||
if (getTopViewId() != 0) {
|
if (getTopViewId() != 0) {
|
||||||
View topView = view.findViewById(getTopViewId());
|
topView = view.findViewById(getTopViewId());
|
||||||
AndroidUtils.setBackground(app, topView, nightMode, R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
|
AndroidUtils.setBackground(app, topView, nightMode, R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
|
||||||
}
|
}
|
||||||
if (!portrait) {
|
if (!portrait) {
|
||||||
|
|
|
@ -61,6 +61,11 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
|
||||||
return R.layout.fragment_gpx_approximation_bottom_sheet_dialog;
|
return R.layout.fragment_gpx_approximation_bottom_sheet_dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTopViewId() {
|
||||||
|
return R.id.gpx_approximation_top_shadow_all;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHeaderViewHeight() {
|
public int getHeaderViewHeight() {
|
||||||
return menuTitleHeight;
|
return menuTitleHeight;
|
||||||
|
@ -259,9 +264,11 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
|
||||||
ViewGroup cardsContainer = getCardsContainer();
|
ViewGroup cardsContainer = getCardsContainer();
|
||||||
cardsContainer.removeAllViews();
|
cardsContainer.removeAllViews();
|
||||||
|
|
||||||
|
if (getTopView() != null) {
|
||||||
SliderCard sliderCard = new SliderCard(mapActivity, distanceThreshold);
|
SliderCard sliderCard = new SliderCard(mapActivity, distanceThreshold);
|
||||||
sliderCard.setListener(this);
|
sliderCard.setListener(this);
|
||||||
cardsContainer.addView(sliderCard.build(mapActivity));
|
getTopView().addView(sliderCard.build(mapActivity));
|
||||||
|
}
|
||||||
|
|
||||||
ProfileCard profileCard = new ProfileCard(mapActivity, snapToRoadAppMode);
|
ProfileCard profileCard = new ProfileCard(mapActivity, snapToRoadAppMode);
|
||||||
profileCard.setListener(this);
|
profileCard.setListener(this);
|
||||||
|
|
|
@ -15,6 +15,7 @@ import net.osmand.plus.routepreparationmenu.cards.BaseCard;
|
||||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ProfileCard extends BaseCard {
|
public class ProfileCard extends BaseCard {
|
||||||
|
@ -34,9 +35,15 @@ public class ProfileCard extends BaseCard {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateContent() {
|
protected void updateContent() {
|
||||||
|
|
||||||
final List<ApplicationMode> modes = new ArrayList<>(ApplicationMode.values(app));
|
final List<ApplicationMode> modes = new ArrayList<>(ApplicationMode.values(app));
|
||||||
modes.remove(ApplicationMode.DEFAULT);
|
modes.remove(ApplicationMode.DEFAULT);
|
||||||
|
Iterator<ApplicationMode> iterator = modes.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
ApplicationMode mode = iterator.next();
|
||||||
|
if ("public_transport".equals(mode.getRoutingProfile())) {
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int i = 0; i < modes.size(); i++) {
|
for (int i = 0; i < modes.size(); i++) {
|
||||||
ApplicationMode mode = modes.get(i);
|
ApplicationMode mode = modes.get(i);
|
||||||
LinearLayout container = view.findViewById(R.id.content_container);
|
LinearLayout container = view.findViewById(R.id.content_container);
|
||||||
|
|
|
@ -34,7 +34,8 @@ import org.apache.commons.logging.Log;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static net.osmand.plus.UiUtilities.CustomRadioButtonType.*;
|
import static net.osmand.plus.UiUtilities.CustomRadioButtonType.LEFT;
|
||||||
|
import static net.osmand.plus.UiUtilities.CustomRadioButtonType.RIGHT;
|
||||||
import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.NEXT_SEGMENT;
|
import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.NEXT_SEGMENT;
|
||||||
import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.WHOLE_TRACK;
|
import static net.osmand.plus.measurementtool.MeasurementEditingContext.CalculationMode.WHOLE_TRACK;
|
||||||
import static net.osmand.plus.measurementtool.MeasurementEditingContext.DEFAULT_APP_MODE;
|
import static net.osmand.plus.measurementtool.MeasurementEditingContext.DEFAULT_APP_MODE;
|
||||||
|
@ -120,9 +121,11 @@ public class RouteBetweenPointsBottomSheetDialogFragment extends BottomSheetDial
|
||||||
|
|
||||||
for (int i = 0; i < modes.size(); i++) {
|
for (int i = 0; i < modes.size(); i++) {
|
||||||
ApplicationMode mode = modes.get(i);
|
ApplicationMode mode = modes.get(i);
|
||||||
|
if (!"public_transport".equals(mode.getRoutingProfile())) {
|
||||||
icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode));
|
icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode));
|
||||||
addProfileView(navigationType, onClickListener, i, icon, mode.toHumanString(), mode.equals(appMode));
|
addProfileView(navigationType, onClickListener, i, icon, mode.toHumanString(), mode.equals(appMode));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
segmentBtn.setOnClickListener(new View.OnClickListener() {
|
segmentBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -477,8 +477,8 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
|
||||||
AndroidUtils.setBackground(ctx, getCardsContainer(), isNightMode(),
|
AndroidUtils.setBackground(ctx, getCardsContainer(), isNightMode(),
|
||||||
R.color.activity_background_light, R.color.activity_background_dark);
|
R.color.activity_background_light, R.color.activity_background_dark);
|
||||||
|
|
||||||
if (getTopViewId() != 0) {
|
if (getTopView() != null) {
|
||||||
View topView = view.findViewById(getTopViewId());
|
View topView = getTopView();
|
||||||
AndroidUtils.setBackground(ctx, topView, isNightMode(), R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
|
AndroidUtils.setBackground(ctx, topView, isNightMode(), R.color.card_and_list_background_light, R.color.card_and_list_background_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue