use of net.osmand.plus.settings.backend.preferences.ListStringPreference in project Osmand by osmandapp.
the class AddNewFavoriteCategoryBottomSheet method setupColorsCard.
private void setupColorsCard() {
MapActivity mapActivity = ((MapActivity) getActivity());
if (mapActivity == null) {
return;
}
List<Integer> colors = new ArrayList<>();
for (int color : ColorDialogs.pallette) {
colors.add(color);
}
ListStringPreference colorsListPref = requiredMyApplication().getSettings().CUSTOM_TRACK_COLORS;
colorsCard = new ColorsCard(mapActivity, null, this, categoryColor, colors, colorsListPref, true);
colorsCard.setListener(this);
LinearLayout colorsCardContainer = view.findViewById(R.id.colors_card_container);
colorsCardContainer.addView(colorsCard.build(view.getContext()));
}
use of net.osmand.plus.settings.backend.preferences.ListStringPreference in project Osmand by osmandapp.
the class OsmandPlugin method registerListStringPreference.
protected ListStringPreference registerListStringPreference(@NonNull String prefId, @Nullable String defValue, @NonNull String delimiter) {
ListStringPreference preference = app.getSettings().registerStringListPreference(prefId, defValue, delimiter);
preference.setRelatedPlugin(this);
pluginPreferences.add(preference);
return preference;
}
use of net.osmand.plus.settings.backend.preferences.ListStringPreference in project Osmand by osmandapp.
the class OsmandSettings method registerStringListPreference.
public ListStringPreference registerStringListPreference(@NonNull String id, @Nullable String defValue, @NonNull String delimiter) {
if (registeredPreferences.containsKey(id)) {
return (ListStringPreference) registeredPreferences.get(id);
}
ListStringPreference preference = new ListStringPreference(this, id, defValue, delimiter);
registeredPreferences.put(id, preference);
return preference;
}
use of net.osmand.plus.settings.backend.preferences.ListStringPreference in project Osmand by osmandapp.
the class RouteLineColorCard method createCards.
private void createCards(ViewGroup container) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
List<Integer> colors = new ArrayList<>();
for (int color : ColorDialogs.pallette) {
colors.add(color);
}
int selectedColorDay = getSelectedColorForTheme(colors, false);
int selectedColorNight = getSelectedColorForTheme(colors, true);
int selectedColor = isNightMap() ? selectedColorNight : selectedColorDay;
ListStringPreference preference = app.getSettings().CUSTOM_ROUTE_LINE_COLORS;
colorsCard = new ColorsCard(mapActivity, null, targetFragment, selectedColor, colors, preference, true);
colorsCard.setListener(this);
container.addView(colorsCard.build(mapActivity));
coloringTypeCard = new ColoringTypeCard(mapActivity, previewRouteLineInfo.getRouteColoringType());
container.addView(coloringTypeCard.build(mapActivity));
promoCard = new PromoBannerCard(mapActivity, true);
container.addView(promoCard.build(mapActivity));
}
}
Aggregations