导航菜单

页面标题

页面副标题

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

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

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


package com.naspers.ragnarok.universal.ui.ui.testDrive.activity;

import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.location.Location;
import android.os.Bundle;
import android.os.Looper;
import androidx.activity.ComponentActivity;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationCallback;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationResult;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.location.LocationSettingsResult;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.naspers.ragnarok.data.R;
import com.naspers.ragnarok.data.util.PermissionUtils;
import com.naspers.ragnarok.domain.constant.Constants;
import com.naspers.ragnarok.domain.entity.chat.ChatAd;
import com.naspers.ragnarok.domain.entity.chat.ChatProfile;
import com.naspers.ragnarok.domain.entity.conversation.Conversation;
import com.naspers.ragnarok.domain.entity.meeting.Center;
import com.naspers.ragnarok.domain.entity.meeting.Showroom;
import com.naspers.ragnarok.universal.databinding.c0;
import com.naspers.ragnarok.universal.ui.ui.dialog.RagnarokCustomActionWithVerticalButtonDialogFragment;
import com.naspers.ragnarok.universal.ui.viewModel.viewIntent.l;
import com.naspers.ragnarok.universal.ui.viewModel.viewIntent.m;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import kotlin.Function;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.CallableReference;
import kotlin.jvm.internal.FunctionAdapter;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.Reflection;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.jvm.internal.StringCompanionObject;
import kotlinx.coroutines.o0;
import kotlinx.coroutines.q0;

@Metadata
@SourceDebugExtension
public final class LocationSearchActivity extends com.naspers.ragnarok.universal.ui.ui.base.a implements com.naspers.ragnarok.universal.ui.ui.widget.a, com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.f, com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.e, com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.g, RagnarokCustomActionWithVerticalButtonDialogFragment.b {
    public com.naspers.ragnarok.universal.ui.viewModel.base.b R;
    private com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.d T;
    public FusedLocationProviderClient U;
    public com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.b W;
    public com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.i X;
    public com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.j Y;
    private ChatAd a0;
    private ChatProfile b0;
    private Conversation c0;
    private a d0;
    private int e0;
    private Context S = this;
    private androidx.recyclerview.widget.f V = new androidx.recyclerview.widget.f(new RecyclerView.f[0]);
    private final Lazy Z = new ViewModelLazy(Reflection.b(com.naspers.ragnarok.universal.ui.viewModel.testDrive.g.class), new l(this), new c(), new m(null, this));
    private String f0 = "";

    public final class a extends LocationCallback {
        private final WeakReference a;

        public a(LocationSearchActivity locationSearchActivity) {
            this.a = new WeakReference(locationSearchActivity);
        }

        public void onLocationResult(LocationResult locationResult) {
            if (this.a.get() != null) {
                ((LocationSearchActivity) this.a.get()).D2(locationResult);
            }
        }
    }

    static final class b implements ResultCallback {
        b() {
        }

        public final void onResult(LocationSettingsResult locationSettingsResult) {
            Status status = locationSettingsResult.getStatus();
            int statusCode = status.getStatusCode();
            if (statusCode == 0) {
                LocationSearchActivity.this.R2();
            } else {
                if (statusCode != 6) {
                    return;
                }
                try {
                    status.startResolutionForResult(LocationSearchActivity.this, Constants.RequestCode.REQUEST_CHECK_SETTINGS);
                } catch (IntentSender.SendIntentException unused) {
                }
            }
        }
    }

    static final class c extends Lambda implements Function0 {
        c() {
            super(0);
        }

        public final ViewModelProvider.Factory invoke() {
            return LocationSearchActivity.this.C2();
        }
    }

    class d extends FunctionReferenceImpl implements Function1 {
        d(Object obj) {
            super(1, obj, LocationSearchActivity.class, "renderState", "renderState(Lcom/naspers/ragnarok/universal/ui/viewModel/viewIntent/LocationSearchViewIntent$ViewState;)V", 0);
        }

        public final void b(com.naspers.ragnarok.universal.ui.viewModel.viewIntent.m mVar) {
            ((LocationSearchActivity) ((CallableReference) this).receiver).H2(mVar);
        }

