57 lines
1.9 KiB
Java
57 lines
1.9 KiB
Java
package com.google.android.gms.maps.model;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
|
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
|
|
|
/* JADX INFO: compiled from: com.google.android.gms:play-services-maps@@19.0.0 */
|
|
/* JADX INFO: loaded from: classes2.dex */
|
|
public final class StyleSpan extends AbstractSafeParcelable {
|
|
public static final Parcelable.Creator<StyleSpan> CREATOR = new zzae();
|
|
private final StrokeStyle zza;
|
|
private final double zzb;
|
|
|
|
public StyleSpan(int i) {
|
|
this.zza = StrokeStyle.colorBuilder(i).build();
|
|
this.zzb = 1.0d;
|
|
}
|
|
|
|
public double getSegments() {
|
|
return this.zzb;
|
|
}
|
|
|
|
public StrokeStyle getStyle() {
|
|
return this.zza;
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public final void writeToParcel(Parcel parcel, int i) {
|
|
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
|
SafeParcelWriter.writeParcelable(parcel, 2, getStyle(), i, false);
|
|
SafeParcelWriter.writeDouble(parcel, 3, getSegments());
|
|
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
|
}
|
|
|
|
public StyleSpan(int i, double d) {
|
|
if (d <= 0.0d) {
|
|
throw new IllegalArgumentException("A style must be applied to some segments on a polyline.");
|
|
}
|
|
this.zza = StrokeStyle.colorBuilder(i).build();
|
|
this.zzb = d;
|
|
}
|
|
|
|
public StyleSpan(StrokeStyle strokeStyle) {
|
|
this.zza = strokeStyle;
|
|
this.zzb = 1.0d;
|
|
}
|
|
|
|
public StyleSpan(StrokeStyle strokeStyle, double d) {
|
|
if (d > 0.0d) {
|
|
this.zza = strokeStyle;
|
|
this.zzb = d;
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException("A style must be applied to some segments on a polyline.");
|
|
}
|
|
} |