com.google.android.gms.maps.model.Cap Java Examples

The following examples show how to use com.google.android.gms.maps.model.Cap. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 6 votes vote down vote up
/**
 * Convert the list of latitude and longitude to the polyline options in transit mode.
 *
 * @param context      A context.
 * @param stepList     A list of latitude and longitude for the steps.
 * @param transitWidth Width of the polyline in screen pixels for transit polyline.
 * @param transitColor Color of the polyline as a 32-bit ARGB color for transit polyline.
 * @param walkingWidth Width of the polyline in screen pixels for walking polyline.
 * @param walkingColor Color of the polyline as a 32-bit ARGB color for walking polyline.
 * @param clickable    Is polyline clickable.
 * @param startCap     Cap at the start vertex of the polyline.
 * @param endCap       Cap at the end vertex of the polyline.
 * @return Options for a polyline.
 * @since 1.2.0
 */
public static ArrayList<PolylineOptions> createTransitPolyline(
        @NonNull Context context,
        @Nullable List<Step> stepList,
        @Dimension(unit = Dimension.DP) int transitWidth,
        @ColorInt int transitColor,
        @Dimension(unit = Dimension.DP) int walkingWidth,
        @ColorInt int walkingColor,
        boolean clickable,
        @Nullable Cap startCap,
        @Nullable Cap endCap) {
    return createTransitPolyline(
            context,
            stepList,
            transitWidth,
            transitColor,
            null,
            walkingWidth,
            walkingColor,
            null,
            clickable,
            JointType.DEFAULT,
            startCap,
            endCap
    );
}
 
Example #2
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 6 votes vote down vote up
/**
 * Convert the list of latitude and longitude to the polyline options.
 *
 * @param context      A context.
 * @param locationList A list of latitude and longitude.
 * @param width        Width of the polyline in screen pixels.
 * @param color        Color of the polyline as a 32-bit ARGB color.
 * @param clickable    Is polyline clickable.
 * @param startCap     Cap at the start vertex of the polyline.
 * @param endCap       Cap at the end vertex of the polyline.
 * @return Options for a polyline.
 * @since 1.2.0
 */
public static PolylineOptions createPolyline(
        @NonNull Context context,
        @Nullable ArrayList<LatLng> locationList,
        @Dimension(unit = Dimension.DP) int width,
        @ColorInt int color,
        boolean clickable,
        @Nullable Cap startCap,
        @Nullable Cap endCap
) {
    return createPolyline(
            context,
            locationList,
            width,
            color,
            clickable,
            JointType.DEFAULT,
            startCap,
            endCap,
            null
    );
}
 
Example #3
Source File: PolylineDemoActivity.java    From android-samples with Apache License 2.0 5 votes vote down vote up
private Cap getSelectedCap(int pos) {
    switch (CAP_TYPE_NAME_RESOURCE_IDS[pos]) {
        case R.string.cap_butt:
            return new ButtCap();
        case R.string.cap_square:
            return new SquareCap();
        case R.string.cap_round:
            return new RoundCap();
        case R.string.cap_image:
            return new CustomCap(
                    BitmapDescriptorFactory.fromResource(R.drawable.chevron),
                    CUSTOM_CAP_IMAGE_REF_WIDTH_PX);
    }
    return null;
}
 
Example #4
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 5 votes vote down vote up
/**
 * Convert the list of latitude and longitude to the polyline options.
 *
 * @param context         A context.
 * @param locationList    A list of latitude and longitude.
 * @param width           Width of the polyline in screen pixels.
 * @param color           Color of the polyline as a 32-bit ARGB color.
 * @param clickable       Is polyline clickable.
 * @param jointType       Joint type for all vertices of the polyline except the start and end vertices.
 * @param startCap        Cap at the start vertex of the polyline.
 * @param endCap          Cap at the end vertex of the polyline.
 * @param patternItemList Stroke pattern for the polyline.
 * @return Options for a polyline.
 * @since 1.2.0
 */
public static PolylineOptions createPolyline(
        @NonNull Context context,
        @Nullable ArrayList<LatLng> locationList,
        @Dimension(unit = Dimension.DP) int width,
        @ColorInt int color,
        boolean clickable,
        int jointType,
        @Nullable Cap startCap,
        @Nullable Cap endCap,
        @Nullable List<PatternItem> patternItemList) {
    PolylineOptions rectLine = new PolylineOptions().width(dpToPx(context, width)).color(color).geodesic(true);
    rectLine.clickable(clickable);
    rectLine.jointType(jointType);
    if (patternItemList != null) {
        rectLine.pattern(patternItemList);
    }
    if (startCap != null) {
        rectLine.startCap(startCap);
    }
    if (endCap != null) {
        rectLine.endCap(endCap);
    }
    if (locationList != null && locationList.size() > 0) {
        for (LatLng location : locationList) {
            rectLine.add(location);
        }
    }
    return rectLine;
}
 
Example #5
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
public TransitPathOption setEndCap(@Nullable Cap endCap) {
    this.endCap = endCap;
    return this;
}
 