        public Object invoke(Object obj) {
            b((com.naspers.ragnarok.universal.ui.viewModel.viewIntent.m) obj);
            return Unit.a;
        }
    }

    class e extends FunctionReferenceImpl implements Function1 {
        e(Object obj) {
            super(1, obj, LocationSearchActivity.class, "renderState", "renderState(Lcom/naspers/ragnarok/universal/ui/viewModel/viewIntent/LocationSearchViewIntent$ViewEffect;)V", 0);
        }

        public final void b(com.naspers.ragnarok.universal.ui.viewModel.viewIntent.l lVar) {
            ((LocationSearchActivity) ((CallableReference) this).receiver).G2(lVar);
        }

        public Object invoke(Object obj) {
            b((com.naspers.ragnarok.universal.ui.viewModel.viewIntent.l) obj);
            return Unit.a;
        }
    }

    static final class f extends SuspendLambda implements Function2 {
        int a;
        private Object b;
        final Location c;
        final LocationSearchActivity d;

        static final class a extends SuspendLambda implements Function2 {
            Object a;
            Object b;
            Object c;
            int d;
            final Location e;
            final LocationSearchActivity f;

            a(Location location, LocationSearchActivity locationSearchActivity, Continuation continuation) {
                super(2, continuation);
                this.e = location;
                this.f = locationSearchActivity;
            }

            public final Continuation create(Object obj, Continuation continuation) {
                return new a(this.e, this.f, continuation);
            }

            public final Object invokeSuspend(Object obj) {
                LocationSearchActivity locationSearchActivity;
                Ref.ObjectRef objectRef;
                Ref.ObjectRef objectRef2;
                Object g = IntrinsicsKt.g();
                int i = this.d;
                if (i == 0) {
                    ResultKt.b(obj);
                    Location location = this.e;
                    if (location != null) {
                        locationSearchActivity = this.f;
                        objectRef = new Ref.ObjectRef();
                        com.naspers.ragnarok.universal.ui.viewModel.testDrive.g y2 = locationSearchActivity.y2();
                        double latitude = location.getLatitude();
                        double longitude = location.getLongitude();
                        this.a = locationSearchActivity;
                        this.b = objectRef;
                        this.c = objectRef;
                        this.d = 1;
                        obj = y2.z0(latitude, longitude, this);
                        if (obj == g) {
                            return g;
                        }
                        objectRef2 = objectRef;
                    }
                    return Unit.a;
                }
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                objectRef2 = (Ref.ObjectRef) this.c;
                objectRef = (Ref.ObjectRef) this.b;
                locationSearchActivity = (LocationSearchActivity) this.a;
                ResultKt.b(obj);
                objectRef2.a = obj;
                if (((Center) objectRef.a) != null) {
                    locationSearchActivity.u2().J(CollectionsKt.g(new Center[]{objectRef.a}));
                }
                return Unit.a;
            }

            public final Object invoke(o0 o0Var, Continuation continuation) {
                return create(o0Var, continuation).invokeSuspend(Unit.a);
            }
        }

        f(Location location, LocationSearchActivity locationSearchActivity, Continuation continuation) {
            super(2, continuation);
            this.c = location;
            this.d = locationSearchActivity;
        }

        public final Continuation create(Object obj, Continuation continuation) {
            f fVar = new f(this.c, this.d, continuation);
            fVar.b = obj;
            return fVar;
        }

        public final Object invokeSuspend(Object obj) {
            IntrinsicsKt.g();
            if (this.a != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            ResultKt.b(obj);
            kotlinx.coroutines.i.d((o0) this.b, (CoroutineContext) null, (q0) null, new a(this.c, this.d, null), 3, (Object) null);
            return Unit.a;
        }

        public final Object invoke(o0 o0Var, Continuation continuation) {
            return create(o0Var, continuation).invokeSuspend(Unit.a);
        }
    }

    static final class g extends Lambda implements Function0 {
        g() {
            super(0);
        }

