use of net.osmand.plus.widgets.FlowLayout.LayoutParams in project Osmand by osmandapp.
the class IconsCard method fillIconsSelector.
private void fillIconsSelector() {
iconsSelector = view.findViewById(R.id.icons_selector);
iconsSelector.removeAllViews();
iconsSelector.setHorizontalAutoSpacing(true);
LayoutInflater inflater = UiUtilities.getInflater(mapActivity, nightMode);
for (String iconName : getIconNameListToShow()) {
int width = getDimen(R.dimen.favorites_select_icon_button_right_padding);
LayoutParams layoutParams = new LayoutParams(width, 0);
iconsSelector.addView(createIconItemView(inflater, iconName), layoutParams);
}
}
use of net.osmand.plus.widgets.FlowLayout.LayoutParams in project Osmand by osmandapp.
the class ColorsCard method createColorSelector.
private void createColorSelector() {
FlowLayout selectCustomColor = view.findViewById(R.id.select_custom_color);
selectCustomColor.removeAllViews();
selectCustomColor.setHorizontalAutoSpacing(true);
int minimalPaddingBetweenIcon = getDimen(R.dimen.favorites_select_icon_button_right_padding);
for (int color : customColors) {
selectCustomColor.addView(createColorItemView(color, selectCustomColor, true), new LayoutParams(minimalPaddingBetweenIcon, 0));
}
if (customColors.size() < 6) {
selectCustomColor.addView(createAddCustomColorItemView(selectCustomColor), new LayoutParams(minimalPaddingBetweenIcon, 0));
}
FlowLayout selectDefaultColor = view.findViewById(R.id.select_default_color);
selectDefaultColor.removeAllViews();
selectDefaultColor.setHorizontalAutoSpacing(true);
for (int color : colors) {
selectDefaultColor.addView(createColorItemView(color, selectDefaultColor, false), new LayoutParams(minimalPaddingBetweenIcon, 0));
}
updateColorSelector(selectedColor);
}
Aggregations