use of net.osmand.plus.routing.PreviewRouteLineInfo in project Osmand by osmandapp.
the class RouteLineAppearanceFragment method createPreviewRouteLineInfo.
private PreviewRouteLineInfo createPreviewRouteLineInfo() {
OsmandSettings settings = requireSettings();
int colorDay = settings.CUSTOM_ROUTE_COLOR_DAY.getModeValue(appMode);
int colorNight = settings.CUSTOM_ROUTE_COLOR_NIGHT.getModeValue(appMode);
ColoringType coloringType = settings.ROUTE_COLORING_TYPE.getModeValue(appMode);
String routeInfoAttribute = settings.ROUTE_INFO_ATTRIBUTE.getModeValue(appMode);
String widthKey = settings.ROUTE_LINE_WIDTH.getModeValue(appMode);
boolean showTurnArrows = settings.ROUTE_SHOW_TURN_ARROWS.getModeValue(appMode);
PreviewRouteLineInfo previewRouteLineInfo = new PreviewRouteLineInfo(colorDay, colorNight, coloringType, routeInfoAttribute, widthKey, showTurnArrows);
previewRouteLineInfo.setIconId(appMode.getNavigationIcon().getIconId());
previewRouteLineInfo.setIconColor(appMode.getProfileColor(isNightMode()));
return previewRouteLineInfo;
}
use of net.osmand.plus.routing.PreviewRouteLineInfo in project Osmand by osmandapp.
the class RouteLineAppearanceFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupAppMode(savedInstanceState);
toolbarHeightPx = getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
if (savedInstanceState != null) {
previewRouteLineInfo = new PreviewRouteLineInfo(savedInstanceState);
initMapTheme = DayNightMode.valueOf(savedInstanceState.getString(INIT_MAP_THEME));
selectedMapTheme = DayNightMode.valueOf(savedInstanceState.getString(SELECTED_MAP_THEME));
} else {
previewRouteLineInfo = createPreviewRouteLineInfo();
initMapTheme = requireSettings().DAYNIGHT_MODE.getModeValue(appMode);
selectedMapTheme = initMapTheme;
}
requireMapActivity().getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
public void handleOnBackPressed() {
dismiss();
}
});
}
Aggregations