        public Object invoke() {
            m31invoke();
            return Unit.a;
        }

        public final void m31invoke() {
            LocationSearchActivity.this.B2();
        }
    }

    static final class h extends Lambda implements Function0 {
        public static final h d = new h();

        h() {
            super(0);
        }

        public final void m32invoke() {
        }

        public Object invoke() {
            m32invoke();
            return Unit.a;
        }
    }

    static final class i extends Lambda implements Function0 {
        i() {
            super(0);
        }

        public Object invoke() {
            m33invoke();
            return Unit.a;
        }

        public final void m33invoke() {
            LocationSearchActivity.this.B2();
        }
    }

    static final class j extends Lambda implements Function0 {
        public static final j d = new j();

        j() {
            super(0);
        }

        public final void m34invoke() {
        }

        public Object invoke() {
            m34invoke();
            return Unit.a;
        }
    }

    static final class k implements Observer, FunctionAdapter {
        private final Function1 a;

        k(Function1 function1) {
            this.a = function1;
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof Observer) && (obj instanceof FunctionAdapter)) {
                return Intrinsics.d(getFunctionDelegate(), ((FunctionAdapter) obj).getFunctionDelegate());
            }
            return false;
        }

        public final Function getFunctionDelegate() {
            return this.a;
        }

        public final int hashCode() {
            return getFunctionDelegate().hashCode();
        }

