119 lines
4.7 KiB
Java
119 lines
4.7 KiB
Java
package com.google.android.gms.maps.model;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import com.google.android.gms.common.internal.Objects;
|
|
import com.google.android.gms.common.internal.Preconditions;
|
|
import com.google.android.gms.common.internal.ReflectedParcelable;
|
|
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
|
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
|
import com.google.android.gms.maps.model.StreetViewPanoramaOrientation;
|
|
|
|
/* JADX INFO: compiled from: com.google.android.gms:play-services-maps@@19.0.0 */
|
|
/* JADX INFO: loaded from: classes2.dex */
|
|
public class StreetViewPanoramaCamera extends AbstractSafeParcelable implements ReflectedParcelable {
|
|
public static final Parcelable.Creator<StreetViewPanoramaCamera> CREATOR = new zzx();
|
|
public final float bearing;
|
|
public final float tilt;
|
|
public final float zoom;
|
|
private final StreetViewPanoramaOrientation zza;
|
|
|
|
/* JADX INFO: compiled from: com.google.android.gms:play-services-maps@@19.0.0 */
|
|
public static final class Builder {
|
|
public float bearing;
|
|
public float tilt;
|
|
public float zoom;
|
|
|
|
public Builder() {
|
|
}
|
|
|
|
public Builder(StreetViewPanoramaCamera streetViewPanoramaCamera) {
|
|
Preconditions.checkNotNull(streetViewPanoramaCamera, "StreetViewPanoramaCamera must not be null.");
|
|
this.zoom = streetViewPanoramaCamera.zoom;
|
|
this.bearing = streetViewPanoramaCamera.bearing;
|
|
this.tilt = streetViewPanoramaCamera.tilt;
|
|
}
|
|
|
|
public Builder bearing(float f) {
|
|
this.bearing = f;
|
|
return this;
|
|
}
|
|
|
|
public StreetViewPanoramaCamera build() {
|
|
return new StreetViewPanoramaCamera(this.zoom, this.tilt, this.bearing);
|
|
}
|
|
|
|
public Builder orientation(StreetViewPanoramaOrientation streetViewPanoramaOrientation) {
|
|
Preconditions.checkNotNull(streetViewPanoramaOrientation, "orientation must not be null.");
|
|
this.tilt = streetViewPanoramaOrientation.tilt;
|
|
this.bearing = streetViewPanoramaOrientation.bearing;
|
|
return this;
|
|
}
|
|
|
|
public Builder tilt(float f) {
|
|
this.tilt = f;
|
|
return this;
|
|
}
|
|
|
|
public Builder zoom(float f) {
|
|
this.zoom = f;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
public StreetViewPanoramaCamera(float f, float f2, float f3) {
|
|
boolean z = false;
|
|
if (f2 >= -90.0f && f2 <= 90.0f) {
|
|
z = true;
|
|
}
|
|
Preconditions.checkArgument(z, "Tilt needs to be between -90 and 90 inclusive: " + f2);
|
|
this.zoom = ((double) f) <= 0.0d ? 0.0f : f;
|
|
this.tilt = 0.0f + f2;
|
|
this.bearing = (((double) f3) <= 0.0d ? (f3 % 360.0f) + 360.0f : f3) % 360.0f;
|
|
StreetViewPanoramaOrientation.Builder builder = new StreetViewPanoramaOrientation.Builder();
|
|
builder.tilt(f2);
|
|
builder.bearing(f3);
|
|
this.zza = builder.build();
|
|
}
|
|
|
|
public static Builder builder() {
|
|
return new Builder();
|
|
}
|
|
|
|
public static Builder builder(StreetViewPanoramaCamera streetViewPanoramaCamera) {
|
|
return new Builder(streetViewPanoramaCamera);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof StreetViewPanoramaCamera)) {
|
|
return false;
|
|
}
|
|
StreetViewPanoramaCamera streetViewPanoramaCamera = (StreetViewPanoramaCamera) obj;
|
|
return Float.floatToIntBits(this.zoom) == Float.floatToIntBits(streetViewPanoramaCamera.zoom) && Float.floatToIntBits(this.tilt) == Float.floatToIntBits(streetViewPanoramaCamera.tilt) && Float.floatToIntBits(this.bearing) == Float.floatToIntBits(streetViewPanoramaCamera.bearing);
|
|
}
|
|
|
|
public StreetViewPanoramaOrientation getOrientation() {
|
|
return this.zza;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Objects.hashCode(Float.valueOf(this.zoom), Float.valueOf(this.tilt), Float.valueOf(this.bearing));
|
|
}
|
|
|
|
public String toString() {
|
|
return Objects.toStringHelper(this).add("zoom", Float.valueOf(this.zoom)).add("tilt", Float.valueOf(this.tilt)).add("bearing", Float.valueOf(this.bearing)).toString();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
float f = this.zoom;
|
|
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
|
SafeParcelWriter.writeFloat(parcel, 2, f);
|
|
SafeParcelWriter.writeFloat(parcel, 3, this.tilt);
|
|
SafeParcelWriter.writeFloat(parcel, 4, this.bearing);
|
|
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
|
}
|
|
} |