90 lines
3.3 KiB
Java
90 lines
3.3 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.safeparcel.AbstractSafeParcelable;
|
||
|
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public class StreetViewPanoramaOrientation extends AbstractSafeParcelable {
|
||
|
public static final Parcelable.Creator<StreetViewPanoramaOrientation> CREATOR = new zzp();
|
||
|
public final float bearing;
|
||
|
public final float tilt;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public static final class Builder {
|
||
|
public float bearing;
|
||
|
public float tilt;
|
||
|
|
||
|
public Builder() {
|
||
|
}
|
||
|
|
||
|
public Builder(StreetViewPanoramaOrientation streetViewPanoramaOrientation) {
|
||
|
Preconditions.checkNotNull(streetViewPanoramaOrientation, "StreetViewPanoramaOrientation");
|
||
|
this.bearing = streetViewPanoramaOrientation.bearing;
|
||
|
this.tilt = streetViewPanoramaOrientation.tilt;
|
||
|
}
|
||
|
|
||
|
public final StreetViewPanoramaOrientation build() {
|
||
|
return new StreetViewPanoramaOrientation(this.tilt, this.bearing);
|
||
|
}
|
||
|
|
||
|
public final Builder tilt(float f) {
|
||
|
this.tilt = f;
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public final Builder bearing(float f) {
|
||
|
this.bearing = f;
|
||
|
return this;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public StreetViewPanoramaOrientation(float f, float f2) {
|
||
|
boolean z = -90.0f <= f && f <= 90.0f;
|
||
|
StringBuilder sb = new StringBuilder(62);
|
||
|
sb.append("Tilt needs to be between -90 and 90 inclusive: ");
|
||
|
sb.append(f);
|
||
|
Preconditions.checkArgument(z, sb.toString());
|
||
|
this.tilt = f + BitmapDescriptorFactory.HUE_RED;
|
||
|
this.bearing = (((double) f2) <= 0.0d ? (f2 % 360.0f) + 360.0f : f2) % 360.0f;
|
||
|
}
|
||
|
|
||
|
@Override // android.os.Parcelable
|
||
|
public void writeToParcel(Parcel parcel, int i) {
|
||
|
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||
|
SafeParcelWriter.writeFloat(parcel, 2, this.tilt);
|
||
|
SafeParcelWriter.writeFloat(parcel, 3, this.bearing);
|
||
|
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
|
||
|
}
|
||
|
|
||
|
public static Builder builder() {
|
||
|
return new Builder();
|
||
|
}
|
||
|
|
||
|
public static Builder builder(StreetViewPanoramaOrientation streetViewPanoramaOrientation) {
|
||
|
return new Builder(streetViewPanoramaOrientation);
|
||
|
}
|
||
|
|
||
|
public int hashCode() {
|
||
|
return Objects.hashCode(Float.valueOf(this.tilt), Float.valueOf(this.bearing));
|
||
|
}
|
||
|
|
||
|
public boolean equals(Object obj) {
|
||
|
if (this == obj) {
|
||
|
return true;
|
||
|
}
|
||
|
if (!(obj instanceof StreetViewPanoramaOrientation)) {
|
||
|
return false;
|
||
|
}
|
||
|
StreetViewPanoramaOrientation streetViewPanoramaOrientation = (StreetViewPanoramaOrientation) obj;
|
||
|
return Float.floatToIntBits(this.tilt) == Float.floatToIntBits(streetViewPanoramaOrientation.tilt) && Float.floatToIntBits(this.bearing) == Float.floatToIntBits(streetViewPanoramaOrientation.bearing);
|
||
|
}
|
||
|
|
||
|
public String toString() {
|
||
|
return Objects.toStringHelper(this).add("tilt", Float.valueOf(this.tilt)).add("bearing", Float.valueOf(this.bearing)).toString();
|
||
|
}
|
||
|
}
|