use of net.osmand.plus.chooseplan.PromoBannerCard in project Osmand by osmandapp.
the class TrackAppearanceFragment method setupCards.
private void setupCards() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
ViewGroup container = getCardsContainer();
container.removeAllViews();
cards.clear();
if (!selectedGpxFile.isShowCurrentTrack() && !Algorithms.isEmpty(getDisplaySegmentGroups())) {
splitIntervalCard = new SplitIntervalCard(mapActivity, trackDrawInfo);
addCard(container, splitIntervalCard);
}
addCard(container, new DirectionArrowsCard(mapActivity, trackDrawInfo));
addCard(container, new ShowStartFinishCard(mapActivity, trackDrawInfo));
trackColoringCard = new TrackColoringCard(mapActivity, selectedGpxFile, trackDrawInfo);
addCard(container, trackColoringCard);
setupColorsCard(container);
GPXTrackAnalysis analysis = selectedGpxFile.getTrackAnalysis(app);
ColoringType coloringType = trackDrawInfo.getColoringType();
coloringTypeCard = new ColoringTypeCard(mapActivity, analysis, coloringType);
addCard(container, coloringTypeCard);
promoCard = new PromoBannerCard(mapActivity, true);
addCard(container, promoCard);
trackWidthCard = new TrackWidthCard(mapActivity, trackDrawInfo, new OnNeedScrollListener() {
@Override
public void onVerticalScrollNeeded(int y) {
View view = trackWidthCard.getView();
if (view != null) {
int resultYPosition = view.getTop() + y;
int dialogHeight = getInnerScrollableHeight();
ScrollView scrollView = (ScrollView) getBottomScrollView();
if (resultYPosition > (scrollView.getScrollY() + dialogHeight)) {
scrollView.smoothScrollTo(0, resultYPosition - dialogHeight);
}
}
}
});
addCard(container, trackWidthCard);
addCard(container, new ActionsCard(mapActivity));
updatePromoCardVisibility();
}
}
use of net.osmand.plus.chooseplan.PromoBannerCard 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