正在查看: Mitra Bukalapak v2.55.0 应用的 AutocompleteActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mitra Bukalapak v2.55.0 应用的 AutocompleteActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.google.android.libraries.places.widget;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import androidx.appcompat.app.c;
import com.google.android.gms.common.api.Status;
import com.google.android.libraries.places.R;
import com.google.android.libraries.places.api.Places;
import com.google.android.libraries.places.api.model.Place;
import com.google.android.libraries.places.api.net.PlacesStatusCodes;
import com.google.android.libraries.places.internal.zzdm;
import com.google.android.libraries.places.internal.zzdz;
import com.google.android.libraries.places.internal.zzfp;
import com.google.android.libraries.places.widget.internal.ui.AutocompleteImplFragment;
import com.google.android.libraries.places.widget.listener.PlaceSelectionListener;
public class AutocompleteActivity extends c implements PlaceSelectionListener {
public static final int RESULT_ERROR = 2;
private static boolean zzc = true;
private int zza;
private int zzb;
public AutocompleteActivity() {
super(R.layout.places_autocomplete_activity);
}
private final void zza(int i, Place place, Status status) {
try {
Intent intent = new Intent();
if (place != null) {
intent.putExtra("places/selected_place", place);
}
intent.putExtra("places/status", status);
setResult(i, intent);
finish();
} catch (Error e) {
e = e;
zzdm.zza(e);
throw e;
} catch (RuntimeException e2) {
e = e2;
zzdm.zza(e);
throw e;
}
}
@SuppressLint({"MissingSuperCall"})
public void onCreate(Bundle bundle) {
try {
zzfp.zzb(Places.isInitialized(), "Places must be initialized.");
if (zzc) {
zzfp.zzb(getCallingActivity() != null, "Cannot find caller. startActivityForResult should be used.");
}
zzdz zzdzVar = (zzdz) zzfp.zza((zzdz) getIntent().getParcelableExtra("places/AutocompleteOptions"));
int i = zza.zza[zzdzVar.zza().ordinal()];
if (i == 1) {
this.zza = R.layout.places_autocomplete_impl_fragment_overlay;
this.zzb = R.style.PlacesAutocompleteOverlay;
} else if (i == 2) {
this.zza = R.layout.places_autocomplete_impl_fragment_fullscreen;
this.zzb = R.style.PlacesAutocompleteFullscreen;
}
getSupportFragmentManager().w1(new AutocompleteImplFragment.zzb(this.zza, this, zzdzVar));
setTheme(this.zzb);
super.onCreate(bundle);
final AutocompleteImplFragment autocompleteImplFragment = (AutocompleteImplFragment) getSupportFragmentManager().i0(R.id.places_autocomplete_content);
autocompleteImplFragment.zza(this);
findViewById(android.R.id.content).setOnTouchListener(new View.OnTouchListener(this, autocompleteImplFragment) {
private final AutocompleteActivity zza;
private final AutocompleteImplFragment zzb;
{
this.zza = this;
this.zzb = autocompleteImplFragment;
}
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
return this.zza.zza(this.zzb, view, motionEvent);
}
});
if (zzdzVar.zzb().isEmpty()) {
zza(2, (Place) null, new Status(PlacesStatusCodes.INVALID_REQUEST, "Place Fields must not be empty."));
}
} catch (Error e) {
e = e;
zzdm.zza(e);
throw e;
} catch (RuntimeException e2) {
e = e2;
zzdm.zza(e);
throw e;
}
}
@Override
public void onError(Status status) {
zza(status.X0() ? 0 : 2, (Place) null, status);
}
@Override
public void onPlaceSelected(Place place) {
zza(-1, place, Status.f);
}
final boolean zza(AutocompleteImplFragment autocompleteImplFragment, View view, MotionEvent motionEvent) {
if (autocompleteImplFragment.getView() == null || motionEvent.getY() <= r1.getBottom()) {
return false;
}
zza(0, (Place) null, new Status(16));
return true;
}
}