正在查看: BodyTech v7.6.4 应用的 AutocompleteActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: BodyTech v7.6.4 应用的 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.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.annotation.RecentlyNonNull;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AppCompatActivity;
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.zzgt;
import com.google.android.libraries.places.internal.zzhj;
import com.google.android.libraries.places.internal.zziy;
import com.google.android.libraries.places.widget.internal.ui.AutocompleteImplFragment;
import com.google.android.libraries.places.widget.listener.PlaceSelectionListener;
import com.google.android.libraries.places.widget.model.AutocompleteActivityMode;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
@Instrumented
public class AutocompleteActivity extends AppCompatActivity implements PlaceSelectionListener, TraceFieldInterface {
public static final int RESULT_ERROR = 2;
public Trace _nr_trace;
@LayoutRes
private int zza;
@StyleRes
private int zzb;
private boolean zzc;
public AutocompleteActivity() {
super(R.layout.places_autocomplete_activity);
this.zzc = false;
}
private final void zzc(int i, @Nullable 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;
zzgt.zzb(e);
throw e;
} catch (RuntimeException e2) {
e = e2;
zzgt.zzb(e);
throw e;
}
}
@SuppressLint({"MissingSuperCall"})
public void onCreate(@Nullable Bundle bundle) {
TraceMachine.startTracing("AutocompleteActivity");
try {
TraceMachine.enterMethod(this._nr_trace, "AutocompleteActivity#onCreate", null);
} catch (NoSuchFieldError unused) {
TraceMachine.enterMethod(null, "AutocompleteActivity#onCreate", null);
}
try {
zziy.zzk(Places.isInitialized(), "Places must be initialized.");
zziy.zzk(getCallingActivity() != null, "Cannot find caller. startActivityForResult should be used.");
zzhj zzhjVar = (zzhj) getIntent().getParcelableExtra("places/AutocompleteOptions");
if (zzhjVar == null) {
TraceMachine.exitMethod();
throw null;
}
AutocompleteActivityMode autocompleteActivityMode = AutocompleteActivityMode.FULLSCREEN;
int ordinal = zzhjVar.zzh().ordinal();
if (ordinal == 0) {
this.zza = R.layout.places_autocomplete_impl_fragment_fullscreen;
this.zzb = R.style.PlacesAutocompleteFullscreen;
} else if (ordinal == 1) {
this.zza = R.layout.places_autocomplete_impl_fragment_overlay;
this.zzb = R.style.PlacesAutocompleteOverlay;
}
getSupportFragmentManager().setFragmentFactory(new com.google.android.libraries.places.widget.internal.ui.zzh(this.zza, this, zzhjVar));
setTheme(this.zzb);
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
final AutocompleteImplFragment autocompleteImplFragment = (AutocompleteImplFragment) getSupportFragmentManager().findFragmentById(R.id.places_autocomplete_content);
zziy.zzj(autocompleteImplFragment != null);
autocompleteImplFragment.zzh(this);
final View findViewById = findViewById(android.R.id.content);
findViewById.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
return AutocompleteActivity.this.zzb(autocompleteImplFragment, findViewById, view, motionEvent);
}
});
findViewById.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AutocompleteActivity.this.zza(view);
}
});
if (!zzhjVar.zzj().isEmpty()) {
TraceMachine.exitMethod();
} else {
zzc(2, null, new Status(PlacesStatusCodes.INVALID_REQUEST, "Place Fields must not be empty."));
TraceMachine.exitMethod();
}
} catch (Error e) {
e = e;
zzgt.zzb(e);
TraceMachine.exitMethod();
throw e;
} catch (RuntimeException e2) {
e = e2;
zzgt.zzb(e);
TraceMachine.exitMethod();
throw e;
}
}
@Override
public void onError(@RecentlyNonNull Status status) {
zzc(true != status.u() ? 2 : 0, null, status);
}
@Override
public void onPlaceSelected(@RecentlyNonNull Place place) {
zzc(-1, place, Status.p);
}
protected void onStart() {
super.onStart();
ApplicationStateMonitor.getInstance().activityStarted();
}
protected void onStop() {
super.onStop();
ApplicationStateMonitor.getInstance().activityStopped();
}
final void zza(View view) {
if (this.zzc) {
zzc(0, null, new Status(16));
}
}
final boolean zzb(AutocompleteImplFragment autocompleteImplFragment, View view, View view2, MotionEvent motionEvent) {
this.zzc = false;
if (autocompleteImplFragment.getView() == null || motionEvent.getY() <= r1.getBottom()) {
return false;
}
this.zzc = true;
view.performClick();
return true;
}
}