StyleSpan
Stay organized with collections
Save and categorize content based on your preferences.
Describes the style for some region of a polyline.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Constructor Summary
* |
StyleSpan
( StrokeStyle
style, double segments) Creates a span with the given style
and length in number of
segments.
|
* |
|
* |
StyleSpan
(int color) Creates a solid color span of length one segment.
|
* |
StyleSpan
(int color, double segments) Creates a solid color span with a given number of segments.
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Public Constructors
public
StyleSpan
( StrokeStyle
style, double segments)
Creates a span with the given style
and length in number of
segments.
Parameters
public
StyleSpan
( StrokeStyle
style)
Creates a span with the given style
of length one segment.
Parameters
style
the style of this span.
public
StyleSpan
(int color)
Creates a solid color span of length one segment.
Parameters
color
the color of this span.
public
StyleSpan
(int color, double
segments)
Creates a solid color span with a given number of segments.
Parameters
Public Methods
public double
getSegments
()
Gets the length of this span in number of segments.
Gets the style of this span.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eStyleSpan\u003c/code\u003e describes the styling (color, pattern, etc.) of a section of a polyline on a map.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003eStyleSpan\u003c/code\u003e with a specific \u003ccode\u003eStrokeStyle\u003c/code\u003e and length, or with just a color and length.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eStyleSpan\u003c/code\u003e allows you to control the appearance of individual sections of a polyline for visual customization.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the style and length of a \u003ccode\u003eStyleSpan\u003c/code\u003e using the \u003ccode\u003egetStyle()\u003c/code\u003e and \u003ccode\u003egetSegments()\u003c/code\u003e methods.\u003c/p\u003e\n"]]],[],null,["# StyleSpan\n\npublic final class **StyleSpan** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nDescribes the style for some region of a polyline. \n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Constructor Summary\n\n|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [StyleSpan](/android/reference/com/google/android/gms/maps/model/StyleSpan#StyleSpan(com.google.android.gms.maps.model.StrokeStyle,%20double))([StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle) style, double segments) Creates a span with the given `style` and length in number of segments. |\n| | [StyleSpan](/android/reference/com/google/android/gms/maps/model/StyleSpan#StyleSpan(com.google.android.gms.maps.model.StrokeStyle))([StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle) style) Creates a span with the given `style` of length one segment. |\n| | [StyleSpan](/android/reference/com/google/android/gms/maps/model/StyleSpan#StyleSpan(int))(int color) Creates a solid color span of length one segment. |\n| | [StyleSpan](/android/reference/com/google/android/gms/maps/model/StyleSpan#StyleSpan(int,%20double))(int color, double segments) Creates a solid color span with a given number of segments. |\n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| double | [getSegments](/android/reference/com/google/android/gms/maps/model/StyleSpan#getSegments())() Gets the length of this span in number of segments. |\n| [StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle) | [getStyle](/android/reference/com/google/android/gms/maps/model/StyleSpan#getStyle())() Gets the style of this span. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nPublic Constructors\n-------------------\n\n#### public **StyleSpan** ([StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle) style, double segments)\n\nCreates a span with the given `style` and length in number of\nsegments. \n\n##### Parameters\n\n| style | the style of this span. |\n| segments | the length of this span in number of segments. |\n|----------|------------------------------------------------|\n\n#### public **StyleSpan** ([StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle) style)\n\nCreates a span with the given `style` of length one segment. \n\n##### Parameters\n\n| style | the style of this span. |\n|-------|-------------------------|\n\n#### public **StyleSpan** (int color)\n\nCreates a solid color span of length one segment. \n\n##### Parameters\n\n| color | the color of this span. |\n|-------|-------------------------|\n\n#### public **StyleSpan** (int color, double segments)\n\nCreates a solid color span with a given number of segments. \n\n##### Parameters\n\n| color | the color of this span. |\n| segments | the length of this span in number of segments. |\n|----------|------------------------------------------------|\n\nPublic Methods\n--------------\n\n#### public double **getSegments** ()\n\nGets the length of this span in number of segments. \n\n#### public [StrokeStyle](/android/reference/com/google/android/gms/maps/model/StrokeStyle)\n**getStyle** ()\n\nGets the style of this span."]]