导航菜单

页面标题

页面副标题

Zepto v25.1.4 - MapView.java 源代码

正在查看: Zepto v25.1.4 应用的 MapView.java JAVA 源代码文件

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


package com.mappls.sdk.maps;

import android.animation.Animator;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PointF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.TextureView;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.collection.LongSparseArray;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.view.ViewCompat;
import com.google.gson.internal.LinkedTreeMap;
import com.inmobi.media.C0178h;
import com.mappls.android.lms.MapplsLMSManager;
import com.mappls.sdk.gestures.AndroidGesturesManager;
import com.mappls.sdk.maps.MapKeyListener;
import com.mappls.sdk.maps.MapKeyListener.TrackballLongPressTimeOut;
import com.mappls.sdk.maps.MapplsMap;
import com.mappls.sdk.maps.NativeMapView;
import com.mappls.sdk.maps.Style;
import com.mappls.sdk.maps.annotations.Annotation;
import com.mappls.sdk.maps.annotations.Icon;
import com.mappls.sdk.maps.annotations.Marker;
import com.mappls.sdk.maps.attribution.AttributionView;
import com.mappls.sdk.maps.auth.MapplsVectorKey;
import com.mappls.sdk.maps.auth.model.PublicKeyToken;
import com.mappls.sdk.maps.camera.CameraPosition;
import com.mappls.sdk.maps.camera.CameraUpdateFactory;
import com.mappls.sdk.maps.exceptions.MapplsConfigurationException;
import com.mappls.sdk.maps.geometry.LatLng;
import com.mappls.sdk.maps.location.LocationComponent;
import com.mappls.sdk.maps.log.Logger;
import com.mappls.sdk.maps.module.http.MapplsMapManager;
import com.mappls.sdk.maps.net.ConnectivityReceiver;
import com.mappls.sdk.maps.promo.MapplsPromo;
import com.mappls.sdk.maps.promo.model.HyperlinkContent;
import com.mappls.sdk.maps.promo.model.Promo;
import com.mappls.sdk.maps.rctmgl.components.mapview.RCTMGLMapView;
import com.mappls.sdk.maps.renderer.MapRenderer;
import com.mappls.sdk.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer;
import com.mappls.sdk.maps.renderer.glsurfaceview.MapplsGLSurfaceView;
import com.mappls.sdk.maps.renderer.textureview.TextureViewMapRenderer;
import com.mappls.sdk.maps.session.AuthenticationError;
import com.mappls.sdk.maps.session.IStopSession;
import com.mappls.sdk.maps.session.InitializationListener;
import com.mappls.sdk.maps.storage.FileSource;
import com.mappls.sdk.maps.style.IStyleListener;
import com.mappls.sdk.maps.style.OnStyleLoadListener;
import com.mappls.sdk.maps.style.sources.Source;
import com.mappls.sdk.maps.utils.BitmapUtils;
import com.mappls.sdk.maps.widgets.CompassView;
import com.mappls.sdk.maps.widgets.LogoView;
import com.mappls.sdk.maps.widgets.indoor.Floor;
import com.mappls.sdk.maps.widgets.indoor.FloorControllerView;
import com.mappls.sdk.maps.widgets.indoor.IndoorConstants;
import com.mappls.sdk.maps.widgets.indoor.iface.IndoorListener;
import com.mappls.sdk.services.account.MapplsAccountManager;
import com.mappls.sdk.services.api.MapplsApiConfiguration;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import org.json.JSONException;
import org.json.JSONObject;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import timber.log.Timber;