        public final void onChanged(Object obj) {
            this.a.invoke(obj);
        }
    }

    public static final class l extends Lambda implements Function0 {
        final ComponentActivity d;

        public l(ComponentActivity componentActivity) {
            super(0);
            this.d = componentActivity;
        }

        public final ViewModelStore invoke() {
            return this.d.getViewModelStore();
        }
    }

    public static final class m extends Lambda implements Function0 {
        final Function0 d;
        final ComponentActivity e;

        public m(Function0 function0, ComponentActivity componentActivity) {
            super(0);
            this.d = function0;
            this.e = componentActivity;
        }

        public final CreationExtras invoke() {
            CreationExtras creationExtras;
            Function0 function0 = this.d;
            return (function0 == null || (creationExtras = (CreationExtras) function0.invoke()) == null) ? this.e.getDefaultViewModelCreationExtras() : creationExtras;
        }
    }

    static final class n extends Lambda implements Function1 {

        static final class a extends SuspendLambda implements Function2 {
            Object a;
            Object b;
            int c;
            final LocationSearchActivity d;
            final Location e;

            a(LocationSearchActivity locationSearchActivity, Location location, Continuation continuation) {
                super(2, continuation);
                this.d = locationSearchActivity;
                this.e = location;
            }

            public final Continuation create(Object obj, Continuation continuation) {
                return new a(this.d, this.e, continuation);
            }

            public final Object invokeSuspend(Object obj) {
                Ref.ObjectRef objectRef;
                Ref.ObjectRef objectRef2;
                Unit unit;
                Object g = IntrinsicsKt.g();
                int i = this.c;
                if (i == 0) {
                    ResultKt.b(obj);
                    Ref.ObjectRef objectRef3 = new Ref.ObjectRef();
                    com.naspers.ragnarok.universal.ui.viewModel.testDrive.g y2 = this.d.y2();
                    double latitude = this.e.getLatitude();
                    double longitude = this.e.getLongitude();
                    this.a = objectRef3;
                    this.b = objectRef3;
                    this.c = 1;
                    Object z0 = y2.z0(latitude, longitude, this);
                    if (z0 == g) {
                        return g;
                    }
                    objectRef = objectRef3;
                    obj = z0;
                    objectRef2 = objectRef;
                } else {
                    if (i != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    objectRef = (Ref.ObjectRef) this.b;
                    objectRef2 = (Ref.ObjectRef) this.a;
                    ResultKt.b(obj);
                }
                objectRef.a = obj;
                if (((Center) objectRef2.a) != null) {
                    this.d.u2().J(CollectionsKt.g(new Center[]{objectRef2.a}));
                    unit = Unit.a;
                } else {
                    unit = null;
                }
                if (unit == null) {
                    this.d.I2();
                }
                return Unit.a;
            }

            public final Object invoke(o0 o0Var, Continuation continuation) {
                return create(o0Var, continuation).invokeSuspend(Unit.a);
            }
        }

        n() {
            super(1);
        }

        public final void a(Location location) {
            if (location != null) {
                LocationSearchActivity locationSearchActivity = LocationSearchActivity.this;
                if (kotlinx.coroutines.i.d(LifecycleOwnerKt.getLifecycleScope(locationSearchActivity), (CoroutineContext) null, (q0) null, new a(locationSearchActivity, location, null), 3, (Object) null) != null) {
                    return;
                }
            }
            LocationSearchActivity.this.I2();
            Unit unit = Unit.a;
        }

        public Object invoke(Object obj) {
            a((Location) obj);
            return Unit.a;
        }
    }

    public final void B2() {
        GoogleApiClient build = new GoogleApiClient.Builder(this).addApi(LocationServices.API).build();
        build.connect();
        LocationRequest create = LocationRequest.create();
        create.setPriority(100);
        create.setInterval(10000L);
        create.setFastestInterval(5000L);
        LocationSettingsRequest.Builder addLocationRequest = new LocationSettingsRequest.Builder().addLocationRequest(create);
        addLocationRequest.setAlwaysShow(true);
        LocationServices.SettingsApi.checkLocationSettings(build, addLocationRequest.build()).setResultCallback(new b());
    }

    public final void G2(com.naspers.ragnarok.universal.ui.viewModel.viewIntent.l lVar) {
        Showroom showroomAddress;
        if (lVar instanceof l.a) {
            K2(((l.a) lVar).a());
            return;
        }
        if (lVar instanceof l.b) {
            String B0 = y2().B0();
            ChatProfile chatProfile = this.b0;
            String addressLine1 = (chatProfile == null || (showroomAddress = chatProfile.getShowroomAddress()) == null) ? null : showroomAddress.getAddressLine1();
            if (addressLine1 == null) {
                addressLine1 = "";
            }
            StringCompanionObject stringCompanionObject = StringCompanionObject.a;
            com.naspers.ragnarok.universal.ui.ui.helper.b.f(this, String.format(getString(R.string.ragnarok_label_location_search_dialog), Arrays.copyOf(new Object[]{B0, addressLine1}, 2)), "", getString(R.string.ragnarok_label_book_store_test_drive), getString(R.string.ragnarok_label_change_location), R.drawable.ragnarok_ic_location_search, this, false);
        }
    }

    public final void H2(com.naspers.ragnarok.universal.ui.viewModel.viewIntent.m mVar) {
        if (mVar instanceof m.a) {
            m.a aVar = (m.a) mVar;
            this.e0 = aVar.b();
            this.f0 = aVar.c();
            ((c0) this.Q).C.setVisibility(8);
            ((c0) this.Q).B.setVisibility(0);
            com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.d dVar = this.T;
            if (dVar == null) {
                dVar = null;
            }
            dVar.J(aVar.a());
            return;
        }
        if ((mVar instanceof m.b) || !(mVar instanceof m.c)) {
            return;
        }
        m.c cVar = (m.c) mVar;
        if (!cVar.a().isEmpty()) {
            this.V.I(A2());
            this.V.I(z2());
            z2().J(cVar.a());
        }
    }

    public final void I2() {
        LocationRequest locationRequest = new LocationRequest();
        locationRequest.setPriority(100);
        locationRequest.setInterval(5L);
        locationRequest.setFastestInterval(0L);
        locationRequest.setNumUpdates(1);
        M2(LocationServices.getFusedLocationProviderClient(this));
        a aVar = new a(this);
        this.d0 = aVar;
        v2().requestLocationUpdates(locationRequest, aVar, Looper.myLooper());
    }

    private final void J2(Center center, String str, String str2, int i2) {
        y2().D0(center, this.c0, str, str2, i2);
    }

    private final void K2(Center center) {
        setIntent(new Intent());
        getIntent().putExtra(Constants.ExtraKeys.LOCATION_SEARCH_RESULT, center);
        setResult(-1, getIntent());
        finish();
    }

    private final void N2(com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.b bVar, com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.i iVar) {
        ((c0) this.Q).C.setVisibility(0);
        this.V.I(bVar);
        ((c0) this.Q).C.setLayoutManager(new LinearLayoutManager(this.S, 1, false));
        ((c0) this.Q).C.setAdapter(this.V);
    }

    private final void Q2() {
        ((c0) this.Q).D.setNavigationIcon(R.drawable.ragnarok_back_arrow);
        ((c0) this.Q).D.setContentInsetStartWithNavigation(0);
        ((c0) this.Q).D.setContentInsetsRelative(0, 0);
        ((c0) this.Q).D.setTitle(getString(R.string.ragnarok_label_home_test_drive));
        androidx.appcompat.app.a supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.w(true);
        }
        androidx.appcompat.app.a supportActionBar2 = getSupportActionBar();
        if (supportActionBar2 != null) {
            supportActionBar2.B(true);
        }
        androidx.appcompat.app.a supportActionBar3 = getSupportActionBar();
        if (supportActionBar3 != null) {
            supportActionBar3.w(true);
        }
        setSupportActionBar(((c0) this.Q).D);
    }

    public final void R2() {
        M2(LocationServices.getFusedLocationProviderClient(this.S));
        if (PermissionUtils.INSTANCE.hasLocationPermissions(this.S) && com.naspers.ragnarok.universal.ui.ui.util.c.a.b(this.S)) {
            Task lastLocation = v2().getLastLocation();
            final n nVar = new n();
            lastLocation.addOnSuccessListener(new OnSuccessListener() {
                public final void onSuccess(Object obj) {
                    LocationSearchActivity.S2(nVar, obj);
                }
            });
        }
    }

    public static final void S2(Function1 function1, Object obj) {
        function1.invoke(obj);
    }

    public final com.naspers.ragnarok.universal.ui.viewModel.testDrive.g y2() {
        return (com.naspers.ragnarok.universal.ui.viewModel.testDrive.g) this.Z.getValue();
    }

    public final com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.j A2() {
        com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.j jVar = this.Y;
        if (jVar != null) {
            return jVar;
        }
        return null;
    }

    public final com.naspers.ragnarok.universal.ui.viewModel.base.b C2() {
        com.naspers.ragnarok.universal.ui.viewModel.base.b bVar = this.R;
        if (bVar != null) {
            return bVar;
        }
        return null;
    }

    @Override
    public void D() {
    }

    public final void D2(LocationResult locationResult) {
        kotlinx.coroutines.i.d(LifecycleOwnerKt.getLifecycleScope(this), (CoroutineContext) null, (q0) null, new f(locationResult.getLastLocation(), this, null), 3, (Object) null);
    }

    @Override
    public void E0(Center center) {
        J2(center, "RECENT_LOCATION", this.f0, 0);
    }

    public final void E2() {
        Context context = this.S;
        if (context != null) {
            com.naspers.ragnarok.universal.ui.ui.util.c.a.e(context, new g(), h.d);
        }
    }

    public final void F2() {
        Context context = this.S;
        if (context != null) {
            com.naspers.ragnarok.universal.ui.ui.util.c.a.e(context, new i(), j.d);
        }
    }

    public final void L2(com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.b bVar) {
        this.W = bVar;
    }

    public final void M2(FusedLocationProviderClient fusedLocationProviderClient) {
        this.U = fusedLocationProviderClient;
    }

    @Override
    public void N(String str) {
        if (str.length() > 3) {
            y2().A0(str);
        }
    }

    public final void O2(com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.i iVar) {
        this.X = iVar;
    }

    public final void P2(com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.j jVar) {
        this.Y = jVar;
    }

    @Override
    public void c0() {
        ((c0) this.Q).B.setVisibility(8);
        ((c0) this.Q).C.setVisibility(0);
    }

    @Override
    public void d(Center center) {
        String address1 = center.getAddress1();
        if (address1 == null || address1.length() == 0) {
            com.naspers.ragnarok.universal.ui.ui.testDrive.activity.b.a(this);
        } else {
            J2(center, "CURRENT_LOCATION", this.f0, 0);
        }
    }

    @Override
    public void k(Center center) {
        J2(center, "MANUAL_LOCATION", this.f0, this.e0);
        com.naspers.ragnarok.universal.ui.ui.util.common.j.b(((c0) this.Q).getRoot());
    }

    @Override
    protected int k2() {
        return com.naspers.ragnarok.universal.e.ragnarok_activity_location_search;
    }

    @Override
    public void m() {
        ((c0) this.Q).A.m();
    }

    @Override
    public void n() {
        if (this.a0 == null || this.b0 == null) {
            return;
        }
        finish();
    }

    protected void onActivityResult(int i2, int i3, Intent intent) {
        super/*androidx.fragment.app.r*/.onActivityResult(i2, i3, intent);
        if (i2 == 11112 && i3 == -1) {
            R2();
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        com.naspers.ragnarok.universal.ui.provider.a.c.a().x().P(this);
        Intent intent = getIntent();
        Conversation conversation = (Conversation) (intent != null ? intent.getSerializableExtra("conversationExtra") : null);
        this.c0 = conversation;
        this.b0 = conversation != null ? conversation.getProfile() : null;
        Conversation conversation2 = this.c0;
        this.a0 = conversation2 != null ? conversation2.getCurrentAd() : null;
        Q2();
        ((c0) this.Q).A.setOnRagnarokSearchViewListener(this);
        y2().r0().observe(this, new k(new d(this)));
        y2().s0().observe(this, new k(new e(this)));
        this.T = new com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.d(new ArrayList(), this);
        RecyclerView recyclerView = ((c0) this.Q).B;
        recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext(), 1, false));
        com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.d dVar = this.T;
        if (dVar == null) {
            dVar = null;
        }
        recyclerView.setAdapter(dVar);
        ArrayList arrayList = new ArrayList();
        arrayList.add(new Center(null, null, null, 0.0d, null, null, null, null, null, 0.0d, null, null, null, 0.0f, 16383, null));
        L2(new com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.b(arrayList, this));
        O2(new com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.i(null, this, 1, null));
        P2(new com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.j());
        N2(u2(), z2());
        R2();
        y2().C0();
        y2().G0(this.c0);
    }

    @Override
    protected void onDestroy() {
        ((c0) this.Q).A.setOnRagnarokSearchViewListener(null);
        u2().O();
        z2().O();
        com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.d dVar = this.T;
        if (dVar == null) {
            dVar = null;
        }
        dVar.O();
        a aVar = this.d0;
        if (aVar != null) {
            v2().removeLocationUpdates(aVar);
            this.d0 = null;
        }
        ((c0) this.Q).C.setAdapter((RecyclerView.f) null);
        ((c0) this.Q).B.setAdapter((RecyclerView.f) null);
        super.onDestroy();
    }

    public void onRequestPermissionsResult(int i2, String[] strArr, int[] iArr) {
        super/*androidx.fragment.app.r*/.onRequestPermissionsResult(i2, strArr, iArr);
        com.naspers.ragnarok.universal.ui.ui.testDrive.activity.b.b(this, i2, iArr);
    }

    public boolean onSupportNavigateUp() {
        setResult(0, new Intent());
        finish();
        return true;
    }

    public final com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.b u2() {
        com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.b bVar = this.W;
        if (bVar != null) {
            return bVar;
        }
        return null;
    }

    public final FusedLocationProviderClient v2() {
        FusedLocationProviderClient fusedLocationProviderClient = this.U;
        if (fusedLocationProviderClient != null) {
            return fusedLocationProviderClient;
        }
        return null;
    }

    public final void w2() {
        B2();
    }

    public final com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.i z2() {
        com.naspers.ragnarok.universal.ui.ui.testDrive.adapter.i iVar = this.X;
        if (iVar != null) {
            return iVar;
        }
        return null;
    }
}