329 lines
12 KiB
Java
329 lines
12 KiB
Java
package com.google.android.gms.maps;
|
|
|
|
import android.app.Activity;
|
|
import android.app.Fragment;
|
|
import android.os.Bundle;
|
|
import android.os.RemoteException;
|
|
import android.os.StrictMode;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
|
|
import com.google.android.gms.common.internal.Preconditions;
|
|
import com.google.android.gms.dynamic.DeferredLifecycleHelper;
|
|
import com.google.android.gms.dynamic.IObjectWrapper;
|
|
import com.google.android.gms.dynamic.ObjectWrapper;
|
|
import com.google.android.gms.dynamic.OnDelegateCreatedListener;
|
|
import com.google.android.gms.maps.internal.IStreetViewPanoramaFragmentDelegate;
|
|
import com.google.android.gms.maps.internal.StreetViewLifecycleDelegate;
|
|
import com.google.android.gms.maps.internal.zzby;
|
|
import com.google.android.gms.maps.internal.zzbz;
|
|
import com.google.android.gms.maps.model.RuntimeRemoteException;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class StreetViewPanoramaFragment extends Fragment {
|
|
private final zzb zzbt = new zzb(this);
|
|
|
|
public static StreetViewPanoramaFragment newInstance() {
|
|
return new StreetViewPanoramaFragment();
|
|
}
|
|
|
|
public static StreetViewPanoramaFragment newInstance(StreetViewPanoramaOptions streetViewPanoramaOptions) {
|
|
StreetViewPanoramaFragment streetViewPanoramaFragment = new StreetViewPanoramaFragment();
|
|
Bundle bundle = new Bundle();
|
|
bundle.putParcelable("StreetViewPanoramaOptions", streetViewPanoramaOptions);
|
|
streetViewPanoramaFragment.setArguments(bundle);
|
|
return streetViewPanoramaFragment;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public static final class zza implements StreetViewLifecycleDelegate {
|
|
private final Fragment zzba;
|
|
private final IStreetViewPanoramaFragmentDelegate zzbu;
|
|
|
|
public zza(Fragment fragment, IStreetViewPanoramaFragmentDelegate iStreetViewPanoramaFragmentDelegate) {
|
|
this.zzbu = (IStreetViewPanoramaFragmentDelegate) Preconditions.checkNotNull(iStreetViewPanoramaFragmentDelegate);
|
|
this.zzba = (Fragment) Preconditions.checkNotNull(fragment);
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onInflate(Activity activity, Bundle bundle, Bundle bundle2) {
|
|
try {
|
|
Bundle bundle3 = new Bundle();
|
|
zzby.zza(bundle2, bundle3);
|
|
this.zzbu.onInflate(ObjectWrapper.wrap(activity), null, bundle3);
|
|
zzby.zza(bundle3, bundle2);
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onCreate(Bundle bundle) {
|
|
try {
|
|
Bundle bundle2 = new Bundle();
|
|
zzby.zza(bundle, bundle2);
|
|
Bundle arguments = this.zzba.getArguments();
|
|
if (arguments != null && arguments.containsKey("StreetViewPanoramaOptions")) {
|
|
zzby.zza(bundle2, "StreetViewPanoramaOptions", arguments.getParcelable("StreetViewPanoramaOptions"));
|
|
}
|
|
this.zzbu.onCreate(bundle2);
|
|
zzby.zza(bundle2, bundle);
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
try {
|
|
Bundle bundle2 = new Bundle();
|
|
zzby.zza(bundle, bundle2);
|
|
IObjectWrapper onCreateView = this.zzbu.onCreateView(ObjectWrapper.wrap(layoutInflater), ObjectWrapper.wrap(viewGroup), bundle2);
|
|
zzby.zza(bundle2, bundle);
|
|
return (View) ObjectWrapper.unwrap(onCreateView);
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onStart() {
|
|
try {
|
|
this.zzbu.onStart();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onResume() {
|
|
try {
|
|
this.zzbu.onResume();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onPause() {
|
|
try {
|
|
this.zzbu.onPause();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onStop() {
|
|
try {
|
|
this.zzbu.onStop();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onDestroyView() {
|
|
try {
|
|
this.zzbu.onDestroyView();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onDestroy() {
|
|
try {
|
|
this.zzbu.onDestroy();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onLowMemory() {
|
|
try {
|
|
this.zzbu.onLowMemory();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.LifecycleDelegate
|
|
public final void onSaveInstanceState(Bundle bundle) {
|
|
try {
|
|
Bundle bundle2 = new Bundle();
|
|
zzby.zza(bundle, bundle2);
|
|
this.zzbu.onSaveInstanceState(bundle2);
|
|
zzby.zza(bundle2, bundle);
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.maps.internal.StreetViewLifecycleDelegate
|
|
public final void getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback onStreetViewPanoramaReadyCallback) {
|
|
try {
|
|
this.zzbu.getStreetViewPanoramaAsync(new zzah(this, onStreetViewPanoramaReadyCallback));
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* loaded from: classes2.dex */
|
|
static final class zzb extends DeferredLifecycleHelper<zza> {
|
|
private final Fragment zzba;
|
|
private OnDelegateCreatedListener<zza> zzbd;
|
|
private Activity zzbe;
|
|
private final List<OnStreetViewPanoramaReadyCallback> zzbw = new ArrayList();
|
|
|
|
zzb(Fragment fragment) {
|
|
this.zzba = fragment;
|
|
}
|
|
|
|
@Override // com.google.android.gms.dynamic.DeferredLifecycleHelper
|
|
public final void createDelegate(OnDelegateCreatedListener<zza> onDelegateCreatedListener) {
|
|
this.zzbd = onDelegateCreatedListener;
|
|
zzd();
|
|
}
|
|
|
|
private final void zzd() {
|
|
if (this.zzbe == null || this.zzbd == null || getDelegate() != null) {
|
|
return;
|
|
}
|
|
try {
|
|
MapsInitializer.initialize(this.zzbe);
|
|
this.zzbd.onDelegateCreated(new zza(this.zzba, zzbz.zza(this.zzbe).zzd(ObjectWrapper.wrap(this.zzbe))));
|
|
Iterator<OnStreetViewPanoramaReadyCallback> it = this.zzbw.iterator();
|
|
while (it.hasNext()) {
|
|
getDelegate().getStreetViewPanoramaAsync(it.next());
|
|
}
|
|
this.zzbw.clear();
|
|
} catch (RemoteException e) {
|
|
throw new RuntimeRemoteException(e);
|
|
} catch (GooglePlayServicesNotAvailableException unused) {
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public final void setActivity(Activity activity) {
|
|
this.zzbe = activity;
|
|
zzd();
|
|
}
|
|
|
|
public final void getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback onStreetViewPanoramaReadyCallback) {
|
|
if (getDelegate() != null) {
|
|
getDelegate().getStreetViewPanoramaAsync(onStreetViewPanoramaReadyCallback);
|
|
} else {
|
|
this.zzbw.add(onStreetViewPanoramaReadyCallback);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onAttach(Activity activity) {
|
|
super.onAttach(activity);
|
|
this.zzbt.setActivity(activity);
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onInflate(Activity activity, AttributeSet attributeSet, Bundle bundle) {
|
|
StrictMode.ThreadPolicy threadPolicy = StrictMode.getThreadPolicy();
|
|
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(threadPolicy).permitAll().build());
|
|
try {
|
|
super.onInflate(activity, attributeSet, bundle);
|
|
this.zzbt.setActivity(activity);
|
|
this.zzbt.onInflate(activity, new Bundle(), bundle);
|
|
} finally {
|
|
StrictMode.setThreadPolicy(threadPolicy);
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
this.zzbt.onCreate(bundle);
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
return this.zzbt.onCreateView(layoutInflater, viewGroup, bundle);
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onStart() {
|
|
super.onStart();
|
|
this.zzbt.onStart();
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onResume() {
|
|
super.onResume();
|
|
this.zzbt.onResume();
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onPause() {
|
|
this.zzbt.onPause();
|
|
super.onPause();
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onStop() {
|
|
this.zzbt.onStop();
|
|
super.onStop();
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onDestroyView() {
|
|
this.zzbt.onDestroyView();
|
|
super.onDestroyView();
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onDestroy() {
|
|
this.zzbt.onDestroy();
|
|
super.onDestroy();
|
|
}
|
|
|
|
@Override // android.app.Fragment, android.content.ComponentCallbacks
|
|
public void onLowMemory() {
|
|
this.zzbt.onLowMemory();
|
|
super.onLowMemory();
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onActivityCreated(Bundle bundle) {
|
|
if (bundle != null) {
|
|
bundle.setClassLoader(StreetViewPanoramaFragment.class.getClassLoader());
|
|
}
|
|
super.onActivityCreated(bundle);
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void onSaveInstanceState(Bundle bundle) {
|
|
if (bundle != null) {
|
|
bundle.setClassLoader(StreetViewPanoramaFragment.class.getClassLoader());
|
|
}
|
|
super.onSaveInstanceState(bundle);
|
|
this.zzbt.onSaveInstanceState(bundle);
|
|
}
|
|
|
|
@Override // android.app.Fragment
|
|
public void setArguments(Bundle bundle) {
|
|
super.setArguments(bundle);
|
|
}
|
|
|
|
public void getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback onStreetViewPanoramaReadyCallback) {
|
|
Preconditions.checkMainThread("getStreetViewPanoramaAsync() must be called on the main thread");
|
|
this.zzbt.getStreetViewPanoramaAsync(onStreetViewPanoramaReadyCallback);
|
|
}
|
|
}
|