use of net.osmand.plus.settings.backend.OsmAndAppCustomization in project Osmand by osmandapp.
the class RouteOptionsBottomSheet method createMenuItems.
@Override
public void createMenuItems(Bundle savedInstanceState) {
items.add(new TitleItem(app.getString(R.string.shared_string_settings), ColorUtilities.getActiveColorId(nightMode)));
OsmAndAppCustomization customization = app.getAppCustomization();
List<LocalRoutingParameter> list = getRoutingParameters(applicationMode);
for (final LocalRoutingParameter optionsItem : list) {
if (!dialogMode.isAvailableParameter(optionsItem) || !customization.isFeatureEnabled(optionsItem.getKey())) {
continue;
}
if (optionsItem instanceof DividerItem) {
if (isDividerRequired()) {
items.add(new DividerStartItem(app));
}
} else if (optionsItem instanceof MuteSoundRoutingParameter) {
items.add(createMuteSoundItem(optionsItem));
} else if (optionsItem instanceof ShowAlongTheRouteItem) {
items.add(createShowAlongTheRouteItem(optionsItem));
} else if (optionsItem instanceof RouteSimulationItem) {
items.add(createRouteSimulationItem(optionsItem));
} else if (optionsItem instanceof AvoidPTTypesRoutingParameter) {
items.add(createAvoidPTTypesItem(optionsItem));
} else if (optionsItem instanceof AvoidRoadsRoutingParameter) {
items.add(createAvoidRoadsItem(optionsItem));
} else if (optionsItem instanceof GpxLocalRoutingParameter) {
items.add(createGpxRoutingItem(optionsItem));
} else if (optionsItem instanceof TimeConditionalRoutingItem) {
items.add(createTimeConditionalRoutingItem(optionsItem));
} else if (optionsItem instanceof OtherSettingsRoutingParameter) {
items.add(createOtherSettingsRoutingItem(optionsItem));
} else if (optionsItem instanceof CustomizeRouteLineRoutingParameter) {
items.add(createCustomizeRouteLineRoutingItem(optionsItem));
} else if (USE_HEIGHT_OBSTACLES.equals(optionsItem.getKey()) && hasReliefParameters()) {
items.add(inflateElevationParameter(optionsItem));
} else {
inflateRoutingParameter(optionsItem);
}
}
}
use of net.osmand.plus.settings.backend.OsmAndAppCustomization in project Osmand by osmandapp.
the class DashBaseFragment method startFavoritesActivity.
protected void startFavoritesActivity(int tab) {
Activity activity = getActivity();
if (activity == null) {
return;
}
OsmandApplication app = getMyApplication();
OsmAndAppCustomization appCustomization = app.getAppCustomization();
final Intent favorites = new Intent(activity, appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
app.getSettings().FAVORITES_TAB.set(tab);
activity.startActivity(favorites);
}
use of net.osmand.plus.settings.backend.OsmAndAppCustomization in project Osmand by osmandapp.
the class OsmEditingFragment method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();
if (OPEN_OSM_EDITS.equals(prefId)) {
Bundle bundle = new Bundle();
bundle.putInt(TAB_ID, OSM_EDIT_TAB);
OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
favorites.putExtra(MapActivity.INTENT_PARAMS, bundle);
startActivity(favorites);
return true;
} else if (OSM_LOGIN_DATA.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
LoginBottomSheetFragment.showInstance(fragmentManager, this);
return true;
}
} else if (OSM_LOGOUT.equals(prefId)) {
osmLogout();
return true;
} else if (MAP_UPDATES_FOR_MAPPERS.equals(prefId)) {
FragmentActivity activity = getActivity();
if (activity != null) {
if (!isValidToken() && !isLoginExists()) {
MappersPromoFragment.showInstance(activity, this);
} else {
MappersFragment.showInstance(activity);
}
return true;
}
}
return super.onPreferenceClick(preference);
}
use of net.osmand.plus.settings.backend.OsmAndAppCustomization in project Osmand by osmandapp.
the class MultimediaNotesFragment method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();
if (OPEN_NOTES.equals(prefId)) {
Bundle bundle = new Bundle();
bundle.putInt(TAB_ID, NOTES_TAB);
OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
favorites.putExtra(MapActivity.INTENT_PARAMS, bundle);
startActivity(favorites);
return true;
} else if (COPY_PLUGIN_SETTINGS.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
SelectCopyAppModeBottomSheet.showInstance(fragmentManager, this, false, getSelectedAppMode());
}
} else if (RESET_TO_DEFAULT.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
ResetProfilePrefsBottomSheet.showInstance(fragmentManager, prefId, this, false, getSelectedAppMode());
}
} else if (CAMERA_PERMISSION.equals(prefId)) {
requestPermissions(new String[] { Manifest.permission.CAMERA }, CAMERA_FOR_PHOTO_PARAMS_REQUEST_CODE);
}
return super.onPreferenceClick(preference);
}
use of net.osmand.plus.settings.backend.OsmAndAppCustomization in project Osmand by osmandapp.
the class MonitoringSettingsFragment method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();
if (OPEN_TRACKS.equals(prefId)) {
Bundle bundle = new Bundle();
bundle.putInt(TAB_ID, FavoritesActivity.GPX_TAB);
OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
favorites.putExtra(MapActivity.INTENT_PARAMS, bundle);
startActivity(favorites);
return true;
} else if (COPY_PLUGIN_SETTINGS.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
SelectCopyAppModeBottomSheet.showInstance(fragmentManager, this, false, getSelectedAppMode());
}
} else if (RESET_TO_DEFAULT.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
ResetProfilePrefsBottomSheet.showInstance(fragmentManager, prefId, this, false, getSelectedAppMode());
}
}
return super.onPreferenceClick(preference);
}
Aggregations