导航菜单

页面标题

页面副标题

OLX India v19.42.007 - AutocompleteActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 AutocompleteActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.google.android.libraries.places.widget;

import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.RecentlyNonNull;
import androidx.appcompat.app.d;
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.zzkd;
import com.google.android.libraries.places.internal.zzkt;
import com.google.android.libraries.places.internal.zzmt;
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;

public class AutocompleteActivity extends d implements PlaceSelectionListener {
    public static final int RESULT_ERROR = 2;
    private int zza;
    private int zzb;
    private boolean zzc;

    public AutocompleteActivity() {
        super(R.layout.places_autocomplete_activity);
        this.zzc = false;
    }

    private final void zzc(int i, Place place, Status status) {
        try {
            Intent intent = new Intent();
            if (place != null) {
                intent.putExtra("places/selected_place", place);
            }
            intent.putExtra("places/status", (Parcelable) status);
            setResult(i, intent);
            finish();
        } catch (Error e) {
            e = e;
            zzkd.zzb(e);
            throw e;
        } catch (RuntimeException e2) {
            e = e2;
            zzkd.zzb(e);
            throw e;
        }
    }

    public void onCreate(Bundle bundle) {
        try {
            zzmt.zzp(Places.isInitialized(), "Places must be initialized.");
            zzmt.zzp(getCallingActivity() != null, "Cannot find caller. startActivityForResult should be used.");
            zzkt zzktVar = (zzkt) getIntent().getParcelableExtra("places/AutocompleteOptions");
            zzktVar.getClass();
            AutocompleteActivityMode autocompleteActivityMode = AutocompleteActivityMode.FULLSCREEN;
            int ordinal = zzktVar.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().O1(new com.google.android.libraries.places.widget.internal.ui.zzh(this.zza, this, zzktVar));
            setTheme(this.zzb);
            super/*androidx.fragment.app.r*/.onCreate(bundle);
            final AutocompleteImplFragment autocompleteImplFragment = (AutocompleteImplFragment) getSupportFragmentManager().o0(R.id.places_autocomplete_content);
            zzmt.zzo(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 (zzktVar.zzj().isEmpty()) {
                zzc(2, null, new Status(PlacesStatusCodes.INVALID_REQUEST, "Place Fields must not be empty."));
            }
        } catch (Error e) {
            e = e;
            zzkd.zzb(e);
            throw e;
        } catch (RuntimeException e2) {
            e = e2;
            zzkd.zzb(e);
            throw e;
        }
    }

    @Override
    public void onError(@RecentlyNonNull Status status) {
        zzc(true != status.isCanceled() ? 2 : 0, null, status);
    }

    @Override
    public void onPlaceSelected(@RecentlyNonNull Place place) {
        zzc(-1, place, Status.RESULT_SUCCESS);
    }

    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;
    }
}