public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
    public static final int F = 0;
    public View A;
    public LogoView B;
    public FloorControllerView C;
    public ImageView D;
    public AuthenticationError E;
    public final MapChangeReceiver a;
    public final MapCallback b;
    public final InitialRenderCallback c;

    public final FocalPointInvalidator f1364d;

    public final GesturesManagerInteractionListener f1365e;

    public final CameraChangeDispatcher f1366f;

    public boolean f1367g;

    public MapplsMapOptions f1368h;

    public boolean f1369i;

    public boolean f1370j;

    public NativeMapView f1371k;

    public MapplsMap f1372l;

    public View f1373m;

    public AttributionClickListener f1374n;
    public MapRenderer o;
    public boolean p;
    public CompassView q;
    public PointF r;
    public MapGestureDetector s;
    public MapKeyListener t;
    public Bundle u;
    public boolean v;
    public View w;
    public Button x;
    public TextView y;
    public TextView z;

    class AnonymousClass8 implements Runnable {
        public AnonymousClass8() {
        }

        @Override
        public final void run() {
            FloorControllerView floorControllerView;
            AttributionView attributionView;
            int i2;
            final MapView mapView = MapView.this;
            if (mapView.p || mapView.f1372l != null) {
                return;
            }
            Context context = mapView.getContext();
            FocalPointChangeListener focalPointChangeListener = new FocalPointChangeListener() {
                @Override
                public final void a(PointF pointF) {
                    MapView.this.r = pointF;
                }
            };
            FocalPointInvalidator focalPointInvalidator = mapView.f1364d;
            focalPointInvalidator.a.add(focalPointChangeListener);
            Projection projection = new Projection(mapView.f1371k, mapView);
            UiSettings uiSettings = new UiSettings(projection, focalPointInvalidator, mapView.getPixelRatio(), mapView);
            LongSparseArray longSparseArray = new LongSparseArray();
            LongSparseArray longSparseArray2 = new LongSparseArray();
            IconManager iconManager = new IconManager(mapView.f1371k);
            NativeMapView nativeMapView = mapView.f1371k;
            AnnotationManager annotationManager = new AnnotationManager(mapView, longSparseArray, iconManager, new AnnotationContainer(nativeMapView, longSparseArray), new MarkerContainer(nativeMapView, longSparseArray, iconManager, longSparseArray2), new PolygonContainer(nativeMapView, longSparseArray), new PolylineContainer(nativeMapView, longSparseArray), new ShapeAnnotationContainer(nativeMapView, longSparseArray), longSparseArray2);
            Transform transform = new Transform(mapView, mapView.f1371k, mapView.f1366f);
            ArrayList arrayList = new ArrayList();
            MapplsMap mapplsMap = new MapplsMap(mapView.f1371k, transform, uiSettings, projection, mapView.f1365e, mapView.f1366f, arrayList);
            mapView.f1372l = mapplsMap;
            annotationManager.f1314g = mapplsMap;
            mapplsMap.f1383k = annotationManager;
            MapGestureDetector mapGestureDetector = new MapGestureDetector(context, transform, projection, uiSettings, annotationManager, mapView.f1366f);
            mapView.s = mapGestureDetector;
            mapView.t = new MapKeyListener(transform, uiSettings, mapGestureDetector);
            MapplsMap mapplsMap2 = mapView.f1372l;
            mapplsMap2.f1382j = new LocationComponent(mapplsMap2, transform, arrayList);
            mapView.f1372l.getClass();
            MapplsMap mapplsMap3 = mapView.f1372l;
            TrafficPlugin trafficPlugin = new TrafficPlugin();
            int i3 = 0;
            trafficPlugin.b = false;
            trafficPlugin.c = true;
            trafficPlugin.f1416d = true;
            trafficPlugin.f1417e = true;
            trafficPlugin.f1418f = true;
            trafficPlugin.a = mapplsMap3;
            mapView.p(trafficPlugin);
            mapplsMap3.o = trafficPlugin;
            MapplsMap mapplsMap4 = mapView.f1372l;
            PlaceIdPlugin placeIdPlugin = new PlaceIdPlugin();
            placeIdPlugin.a = mapplsMap4;
            mapplsMap4.e(placeIdPlugin);
            mapplsMap4.q = placeIdPlugin;
            mapView.setClickable(true);
            mapView.setLongClickable(true);
            mapView.setFocusable(true);
            mapView.setFocusableInTouchMode(true);
            mapView.requestDisallowInterceptTouchEvent(true);
            mapView.f1371k.o0(Mappls.isConnected().booleanValue());
            Bundle bundle = mapView.u;
            Long l2 = null;
            if (bundle == null) {
                MapplsMap mapplsMap5 = mapView.f1372l;
                MapplsMapOptions mapplsMapOptions = mapView.f1368h;
                Transform transform2 = mapplsMap5.f1376d;
                transform2.getClass();
                CameraPosition cameraPosition = mapplsMapOptions.a;
                if (cameraPosition != null && !cameraPosition.equals(CameraPosition.a)) {
                    transform2.g(mapplsMap5, CameraUpdateFactory.b(cameraPosition), null);
                }
                transform2.i(mapplsMapOptions.t);
                transform2.h(mapplsMapOptions.u);
                double d2 = mapplsMapOptions.v;
                NativeMap nativeMap = transform2.a;
                if (d2 < 0.0d || d2 > 60.0d) {
                    Logger.e("Mbgl-Transform", String.format("Not setting minPitchPreference, value is in unsupported range: %s", Double.valueOf(d2)));
                } else {
                    nativeMap.F(d2);
                }
                double d3 = mapplsMapOptions.w;
                if (d3 < 0.0d || d3 > 60.0d) {
                    Logger.e("Mbgl-Transform", String.format("Not setting maxPitchPreference, value is in unsupported range: %s", Double.valueOf(d3)));
                } else {
                    nativeMap.r(d3);
                }
                UiSettings uiSettings2 = mapplsMap5.b;
                if (uiSettings2 != null) {
                    Resources resources = context.getResources();
                    uiSettings2.q = mapplsMapOptions.B;
                    uiSettings2.r = mapplsMapOptions.y;
                    uiSettings2.s = mapplsMapOptions.z;
                    uiSettings2.o = mapplsMapOptions.x;
                    uiSettings2.p = mapplsMapOptions.A;
                    uiSettings2.t = mapplsMapOptions.C;
                    uiSettings2.u = mapplsMapOptions.D;
                    if (mapplsMapOptions.c) {
                        uiSettings2.b(mapplsMapOptions, resources);
                    }
                    uiSettings2.d(mapplsMapOptions, resources);
                    uiSettings2.I = true;
                    ImageView C = uiSettings2.b.C();
                    uiSettings2.f1433k = C;
                    UiSettings.k(mapplsMapOptions.f1396l, C);
                    int[] iArr = mapplsMapOptions.f1397m;
                    if (iArr != null) {
                        int i4 = iArr[0];
                        int i5 = iArr[1];
                        int i6 = iArr[2];
                        int i7 = iArr[3];
                        ImageView imageView = uiSettings2.f1433k;
                        if (imageView != null) {
                            UiSettings.l(imageView, i4, i5, i6, i7, uiSettings2.f1435m);
                        }
                    } else {
                        int dimension = (int) resources.getDimension(R.dimen.mappls_maps_four_dp);
                        ImageView imageView2 = uiSettings2.f1433k;
                        if (imageView2 != null) {
                            UiSettings.l(imageView2, dimension, dimension, dimension, dimension, uiSettings2.f1435m);
                        }
                    }
                    if (mapplsMapOptions.f1398n) {
                        uiSettings2.c(context, mapplsMapOptions);
                    }
                    if (mapplsMapOptions.q) {
                        uiSettings2.a(context, mapplsMapOptions);
                    }
                }
                boolean z = mapplsMapOptions.b;
                mapplsMap5.f1385m = z;
                NativeMap nativeMap2 = mapplsMap5.a;
                nativeMap2.g0(z);
                String str = mapplsMapOptions.K;
                if (!TextUtils.isEmpty(str)) {
                    nativeMap2.p(str);
                }
                if (mapplsMapOptions.E) {
                    nativeMap2.i0(mapplsMapOptions.F);
                } else {
                    nativeMap2.i0(0);
                }
            } else {
                MapplsMap mapplsMap6 = mapView.f1372l;
                mapplsMap6.getClass();
                CameraPosition cameraPosition2 = (CameraPosition) bundle.getParcelable("mappls_cameraPosition");
                UiSettings uiSettings3 = mapplsMap6.b;
                if (uiSettings3 != null) {
                    uiSettings3.s = bundle.getBoolean("mappls_horizontalScrollEnabled");
                    uiSettings3.q = bundle.getBoolean("mappls_zoomEnabled");
                    uiSettings3.r = bundle.getBoolean("mappls_scrollEnabled");
                    uiSettings3.o = bundle.getBoolean("mappls_rotateEnabled");
                    uiSettings3.p = bundle.getBoolean("mappls_tiltEnabled");
                    uiSettings3.t = bundle.getBoolean("mappls_doubleTapEnabled");
                    uiSettings3.v = bundle.getBoolean("mappls_scaleAnimationEnabled");
                    uiSettings3.w = bundle.getBoolean("mappls_rotateAnimationEnabled");
                    uiSettings3.x = bundle.getBoolean("mappls_flingAnimationEnabled");
                    uiSettings3.y = bundle.getBoolean("mappls_increaseRotateThreshold");
                    uiSettings3.z = bundle.getBoolean("mappls_disableRotateWhenScaling");
                    uiSettings3.A = bundle.getBoolean("mappls_increaseScaleThreshold");
                    uiSettings3.u = bundle.getBoolean("mappls_quickZoom");
                    uiSettings3.B = bundle.getFloat("mappls_zoomRate", 1.0f);
                    boolean z2 = bundle.getBoolean("mappls_compassEnabled");
                    MapView mapView2 = uiSettings3.b;
                    if (z2 && !uiSettings3.E) {
                        uiSettings3.f1426d = mapView2.z();
                        uiSettings3.E = true;
                    }
                    uiSettings3.f(bundle.getBoolean("mappls_compassEnabled"));
                    uiSettings3.g(bundle.getInt("mappls_compassGravity"));
                    uiSettings3.h(bundle.getInt("mappls_compassMarginLeft"), bundle.getInt("mappls_compassMarginTop"), bundle.getInt("mappls_compassMarginRight"), bundle.getInt("mappls_compassMarginBottom"));
                    boolean z3 = bundle.getBoolean("mappls_compassFade");
                    CompassView compassView = uiSettings3.f1426d;
                    if (compassView != null) {
                        compassView.b = z3;
                    }
                    Context context2 = mapView2.getContext();
                    byte[] byteArray = bundle.getByteArray("mappls_compassImage");
                    BitmapDrawable bitmapDrawable = byteArray == null ? null : new BitmapDrawable(context2.getResources(), BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length));
                    CompassView compassView2 = uiSettings3.f1426d;
                    if (compassView2 != null) {
                        compassView2.setCompassImage(bitmapDrawable);
                    }
                    if (bundle.getBoolean("mappls_logoEnabled") && !uiSettings3.H) {
                        uiSettings3.f1432j = mapView2.E();
                        uiSettings3.H = true;
                    }
                    uiSettings3.j(bundle.getBoolean("mappls_logoEnabled"));
                    int i8 = bundle.getInt("mappls_logoGravity");
                    LogoView logoView = uiSettings3.f1432j;
                    if (logoView != null) {
                        UiSettings.k(i8, logoView);
                    }
                    int i9 = bundle.getInt("mappls_logoMarginLeft");
                    int i10 = bundle.getInt("mappls_logoMarginTop");
                    int i11 = bundle.getInt("mappls_logoMarginRight");
                    int i12 = bundle.getInt("mappls_logoMarginBottom");
                    LogoView logoView2 = uiSettings3.f1432j;
                    if (logoView2 != null) {
                        UiSettings.l(logoView2, i9, i10, i11, i12, uiSettings3.f1434l);
                    }
                    if (!uiSettings3.I) {
                        uiSettings3.f1433k = mapView2.C();
                        uiSettings3.I = true;
                    }
                    UiSettings.k(bundle.getInt("mappls_eventGravity"), uiSettings3.f1433k);
                    int i13 = bundle.getInt("mappls_eventMarginLeft");
                    int i14 = bundle.getInt("mappls_eventMarginTop");
                    int i15 = bundle.getInt("mappls_eventMarginRight");
                    int i16 = bundle.getInt("mappls_eventMarginBottom");
                    ImageView imageView3 = uiSettings3.f1433k;
                    if (imageView3 != null) {
                        UiSettings.l(imageView3, i13, i14, i15, i16, uiSettings3.f1435m);
                    }
                    if (bundle.getBoolean("mappls_layerControlEnabled") && !uiSettings3.F) {
                        uiSettings3.f1428f = mapView2.D();
                        uiSettings3.F = true;
                    }
                    uiSettings3.i(bundle.getBoolean("mappls_layerControlEnabled"));
                    int i17 = bundle.getInt("mappls_layerControlGravity");
                    FloorControllerView floorControllerView2 = uiSettings3.f1428f;
                    if (floorControllerView2 != null) {
                        UiSettings.k(i17, floorControllerView2);
                    }
                    int i18 = bundle.getInt("mappls_layerControlMarginLeft");
                    int i19 = bundle.getInt("mappls_layerControlMarginTop");
                    int i20 = bundle.getInt("mappls_layerControlMarginRight");
                    int i21 = bundle.getInt("mappls_layerControlMarginBottom");
                    FloorControllerView floorControllerView3 = uiSettings3.f1428f;
                    if (floorControllerView3 != null) {
                        UiSettings.l(floorControllerView3, i18, i19, i20, i21, uiSettings3.f1429g);
                    }
                    if (bundle.getBoolean("mappls_atrrEnabled") && !uiSettings3.G) {
                        uiSettings3.f1430h = mapView2.y();
                        uiSettings3.G = true;
                    }
                    uiSettings3.e(bundle.getBoolean("mappls_atrrEnabled"));
                    int i22 = bundle.getInt("mappls_attrGravity");
                    AttributionView attributionView2 = uiSettings3.f1430h;
                    if (attributionView2 != null) {
                        UiSettings.k(i22, attributionView2);
                    }
                    int i23 = bundle.getInt("mappls_attrMarginLeft");
                    int i24 = bundle.getInt("mappls_attrMarginTop");
                    int i25 = bundle.getInt("mappls_attrMarginRight");
                    int i26 = bundle.getInt("mappls_atrrMarginBottom");
                    AttributionView attributionView3 = uiSettings3.f1430h;
                    if (attributionView3 != null) {
                        UiSettings.l(attributionView3, i23, i24, i25, i26, uiSettings3.f1431i);
                    }
                    uiSettings3.C = bundle.getBoolean("mappls_deselectMarkerOnTap");
                    PointF pointF = (PointF) bundle.getParcelable("mappls_userFocalPoint");
                    if (pointF != null) {
                        uiSettings3.D = pointF;
                        uiSettings3.a.a(pointF);
                    }
                }
                if (cameraPosition2 != null) {
                    mapplsMap6.N(CameraUpdateFactory.b(new CameraPosition.Builder(cameraPosition2).b()), null);
                }
                mapplsMap6.a.g0(bundle.getBoolean("mappls_debugActive"));
            }
            MapCallback mapCallback = mapView.b;
            MapView mapView3 = MapView.this;
            final MapplsMap mapplsMap7 = mapView3.f1372l;
            mapplsMap7.f1376d.d();
            mapplsMap7.f1383k.f1317j.b();
            AnnotationManager annotationManager2 = mapplsMap7.f1383k;
            LongSparseArray longSparseArray3 = annotationManager2.f1311d;
            int k2 = longSparseArray3.k();
            while (i3 < k2) {
                Annotation annotation = (Annotation) longSparseArray3.e(i3, l2);
                if (annotation instanceof Marker) {
                    Marker marker = (Marker) annotation;
                    Icon icon = marker.getIcon();
                    IconManager iconManager2 = annotationManager2.b;
                    iconManager2.getClass();
                    String str2 = icon.b;
                    i2 = i3;
                    marker.setTopOffsetPixels((int) (iconManager2.b.q(str2) * r12.getPixelRatio()));
                } else {
                    i2 = i3;
                }
                i3 = i2 + 1;
                l2 = null;
            }
            MapView mapView4 = annotationManager2.a;
            if (mapView4 != null) {
                Iterator it = annotationManager2.f1312e.iterator();
                while (it.hasNext()) {
                    Marker marker2 = (Marker) it.next();
                    if (marker2.isInfoWindowShown()) {
                        marker2.hideInfoWindow();
                        marker2.showInfoWindow(mapplsMap7, mapView4);
                    }
                }
            }
            UiSettings uiSettings4 = mapplsMap7.b;
            if (uiSettings4 != null && (attributionView = uiSettings4.f1430h) != null && attributionView.getMap() == null) {
                uiSettings4.f1430h.setMap(mapplsMap7);
            }
            if (uiSettings4 != null && (floorControllerView = uiSettings4.f1428f) != null && floorControllerView.getMap() == null) {
                uiSettings4.f1428f.setMap(mapplsMap7);
                uiSettings4.f1428f.a.add(new IndoorListener() {
                    public AnonymousClass1() {
                    }

                    @Override
                    public final void a(int i27, int i28) {
                        String str3;
                        ArrayList arrayList2 = new ArrayList();
                        if (i27 < 0) {
                            i28 += i27;
                        }
                        while (i27 < i28) {
                            Integer valueOf = Integer.valueOf(i27);
                            if (i27 == 0) {
                                str3 = "G";
                            } else {
                                str3 = i27 + "";
                            }
                            IndoorConstants.a(i27);
                            arrayList2.add(new Floor(valueOf, str3));
                            i27++;
                        }
                        MapplsMap.this.b.f1428f.g(arrayList2);
                    }

                    @Override
                    public final void b() {
                        MapplsMap mapplsMap8 = MapplsMap.this;
                        mapplsMap8.b.f1428f.g(new ArrayList());
                        mapplsMap8.b.f1428f.setFloor(0);
                    }
                });
            }
            ArrayList arrayList2 = mapCallback.a;
            if (arrayList2.size() > 0) {
                Iterator it2 = arrayList2.iterator();
                while (it2.hasNext()) {
                    OnMapReadyCallback onMapReadyCallback = (OnMapReadyCallback) it2.next();
                    if (onMapReadyCallback != null) {
                        onMapReadyCallback.g(mapView3.f1372l);
                    }
                    it2.remove();
                }
            }
            mapView3.f1372l.f1376d.d();
            mapView.f1372l.P();
        }
    }

    public static class AttributionClickListener implements View.OnClickListener {
        public final AttributionDialogManager a;
        public final UiSettings b;

        public AttributionClickListener(Context context, MapplsMap mapplsMap) {
            this.a = new AttributionDialogManager(context, mapplsMap);
            this.b = mapplsMap.b;
        }

        @Override
        public final void onClick(View view) {
            this.b.getClass();
            this.a.onClick(view);
            if (MapplsLMSManager.isInitialised()) {
                try {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("event_view", "attribution");
                    MapplsLMSManager.getInstance().add(C0178h.CLICK_BEACON, "mappls-map", "8.2.6", jSONObject);
                } catch (JSONException unused) {
                }
            }
        }
    }

    public class FocalPointInvalidator implements FocalPointChangeListener {
        public final ArrayList a = new ArrayList();

        public FocalPointInvalidator() {
        }

        @Override
        public final void a(PointF pointF) {
            PointF pointF2;
            UiSettings uiSettings;
            MapGestureDetector mapGestureDetector = MapView.this.s;
            if (pointF != null || (uiSettings = mapGestureDetector.c) == null || (pointF2 = uiSettings.D) == null) {
                pointF2 = pointF;
            }
            mapGestureDetector.f1353n = pointF2;
            Iterator it = this.a.iterator();
            while (it.hasNext()) {
                ((FocalPointChangeListener) it.next()).a(pointF);
            }
        }
    }

    public class GesturesManagerInteractionListener implements MapplsMap.OnGesturesManagerInteractionListener {
        public GesturesManagerInteractionListener() {
        }

        @Override
        public final void a(MapplsMap.OnMapClickListener onMapClickListener) {
            MapView.this.s.f1345f.remove(onMapClickListener);
        }

        @Override
        public final void b(MapplsMap.OnMapLongClickListener onMapLongClickListener) {
            MapView.this.s.f1346g.remove(onMapLongClickListener);
        }

        @Override
        public final void c(MapplsMap.OnMapLongClickListener onMapLongClickListener) {
            MapView.this.s.f1346g.add(onMapLongClickListener);
        }

        @Override
        public final void d(AndroidGesturesManager androidGesturesManager) {
            MapView mapView = MapView.this;
            MapGestureDetector mapGestureDetector = mapView.s;
            Context context = mapView.getContext();
            mapGestureDetector.f(androidGesturesManager);
            mapGestureDetector.e(context);
        }

        @Override
        public final AndroidGesturesManager e() {
            return MapView.this.s.p;
        }

        @Override
        public final void f(MapplsMap.OnRotateListener onRotateListener) {
            MapView.this.s.f1349j.add(onRotateListener);
        }

        @Override
        public final void g(MapplsMap.OnMapClickListener onMapClickListener) {
            MapView.this.s.f1345f.add(onMapClickListener);
        }

        @Override
        public final void h(MapplsMap.OnFlingListener onFlingListener) {
            MapView.this.s.f1347h.add(onFlingListener);
        }

        @Override
        public final void i(MapplsMap.OnMoveListener onMoveListener) {
            MapView.this.s.f1348i.add(onMoveListener);
        }
    }

    public class InitialRenderCallback implements OnDidFinishRenderingFrameListener {
        public int a;

        public InitialRenderCallback() {
            MapView.this.q(this);
        }

        @Override
        public final void f(boolean z) {
            MapView mapView = MapView.this;
            MapplsMap mapplsMap = mapView.f1372l;
            if (mapplsMap == null || mapplsMap.E() == null || !mapView.f1372l.E().f1410f) {
                return;
            }
            int i2 = this.a + 1;
            this.a = i2;
            if (i2 == 3) {
                mapView.setForeground(null);
                mapView.a.f1336h.remove(this);
            }
        }
    }

    public class MapCallback implements OnDidFinishLoadingStyleListener, OnDidFinishRenderingFrameListener, OnDidFinishLoadingMapListener, OnCameraIsChangingListener, OnCameraDidChangeListener, OnDidFailLoadingMapListener {
        public final ArrayList a = new ArrayList();

        public MapCallback() {
            MapView.this.p(this);
            MapView.this.q(this);
            MapView.this.o(this);
            MapView.this.m(this);
            MapView.this.l(this);
            MapView.this.n(this);
        }

        @Override
        public final void a() {
            MapplsMap mapplsMap = MapView.this.f1372l;
            if (mapplsMap != null) {
                mapplsMap.Q();
            }
        }

        @Override
        public final void e(boolean z) {
            MapplsMap mapplsMap = MapView.this.f1372l;
            if (mapplsMap != null) {
                mapplsMap.Q();
            }
        }

        @Override
        public final void f(boolean z) {
            UiSettings uiSettings;
            MapView mapView = MapView.this;
            if (mapView.f1372l != null) {
                if (MapplsLMSManager.isInitialised() && mapView.f1372l.f1376d.c() != null) {
                    LatLng latLng = mapView.f1372l.f1376d.c().target;
                    MapplsLMSManager.getInstance().setMapCenter(latLng.b(), latLng.c());
                }
                MapplsMap mapplsMap = mapView.f1372l;
                CameraPosition d2 = mapplsMap.f1376d.d();
                if (d2 == null || (uiSettings = mapplsMap.b) == null) {
                    return;
                }
                double d3 = -d2.bearing;
                uiSettings.J = d3;
                CompassView compassView = uiSettings.f1426d;
                if (compassView != null) {
                    compassView.d(d3);
                }
            }
        }

        @Override
        public final void i() {
            MapplsMap mapplsMap = MapView.this.f1372l;
            if (mapplsMap != null) {
                mapplsMap.Q();
            }
        }

        @Override
        public final void k() {
            MapView mapView = MapView.this;
            MapplsMap mapplsMap = mapView.f1372l;
            if (mapplsMap != null) {
                mapplsMap.f1381i = null;
                OnStyleLoadListener onStyleLoadListener = mapplsMap.p;
                if (onStyleLoadListener != null) {
                    onStyleLoadListener.j();
                    mapplsMap.p = null;
                }
                Boolean bool = ConnectivityReceiver.c(mapView.getContext()).f1573d;
                if (bool == null || bool.booleanValue()) {
                    return;
                }
                MapplsMap mapplsMap2 = mapView.f1372l;
                Style.Builder builder = new Style.Builder();
                builder.f1412e = "{\"version\": 8,\"sources\": {},\"layers\": []}";
                builder.f1411d = null;
                mapplsMap2.f0(builder, null);
            }
        }

        @Override
        public final void onDidFinishLoadingStyle() {
            MapplsMap mapplsMap = MapView.this.f1372l;
            if (mapplsMap == null || mapplsMap.a.isDestroyed()) {
                return;
            }
            Style style = mapplsMap.f1384l;
            ArrayList arrayList = mapplsMap.f1379g;
            if (style != null) {
                if (!style.f1410f) {
                    style.f1410f = true;
                    Style.Builder builder = style.f1409e;
                    Iterator it = builder.a.iterator();
                    while (it.hasNext()) {
                        style.g((Source) it.next());
                    }
                    Iterator it2 = builder.b.iterator();
                    while (it2.hasNext()) {
                        Style.Builder.LayerWrapper layerWrapper = (Style.Builder.LayerWrapper) it2.next();
                        if (layerWrapper instanceof Style.Builder.LayerAtWrapper) {
                            layerWrapper.getClass();
                            style.e(null, 0);
                        } else if (layerWrapper instanceof Style.Builder.LayerAboveWrapper) {
                            layerWrapper.getClass();
                            style.d(null, null);
                        } else if (layerWrapper instanceof Style.Builder.LayerBelowWrapper) {
                            layerWrapper.getClass();
                            style.f(null, null);
                        } else {
                            layerWrapper.getClass();
                            style.f(null, "com.mappls.annotations.points");
                        }
                    }
                    Iterator it3 = builder.c.iterator();
                    while (it3.hasNext()) {
                        Style.Builder.ImageWrapper imageWrapper = (Style.Builder.ImageWrapper) it3.next();
                        style.a(imageWrapper.b, imageWrapper.a, imageWrapper.c);
                    }
                }
                mapplsMap.f1382j.e();
                Style.OnStyleLoaded onStyleLoaded = mapplsMap.f1381i;
                if (onStyleLoaded != null) {
                    onStyleLoaded.a(mapplsMap.f1384l);
                }
                Iterator it4 = arrayList.iterator();
                while (it4.hasNext()) {
                    ((Style.OnStyleLoaded) it4.next()).a(mapplsMap.f1384l);
                }
            } else if (MapStrictMode.a) {
                throw new MapStrictModeException("No style to provide.");
            }
            mapplsMap.f1381i = null;
            arrayList.clear();
        }
    }

    public interface OnCameraDidChangeListener {
        void e(boolean z);
    }

    public interface OnCameraIsChangingListener {
        void a();
    }

    public interface OnCameraWillChangeListener {
        void a();
    }

    public interface OnCanRemoveUnusedStyleImageListener {
        boolean a();
    }

    public interface OnDidBecomeIdleListener {
        void h();
    }

    public interface OnDidFailLoadingMapListener {
        void k();
    }

    public interface OnDidFinishLoadingMapListener {
        void i();
    }

    public interface OnDidFinishLoadingStyleListener {
        void onDidFinishLoadingStyle();
    }

    public interface OnDidFinishRenderingFrameListener {
        void f(boolean z);
    }

    public interface OnDidFinishRenderingMapListener {
        void onDidFinishRenderingMap(boolean z);
    }

    public interface OnSourceChangedListener {
        void a();
    }

    public interface OnStyleImageMissingListener {
        void b(String str);
    }

    public interface OnWillStartLoadingMapListener {
        void g();
    }

    public interface OnWillStartRenderingFrameListener {
        void c();
    }

    public interface OnWillStartRenderingMapListener {
        void d();
    }

    @UiThread
    public MapView(@NonNull Context context) {
        super(context);
        this.a = new MapChangeReceiver();
        this.b = new MapCallback();
        this.c = new InitialRenderCallback();
        this.f1364d = new FocalPointInvalidator();
        this.f1365e = new GesturesManagerInteractionListener();
        this.f1366f = new CameraChangeDispatcher();
        this.f1367g = false;
        this.f1369i = false;
        this.f1370j = false;
        Boolean bool = ConnectivityReceiver.c(context).f1573d;
        if (bool != null && !bool.booleanValue()) {
            F(context, MapplsMapOptions.a(context, null));
        } else if (MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
            F(context, MapplsMapOptions.a(context, null));
        } else {
            x(context, MapplsMapOptions.a(context, null));
        }
    }

    public static void setMapStrictModeEnabled(boolean z) {
        synchronized (MapStrictMode.class) {
            MapStrictMode.a = z;
        }
    }

    public final void B(MapplsMapOptions mapplsMapOptions) {
        String str = mapplsMapOptions.H ? mapplsMapOptions.I : null;
        if (mapplsMapOptions.L) {
            TextureView textureView = new TextureView(getContext());
            this.o = new TextureViewMapRenderer(getContext(), textureView, str, mapplsMapOptions.M) {
                @Override
                public final void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
                    MapView mapView = MapView.this;
                    if (mapView.f1370j) {
                        mapView.post(mapView.new AnonymousClass8());
                    }
                    super.onSurfaceCreated(gl10, eGLConfig);
                    mapView.f1369i = true;
                }
            };
            addView(textureView, 0);
            this.f1373m = textureView;
        } else {
            MapplsGLSurfaceView mapplsGLSurfaceView = new MapplsGLSurfaceView(getContext());
            mapplsGLSurfaceView.setZOrderMediaOverlay(this.f1368h.G);
            this.o = new GLSurfaceViewMapRenderer(getContext(), mapplsGLSurfaceView, str) {
                @Override
                public final void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
                    MapView mapView = MapView.this;
                    if (mapView.f1370j) {
                        mapView.post(mapView.new AnonymousClass8());
                    }
                    super.onSurfaceCreated(gl10, eGLConfig);
                    mapView.f1369i = true;
                }
            };
            addView(mapplsGLSurfaceView, 0);
            this.f1373m = mapplsGLSurfaceView;
        }
        this.f1371k = new NativeMapView(getContext(), getPixelRatio(), this.f1368h.P, this, this.a, this.o);
    }

    public final ImageView C() {
        ImageView imageView = new ImageView(getContext());
        this.D = imageView;
        addView(imageView);
        this.D.getLayoutParams().width = -2;
        this.D.getLayoutParams().height = -2;
        this.D.setTag("eventView");
        this.D.setImageDrawable(BitmapUtils.b(R.drawable.mappls_maps_fab_corona, getContext(), null));
        this.D.setVisibility(8);
        return this.D;
    }

    public final FloorControllerView D() {
        FloorControllerView floorControllerView = new FloorControllerView(getContext());
        this.C = floorControllerView;
        addView(floorControllerView);
        this.C.setTag("attrView");
        this.C.getLayoutParams().width = -2;
        this.C.getLayoutParams().height = -2;
        this.C.setBackgroundResource(R.drawable.mappls_maps_floor_layer_bg);
        this.C.setClickable(true);
        this.C.setFocusable(true);
        return this.C;
    }

    public final LogoView E() {
        LogoView logoView = new LogoView(getContext());
        this.B = logoView;
        addView(logoView);
        LogoView logoView2 = this.B;
        MapplsMap mapplsMap = this.f1372l;
        logoView2.a = mapplsMap;
        logoView2.b = this;
        mapplsMap.a(logoView2);
        p(logoView2);
        logoView2.a();
        this.B.setTag("logoView");
        this.B.getLayoutParams().width = -2;
        this.B.getLayoutParams().height = -2;
        this.B.setVisibility(8);
        this.B.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                UiSettings uiSettings;
                MapView mapView = MapView.this;
                MapplsMap mapplsMap2 = mapView.f1372l;
                if (mapplsMap2 == null || (uiSettings = mapplsMap2.b) == null || !uiSettings.K) {
                    return;
                }
                if (MapplsLMSManager.isInitialised()) {
                    try {
                        JSONObject jSONObject = new JSONObject();
                        jSONObject.put("event_view", "logo");
                        MapplsLMSManager.getInstance().add(C0178h.CLICK_BEACON, "mappls-map", "8.2.6", jSONObject);
                    } catch (JSONException unused) {
                    }
                }
                try {
                    Intent intent = new Intent("android.intent.action.VIEW");
                    intent.setData(Uri.parse("https://about.mappls.com/"));
                    intent.setFlags(268435456);
                    mapView.getContext().startActivity(intent);
                } catch (ActivityNotFoundException unused2) {
                }
            }
        });
        return this.B;
    }

    public final void F(final Context context, final MapplsMapOptions mapplsMapOptions) {
        this.f1368h = mapplsMapOptions;
        if (MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
            setWillNotDraw(false);
            B(mapplsMapOptions);
        }
        setForeground(new ColorDrawable(mapplsMapOptions.N));
        Mappls.getStyleHelper().initialiseStyles(new IStyleListener() {
            @Override
            public final void a(int i2, String str) {
                if (MapplsLMSManager.isInitialised()) {
                    try {
                        JSONObject jSONObject = new JSONObject();
                        jSONObject.put("error_code", i2);
                        jSONObject.put("error_message", str);
                        MapplsLMSManager.getInstance().add("style-api-error", "mappls-map", "8.2.6", jSONObject);
                    } catch (JSONException unused) {
                    }
                }
                int i3 = MapView.F;
                MapView.this.J(i2, str);
            }

            @Override
            public final void onSuccess() {
                final Context context2 = context;
                Boolean bool = ConnectivityReceiver.c(context2).f1573d;
                boolean z = (bool == null || bool.booleanValue()) ? false : true;
                final MapplsMapOptions mapplsMapOptions2 = mapplsMapOptions;
                final MapView mapView = MapView.this;
                if (z) {
                    mapView.G(mapplsMapOptions2);
                    return;
                }
                int i2 = MapView.F;
                mapView.getClass();
                if (MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
                    mapView.N(context2, mapplsMapOptions2);
                } else if (MapplsMapManager.b.a == null) {
                    MapplsVectorKey.a().a().enqueueCall(new Callback<PublicKeyToken>() {
                        @Override
                        public final void a(Call call, Throwable th) {
                            if (MapplsLMSManager.isInitialised()) {
                                try {
                                    JSONObject jSONObject = new JSONObject();
                                    jSONObject.put("error_code", 5);
                                    jSONObject.put("error_message", th.getMessage());
                                    MapplsLMSManager.getInstance().add("vector-key-api-error", "mappls-map", "8.2.6", jSONObject);
                                } catch (JSONException unused) {
                                }
                            }
                            int i3 = MapView.F;
                            MapView.this.J(5, "Something went wrong - 102");
                        }

                        @Override
                        public final void b(Call call, Response response) {
                            String str;
                            Object obj;
                            okhttp3.Response response2 = response.a;
                            int i3 = response2.f6663d;
                            MapView mapView2 = MapView.this;
                            if (i3 == 200 && (obj = response.b) != null) {
                                MapplsMapManager.b.a = ((PublicKeyToken) obj).getPublicKey();
                                ((PublicKeyToken) obj).getExpiresOn();
                                if (MapplsLMSManager.isInitialised()) {
                                    try {
                                        JSONObject jSONObject = new JSONObject();
                                        jSONObject.put("key_expiry", ((PublicKeyToken) obj).getExpiresOn());
                                        MapplsLMSManager.getInstance().add("vector-key-api-success", "mappls-map", "8.2.6", jSONObject);
                                    } catch (JSONException unused) {
                                    }
                                }
                                mapView2.N(context2, mapplsMapOptions2);
                                return;
                            }
                            okhttp3.Response response3 = response.a;
                            if (i3 == 7 || i3 == 8 || i3 == 9 || i3 == 101 || i3 == 102 || i3 == 103) {
                                if (MapplsLMSManager.isInitialised()) {
                                    try {
                                        JSONObject jSONObject2 = new JSONObject();
                                        jSONObject2.put("error_code", response3.f6663d);
                                        jSONObject2.put("error_message", response3.c);
                                        MapplsLMSManager.getInstance().add("vector-key-api-error", "mappls-map", "8.2.6", jSONObject2);
                                    } catch (JSONException unused2) {
                                    }
                                }
                                int i4 = response3.f6663d;
                                String str2 = response3.c;
                                int i5 = MapView.F;
                                mapView2.J(i4, str2);
                                return;
                            }
                            if (response2.f6665f.a("message") != null) {
                                str = response3.f6665f.a("message") + " - 102";
                                int i6 = response3.f6663d;
                                String str3 = response3.f6665f.a("message") + " - 102";
                                int i7 = MapView.F;
                                mapView2.J(i6, str3);
                            } else {
                                int i8 = response3.f6663d;
                                int i9 = MapView.F;
                                mapView2.J(i8, "Something went wrong - 102");
                                str = "Something went wrong - 102";
                            }
                            if (MapplsLMSManager.isInitialised()) {
                                try {
                                    JSONObject jSONObject3 = new JSONObject();
                                    jSONObject3.put("error_code", response3.f6663d);
                                    jSONObject3.put("error_message", str);
                                    MapplsLMSManager.getInstance().add("vector-key-api-error", "mappls-map", "8.2.6", jSONObject3);
                                } catch (JSONException unused3) {
                                }
                            }
                        }
                    });
                } else {
                    mapView.N(context2, mapplsMapOptions2);
                }
            }
        });
    }

    public final void G(MapplsMapOptions mapplsMapOptions) {
        this.E = null;
        if (isInEditMode()) {
            return;
        }
        this.f1370j = true;
        setForeground(new ColorDrawable(mapplsMapOptions.N));
        View view = this.w;
        if (view != null) {
            view.setVisibility(8);
        }
        if (!Mappls.hasInstance()) {
            throw new MapplsConfigurationException();
        }
        if (this.f1369i) {
            post(new AnonymousClass8());
        }
        if (MapplsMapConfiguration.getInstance().isEnablePromotion()) {
            MapplsPromo.a().a().enqueueCall(new Callback<List<Promo>>() {
                @Override
                public final void a(Call call, Throwable th) {
                    ImageView imageView = MapView.this.D;
                    if (imageView != null) {
                        imageView.setVisibility(8);
                    }
                }

                @Override
                public final void b(Call call, Response response) {
                    if (response.a.f6663d == 200) {
                        Object obj = response.b;
                        int size = ((List) obj).size();
                        MapView mapView = MapView.this;
                        if (size <= 0) {
                            ImageView imageView = mapView.D;
                            if (imageView != null) {
                                imageView.setVisibility(8);
                                return;
                            }
                            return;
                        }
                        for (Promo promo : (List) obj) {
                            if (promo.b().equalsIgnoreCase("Hyperlink")) {
                                LinkedTreeMap linkedTreeMap = (LinkedTreeMap) promo.a();
                                String obj2 = linkedTreeMap.containsKey("title") ? linkedTreeMap.get("title").toString() : null;
                                if (obj2 != null && obj2.equalsIgnoreCase("COVID-19")) {
                                    String obj3 = linkedTreeMap.get("iconSource").toString();
                                    final String obj4 = linkedTreeMap.get("triggerUrl").toString();
                                    String obj5 = linkedTreeMap.get("description").toString();
                                    HyperlinkContent hyperlinkContent = new HyperlinkContent();
                                    hyperlinkContent.c(obj2);
                                    hyperlinkContent.b(obj3);
                                    hyperlinkContent.d(obj4);
                                    hyperlinkContent.a(obj5);
                                    ImageView imageView2 = mapView.D;
                                    if (imageView2 != null) {
                                        imageView2.setVisibility(0);
                                        mapView.D.setOnClickListener(new View.OnClickListener() {
                                            @Override
                                            public final void onClick(View view2) {
                                                MapView.this.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse(obj4)));
                                            }
                                        });
                                        return;
                                    }
                                    return;
                                }
                            }
                        }
                    }
                }
            });
        }
    }

    public boolean H() {
        return this.p;
    }

    public void I() {
        this.p = true;
        if (MapplsLMSManager.isInitialised()) {
            MapplsLMSManager.getInstance().setMapCenter(0.0d, 0.0d);
        }
        MapChangeReceiver mapChangeReceiver = this.a;
        mapChangeReceiver.a.clear();
        mapChangeReceiver.b.clear();
        mapChangeReceiver.c.clear();
        mapChangeReceiver.f1332d.clear();
        mapChangeReceiver.f1333e.clear();
        mapChangeReceiver.f1334f.clear();
        mapChangeReceiver.f1335g.clear();
        mapChangeReceiver.f1336h.clear();
        mapChangeReceiver.f1337i.clear();
        mapChangeReceiver.f1338j.clear();
        mapChangeReceiver.f1339k.clear();
        mapChangeReceiver.f1340l.clear();
        mapChangeReceiver.f1341m.clear();
        mapChangeReceiver.f1342n.clear();
        mapChangeReceiver.o.clear();
        MapCallback mapCallback = this.b;
        mapCallback.a.clear();
        MapView mapView = MapView.this;
        mapView.a.f1340l.remove(mapCallback);
        MapChangeReceiver mapChangeReceiver2 = mapView.a;
        mapChangeReceiver2.f1336h.remove(mapCallback);
        mapChangeReceiver2.f1333e.remove(mapCallback);
        mapChangeReceiver2.b.remove(mapCallback);
        mapChangeReceiver2.c.remove(mapCallback);
        mapChangeReceiver2.f1334f.remove(mapCallback);
        InitialRenderCallback initialRenderCallback = this.c;
        MapView.this.a.f1336h.remove(initialRenderCallback);
        CompassView compassView = this.q;
        if (compassView != null) {
            compassView.c();
        }
        MapplsMap mapplsMap = this.f1372l;
        if (mapplsMap != null) {
            mapplsMap.f1382j.getClass();
            MapplsApiConfiguration.getInstance().setLocation(null);
            if (MapplsLMSManager.isInitialised()) {
                MapplsLMSManager.getInstance().setCurrentLocation(null);
            }
            Style style = mapplsMap.f1384l;
            if (style != null) {
                style.h();
            }
            CameraChangeDispatcher cameraChangeDispatcher = mapplsMap.f1377e;
            cameraChangeDispatcher.a.removeCallbacksAndMessages(null);
            cameraChangeDispatcher.f1327d.clear();
            cameraChangeDispatcher.f1328e.clear();
            cameraChangeDispatcher.f1329f.clear();
            cameraChangeDispatcher.f1330g.clear();
        }
        NativeMapView nativeMapView = this.f1371k;
        if (nativeMapView != null) {
            nativeMapView.k0();
            this.f1371k = null;
        }
        MapRenderer mapRenderer = this.o;
        if (mapRenderer != null) {
            mapRenderer.onDestroy();
        }
    }

    public final void J(int i2, String str) {
        this.E = new AuthenticationError(i2, str);
        setForeground(null);
        MapCallback mapCallback = this.b;
        mapCallback.getClass();
        Log.e("onMapError", i2 + "----" + str);
        ArrayList arrayList = mapCallback.a;
        if (arrayList.size() > 0) {
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                ((OnMapReadyCallback) it.next()).A(i2, str);
            }
        }
        if (MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
            return;
        }
        this.A.setVisibility(0);
        this.z.setText(str);
        this.y.setVisibility(8);
        this.x.setVisibility((i2 == 1 || i2 == 2 || i2 == 3 || i2 == 4) ? false : true ? 0 : 8);
    }

    public final void K(Bundle bundle) {
        Bitmap a;
        if (this.f1372l != null) {
            bundle.putBoolean("mappls_savedState", true);
            MapplsMap mapplsMap = this.f1372l;
            bundle.putParcelable("mappls_cameraPosition", mapplsMap.f1376d.c());
            bundle.putBoolean("mappls_debugActive", mapplsMap.f1385m);
            UiSettings uiSettings = mapplsMap.b;
            if (uiSettings != null) {
                bundle.putBoolean("mappls_horizontalScrollEnabled", uiSettings.s);
                bundle.putBoolean("mappls_zoomEnabled", uiSettings.q);
                bundle.putBoolean("mappls_scrollEnabled", uiSettings.r);
                bundle.putBoolean("mappls_rotateEnabled", uiSettings.o);
                bundle.putBoolean("mappls_tiltEnabled", uiSettings.p);
                bundle.putBoolean("mappls_doubleTapEnabled", uiSettings.t);
                bundle.putBoolean("mappls_scaleAnimationEnabled", uiSettings.v);
                bundle.putBoolean("mappls_rotateAnimationEnabled", uiSettings.w);
                bundle.putBoolean("mappls_flingAnimationEnabled", uiSettings.x);
                bundle.putBoolean("mappls_increaseRotateThreshold", uiSettings.y);
                bundle.putBoolean("mappls_disableRotateWhenScaling", uiSettings.z);
                bundle.putBoolean("mappls_increaseScaleThreshold", uiSettings.A);
                bundle.putBoolean("mappls_quickZoom", uiSettings.u);
                bundle.putFloat("mappls_zoomRate", uiSettings.B);
                CompassView compassView = uiSettings.f1426d;
                boolean z = false;
                bundle.putBoolean("mappls_compassEnabled", compassView != null ? compassView.isEnabled() : false);
                CompassView compassView2 = uiSettings.f1426d;
                bundle.putInt("mappls_compassGravity", compassView2 != null ? ((FrameLayout.LayoutParams) compassView2.getLayoutParams()).gravity : -1);
                int[] iArr = uiSettings.f1427e;
                bundle.putInt("mappls_compassMarginLeft", iArr[0]);
                bundle.putInt("mappls_compassMarginTop", iArr[1]);
                bundle.putInt("mappls_compassMarginBottom", iArr[3]);
                bundle.putInt("mappls_compassMarginRight", iArr[2]);
                CompassView compassView3 = uiSettings.f1426d;
                bundle.putBoolean("mappls_compassFade", compassView3 != null ? compassView3.b : false);
                CompassView compassView4 = uiSettings.f1426d;
                byte[] bArr = null;
                Drawable compassImage = compassView4 != null ? compassView4.getCompassImage() : null;
                if (compassImage != null && (a = BitmapUtils.a(compassImage)) != null) {
                    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                    a.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
                    bArr = byteArrayOutputStream.toByteArray();
                }
                bundle.putByteArray("mappls_compassImage", bArr);
                LogoView logoView = uiSettings.f1432j;
                bundle.putInt("mappls_logoGravity", logoView != null ? ((FrameLayout.LayoutParams) logoView.getLayoutParams()).gravity : -1);
                int[] iArr2 = uiSettings.f1434l;
                bundle.putInt("mappls_logoMarginLeft", iArr2[0]);
                bundle.putInt("mappls_logoMarginTop", iArr2[1]);
                bundle.putInt("mappls_logoMarginRight", iArr2[2]);
                bundle.putInt("mappls_logoMarginBottom", iArr2[3]);
                LogoView logoView2 = uiSettings.f1432j;
                bundle.putBoolean("mappls_logoEnabled", logoView2 != null && logoView2.getVisibility() == 0);
                bundle.putInt("mappls_logoSize", 0);
                ImageView imageView = uiSettings.f1433k;
                bundle.putInt("mappls_eventGravity", imageView != null ? ((FrameLayout.LayoutParams) imageView.getLayoutParams()).gravity : -1);
                int[] iArr3 = uiSettings.f1435m;
                bundle.putInt("mappls_eventMarginLeft", iArr3[0]);
                bundle.putInt("mappls_eventMarginTop", iArr3[1]);
                bundle.putInt("mappls_eventMarginRight", iArr3[2]);
                bundle.putInt("mappls_eventMarginBottom", iArr3[3]);
                FloorControllerView floorControllerView = uiSettings.f1428f;
                bundle.putInt("mappls_layerControlGravity", floorControllerView != null ? ((FrameLayout.LayoutParams) floorControllerView.getLayoutParams()).gravity : -1);
                int[] iArr4 = uiSettings.f1429g;
                bundle.putInt("mappls_layerControlMarginLeft", iArr4[0]);
                bundle.putInt("mappls_layerControlMarginTop", iArr4[1]);
                bundle.putInt("mappls_layerControlMarginRight", iArr4[2]);
                bundle.putInt("mappls_layerControlMarginBottom", iArr4[3]);
                FloorControllerView floorControllerView2 = uiSettings.f1428f;
                bundle.putBoolean("mappls_layerControlEnabled", floorControllerView2 != null && floorControllerView2.getVisibility() == 0);
                AttributionView attributionView = uiSettings.f1430h;
                bundle.putInt("mappls_attrGravity", attributionView != null ? ((FrameLayout.LayoutParams) attributionView.getLayoutParams()).gravity : -1);
                int[] iArr5 = uiSettings.f1431i;
                bundle.putInt("mappls_attrMarginLeft", iArr5[0]);
                bundle.putInt("mappls_attrMarginTop", iArr5[1]);
                bundle.putInt("mappls_attrMarginRight", iArr5[2]);
                bundle.putInt("mappls_atrrMarginBottom", iArr5[3]);
                AttributionView attributionView2 = uiSettings.f1430h;
                if (attributionView2 != null) {
                    z = attributionView2.getVisibility() == 0;
                }
                bundle.putBoolean("mappls_atrrEnabled", z);
                bundle.putBoolean("mappls_deselectMarkerOnTap", uiSettings.C);
                bundle.putParcelable("mappls_userFocalPoint", uiSettings.D);
            }
        }
    }

    public final void L() {
        if (!this.v) {
            ConnectivityReceiver.c(getContext()).a();
            FileSource.b(getContext()).activate();
            this.v = true;
        }
        MapplsMap mapplsMap = this.f1372l;
        if (mapplsMap != null) {
            mapplsMap.P();
        }
        MapRenderer mapRenderer = this.o;
        if (mapRenderer != null) {
            mapRenderer.onStart();
        }
    }

    public final void M() {
        AttributionClickListener attributionClickListener = this.f1374n;
        if (attributionClickListener != null) {
            attributionClickListener.b.getClass();
            AttributionDialogManager attributionDialogManager = attributionClickListener.a;
            AlertDialog alertDialog = attributionDialogManager.c;
            if (alertDialog != null && alertDialog.isShowing()) {
                attributionDialogManager.c.dismiss();
            }
        }
        if (this.f1372l != null) {
            this.s.a();
            MapplsMap mapplsMap = this.f1372l;
            mapplsMap.f1386n = false;
            LocationComponent locationComponent = mapplsMap.f1382j;
            locationComponent.g();
            MapplsApiConfiguration.getInstance().setLocation(null);
            if (MapplsLMSManager.isInitialised()) {
                MapplsLMSManager.getInstance().setCurrentLocation(null);
            }
            locationComponent.r = false;
        }
        MapRenderer mapRenderer = this.o;
        if (mapRenderer != null) {
            mapRenderer.onStop();
        }
        if (this.v) {
            ConnectivityReceiver.c(getContext()).b();
            FileSource.b(getContext()).deactivate();
            this.v = false;
        }
    }

    public final void N(final Context context, final MapplsMapOptions mapplsMapOptions) {
        if (this.f1367g) {
            G(mapplsMapOptions);
        } else {
            Mappls.getSessionHelper().d(new InitializationListener() {
                @Override
                public final void a(AuthenticationError authenticationError, Exception exc) {
                    MapView mapView = MapView.this;
                    mapView.f1367g = false;
                    int i2 = authenticationError.a;
                    if (i2 == 409) {
                        Mappls.getSessionHelper().a(new IStopSession() {
                            @Override
                            public final void D() {
                                MapView mapView2 = MapView.this;
                                int i3 = MapView.F;
                                mapView2.J(5, "Something went wrong - 104");
                            }

                            @Override
                            public final void onSuccess() {
                                AnonymousClass9 anonymousClass9 = AnonymousClass9.this;
                                MapView.this.N(context, mapplsMapOptions);
                            }
                        });
                        return;
                    }
                    String str = authenticationError.b;
                    if (i2 > 399 && i2 < 500) {
                        mapView.J(i2, str + " - 103");
                        return;
                    }
                    if (i2 == 101 || i2 == 102 || i2 == 103 || i2 == 7 || i2 == 8 || i2 == 9) {
                        mapView.J(i2, str);
                    } else {
                        mapView.J(5, "Something went wrong - 103");
                    }
                }

                @Override
                public final void onSuccess() {
                    MapView mapView = MapView.this;
                    mapView.f1367g = true;
                    mapView.G(mapplsMapOptions);
                }
            });
        }
    }

    public CompassView getCompassView() {
        return this.q;
    }

    @Nullable
    MapplsMap getMapplsMap() {
        return this.f1372l;
    }

    public float getPixelRatio() {
        float f2 = this.f1368h.O;
        return f2 == 0.0f ? getResources().getDisplayMetrics().density : f2;
    }

    @NonNull
    @UiThread
    public View getRenderView() {
        return this.f1373m;
    }

    @Override
    @Nullable
    public Bitmap getViewContent() {
        setDrawingCacheEnabled(true);
        setDrawingCacheQuality(524288);
        buildDrawingCache();
        if (getDrawingCache() == null) {
            return null;
        }
        Bitmap createBitmap = Bitmap.createBitmap(getDrawingCache());
        setDrawingCacheEnabled(false);
        destroyDrawingCache();
        return createBitmap;
    }

    public final void l(OnCameraDidChangeListener onCameraDidChangeListener) {
        this.a.c.add(onCameraDidChangeListener);
    }

    public final void m(OnCameraIsChangingListener onCameraIsChangingListener) {
        this.a.b.add(onCameraIsChangingListener);
    }

    public final void n(OnDidFailLoadingMapListener onDidFailLoadingMapListener) {
        this.a.f1334f.add(onDidFailLoadingMapListener);
    }

    public final void o(OnDidFinishLoadingMapListener onDidFinishLoadingMapListener) {
        this.a.f1333e.add(onDidFinishLoadingMapListener);
    }

    @Override
    public final boolean onGenericMotionEvent(MotionEvent motionEvent) {
        UiSettings uiSettings;
        MapGestureDetector mapGestureDetector = this.s;
        if (mapGestureDetector == null) {
            return super.onGenericMotionEvent(motionEvent);
        }
        mapGestureDetector.getClass();
        if ((motionEvent.getSource() & 2) == 2 && motionEvent.getActionMasked() == 8 && ((uiSettings = mapGestureDetector.c) == null || uiSettings.q)) {
            Transform transform = mapGestureDetector.a;
            transform.b();
            double axisValue = motionEvent.getAxisValue(9);
            PointF pointF = new PointF(motionEvent.getX(), motionEvent.getY());
            NativeMap nativeMap = transform.a;
            nativeMap.c0(nativeMap.d0() + axisValue, pointF);
        } else if (!super.onGenericMotionEvent(motionEvent)) {
            return false;
        }
        return true;
    }

    @Override
    public final boolean onKeyDown(int r18, android.view.KeyEvent r19) {
        throw new UnsupportedOperationException("Method not decompiled: com.mappls.sdk.maps.MapView.onKeyDown(int, android.view.KeyEvent):boolean");
    }

    @Override
    public final boolean onKeyLongPress(int i2, KeyEvent keyEvent) {
        UiSettings uiSettings;
        MapKeyListener mapKeyListener = this.t;
        if (mapKeyListener == null) {
            return super.onKeyLongPress(i2, keyEvent);
        }
        mapKeyListener.getClass();
        if ((i2 != 23 && i2 != 66) || ((uiSettings = mapKeyListener.b) != null && !uiSettings.q)) {
            return super.onKeyLongPress(i2, keyEvent);
        }
        mapKeyListener.c.i(false, new PointF(uiSettings.c.g() / 2.0f, uiSettings.c.d() / 2.0f), true);
        return true;
    }

    @Override
    public final boolean onKeyUp(int i2, KeyEvent keyEvent) {
        MapKeyListener mapKeyListener = this.t;
        if (mapKeyListener == null) {
            return super.onKeyUp(i2, keyEvent);
        }
        mapKeyListener.getClass();
        if (!keyEvent.isCanceled() && (i2 == 23 || i2 == 66)) {
            UiSettings uiSettings = mapKeyListener.b;
            if (uiSettings.q) {
                Projection projection = uiSettings.c;
                mapKeyListener.c.i(true, new PointF(projection.g() / 2.0f, projection.d() / 2.0f), true);
                return true;
            }
        }
        return super.onKeyUp(i2, keyEvent);
    }

    @Override
    public final void onSizeChanged(int i2, int i3, int i4, int i5) {
        NativeMapView nativeMapView;
        if (isInEditMode() || (nativeMapView = this.f1371k) == null) {
            return;
        }
        nativeMapView.n0(i2, i3);
    }

    @Override
    public boolean onTouchEvent(MotionEvent motionEvent) {
        MapGestureDetector mapGestureDetector = this.s;
        if (mapGestureDetector == null) {
            return super.onTouchEvent(motionEvent);
        }
        mapGestureDetector.getClass();
        if (motionEvent != null && (motionEvent.getButtonState() == 0 || motionEvent.getButtonState() == 1)) {
            int actionMasked = motionEvent.getActionMasked();
            Transform transform = mapGestureDetector.a;
            if (actionMasked == 0) {
                mapGestureDetector.a();
                transform.a.G(true);
            }
            boolean onTouchEvent = mapGestureDetector.p.onTouchEvent(motionEvent);
            int actionMasked2 = motionEvent.getActionMasked();
            ArrayList arrayList = mapGestureDetector.f1352m;
            if (actionMasked2 == 1) {
                mapGestureDetector.d();
                transform.a.G(false);
                transform.d();
                if (!arrayList.isEmpty()) {
                    mapGestureDetector.s.removeCallbacksAndMessages(null);
                    Iterator it = arrayList.iterator();
                    while (it.hasNext()) {
                        ((Animator) it.next()).start();
                    }
                    arrayList.clear();
                }
            } else if (actionMasked2 == 3) {
                arrayList.clear();
                transform.a.G(false);
                transform.d();
                mapGestureDetector.d();
            } else if (actionMasked2 == 5) {
                mapGestureDetector.d();
            }
            if (onTouchEvent) {
                return true;
            }
        }
        return super.onTouchEvent(motionEvent);
    }

    @Override
    public final boolean onTrackballEvent(MotionEvent motionEvent) {
        MapKeyListener mapKeyListener = this.t;
        if (mapKeyListener == null) {
            return super.onTrackballEvent(motionEvent);
        }
        mapKeyListener.getClass();
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 0) {
            MapKeyListener.TrackballLongPressTimeOut trackballLongPressTimeOut = mapKeyListener.f1363d;
            if (trackballLongPressTimeOut != null) {
                trackballLongPressTimeOut.a = true;
                mapKeyListener.f1363d = null;
            }
            mapKeyListener.f1363d = mapKeyListener.new TrackballLongPressTimeOut();
            new Handler(Looper.getMainLooper()).postDelayed(mapKeyListener.f1363d, ViewConfiguration.getLongPressTimeout());
            return true;
        }
        UiSettings uiSettings = mapKeyListener.b;
        if (actionMasked != 1) {
            if (actionMasked != 2) {
                if (actionMasked == 3) {
                    MapKeyListener.TrackballLongPressTimeOut trackballLongPressTimeOut2 = mapKeyListener.f1363d;
                    if (trackballLongPressTimeOut2 == null) {
                        return true;
                    }
                    trackballLongPressTimeOut2.a = true;
                    mapKeyListener.f1363d = null;
                    return true;
                }
            } else if (uiSettings.r) {
                mapKeyListener.a.b();
                mapKeyListener.a.f(motionEvent.getX() * (-10.0d), motionEvent.getY() * (-10.0d), 0L);
                return true;
            }
        } else if (uiSettings.q) {
            if (mapKeyListener.f1363d == null) {
                return true;
            }
            Projection projection = uiSettings.c;
            mapKeyListener.c.i(true, new PointF(projection.g() / 2.0f, projection.d() / 2.0f), true);
            return true;
        }
        return super.onTrackballEvent(motionEvent);
    }

    public final void p(OnDidFinishLoadingStyleListener onDidFinishLoadingStyleListener) {
        this.a.f1340l.add(onDidFinishLoadingStyleListener);
    }

    public final void q(OnDidFinishRenderingFrameListener onDidFinishRenderingFrameListener) {
        this.a.f1336h.add(onDidFinishRenderingFrameListener);
    }

    public final void r(RCTMGLMapView rCTMGLMapView) {
        this.a.f1338j.add(rCTMGLMapView);
    }

    public final void s(RCTMGLMapView rCTMGLMapView) {
        this.a.f1342n.add(rCTMGLMapView);
    }

    public void setIsSatellite(boolean z) {
        this.B.setImageResource(z ? R.drawable.mappls_maps_logo_icon : R.drawable.mappls_maps_bhuwan_logo_icon);
    }

    public void setMapplsMap(MapplsMap mapplsMap) {
        this.f1372l = mapplsMap;
    }

    public void setMaximumFps(int i2) {
        MapRenderer mapRenderer = this.o;
        if (mapRenderer == null) {
            throw new IllegalStateException("Calling MapView#setMaximumFps before mapRenderer is created.");
        }
        mapRenderer.setMaximumFps(i2);
    }

    public final void t(RCTMGLMapView rCTMGLMapView) {
        this.a.f1335g.add(rCTMGLMapView);
    }

    public final void u(RCTMGLMapView rCTMGLMapView) {
        this.a.f1337i.add(rCTMGLMapView);
    }

    public final void v(Context context, MapplsMapOptions mapplsMapOptions) {
        this.E = null;
        try {
            if (TextUtils.isEmpty(MapplsAccountManager.getInstance().getMapSDKKey())) {
                J(1, "Map SDK Key is missing.\n\nPlease set it in MapplsAccountManager");
                return;
            }
            if (TextUtils.isEmpty(MapplsAccountManager.getInstance().getRestAPIKey())) {
                J(2, "Rest API Key is missing.\n\nPlease set it in MapplsAccountManager");
                return;
            }
            if (TextUtils.isEmpty(MapplsAccountManager.getInstance().getAtlasClientId())) {
                J(3, "Atlas client ID is missing.\n\nPlease set it in MapplsAccountManager");
                return;
            }
            if (TextUtils.isEmpty(MapplsAccountManager.getInstance().getAtlasClientSecret())) {
                J(4, "Atlas client Secret is missing.\n\nPlease set it in MapplsAccountManager");
                return;
            }
            this.A.setVisibility(4);
            this.y.setVisibility(0);
            setForeground(null);
            F(context, mapplsMapOptions);
        } catch (Exception e2) {
            Timber.b.b(e2);
            J(5, "Something went wrong.Please try again.");
        }
    }

    public final void w(OnMapReadyCallback onMapReadyCallback) {
        MapplsMap mapplsMap = this.f1372l;
        if (mapplsMap == null && this.E == null) {
            this.b.a.add(onMapReadyCallback);
        } else if (mapplsMap != null) {
            onMapReadyCallback.g(mapplsMap);
        } else {
            AuthenticationError authenticationError = this.E;
            onMapReadyCallback.A(authenticationError.a, authenticationError.b);
        }
    }

    public final void x(final Context context, final MapplsMapOptions mapplsMapOptions) {
        if (isInEditMode()) {
            return;
        }
        setForeground(new ColorDrawable(mapplsMapOptions.N));
        this.f1368h = mapplsMapOptions;
        setContentDescription(context.getString(R.string.mappls_maps_mapActionDescription));
        setWillNotDraw(false);
        B(mapplsMapOptions);
        final View inflate = LayoutInflater.from(getContext()).inflate(R.layout.mappls_maps_splash_layout, (ViewGroup) null);
        inflate.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
        this.w = inflate.findViewById(R.id.splash_view);
        Button button = (Button) inflate.findViewById(R.id.map_retry_button);
        this.x = button;
        Context context2 = getContext();
        int i2 = R.color.mappls_maps_light_gray;
        Object obj = ContextCompat.a;
        ViewCompat.E(button, ResourcesCompat.c(context2.getResources(), i2, context2.getTheme()));
        this.y = (TextView) inflate.findViewById(R.id.loading_map_text_view);
        this.z = (TextView) inflate.findViewById(R.id.error_text_view);
        this.A = inflate.findViewById(R.id.map_loading_issue_layout);
        this.w.setVisibility(MapplsMapConfiguration.getInstance().isDeveloperShowingSplash() ? 8 : 0);
        addView(inflate);
        v(context, mapplsMapOptions);
        this.x.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                boolean isInitialised = MapplsLMSManager.isInitialised();
                MapView mapView = MapView.this;
                if (isInitialised) {
                    try {
                        JSONObject jSONObject = new JSONObject();
                        jSONObject.put("event_view", "retry");
                        AuthenticationError authenticationError = mapView.E;
                        if (authenticationError != null) {
                            jSONObject.put("error_code", authenticationError.a);
                            jSONObject.put("error_message", mapView.E.b);
                        }
                        MapplsLMSManager.getInstance().add(C0178h.CLICK_BEACON, "mappls-map", "8.2.6", jSONObject);
                    } catch (JSONException unused) {
                    }
                }
                int i3 = MapView.F;
                mapView.v(context, mapplsMapOptions);
            }
        });
    }

    public final AttributionView y() {
        AttributionView attributionView = new AttributionView(getContext());
        addView(attributionView);
        attributionView.setTag("attrView");
        attributionView.getLayoutParams().width = -2;
        attributionView.getLayoutParams().height = -2;
        attributionView.setAdjustViewBounds(true);
        attributionView.setClickable(true);
        attributionView.setFocusable(true);
        attributionView.setContentDescription(getResources().getString(R.string.mappls_maps_attributionsIconContentDescription));
        attributionView.setImageDrawable(BitmapUtils.b(R.drawable.mappls_maps_info_bg_selector, getContext(), null));
        AttributionClickListener attributionClickListener = new AttributionClickListener(getContext(), this.f1372l);
        this.f1374n = attributionClickListener;
        attributionView.setOnClickListener(attributionClickListener);
        return attributionView;
    }

    public final CompassView z() {
        CompassView compassView = new CompassView(getContext());
        this.q = compassView;
        addView(compassView);
        this.q.setTag("compassView");
        this.q.getLayoutParams().width = -2;
        this.q.getLayoutParams().height = -2;
        this.q.setContentDescription(getResources().getString(R.string.mappls_maps_compassContentDescription));
        CompassView compassView2 = this.q;
        final CameraChangeDispatcher cameraChangeDispatcher = this.f1366f;
        compassView2.f1791d = new MapplsMap.OnCompassAnimationListener() {
            @Override
            public final void a() {
                CompassView compassView3 = MapView.this.q;
                if (compassView3 != null) {
                    compassView3.f1792e = false;
                }
                cameraChangeDispatcher.onCameraIdle();
            }

            @Override
            public final void b() {
                cameraChangeDispatcher.a();
            }
        };
        compassView2.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MapView mapView = MapView.this;
                MapplsMap mapplsMap = mapView.f1372l;
                if (mapplsMap == null || mapView.q == null) {
                    return;
                }
                double d2 = mapplsMap.f1376d.c().bearing;
                PointF pointF = mapView.r;
                if (pointF != null) {
                    MapplsMap mapplsMap2 = mapView.f1372l;
                    float f2 = pointF.x;
                    float f3 = pointF.y;
                    mapplsMap2.O();
                    mapplsMap2.f1376d.a.H(0.0d, f2, f3, 150L);
                } else {
                    MapplsMap mapplsMap3 = mapView.f1372l;
                    float g2 = mapplsMap3.c.g() / 2.0f;
                    float d3 = mapView.f1372l.c.d() / 2.0f;
                    mapplsMap3.O();
                    mapplsMap3.f1376d.a.H(0.0d, g2, d3, 150L);
                }
                cameraChangeDispatcher.b(3);
                CompassView compassView3 = mapView.q;
                compassView3.f1792e = true;
                compassView3.postDelayed(compassView3, 650L);
                if (MapplsLMSManager.isInitialised()) {
                    try {
                        JSONObject jSONObject = new JSONObject();
                        jSONObject.put("event_view", "compass");
                        jSONObject.put("bearing", d2);
                        MapplsLMSManager.getInstance().add(C0178h.CLICK_BEACON, "mappls-map", "8.2.6", jSONObject);
                    } catch (JSONException unused) {
                    }
                }
            }
        });
        return this.q;
    }

    @UiThread
    public MapView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        super(context, attributeSet);
        this.a = new MapChangeReceiver();
        this.b = new MapCallback();
        this.c = new InitialRenderCallback();
        this.f1364d = new FocalPointInvalidator();
        this.f1365e = new GesturesManagerInteractionListener();
        this.f1366f = new CameraChangeDispatcher();
        this.f1367g = false;
        this.f1369i = false;
        this.f1370j = false;
        if (!MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
            x(context, MapplsMapOptions.a(context, attributeSet));
        } else {
            F(context, MapplsMapOptions.a(context, attributeSet));
        }
    }

    @UiThread
    public MapView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i2) {
        super(context, attributeSet, i2);
        this.a = new MapChangeReceiver();
        this.b = new MapCallback();
        this.c = new InitialRenderCallback();
        this.f1364d = new FocalPointInvalidator();
        this.f1365e = new GesturesManagerInteractionListener();
        this.f1366f = new CameraChangeDispatcher();
        this.f1367g = false;
        this.f1369i = false;
        this.f1370j = false;
        if (!MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
            x(context, MapplsMapOptions.a(context, attributeSet));
        } else {
            F(context, MapplsMapOptions.a(context, attributeSet));
        }
    }

    public MapView(Context context, MapplsMapOptions mapplsMapOptions) {
        super(context);
        this.a = new MapChangeReceiver();
        this.b = new MapCallback();
        this.c = new InitialRenderCallback();
        this.f1364d = new FocalPointInvalidator();
        this.f1365e = new GesturesManagerInteractionListener();
        this.f1366f = new CameraChangeDispatcher();
        this.f1367g = false;
        this.f1369i = false;
        this.f1370j = false;
        if (!MapplsMapConfiguration.getInstance().isUsingRasterStyle()) {
            x(context, mapplsMapOptions == null ? MapplsMapOptions.a(context, null) : mapplsMapOptions);
        } else {
            F(context, mapplsMapOptions == null ? MapplsMapOptions.a(context, null) : mapplsMapOptions);
        }
    }
}