Search in sources :

Example 1 with ListStringPreference

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()));
}
Also used : ColorsCard(net.osmand.plus.track.cards.ColorsCard) ListStringPreference(net.osmand.plus.settings.backend.preferences.ListStringPreference) ArrayList(java.util.ArrayList) LinearLayout(android.widget.LinearLayout) MapActivity(net.osmand.plus.activities.MapActivity)

Example 2 with ListStringPreference

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;
}
Also used : ListStringPreference(net.osmand.plus.settings.backend.preferences.ListStringPreference)

Example 3 with ListStringPreference

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;
}
Also used : ListStringPreference(net.osmand.plus.settings.backend.preferences.ListStringPreference)

Example 4 with ListStringPreference

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));
    }
}
Also used : ColorsCard(net.osmand.plus.track.cards.ColorsCard) ListStringPreference(net.osmand.plus.settings.backend.preferences.ListStringPreference) PromoBannerCard(net.osmand.plus.chooseplan.PromoBannerCard) ArrayList(java.util.ArrayList) ColoringTypeCard(net.osmand.plus.track.cards.ColoringTypeCard) MapActivity(net.osmand.plus.activities.MapActivity)

Aggregations

ListStringPreference (net.osmand.plus.settings.backend.preferences.ListStringPreference)4 ArrayList (java.util.ArrayList)2 MapActivity (net.osmand.plus.activities.MapActivity)2 ColorsCard (net.osmand.plus.track.cards.ColorsCard)2 LinearLayout (android.widget.LinearLayout)1 PromoBannerCard (net.osmand.plus.chooseplan.PromoBannerCard)1 ColoringTypeCard (net.osmand.plus.track.cards.ColoringTypeCard)1