Example #6
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
public TransitPathOption setStartCap(@Nullable Cap startCap) {
    this.startCap = startCap;
    return this;
}
 
Example #7
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
@Nullable
public Cap getStartCap() {
    return startCap;
}
 
Example #8
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
public PathOption setEndCap(Cap endCap) {
    this.endCap = endCap;
    return this;
}
 
Example #9
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
public Cap getEndCap() {
    return endCap;
}
 
Example #10
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
public PathOption setStartCap(Cap startCap) {
    this.startCap = startCap;
    return this;
}
 
Example #11
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
public Cap getStartCap() {
    return startCap;
}
 
Example #12
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
/**
 * Convert the list of latitude and longitude to the polyline options in transit mode.
 *
 * @param context                A context.
 * @param stepList               A list of latitude and longitude for the steps.
 * @param transitWidth           Width of the polyline in screen pixels for transit polyline.
 * @param transitColor           Color of the polyline as a 32-bit ARGB color for transit polyline.
 * @param transitPatternItemList Stroke pattern for the polyline for transit polyline.
 * @param walkingWidth           Width of the polyline in screen pixels for walking polyline.
 * @param walkingColor           Color of the polyline as a 32-bit ARGB color for walking polyline.
 * @param walkingPatternItemList Stroke pattern for the polyline for walking polyline.
 * @param clickable              Is polyline clickable.
 * @param jointType              Joint type for all vertices of the polyline except the start and end vertices.
 * @param startCap               Cap at the start vertex of the polyline.
 * @param endCap                 Cap at the end vertex of the polyline.
 * @return Options for a polyline.
 * @since 1.2.0
 */
public static ArrayList<PolylineOptions> createTransitPolyline(
        @NonNull Context context,
        @Nullable List<Step> stepList,
        @Dimension(unit = Dimension.DP) int transitWidth,
        @ColorInt int transitColor,
        @Nullable List<PatternItem> transitPatternItemList,
        @Dimension(unit = Dimension.DP) int walkingWidth,
        @ColorInt int walkingColor,
        @Nullable List<PatternItem> walkingPatternItemList,
        boolean clickable,
        int jointType,
        @Nullable Cap startCap,
        @Nullable Cap endCap
) {
    ArrayList<PolylineOptions> polylineOptionsList = new ArrayList<>();
    if (stepList != null && stepList.size() > 0) {
        for (Step step : stepList) {
            ArrayList<LatLng> directionPointList = new ArrayList<>();
            convertStepToPosition(step, directionPointList);
            if (step.isContainStepList()) {
                polylineOptionsList.add(createPolyline(
                        context,
                        directionPointList,
                        walkingWidth,
                        walkingColor,
                        clickable,
                        jointType,
                        startCap,
                        endCap,
                        walkingPatternItemList
                ));
            } else {
                polylineOptionsList.add(createPolyline(
                        context,
                        directionPointList,
                        transitWidth,
                        transitColor,
                        clickable,
                        jointType,
                        startCap,
                        endCap,
                        transitPatternItemList
                ));
            }
        }
    }
    return polylineOptionsList;
}
 
Example #13
Source File: DirectionConverter.java    From GoogleDirectionLibrary with Apache License 2.0 4 votes vote down vote up
@Nullable
public Cap getEndCap() {
    return endCap;
}
 
Example #14
Source File: DelegatingCurve.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
@Override
public Cap getEndCap() {
    return polyline.getEndCap();
}
 
Example #15
Source File: CurveOptions.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
public CurveOptions startCap(Cap cap) {
    real.startCap(cap);
    return this;
}
 
Example #16
Source File: CurveOptions.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
public Cap getStartCap() {
    return real.getStartCap();
}
 
Example #17
Source File: CurveOptions.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
public Cap getEndCap() {
    return real.getEndCap();
}
 
Example #18
Source File: CurveOptions.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
public CurveOptions endCap(Cap cap) {
    real.endCap(cap);
    return this;
}
 
Example #19
Source File: DelegatingCurve.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
@Override
public void setStartCap(Cap startCap) {
    polyline.setStartCap(startCap);
}
 
Example #20
Source File: DelegatingCurve.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
@Override
public void setEndCap(Cap endCap) {
    polyline.setEndCap(endCap);
}
 
Example #21
Source File: DelegatingCurve.java    From Curve-Fit with Apache License 2.0 4 votes vote down vote up
@Override
public Cap getStartCap() {
    return polyline.getStartCap();
}
 
Example #22
Source File: Curve.java    From Curve-Fit with Apache License 2.0 votes vote down vote up
Cap getEndCap(); 
Example #23
Source File: Curve.java    From Curve-Fit with Apache License 2.0 votes vote down vote up
Cap getStartCap(); 
Example #24
Source File: Curve.java    From Curve-Fit with Apache License 2.0 votes vote down vote up
void setEndCap(Cap endCap); 
Example #25
Source File: Curve.java    From Curve-Fit with Apache License 2.0 votes vote down vote up
void setStartCap(Cap startCap);