正在查看: Petal Maps v4.7.0.310001 应用的 DetailFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Petal Maps v4.7.0.310001 应用的 DetailFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.huawei.maps.poi.ui;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.location.Location;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.TooltipCompat;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.res.ResourcesCompat;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Observer;
import androidx.navigation.fragment.NavHostFragment;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.huawei.hmf.tasks.Task;
import com.huawei.hms.framework.common.NetworkUtil;
import com.huawei.hms.navi.navibase.enums.MapNaviRoutingTip;
import com.huawei.hms.navi.navibase.enums.VehicleType;
import com.huawei.hms.navi.navibase.model.MapNaviPath;
import com.huawei.hms.navi.navibase.model.locationstruct.NaviLatLng;
import com.huawei.hms.support.picker.result.AuthAccountPicker;
import com.huawei.hwidauth.api.Result;
import com.huawei.hwidauth.api.ResultCallBack;
import com.huawei.map.mapapi.CameraUpdateFactory;
import com.huawei.map.mapapi.model.CameraPosition;
import com.huawei.map.mapapi.model.CustomPoi;
import com.huawei.map.mapapi.model.LatLng;
import com.huawei.map.mapapi.model.Marker;
import com.huawei.map.mapapi.model.PointOfInterest;
import com.huawei.map.mapapi.model.Polygon;
import com.huawei.map.mapapi.model.Polyline;
import com.huawei.maps.app.common.utils.RequestIdUtil;
import com.huawei.maps.app.common.utils.task.TaskExecutor;
import com.huawei.maps.app.common.utils.task.TaskRunnable;
import com.huawei.maps.businessbase.R;
import com.huawei.maps.businessbase.bean.CustomGuidesResp;
import com.huawei.maps.businessbase.bean.CustomRecommendDataBean;
import com.huawei.maps.businessbase.bean.GuideInfo;
import com.huawei.maps.businessbase.bean.NavCompleteInfo;
import com.huawei.maps.businessbase.bean.TitleInfo;
import com.huawei.maps.businessbase.comments.PoiCommentResponse;
import com.huawei.maps.businessbase.comments.bean.ChildCommentItem;
import com.huawei.maps.businessbase.comments.bean.ChildComments;
import com.huawei.maps.businessbase.comments.bean.CommentDataInfo;
import com.huawei.maps.businessbase.comments.bean.ImageItemFile;
import com.huawei.maps.businessbase.comments.bean.ImageItemInfo;
import com.huawei.maps.businessbase.comments.bean.MediaComment;
import com.huawei.maps.businessbase.commonenum.MeasurePageSource;
import com.huawei.maps.businessbase.database.collectinfo.CollectDao;
import com.huawei.maps.businessbase.database.collectinfo.CollectFolderInfo;
import com.huawei.maps.businessbase.database.collectinfo.CollectInfo;
import com.huawei.maps.businessbase.database.commonaddress.bean.CommonAddressRecords;
import com.huawei.maps.businessbase.dynamic.callback.DynamicCardCallBack;
import com.huawei.maps.businessbase.dynamic.callback.DynamicCardDataCallBack;
import com.huawei.maps.businessbase.event.ITrafficEventListener;
import com.huawei.maps.businessbase.listener.AnimateCallback;
import com.huawei.maps.businessbase.listener.IMapListener;
import com.huawei.maps.businessbase.listener.OnSettingsWirelessBackListener;
import com.huawei.maps.businessbase.manager.AbstractMapUIController;
import com.huawei.maps.businessbase.manager.FavoritesMakerHelper;
import com.huawei.maps.businessbase.manager.MapHelper;
import com.huawei.maps.businessbase.manager.MapMutableLiveData;
import com.huawei.maps.businessbase.manager.location.AbstractLocationHelper;
import com.huawei.maps.businessbase.manager.routeplan.RouteDataManager;
import com.huawei.maps.businessbase.model.AddressDetail;
import com.huawei.maps.businessbase.model.ChildrenNode;
import com.huawei.maps.businessbase.model.Coordinate;
import com.huawei.maps.businessbase.model.NaviCurRecord;
import com.huawei.maps.businessbase.model.Poi;
import com.huawei.maps.businessbase.model.Site;
import com.huawei.maps.businessbase.model.bean.HotelSourceId;
import com.huawei.maps.businessbase.model.bean.HwLocationType;
import com.huawei.maps.businessbase.model.bean.SatelliteCardData;
import com.huawei.maps.businessbase.model.bus.BusSubway;
import com.huawei.maps.businessbase.model.bus.BusTransportLine;
import com.huawei.maps.businessbase.model.chargestation.CarChargeInfo;
import com.huawei.maps.businessbase.model.chargestation.ChargingStationAmenities;
import com.huawei.maps.businessbase.model.discount.DealsInfo;
import com.huawei.maps.businessbase.model.gasstation.GasStation;
import com.huawei.maps.businessbase.model.hotel.Hotel;
import com.huawei.maps.businessbase.model.industry.Industry;
import com.huawei.maps.businessbase.model.navirecords.RecordSiteInfo;
import com.huawei.maps.businessbase.model.records.Records;
import com.huawei.maps.businessbase.model.restaurant.Menu;
import com.huawei.maps.businessbase.model.restaurant.Restaurant;
import com.huawei.maps.businessbase.network.weaknetwork.NetworkConnectRetryListener;
import com.huawei.maps.businessbase.network.weaknetwork.WeakNetworkRepository;
import com.huawei.maps.businessbase.retrievalservice.bean.BottomMenu;
import com.huawei.maps.businessbase.retrievalservice.bean.HotelCheckInConfig;
import com.huawei.maps.businessbase.retrievalservice.bean.MatchingLanguageCpUrlInfo;
import com.huawei.maps.businessbase.retrievalservice.bean.PoiTicketsInfo;
import com.huawei.maps.businessbase.retrievalservice.bean.ReserveReportData;
import com.huawei.maps.businessbase.retrievalservice.bean.SafeJourneyConfig;
import com.huawei.maps.businessbase.retrievalservice.bean.SafeJourneyUrlInfo;
import com.huawei.maps.businessbase.retrievalservice.bean.WebViewData;
import com.huawei.maps.businessbase.servicepermission.ServicePermission;
import com.huawei.maps.businessbase.servicepermission.ServicePermissionManager;
import com.huawei.maps.businessbase.siteservice.bean.Delivery;
import com.huawei.maps.businessbase.siteservice.bean.HotelDetails;
import com.huawei.maps.businessbase.siteservice.bean.ParkingLotBean;
import com.huawei.maps.businessbase.siteservice.bean.PoiPictureBean;
import com.huawei.maps.businessbase.siteservice.bean.RestaurantDetails;
import com.huawei.maps.businessbase.siteservice.bean.TravelBean;
import com.huawei.maps.businessbase.siteservice.bean.TrivagoThreeParties;
import com.huawei.maps.businessbase.traceless.TracelessModeTips;
import com.huawei.maps.businessbase.ui.BaseActivity;
import com.huawei.maps.businessbase.ui.BaseFragment;
import com.huawei.maps.businessbase.ui.EventObserverFragment;
import com.huawei.maps.businessbase.utils.DatePickerUtil;
import com.huawei.maps.businessbase.utils.DynamicCardAdapterDataKey;
import com.huawei.maps.businessbase.utils.PermissionsUtil;
import com.huawei.maps.businessbase.utils.UgcAgcSwitchUtil;
import com.huawei.maps.businessbase.utils.account.OnAccountFailureListener;
import com.huawei.maps.businessbase.utils.account.OnAccountSuccessListener;
import com.huawei.maps.businessbase.utils.account.bean.Account;
import com.huawei.maps.businessbase.viewmodel.CollectAddressViewModel;
import com.huawei.maps.businessbase.viewmodel.CollectFolderViewModel;
import com.huawei.maps.businessbase.viewmodel.CommonAddressRecordsViewModel;
import com.huawei.maps.businessbase.viewmodel.SearchConfigViewModel;
import com.huawei.maps.businessbase.viewmodel.SearchResultCalendarViewModel;
import com.huawei.maps.businessbase.viewmodel.ShareViewModel;
import com.huawei.maps.businessbase.viewmodel.SpecialLocationViewModel;
import com.huawei.maps.businessbase.weatherrequester.bean.WeatherInfo;
import com.huawei.maps.commonui.model.ScreenDisplayStatus;
import com.huawei.maps.commonui.photogallery.internal.entity.MediaItem;
import com.huawei.maps.commonui.view.MapImageView;
import com.huawei.maps.commonui.view.MapRecyclerView;
import com.huawei.maps.commonui.view.MapSafeWebView;
import com.huawei.maps.commonui.view.MapScrollLayout;
import com.huawei.maps.commonui.view.PopRecyclerHelper;
import com.huawei.maps.commonui.view.popwindow.CustomPopWindow;
import com.huawei.maps.dependencycallback.locationshare.ShareLocationCommonListen;
import com.huawei.maps.diymaps.data.models.PoiBasicInfo;
import com.huawei.maps.diymaps.ui.events.DIYMapsActionEvent;
import com.huawei.maps.diymaps.ui.viewmodels.DIYMapsCreatePoiViewModel;
import com.huawei.maps.dynamic.card.adapter.DynamicCardAdapter;
import com.huawei.maps.dynamic.card.adapter.DynamicPoiCommentAdapter;
import com.huawei.maps.dynamic.card.bean.HighlightCommentBean;
import com.huawei.maps.dynamic.card.bean.HotelReservationCardBean;
import com.huawei.maps.dynamic.card.bean.ImageClickCallBackBean;
import com.huawei.maps.dynamic.card.bean.MeetkaiAdvertisementCardBean;
import com.huawei.maps.dynamic.card.bean.PoiLikeAction;
import com.huawei.maps.dynamic.card.bean.operate.RouteCardInfo;
import com.huawei.maps.dynamic.card.contact.CommentViewHolderListener;
import com.huawei.maps.dynamic.card.model.CountryGuideData;
import com.huawei.maps.dynamic.card.model.TopCitiesItem;
import com.huawei.maps.dynamic.card.stat.CardScrollStatus;
import com.huawei.maps.dynamic.card.utils.PoiOperateEnum;
import com.huawei.maps.dynamic.card.viewholder.DynamicCardNearbySubwayBusRecommendationsCardHolder;
import com.huawei.maps.dynamic.card.viewholder.SpacesItemBottomDecoration;
import com.huawei.maps.dynamic.card.viewmodel.ReservationViewModel;
import com.huawei.maps.dynamiccard.databinding.DynamicViewCommentTipPopWindowBinding;
import com.huawei.maps.dynamiccard.databinding.DynamicViewMoreTipPopWindowBinding;
import com.huawei.maps.imagepicker.bean.FileItem;
import com.huawei.maps.imagepicker.listener.OnSelectResultListener;
import com.huawei.maps.poi.R$color;
import com.huawei.maps.poi.R$dimen;
import com.huawei.maps.poi.R$drawable;
import com.huawei.maps.poi.R$id;
import com.huawei.maps.poi.R$layout;
import com.huawei.maps.poi.R$plurals;
import com.huawei.maps.poi.R$string;
import com.huawei.maps.poi.bean.DynamicPoiDetailBean;
import com.huawei.maps.poi.bean.DynamicPoiDetailLocalDataBean;
import com.huawei.maps.poi.bean.DynamicSiteBean;
import com.huawei.maps.poi.collect.ICollectStrategy;
import com.huawei.maps.poi.comment.viewmodel.ApiCommentViewModel;
import com.huawei.maps.poi.comment.viewmodel.CommentViewModel;
import com.huawei.maps.poi.common.PoiConstants$CommentType;
import com.huawei.maps.poi.common.mediauploader.MediaProgressCallback;
import com.huawei.maps.poi.databinding.LayoutDetailBottomMorePopWindowBinding;
import com.huawei.maps.poi.databinding.LayoutSiteDetailBinding;
import com.huawei.maps.poi.databinding.LayoutSiteDetailBottomBinding;
import com.huawei.maps.poi.meetkaiads.viewmodel.MeetkaiPlaceAdsViewModel;
import com.huawei.maps.poi.model.Data;
import com.huawei.maps.poi.model.DetailOptions;
import com.huawei.maps.poi.model.GooglResponse;
import com.huawei.maps.poi.model.PoiPictureListResponse;
import com.huawei.maps.poi.model.VMInPoiModule;
import com.huawei.maps.poi.nearby.NearbyFeedData;
import com.huawei.maps.poi.openstate.bean.PoiOpenStateInfo;
import com.huawei.maps.poi.service.bean.NearbySearchRequest;
import com.huawei.maps.poi.service.bean.SearchNearbyResponse;
import com.huawei.maps.poi.ugc.fragment.MapSubmitSuccessDialogType;
import com.huawei.maps.poi.ugc.service.bean.McConstant;
import com.huawei.maps.poi.ugc.utils.PoiReportCommonUtil;
import com.huawei.maps.poi.ui.DetailFragment;
import com.huawei.maps.poi.ui.DetailUIHandler;
import com.huawei.maps.poi.ui.detail.model.PoiType;
import com.huawei.maps.poi.utils.CollectHelper;
import com.huawei.maps.poi.utils.DetailReportUtil;
import com.huawei.maps.poi.viewmodel.BottomViewModel;
import com.huawei.maps.poi.viewmodel.DetailViewModel;
import com.huawei.maps.poi.viewmodel.SummaryTranslateViewModel;
import com.huawei.maps.ugc.data.models.comments.commentcreate.CommentInfo;
import com.huawei.maps.ugc.data.models.comments.commentcreate.ParentCommentInfo;
import com.huawei.maps.ugc.data.models.comments.commentcreate.PoiCommentInfo;
import com.huawei.maps.ugc.data.models.comments.commentdelete.CommentDelete;
import com.huawei.maps.ugc.data.models.comments.commentdelete.McPoiCommentType;
import com.huawei.maps.ugc.data.models.comments.commentdelete.PoiInfo;
import com.huawei.maps.ugc.data.models.comments.commentlike.CommentLikeInfo;
import com.huawei.maps.ugc.data.models.comments.commentreplies.CommentReplyInputModel;
import com.huawei.maps.ugc.ui.events.comments.commentreplies.CommentReplyUIEvent;
import com.huawei.maps.ugc.ui.events.comments.commenttranslate.TranslationEvent;
import com.huawei.maps.ugc.ui.fragments.comments.commenstinpoidetail.CommentsInPoiDetailFragment;
import com.huawei.maps.ugc.ui.viewmodels.comments.CommentStateViewModel;
import com.huawei.maps.ugc.ui.viewmodels.comments.CommentsViewModel;
import com.huawei.maps.ugc.ui.viewmodels.comments.cityid.CityIdViewModel;
import com.huawei.maps.ugc.ui.viewmodels.comments.commentlike.CommentLikeViewModel;
import com.huawei.maps.ugc.ui.viewmodels.comments.commentreplies.CommentRepliesSharedViewModel;
import com.huawei.maps.ugc.ui.viewmodels.comments.commenttranslate.TranslationViewModel;
import com.huawei.secure.android.common.intent.IntentUtils;
import com.huawei.secure.android.common.intent.SafeBundle;
import com.huawei.secure.android.common.intent.SafeIntent;
import com.huawei.secure.android.common.intent.SafeUri;
import com.huawei.secure.android.common.util.UrlUtil;
import defpackage.SummaryCardUIState;
import defpackage.a07;
import defpackage.a32;
import defpackage.b37;
import defpackage.bz3;
import defpackage.cv1;
import defpackage.cz3;
import defpackage.d32;
import defpackage.e32;
import defpackage.e40;
import defpackage.et0;
import defpackage.f86;
import defpackage.ho;
import defpackage.jz0;
import defpackage.m72;
import defpackage.pc;
import defpackage.pw1;
import defpackage.qp6;
import defpackage.t07;
import defpackage.v12;
import defpackage.vq0;
import defpackage.x22;
import defpackage.x9a;
import java.io.IOException;
import java.net.URISyntaxException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Stack;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
public class DetailFragment extends EventObserverFragment<LayoutSiteDetailBinding> implements ICollectStrategy, ITrafficEventListener, NetworkConnectRetryListener {
public static final String[] f2 = {"image/jpeg", "image/png", "image/jpg", "image/gif", "image/webp"};
public String A0;
public String[] B0;
public int C0;
public String D0;
public String F;
public ReservationViewModel F0;
public DetailUIHandler G;
public SearchResultCalendarViewModel G0;
public HighlightCommentBean H0;
public List<CommentDataInfo> J0;
public DetailOptions K;
public TabLayout K0;
public CollectHelper L;
public TabLayout.e L0;
public TabLayout.e M0;
public BottomViewModel N;
public TabLayout.e N0;
public VMInPoiModule O;
public TabLayout.e O0;
public CollectFolderViewModel P;
public TabLayout.e P0;
public CollectInfo Q;
public RecyclerSmoothScroller Q0;
public r R;
public CommentReplyInputModel R0;
public CommentRepliesSharedViewModel S;
public pc S0;
public float T;
public CommentsInPoiDetailFragment T0;
public DynamicPoiDetailBean U;
public CommentsViewModel U0;
public DynamicPoiDetailLocalDataBean V;
public List<MediaItem> V0;
public DynamicCardAdapter W;
public CommentViewModel X0;
public CityIdViewModel Y0;
public SpecialLocationViewModel Z0;
public q b0;
public DetailViewModel c;
public int d;
public TranslationViewModel e;
public SummaryTranslateViewModel f;
public long g0;
public List<Polygon> h;
public boolean i;
public boolean i0;
public ShareViewModel j;
public Site j0;
public MeetkaiPlaceAdsViewModel k;
public SearchConfigViewModel l;
public ApiCommentViewModel m;
public List<NaviLatLng> m0;
public CommentStateViewModel n;
public List<NaviLatLng> n0;
public CommentLikeViewModel o;
public DIYMapsCreatePoiViewModel p;
public LayoutSiteDetailBottomBinding q;
public LayoutDetailBottomMorePopWindowBinding r;
public DynamicViewMoreTipPopWindowBinding s;
public DynamicViewCommentTipPopWindowBinding t;
public CustomPopWindow u;
public CustomPopWindow v;
public int w;
public boolean y;
public List<Polyline> g = new ArrayList();
public int x = 0;
public boolean z = false;
public boolean A = false;
public boolean B = false;
public boolean C = false;
public boolean D = false;
public boolean E = false;
public boolean H = true;
public boolean I = true;
public boolean J = true;
public JsonObject a0 = null;
public boolean c0 = false;
public final Stack<DetailOptions> d0 = new Stack<>();
public HashMap<String, Function<Object, Void>> e0 = new HashMap<>();
public boolean f0 = false;
public int h0 = 20000;
public boolean k0 = false;
public boolean l0 = false;
public boolean o0 = false;
public boolean p0 = false;
public boolean q0 = false;
public boolean r0 = false;
public int s0 = 0;
public boolean t0 = false;
public boolean u0 = false;
public boolean v0 = false;
public boolean w0 = false;
public boolean x0 = true;
public boolean y0 = false;
public boolean z0 = false;
public boolean E0 = false;
public boolean I0 = false;
public List<FileItem> W0 = new ArrayList();
public boolean a1 = false;
public String b1 = "";
public boolean c1 = false;
public kt3 d1 = new h();
public TabLayout.OnTabSelectedListener e1 = new i();
public Observer<Pair<Integer, CommentViewModel.a>> f1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.h6((Pair) obj);
}
};
public RecyclerView.OnScrollListener g1 = CardScrollStatus.a.a();
public final Observer<DetailOptions> h1 = new j();
public final Observer<SearchNearbyResponse> i1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.M6((SearchNearbyResponse) obj);
}
};
public final Observer<SearchNearbyResponse> j1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.X6((SearchNearbyResponse) obj);
}
};
public final Observer<Boolean> k1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.f7((Boolean) obj);
}
};
public final Observer<Pair<Integer, CommentDelete>> l1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.h7((Pair) obj);
}
};
public final Observer<Boolean> m1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.i7((Boolean) obj);
}
};
public final Observer<CommentReplyUIEvent> n1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.i6((CommentReplyUIEvent) obj);
}
};
public final Observer<Pair<Integer, CommentViewModel.a>> o1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.j6((Pair) obj);
}
};
public final Observer<CommentDelete> p1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.k6((CommentDelete) obj);
}
};
public final Observer<Boolean> q1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.l6((Boolean) obj);
}
};
public final Observer<List<th1>> r1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.m6((List) obj);
}
};
public final Observer<WeatherInfo> s1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.n6((WeatherInfo) obj);
}
};
public final Observer<String> t1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.o6((String) obj);
}
};
public final Observer<String> u1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.p6((String) obj);
}
};
public final Observer<CustomGuidesResp> v1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.q6((CustomGuidesResp) obj);
}
};
public final Observer<CustomRecommendDataBean> w1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.r6((CustomRecommendDataBean) obj);
}
};
public final Observer<CountryGuideData> x1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.s6((CountryGuideData) obj);
}
};
public final Observer<String> y1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.t6((String) obj);
}
};
public final Observer<Boolean> z1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.u6((Boolean) obj);
}
};
public final Observer<Site> A1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.v6((Site) obj);
}
};
public final Observer<Boolean> B1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.w6((Boolean) obj);
}
};
public final Observer<Boolean> C1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.x6((Boolean) obj);
}
};
public final Observer<Boolean> D1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.y6((Boolean) obj);
}
};
public final Observer<Boolean> E1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.z6((Boolean) obj);
}
};
public final Observer<Boolean> F1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.B6((Boolean) obj);
}
};
public final Observer<Hotel> G1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.C6((Hotel) obj);
}
};
public final Observer<List<TravelBean>> H1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.D6((List) obj);
}
};
public final Observer<List<HotelDetails>> I1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.E6((List) obj);
}
};
public final Observer<List<HotelDetails>> J1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.F6((List) obj);
}
};
public final Observer<List<TrivagoThreeParties>> K1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.G6((List) obj);
}
};
public final Observer<List<RestaurantDetails>> L1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.I6((List) obj);
}
};
public final Observer<Restaurant> M1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.J6((Restaurant) obj);
}
};
public final Observer<Delivery> N1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.L6((Delivery) obj);
}
};
public final Observer<GasStation> O1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.O6((GasStation) obj);
}
};
public final Observer<DealsInfo> P1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.P6((DealsInfo) obj);
}
};
public final Observer<Industry> Q1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.Q6((Industry) obj);
}
};
public final Observer<BusSubway> R1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.R6((BusSubway) obj);
}
};
public final Observer<List<Menu>> S1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.S6((List) obj);
}
};
public final Observer<ParkingLotBean> T1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.T6((ParkingLotBean) obj);
}
};
public final Observer<CarChargeInfo> U1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.Y6((CarChargeInfo) obj);
}
};
public final Observer<String> V1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.Z6((String) obj);
}
};
public final Observer<PoiPictureListResponse> W1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.a7((PoiPictureListResponse) obj);
}
};
public final Observer<SummaryCardUIState> X1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.b7((SummaryCardUIState) obj);
}
};
public final Observer<r3a> Y1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.c7((r3a) obj);
}
};
public final Observer<Boolean> Z1 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.d7((Boolean) obj);
}
};
public final Observer<NearbyFeedData> a2 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.e7((NearbyFeedData) obj);
}
};
public final Observer<om1> b2 = new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.g7((om1) obj);
}
};
public boolean c2 = false;
public boolean d2 = true;
public MapScrollLayout.Status e2 = MapScrollLayout.Status.COLLAPSED;
public interface CardUpdateCallback {
void endUpdate();
}
public static class DynamicSmoothScroller extends LinearSmoothScroller {
public DynamicSmoothScroller(Context context) {
super(context);
}
public int getVerticalSnapPreference() {
return -1;
}
}
public static class RecyclerSmoothScroller extends LinearSmoothScroller {
public RecyclerSmoothScroller(Context context) {
super(context);
}
public float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
return 20.0f / displayMetrics.densityDpi;
}
public int getVerticalSnapPreference() {
return -1;
}
}
public class a implements Runnable {
public final Site a;
public a(Site site) {
this.a = site;
}
@Override
public void run() {
DetailFragment.this.p8(this.a);
}
}
public class b implements AnimateCallback {
public b() {
}
public void onCancel() {
CameraPosition n2 = MapHelper.F2().n2();
if (qc6.c(n2)) {
DetailFragment.this.T = n2.zoom;
}
}
public void onFinish() {
CameraPosition n2 = MapHelper.F2().n2();
if (qc6.c(n2)) {
DetailFragment.this.T = n2.zoom;
}
}
}
public class c implements Runnable {
public c() {
}
@Override
public void run() {
if (DetailFragment.this.G != null) {
DetailFragment.this.G.M();
}
}
}
public class d implements ShareLocationCommonListen {
public d() {
}
public void onQueryPrivacySwitchResult() {
if (DetailFragment.this.N != null) {
DetailFragment.this.N.h.postValue(Boolean.FALSE);
}
DetailFragment.this.E4();
}
public void onQueryPrivacySwitchResultFail() {
if (DetailFragment.this.N != null) {
DetailFragment.this.N.h.postValue(Boolean.FALSE);
}
cz9.k(o41.f(R$string.connect_failed));
}
}
public class e implements IMapListener {
public e() {
}
public void onCustomPoiClick(CustomPoi customPoi) {
if (customPoi.getTag() == null || !(customPoi.getTag() instanceof ChildrenNode)) {
return;
}
DetailReportUtil.l();
ChildrenNode childrenNode = (ChildrenNode) customPoi.getTag();
MapHelper.F2().t3(customPoi);
Site p = com.huawei.maps.poi.utils.c.p(childrenNode);
DetailFragment.this.d0.push(DetailFragment.this.K);
DetailFragment.this.da(d32.b(p));
DetailFragment detailFragment = DetailFragment.this;
detailFragment.e9(detailFragment.d0.size() == 0);
}
}
public class f implements Runnable {
public f() {
}
@Override
public void run() {
DetailFragment.this.y9();
}
}
public class g extends TaskRunnable {
public g() {
}
public String getClassName() {
return "DetailFragment";
}
public void run() {
r26.a.a(DetailFragment.this, R$id.detail_to_simultaneous_translation, (Bundle) null);
DetailFragment.this.t8();
}
}
public class h extends kt3 {
public h() {
}
public void onCalculateRouteSuccess(int[] iArr, MapNaviRoutingTip mapNaviRoutingTip) {
DetailFragment.this.P3(it3.x().getNaviPath());
}
public void onCalculateWalkRouteFailure(int i) {
hm4.p("DetailFragment", "mDriveRouteListener onCalculateWalkRouteFailure");
}
public void onCalculateWalkRouteSuccess(int[] iArr, MapNaviRoutingTip mapNaviRoutingTip) {
DetailFragment.this.P3(it3.x().getNaviPath());
}
}
public class j implements Observer<DetailOptions> {
public j() {
}
public void onChanged(DetailOptions detailOptions) {
if (detailOptions == null) {
DetailFragment.this.a9(true);
MapHelper.F2().m6();
MapHelper.F2().M6(true);
AbstractMapUIController.getInstance().hideBottomNav();
return;
}
detailOptions.setInvalidPoi(false);
DetailFragment.this.N9(detailOptions);
if (detailOptions.isCollectSite()) {
detailOptions.showCenter(true);
}
DetailFragment.this.K = detailOptions;
DetailFragment.this.L.d0(DetailFragment.this.K.isCollectSite());
DetailFragment.this.T9();
if (jh8.v()) {
DetailFragment.this.T3();
} else if (jh8.x()) {
DetailFragment.this.R3();
} else {
DetailFragment.this.S3();
}
if (DetailFragment.this.o0) {
return;
}
if (DetailFragment.this.c != null) {
DetailFragment.this.c.R.setValue(Boolean.FALSE);
}
DetailFragment detailFragment = DetailFragment.this;
detailFragment.ca(detailFragment.K);
DetailFragment.this.m8();
}
}
public class l implements ViewTreeObserver.OnGlobalLayoutListener {
public l() {
}
@Override
public void onGlobalLayout() {
if (DetailFragment.this.K0 == null || DetailFragment.this.K0.getViewTreeObserver() == null) {
return;
}
DetailFragment.this.K0.getViewTreeObserver().removeOnGlobalLayoutListener(this);
for (int i = 0; i < DetailFragment.this.K0.getTabCount(); i++) {
DetailFragment detailFragment = DetailFragment.this;
detailFragment.q9(detailFragment.K0.x(i));
}
}
}
public class m implements IMapListener {
public m() {
}
public void onCameraIdle(LatLng latLng, float f) {
AbstractMapUIController.getInstance().setLastCameraPosition(CameraPosition.builder().target(latLng).build());
}
public void onCameraMove() {
if (DetailFragment.this.c == null || DetailFragment.this.c.n == null || DetailFragment.this.c.n.getValue() == null) {
hm4.h("DetailFragment", "setMapListener -- site.getValue is null");
} else {
DetailFragment.this.a4();
}
}
public void onCameraMoveStarted(int i) {
if (i == 1) {
DetailFragment.this.t0 = true;
}
}
public void onMarkerClick(Marker marker) {
DetailFragment.this.Z8();
DetailFragment.this.N8();
DetailFragment.this.M8();
DetailFragment.this.da(d32.n(marker));
}
}
public class n implements Runnable {
public final Site a;
public final String b;
public n(Site site, String str) {
this.a = site;
this.b = str;
}
public final void b(int i) {
if (i <= 0) {
DetailFragment.this.N.j.setValue(o41.i(o41.c(), R$drawable.ic_add_location, R$color.color_bg_normal));
DetailFragment.this.N.k.setValue(Integer.valueOf(R$string.add));
DetailFragment.this.q.llDirection.setAlpha(1.0f);
DetailFragment.this.q.llDirection.setClickable(true);
return;
}
DetailFragment.this.N.j.setValue((Object) null);
DetailFragment.this.N.g.setValue(8);
DetailFragment.this.N.k.setValue(Integer.valueOf(R$string.map_site_added));
DetailFragment.this.q.llDirection.setAlpha(0.4f);
DetailFragment.this.q.llDirection.setClickable(false);
}
@Override
public void run() {
CollectDao collectDao = qu0.c().b().collectDao();
String a = x52.a(e4.a().getUid());
Site site = this.a;
if (site == null) {
return;
}
final int qryCountBySiteAndFolderName = (DetailOptions.LONG_CLICK.equals(site.getPoiType()) || "[Marked Location]".equals(this.a.getName())) ? collectDao.qryCountBySiteAndFolderName(a, this.b, this.a.getLocation().getLat(), this.a.getLocation().getLng()) : collectDao.qryCountBySiteAndFolderName(a, this.b, this.a.getSiteId());
fk2.b(new Runnable() {
@Override
public final void run() {
DetailFragment.n.this.b(qryCountBySiteAndFolderName);
}
});
}
}
public class o implements Runnable {
public o() {
}
@Override
public void run() {
if (((BaseFragment) DetailFragment.this).mBinding != null) {
((LayoutSiteDetailBinding) ((BaseFragment) DetailFragment.this).mBinding).appBar.t(true, false);
}
}
}
public class p implements OnSettingsWirelessBackListener {
public p() {
}
public void onSettingsWirelessBack() {
if (qk9.r()) {
if (DetailFragment.this.c == null || !DetailFragment.this.i) {
DetailFragment.this.m8();
return;
}
DetailFragment.this.c.N.setValue(DetailFragment.this.F);
DetailFragment.this.c.O.setValue(Boolean.TRUE);
DetailFragment.this.M3(true);
DetailFragment.this.c.Q.setValue(Boolean.FALSE);
}
}
}
public class q {
public class a implements Runnable {
public final View a;
public a(View view) {
this.a = view;
}
@Override
public void run() {
int b = ct3.b(o41.c(), 12.0f);
int[] iArr = new int[2];
this.a.getLocationInWindow(iArr);
int i = iArr[0];
int i2 = iArr[1];
hm4.p("DetailFragment", "onMoreBtnClick locationX = " + i + ", locationY = " + i2);
if (i2 == 0 || i == 0) {
return;
}
DetailFragment.this.v.r(this.a, 8388693, ((ct3.y(o41.c()) - i) - (this.a.getWidth() / 2)) - b, ct3.u() - i2);
}
}
public q() {
}
public static void f(BottomViewModel bottomViewModel) {
bottomViewModel.d.setValue(8);
}
public final void b(Site site) {
if (site != null) {
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", site);
PoiReportCommonUtil.m0(DetailFragment.this, R$id.action_detailFragment_to_roadDoesNotExistFragment, safeBundle.getBundle());
}
}
public final void c(Site site) {
if (site != null) {
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", site);
if (tha.b(e32.l(site))) {
cz9.k(o41.f(R$string.no_network));
DetailFragment.this.q.detailBottomLayout.setVisibility(0);
} else {
safeBundle.putParcelableArrayList("road point list", (ArrayList) e32.l(site));
safeBundle.putInt("modify issue type index", 0);
RouteDataManager.b().M("SEARCH_SPEED_BUMP");
PoiReportCommonUtil.m0(DetailFragment.this, R$id.detail_to_speed_bump_fragment, safeBundle.getBundle());
}
}
}
public final void d(Site site) {
if (site != null) {
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", site);
if (tha.b(e32.l(site))) {
cz9.k(o41.f(R$string.no_network));
DetailFragment.this.q.detailBottomLayout.setVisibility(0);
} else {
safeBundle.putParcelableArrayList("road point list", (ArrayList) e32.l(site));
safeBundle.putInt("modify issue type index", 0);
RouteDataManager.b().M("SEARCH_SPEED_LIMIT");
PoiReportCommonUtil.m0(DetailFragment.this, R$id.detail_to_speed_limit_fragment, safeBundle.getBundle());
}
}
}
public final void e(Site site) {
if (site != null) {
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", site);
if (tha.b(e32.l(site))) {
cz9.k(o41.f(R$string.no_network));
DetailFragment.this.q.detailBottomLayout.setVisibility(0);
} else {
safeBundle.putParcelableArrayList("road point list", (ArrayList) e32.l(site));
safeBundle.putInt("modify issue type index", 1);
RouteDataManager.b().M("SEARCH_MODIFY_ROAD_INFORMATION");
PoiReportCommonUtil.m0(DetailFragment.this, R$id.detail_to_modify_road_fragment, safeBundle.getBundle());
}
}
}
public void g() {
MapHelper.F2().v1(false);
Site site = (Site) DetailFragment.this.c.n.getValue();
if (site == null) {
hm4.z("DetailFragment", "ClickProxy onBottomBtnClick site is null ");
return;
}
MapHelper.F2().X7(false);
MapHelper.F2().z6(false);
DetailFragment.this.w0 = true;
hm4.p("DetailFragment", "onBottomBtnClick");
if (qc6.c(DetailFragment.this.K) && DetailFragment.this.K.isLocationMarkerClick() && zu1.b()) {
DetailFragment.this.C8();
return;
}
if (DetailFragment.this.q != null && !RouteDataManager.b().o()) {
DetailFragment.this.q.detailBottomLayout.setVisibility(8);
}
DetailReportUtil.q(site.getSiteId());
if (qc6.c(DetailFragment.this.K) && DetailFragment.this.K.isFromNavComplete()) {
NavCompleteInfo navCompleteInfo = new NavCompleteInfo();
navCompleteInfo.setSite(site);
navCompleteInfo.setCommuteType(DetailFragment.this.K.getAddressType());
RouteDataManager.b().H(navCompleteInfo);
jh8.i().postValue(site);
try {
NavHostFragment.findNavController(DetailFragment.this).navigateUp();
return;
} catch (IllegalArgumentException unused) {
hm4.h("DetailFragment", "navigation destination is unknown to this NavController");
return;
}
}
boolean z = DetailFragment.this.o0 || (qc6.c(DetailFragment.this.K) && DetailFragment.this.K.isFromCollectOrFavorite());
if ((jh8.F() || (z && zu1.a())) && !jh8.v() && !jh8.A()) {
DetailFragment.this.savePageStatus();
if (DetailFragment.this.isAdded()) {
DetailFragment.this.c.E.setValue(Boolean.TRUE);
DetailFragment.this.h0 = 20001;
if (DetailFragment.this.K != null) {
site.setIsNewPoiType(DetailFragment.this.K.getPoiType() == McConstant.McPoiOperationType.NEW);
AbstractMapUIController.getInstance().startNavigation(DetailFragment.this.getActivity(), site, DetailFragment.this.K.isFromCollectOrFavorite());
if (!DetailFragment.this.K.isFromCollectOrFavorite() && TextUtils.isEmpty(DetailFragment.this.K.getGooglUrl()) && !DetailFragment.this.K.isGeo() && !DetailFragment.this.o0) {
s(site);
DetailFragment.this.saveDetailClickRecord(site);
}
}
}
DetailReportUtil.t0(DetailFragment.this.K);
AbstractMapUIController.getInstance().setDisableExpendForNavi(true);
DetailFragment.this.A = true;
DetailReportUtil.D(MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE, DetailFragment.this.K.isMapLongClick());
DetailReportUtil.L(site, DetailFragment.this.K, PoiOperateEnum.POI_ROUTE.getType());
DetailReportUtil.l0(DetailFragment.this.d0.size() == 0, "routePlan", site.getSiteId());
return;
}
if (jh8.v() && DetailFragment.this.isAdded()) {
jh8.i().postValue(site);
MapHelper.F2().j6();
return;
}
if ((jh8.D() || jh8.A()) && DetailFragment.this.isAdded()) {
boolean j = f51.f().j();
String g = f51.f().g();
if (!TextUtils.isEmpty(g)) {
q41.j(j, g);
}
if (DetailFragment.this.K != null && DetailFragment.this.K.isLocationMarkerClick()) {
site.setMyLocation(true);
}
jh8.W(false);
s(site);
DetailFragment.this.saveDetailClickRecord(site, false);
AbstractLocationHelper.getInstance().resetLocationMarker();
try {
if (RouteDataManager.b().q()) {
b(site);
} else if (RouteDataManager.b().p()) {
e(site);
} else if (RouteDataManager.b().s()) {
d(site);
} else if (RouteDataManager.b().r()) {
c(site);
} else if (!RouteDataManager.b().o()) {
MapHelper.F2().Q5();
ux4.g(DetailFragment.this);
} else {
if (Objects.equals(DetailFragment.this.N.k.getValue(), Integer.valueOf(R$string.explore_comment_posted))) {
return;
}
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", site);
safeBundle.putBoolean("comment_service_online", DetailFragment.this.E0);
ux4.c(DetailFragment.this, R$id.detail_to_create_post, safeBundle.getBundle());
}
} catch (IllegalArgumentException unused2) {
hm4.h("DetailFragment", "navigation destination is unknown to this NavController");
}
}
if (jh8.K() && DetailFragment.this.isAdded()) {
try {
NavHostFragment.findNavController(DetailFragment.this).navigateUp();
} catch (IllegalArgumentException unused3) {
hm4.h("DetailFragment", "navigation destination is unknown to this NavController");
}
}
DetailReportUtil.r();
if (RouteDataManager.b().B()) {
jh8.f().setValue(site);
RouteDataManager.b().J(true);
} else if (RouteDataManager.b().C()) {
hm4.p("DetailFragment", "team map set setValue DetailFragment");
jh8.o().setValue(site);
} else {
DetailFragment.this.h0 = 20001;
jh8.j0(site);
}
}
public void h() {
AbstractMapUIController.getInstance().setIsExposureForPRC(false);
AbstractMapUIController.getInstance().setIsExposureForPDC(false);
MapHelper.F2().v1(false);
MapHelper.F2().d7(true);
MapHelper.F2().c7("");
xu0.i().r(true);
if (DetailFragment.this.c != null) {
DetailFragment.this.c.f().removeObserver(DetailFragment.this.j1);
DetailFragment.this.c.g().removeObserver(DetailFragment.this.i1);
}
if (DetailFragment.this.c == null || !DetailFragment.this.i) {
DetailFragment.this.onBackPressed();
return;
}
if (qc6.c(DetailFragment.this.G) && DetailFragment.this.G.P0((LayoutSiteDetailBinding) ((BaseFragment) DetailFragment.this).mBinding)) {
return;
}
DetailFragment.this.i = false;
MapMutableLiveData<Boolean> mapMutableLiveData = DetailFragment.this.c.P;
Boolean bool = Boolean.FALSE;
mapMutableLiveData.setValue(bool);
DetailFragment.this.c.O.setValue(bool);
DetailFragment.this.M3(false);
DetailFragment.this.c.Q.setValue(bool);
((LayoutSiteDetailBinding) ((BaseFragment) DetailFragment.this).mBinding).searchWeb.o((String) null, "", "text/html", "utf-8", (String) null);
DetailFragment.this.c.s.setValue(0);
ve8.p().p0(true);
long currentTimeMillis = System.currentTimeMillis();
ug3.c(String.valueOf(currentTimeMillis > DetailFragment.this.g0 ? currentTimeMillis - DetailFragment.this.g0 : 0L));
ve8.p().V(true);
ve8.p().U(false);
}
public void i() {
if (!qk9.r()) {
cz9.k(o41.f(R$string.no_network));
return;
}
Site site = (Site) DetailFragment.this.N.a.getValue();
DetailFragment.this.I0 = true;
DetailReportUtil.l0(DetailFragment.this.d0.size() == 0, "collect", site == null ? null : site.getSiteId());
if (DetailFragment.this.j != null) {
DetailFragment.this.j.a().postValue(Boolean.TRUE);
}
DetailReportUtil.q(site != null ? site.getSiteId() : null);
DetailReportUtil.s(DetailFragment.this.K);
DetailReportUtil.D(MapSubmitSuccessDialogType.IS_FROM_POI_UGC, DetailFragment.this.K.isMapLongClick());
DetailReportUtil.L(site, DetailFragment.this.K, PoiOperateEnum.POI_COLLECT.getType());
}
public void j(View view) {
if (o72.c(R$id.iv_more)) {
return;
}
DetailFragment.this.v = null;
View root = DetailFragment.this.r.getRoot();
DetailFragment.this.r.setIsDark(((BaseFragment) DetailFragment.this).isDark);
root.measure(0, 0);
DetailFragment detailFragment = DetailFragment.this;
detailFragment.v = new CustomPopWindow.PopupWindowBuilder(detailFragment.getActivity()).e(root).f(-2, -2).a();
DetailFragment.this.v.p().setBackgroundDrawable(ResourcesCompat.getDrawable(DetailFragment.this.getResources(), R$drawable.shape_more_pop_window_bg, (Resources.Theme) null));
view.post(new a(view));
}
public void k() {
jh8.e().setValue(0);
}
public void l() {
String str;
String str2;
String str3;
String str4;
if (o72.c(R$id.iv_petal_travels)) {
return;
}
Location v = com.huawei.maps.businessbase.manager.location.a.v();
if (v != null) {
str = v.getLongitude() + "," + v.getLatitude();
str2 = "我的位置";
} else {
str = "";
str2 = str;
}
Site site = (Site) DetailFragment.this.c.n.getValue();
if (site == null || site.getLocation() == null) {
hm4.p("DetailFragment", "select site is null!");
str3 = "";
str4 = str3;
} else {
String str5 = site.getLocation().getLng() + "," + site.getLocation().getLat();
str4 = site.getName();
str3 = str5;
}
tx6.g().t(DetailFragment.this.getContext(), str, str2, str3, str4, "poi_detail");
}
public void m(String str) {
DetailReportUtil.l0(DetailFragment.this.d0.size() == 0, "call", DetailFragment.this.s4());
SafeIntent safeIntent = new SafeIntent(new Intent());
safeIntent.setAction("android.intent.action.DIAL");
Uri parse = Uri.parse("tel:" + str);
if (c55.e(parse.toString()).booleanValue()) {
safeIntent.setData(parse);
IntentUtils.safeStartActivity(DetailFragment.this.getActivity(), safeIntent);
}
if (qc6.c(DetailFragment.this.c)) {
DetailReportUtil.L((Site) DetailFragment.this.c.n.getValue(), DetailFragment.this.K, PoiOperateEnum.POI_CALL.getType());
}
}
public void n() {
jh8.e().setValue(1);
}
public void o() {
if (DetailFragment.this.v != null && DetailFragment.this.v.q()) {
DetailFragment.this.v.o();
}
if (RouteDataManager.b().q() || RouteDataManager.b().p() || RouteDataManager.b().s() || RouteDataManager.b().r() || RouteDataManager.b().o()) {
DetailFragment.this.onBackPressed();
return;
}
AbstractLocationHelper.getInstance().resetLocationMarker();
DetailFragment.this.A = true;
MapMutableLiveData<Boolean> mapMutableLiveData = DetailFragment.this.c.E;
Boolean bool = Boolean.TRUE;
mapMutableLiveData.setValue(bool);
DetailFragment.this.saveTempPageStatus();
Site site = (Site) DetailFragment.this.c.n.getValue();
if (site == null) {
hm4.h("DetailFragment", "onSeachClick -- site is null");
return;
}
if (DetailFragment.this.o0) {
jh8.e0(true);
}
DetailFragment.this.m5(site);
jh8.a0(true);
MapHelper.F2().G1();
MapHelper.F2().M6(false);
DetailReportUtil.k0(site.getSiteId(), site.getName());
DetailReportUtil.L(site, DetailFragment.this.K, PoiOperateEnum.POI_SEARCH.getType());
AbstractMapUIController.getInstance().startNavigationSearch(DetailFragment.this.getActivity());
jh8.d().postValue(site);
DetailFragment.this.c.u0.setValue(bool);
DetailFragment.this.z = true;
}
public void p() {
if (DetailFragment.this.v != null && DetailFragment.this.v.q()) {
DetailFragment.this.v.o();
}
if (o72.c(R$id.iv_share)) {
return;
}
Site site = (Site) DetailFragment.this.c.n.getValue();
DetailReportUtil.l0(DetailFragment.this.d0.size() == 0, "share", site == null ? null : site.getSiteId());
int ordinal = DetailReportUtil.ShareFrom.DEFAULT.ordinal();
if (DetailFragment.this.K.isLocationMarkerClick()) {
ordinal = DetailReportUtil.ShareFrom.LOCATION_MARKER_CLICK.ordinal();
} else if (DetailFragment.this.K.isFromFavorite()) {
ordinal = DetailReportUtil.ShareFrom.COMMON_LOCATION.ordinal();
} else if (DetailFragment.this.K.isCollectSite()) {
ordinal = DetailReportUtil.ShareFrom.COLLECT_CLICK.ordinal();
} else {
DetailReportUtil.ShareFrom item = DetailReportUtil.ShareFrom.getItem(DetailFragment.this.K.getDataSourceType());
if (item != null) {
ordinal = item.getShareFrom();
} else {
hm4.p("DetailFragment", "onShareBtnClick item is null");
}
}
if (site != null && (DetailFragment.this.K.isInvalidPoi() || AbstractMapUIController.getInstance().isOfflineData(site.getSiteId()))) {
s(site);
}
com.huawei.maps.poi.utils.b.o(site, DetailFragment.this.getParentFragmentManager(), ordinal);
DetailReportUtil.q(site != null ? site.getSiteId() : null);
DetailReportUtil.p0(DetailFragment.this.K, MapSubmitSuccessDialogType.IS_FROM_ROAD_UGC);
DetailReportUtil.D(MapSubmitSuccessDialogType.IS_FROM_ROAD_UGC, DetailFragment.this.K.isMapLongClick());
DetailReportUtil.L(site, DetailFragment.this.K, PoiOperateEnum.POI_SHARE.getType());
DetailReportUtil.m0(site, DetailFragment.this.K);
}
public void q(View view) {
Site site = (Site) DetailFragment.this.c.n.getValue();
DetailReportUtil.l0(DetailFragment.this.d0.size() == 0, "navigation", site == null ? null : site.getSiteId());
if (site == null || f86.a(view)) {
return;
}
Optional.ofNullable(DetailFragment.this.N).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.q.f((BottomViewModel) obj);
}
});
DetailFragment.this.q0 = false;
if (!ServicePermission.isNaviEnable()) {
cz9.p(o41.c().getString(R$string.nav_function_disable));
return;
}
if (DetailFragment.this.K != null) {
jh8.P(DetailFragment.this.K.isCollectSite());
}
DetailFragment.this.h0 = 20001;
DetailFragment.this.savePageStatus();
p19.F().n2("0");
DetailFragment.this.c.E.setValue(Boolean.TRUE);
NaviCurRecord.getInstance().updateNaviCurInfo(site);
AbstractMapUIController.getInstance().startNavigationDrive(DetailFragment.this.getActivity(), site);
xr4.Q().O1("quickly");
DetailReportUtil.u(site.getSiteId(), DetailFragment.this.o0 ? "nearby" : "");
AbstractMapUIController.getInstance().setDisableExpendForNavi(true);
DetailFragment.this.A = true;
DetailFragment.this.saveDetailClickRecord(site);
DetailReportUtil.s0(DetailFragment.this.K);
DetailReportUtil.L(site, DetailFragment.this.K, PoiOperateEnum.POT_NAVIGATION.getType());
}
public void r() {
Parcelable parcelable = (Site) DetailFragment.this.c.n.getValue();
DetailReportUtil.l0(DetailFragment.this.d0.size() == 0, "ugc", parcelable == null ? null : parcelable.getSiteId());
DetailReportUtil.L(parcelable, DetailFragment.this.K, PoiOperateEnum.POI_REPORT.getType());
if (tg6.b().c().getOfflineMapsConfigs().getNetworkType() == -1) {
cz9.k(o41.f(R$string.no_network));
return;
}
DetailFragment.this.saveTempPageStatus();
DetailFragment.this.z = true;
if (!e4.a().hasLogin()) {
DetailFragment.this.F4(10001);
return;
}
Bundle bundle = new Bundle();
bundle.putParcelable("site", parcelable);
if (PoiReportCommonUtil.b0(parcelable)) {
cz9.j(R$string.claimed_by_merchant);
} else {
PoiReportCommonUtil.m0(DetailFragment.this, R$id.detail_to_poi_all_report, bundle);
}
if (parcelable == null || parcelable.getPoi() == null) {
vz6.w((String) null);
} else {
vz6.w(parcelable.getPoi().getHwPoiTypes()[0]);
}
}
public final void s(Site site) {
if (DetailFragment.this.K == null || !DetailFragment.this.K.isInvalidPoi() || DetailFragment.this.K.getSite() == null) {
return;
}
String siteId = DetailFragment.this.K.getSite().getSiteId();
if (TextUtils.isEmpty(siteId)) {
return;
}
site.setSiteId(siteId);
}
}
public class r extends j65 {
public String a;
public String b;
public static void l(BottomViewModel bottomViewModel) {
bottomViewModel.d.setValue(8);
}
public void doUpdateVisitedHistory(WebView webView, String str, boolean z) {
super/*android.webkit.WebViewClient*/.doUpdateVisitedHistory(webView, str, z);
if (DetailFragment.this.r0) {
DetailFragment.this.r0 = false;
webView.clearHistory();
}
}
public final void i(String str, WebResourceError webResourceError, String str2) {
if (str.contains(this.b)) {
ug3.a(String.valueOf(webResourceError.getErrorCode()), this.a, str);
}
}
public final void j(String str, DetailUIHandler detailUIHandler) {
detailUIHandler.N0(DetailFragment.this.getActivity(), str);
}
public final void k(String str, DetailUIHandler detailUIHandler) {
detailUIHandler.O0(DetailFragment.this.getActivity(), str);
}
public final void m(String str, DetailUIHandler detailUIHandler) {
detailUIHandler.N0(DetailFragment.this.getActivity(), str);
}
public final void n(String str) {
((LayoutSiteDetailBinding) ((BaseFragment) DetailFragment.this).mBinding).searchWeb.p(str);
}
public final void o(String str) {
this.a = str;
}
public void onPageFinished(WebView webView, String str) {
if (DetailFragment.this.o0 && DetailFragment.this.q0) {
DetailFragment.this.F = str;
DetailFragment.this.t4();
}
}
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
super/*android.webkit.WebViewClient*/.onPageStarted(webView, str, bitmap);
if (DetailFragment.this.o0) {
if (com.huawei.maps.poi.utils.c.c0(str)) {
if (((BaseFragment) DetailFragment.this).mBinding != null) {
DetailFragment.this.c.e.setValue(8);
((LayoutSiteDetailBinding) ((BaseFragment) DetailFragment.this).mBinding).viewClose.setVisibility(8);
return;
}
return;
}
if (((BaseFragment) DetailFragment.this).mBinding != null) {
DetailFragment.this.c.e.setValue(0);
((LayoutSiteDetailBinding) ((BaseFragment) DetailFragment.this).mBinding).viewClose.setVisibility(0);
}
}
}
public void onReceivedError(WebView webView, WebResourceRequest webResourceRequest, final WebResourceError webResourceError) {
super/*android.webkit.WebViewClient*/.onReceivedError(webView, webResourceRequest, webResourceError);
final String uri = webResourceRequest.getUrl().toString();
Optional.ofNullable(uri).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.r.this.i(uri, webResourceError, (String) obj);
}
});
}
public final void p(String str) {
this.b = str;
}
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
final String uri = webResourceRequest.getUrl().toString();
if (uri.startsWith("tel:")) {
Optional.ofNullable(DetailFragment.this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.r.this.j(uri, (DetailUIHandler) obj);
}
});
return true;
}
if (uri.startsWith("mailto:")) {
Optional.ofNullable(DetailFragment.this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.r.this.k(uri, (DetailUIHandler) obj);
}
});
return true;
}
if (DetailFragment.this.o0) {
if (com.huawei.maps.poi.utils.c.d0(uri) || uri.startsWith("mailto:")) {
DetailFragment.this.s0 = 0;
DetailFragment.this.q0 = true;
} else {
DetailFragment.this.q0 = false;
Optional.ofNullable(DetailFragment.this.N).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.r.l((BottomViewModel) obj);
}
});
}
if (uri.startsWith("intent://")) {
final String i0 = DetailFragment.this.G == null ? "" : DetailFragment.this.G.i0(uri);
if (TextUtils.isEmpty(i0)) {
return false;
}
if (i0.startsWith("http") || !"about:blank".equals(i0)) {
DetailFragment.this.F = uri;
if (UrlUtil.isNetworkUrl(i0)) {
fk2.f(new Runnable() {
@Override
public final void run() {
DetailFragment.r.this.n(i0);
}
});
}
} else {
Optional.ofNullable(DetailFragment.this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.r.this.m(i0, (DetailUIHandler) obj);
}
});
}
return true;
}
DetailFragment.this.F = uri;
}
return super/*android.webkit.WebViewClient*/.shouldOverrideUrlLoading(webView, webResourceRequest);
}
public r() {
this.a = "";
this.b = "";
}
}
private void A4(CommentDataInfo commentDataInfo) {
if (k0a.k().m()) {
k0a.k().B(getActivity(), TracelessModeTips.TIP_NORMAL);
return;
}
if (commentDataInfo == null) {
return;
}
t8();
Bundle bundle = new Bundle();
bundle.putParcelable("site", (Site) this.c.n.getValue());
bundle.putParcelable("key_comment_data", commentDataInfo);
ux4.c(this, R$id.detail_to_poi_comment_report, bundle);
}
public void A8(List<CollectFolderInfo> list) {
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null) {
hm4.f("DetailFragment", "binding is null");
} else {
detailViewModel.V.postValue(list);
}
}
public static void B7(MapSafeWebView mapSafeWebView, MapSafeWebView mapSafeWebView2) {
if (mapSafeWebView == mapSafeWebView2) {
ve8.p().H();
}
}
public void B8(CollectFolderInfo collectFolderInfo) {
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null) {
hm4.f("DetailFragment", "binding is null");
} else {
detailViewModel.U.postValue(collectFolderInfo);
}
}
private void B9(View view) {
if (view == null) {
return;
}
if (this.s == null) {
this.s = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R$layout.dynamic_view_more_tip_pop_window, (ViewGroup) null, false);
}
int[] iArr = new int[2];
view.getLocationOnScreen(iArr);
int b2 = ct3.b(o41.c(), 242.0f);
int b3 = ct3.b(o41.c(), 45.0f);
int b4 = ct3.b(o41.c(), 62.0f);
int b5 = ct3.b(o41.c(), 24.0f);
CustomPopWindow a2 = new CustomPopWindow.PopupWindowBuilder(getContext()).e(this.s.getRoot()).f(b2, -2).a();
int i2 = iArr[0];
if (q42.y()) {
b3 = b2 - b4;
}
this.u = a2.r(view, 8388659, i2 - b3, iArr[1] + b5);
}
private void C4() {
String string = getString(R$string.submitted_successfully);
String string2 = getString(R$string.poi_review_submitted_success);
SafeBundle safeBundle = new SafeBundle();
safeBundle.putString("key_value", string + System.lineSeparator() + string2);
safeBundle.putInt("user_feedback_points", O3());
safeBundle.putString("map_submit_success_dialog_source_type", MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE);
ux4.c(this, R$id.detail_to_poi_upload_image_success, safeBundle.getBundle());
}
public static void C7(DetailViewModel detailViewModel) {
detailViewModel.M.setValue(1);
}
public static void D7(DetailViewModel detailViewModel) {
detailViewModel.M.setValue(0);
}
public void D8(String str) {
StringBuilder sb = new StringBuilder();
sb.append("onUserIdGet uid not empty:");
sb.append(!TextUtils.isEmpty(str));
hm4.f("TAG_FLOW_LOGIN_COLLECT", sb.toString());
if (TextUtils.isEmpty(str)) {
P8();
hm4.f("TAG_FLOW_LOGIN_COLLECT", "uid empty");
return;
}
BottomViewModel bottomViewModel = this.N;
if (bottomViewModel == null || this.c == null || this.P == null || this.K == null) {
hm4.f("DetailFragment", "binding is null");
return;
}
Site site = (Site) bottomViewModel.a.getValue();
if (!this.K.isCollectSite() && site != null) {
this.L.i0(str, site);
}
this.P.e(str).observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.B8((CollectFolderInfo) obj);
}
});
this.P.c(str).observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.A8((List) obj);
}
});
ho.c(str, getFragmentViewModel(CollectFolderViewModel.class));
}
public void F6(List list) {
hm4.f("DetailFragment", "mHotelDetailDataObserver changed:" + list);
if (list == null) {
return;
}
this.U.setHotelDetailLoading(false);
this.U.setHotelDetails(list);
Z4(new int[]{sb2.x}, this.U);
}
public static Void G5(Object obj) {
return null;
}
public void l7(Account account, int i2) {
this.B = false;
switch (i2) {
case 10000:
collectByNoLogin(account);
StringBuilder sb = new StringBuilder();
sb.append("signInActivityResult account not empty");
sb.append(account == null);
hm4.f("TAG_FLOW_LOGIN_COLLECT", sb.toString());
break;
case 10001:
e4.a().onSignIn(account);
t8();
A9();
break;
case 10002:
e4.a().onSignIn(account);
this.B = true;
this.C = true;
if (e4.a().isChildren()) {
this.f0 = true;
hm4.p("DetailFragment", "login by child");
break;
}
break;
case 10003:
e4.a().onSignIn(account);
p4();
break;
case 10004:
e4.a().onSignIn(account);
new a07(this, (Site) this.c.n.getValue()).s();
break;
case 10005:
e4.a().onSignIn(account);
this.B = true;
this.C = false;
if (e4.a().isChildren()) {
this.f0 = true;
hm4.p("DetailFragment", "login by child");
break;
}
break;
case 10006:
e4.a().onSignIn(account);
this.K.setScrollToExpand(true);
this.K.setScrollToComment(false);
this.B = true;
this.C = true;
if (e4.a().isChildren()) {
this.f0 = true;
hm4.p("DetailFragment", "login by child");
break;
}
break;
case 10007:
e4.a().onSignIn(account);
if (!e4.a().isChildren()) {
x8(MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
hm4.p("DetailFragment", "login by child");
break;
} else {
ia(this.K.getSite());
break;
}
case 10008:
e4.a().onSignIn(account);
if (!e4.a().isChildren()) {
x8(MapSubmitSuccessDialogType.IS_FROM_POI_UGC);
hm4.p("DetailFragment", "login by child");
break;
} else {
ia(this.K.getSite());
break;
}
}
n4(Boolean.TRUE, this.B);
}
public void I6(List list) {
hm4.f("DetailFragment", "mRestaurantDetailObserver changed:" + list);
if (list == null) {
return;
}
this.U.setRestaurantReservationDetails(list);
a5(new int[]{sb2.y}, this.U, new CardUpdateCallback() {
@Override
public final void endUpdate() {
DetailFragment.this.H6();
}
});
}
private void K9(Site site) {
L9(site, false);
}
private void M9(final Site site) {
this.L.X(site);
CollectHelper.Z(false);
this.c.B.disposeObserver();
DetailOptions detailOptions = this.K;
if (detailOptions != null && detailOptions.isLocationMarkerClick()) {
MapHelper.F2().b6();
MapHelper.F2().R5();
MapHelper.F2().m1();
}
if (!this.o0) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).C0(site);
}
});
}
this.c.n.setValue(site);
this.N.a.setValue(site);
if (qc6.c(((BaseFragment) this).mBinding)) {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.llPoiOperate.setVisibility(8);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.viewFlipper.stopFlipping();
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).localSiteNameTextView.setVisibility(8);
}
}
public void N4(Site site) {
if (site != null && !this.K.isGeo()) {
boolean z = "[Marked Location]".equals(this.K.getSiteName()) || "[Marked Location]".equals(site.getName());
boolean z2 = (this.K.isCollectSite() || this.K.isLocationMarkerClick()) ? false : true;
if (!pa9.c(site.getPoi()) && z2 && z && site.isPoiFlag()) {
this.c.n.setValue(site);
if (site.isCloseDetail()) {
this.c.B.getDetailData().postValue(site);
return;
} else if (this.K.isLink()) {
this.c.B.getDetailData().postValue(site);
return;
} else {
this.c.B.startDetailSearch(site);
return;
}
}
}
if (site != null) {
if (this.K.isLatLngSearch()) {
StringBuilder sb = new StringBuilder();
if (site.getReverseName() != null) {
sb.append(site.getReverseName());
sb.append(" ");
}
if (site.getFormatAddress() != null) {
sb.append(site.getFormatAddress());
}
if (site.isPoiFlag() && site.getPoi() != null) {
site.getPoi().setHwPoiTypes((String[]) null);
}
site.setFormatAddress(sb.toString());
}
if (!TextUtils.isEmpty(this.K.getSiteName())) {
site.setName(this.K.getSiteName());
}
Site site2 = (Site) this.c.n.getValue();
if (this.K.isGeo() && this.K.getGeoZoom() == -1) {
if (site2 != null) {
site.setName(site2.getName());
}
if (!TextUtils.isEmpty(this.K.getGeoPoiAddress())) {
site.setFormatAddress(this.K.getGeoPoiAddress());
site.setReverseName("");
}
} else if (this.K.isCollectSite() && site2 != null) {
site2.setColletSite(true);
}
this.W.d();
c9(site);
} else {
site = (Site) this.c.n.getValue();
if (!this.K.isGeo()) {
if (this.K.isCollectSite() && site != null) {
site.setColletSite(true);
}
I8((Site) this.c.n.getValue());
} else if (this.K.getGeoZoom() == -1) {
MapHelper.F2().w8(site, false, 0);
}
}
k9(site);
hm4.f("DetailFragment", "handleLatLngBack");
Optional.ofNullable(site).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.W5((Site) obj);
}
});
DetailReportUtil.E();
x9(this.c.C.getCityCode());
}
private int O3() {
if (tha.b(this.V0)) {
return 0;
}
return this.V0.size() * 5;
}
private void P8() {
U9(-1);
}
public static void Q7(Site site, LayoutSiteDetailBinding layoutSiteDetailBinding) {
com.huawei.maps.dynamic.card.utils.a.a.k(site, layoutSiteDetailBinding.imgBrandLogo);
}
public void S3() {
LayoutSiteDetailBottomBinding layoutSiteDetailBottomBinding;
if (this.K == null || this.N == null || this.c == null || (layoutSiteDetailBottomBinding = this.q) == null) {
return;
}
layoutSiteDetailBottomBinding.llDirection.setAlpha(1.0f);
this.q.llDirection.setClickable(true);
this.N.o.setValue(0);
boolean z = this.w == 0 || ((this.K.isFavoritesSite() || this.K.isCollectSite()) && !jh8.D()) || this.o0;
if (this.K.isLocationMarkerClick() && z) {
zu1.d(0);
this.N.j.setValue((Object) null);
this.N.g.setValue(8);
this.N.k.setValue(Integer.valueOf(R$string.realtime_share_location));
this.c.u.setValue(8);
w59 w59Var = w59.a;
if (w59Var.J() || TextUtils.isEmpty(e4.a().getAccessToken())) {
this.q.llDirection.setAlpha(0.4f);
this.q.llDirection.setClickable(!k0a.k().m());
} else {
this.N.l.setValue(0);
this.N.v.setValue(Boolean.TRUE);
this.q.llDirection.setClickable(true);
}
w59Var.o(true);
} else if ((z && !this.K.isFromNavComplete() && !jh8.A()) || zu1.a()) {
zu1.d(1);
this.N.j.setValue(o41.c().getResources().getDrawable(R$drawable.hos_ic_routes_go_reverse, null));
this.N.k.setValue(Integer.valueOf(R$string.site_detail_direction));
this.c.u.setValue(0);
this.N.o.setValue(0);
this.N.g.setValue(0);
if (this.K.isHideStartNav()) {
this.K.setHideStartNav(false);
this.N.f.setValue(0);
}
} else if (RouteDataManager.b().q() || RouteDataManager.b().p() || RouteDataManager.b().s() || RouteDataManager.b().r()) {
t9();
} else {
zu1.d(2);
this.N.g.setValue(8);
this.N.j.setValue(o41.i(o41.c(), R$drawable.ic_add_location, R$color.color_bg_normal));
RouteDataManager b2 = RouteDataManager.b();
this.N.k.setValue(Integer.valueOf("SEARCH_HOME".equals(b2.h()) ? R$string.map_commute_set_home : "SEARCH_WORK".equals(b2.h()) ? R$string.map_commute_set_work : R$string.add));
this.c.u.setValue(0);
this.N.g.setValue(0);
this.N.o.setValue(0);
this.N.f.setValue(8);
this.K.setHideStartNav(true);
}
if (this.o0) {
this.N.f.setValue(8);
this.N.n.setValue(8);
this.N.l.setValue(8);
this.N.v.setValue(Boolean.FALSE);
this.N.m.setValue(0);
this.N.w.setValue(Boolean.TRUE);
} else {
this.N.e.setValue(8);
this.c.e.setValue(8);
}
if (k0a.k().m()) {
this.N.n.setValue(8);
this.N.l.setValue(8);
this.N.v.setValue(Boolean.FALSE);
this.N.p.setValue(8);
}
if (this.K.isLocationMarkerClick()) {
this.N.f.setValue(8);
this.N.p.setValue(8);
this.N.e.setValue(8);
}
String cityCode = this.c.C.getCityCode();
if (cityCode == null) {
cityCode = r4();
}
boolean j2 = tx6.g().j(cityCode);
this.N.t.setValue(Integer.valueOf(j2 ? 0 : 8));
U3(j2);
}
public void U9(int i2) {
Site site;
if (this.q == null) {
hm4.f("DetailFragment", "binding is null");
return;
}
CollectInfo collectInfo = this.Q;
String str = "";
String siteId = (collectInfo == null || collectInfo.getSiteId() == null) ? "" : this.Q.getSiteId();
MapMutableLiveData<Site> mapMutableLiveData = this.c.n;
if (mapMutableLiveData != null && mapMutableLiveData.getValue() != null && (site = (Site) this.c.n.getValue()) != null) {
str = site.getSiteId();
}
if (siteId != null && str != null && !siteId.equals(str)) {
MapMutableLiveData<Site> mapMutableLiveData2 = this.c.n;
if (mapMutableLiveData2 == null || mapMutableLiveData2.getValue() == null) {
return;
}
hm4.f("DetailFragment", "collectInfo error queryCollect");
if (!TextUtils.isEmpty(e4.a().getUid())) {
this.L.X((Site) this.c.n.getValue());
}
}
CollectInfo collectInfo2 = this.Q;
if (collectInfo2 != null) {
this.q.ivCollect.g(i2, collectInfo2.getCustomFolderType(), this.Q.getCustomFolderColor());
} else {
this.q.ivCollect.g(i2, 0, 0);
}
}
private void V3() {
if (this.U.getPoiOpenStateInfo() != null) {
PoiOpenStateInfo poiOpenStateInfo = this.U.getPoiOpenStateInfo();
poiOpenStateInfo.setColor(qp6.a().b(poiOpenStateInfo.getOpenState()).getTextColor());
this.c.q0.postValue(poiOpenStateInfo);
hm4.f("DetailFragment", "poiOpenStateInfo--color--change");
}
}
public static void W5(Site site) {
DetailReportUtil.p(site.getSiteId());
}
public static void W7(Site site, LayoutSiteDetailBinding layoutSiteDetailBinding) {
com.huawei.maps.dynamic.card.utils.a.a.k(site, layoutSiteDetailBinding.imgBrandLogo);
}
private void Z9() {
th1 th1Var;
CommentsViewModel commentsViewModel;
CommentRepliesSharedViewModel commentRepliesSharedViewModel = this.S;
if (commentRepliesSharedViewModel == null || (th1Var = (th1) commentRepliesSharedViewModel.m().getValue()) == null) {
return;
}
List i2 = this.S.i();
List w = this.S.w();
Boolean bool = (Boolean) this.S.o().getValue();
if (bool == null || (commentsViewModel = this.U0) == null) {
return;
}
commentsViewModel.R(th1Var, i2, w, bool.booleanValue());
}
public static void a8(int i2, MapRecyclerView mapRecyclerView) {
DynamicSmoothScroller dynamicSmoothScroller = new DynamicSmoothScroller(o41.c());
dynamicSmoothScroller.setTargetPosition(i2);
RecyclerView.LayoutManager layoutManager = mapRecyclerView.getLayoutManager();
if (layoutManager != null) {
layoutManager.startSmoothScroll(dynamicSmoothScroller);
}
}
private void b4() {
e4.a().checkUserPassword(this, e4.a().isChildren(), 1021, new ResultCallBack() {
public final void onResult(Result result) {
DetailFragment.this.u5((ap0) result);
}
});
}
public static void e6(Site site, String[] strArr) {
List asList = Arrays.asList(strArr);
if (asList.contains("HOTEL") || asList.contains("HOTEL".toLowerCase(Locale.ENGLISH))) {
ab0.d().c(wi7.a(site.getSiteId()));
}
}
private void f9() {
MapHelper.F2().B7(3, new m());
}
public static int g8(PoiTicketsInfo poiTicketsInfo, PoiTicketsInfo poiTicketsInfo2) {
return poiTicketsInfo.getSort().compareTo(poiTicketsInfo2.getSort());
}
public void h6(Pair pair) {
if (pair == null) {
hm4.h("DetailFragment", "upload change check pair error");
}
CommentViewModel.a aVar = (CommentViewModel.a) pair.second;
switch (((Integer) pair.first).intValue()) {
case 1001:
bz3.a();
if (aVar != null) {
y8a.H(tha.b(this.V0) ? 0 : this.V0.size(), "submit_result_success");
}
C4();
p79.g("poi_name_clicked", this.y0, o41.c());
break;
case e40.H1:
y8a.H(tha.b(this.V0) ? 0 : this.V0.size(), "submit_result_failure");
break;
case 1003:
v8();
sr4.l(requireActivity());
break;
case 1004:
u8();
sr4.k();
break;
}
}
private void i9() {
ShareViewModel shareViewModel = this.j;
if (shareViewModel != null) {
shareViewModel.a().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.X7((Boolean) obj);
}
});
}
this.c.T.observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.S9((SatelliteCardData) obj);
}
});
this.c.B.getDetailData().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.handleSiteBack((Site) obj);
}
});
this.c.B.getDetailDataJson().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.W4((JsonObject) obj);
}
});
this.c.B.getAdditionalDetailData().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.I4((JsonObject) obj);
}
});
this.c.B.getIsCreateCommentAfterSignIn().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.g4(((Boolean) obj).booleanValue());
}
});
this.c.B.getRecommendationsData().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.U4((JsonObject) obj);
}
});
this.c.B.getReviewType().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.V4(((Integer) obj).intValue());
}
});
this.c.B.getIsServiceStopped().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.J4(((Boolean) obj).booleanValue());
}
});
this.c.D.observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.Y7((String) obj);
}
});
this.c.C.getReverseGeoCodeData().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.N4((Site) obj);
}
});
this.c.G.getGooglResponse().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.L4((GooglResponse) obj);
}
});
this.O.detailOptionsData.observe(this, this.h1);
w8();
this.c.B.getErrorData().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.R4((String) obj);
}
});
this.n.b().observe(this, this.k1);
this.n.c().observe(this, this.p1);
this.n.a().observe(this, this.m1);
this.m.k().observe(this, this.q1);
this.c.B.getCustomCommentData().observe(this, this.r1);
this.c.B.getWeatherInfo().observe(this, this.s1);
this.c.B.getLocalTime().observe(this, this.t1);
this.c.B.getExchangeRate().observe(this, this.u1);
this.c.B.getTopRankingList().observe(this, this.w1);
this.c.B.getPopularCitiesBack().observe(this, this.x1);
this.c.B.getGuides().observe(this, this.v1);
this.c.B.getIsHaveSelfComment().observe(this, this.Z1);
this.e.g().observe(this, this.Y1);
this.c.Z.observe(this, this.y1);
this.c.a0.observe(this, this.z1);
this.c.c0.observe(this, this.A1);
this.c.d0.observe(this, this.B1);
this.c.e0.observe(this, this.C1);
this.c.f0.observe(this, this.D1);
this.c.g0.observe(this, this.E1);
this.c.B.getHotelData().observe(this, this.G1);
this.c.B.getHotelDetailLoading().observe(this, this.F1);
this.c.B.getTravelData().observe(this, this.H1);
this.c.B.getHotelDetailsData().observe(this, this.J1);
this.c.B.getTodayHotelDataDetail().observe(this, this.I1);
this.c.B.getTrivagoListData().observe(this, this.K1);
this.c.B.getRestaurantData().observe(this, this.M1);
this.c.B.getRestaurantReservationData().observe(this, this.L1);
this.c.B.getDeliveryData().observe(this, this.N1);
this.c.B.getGasStationData().observe(this, this.O1);
this.c.B.getDealsInfoData().observe(this, this.P1);
this.c.B.getIndustryData().observe(this, this.Q1);
this.c.B.getBusSubwayData().observe(this, this.R1);
this.c.B.getMenuData().observe(this, this.S1);
this.c.B.getParkingLotInfoData().observe(this, this.T1);
this.c.B.getPoiPictureList().observe(this, this.W1);
this.k.b().observe(this, this.V1);
this.c.B.getCarChargeInfoData().observe(this, this.U1);
this.c.B.getNearbyPoiDetailData().observe(this, this.a2);
this.f.b().observe(this, this.X1);
}
private void initViewModel() {
this.c = getFragmentViewModel(DetailViewModel.class);
this.j = getActivityViewModel(ShareViewModel.class);
this.N = (BottomViewModel) getActivityViewModel(BottomViewModel.class);
this.O = (VMInPoiModule) getActivityViewModel(VMInPoiModule.class);
this.P = getFragmentViewModel(CollectFolderViewModel.class);
this.m = (ApiCommentViewModel) getFragmentViewModel(ApiCommentViewModel.class);
this.n = getActivityViewModel(CommentStateViewModel.class);
this.o = getActivityViewModel(CommentLikeViewModel.class);
this.l = getActivityViewModel(SearchConfigViewModel.class);
this.k = (MeetkaiPlaceAdsViewModel) getFragmentViewModel(MeetkaiPlaceAdsViewModel.class);
this.e = getFragmentViewModel(TranslationViewModel.class);
this.f = (SummaryTranslateViewModel) getFragmentViewModel(SummaryTranslateViewModel.class);
this.p = getFragmentViewModel(DIYMapsCreatePoiViewModel.class);
this.S = getActivityViewModel(CommentRepliesSharedViewModel.class);
this.U0 = getFragmentViewModel(CommentsViewModel.class);
this.X0 = (CommentViewModel) getFragmentViewModel(CommentViewModel.class);
this.Y0 = getFragmentViewModel(CityIdViewModel.class);
SpecialLocationViewModel activityViewModel = getActivityViewModel(SpecialLocationViewModel.class);
this.Z0 = activityViewModel;
this.c.B.setSpecialLocationVM(activityViewModel);
this.c.B.setCommentsViewModel(this.U0);
this.F0 = getActivityViewModel(ReservationViewModel.class);
this.G0 = getActivityViewModel(SearchResultCalendarViewModel.class);
}
public static void j7(PoiCommentInfo poiCommentInfo, Account account) {
poiCommentInfo.setAccessToken(account.getAccessToken());
}
private void ja() {
if (this.c == null) {
hm4.f("DetailFragment", "binding is null");
return;
}
String uid = e4.a().getUid();
if (TextUtils.isEmpty(uid)) {
if (!TextUtils.isEmpty((String) this.c.W.getValue())) {
this.c.W.postValue((Object) null);
}
hm4.f("TAG_FLOW_LOGIN_COLLECT", "updateUserId uid empty");
} else {
this.c.W.postValue(x52.a(uid));
hm4.f("TAG_FLOW_LOGIN_COLLECT", "updateUserId uid not empty");
}
}
private void k9(final Site site) {
Optional.ofNullable(site).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.Z7(site, (Site) obj);
}
});
}
public static boolean l5(List<ResolveInfo> list) {
if (list != null) {
try {
Iterator<ResolveInfo> it = list.iterator();
while (it.hasNext()) {
if (it.next().activityInfo.applicationInfo.packageName.equals("com.booking")) {
return true;
}
}
} catch (NullPointerException unused) {
}
}
return false;
}
public static void l8(BottomViewModel bottomViewModel) {
bottomViewModel.d.setValue(8);
}
public void m8() {
n8(false);
}
public static void o7(Site site) {
MapHelper.F2().v8(site);
}
public void openPhotoActivity() {
Iterator<FileItem> it = this.W0.iterator();
while (it.hasNext()) {
FileItem next = it.next();
Iterator<MediaItem> it2 = this.V0.iterator();
while (true) {
if (!it2.hasNext()) {
it.remove();
break;
} else {
if (next.getFileName().equals(it2.next().e())) {
break;
}
}
}
}
String s = qk9.s();
String f3 = p79.f("add_language_key", "", o41.c());
if (!TextUtils.isEmpty(f3) && !f3.equals(s)) {
p79.l("add_language_key", o41.c());
}
jz3.a(getActivity()).f(9).i(true).g(true).c(f2).b(this.W0).a((String) null).d(true).e(new OnSelectResultListener() {
public final void onActivityResult(int i2, List list, List list2, int i3) {
DetailFragment.this.K7(i2, list, list2, i3);
}
}).k();
}
public static void p7(Site site) {
MapHelper.F2().v8(site);
}
public void p8(Site site) {
if (site == null) {
hm4.h("DetailFragment", "moveCamera failed, site is null");
return;
}
if (this.o0) {
return;
}
if (!tha.a(this.A0)) {
MapHelper.F2().H0 = site.getLocation();
}
hm4.p("DetailFragment", "AOIFlag is " + site.isAoiFlag());
if (site.isAoiFlag()) {
MapHelper.F2().U0(com.huawei.maps.poi.utils.c.u(site.getViewport()), new b());
if (pa9.e(site.getPoi())) {
return;
}
MapHelper.F2().m8(site);
return;
}
if (pa9.d(site.getPoi()) && !"[Marked Location]".equals(site.getName())) {
int e2 = (int) (ct3.e((Activity) getContext()) * 0.4d);
if (ct3.A(o41.c()) == ScreenDisplayStatus.PAD_AND_LANDSCAPE) {
e2 = (int) (ct3.e((Activity) getContext()) * 0.5d);
}
MapHelper.F2().q5(site, e2);
return;
}
if (!this.K.isNeedMoveCamera()) {
if (site.isPoiFlag()) {
MapHelper.F2().n8(site, true, this.K.isChildNode());
}
} else if (this.K.getMapZoom() != -1.0f) {
MapHelper.F2().x8(site, (int) this.K.getMapZoom(), true);
} else {
MapHelper.F2().v8(site);
}
}
public static void s7(DetailViewModel detailViewModel) {
detailViewModel.G.clearGoogleWebView();
}
private void submitData() {
Site site;
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null || (site = (Site) detailViewModel.n.getValue()) == null) {
return;
}
PoiCommentInfo poiCommentInfo = new PoiCommentInfo();
poiCommentInfo.setSite(site);
poiCommentInfo.setAccessToken(e4.a().getAccessToken());
poiCommentInfo.setSysLanguageCode(gg4.i());
CommentInfo commentInfo = new CommentInfo();
commentInfo.setContentID(site.getSiteId());
commentInfo.setDeviceNickName(q42.f());
if (!tha.b(this.V0)) {
poiCommentInfo.setPhotosItem(this.V0);
commentInfo.setCommentType(PoiConstants$CommentType.COMENT_TEXT_IMAGE.getCommentType());
MediaComment mediaComment = commentInfo.getMediaComment();
if (mediaComment == null) {
mediaComment = new MediaComment();
}
mediaComment.setCommentStr("--");
commentInfo.setMediaComment(mediaComment);
}
poiCommentInfo.setCommentInfo(commentInfo);
poiCommentInfo.setCityId((String) this.Y0.b().getValue());
poiCommentInfo.setPoiInfo(new PoiInfo(site, McPoiCommentType.CREATE));
this.S0.q(poiCommentInfo, this.X0.a());
}
public void t6(String str) {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding == null || ((LayoutSiteDetailBinding) viewDataBinding).subtabLayout == null || str == null) {
return;
}
for (int i2 = 0; i2 < this.K0.getTabCount(); i2++) {
if (TextUtils.equals((String) this.K0.x(i2).j(), str)) {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtabLayout.L(i2, 0.0f, true);
return;
}
}
}
public static void t7(DetailViewModel detailViewModel) {
detailViewModel.M.setValue(2);
}
private void u8() {
gw0.o(MapSubmitSuccessDialogType.IS_FROM_POI_UGC, getResources().getString(R$string.connect_failed));
}
public static mda v5(PoiLikeAction poiLikeAction, Site site, CommentLikeInfo.LikeStatus likeStatus, Long l2, Boolean bool) {
poiLikeAction.getListener().onUpdate(l2.longValue(), bool.booleanValue());
DetailReportUtil.N(site, likeStatus);
return null;
}
private void v8() {
gw0.o(MapSubmitSuccessDialogType.IS_FROM_POI_UGC, getResources().getString(R$string.no_network));
}
public static mda w5() {
return null;
}
private void w8() {
this.c.Y.observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.V9((CollectInfo) obj);
}
});
this.c.X.observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.U9(((Integer) obj).intValue());
}
});
this.c.W.observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.D8((String) obj);
}
});
this.c.o0.observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.z8((CollectFolderInfo) obj);
}
});
ja();
getActivityViewModel(CollectAddressViewModel.class).j().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.k7((Boolean) obj);
}
});
}
public static void x5(Records records) {
wj7.o().j(records);
}
public void z8(CollectFolderInfo collectFolderInfo) {
if (this.A) {
hm4.h("DetailFragment", "onFullCollectFolderInfoClick error");
return;
}
t8();
AbstractMapUIController.getInstance().dynamicCardJump(nav(), "gotoFragmentCommonAddress", collectFolderInfo);
hm4.f("DetailFragment", "onFullCollectFolderInfoClick");
}
private void z9(List<String> list, List<String> list2, int i2) {
FragmentActivity activity = getActivity();
if (activity == null || activity.isFinishing() || tha.b(list2)) {
return;
}
t8();
Site site = (Site) this.c.n.getValue();
AbstractMapUIController.getInstance().showPoiPicturesPage(activity, (ArrayList) list, list2, i2, this, site != null ? site.getName() : "", false);
}
public final Void A5(Object obj) {
DetailReportUtil.V(this.K.getSite(), MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE, MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
return null;
}
public final void A6(Boolean bool) {
ViewDataBinding viewDataBinding;
if (bool == null || bool.booleanValue() || (viewDataBinding = ((BaseFragment) this).mBinding) == null) {
return;
}
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.scrollToPosition(0);
}
public final void A7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.G.l0(layoutSiteDetailBinding.detailDigest);
}
public void A9() {
Site site;
int i2;
if (b37.e((Site) this.c.n.getValue(), this.K.getPoiType())) {
i2 = R$id.detail_to_poi_report_new;
site = new Site();
Coordinate v4 = v4((Site) this.c.n.getValue(), this.K.getPoiType());
if (v4 != null) {
site.setLocation(v4);
Site site2 = (Site) this.c.n.getValue();
if (this.K.getPoiType() == McConstant.McPoiOperationType.MODIFY && site2 != null) {
site.setFormatAddress(site2.getFormatAddress());
}
}
String trim = ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.getText().toString().trim();
if (o41.f(R$string.mylocation).equals(trim)) {
y8a.e("6");
p79.k("add_poi_type_key", "6", o41.c());
} else if (o41.f(R$string.marked_location).equals(trim)) {
y8a.e("5");
p79.k("add_poi_type_key", "7", o41.c());
} else {
y8a.e("5");
p79.k("add_poi_type_key", "8", o41.c());
}
} else {
site = (Site) this.c.n.getValue();
i2 = R$id.detail_to_poi_report_issue;
}
Bundle bundle = new Bundle();
if (site == null) {
return;
}
bundle.putParcelable("site", site);
bundle.putString("page_source_key", MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE);
x9a.a().c(site);
if (i2 == R$id.detail_to_poi_all_report && PoiReportCommonUtil.b0(site)) {
cz9.j(R$string.claimed_by_merchant);
} else {
PoiReportCommonUtil.m0(this, i2, bundle);
}
}
public void B4(ArrayList<ImageItemInfo> arrayList, int i2) {
new Bundle().putParcelableArrayList("key_comment_images", arrayList);
ArrayList arrayList2 = new ArrayList();
Iterator<ImageItemInfo> it = arrayList.iterator();
while (it.hasNext()) {
ImageItemInfo next = it.next();
if (next != null) {
ImageItemFile originalImageFile = next.getOriginalImageFile() != null ? next.getOriginalImageFile() : next.getPreviewImageFile();
if (originalImageFile != null) {
arrayList2.add(originalImageFile.getDownloadURL());
}
}
}
z9(arrayList2, arrayList2, i2);
}
public final Void B5(Object obj) {
DetailReportUtil.V(this.K.getSite(), MapSubmitSuccessDialogType.IS_FROM_POI_UGC, MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
return null;
}
public final void B6(Boolean bool) {
if (bool.booleanValue()) {
this.U.setHotelDetailLoading(true);
final Boolean bool2 = (Boolean) this.c.B.getIsFromDataPicker().getValue();
if (bool2 != null && !bool2.booleanValue() && this.F0 != null) {
SearchResultCalendarViewModel searchResultCalendarViewModel = this.G0;
if (searchResultCalendarViewModel == null || !((Boolean) searchResultCalendarViewModel.a().getValue()).booleanValue()) {
this.F0.g(DatePickerUtil.getRawCheckInDay(this.x).longValue(), DatePickerUtil.getRawCheckOutDay(this.x).longValue());
} else {
this.F0.g(((Long) this.G0.d().getValue()).longValue(), ((Long) this.G0.c().getValue()).longValue());
}
}
a5(new int[]{sb2.x}, this.U, new CardUpdateCallback() {
@Override
public final void endUpdate() {
DetailFragment.this.A6(bool2);
}
});
}
}
public final Void C5(Object obj) {
DetailReportUtil.V(this.K.getSite(), MapSubmitSuccessDialogType.IS_FROM_ROAD_UGC, MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
return null;
}
public final void C6(Hotel hotel) {
hm4.f("DetailFragment", "mHotelDataObserver changed:" + hotel);
if (hotel == null) {
return;
}
this.x = 0;
SearchResultCalendarViewModel searchResultCalendarViewModel = this.G0;
if (searchResultCalendarViewModel != null && ((Boolean) searchResultCalendarViewModel.a().getValue()).booleanValue() && this.K.isFromSearchResult()) {
HotelReservationCardBean.TODAY_LONG.set((Long) this.G0.d().getValue());
HotelReservationCardBean.NEXT_LONG.set((Long) this.G0.c().getValue());
} else {
String str = (String) Optional.ofNullable((Site) this.c.n.getValue()).map(new x51()).map(new pw1()).orElse(null);
List list = (List) this.l.a.j().getValue();
if (!tha.b(list) && !tha.a(str)) {
Iterator it = list.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
HotelCheckInConfig hotelCheckInConfig = (HotelCheckInConfig) it.next();
if (!tha.a(hotelCheckInConfig.getCountryCode()) && yg9.b(str, hotelCheckInConfig.getCountryCode())) {
this.x = hotelCheckInConfig.getConfigDays();
break;
}
}
}
this.F0.g(DatePickerUtil.getRawCheckInDay(this.x).longValue(), DatePickerUtil.getRawCheckOutDay(this.x).longValue());
HotelReservationCardBean.TODAY_LONG.set(DatePickerUtil.getRawCheckInDay(this.x));
HotelReservationCardBean.NEXT_LONG.set(DatePickerUtil.getRawCheckOutDay(this.x));
}
DetailViewModel detailViewModel = this.c;
detailViewModel.B.queryHotelPriceAndCPInfo((Site) detailViewModel.n.getValue(), false);
this.U.setHotel(hotel);
Z4(new int[]{sb2.I, sb2.A, sb2.z, sb2.C}, this.U);
}
public void C8() {
if (!qk9.r()) {
cz9.k(o41.f(R$string.no_network));
return;
}
j59.l("0");
if (!e4.a().hasLogin()) {
cz9.j(R$string.realtime_location_shareing_notlogin_tip);
return;
}
if (!k.Q2() || (!kj2.h(o41.c()) && !k.P2())) {
cz9.j(R$string.realtime_location_shareing_regions_unavailable_tip);
return;
}
if (e4.a().isChildren()) {
cz9.j(R$string.realtime_location_shareing_limite_adult_use_tip);
return;
}
w59 w59Var = w59.a;
if (!w59Var.A()) {
E4();
return;
}
BottomViewModel bottomViewModel = this.N;
if (bottomViewModel != null) {
bottomViewModel.h.postValue(Boolean.TRUE);
}
w59Var.Y(new d());
w59Var.Q();
}
public final void C9(androidx.core.util.Pair pair) {
View view = (View) pair.first;
Rect rect = (Rect) pair.second;
if (view == null) {
return;
}
if (this.t == null) {
this.t = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R$layout.dynamic_view_comment_tip_pop_window, (ViewGroup) null, false);
}
this.t.bubble.setArrowPositionCenter(false);
this.t.bubble.setArrowStartLocation(2);
int b2 = ct3.b(o41.c(), 242.0f);
this.u = new CustomPopWindow.PopupWindowBuilder(getContext()).e(this.t.getRoot()).f(b2, -2).a().r(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).getRoot(), 0, rect.centerX() + (q42.y() ? ct3.b(o41.c(), -54.0f) : ct3.b(o41.c(), -189.0f)), rect.bottom + ct3.b(o41.c(), 8.0f));
}
public final void D4() {
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null && detailViewModel.n != null) {
this.V.setCommentCommitEnable(false);
this.V.setCommentQueryEnable(false);
}
DetailOptions detailOptions = this.K;
if (detailOptions != null) {
this.V.setModifyPoi(McConstant.McPoiOperationType.MODIFY == detailOptions.getPoiType());
}
hm4.f("DetailFragment", "getDynamicCardData goneCommentCard");
Z4(new int[]{sb2.G, sb2.F}, this.U);
}
public final Void D5(Object obj) {
DetailReportUtil.V(this.K.getSite(), MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE, MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
return null;
}
public final void D6(List list) {
hm4.f("DetailFragment", "mTravelDataObserver changed:" + list);
if (list == null) {
return;
}
DynamicPoiDetailBean dynamicPoiDetailBean = new DynamicPoiDetailBean();
this.c.S.setValue(Integer.valueOf((int) (((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtitle.getWidth() * 0.4f)));
SearchConfigViewModel searchConfigViewModel = this.l;
if (searchConfigViewModel != null) {
List<PoiTicketsInfo> list2 = (List) searchConfigViewModel.a.t().getValue();
if (!tha.b(list) && !tha.b(list2)) {
I9(list2, list);
}
}
this.c.R.setValue(Boolean.valueOf(!tha.b(list)));
dynamicPoiDetailBean.setTravel(list);
Z4(new int[]{sb2.v}, dynamicPoiDetailBean);
}
public final void D9(Object obj, boolean z) {
Optional.ofNullable((Site) this.c.n.getValue()).map(new Function() {
@Override
public final Object apply(Object obj2) {
return ((Site) obj2).getSiteId();
}
}).ifPresent(new Consumer() {
@Override
public final void accept(Object obj2) {
DetailFragment.this.f8((String) obj2);
}
});
if (obj instanceof WebViewData) {
WebViewData webViewData = (WebViewData) obj;
String url = webViewData.getUrl();
this.F = url;
if (TextUtils.isEmpty(url)) {
cz9.p(o41.c().getString(R$string.no_click_url));
} else {
if (!qk9.r()) {
v9();
return;
}
if (z) {
tg3.e(this.F);
}
G8(webViewData);
}
}
}
public final void E4() {
w59 w59Var = w59.a;
if (w59Var.B()) {
cz9.j(R$string.realtime_location_add_share_limit);
} else {
t8();
w59Var.I(getActivity(), 0);
}
}
public final Void E5(Object obj) {
DetailReportUtil.V(this.K.getSite(), "5", MapSubmitSuccessDialogType.IS_FROM_POI_UGC);
return null;
}
public final void E6(List list) {
hm4.f("DetailFragment", "mTodayHotelDetailDataObserver changed:" + list);
if (((BaseFragment) this).mBinding != null) {
a32.h().p(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).topImageLayout, list);
}
}
public final void E7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
com.huawei.maps.dynamic.card.utils.a.a.k((Site) this.c.n.getValue(), layoutSiteDetailBinding.imgBrandLogo);
}
public final void E8(String str) {
final Context context = getContext();
if (context == null) {
return;
}
try {
final SafeIntent safeIntent = str.startsWith("android-app://") ? new SafeIntent(Intent.parseUri(str, 2)) : new SafeIntent(Intent.parseUri(str, 1));
safeIntent.setClipData(null);
safeIntent.addCategory("android.intent.category.BROWSABLE");
safeIntent.setFlags(268435456);
safeIntent.setComponent(null);
safeIntent.setSelector((Intent) null);
dv9.a(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
IntentUtils.safeStartActivity(context, safeIntent);
}
});
} catch (ActivityNotFoundException e2) {
hm4.h("DetailFragment", "deepLinkOpenApp: ActivityNotFoundException: " + e2.getMessage());
} catch (NullPointerException e3) {
hm4.h("DetailFragment", "deepLinkOpenApp: NullPointerException: " + e3.getMessage());
} catch (URISyntaxException e4) {
hm4.h("DetailFragment", "deepLinkOpenApp: URISyntaxException: " + e4.getMessage());
} catch (Exception e5) {
hm4.h("DetailFragment", "deepLinkOpenApp: Exception:" + e5.getMessage());
}
}
public final void Y7(String str) {
cz9.f();
cz9.p(str);
}
public void F4(final int i2) {
e4.a().silentSignIn(new OnAccountSuccessListener() {
public final void onSuccess(Account account) {
DetailFragment.Q5(account);
}
}, new OnAccountFailureListener() {
public final void onFailure(Exception exc) {
DetailFragment.this.R5(i2, exc);
}
});
}
public final Void F5(Object obj) {
DetailReportUtil.Y(this.K.getSite());
return null;
}
public final void F7() {
O9(true);
}
public final void F8(Object obj) {
hm4.f("DetailFragment", " OPEN_DETAIL_FRAGMENT_WITH_NEW_SITE ");
this.c.f().setValue((Object) null);
this.c.g().setValue((Object) null);
this.c.f().removeObserver(this.j1);
this.c.g().removeObserver(this.i1);
Site site = (Site) obj;
Site site2 = (Site) this.c.n.getValue();
this.j0 = site2;
Q3(site2, site);
LatLng latLng = new LatLng(site.getLocation().getLat(), site.getLocation().getLng());
this.K.needMoveCamera(false);
this.K.showCenter(false);
CameraPosition.builder().target(latLng).build();
this.d0.push(this.K);
da(d32.t(site));
MapHelper.F2().v8(site);
ea();
e9(this.d0.size() == 0);
}
public final void F9(Site site) {
if (site == null) {
hm4.h("DetailFragment", "show ugc check site error");
return;
}
if (k0a.k().m()) {
hm4.h("DetailFragment", "traceless mode");
return;
}
if (this.K.getRecords() != null && TextUtils.equals(DetailOptions.LONG_CLICK, this.K.getRecords().getPoiType())) {
this.K.poiType(McConstant.McPoiOperationType.NEW);
}
if (UgcAgcSwitchUtil.h()) {
this.y = b37.e(site, this.K.getPoiType()) ? b37.h() : b37.k(site);
} else {
this.y = false;
}
}
public void G4(boolean z) {
SafeBundle safeBundle = new SafeBundle();
Site site = (Site) this.c.n.getValue();
RouteDataManager.b().I(MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE);
if (site == null) {
return;
}
safeBundle.putParcelable("site", site);
safeBundle.putBoolean("open_keyboard", z);
safeBundle.putBoolean("open_comment_picture_selection", !z);
safeBundle.putBoolean("comment_service_online", this.E0);
safeBundle.putString("page_source", "from_poi_reviews_page");
PoiReportCommonUtil.h0(this, R$id.detail_to_poi_comment_create, site, safeBundle.getBundle());
}
public final void G6(List list) {
hm4.f("DetailFragment", "mTrivagoDataObserver changed:" + list);
if (list == null) {
return;
}
this.U.setTrivagoList(list);
Z4(new int[]{sb2.x}, this.U);
}
public final void G7(View view) {
view.postDelayed(new Runnable() {
@Override
public final void run() {
DetailFragment.this.F7();
}
}, 500L);
}
public final void G8(WebViewData webViewData) {
if (!qk9.r()) {
v9();
return;
}
this.R.p(this.F);
DetailReportUtil.w(webViewData.getSourceName());
this.c.s.setValue(8);
MapMutableLiveData<Boolean> mapMutableLiveData = this.c.P;
Boolean bool = Boolean.TRUE;
mapMutableLiveData.setValue(bool);
this.g0 = System.currentTimeMillis();
this.i = true;
this.c.O.setValue(bool);
this.c.N.setValue(this.F);
M3(true);
}
public void H4(float f3) {
SafeBundle safeBundle = new SafeBundle();
Site site = (Site) this.c.n.getValue();
if (site == null) {
return;
}
RouteDataManager.b().I(MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE);
safeBundle.putParcelable("site", site);
safeBundle.putBoolean("comment_service_online", this.E0);
safeBundle.putBoolean("open_keyboard", true);
safeBundle.putFloat("key_rating", f3);
safeBundle.putString("page_source", "from_poi_reviews_page");
PoiReportCommonUtil.h0(this, R$id.detail_to_poi_comment_create, site, safeBundle.getBundle());
}
public final Void H5(Object obj) {
DetailReportUtil.X(this.K.getSite());
return null;
}
public final void H6() {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.scrollToPosition(0);
}
}
public final void H8(String str, Object obj) {
char c2;
TitleInfo titleInfo;
Context c3;
str.hashCode();
switch (str.hashCode()) {
case -1664781625:
if (str.equals("clickPowerByItem")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case -1496470916:
if (str.equals("clickWeatherCard")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case -1268879491:
if (str.equals("click_comment_reply_detail")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case -1200194966:
if (str.equals("SiteMailClick")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -1182152711:
if (str.equals("PoiCommentTranslate")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case -1147058684:
if (str.equals("BusinessHourClick")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case -1125803192:
if (str.equals("PoiCommentItemImagesClick")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case -1092869788:
if (str.equals("clickCommentTip")) {
c2 = 7;
break;
}
c2 = 65535;
break;
case -894279804:
if (str.equals("clickGuideCard")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
case -609388385:
if (str.equals("PoiCommentReportClick")) {
c2 = '\t';
break;
}
c2 = 65535;
break;
case -452300941:
if (str.equals("click_comment_input")) {
c2 = '\n';
break;
}
c2 = 65535;
break;
case -447660578:
if (str.equals("PoiCommentMoreClick")) {
c2 = 11;
break;
}
c2 = 65535;
break;
case -392464391:
if (str.equals("clickViewMoreTip")) {
c2 = '\f';
break;
}
c2 = 65535;
break;
case -341789428:
if (str.equals("datePickerClick")) {
c2 = '\r';
break;
}
c2 = 65535;
break;
case -279971002:
if (str.equals("click_all_reviews")) {
c2 = 14;
break;
}
c2 = 65535;
break;
case -167049816:
if (str.equals("clear_removed_child_comments")) {
c2 = 15;
break;
}
c2 = 65535;
break;
case 147003916:
if (str.equals("PoiCommentLike")) {
c2 = 16;
break;
}
c2 = 65535;
break;
case 175389085:
if (str.equals("expandProviderClick")) {
c2 = 17;
break;
}
c2 = 65535;
break;
case 286335865:
if (str.equals("clickTopRankingCard")) {
c2 = 18;
break;
}
c2 = 65535;
break;
case 303990371:
if (str.equals("clickImageCard")) {
c2 = 19;
break;
}
c2 = 65535;
break;
case 577472647:
if (str.equals("poiLikeCommentUpdate")) {
c2 = 20;
break;
}
c2 = 65535;
break;
case 743502016:
if (str.equals("clickServiceItem")) {
c2 = 21;
break;
}
c2 = 65535;
break;
case 939577979:
if (str.equals("selectProviderClick")) {
c2 = 22;
break;
}
c2 = 65535;
break;
case 945855447:
if (str.equals("LongCopyClick")) {
c2 = 23;
break;
}
c2 = 65535;
break;
case 1180256762:
if (str.equals("clickProductItem")) {
c2 = 24;
break;
}
c2 = 65535;
break;
case 1213765669:
if (str.equals("clickEventItem")) {
c2 = 25;
break;
}
c2 = 65535;
break;
case 1238116464:
if (str.equals("PoiCommentGoToClick")) {
c2 = 26;
break;
}
c2 = 65535;
break;
case 1374431105:
if (str.equals("SitePhoneClick")) {
c2 = 27;
break;
}
c2 = 65535;
break;
case 1378771807:
if (str.equals("PoiCommentHighlight")) {
c2 = 28;
break;
}
c2 = 65535;
break;
case 1743632102:
if (str.equals("SiteWebUrlClick")) {
c2 = 29;
break;
}
c2 = 65535;
break;
case 1979977290:
if (str.equals("handle_other_replies_text")) {
c2 = 30;
break;
}
c2 = 65535;
break;
case 1982976853:
if (str.equals("SiteUploadImageClick")) {
c2 = 31;
break;
}
c2 = 65535;
break;
case 2071857411:
if (str.equals("clickMeasureDistanceTool")) {
c2 = ' ';
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
D9(obj, true);
break;
case 1:
Site site = (Site) this.c.n.getValue();
if (site != null && site.getLocation() != null && site.getAddress() != null) {
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", site);
RouteDataManager.b().P(true);
r26.a.a(this, R$id.detail_to_weather, safeBundle.getBundle());
t8();
DetailReportUtil.n();
break;
}
break;
case 2:
if (obj instanceof cm7) {
cm7 cm7Var = (cm7) obj;
z4(cm7Var.b(), cm7Var.a());
break;
}
break;
case 3:
case 5:
case '\r':
case 17:
case 21:
case 24:
case 25:
case 29:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
DetailReportUtil.I(str, (Site) this.c.n.getValue(), obj);
break;
case 4:
if (obj instanceof th1) {
th1 th1Var = (th1) obj;
if (th1Var.a().isTranslatedClick()) {
vz6.o("see original");
} else {
vz6.o("see translate");
}
if (this.J0 != null) {
String commentID = th1Var.a().getCommentID();
int i2 = -1;
for (CommentDataInfo commentDataInfo : this.J0) {
if (commentDataInfo.getCommentID().equals(commentID)) {
i2 = this.J0.indexOf(commentDataInfo);
}
}
if (i2 != -1) {
if (tha.a(this.J0.get(i2).getTranslatedText())) {
if (qk9.r()) {
TranslationEvent.b bVar = new TranslationEvent.b(this.J0.get(i2).getComment(), commentID);
this.J0.get(i2).setIsTranslatedClick(true);
aa();
this.e.h(bVar);
break;
} else {
cz9.k(o41.f(R$string.no_network));
aa();
break;
}
} else {
this.J0.get(i2).setIsTranslatedClick(!this.J0.get(i2).isTranslatedClick());
aa();
break;
}
}
}
}
break;
case 6:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (obj instanceof Pair) {
Pair pair = (Pair) obj;
B4(cz3.a((MediaComment) pair.first), ((ImageClickCallBackBean) pair.second).getPicPosition());
}
t8();
break;
case 7:
if (obj instanceof androidx.core.util.Pair) {
C9((androidx.core.util.Pair) obj);
break;
}
break;
case '\b':
if ((obj instanceof TitleInfo) && (titleInfo = (TitleInfo) obj) != null) {
rg3.b("city_detail_page", titleInfo.getTitle());
}
t8();
break;
case '\t':
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (obj instanceof CommentDataInfo) {
A4((CommentDataInfo) obj);
break;
}
break;
case '\n':
if (obj instanceof th1) {
if (e4.a().isChildren()) {
cz9.j(R$string.protect_minors_enable);
break;
} else {
x4((th1) obj);
break;
}
}
break;
case 11:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (!o72.e("PoiCommentMoreClick")) {
p4();
break;
}
break;
case '\f':
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (obj != null && (obj instanceof View)) {
B9((View) obj);
break;
}
break;
case 14:
if (obj instanceof HashMap) {
y4((HashMap) obj);
break;
}
break;
case 15:
CommentRepliesSharedViewModel commentRepliesSharedViewModel = this.S;
if (commentRepliesSharedViewModel != null) {
commentRepliesSharedViewModel.h();
break;
}
break;
case 16:
if (obj instanceof PoiLikeAction) {
e4((PoiLikeAction) obj);
break;
}
break;
case 18:
if (obj instanceof CustomRecommendDataBean.DataBean.CustomListBean) {
CustomRecommendDataBean.DataBean.CustomListBean customListBean = (CustomRecommendDataBean.DataBean.CustomListBean) obj;
if (customListBean != null && !tha.a(customListBean.getPoiType())) {
rg3.e("city_detail_page", customListBean.getPoiType());
}
t8();
break;
}
break;
case 19:
if (obj instanceof ImageClickCallBackBean) {
ImageClickCallBackBean imageClickCallBackBean = (ImageClickCallBackBean) obj;
if (imageClickCallBackBean.getPictureInfoBean() != null) {
if (imageClickCallBackBean.isClickMore()) {
t8();
Bundle bundle = new Bundle();
bundle.putParcelable("poi_site", (Parcelable) this.c.n.getValue());
bundle.putParcelableArrayList("poi_all_pictures", (ArrayList) e17.d((Site) this.c.n.getValue()));
bundle.putParcelableArrayList("poi_all_videos", (ArrayList) e17.e((Site) this.c.n.getValue()));
bundle.putParcelableArrayList("poi_user_pictures", (ArrayList) e17.i((List) this.c.p0.getValue()));
bundle.putBoolean("ugc_photo_poi_name_clicked", this.y0);
ux4.c(this, R$id.detail_to_album_fragment, bundle);
DetailReportUtil.O((Site) this.c.n.getValue());
break;
} else if (imageClickCallBackBean.getPictureInfoBean().getIsUploadImgView() == 1) {
if (e4.a().hasLogin()) {
x8(MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
break;
} else {
F4(10007);
break;
}
} else if (!imageClickCallBackBean.getPictureInfoBean().isVideoThumbnail() || TextUtils.isEmpty(imageClickCallBackBean.getPictureInfoBean().getVideoUrl())) {
DetailReportUtil.W((Site) this.c.n.getValue(), String.valueOf(imageClickCallBackBean.getPicPosition() + 1), "picture");
List<String> f3 = e17.f(e17.d((Site) this.c.n.getValue()));
z9(f3, f3, imageClickCallBackBean.getPicPosition());
break;
} else {
t8();
String videoUrl = imageClickCallBackBean.getPictureInfoBean().getVideoUrl();
Bundle bundle2 = new Bundle();
bundle2.putString("url_path_operation", videoUrl);
bundle2.putBoolean("isShowTitleBar", videoUrl.endsWith(".html"));
bundle2.putBoolean("isSupportFullScreen", true);
bundle2.putBoolean("isNeedSaveOverlay", true);
ux4.c(this, R$id.fragment_operation, bundle2);
DetailReportUtil.W((Site) this.c.n.getValue(), String.valueOf(imageClickCallBackBean.getPicPosition() + 1), "videoThumbnai");
break;
}
}
}
break;
case 20:
if (obj instanceof CommentDataInfo) {
Y9((CommentDataInfo) obj);
break;
}
break;
case 22:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (obj instanceof Pair) {
Pair pair2 = (Pair) obj;
DetailReportUtil.c0(this.K.getSite(), String.valueOf(pair2.first), String.valueOf(pair2.second));
break;
}
break;
case 23:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
DetailReportUtil.T(this.K.getSite(), String.valueOf(obj), MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
DetailReportUtil.F(String.valueOf(obj), this.K.isMapLongClick());
break;
case 26:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if ((obj instanceof th1) && (c3 = o41.c()) != null) {
final SafeIntent safeIntent = new SafeIntent(new Intent("android.intent.action.MAIN", (Uri) null));
safeIntent.addCategory("android.intent.category.LAUNCHER");
if (l5(c3.getPackageManager().queryIntentActivities((Intent) safeIntent, 0))) {
E8("booking://hotel/");
break;
} else {
dv9.a(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i3) {
DetailFragment.this.L7(safeIntent, dialogInterface, i3);
}
});
break;
}
}
break;
case 27:
DetailReportUtil.l0(this.d0.size() == 0, "call", s4());
DetailReportUtil.I(str, (Site) this.c.n.getValue(), obj);
break;
case 28:
if (obj instanceof HighlightCommentBean) {
this.H0 = (HighlightCommentBean) obj;
if (!TextUtils.isEmpty(this.D0)) {
this.H0.getListener().onHighlight(this.D0);
break;
}
}
break;
case 30:
if (obj instanceof th1) {
J8(((th1) obj).a());
break;
}
break;
case 31:
if (e4.a().hasLogin()) {
x8(MapSubmitSuccessDialogType.IS_FROM_POI_UGC);
break;
} else {
F4(10008);
break;
}
case ' ':
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null) {
hm4.f("DetailFragment", "CLICK_MEASURE_DISTANCE_TOOL DetailVM is null");
break;
} else {
Site site2 = (Site) detailViewModel.n.getValue();
if (site2 != null) {
yl7.w().i1();
MeasurePageSource measurePageSource = MeasurePageSource.FROM_POI;
DetailReportUtil.o(measurePageSource.getPageSource());
SafeBundle safeBundle2 = new SafeBundle();
safeBundle2.putParcelable("site", site2);
safeBundle2.putString("page_source_key", measurePageSource.getPageSource());
r26.a.a(this, R$id.detail_to_measure_distance_fragment, safeBundle2.getBundle());
this.c.E.postValue(Boolean.TRUE);
t8();
break;
}
}
break;
default:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
i5(str, obj);
break;
}
}
public final void H9(String str, MapRecyclerView mapRecyclerView) {
if (mapRecyclerView == null || mapRecyclerView.getAdapter() == null || this.G == null) {
return;
}
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).appBar.setExpanded(false);
this.G.A0(true);
this.G.z0(true);
if (this.Q0 == null) {
this.Q0 = new RecyclerSmoothScroller(getContext());
}
this.Q0.setTargetPosition(0);
if (TextUtils.equals(str, "overview")) {
this.Q0.setTargetPosition(0);
} else if (TextUtils.equals(str, "review") && this.G.F() != Integer.MAX_VALUE) {
this.Q0.setTargetPosition(this.G.F());
} else if (TextUtils.equals(str, "tool") && this.G.H() != Integer.MAX_VALUE) {
this.Q0.setTargetPosition(this.G.H());
} else if (TextUtils.equals(str, "strategy") && this.G.G() != Integer.MAX_VALUE) {
this.Q0.setTargetPosition(this.G.G());
} else if (TextUtils.equals(str, "nearby") && this.G.E() != Integer.MAX_VALUE) {
this.Q0.setTargetPosition(this.G.E());
}
try {
mapRecyclerView.getLayoutManager().startSmoothScroll(this.Q0);
} catch (IllegalArgumentException e2) {
hm4.h("DetailFragment", "msg:" + e2.getMessage() + " " + this.Q0.getTargetPosition());
}
}
public final void I4(JsonObject jsonObject) {
hm4.f("DetailFragment", " handleAdditionData begin");
if (jsonObject == null) {
if (isResumed()) {
cz9.j(R$string.feedback_sdk_no_network_toast);
}
} else {
W9(jsonObject);
p5(jsonObject);
if (k.h2()) {
P9(jsonObject);
}
}
}
public final Void I5(Object obj) {
DetailReportUtil.Z(this.K.getSite());
return null;
}
public final void I7(float f3, DynamicCardAdapter dynamicCardAdapter) {
if (((BaseFragment) this).mBinding != null) {
a32.h().p(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).topImageLayout, Float.valueOf(f3));
}
}
public final void I8(Site site) {
if (!this.K.isShowCenter()) {
if (ct3.A(o41.c()) == ScreenDisplayStatus.PAD_AND_LANDSCAPE) {
T4(site, (ct3.e(getActivity()) * 5) / 10);
return;
} else {
T4(site, (ct3.e(getActivity()) * 4) / 10);
return;
}
}
if (this.K.isLocationMarkerClick()) {
AbstractLocationHelper.getInstance().handleLocationMarkerClick();
m5(site);
}
int geoZoom = (!TextUtils.equals("999999999999999999999999999", site.getSiteId()) || site.getLocation() == null) ? this.K.getGeoZoom() : (int) site.getLocation().getZoom();
if (this.K.isCollectSite() || this.K.isChildNode()) {
return;
}
MapHelper F2 = MapHelper.F2();
if (geoZoom == -1) {
geoZoom = 18;
}
F2.w8(site, true, geoZoom);
}
public final void I9(List<PoiTicketsInfo> list, List<TravelBean> list2) {
List list3;
list.sort(new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
int g8;
g8 = DetailFragment.g8((PoiTicketsInfo) obj, (PoiTicketsInfo) obj2);
return g8;
}
});
HashMap hashMap = new HashMap();
for (int i2 = 0; i2 < list.size(); i2++) {
hashMap.put(list.get(i2).getSource(), new ArrayList());
}
int i3 = 0;
for (int i4 = 0; i4 < list2.size(); i4++) {
if (hashMap.containsKey(list2.get(i4).getSource()) && (list3 = (List) hashMap.get(list2.get(i4).getSource())) != null) {
list3.add(list2.get(i4));
i3 = Math.max(list3.size(), i3);
}
}
ArrayList arrayList = new ArrayList();
for (int i5 = 0; i5 < i3; i5++) {
for (PoiTicketsInfo poiTicketsInfo : list) {
List list4 = (List) hashMap.get(poiTicketsInfo.getSource());
if (!tha.b(list4) && i5 < list4.size()) {
((TravelBean) list4.get(i5)).setIconUrl(poiTicketsInfo.getIconUrl());
((TravelBean) list4.get(i5)).setSourceName(poiTicketsInfo.getSourceName());
((TravelBean) list4.get(i5)).setSource(poiTicketsInfo.getSource());
((TravelBean) list4.get(i5)).setChannel(q4(poiTicketsInfo.getAds()));
arrayList.add((TravelBean) list4.get(i5));
}
}
}
list2.clear();
list2.addAll(arrayList);
}
public final void J4(boolean z) {
this.E0 = z;
}
public final Void J5(Object obj) {
if (!(obj instanceof ReserveReportData)) {
return null;
}
ReserveReportData reserveReportData = (ReserveReportData) obj;
vz6.n("search_reservation_btn_click", reserveReportData.getClickContent(), reserveReportData.getClickType(), DetailReportUtil.i(this.K.getOperationSource()));
AbstractMapUIController.getInstance().reportOpeEvent("022001");
return null;
}
public final void J6(Restaurant restaurant) {
hm4.f("DetailFragment", "mRestaurantObserver changed:" + restaurant);
this.c.q.setValue(restaurant);
}
public final void J8(CommentDataInfo commentDataInfo) {
ChildComments childComments;
Integer total;
if (commentDataInfo == null || (childComments = commentDataInfo.getChildComments()) == null || (total = childComments.getTotal()) == null) {
return;
}
int intValue = total.intValue() - 3;
if (total.intValue() <= 3) {
DynamicPoiCommentAdapter.d = "";
return;
}
DynamicPoiCommentAdapter.d = " " + o41.c().getResources().getQuantityString(R$plurals.comment_reply_others, intValue, Integer.valueOf(intValue));
}
public void J9(LatLng latLng) {
if (latLng == null) {
return;
}
e5();
this.L.a0(DetailOptions.LONG_CLICK);
this.c.i.setValue(8);
NearbySearchRequest nearbySearchRequest = new NearbySearchRequest();
nearbySearchRequest.setPoliticalView(ServicePermission.getPoliticalView());
Coordinate coordinate = new Coordinate(latLng.latitude, latLng.longitude);
nearbySearchRequest.setLocation(coordinate);
Site site = new Site();
site.setLocation(coordinate);
if (this.K.isCollectSite()) {
site.setColletSite(true);
}
if (!this.K.isGeo()) {
if (TextUtils.isEmpty(this.K.getSiteName())) {
site.setName("[Marked Location]");
} else {
site.setName(this.K.getSiteName());
}
site.setPoiType(DetailOptions.LONG_CLICK);
if (this.K.isShowCenter()) {
MapHelper.F2().x8(site, this.K.getGeoZoom() == -1 ? 18 : this.K.getGeoZoom(), true);
if (this.K.isLocationMarkerClick()) {
MapHelper.F2().j6();
}
} else if (this.K.isLocationMarkerClick()) {
AbstractLocationHelper.getInstance().handleLocationMarkerClick();
} else if (this.K.isMapLongClick()) {
MapHelper.F2().z3(site);
}
} else if (this.K.getGeoZoom() != -1) {
site.setName("[Marked Location]");
site.setPoiType(DetailOptions.LONG_CLICK);
MapHelper.F2().w8(site, this.K.getGeoZoom() != 0, this.K.getGeoZoom());
} else {
site.setName(TextUtils.isEmpty(this.K.getGeoLabel()) ? "[Marked Location]" : this.K.getGeoLabel());
}
if (!TextUtils.isEmpty(this.K.getSiteName())) {
site.setName(this.K.getSiteName());
}
M9(site);
this.c.C.reverseGeocode(nearbySearchRequest, this.K);
this.c.n.setValue(site);
this.N.a.setValue(site);
boolean isSearchHistorySite = this.K.isSearchHistorySite();
if (this.K.isLocationMarkerClick()) {
return;
}
MapHelper.F2().k5(latLng, isSearchHistorySite, 15.0f);
}
public void K3() {
MapHelper.F2().B7(19, new e());
}
public final void K4(Site site) {
if (site == null || !(pa9.g(site) || pa9.k(site))) {
X4(null, null, false, null);
this.V.setShowExchangeRateConversion(false);
} else {
d5();
this.c.B.getPopularCities();
}
}
public final Void K5(Object obj) {
this.c.E.setValue(Boolean.TRUE);
cv1.c().f(this, obj, (Site) this.c.n.getValue());
return null;
}
public final void K6() {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.scrollToPosition(0);
}
}
public final void K7(int i2, List list, List list2, int i3) throws IOException, NoSuchAlgorithmException {
if (tha.b(this.V0)) {
this.V0 = new ArrayList();
}
if (i3 == 0) {
FileItem fileItem = (FileItem) list.get(0);
this.W0.add(fileItem);
this.V0.add(new MediaItem(o41.c(), fileItem.getFileName(), fileItem.getFilePath(), fileItem.getSize(), fileItem.getDuration(), fileItem.getId()));
} else {
this.W0 = list;
this.V0.clear();
Iterator it = list.iterator();
while (it.hasNext()) {
FileItem fileItem2 = (FileItem) it.next();
this.V0.add(new MediaItem(o41.c(), fileItem2.getFileName(), fileItem2.getFilePath(), fileItem2.getSize(), fileItem2.getDuration(), fileItem2.getId()));
}
}
submitData();
}
public final void K8() {
hm4.p("DetailFragment", "pullDynamicCard");
if (this.U == null) {
return;
}
U8();
if (this.K != null) {
this.V.setFromGeoWithAddress(!TextUtils.isEmpty(r0.getGeoPoiAddress()));
boolean z = (RouteDataManager.b().s() || RouteDataManager.b().r()) ? false : true;
boolean z2 = (RouteDataManager.b().q() || RouteDataManager.b().p()) ? false : true;
if (this.y && z2 && z) {
this.V.setPoiType(this.K.getPoiType().name());
this.V.setReportIssue(!b37.e(this.U.getSite(), this.K.getPoiType()));
}
}
this.V.setShowUGC(this.y);
this.U.setLocalDataBean(this.V);
String u4 = u4();
if (this.U.getSite() != null && this.U.getSiteJson() == null) {
DynamicSiteBean dynamicSiteBean = new DynamicSiteBean();
dynamicSiteBean.setSite(this.U.getSite());
this.U.setSiteJson(JsonParser.parseString(og3.a(dynamicSiteBean)).getAsJsonObject());
}
this.V.setShowBusinessOwner(false);
xb2.b().a(u4, this.U, new DynamicCardDataCallBack() {
public final void onCallBack(List list) {
DetailFragment.this.M7(list);
}
});
this.c.F.setValue(this.W);
b9();
}
public final void L3() {
if (this.K.isLocationMarkerClick()) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).w();
}
});
return;
}
hm4.p("DetailFragment", "addSatelliteLayout not location marker click");
SatelliteCardData satelliteCardData = new SatelliteCardData();
satelliteCardData.setMyLocation(false);
S9(satelliteCardData);
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).k0();
}
});
}
public void L4(GooglResponse googlResponse) {
Site site = googlResponse.getSite();
Throwable throwable = googlResponse.getThrowable();
if (site != null && throwable == null) {
hm4.f("DetailFragment", "normal");
this.L.a0(DetailOptions.LONG_CLICK);
Optional.ofNullable(this.G).ifPresent(new v12());
this.L.X(site);
CollectHelper.Z(false);
MapHelper.F2().w8(site, true, 15);
this.c.n.setValue(site);
this.N.a.setValue(site);
c9(site);
return;
}
if (site != null && throwable != null) {
hm4.f("DetailFragment", "error reverse");
Optional.ofNullable(this.G).ifPresent(new v12());
MapHelper.F2().x8(site, 15, true);
M9(site);
return;
}
if (site != null || throwable == null) {
return;
}
if (!qk9.r()) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.S5((DetailUIHandler) obj);
}
});
} else if ("no latlng info".equals(throwable.getMessage())) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.T5((DetailUIHandler) obj);
}
});
} else {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.U5((DetailUIHandler) obj);
}
});
}
hm4.f("DetailFragment", "error google");
}
public final Void L5(Object obj) {
this.N.s.setValue(Long.valueOf(System.currentTimeMillis()));
this.z = true;
this.c.E.setValue(Boolean.TRUE);
cv1.c().e(this, obj, (Site) this.c.n.getValue());
return null;
}
public final void L6(Delivery delivery) {
hm4.f("DetailFragment", "mDeliveryObserver changed:" + delivery);
if (delivery == null) {
return;
}
List<RestaurantDetails> b2 = vq0.b((List) this.l.a().G().getValue(), delivery);
if (tha.b(b2)) {
return;
}
this.U.setDeliveryDetails(b2);
a5(new int[]{sb2.V}, this.U, new CardUpdateCallback() {
@Override
public final void endUpdate() {
DetailFragment.this.K6();
}
});
}
public final void L7(SafeIntent safeIntent, DialogInterface dialogInterface, int i2) {
String G = k.G();
if (TextUtils.isEmpty(G)) {
return;
}
safeIntent.setAction("android.intent.action.VIEW");
Uri parse = Uri.parse(G);
if (c55.e(parse.toString()).booleanValue()) {
safeIntent.setData(parse);
IntentUtils.safeStartActivity(getActivity(), safeIntent);
}
}
public final void L8() {
HotelReservationCardBean.TODAY_LONG.set((Object) null);
HotelReservationCardBean.NEXT_LONG.set((Object) null);
}
public final void L9(Site site, boolean z) {
if (site == null) {
return;
}
AbstractLocationHelper.getInstance().resetLocationMarker();
if (!z) {
MapHelper.F2().v1(false);
}
this.L.a0("click");
this.c.i.setValue(8);
site.setPoiType("click");
M9(site);
this.c.n.setValue(site);
ez0.a.c(site);
if (!tg6.b().d().isExecuteOfflineLogic() && !NetworkUtil.isNetworkAvailable(getContext())) {
cz9.p(o41.f(R$string.no_network));
if (!this.K.isNeedMoveCamera() || this.c.n.getValue() == null) {
return;
}
MapHelper.F2().v8((Site) this.c.n.getValue());
return;
}
boolean isNetworkAvailable = NetworkUtil.isNetworkAvailable(getContext());
if (isNetworkAvailable && AbstractMapUIController.getInstance().isOfflineData(site.getSiteId())) {
cz9.p(o41.f(R$string.site_change_tips));
if (TextUtils.isEmpty(site.getName())) {
site.setName("[Marked Location]");
}
q8(site);
return;
}
if (!isNetworkAvailable && !tg6.b().a().isExecuteOfflineLogic()) {
cz9.o(R$string.no_network);
q8(site);
return;
}
if (!site.isCloseDetail() && !"[Marked Location]".equals(site.getName()) && (!this.K.isFromNavComplete() || site.getPoi() == null)) {
if (!this.K.isFromNavComplete()) {
this.c.B.startDetailSearch(site);
return;
}
Coordinate location = site.getLocation();
if (location != null) {
J9(new LatLng(location.getLat(), location.getLng()));
return;
}
return;
}
if (!TextUtils.isEmpty(site.getSiteId()) && !TextUtils.equals("999999999999999999999999999", site.getSiteId()) && "[Marked Location]".equals(site.getName())) {
cz9.p(o41.f(R$string.site_change_tips));
}
this.c.B.getDetailData().postValue(site);
if (qk9.r() || tg6.b().a().isExecuteOfflineLogic()) {
return;
}
cz9.o(R$string.no_network);
}
public final void M3(boolean z) {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding == null || ((LayoutSiteDetailBinding) viewDataBinding).operationLayout.llPoiOperate.getVisibility() == 8) {
return;
}
if (z) {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.llPoiOperate.setPadding(0, ct3.b(o41.b(), 2.0f), 0, ct3.b(o41.b(), 8.0f));
} else {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.llPoiOperate.setPadding(0, 0, 0, ct3.b(o41.b(), 10.0f));
}
}
public void M4(String str) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).u0();
}
});
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.V5((DetailUIHandler) obj);
}
});
this.c.i.setValue(8);
this.c.G.lambda$getGoogleSite$0(str);
}
public final Void M5(Object obj) {
cv1.c().d(this, obj);
return null;
}
public final void M6(SearchNearbyResponse searchNearbyResponse) {
if (o5() || searchNearbyResponse == null) {
return;
}
Q4(searchNearbyResponse.getSites());
DynamicCardNearbySubwayBusRecommendationsCardHolder.setFromSecondaryPage(false);
}
public final void M7(List list) {
this.W.b(list);
DetailUIHandler detailUIHandler = this.G;
boolean R = detailUIHandler != null ? detailUIHandler.R() : true;
if (!this.A && !this.z && isAdded() && R) {
DetailOptions detailOptions = this.K;
if (detailOptions != null && detailOptions.isScrollToExpand) {
ve8.p().O(300);
} else if (detailOptions == null || !detailOptions.isScrollToComment()) {
if (j5()) {
ve8.p().o0();
} else {
ve8.p().M(e40.B0);
}
} else {
if (this.W == null || this.G == null) {
return;
}
int baseline = ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.getRoot().getBaseline();
ve8.p().O(0);
ve8.p().Y(this.G.C(baseline));
m9(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv, this.K.isScrollNeededToCardShelf());
if (k0a.k().m()) {
k0a.k().B(getActivity(), TracelessModeTips.TIP_NORMAL);
return;
} else if (!e4.a().hasLogin()) {
F4(10006);
this.K.setScrollToComment(false);
return;
}
}
}
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv.postDelayed(new Runnable() {
@Override
public final void run() {
DetailFragment.this.N7();
}
}, 400L);
m9(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv, this.K.isScrollNeededToCardShelf());
}
public void M8() {
if (tha.b(this.h)) {
return;
}
Iterator<Polygon> it = this.h.iterator();
while (it.hasNext()) {
it.next().remove();
}
this.h.clear();
MapHelper.F2().q1();
}
public final void N3() {
Site site;
if (this.c == null) {
return;
}
String P0 = k.P0();
String serviceCountry = ServicePermissionManager.INSTANCE.getServiceCountry();
if ((TextUtils.isEmpty(P0) || TextUtils.isEmpty(serviceCountry) || !P0.contains(serviceCountry)) && (site = (Site) this.c.n.getValue()) != null) {
String R0 = k.R0();
Poi poi = site.getPoi();
if (qc6.c(poi)) {
String[] hwPoiTypeIds = poi.getHwPoiTypeIds();
if (!TextUtils.isEmpty(R0) && !tha.e(hwPoiTypeIds)) {
for (String str : hwPoiTypeIds) {
if (R0.contains(str)) {
return;
}
}
}
DetailOptions detailOptions = this.K;
if (detailOptions != null && detailOptions.isFromNearby() && !com.huawei.maps.poi.utils.c.a0(poi)) {
return;
}
}
double G = com.huawei.maps.poi.utils.c.G(site);
if (G > 50000.0d || G < 0.0d) {
return;
}
it3.x().W(this.d1);
it3.x().c(this.d1);
hm4.p("DetailFragment", "calculateRoute start:");
ArrayList arrayList = new ArrayList();
LatLng O2 = MapHelper.F2().O2();
if (O2 == null) {
return;
}
arrayList.add(new NaviLatLng(O2.latitude, O2.longitude));
ArrayList arrayList2 = new ArrayList();
Coordinate location = site.getLocation();
if (location == null) {
return;
}
arrayList2.add(new NaviLatLng(location.getLat(), location.getLng()));
VehicleType vehicleType = VehicleType.WALKING;
if (G >= 2000.0d) {
vehicleType = VehicleType.DRIVING;
}
this.l0 = true;
if (!sl4.e()) {
hm4.p("DetailFragment", "calculate detail noPermission ");
return;
}
RecordSiteInfo toPoint = NaviCurRecord.getInstance().getToPoint();
NaviCurRecord.getInstance().setToInfo(site);
boolean g2 = it3.x().g(vehicleType, arrayList, arrayList2);
NaviCurRecord.getInstance().setToInfo(toPoint);
hm4.p("DetailFragment", "start calculate :" + g2);
}
}
public final Void N5(Object obj) {
if (!(obj instanceof TravelBean)) {
return null;
}
TravelBean travelBean = (TravelBean) obj;
WebViewData webViewData = new WebViewData();
if (TextUtils.isEmpty(travelBean.getDetailUrl())) {
webViewData.setUrl("");
} else {
webViewData.setUrl(travelBean.getDetailUrl());
}
if (TextUtils.isEmpty(travelBean.getSourceName())) {
webViewData.setSourceName(h27.b(travelBean.getSource()));
webViewData.setTitle(h27.b(travelBean.getSource()));
} else {
webViewData.setSourceName(travelBean.getSourceName());
webViewData.setTitle(travelBean.getSourceName());
}
List list = (List) this.l.a().h().getValue();
if (!tha.b(list)) {
Iterator it = list.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
MatchingLanguageCpUrlInfo.CpLanguageConfig cpLanguageConfig = (MatchingLanguageCpUrlInfo.CpLanguageConfig) it.next();
if (webViewData.getUrl().contains(cpLanguageConfig.getUrlHost())) {
int indexOf = webViewData.getUrl().indexOf(cpLanguageConfig.getUrlHost()) + cpLanguageConfig.getUrlHost().length();
webViewData.setUrl(webViewData.getUrl().substring(0, indexOf) + cpLanguageConfig.getMatchLanguage() + webViewData.getUrl().substring(indexOf + cpLanguageConfig.getReplaceLength()));
break;
}
}
}
cv1.c().d(this, webViewData);
DetailReportUtil.g0(true, travelBean.getSource() != null ? travelBean.getSource().toLowerCase(Locale.ROOT) : "");
return null;
}
public final void N6() {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.scrollToPosition(0);
}
}
public final void N7() {
if (!isAdded() || this.W == null || this.G == null) {
return;
}
ve8.p().Y(this.G.D(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.viewFlipper.getHeight(), ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.getHeight() + ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtitle.getHeight() + (((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).localSiteNameTextView.getVisibility() == 0 ? ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).localSiteNameTextView.getHeight() : 0)));
j9();
}
public void N8() {
if (tha.b(this.g)) {
return;
}
Iterator<Polyline> it = this.g.iterator();
while (it.hasNext()) {
it.next().remove();
}
this.g.clear();
}
public final void N9(@NonNull final DetailOptions detailOptions) {
if (this.u0 || !detailOptions.isSearchOnly()) {
c5();
return;
}
final Function0 function0 = new Function0() {
public final Object invoke() {
mda i8;
i8 = DetailFragment.this.i8();
return i8;
}
};
this.E = true;
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).getRoot().post(new Runnable() {
@Override
public final void run() {
DetailFragment.this.j8(detailOptions, function0);
}
});
}
public void O4(LatLng latLng) {
if (MapHelper.F2().W3()) {
MapHelper.F2().v1(false);
J9(latLng);
AbstractLocationHelper.getInstance().resetLocationMarker();
}
}
public final void O5(String str) {
if (this.G == null || this.c == null || this.N == null || ((BaseFragment) this).mBinding == null) {
return;
}
if (TextUtils.isEmpty(str) || TextUtils.equals("null", str) || TextUtils.equals("\"{}\"", str)) {
this.N.d.setValue(8);
if (this.s0 >= 100 || !this.q0) {
return;
}
fk2.c(new Runnable() {
@Override
public final void run() {
DetailFragment.this.t4();
}
}, 100L);
return;
}
this.c.n.setValue(this.G.T(str));
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).nameLayout.setVisibility(4);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.setVisibility(8);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).localSiteNameTextView.setVisibility(8);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtitle.setVisibility(8);
this.N.e.setValue(0);
zu1.d(1);
this.N.d.setValue(0);
MapHelper.F2().v8((Site) this.c.n.getValue());
this.c.i.setValue(0);
this.G.y0();
if (qc6.b(this.K)) {
this.K = new DetailOptions();
}
if (this.p0) {
d9(62.0f);
}
}
public final void O6(GasStation gasStation) {
hm4.f("DetailFragment", "mGasStationObserver changed:" + gasStation);
if (gasStation == null) {
return;
}
this.U.setGasStation(gasStation);
a5(new int[]{sb2.L}, this.U, new CardUpdateCallback() {
@Override
public final void endUpdate() {
DetailFragment.this.N6();
}
});
}
public final void O8(List<CommentDataInfo> list) {
if (this.J0.isEmpty()) {
return;
}
for (CommentDataInfo commentDataInfo : list) {
for (int i2 = 0; i2 < this.J0.size(); i2++) {
if (this.J0.get(i2).getCommentID().equals(commentDataInfo.getCommentID())) {
this.J0.get(i2).setTranslateShowing(commentDataInfo.isTranslateShowing());
this.J0.get(i2).setIsTranslatedClick(commentDataInfo.isTranslatedClick());
this.J0.get(i2).setTranslatedText(commentDataInfo.getTranslatedText());
}
}
}
aa();
}
public final void O9(boolean z) {
jh8.Z(z);
}
public final void P3(MapNaviPath mapNaviPath) {
R9(mapNaviPath);
if (this.n0 == null || this.m0 == null || !n5(mapNaviPath) || !this.k0) {
if (this.k0) {
Q3(this.j0, (Site) this.c.n.getValue());
}
this.l0 = false;
} else {
if (this.l0) {
N3();
}
this.k0 = false;
l4(mapNaviPath);
}
}
public final void P4(List<Site> list) {
hm4.f("DetailFragment", "recommendSites change");
List<Site> w4 = w4(list);
if (w4 == null || w4.size() == 0) {
return;
}
this.U.setNearbyBusRecommendSites(w4);
Z4(new int[]{sb2.P}, this.U);
}
public final void P5() {
if (((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.h()) {
la();
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.i();
return;
}
this.q0 = false;
try {
NavHostFragment.findNavController(this).navigateUp();
} catch (IllegalArgumentException unused) {
hm4.h("DetailFragment", "navigation destination is unknown to this NavController");
} catch (IllegalStateException unused2) {
hm4.h("DetailFragment", "not associated with a fragment manager.");
}
MapHelper.F2().j6();
AbstractLocationHelper.getInstance().resetLocationMarker();
}
public final void P6(DealsInfo dealsInfo) {
hm4.f("DetailFragment", "mDealInfoObserver changed:" + dealsInfo);
if (dealsInfo == null) {
return;
}
this.U.setDealsInfo(dealsInfo);
Z4(new int[]{sb2.M}, this.U);
}
public final void P7(Site site, DetailUIHandler detailUIHandler) {
detailUIHandler.x0(site, (LayoutSiteDetailBinding) ((BaseFragment) this).mBinding);
}
public final void P9(JsonObject jsonObject) {
if (this.x0) {
List<CommentDataInfo> list = this.J0;
List<CommentDataInfo> b2 = t07.b(jsonObject);
this.J0 = b2;
if (b2 == null) {
return;
}
List<CommentDataInfo> k4 = k4();
this.J0 = k4;
this.i0 = tha.b(k4);
if (!tha.b(list)) {
O8(list);
}
if (tha.b(this.J0)) {
return;
}
for (int i2 = 0; i2 < this.J0.size(); i2++) {
if (tha.a(this.J0.get(i2).getTranslatedText())) {
this.J0.get(i2).setTranslateShowing(true);
this.e.h(new TranslationEvent.b(this.J0.get(i2).getComment(), this.J0.get(i2).getCommentID()));
}
}
}
}
public final void Q3(Site site, Site site2) {
l9(false);
a9(true);
MapHelper.F2().v1(false);
if (site == null || site2 == null) {
return;
}
it3.x().W(this.d1);
it3.x().c(this.d1);
jq5.t().V(gg4.c());
ArrayList arrayList = new ArrayList();
this.n0 = arrayList;
arrayList.add(new NaviLatLng(site.getLocation().getLat(), site.getLocation().getLng()));
ArrayList arrayList2 = new ArrayList();
this.m0 = arrayList2;
arrayList2.add(new NaviLatLng(site2.getLocation().getLat(), site2.getLocation().getLng()));
NaviCurRecord.getInstance().setFromNearby(true);
this.k0 = true;
if (!sl4.e()) {
hm4.p("DetailFragment", "calculate detail noPermission ");
return;
}
hm4.p("DetailFragment", "start calculate :" + it3.x().g(VehicleType.WALKING, this.n0, this.m0));
}
public final void Q4(List<Site> list) {
hm4.f("DetailFragment", "recommendSites change");
List<Site> w4 = w4(list);
if (w4 == null || w4.size() == 0) {
return;
}
this.U.setNearbySubwayRecommendSites(w4);
hm4.f("DetailFragment", "recommendSubwaySites getDynamicCardData ");
Z4(new int[]{sb2.P}, this.U);
}
public final void Q6(Industry industry) {
hm4.f("DetailFragment", "mIndustryObserver changed:" + industry);
this.U.setIndustry(industry);
}
public void Q8() {
Optional.ofNullable(this.G).ifPresent(new v12());
this.c.G.cancel();
}
public final void Q9() {
if (this.x0) {
this.x0 = false;
g5();
}
}
public final void R3() {
BottomViewModel bottomViewModel;
final Site site;
if (this.K == null || (bottomViewModel = this.N) == null || this.c == null || this.q == null) {
return;
}
bottomViewModel.o.setValue(0);
this.N.l.setValue(8);
this.N.m.setValue(8);
MapMutableLiveData<Boolean> mapMutableLiveData = this.N.v;
Boolean bool = Boolean.FALSE;
mapMutableLiveData.setValue(bool);
this.N.w.setValue(bool);
if (jh8.x()) {
if (this.K.getSite() != null) {
site = this.K.getSite();
} else if (this.K.getPointOfInterest() != null) {
site = com.huawei.maps.poi.utils.c.m(this.K.getPointOfInterest());
} else {
if (this.K.getLatLng() == null) {
return;
}
Coordinate coordinate = new Coordinate(this.K.getLatLng().latitude, this.K.getLatLng().longitude);
Site site2 = new Site();
site2.setLocation(coordinate);
site2.setPoiType(DetailOptions.LONG_CLICK);
site = site2;
}
zu1.d(2);
this.N.g.setValue(8);
this.N.n.setValue(8);
fk2.b(new Runnable() {
@Override
public final void run() {
DetailFragment.this.t5(site);
}
});
this.c.u.setValue(0);
this.N.g.setValue(0);
this.N.o.setValue(0);
this.N.f.setValue(8);
this.K.setHideStartNav(true);
String cityCode = this.c.C.getCityCode();
if (cityCode == null) {
cityCode = r4();
}
boolean j2 = tx6.g().j(cityCode);
this.N.t.setValue(Integer.valueOf(j2 ? 0 : 8));
U3(j2);
}
}
public final void R4(String str) {
DetailOptions detailOptions = this.K;
if (detailOptions == null) {
return;
}
Site site = detailOptions.getSite();
if (this.K.isLink() && this.K.isReverseGeo && site != null && site.getLocation() != null) {
DetailOptions poiType = this.K.poiType(McConstant.McPoiOperationType.NEW);
this.K = poiType;
poiType.isReverseGeo = false;
J9(com.huawei.maps.poi.utils.c.I(site.getLocation()));
DetailReportUtil.n0();
}
hm4.p("DetailFragment", "searchbyid error, code is :" + str);
if ("010004".equalsIgnoreCase(str)) {
if (!DetailOptions.POI_CLICK.equals(this.K.getDataSourceType())) {
this.K.setInvalidPoi(true);
DetailReportUtil.d0(MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
if (getSafeArguments().getBoolean("load_native_to_poi_detail")) {
DetailReportUtil.C();
s8();
} else {
w9(site);
}
}
if (!this.K.isNeedMoveCamera() || this.c.n.getValue() == null) {
return;
}
MapHelper.F2().v8((Site) this.c.n.getValue());
}
}
public final void R5(int i2, Exception exc) {
if (isAdded()) {
startActivityForResult(e4.a().getAccountIntent(), i2);
}
}
public final void R6(BusSubway busSubway) {
hm4.f("DetailFragment", "mBusSubwayObserver changed:" + busSubway);
if (busSubway != null) {
busSubway.setBusTransportLines(c4(busSubway.getBusTransportLines()));
this.U.setBusSubway(busSubway);
}
}
public final void R7(Site site, DetailUIHandler detailUIHandler) {
detailUIHandler.x0(site, (LayoutSiteDetailBinding) ((BaseFragment) this).mBinding);
}
public final void R8(boolean z) {
hm4.p("DetailFragment", "resetPage");
DetailOptions detailOptions = (DetailOptions) this.O.detailOptionsData.getValue();
this.O.detailOptionsData.setValue((Object) null);
ca(detailOptions);
this.O.detailOptionsData.observe(this, this.h1);
if (z) {
resetTempPageStatus();
} else if (this.h0 == 20001) {
S8();
} else {
resetPageStatus();
}
if (qc6.c(((BaseFragment) this).mPageScrollStatus) && qc6.c(this.c)) {
this.c.i.setValue(Integer.valueOf(((BaseFragment) this).mPageScrollStatus.isEnabled() ? 0 : 8));
}
final Site site = (Site) this.c.n.getValue();
Boolean bool = (Boolean) this.c.E.getValue();
if (bool != null && bool.booleanValue()) {
hm4.p("DetailFragment", "resetMapStatus: showDetailPoi");
if (site == null || !site.isAoiFlag()) {
if (site != null) {
site.setMyLocation(o41.f(R$string.mylocation).equals(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.getText().toString()));
}
MapHelper.F2().m8(site);
} else {
Y3(site);
if (pa9.e(site.getPoi()) && !this.K.isLongClick()) {
MapHelper.F2().Y(site);
}
Z3();
}
q8(site);
}
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).n0(site);
}
});
this.L.X((Site) this.c.n.getValue());
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.P7(site, (DetailUIHandler) obj);
}
});
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.Q7(site, (LayoutSiteDetailBinding) obj);
}
});
if (z) {
AbstractMapUIController.getInstance().setDynamicCardCallBack((DynamicCardCallBack) null);
b9();
AbstractMapUIController.getInstance().setIsShowOfflineTips(tg6.b().a().isExecuteOfflineLogic());
}
}
public final void R9(MapNaviPath mapNaviPath) {
if (mapNaviPath == null) {
return;
}
RouteCardInfo routeCardInfo = new RouteCardInfo();
routeCardInfo.setAllLength(mapNaviPath.getAllLength());
routeCardInfo.setAllTime(mapNaviPath.getAllTime());
if (this.l0) {
this.U.setRouteCardInfo(routeCardInfo);
} else {
this.U.setRouteCardInfo(null);
}
Z4(new int[]{sb2.a}, this.U);
}
public void S4(PointOfInterest pointOfInterest) {
if (MapHelper.F2().W3()) {
MapHelper.F2().F1();
d4(false);
MapHelper.F2().v1(false);
Site m2 = com.huawei.maps.poi.utils.c.m(pointOfInterest);
MapHelper.F2().H3(m2);
e5();
K9(m2);
DetailReportUtil.M(pointOfInterest);
AbstractMapUIController.getInstance().setIsCheckPoiOffline(false);
}
}
public final void S5(DetailUIHandler detailUIHandler) {
detailUIHandler.G0((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding);
}
public final void S6(List list) {
hm4.f("DetailFragment", "mMenuObserver changed:" + list);
if (list == null) {
return;
}
this.U.setMenu(list);
Z4(new int[]{sb2.Q}, this.U);
}
public final void S7() {
G4(false);
}
public final void S8() {
ve8.p().j0(((BaseFragment) this).mPageScrollStatus, true);
if (MapScrollLayout.Status.EXPANDED == ((BaseFragment) this).mPageScrollStatus.getPageStatus()) {
AbstractMapUIController.getInstance().handleOpacityCoatingViewEnable(!ct3.W(o41.c()));
}
}
public final void S9(@NonNull SatelliteCardData satelliteCardData) {
satelliteCardData.setMyLocation(this.K.isLocationMarkerClick());
this.U.setSatelliteCardData(satelliteCardData);
Z4(new int[]{sb2.a}, this.U);
}
public final void T3() {
BottomViewModel bottomViewModel;
Site site;
if (this.K == null || (bottomViewModel = this.N) == null || this.c == null || this.q == null) {
return;
}
bottomViewModel.o.setValue(0);
if (jh8.v()) {
if (this.K.getSite() != null) {
site = this.K.getSite();
} else if (this.K.getPointOfInterest() != null) {
site = com.huawei.maps.poi.utils.c.m(this.K.getPointOfInterest());
} else if (this.K.getLatLng() == null) {
return;
} else {
site = this.K.getSite();
}
zu1.d(2);
this.N.g.setValue(8);
this.N.n.setValue(8);
com.huawei.maps.app.common.utils.task.a.b(TaskExecutor.COLLECT).d(com.huawei.maps.app.common.utils.task.a.a("DetailFragment", "changeCollectButtonStyle", new n(site, mv0.a())));
this.c.u.setValue(0);
this.N.g.setValue(0);
this.N.o.setValue(0);
this.N.f.setValue(8);
this.K.setHideStartNav(true);
String cityCode = this.c.C.getCityCode();
if (cityCode == null) {
cityCode = r4();
}
boolean j2 = tx6.g().j(cityCode);
this.N.t.setValue(Integer.valueOf(j2 ? 0 : 8));
U3(j2);
}
}
public final void T4(Site site, int i2) {
if (!DetailOptions.DEFAULT_CLICK.equals(this.K.getDataSourceType()) && !this.K.isShowCenter()) {
MapHelper.F2().h5(true);
MapHelper.F2().q5(site, i2);
}
CustomPopWindow customPopWindow = this.v;
if (customPopWindow != null) {
customPopWindow.o();
}
f5();
}
public final void T5(DetailUIHandler detailUIHandler) {
detailUIHandler.F0((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding);
}
public final void T6(ParkingLotBean parkingLotBean) {
hm4.f("DetailFragment", "mParkingLotObserver changed:" + parkingLotBean);
if (parkingLotBean == null) {
return;
}
this.U.setParkInfo(parkingLotBean);
Z4(new int[]{sb2.T}, this.U);
}
public final void T7(Site site) {
if (site != null) {
AddressDetail address = site.getAddress();
String e2 = xe1.e();
String str = "";
if (address != null) {
String countryCode = address.getCountryCode();
if (!tha.a(countryCode)) {
str = countryCode;
}
}
if (!k.n4() || str.equalsIgnoreCase(e2)) {
return;
}
AbstractMapUIController.getInstance().showAddressAskingFragment(getActivity(), site);
}
}
public final synchronized void T8() {
n36.a().c(false);
DynamicCardNearbySubwayBusRecommendationsCardHolder.setFromSecondaryPage(false);
}
public final void T9() {
if (qc6.c(this.l)) {
final BottomMenu bottomMenu = (BottomMenu) this.l.a.f().getValue();
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.k8(bottomMenu, (DetailUIHandler) obj);
}
});
List list = (List) this.l.a.o().getValue();
if (tha.b(list) || !qc6.c(this.c)) {
return;
}
this.c.h.setValue(list);
}
}
public final void U3(boolean z) {
if (this.N == null) {
hm4.p("DetailFragment", "moreBtn bottomVm is null!");
return;
}
if (yl3.e()) {
this.N.w.setValue(Boolean.FALSE);
}
boolean booleanValue = this.N.v.getValue() != null ? ((Boolean) this.N.v.getValue()).booleanValue() : false;
boolean booleanValue2 = this.N.w.getValue() != null ? ((Boolean) this.N.w.getValue()).booleanValue() : false;
int i2 = (this.N.f.getValue() == null || !((Integer) this.N.f.getValue()).equals(0)) ? 0 : 1;
if (this.N.n.getValue() != null && ((Integer) this.N.n.getValue()).equals(0)) {
i2++;
}
if (this.N.p.getValue() != null && ((Integer) this.N.p.getValue()).equals(0)) {
i2++;
}
if (this.N.q.getValue() != null && ((Integer) this.N.q.getValue()).equals(0)) {
i2++;
}
if (z) {
i2++;
}
if (booleanValue) {
i2++;
}
if (booleanValue2) {
i2++;
}
hm4.p("DetailFragment", "count = " + i2 + ",isSearchImgShow = " + booleanValue2 + ",isShareImgShow = " + booleanValue);
if (((i2 > 4) && booleanValue) && booleanValue2) {
this.N.l.setValue(8);
this.N.m.setValue(8);
this.N.u.setValue(0);
} else {
this.N.u.setValue(8);
if (booleanValue2) {
this.N.m.setValue(0);
}
if (booleanValue) {
this.N.l.setValue(0);
}
}
}
public final void U4(JsonObject jsonObject) {
if (jsonObject == null && isResumed()) {
return;
}
hm4.f("DetailFragment", " handleRecommendationsData begin");
DynamicPoiDetailBean dynamicPoiDetailBean = new DynamicPoiDetailBean();
dynamicPoiDetailBean.setSiteJson(jsonObject);
hm4.f("DetailFragment", " getDynamicCardData nearby recommendations");
Z4(new int[]{sb2.O}, dynamicPoiDetailBean);
}
public final void U5(DetailUIHandler detailUIHandler) {
detailUIHandler.H0((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding);
}
public final void U6(CarChargeInfo carChargeInfo, LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.c.r.setValue(carChargeInfo);
}
public final void U7(String str, Object obj) {
char c2;
Site site;
this.d2 = false;
str.hashCode();
switch (str.hashCode()) {
case -1697299732:
if (str.equals("click_top_city")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case -1618753757:
if (str.equals("clickCityAirTicket")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case -1372868194:
if (str.equals("clickRealtimeTranslation")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case -1359334009:
if (str.equals("gotoFragmentHotelIntroduceSecondaryDetail")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -1109845566:
if (str.equals("explore_nearby_poi_card_click")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case -892306611:
if (str.equals("click_safe_journey_card_item_to_second_page")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case -868752049:
if (str.equals("PoiCreateCommentClick")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case -663454056:
if (str.equals("requestDatePickerWithPrice")) {
c2 = 7;
break;
}
c2 = 65535;
break;
case -573735822:
if (str.equals("clickOfflineMaps")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
case 395123926:
if (str.equals("click_detail_meetkai_banner")) {
c2 = '\t';
break;
}
c2 = 65535;
break;
case 415471156:
if (str.equals("SatelliteOverviewClick")) {
c2 = '\n';
break;
}
c2 = 65535;
break;
case 464165518:
if (str.equals("clickSimultaneousTranslation")) {
c2 = 11;
break;
}
c2 = 65535;
break;
case 535462326:
if (str.equals("openDetailFragmentWithNewSite")) {
c2 = '\f';
break;
}
c2 = 65535;
break;
case 559480406:
if (str.equals("clickRealtimeExchange")) {
c2 = '\r';
break;
}
c2 = 65535;
break;
case 838486636:
if (str.equals("PoiCreateCommentWithImageClick")) {
c2 = 14;
break;
}
c2 = 65535;
break;
case 1189227021:
if (str.equals("RECOMMENDATION_POI_CLICK")) {
c2 = 15;
break;
}
c2 = 65535;
break;
case 1255433772:
if (str.equals("clickCommonPhrase")) {
c2 = 16;
break;
}
c2 = 65535;
break;
case 1294405244:
if (str.equals("clickAddressCard")) {
c2 = 17;
break;
}
c2 = 65535;
break;
case 1340966311:
if (str.equals("click_safe_journey_card_item_to_search_result")) {
c2 = 18;
break;
}
c2 = 65535;
break;
case 1364281591:
if (str.equals("PoiCreateCommentWithStarClick")) {
c2 = 19;
break;
}
c2 = 65535;
break;
case 1537350656:
if (str.equals("detailFragmentResetMapStatus")) {
c2 = 20;
break;
}
c2 = 65535;
break;
case 1745662933:
if (str.equals("PoiParentChildClickMore")) {
c2 = 21;
break;
}
c2 = 65535;
break;
case 1899353930:
if (str.equals("BGCBtnClick")) {
c2 = 22;
break;
}
c2 = 65535;
break;
case 2117016477:
if (str.equals("UGCBtnClick")) {
c2 = 23;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
if (obj instanceof TopCitiesItem) {
this.d0.push(this.K);
TopCitiesItem topCitiesItem = (TopCitiesItem) obj;
Long siteId = topCitiesItem.getSiteId();
String name = topCitiesItem.getName();
Integer ranking = topCitiesItem.getRanking();
if (siteId != null && ranking != null) {
DetailReportUtil.q0(ranking.intValue());
String l2 = siteId.toString();
if (!tha.a(l2) && !tha.a(name)) {
da(d32.s(com.huawei.maps.poi.utils.c.s(l2, name)));
e9(this.d0.size() == 0);
break;
}
}
}
break;
case 1:
SafeJourneyUrlInfo safeJourneyUrlInfo = (SafeJourneyUrlInfo) this.l.a().B().getValue();
if (safeJourneyUrlInfo != null) {
String airTicketUrl = safeJourneyUrlInfo.getAirTicketUrl();
if (!kj2.h(o41.c())) {
airTicketUrl = safeJourneyUrlInfo.getAirTicketUrlForOtherDevice();
}
if (!TextUtils.isEmpty(airTicketUrl)) {
SafeIntent safeIntent = new SafeIntent(new Intent("android.intent.action.VIEW", Uri.parse(airTicketUrl)));
if (!airTicketUrl.startsWith("petalmaps") && !airTicketUrl.startsWith("hwcloudtest")) {
cz9.o(R.string.third_jump_tip);
}
IntentUtils.safeStartActivity(getContext(), safeIntent);
vz6.F(String.valueOf(7));
break;
}
}
break;
case 2:
r26.a.a(this, R$id.detail_to_realtimeTranslationFragment, (Bundle) null);
t8();
break;
case 3:
if (obj != null && (obj instanceof Boolean) && ((Boolean) obj).booleanValue()) {
DetailReportUtil.l0(this.d0.size() == 0, "intro", s4());
break;
}
break;
case 4:
if (obj instanceof Bundle) {
x22.INSTANCE.c((Bundle) obj, (VMInPoiModule) getActivityViewModel(VMInPoiModule.class), this.d0, this.K);
break;
}
break;
case 5:
if (this.c.n.getValue() != null && (obj instanceof Integer)) {
cv1.c().i((Site) this.c.n.getValue(), (SafeJourneyUrlInfo) this.l.a().B().getValue(), ((Integer) obj).intValue(), ((BaseFragment) this).isDark, this);
t8();
break;
}
break;
case 6:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
t8();
G4(true);
break;
case 7:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null && (site = (Site) detailViewModel.n.getValue()) != null) {
Z4(new int[]{sb2.x}, this.U);
this.c.B.queryHotelPriceAndCPInfo(site, true);
break;
}
break;
case '\b':
if (k.i3()) {
r26.a.a(this, R$id.detail_to_offlineMapFragment, (Bundle) null);
t8();
break;
}
break;
case '\t':
if (obj instanceof Bundle) {
ux4.c(this, R$id.realtimeExchangeFragment, (Bundle) obj);
t8();
break;
}
break;
case '\n':
t8();
break;
case 11:
if (!e4.a().isChildren()) {
r26.a.a(this, R$id.detail_to_simultaneous_translation, (Bundle) null);
t8();
break;
} else {
b4();
break;
}
case '\f':
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (obj instanceof Site) {
F8(obj);
break;
}
break;
case '\r':
if (!this.b1.isEmpty()) {
String str2 = (String) this.c.B.getExchangeRatePathStr().getValue();
if (!TextUtils.isEmpty(str2)) {
String str3 = str2.trim() + "?monetaryUnit=" + this.b1;
Bundle bundle = new Bundle();
bundle.putString("url_path_operation", str3);
bundle.putBoolean("isShowExchangeRate", true);
bundle.putBoolean("isUseFeedItemJavaScriptObj", true);
bundle.putBoolean("isSupportFullScreen", true);
bundle.putBoolean("isNeedSaveOverlay", true);
ux4.c(this, R$id.fragment_operation, bundle);
t8();
break;
} else {
cz9.p(o41.c().getString(R$string.no_click_url));
break;
}
}
break;
case 14:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
t8();
this.a1 = false;
PermissionsUtil.u(this, new PermissionsUtil.RequestCallback() {
public final void success() {
DetailFragment.this.S7();
}
});
break;
case 15:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (!tg6.b().a().isExecuteOfflineLogic()) {
if (obj instanceof Site) {
Site site2 = (Site) obj;
this.d0.push(this.K);
da(d32.s(site2));
f17.a();
MapHelper.F2().v8(site2);
e9(this.d0.size() == 0);
break;
}
} else {
cz9.k(o41.f(R$string.offline_unavailable_str));
break;
}
break;
case 16:
r26.a.a(this, R$id.detail_to_common_phrase, (Bundle) null);
t8();
break;
case 17:
Optional.ofNullable((Site) this.c.n.getValue()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj2) {
DetailFragment.this.T7((Site) obj2);
}
});
break;
case 18:
if (obj instanceof String) {
cv1.c().j(this, (String) obj);
t8();
break;
}
break;
case 19:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
t8();
if (obj != null) {
H4(((Float) obj).floatValue());
break;
}
break;
case 20:
t8();
break;
case 21:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (obj instanceof ChildrenNode) {
if (this.U.getSite() != null && this.U.getSite().getPoi() != null && this.U.getSite().getPoi().getChildrenNodes() != null) {
List childrenNodes = this.U.getSite().getPoi().getChildrenNodes();
int i2 = 0;
while (true) {
if (i2 >= childrenNodes.size()) {
i2 = 0;
} else if (!TextUtils.equals(((ChildrenNode) childrenNodes.get(i2)).getSiteId(), ((ChildrenNode) obj).getSiteId())) {
i2++;
}
}
DetailReportUtil.a0(this.U.getSite(), String.valueOf(i2 + 1));
}
N8();
Site p2 = com.huawei.maps.poi.utils.c.p((ChildrenNode) obj);
this.d0.push(this.K);
da(d32.b(p2));
e9(this.d0.size() == 0);
break;
}
break;
case 22:
DetailReportUtil.l0(this.d0.size() == 0, "other", s4());
if (!e4.a().hasLogin()) {
F4(10004);
break;
} else {
DynamicPoiDetailBean dynamicPoiDetailBean = this.U;
if (dynamicPoiDetailBean != null) {
DetailReportUtil.P(dynamicPoiDetailBean.getSite());
DetailReportUtil.T(this.U.getSite(), "7", MapSubmitSuccessDialogType.IS_FROM_POI_UGC);
}
new a07(this, (Site) this.c.n.getValue()).s();
break;
}
case 23:
DetailReportUtil.l0(this.d0.size() == 0, "ugc", s4());
y8a.u(MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE);
if (tg6.b().c().getOfflineMapsConfigs().getNetworkType() != -1) {
if (!e4.a().hasLogin()) {
F4(10001);
break;
} else {
t8();
A9();
DetailReportUtil.T(this.K.getSite(), "6", MapSubmitSuccessDialogType.IS_FROM_POI_UGC);
break;
}
} else if (!tg6.b().c().isOffLineSwitchOn()) {
cz9.k(o41.f(R$string.no_network));
break;
} else {
cz9.p(getString(R$string.offline_unavailable_str));
break;
}
default:
H8(str, obj);
break;
}
}
public void U8() {
this.c1 = false;
this.z0 = false;
this.K0.D();
this.L0 = null;
this.P0 = null;
this.N0 = null;
this.M0 = null;
this.O0 = null;
this.c.b0.setValue(8);
this.c.c0.setValue((Object) null);
MapMutableLiveData<Boolean> mapMutableLiveData = this.c.d0;
Boolean bool = Boolean.FALSE;
mapMutableLiveData.setValue(bool);
this.c.e0.setValue(bool);
this.c.f0.setValue(bool);
this.c.g0.setValue(bool);
this.c.h0.setValue(Integer.MAX_VALUE);
this.c.i0.setValue(Integer.MAX_VALUE);
this.c.j0.setValue(Integer.MAX_VALUE);
this.c.l0.setValue(Integer.MAX_VALUE);
this.c.k0.setValue(Integer.MAX_VALUE);
this.c.m0.setValue(Integer.MAX_VALUE);
this.c.Z.setValue("overview");
}
public final void V4(int i2) {
this.C0 = i2;
}
public final void V5(DetailUIHandler detailUIHandler) {
detailUIHandler.E0((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding);
}
public final void V6(ChargingStationAmenities chargingStationAmenities) {
this.U.setNearbyServiceList(ch8.b(chargingStationAmenities));
}
public final void V7(Site site, DetailUIHandler detailUIHandler) {
detailUIHandler.q0(site, this.w);
}
public final void V8(r3a r3aVar) {
for (CommentDataInfo commentDataInfo : this.J0) {
if (commentDataInfo.getCommentID().equals(r3aVar.c())) {
List<CommentDataInfo> list = this.J0;
list.get(list.indexOf(commentDataInfo)).setTranslateShowing(false);
List<CommentDataInfo> list2 = this.J0;
list2.get(list2.indexOf(commentDataInfo)).setIsTranslatedClick(false);
List<CommentDataInfo> list3 = this.J0;
list3.get(list3.indexOf(commentDataInfo)).setTranslatedText(r3aVar.g());
}
}
aa();
}
public final void V9(CollectInfo collectInfo) {
this.Q = collectInfo;
}
public final void W3(List<th1> list) {
try {
if (this.D) {
return;
}
boolean z = false;
for (int i2 = 0; i2 < list.size(); i2++) {
if (list.get(i2).a().getCommentID().equals(this.D0)) {
z = true;
}
}
if (TextUtils.isEmpty(this.D0)) {
return;
}
ve8.p().O(e40.B0);
m9(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv, this.K.isScrollNeededToCardShelf());
if (!z) {
cz9.j(R$string.title_comment_deleted);
this.D = true;
} else {
HighlightCommentBean highlightCommentBean = this.H0;
if (highlightCommentBean != null) {
highlightCommentBean.getListener().onHighlight(this.D0);
}
}
} catch (Exception e2) {
hm4.p("DetailFragment", "" + e2.getMessage());
}
}
public final void W4(JsonObject jsonObject) {
hm4.f("DetailFragment", " handleSiteJsonBack jsonObject");
this.U.setSiteJson(jsonObject);
}
public final void W6() {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.scrollToPosition(0);
}
}
public void W8() {
TabLayout tabLayout;
MapRecyclerView mapRecyclerView = ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv;
if (mapRecyclerView == null || mapRecyclerView.getAdapter() == null || this.c == null) {
hm4.p("DetailFragment", "saveCardPosition recyclerView is null");
return;
}
int itemCount = mapRecyclerView.getAdapter().getItemCount();
hm4.p("DetailFragment", "recyclerView item's count:" + itemCount);
if (itemCount <= 0) {
return;
}
for (int i2 = 0; i2 < itemCount; i2++) {
int itemViewType = mapRecyclerView.getAdapter().getItemViewType(i2);
if (itemViewType == sb2.F) {
hm4.p("DetailFragment", "review_edit_card position:" + i2);
this.c.h0.setValue(Integer.valueOf(i2));
this.c.d0.setValue(Boolean.TRUE);
} else if (itemViewType == sb2.G) {
hm4.p("DetailFragment", "review_content_card position =" + i2);
this.c.i0.setValue(Integer.valueOf(i2));
this.c.d0.setValue(Boolean.TRUE);
} else if (itemViewType == sb2.Y) {
hm4.p("DetailFragment", "safeJourney_card position =" + i2);
this.c.j0.setValue(Integer.valueOf(i2));
this.c.e0.setValue(Boolean.TRUE);
} else if (itemViewType == sb2.p) {
hm4.p("DetailFragment", "top_ranking_card position =" + i2);
this.c.k0.setValue(Integer.valueOf(i2));
this.c.f0.setValue(Boolean.TRUE);
} else if (itemViewType == sb2.r) {
hm4.p("DetailFragment", "guide_card position =" + i2);
this.c.l0.setValue(Integer.valueOf(i2));
this.c.f0.setValue(Boolean.TRUE);
} else if (itemViewType == sb2.Z) {
hm4.p("DetailFragment", "nearby_card position =" + i2);
this.c.m0.setValue(Integer.valueOf(i2));
this.c.g0.setValue(Boolean.TRUE);
}
}
if (this.z0 || (tabLayout = this.K0) == null || tabLayout.getTabCount() <= 2) {
return;
}
this.z0 = true;
p9((Site) this.c.n.getValue());
}
public final void W9(JsonObject jsonObject) {
MapMutableLiveData<Site> mapMutableLiveData;
this.U.setCommentJson(jsonObject);
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null && (mapMutableLiveData = detailViewModel.n) != null) {
this.V.setCommentCommitEnable(x07.d((Site) mapMutableLiveData.getValue()) && !this.c0);
this.V.setCommentQueryEnable(x07.g((Site) this.c.n.getValue(), this.i0));
}
DetailOptions detailOptions = this.K;
if (detailOptions != null) {
this.V.setModifyPoi(McConstant.McPoiOperationType.MODIFY == detailOptions.getPoiType());
}
hm4.f("DetailFragment", "getDynamicCardData updateCommentCardItem ");
int[] iArr = {sb2.G, sb2.F};
this.U.setLocalDataBean(this.V);
Z4(iArr, this.U);
}
public void X3(Site site) {
if (site == null || site.getPoi() == null || this.K.isFromNavComplete()) {
hm4.p("DetailFragment", "polygon is null");
return;
}
boolean z = (this.K.isLongClick() || this.K.isLocationMarkerClick()) ? false : true;
if (pa9.e(site.getPoi()) && !TextUtils.equals("[Marked Location]", site.getName()) && z && TextUtils.isEmpty(this.K.getGooglUrl())) {
MapHelper.F2().Y(site);
}
if (site.getPolygon() == null) {
return;
}
List<Polygon> list = this.h;
if (list != null && !list.isEmpty()) {
M8();
}
this.h = e32.a(site);
if (tha.b(site.getPoi().getChildrenNodes())) {
return;
}
MapHelper.F2().j8(site.getPoi().getChildrenNodes());
if (!this.K.isChildNode()) {
this.d0.push(this.K);
}
DetailReportUtil.m();
this.v0 = true;
e9(this.d0.size() == 0);
}
public final void X4(CountryGuideData countryGuideData, String str, boolean z, String str2) {
if (z) {
List<TopCitiesItem> b2 = ye1.b(countryGuideData, str, str2);
if (tha.b(b2)) {
this.V.setTopCitiesShow(false);
} else {
this.U.setTopCitiesItemList(b2);
this.V.setTopCitiesShow(!tha.b(b2));
}
} else {
this.V.setTopCitiesShow(false);
}
Z4(new int[]{sb2.U}, this.U);
}
public final void X5(DetailUIHandler detailUIHandler) {
T4((Site) this.c.n.getValue(), detailUIHandler.A());
}
public final void X6(SearchNearbyResponse searchNearbyResponse) {
if (o5() || searchNearbyResponse == null) {
return;
}
P4(searchNearbyResponse.getSites());
DynamicCardNearbySubwayBusRecommendationsCardHolder.setFromSecondaryPage(false);
}
public final void X7(Boolean bool) {
if (bool.booleanValue() || o72.c(R$id.iv_collect) || !this.I0) {
return;
}
this.I0 = false;
if (e4.a().hasLogin()) {
collectByLogin();
} else {
collectByNoLogin(null);
}
}
public void X8(final Site site) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.R7(site, (DetailUIHandler) obj);
}
});
if (site == null || this.K == null) {
return;
}
boolean z = (RouteDataManager.b().s() || RouteDataManager.b().r()) ? false : true;
boolean z2 = (RouteDataManager.b().q() || RouteDataManager.b().p()) ? false : true;
if (this.K.isShowReport() && this.V.isReportIssue() && z2 && z) {
this.N.p.setValue(0);
}
if (this.K.isShowCall() && qc6.c(site.getPoi()) && !TextUtils.isEmpty(site.getPoi().getPhone())) {
this.N.q.setValue(0);
}
}
public final void l6(Object obj) {
if (1 == this.C0) {
this.W.m(R$layout.dynamic_card_legacy_review_layout, obj);
} else {
this.W.m(R$layout.dynamic_card_poi_comment_layout, obj);
}
}
public void Y3(Site site) {
if (site.getPolyline() == null) {
return;
}
List<Polyline> list = this.g;
if (list != null && !list.isEmpty()) {
N8();
}
this.g = e32.c(site);
}
public final void Y4() {
AddressDetail address;
Map map;
Site site = (Site) this.c.n.getValue();
String upperCase = ServicePermissionManager.INSTANCE.getServiceCountry().toUpperCase(Locale.ENGLISH);
boolean z = false;
if (TextUtils.equals(upperCase, "CN") && ((pa9.g(site) || pa9.k(site) || pa9.o(site)) && (map = (Map) this.l.a().z().getValue()) != null && site != null && map.containsKey(site.getSiteId()))) {
SafeJourneyConfig safeJourneyConfig = (SafeJourneyConfig) map.get(site.getSiteId());
safeJourneyConfig.setSiteType(pa9.g(site) ? "country" : "city");
this.U.setSafeJourneyConfig(safeJourneyConfig);
this.V.setShowAssistant(false);
Z4(new int[]{sb2.Y, sb2.S}, this.U);
return;
}
String e2 = xe1.e();
this.V.setShowSimultaneousTranslation(k.s2() && (e4.a().hasLogin() && !e4.a().isChildren() && !k0a.k().m()));
this.V.setShowTranslation(k.y3());
this.V.setShowCommonSpoken(k.j2());
this.V.setShowRealtimeExchange(TextUtils.equals(upperCase, "CN"));
this.V.setTwoWord(false);
if (this.U.getSite() == null || (address = this.U.getSite().getAddress()) == null || tha.a(address.getCountryCode())) {
return;
}
String countryCode = address.getCountryCode();
this.V.setShowOfflineMaps(k.j3(countryCode));
DynamicPoiDetailLocalDataBean dynamicPoiDetailLocalDataBean = this.V;
if (k.n4() && !e2.equalsIgnoreCase(countryCode)) {
z = true;
}
dynamicPoiDetailLocalDataBean.setShowAssistant(z);
}
public final void Y5(PoiOpenStateInfo poiOpenStateInfo) {
this.c.q0.setValue(poiOpenStateInfo);
hm4.f("DetailFragment", "poiOpenStateInfo change");
if (poiOpenStateInfo == null) {
return;
}
this.U.setPoiOpenStateInfo(poiOpenStateInfo);
hm4.f("DetailFragment", "poiOpenStateInfo getDynamicCardData ");
Z4(new int[]{sb2.a}, this.U);
}
public final void Y6(final CarChargeInfo carChargeInfo) {
hm4.f("DetailFragment", "mCarChargeInfoObserver changed:" + carChargeInfo);
if (carChargeInfo == null) {
return;
}
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.U6(carChargeInfo, (LayoutSiteDetailBinding) obj);
}
});
this.U.setCarChargeInfo(carChargeInfo);
Optional.ofNullable(carChargeInfo).map(new zn0()).map(new Function() {
@Override
public final Object apply(Object obj) {
return ((CarChargeInfo.RecommendInfo) obj).getAmenities();
}
}).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.V6((ChargingStationAmenities) obj);
}
});
a5(new int[]{sb2.W, sb2.X, sb2.a}, this.U, new CardUpdateCallback() {
@Override
public final void endUpdate() {
DetailFragment.this.W6();
}
});
}
public final void Y8() {
ApiCommentViewModel apiCommentViewModel = this.m;
if (apiCommentViewModel != null) {
apiCommentViewModel.h().observe(this, this.l1);
}
CommentRepliesSharedViewModel commentRepliesSharedViewModel = this.S;
if (commentRepliesSharedViewModel != null) {
commentRepliesSharedViewModel.y().observe(this, this.n1);
}
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null) {
detailViewModel.r0.observe(getViewLifecycleOwner(), this.o1);
}
CommentViewModel commentViewModel = this.X0;
if (commentViewModel != null) {
commentViewModel.a().observe(this, this.f1);
}
}
public final void Y9(CommentDataInfo commentDataInfo) {
x07.l(this.J0, commentDataInfo);
this.c.B.updateCommentLikeInList(commentDataInfo);
}
public final void Z3() {
Site site = (Site) this.c.n.getValue();
if (site == null || !site.isAoiFlag()) {
return;
}
if (pa9.c(site.getPoi())) {
a4();
} else if (site.isAoiFlag()) {
a9(true);
}
}
public final void Z4(int[] iArr, Object obj) {
a5(iArr, obj, null);
}
public final void Z5(Boolean bool) {
hm4.p("DetailFragment", "isCheckPoiSuccess change");
boolean b2 = dv9.b();
boolean d2 = dv9.d();
this.U.setShowPoweredByCard(bool.booleanValue() && b2);
this.U.setShowViewMoreCard(d2);
if (tg6.b().c().isDownloadBasicData().equals(MapSubmitSuccessDialogType.IS_FROM_POI_UGC)) {
if (tg6.b().c().isOffLineSwitchOn()) {
if (tg6.b().c().getOfflineMapsConfigs().getNetworkType() == -1 || tg6.b().c().getOfflineMapsConfigs().getNetworkType() == 6) {
this.U.setShowViewMoreCard(false);
}
} else if (tg6.b().c().getOfflineMapsConfigs().getNetworkType() == -1) {
this.U.setShowViewMoreCard(false);
}
}
this.U.setSearchConfigJson((JsonObject) this.l.a.D().getValue());
Z4(new int[]{sb2.J}, this.U);
}
public final void Z6(String str) {
hm4.f("DetailFragment", "mMeetkaiPlaceBannerObserver changed:" + str);
s9(str);
}
public final void Z7(Site site, Site site2) {
if (this.K.isFromDeleteStop()) {
site.setPoiType("click");
} else {
site.setPoiType(DetailOptions.LONG_CLICK);
}
}
public final void Z8() {
if (this.o0) {
setArguments((Bundle) null);
this.i = false;
this.c.s.setValue(0);
MapMutableLiveData<Boolean> mapMutableLiveData = this.c.P;
Boolean bool = Boolean.FALSE;
mapMutableLiveData.setValue(bool);
this.c.O.setValue(bool);
M3(false);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).nameLayout.setVisibility(0);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.setVisibility(0);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtitle.setVisibility(0);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).viewClose.setVisibility(0);
this.o0 = false;
r9(false);
}
}
public final void a4() {
Site site;
Poi poi;
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null || (site = (Site) detailViewModel.n.getValue()) == null || site.getPoi() == null || (poi = site.getPoi()) == null || this.T == 0.0f || !pa9.c(poi)) {
return;
}
CameraPosition n2 = MapHelper.F2().n2();
if (qc6.c(n2)) {
a9(Math.abs(this.T - n2.zoom) <= 1.0f);
}
}
public final void a5(final int[] iArr, Object obj, final CardUpdateCallback cardUpdateCallback) {
xb2.b().a(u4(), obj, new DynamicCardDataCallBack() {
public final void onCallBack(List list) {
DetailFragment.this.a6(iArr, cardUpdateCallback, list);
}
});
}
public final void a6(int[] iArr, CardUpdateCallback cardUpdateCallback, List list) {
DynamicCardAdapter dynamicCardAdapter = this.W;
if (dynamicCardAdapter != null) {
dynamicCardAdapter.n(iArr, list);
if (cardUpdateCallback != null) {
cardUpdateCallback.endUpdate();
}
if (this.c == null || !k.Z()) {
return;
}
this.c.a0.setValue(Boolean.TRUE);
}
}
public final void a7(PoiPictureListResponse poiPictureListResponse) {
hm4.f("DetailFragment", "mPoiPictureQueryObserver changed:" + poiPictureListResponse);
Site site = (Site) this.c.n.getValue();
if (site == null || site.getPoi() == null || poiPictureListResponse == null || poiPictureListResponse.getData() == null) {
return;
}
List<Data> data = poiPictureListResponse.getData().getData();
if (tha.b(data)) {
return;
}
ArrayList arrayList = new ArrayList();
for (Data data2 : data) {
if (data2.getOriginalImageFile() != null && !tha.a(data2.getOriginalImageFile().getPreviewURL())) {
PoiPictureBean poiPictureBean = new PoiPictureBean();
poiPictureBean.setPictureUrl(data2.getOriginalImageFile().getPreviewURL());
arrayList.add(poiPictureBean);
}
}
this.c.p0.setValue(arrayList);
if (tha.b(site.getPoi().getPictures())) {
site.getPoi().setPictures(arrayList);
} else {
site.getPoi().getPictures().addAll(arrayList);
}
this.c.B.getPoiPictureList().setValue((Object) null);
this.U.setSite(site);
ia(site);
Z4(new int[]{sb2.K}, this.U);
if (((BaseFragment) this).mBinding != null) {
a32.h().q(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).topImageLayout, site);
}
}
public void a9(boolean z) {
if (tha.b(this.h)) {
return;
}
Iterator<Polygon> it = this.h.iterator();
while (it.hasNext()) {
it.next().setVisible(z);
}
MapHelper.F2().A6(z);
}
public final void aa() {
PoiCommentResponse a2;
JsonObject jsonObject = this.a0;
if (jsonObject == null || (a2 = t07.a(jsonObject)) == null || a2.getData() == null || a2.getData().getLatestCommentInfos() == null) {
return;
}
a2.getData().getLatestCommentInfos().setData(this.J0);
try {
Gson create = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
JsonObject jsonObject2 = (JsonObject) create.fromJson(create.toJson(a2), JsonObject.class);
if (jsonObject2 != null) {
p5(jsonObject2);
W9(jsonObject2);
}
} catch (Exception e2) {
hm4.f("DetailFragment", "updateCommentTranslate jsonException:" + e2.getMessage());
}
}
public void b5(Marker marker) {
if (!MapHelper.F2().W3() || marker == null || marker.getPosition() == null) {
return;
}
J9(marker.getPosition());
}
public final void b6(boolean z, Site site) {
boolean e2 = pa9.e(site.getPoi());
DetailOptions detailOptions = this.K;
MapHelper.F2().M3(z, e2 & ((detailOptions == null || detailOptions.isLongClick() || this.K.isLocationMarkerClick() || !TextUtils.isEmpty(this.K.getGooglUrl())) ? false : true));
}
public final void b7(defpackage.SummaryCardUIState r7) {
throw new UnsupportedOperationException("Method not decompiled: com.huawei.maps.poi.ui.DetailFragment.b7(mi9):void");
}
public final void b8(Site site, String[] strArr) {
this.c.b0.setValue(Integer.valueOf((k.Z() && (pa9.j(site) || pa9.k(site))) ? 0 : 8));
}
public final void b9() {
if (isAdded()) {
AbstractMapUIController.getInstance().setDynamicCardCallBack(new DynamicCardCallBack() {
public final void onClickCallBack(String str, Object obj) {
DetailFragment.this.U7(str, obj);
}
});
}
}
public final void q6(CustomGuidesResp customGuidesResp) {
if (customGuidesResp == null) {
this.V.setShowGuide(false);
} else {
List<GuideInfo> guideInfos = customGuidesResp.getGuideInfos();
if (guideInfos == null || guideInfos.size() < 3) {
this.V.setShowGuide(false);
} else {
this.V.setShowGuide(true);
}
this.U.setGuides(guideInfos);
}
Z4(new int[]{sb2.r}, this.U);
}
public final List<BusTransportLine> c4(List<BusTransportLine> list) {
if (list == null) {
return null;
}
HashMap hashMap = new HashMap();
for (BusTransportLine busTransportLine : list) {
if (busTransportLine != null && !TextUtils.isEmpty(busTransportLine.getName())) {
String name = busTransportLine.getName();
List list2 = (List) hashMap.get(name);
if (list2 != null) {
list2.add(busTransportLine);
} else {
ArrayList arrayList = new ArrayList();
arrayList.add(busTransportLine);
hashMap.put(name, arrayList);
}
}
}
list.clear();
Iterator it = hashMap.entrySet().iterator();
while (it.hasNext()) {
list.add((BusTransportLine) ((List) ((Map.Entry) it.next()).getValue()).get(0));
}
return list;
}
public final void c5() {
AbstractMapUIController.getInstance().hideResultBadButton();
AbstractMapUIController.getInstance().toggleBadResultBubble(false);
}
public final void c6(int i2) {
try {
FragmentActivity activity = getActivity();
if (activity != null) {
FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
CommentsInPoiDetailFragment commentsInPoiDetailFragment = this.T0;
if (commentsInPoiDetailFragment == null || (commentsInPoiDetailFragment.isAdded() && !this.T0.isVisible())) {
this.T0 = CommentsInPoiDetailFragment.k.a(this.U0);
}
SafeBundle safeBundle = new SafeBundle();
safeBundle.putBoolean("poi_is_from_message_center", getSafeArguments().getBoolean("poi_is_from_message_center"));
this.T0.setArguments(safeBundle.getBundle());
supportFragmentManager.beginTransaction().replace(i2, this.T0).commitNowAllowingStateLoss();
}
} catch (Exception unused) {
hm4.h("DetailFragment", "display reviews fragment error");
}
}
public final void c7(r3a r3aVar) {
char c2;
try {
String e2 = r3aVar.e();
String d2 = r3aVar.d();
if (!tha.a(d2) && d2.equals("not_support_language_error")) {
Q9();
return;
}
String lowerCase = gg4.m().toLowerCase(Locale.ENGLISH);
String str = (String) r3aVar.f().c();
if (!tha.a(str) && !lowerCase.equals(str)) {
switch (e2.hashCode()) {
case -1041501943:
if (e2.equals("first_request_error")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case -621834460:
if (e2.equals("other_request_success")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case -617237321:
if (e2.equals("network_error")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -544169276:
if (e2.equals("first_request_success")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case 294392765:
if (e2.equals("not_support_language_error")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case 1054504297:
if (e2.equals("other_request_error")) {
c2 = 4;
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
if (c2 == 0 || c2 == 1) {
if (tha.b(this.J0)) {
return;
}
for (int i2 = 0; i2 < this.J0.size(); i2++) {
if (this.J0.get(i2).getCommentID().equals(r3aVar.c())) {
if (!tha.a(r3aVar.g())) {
this.J0.get(i2).setTranslatedText(r3aVar.g());
} else if (this.J0.get(i2).isTranslatedClick()) {
this.J0.get(i2).setIsTranslatedClick(false);
cz9.j(R$string.network_abnormal);
hm4.p("DetailFragment", "mCommentTranslateObserver success network abnormal toast");
}
aa();
}
}
return;
}
if (c2 != 2 && c2 != 3 && c2 != 4 && c2 != 5) {
hm4.h("DetailFragment", "Translate fail response");
return;
}
cz9.j(R$string.network_abnormal);
hm4.p("DetailFragment", "mCommentTranslateObserver error network abnormal toast");
if (tha.b(this.J0)) {
return;
}
for (int i3 = 0; i3 < this.J0.size(); i3++) {
if (this.J0.get(i3).getCommentID().equals(r3aVar.c())) {
this.J0.get(i3).setIsTranslatedClick(false);
aa();
}
}
return;
}
V8(r3aVar);
} catch (NullPointerException e3) {
hm4.h("DetailFragment", "comment translate nullPointerException" + e3.getMessage());
}
}
public final void c8(View view) {
networkSettingClick();
}
public void c9(final Site site) {
hm4.p("DetailFragment", "setEndDetailSite");
ez0.a.c(site);
CommentsViewModel commentsViewModel = this.U0;
if (commentsViewModel != null) {
commentsViewModel.A(site);
}
if (this.o0) {
s8();
return;
}
if (this.K.isCollectSite()) {
site.setColletSite(true);
}
I8(site);
F9(site);
if (RouteDataManager.b().q() || RouteDataManager.b().p() || RouteDataManager.b().s() || RouteDataManager.b().r()) {
this.c.i.setValue(8);
} else {
this.c.i.setValue(0);
}
this.c.s.setValue(0);
this.c.P.setValue(Boolean.FALSE);
this.i = false;
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.o((String) null, "", "text/html", "utf-8", (String) null);
Y3(site);
X3(site);
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.V7(site, (DetailUIHandler) obj);
}
});
f17.a();
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.W7(site, (LayoutSiteDetailBinding) obj);
}
});
this.U.setSite(site);
if (((BaseFragment) this).mBinding != null) {
a32.h().l(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).topImageLayout, site, getContext());
}
g9(site);
Y4();
n9(site);
K8();
o9(site);
K4(site);
this.c.B.getExchangeRateNonCountryAreaCode(site);
DetailReportUtil.e0(site, this.K);
DetailOptions detailOptions = this.K;
if (detailOptions == null || !detailOptions.isFromNearby()) {
xr4.Q().W1(false);
} else {
xr4.Q().W1(true);
}
DetailReportUtil.K();
xr4.Q().r1();
o8(site);
N3();
X8(site);
if (df3.d()) {
L3();
}
}
public final void ca(DetailOptions detailOptions) {
if (detailOptions == null || !detailOptions.isFromSuccess()) {
return;
}
D4();
n4(Boolean.TRUE, false);
K8();
b9();
}
@JavascriptInterface
public void call(final String str) {
if (com.huawei.maps.poi.utils.c.b0(this.F, this.B0)) {
Optional.ofNullable(this.b0).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailFragment.q) obj).m(str);
}
});
}
}
@Override
public void collectByLogin() {
CollectFolderInfo collectFolderInfo = (CollectFolderInfo) this.c.U.getValue();
if (collectFolderInfo == null) {
hm4.p("DetailFragment", "default folder not init");
ja();
return;
}
boolean b2 = et0.b(0, collectFolderInfo.getNum());
if (this.L.B() || b2) {
su0.x(false);
this.L.showSelectFavoritesDialog(nav(), getActivity());
} else {
if (this.L.z() >= 5000) {
cz9.p(getString(R$string.collect_upper_limit));
return;
}
this.L.collectToDefaultFolder((String) this.c.W.getValue(), (Site) this.c.n.getValue(), (CollectFolderInfo) this.c.U.getValue());
this.L.O(nav(), getActivity(), System.currentTimeMillis());
}
}
@Override
public void collectByNoLogin(Account account) {
if (account != null) {
getActivityViewModel(CollectAddressViewModel.class).j().postValue(Boolean.TRUE);
e4.a().onSignIn(account);
this.c.W.postValue(x52.a(account.getUid()));
StringBuilder sb = new StringBuilder();
sb.append("collectByNoLogin uid not empty:");
sb.append(!TextUtils.isEmpty(r4));
hm4.f("TAG_FLOW_LOGIN_COLLECT", sb.toString());
return;
}
if (o72.e("")) {
hm4.f("TAG_FLOW_LOGIN_COLLECT", "collectByNoLogin double click");
return;
}
this.L.updateAppCollectIcon(0, 0);
F4(10000);
if (kj2.h(getActivity())) {
hm4.f("TAG_FLOW_LOGIN_COLLECT", "launch login by hw phone");
} else {
hm4.f("TAG_FLOW_LOGIN_COLLECT", "launch login by third phone");
}
}
public void collectClickPoi(Site site) {
if (site == null) {
return;
}
site.setColletSite(true);
DetailOptions detailOptions = this.K;
if (detailOptions != null) {
detailOptions.collectSite(true);
}
if (!MapHelper.F2().R3(site.getSiteId())) {
M8();
}
da(d32.d(site));
}
public final void d4(boolean z) {
ViewDataBinding viewDataBinding;
DynamicPoiDetailBean dynamicPoiDetailBean = this.U;
if (dynamicPoiDetailBean != null) {
dynamicPoiDetailBean.setRouteCardInfo(null);
this.U.setSiteJson(null);
this.U.setPoiOpenStateInfo(null);
this.U.setLocalDataBean(null);
this.U.setSite(null);
this.U.setNearbySubwayRecommendSites(null);
this.U.setNearbyBusRecommendSites(null);
this.U.setMenu(null);
this.U.setRestaurant(null);
this.U.setSearchConfigJson(null);
this.U.setHotelDetails(null);
this.U.setGasStation(null);
this.U.setDealsInfo(null);
this.U.setRecommends(null);
this.U.setGuides(null);
this.U.setHotel(null);
this.U.setRestaurantReservationDetails(null);
this.U.setCarChargeInfo(null);
this.U.setNearbyServiceList(null);
this.U.setSafeJourneyConfig(null);
this.U.setTopCitiesItemList(null);
this.U.setGuides(null);
this.U.setHotelDetailLoading(false);
this.U.setMeetkaiAdvertisementCardBean(null);
this.U.setCommentJson(null);
this.U.setDeliveryDetails(null);
}
List<CommentDataInfo> list = this.J0;
if (list != null) {
list.clear();
}
if (z && (viewDataBinding = ((BaseFragment) this).mBinding) != null && ((LayoutSiteDetailBinding) viewDataBinding).dynamicRv != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.stopScroll();
}
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null) {
detailViewModel.q0.setValue((Object) null);
this.c.F.setValue((Object) null);
this.c.B.getGasStationData().setValue((Object) null);
this.c.r.setValue((Object) null);
this.c.B.clearCommentDataInfoAllList();
}
xr4.Q().W1(false);
DynamicCardAdapter dynamicCardAdapter = this.W;
if (dynamicCardAdapter != null) {
dynamicCardAdapter.d();
this.W.g(z);
}
}
public final void d5() {
this.V.setShowTopRanking(false);
this.V.setShowGuide(false);
this.U.setWeatherInfo(null);
Z4(new int[]{sb2.p, sb2.c, sb2.r}, this.U);
}
public final void d6() {
if (((BaseFragment) this).mBinding != null) {
AbstractMapUIController.getInstance().bindScrollView(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).appBar);
}
}
public final void d7(Boolean bool) {
if (bool != null && this.K.isScrollToComment()) {
this.K.setScrollToComment(false);
this.K.setScrollToExpand(true);
if (!bool.booleanValue()) {
t8();
G4(true);
} else {
if (this.W == null || this.G == null) {
return;
}
int baseline = ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).operationLayout.getRoot().getBaseline();
ve8.p().O(0);
ve8.p().Y(this.G.C(baseline));
m9(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv, this.K.isScrollNeededToCardShelf());
}
}
}
public final void d8(Records records, DialogInterface dialogInterface, int i2) {
i11.d().g(records.getSiteId(), getActivityViewModel(CommonAddressRecordsViewModel.class), MapSubmitSuccessDialogType.IS_FROM_COMMENT_PAGE);
at0.w().M(records.getSiteId());
j4(records);
onBackPressed();
}
public final void d9(float f3) {
if (((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).inlineH5Layout.getLayoutParams() instanceof ConstraintLayout.LayoutParams) {
ConstraintLayout.LayoutParams layoutParams = ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).inlineH5Layout.getLayoutParams();
((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin = ct3.F(o41.c()) + ct3.b(o41.c(), f3);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).inlineH5Layout.setLayoutParams(layoutParams);
}
}
public final void da(DetailOptions detailOptions) {
if (this.K == null || detailOptions == null) {
hm4.h("DetailFragment", "updateOptions mDetailOptions is null");
return;
}
if (detailOptions.isCollectSite()) {
this.K.collectSite(true);
} else {
this.K.collectSite(false);
}
if (detailOptions.isShowCenter()) {
this.K.showCenter(true);
}
e9(false);
this.O.detailOptionsData.setValue(detailOptions.favoritesSite(this.K.isFavoritesSite()).collectSite(this.K.isCollectSite()).showCenter(this.K.isShowCenter()).setFromAddStop(this.K.isFromAddStop()).setFromNavComplete(this.K.isFromNavComplete()).setAddressType(this.K.getAddressType()).setFromDeleteStop(this.K.isFromDeleteStop()));
}
public final void e4(final PoiLikeAction poiLikeAction) {
ArrayList imageList;
CommentDataInfo a2 = poiLikeAction.getCommentData().a();
CommentLikeInfo commentLikeInfo = new CommentLikeInfo();
commentLikeInfo.setCommentId(a2.getCommentID());
commentLikeInfo.setCommentType(a2.getCommentType());
try {
commentLikeInfo.setCommentCreateTime(oy9.e(new SimpleDateFormat("yyyyMMddHHmmss").parse(a2.getCreateTime())));
} catch (ParseException unused) {
hm4.h("DetailFragment", "comment time parse error");
}
commentLikeInfo.setCommentCreatorNickName(a2.getNickName());
commentLikeInfo.setCommentStarRating(a2.getLikeStatus());
if (a2.getMediaComment() != null && (imageList = a2.getMediaComment().getImageList()) != null) {
ArrayList arrayList = new ArrayList();
Iterator it = imageList.iterator();
while (it.hasNext()) {
ImageItemFile originalPublicImageFile = ((ImageItemInfo) it.next()).getOriginalPublicImageFile();
if (originalPublicImageFile != null) {
arrayList.add(originalPublicImageFile.getDownloadURL());
}
}
commentLikeInfo.setCommentPhotoUrls(arrayList);
}
try {
commentLikeInfo.setCommentStarRating((int) Float.parseFloat(a2.getStarRating()));
} catch (NumberFormatException unused2) {
hm4.h("DetailFragment", "NumberFormatException");
}
commentLikeInfo.setCommentData(a2.getComment());
commentLikeInfo.setCommentSource(a2.getSrc());
final Site site = (Site) this.c.n.getValue();
if (site != null) {
commentLikeInfo.setPoiId(site.getSiteId());
}
Account account = e4.a().getAccount();
commentLikeInfo.setLikeUserNickName(account.getDisplayName());
commentLikeInfo.setLikeUserAvatarUrl(account.getAvatarUriString());
final CommentLikeInfo.LikeStatus likeStatus = a2.getIsCommentLiked() == 1 ? CommentLikeInfo.LikeStatus.UNLIKE : CommentLikeInfo.LikeStatus.LIKE;
commentLikeInfo.setLikeStatus(likeStatus);
this.o.d(commentLikeInfo, new Function2() {
public final Object invoke(Object obj, Object obj2) {
mda v5;
v5 = DetailFragment.v5(poiLikeAction, site, likeStatus, (Long) obj, (Boolean) obj2);
return v5;
}
}, new Function0() {
public final Object invoke() {
mda w5;
w5 = DetailFragment.w5();
return w5;
}
});
}
public final void e5() {
this.V.setShowGuide(false);
this.V.setShowTopRanking(false);
Z4(new int[]{sb2.p, sb2.r}, this.U);
}
public final void e7(NearbyFeedData nearbyFeedData) {
hm4.z("DetailFragment", "nearbyPoiDetailCardBean changed");
if (nearbyFeedData != null) {
this.U.setNearbyFeedData(nearbyFeedData);
DynamicCardAdapter dynamicCardAdapter = this.W;
if (dynamicCardAdapter != null) {
dynamicCardAdapter.addExtraData(DynamicCardAdapterDataKey.CITY_ID, nearbyFeedData.getCityCode());
}
Z4(new int[]{sb2.Z}, this.U);
}
}
public final void e8(int i2, int i3) {
tx6.g().v(getActivity(), this.q.getRoot(), i2, i3 - ct3.b(o41.c(), 5.0f));
}
public final void e9(boolean z) {
hm4.p("DetailFragment", "isFromSearch " + z);
wr4.a(z);
}
public final void ea() {
Site site = (Site) this.c.n.getValue();
Records records = this.K.getRecords();
if (site == null || records == null || records.getSiteId() == null || records.getSiteId().equals(site.getSiteId())) {
return;
}
hm4.p("DetailFragment", "update Records");
deleteRecordsById(records);
saveDetailClickRecord(site, false);
}
public final boolean f4(MapScrollLayout.Status status, MapScrollLayout.Status status2) {
MapScrollLayout.Status status3 = MapScrollLayout.Status.EXPANDED;
if (status == status3) {
return true;
}
return status == MapScrollLayout.Status.COLLAPSED && status2 != status3;
}
public void f5() {
PopRecyclerHelper.e().d();
}
public final void f6(MapSafeWebView mapSafeWebView) {
mapSafeWebView.loadUrl(this.F);
}
public final void f7(Boolean bool) {
if (bool.booleanValue()) {
this.c0 = true;
o4();
}
n4(bool, false);
}
public final void f8(String str) {
this.R.o(str);
}
public final void fa(String str, Boolean bool) {
Poi poi;
Site site = this.U.getSite();
if (site == null || (poi = site.getPoi()) == null) {
return;
}
poi.setTranslatedDescription(str);
poi.setIsTranslateLoading(bool);
site.setPoi(poi);
this.U.setSite(site);
Z4(new int[]{sb2.B}, this.U);
}
public void fragmentStatistics(String str) {
((BaseFragment) this).entryTime = DetailReportUtil.a(str, getClass().getSimpleName(), ((BaseFragment) this).type, ((BaseFragment) this).source, ((BaseFragment) this).entryTime);
}
public final void g4(boolean z) {
if (z) {
hm4.p("DetailFragment", " AgeRangeFlag: " + e4.a().isChildren());
if (e4.a().isChildren()) {
cz9.j(R$string.protect_minors_enable);
} else {
t8();
G4(this.C);
}
}
}
public final void g5() {
Iterator<CommentDataInfo> it = this.J0.iterator();
while (it.hasNext()) {
it.next().setTranslateShowing(false);
}
}
public final void g6(MapSafeWebView mapSafeWebView) {
mapSafeWebView.addJavascriptInterface(this, "SparkleNative");
}
public final void g7(om1 om1Var) {
if (om1Var instanceof b) {
b bVar = (b) om1Var;
if (!bVar.d()) {
vm1.a.K();
return;
}
R3();
if (bVar.a() != null) {
if (bVar.c()) {
vm1.a.b(bVar.a(), bVar.b());
} else {
vm1.a.w(bVar.a());
}
vm1 vm1Var = vm1.a;
if (vm1Var.t()) {
vm1Var.d();
vm1Var.G(vm1Var.g(), ((BaseFragment) this).isDark);
}
}
}
}
public final void g9(Site site) {
if (site == null || ((BaseFragment) this).mBinding == null || this.V == null || !k.d()) {
return;
}
this.V.setShowMeasureDistance((TextUtils.equals(o41.f(R$string.mylocation), ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.getText().toString()) || pa9.c(site.getPoi())) ? false : true);
}
public final void o6(String str) {
this.V.setShowWeatherAndTime(true);
this.U.setLocalTime(str);
Z4(new int[]{sb2.c}, this.U);
}
public int getContentLayoutId() {
return R$layout.layout_site_detail;
}
@JavascriptInterface
public void goBack() {
fk2.f(new Runnable() {
@Override
public final void run() {
DetailFragment.this.P5();
}
});
}
public final NearbySearchRequest h4(Site site, String str) {
NearbySearchRequest nearbySearchRequest = new NearbySearchRequest();
nearbySearchRequest.setHwPoiType(HwLocationType.getItem(str));
nearbySearchRequest.setLocation(site.getLocation());
nearbySearchRequest.setRadius(1000);
nearbySearchRequest.setLanguage(gg4.l());
return nearbySearchRequest;
}
public void h5() {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding == null) {
return;
}
this.K0 = ((LayoutSiteDetailBinding) viewDataBinding).subtabLayout;
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null && detailViewModel.c0.getValue() != null) {
if (pa9.c(((Site) this.c.c0.getValue()).getPoi())) {
this.L0 = this.K0.A().v(getString(R$string.tab_about)).t("overview");
} else {
this.L0 = this.K0.A().v(getString(R$string.tab_overall)).t("overview");
}
this.K0.g(this.L0, false);
}
DetailViewModel detailViewModel2 = this.c;
if (detailViewModel2 != null && ((Boolean) detailViewModel2.e0.getValue()).booleanValue()) {
TabLayout.e t = this.K0.A().v(getString(R$string.tab_tool)).t("tool");
this.M0 = t;
this.K0.g(t, false);
}
DetailViewModel detailViewModel3 = this.c;
if (detailViewModel3 != null && ((Boolean) detailViewModel3.f0.getValue()).booleanValue()) {
TabLayout.e t2 = this.K0.A().v(getString(R$string.tab_strategy)).t("strategy");
this.N0 = t2;
this.K0.g(t2, false);
}
DetailViewModel detailViewModel4 = this.c;
if (detailViewModel4 != null && ((Boolean) detailViewModel4.d0.getValue()).booleanValue()) {
TabLayout.e t3 = this.K0.A().v(getString(R$string.tab_review)).t("review");
this.P0 = t3;
this.K0.g(t3, false);
}
DetailViewModel detailViewModel5 = this.c;
if (detailViewModel5 != null && ((Boolean) detailViewModel5.g0.getValue()).booleanValue()) {
TabLayout.e t4 = this.K0.A().v(getString(R$string.tab_nearby)).t("nearby");
this.O0 = t4;
this.K0.g(t4, false);
}
this.K0.d(this.e1);
this.K0.getViewTreeObserver().addOnGlobalLayoutListener(new l());
}
public final void h7(Pair pair) {
if (pair == null) {
return;
}
if (((Integer) pair.first).intValue() == 1001) {
cz9.j(R$string.delete_success);
this.n.c().postValue((CommentDelete) pair.second);
}
if (((Integer) pair.first).intValue() == 1003) {
sr4.l(requireActivity());
}
}
public final void h9() {
this.c.g().observe(this, this.i1);
this.c.f().observe(this, this.j1);
}
public final void r6(CustomRecommendDataBean customRecommendDataBean) {
if (customRecommendDataBean == null || customRecommendDataBean.getData() == null || tha.b(customRecommendDataBean.getData().getCustomList())) {
this.V.setShowTopRanking(false);
} else {
CustomRecommendDataBean.DataBean data = customRecommendDataBean.getData();
ArrayList arrayList = new ArrayList();
for (CustomRecommendDataBean.DataBean.CustomListBean customListBean : data.getCustomList()) {
if (customListBean.getEntrancePicture() != null && !tha.a(customListBean.getEntrancePicture().getUrl()) && !tha.a(customListBean.getRankingName()) && !tha.a(customListBean.getRankingTypeTitle()) && !tha.a(customListBean.getJumpLink())) {
arrayList.add(customListBean);
}
}
this.U.setRecommends(arrayList);
this.V.setShowTopRanking(!tha.b(arrayList));
}
Z4(new int[]{sb2.p}, this.U);
}
public final void handleSiteBack(com.huawei.maps.businessbase.model.Site r8) {
throw new UnsupportedOperationException("Method not decompiled: com.huawei.maps.poi.ui.DetailFragment.handleSiteBack(com.huawei.maps.businessbase.model.Site):void");
}
public void handlerTrafficEventClick() {
onBackPressed();
}
public final void i4() {
DetailViewModel detailViewModel;
if (ve8.p().z() || (detailViewModel = this.c) == null) {
return;
}
MapMutableLiveData<String> mapMutableLiveData = detailViewModel.Z;
if (mapMutableLiveData != null) {
mapMutableLiveData.setValue("strategy");
}
ve8.p().p0(true);
ve8.p().K(MapScrollLayout.Status.EXPANDED);
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
H9("strategy", ((LayoutSiteDetailBinding) viewDataBinding).dynamicRv);
}
}
public final void i5(String str, Object obj) {
t8();
Function<Object, Void> function = this.e0.get(str);
if (function != null) {
function.apply(obj);
}
}
public final void i6(CommentReplyUIEvent commentReplyUIEvent) {
CommentDataInfo a2;
CommentReplyInputModel a3;
ArrayList imageList;
if (!(commentReplyUIEvent instanceof CommentReplyUIEvent.l)) {
if (commentReplyUIEvent instanceof CommentReplyUIEvent.b) {
cz9.k(getString(R$string.network_abnormal));
hm4.p("DetailFragment", "commentInputDialogObserver network abnormal toast");
return;
} else {
if (commentReplyUIEvent instanceof CommentReplyUIEvent.a) {
cz9.k(getString(R$string.comment_reply_already_replied));
return;
}
return;
}
}
th1 th1Var = (th1) this.S.m().getValue();
if (th1Var == null || (a2 = th1Var.a()) == null || (a3 = ((CommentReplyUIEvent.l) commentReplyUIEvent).a()) == null) {
return;
}
this.R0 = a3;
if (a3.getAddedChildCommentItem() == null || a3.getMainCommentId() == null) {
return;
}
this.S0 = new pc();
final PoiCommentInfo poiCommentInfo = new PoiCommentInfo();
if (e4.a().isExpireAccount()) {
e4.a().silentSignInWithOutId(new OnAccountSuccessListener() {
public final void onSuccess(Account account) {
DetailFragment.j7(poiCommentInfo, account);
}
}, (OnAccountFailureListener) null);
} else {
poiCommentInfo.setAccessToken(e4.a().getAccessToken());
}
poiCommentInfo.setRequestId(RequestIdUtil.genRequestId(o41.b().getAppId(), "create"));
poiCommentInfo.setConversationId(pd1.c());
CommentInfo commentInfo = new CommentInfo();
if (a3.getAddedChildCommentItem() != null) {
ParentCommentInfo parentCommentInfo = new ParentCommentInfo();
parentCommentInfo.setCommentData(a2.getComment());
parentCommentInfo.setCommentCreatorNickName(a2.getNickName());
parentCommentInfo.setCommentCreateTime(String.valueOf(a2.getCommentCreateTime()));
if (!tha.a(a2.getSrc()) && !a2.getSrc().equals("BOOKING")) {
try {
parentCommentInfo.setCommentStarRating(Integer.parseInt(a2.getStarRating()));
} catch (Exception e2) {
hm4.h(getTag(), e2.getMessage() + "starRating parse fail.");
}
}
parentCommentInfo.setCommentType(a2.getCommentType());
parentCommentInfo.setLikeUserNickName(a3.getAddedChildCommentItem().getNickname());
parentCommentInfo.setLikeUserAvatarUrl(a3.getAddedChildCommentItem().getAvatar());
if (a2.getMediaComment() != null && (imageList = a2.getMediaComment().getImageList()) != null) {
ArrayList arrayList = new ArrayList();
Iterator it = imageList.iterator();
while (it.hasNext()) {
ImageItemFile originalPublicImageFile = ((ImageItemInfo) it.next()).getOriginalPublicImageFile();
if (originalPublicImageFile != null) {
arrayList.add(originalPublicImageFile.getDownloadURL());
}
}
parentCommentInfo.setCommentPhotoUrls(arrayList);
}
poiCommentInfo.setParentCommentInfo(parentCommentInfo);
commentInfo.setComment(a3.getAddedChildCommentItem().getComment());
commentInfo.setContentID(a2.getContentID());
commentInfo.setDeviceNickName(q42.f());
commentInfo.setParentCommentSrc(a2.getSrc());
commentInfo.setParentCommentId(a2.getCommentID());
poiCommentInfo.setCommentInfo(commentInfo);
Site site = (Site) this.c.B.getDetailData().getValue();
if (site != null) {
poiCommentInfo.setSite(site);
poiCommentInfo.setPoiInfo(new PoiInfo(site, McPoiCommentType.CREATE));
}
poiCommentInfo.setCityId((String) this.Y0.b().getValue());
this.S0.n(poiCommentInfo, this.c.r0, new k());
}
}
public final void i7(Boolean bool) {
if (bool == null || !bool.booleanValue()) {
return;
}
t8();
this.n.a().setValue(Boolean.FALSE);
}
public final mda i8() {
this.u0 = true;
return mda.a;
}
public final void ia(Site site) {
if (site == null || site.getPoi() == null || !e17.g()) {
return;
}
if (this.S0 == null) {
this.S0 = new pc();
}
this.U.setShowUploadImageCardView(!pa9.c(site.getPoi()));
hm4.f("DetailFragment", "updateUploadImageCard getDynamicCardData ");
Z4(new int[]{sb2.a}, this.U);
}
public void initDarkMode(final boolean z) {
super/*com.huawei.maps.businessbase.ui.BaseFragment*/.initDarkMode(z);
this.c.g.setValue(Boolean.valueOf(z));
this.N.c.setValue(Boolean.valueOf(z));
this.r.setIsDark(z);
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null && ((LayoutSiteDetailBinding) viewDataBinding).tabFrameLayout.getVisibility() == 0) {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtabLayout.N(z ? o41.d(R$color.hos_text_color_secondary_dark) : o41.d(R$color.hos_text_color_secondary), z ? o41.d(R$color.hos_text_color_primary_activated_dark) : o41.d(R$color.hos_text_color_primary_activated));
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtabLayout.setSelectedTabIndicatorColor(z ? o41.d(R$color.hos_text_color_primary_activated_dark) : o41.d(R$color.hos_text_color_primary_activated));
}
PopRecyclerHelper.e().f(z);
Optional.ofNullable((Site) this.c.n.getValue()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.b6(z, (Site) obj);
}
});
if (jh8.v()) {
T3();
} else {
S3();
}
V3();
DynamicCardAdapter dynamicCardAdapter = this.W;
if (dynamicCardAdapter != null) {
dynamicCardAdapter.setDark(z);
}
tx6.g().s(z);
}
public void initData() {
hm4.p("DetailFragment", "initData");
Y8();
MapHelper.F2().H6(true);
MapHelper.F2().z6(true);
if (this.A) {
R8(false);
this.A = false;
}
m4();
this.h0 = 20000;
AbstractMapUIController.getInstance().setMapViewResultHeight(0);
this.B0 = com.huawei.maps.poi.utils.c.K();
SafeBundle safeArguments = getSafeArguments();
if (safeArguments.isEmpty()) {
return;
}
this.D0 = safeArguments.getString("key_comment_deleted_id", "");
}
public void initViews() {
MapMutableLiveData<Site> mapMutableLiveData;
hm4.p("DetailFragment", "initViews");
this.d = ct3.C(getActivity());
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).slideOnsearch.setSupportDraggable(true);
O9(false);
jh8.h0(this.w);
jh8.Q(true);
BaseActivity activity = getActivity();
if (activity instanceof BaseActivity) {
this.G = new DetailUIHandler(this, activity);
getLifecycle().addObserver(this.G);
}
DetailOptions detailOptions = this.K;
boolean z = detailOptions != null && detailOptions.isLocationMarkerClick();
if (this.U == null || !z) {
this.U = new DynamicPoiDetailBean();
}
this.V = new DynamicPoiDetailLocalDataBean();
if (this.W == null) {
DynamicCardAdapter dynamicCardAdapter = new DynamicCardAdapter(new CommentViewHolderListener() {
public final void onCommentViewHolder(int i2) {
DetailFragment.this.c6(i2);
}
});
this.W = dynamicCardAdapter;
dynamicCardAdapter.setParentFragment(this);
}
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null && ((LayoutSiteDetailBinding) viewDataBinding).dynamicRv != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.addOnScrollListener(this.g1);
}
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv.addItemDecoration(new SpacesItemBottomDecoration(R$dimen.dp_12));
if (this.b0 == null) {
this.b0 = new q();
}
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).setClickProxy(this.b0);
LayoutSiteDetailBottomBinding layoutSiteDetailBottomBinding = (LayoutSiteDetailBottomBinding) AbstractMapUIController.getInstance().getSiteDetailBottomBind();
this.q = layoutSiteDetailBottomBinding;
if (layoutSiteDetailBottomBinding != null) {
layoutSiteDetailBottomBinding.setClickProxy(this.b0);
}
LayoutDetailBottomMorePopWindowBinding layoutDetailBottomMorePopWindowBinding = (LayoutDetailBottomMorePopWindowBinding) DataBindingUtil.inflate(LayoutInflater.from(getContext()), R$layout.layout_detail_bottom_more_pop_window, (ViewGroup) null, false);
this.r = layoutDetailBottomMorePopWindowBinding;
if (layoutDetailBottomMorePopWindowBinding != null) {
layoutDetailBottomMorePopWindowBinding.setClickProxy(this.b0);
}
f9();
K3();
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).setVm(this.c);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).setPoiVm(this.O);
l9(true);
Z3();
AbstractMapUIController.getInstance().hideWeatherBadge();
this.R = new r();
if (qc6.c(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.b)) {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.b.setWebViewClient(this.R, false);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.setCanRefreshWeb(true);
}
if (!getSafeArguments().getBoolean("load_native_to_poi_detail")) {
s8();
}
this.y0 = getSafeArguments().getBoolean("ugc_photo_poi_name_clicked", false);
this.A0 = getSafeArguments().getString("meetkai_banner_html");
ve8.p().l0(MapScrollLayout.ScrollTopBottomState.DISABLE);
AbstractMapUIController.getInstance().hideTrafficDialog();
DetailOptions detailOptions2 = (DetailOptions) this.O.detailOptionsData.getValue();
if (detailOptions2 != null) {
N9(detailOptions2);
}
if (!this.o0) {
T9();
}
this.d2 = true;
if (RouteDataManager.b().z()) {
b9();
}
h5();
ve8.p().o0();
if (!c06.b() && k.p1()) {
MapHelper.F2().b7(true);
}
if (!c06.b() && !AbstractMapUIController.getInstance().isNaviCompletedPageShowing()) {
com.huawei.maps.businessbase.utils.b.a().h((Boolean) null);
}
if (j5()) {
ve8.p().o0();
}
this.p.f().observe(getViewLifecycleOwner(), this.b2);
com.huawei.maps.app.common.utils.task.a.f(com.huawei.maps.app.common.utils.task.a.a("DetailFragment", "bindAppBar", new Runnable() {
@Override
public final void run() {
DetailFragment.this.d6();
}
}), 500L);
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null || (mapMutableLiveData = detailViewModel.n) == null || mapMutableLiveData.getValue() == null) {
return;
}
a32.h().l(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).topImageLayout, (Site) this.c.n.getValue(), getContext());
}
public final void j4(final Records records) {
com.huawei.maps.app.common.utils.task.a.b(TaskExecutor.SQL).d(com.huawei.maps.app.common.utils.task.a.a("DetailFragment", "deleteOneRecord", new Runnable() {
@Override
public final void run() {
DetailFragment.x5(records);
}
}));
}
public final boolean j5() {
return getSafeArguments().getBoolean("IS_CLICKED_BY_DIYMAPS");
}
public final void j6(Pair pair) {
CommentsViewModel commentsViewModel;
if (1001 != ((Integer) pair.first).intValue()) {
if (1002 == ((Integer) pair.first).intValue()) {
CommentRepliesSharedViewModel commentRepliesSharedViewModel = this.S;
if (commentRepliesSharedViewModel != null) {
commentRepliesSharedViewModel.E().postValue(Boolean.TRUE);
}
if (jz0.g().getFailDistinctCode().equals("005031")) {
cz9.k(getString(R$string.comment_reply_already_replied));
return;
}
return;
}
return;
}
CommentRepliesSharedViewModel commentRepliesSharedViewModel2 = this.S;
if (commentRepliesSharedViewModel2 != null) {
commentRepliesSharedViewModel2.E().postValue(Boolean.TRUE);
}
th1 th1Var = (th1) this.S.m().getValue();
if (this.R0 == null || (commentsViewModel = this.U0) == null) {
return;
}
commentsViewModel.R(th1Var, new ArrayList(Collections.singleton(this.R0.getAddedChildCommentItem())), new ArrayList(), false);
cz9.k(getString(R$string.comment_reply_review_success));
}
public final void j8(DetailOptions detailOptions, Function0 function0) {
AbstractMapUIController.getInstance().setBadResultCallbackFromDetail(getActivity(), detailOptions.getSiteName(), function0);
}
public final void j9() {
LayoutSiteDetailBottomBinding layoutSiteDetailBottomBinding = this.q;
if (layoutSiteDetailBottomBinding == null || layoutSiteDetailBottomBinding.detailBottomTipLayout.getRoot().getVisibility() != 0 || this.G == null) {
return;
}
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
ve8.p().Y(this.G.C(viewDataBinding != null ? ((LayoutSiteDetailBinding) viewDataBinding).operationLayout.viewFlipper.getHeight() : 0) + this.q.detailBottomTipLayout.getRoot().getHeight());
}
public final List<CommentDataInfo> k4() {
return (List) this.J0.stream().filter(m72.b(new Function() {
@Override
public final Object apply(Object obj) {
return ((CommentDataInfo) obj).getCommentID();
}
})).collect(Collectors.toList());
}
public final boolean k5() {
DetailOptions detailOptions = this.K;
return detailOptions != null && "strategy".equals(detailOptions.getPosition());
}
public final void k6(CommentDelete commentDelete) {
n4(Boolean.TRUE, false);
}
public final void k7(Boolean bool) {
ja();
}
public final void k8(BottomMenu bottomMenu, DetailUIHandler detailUIHandler) {
detailUIHandler.M0(bottomMenu, this.K);
}
public final void n6(WeatherInfo weatherInfo) {
this.V.setShowWeatherAndTime(true);
this.U.setWeatherInfo(weatherInfo);
Z4(new int[]{sb2.c}, this.U);
}
public final void l4(MapNaviPath mapNaviPath) {
c06.k(1);
Site site = (Site) this.c.n.getValue();
if (mapNaviPath == null || mapNaviPath.getEndPoint() == null || site == null) {
return;
}
MapHelper.F2().b6();
e32.d(mapNaviPath.getCoordList());
MapHelper.F2().O0(it3.x().getNaviPaths());
e32.n(false);
e32.g(mapNaviPath, this.n0, this.m0);
}
public void l9(boolean z) {
if (tha.b(this.g)) {
return;
}
Iterator<Polyline> it = this.g.iterator();
while (it.hasNext()) {
it.next().setVisible(z);
}
}
public final void la() {
if (this.p0) {
d9(0.0f);
}
this.q0 = true;
ve8.p().O(e40.B0);
this.c.i.setValue(8);
ve8.p().W(false);
Optional.ofNullable(this.N).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.l8((BottomViewModel) obj);
}
});
}
public final void m4() {
if (this.e0 == null) {
this.e0 = new HashMap<>();
}
this.e0.put("openDetailFragmentTabWithSite", new Function() {
@Override
public final Object apply(Object obj) {
Void y5;
y5 = DetailFragment.this.y5(obj);
return y5;
}
});
this.e0.put("gotoFragmentSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void z5;
z5 = DetailFragment.this.z5(obj);
return z5;
}
});
this.e0.put("gotoFragmentHotelIntroduceSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void A5;
A5 = DetailFragment.this.A5(obj);
return A5;
}
});
this.e0.put("gotoFragmentHotelFacilitiesSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void B5;
B5 = DetailFragment.this.B5(obj);
return B5;
}
});
this.e0.put("gotoFragmentHotelServicesSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void C5;
C5 = DetailFragment.this.C5(obj);
return C5;
}
});
this.e0.put("gotoFragmentHotelPolicySecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void D5;
D5 = DetailFragment.this.D5(obj);
return D5;
}
});
this.e0.put("gotoFragmentHotelPaymentSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void E5;
E5 = DetailFragment.this.E5(obj);
return E5;
}
});
this.e0.put("gotoFragmentProductsSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void F5;
F5 = DetailFragment.this.F5(obj);
return F5;
}
});
this.e0.put("gotoTabFragmentSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void G5;
G5 = DetailFragment.G5(obj);
return G5;
}
});
this.e0.put("gotoFragmentEventsSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void H5;
H5 = DetailFragment.this.H5(obj);
return H5;
}
});
this.e0.put("gotoFragmentServicesSecondaryDetail", new Function() {
@Override
public final Object apply(Object obj) {
Void I5;
I5 = DetailFragment.this.I5(obj);
return I5;
}
});
this.e0.put("click_reserve_report", new Function() {
@Override
public final Object apply(Object obj) {
Void J5;
J5 = DetailFragment.this.J5(obj);
return J5;
}
});
this.e0.put("clickViewMoreItem", new Function() {
@Override
public final Object apply(Object obj) {
Void K5;
K5 = DetailFragment.this.K5(obj);
return K5;
}
});
this.e0.put("clickViewOperate", new Function() {
@Override
public final Object apply(Object obj) {
Void L5;
L5 = DetailFragment.this.L5(obj);
return L5;
}
});
this.e0.put("clickDiscountCard", new Function() {
@Override
public final Object apply(Object obj) {
Void M5;
M5 = DetailFragment.this.M5(obj);
return M5;
}
});
this.e0.put("clickViewTravel", new Function() {
@Override
public final Object apply(Object obj) {
Void N5;
N5 = DetailFragment.this.N5(obj);
return N5;
}
});
}
public final void m5(Site site) {
ViewDataBinding viewDataBinding;
if (site == null || (viewDataBinding = ((BaseFragment) this).mBinding) == null || ((LayoutSiteDetailBinding) viewDataBinding).tvSiteName.getText() == null) {
return;
}
boolean equals = TextUtils.equals(o41.f(R$string.mylocation), ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.getText());
site.setMyLocation(equals);
hm4.f("DetailFragment", "isMyLocationSite" + equals);
}
public final void m6(List list) {
W3(list);
l6(list);
}
public final void m9(final MapRecyclerView mapRecyclerView, boolean z) {
if (!z || ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv.getAdapter() == null) {
return;
}
int e2 = ct3.e((Activity) getContext());
int b2 = ct3.b(o41.b(), 151.0f);
ve8.p().h0(e2);
ve8.p().Y(b2);
ve8.p().p0(true);
final int i2 = -1;
for (int i3 = 0; i3 < this.W.j(); i3++) {
if (this.W.k(i3) == sb2.x) {
i2 = i3;
}
}
if (i2 != -1) {
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).dynamicRv.postDelayed(new Runnable() {
@Override
public final void run() {
DetailFragment.a8(i2, mapRecyclerView);
}
}, 200L);
}
}
public void mapLongClick(LatLng latLng) {
if (MapHelper.F2().W3()) {
Z8();
N8();
M8();
da(d32.o(latLng));
if (!MapHelper.F2().I2()) {
xu0.i().u(MapHelper.F2().H2(), true);
}
AbstractLocationHelper.getInstance().resetLocationMarker();
}
}
public final void n4(Boolean bool, boolean z) {
hm4.f("DetailFragment", " refreshCommitData " + bool + " isAfterSignIn:" + z);
if (bool.booleanValue()) {
this.n.b().setValue(Boolean.FALSE);
if (1 == this.C0) {
DetailViewModel detailViewModel = this.c;
detailViewModel.B.startCommentSearch((Site) detailViewModel.n.getValue(), z, false);
} else {
DetailViewModel detailViewModel2 = this.c;
detailViewModel2.B.getSelfCommentSearch((Site) detailViewModel2.n.getValue(), z, false);
}
}
}
public final boolean n5(MapNaviPath mapNaviPath) {
return mapNaviPath.getStartPoint().getLatitude() == this.n0.get(0).getLatitude() && mapNaviPath.getStartPoint().getLongitude() == this.n0.get(0).getLongitude() && mapNaviPath.getEndPoint().getLatitude() == this.m0.get(0).getLatitude() && mapNaviPath.getEndPoint().getLongitude() == this.m0.get(0).getLongitude();
}
public final void n7(Task task, final int i2) {
e4.a().requestAccountLogin(((AuthAccountPicker) task.getResult()).getAuthorizationCode(), new OnAccountSuccessListener() {
public final void onSuccess(Account account) {
DetailFragment.this.l7(i2, account);
}
}, new OnAccountFailureListener() {
public final void onFailure(Exception exc) {
DetailFragment.m7(exc);
}
});
}
public final void n8(boolean z) {
if (this.K != null) {
d4(false);
Q8();
if (this.K.getRecords() != null) {
MapHelper.F2().q1();
}
Site site = this.K.getSite();
if (site != null && (!TextUtils.isEmpty(site.getSiteId()) || site.isCloseDetail())) {
if (this.K.isCollectSite()) {
site.setColletSite(true);
}
L9(site, z);
if (this.K.isShowCenter()) {
MapHelper.F2().x8(site, this.K.getGeoZoom() == -1 ? 18 : this.K.getGeoZoom(), false);
}
if (site.isCloseDetail()) {
return;
}
}
Marker marker = this.K.getMarker();
if (marker != null) {
b5(marker);
}
LatLng latLng = this.K.getLatLng();
if (latLng == null && site != null && TextUtils.isEmpty(site.getSiteId())) {
Coordinate location = site.getLocation();
if (DetailOptions.LONG_CLICK.equals(site.getPoiType())) {
this.K.longClickMap(true);
}
if (location != null) {
latLng = new LatLng(location.getLat(), location.getLng());
}
}
if (latLng != null) {
O4(latLng);
}
PointOfInterest pointOfInterest = this.K.getPointOfInterest();
if (pointOfInterest != null) {
S4(pointOfInterest);
}
String googlUrl = this.K.getGooglUrl();
if (!TextUtils.isEmpty(googlUrl)) {
M4(googlUrl);
}
this.N.r.postValue(Boolean.FALSE);
AbstractMapUIController.getInstance().setIsShowOfflineTips(tg6.b().a().isExecuteOfflineLogic());
}
}
public void n9(Site site) {
if (this.c.B.checkLocalitiesActive(site) && vi2.a.a(site, PoiType.CITY_POI.getPoiType())) {
return;
}
this.V.setShowWeatherAndTime(false);
}
public void networkSettingClick() {
AbstractMapUIController.getInstance().startWirelessSetting(getActivity(), new p());
}
public final void o4() {
if (!this.c0 || this.a0 == null) {
return;
}
p79.k("delete_comment_card_key", "comment_gone", o41.c());
if (this.i0) {
D4();
} else {
l6("GONE");
}
}
public final boolean o5() {
if (!MapSubmitSuccessDialogType.IS_FROM_POI_UGC.equals(tg6.b().c().isDownloadBasicData())) {
return false;
}
if (!tg6.b().c().isOffLineSwitchOn() || tg6.b().c().getOfflineMapsConfigs().getNetworkType() == 1) {
return !tg6.b().c().isOffLineSwitchOn() && tg6.b().c().getOfflineMapsConfigs().getNetworkType() == -1;
}
return true;
}
public final void o8(final Site site) {
Optional.ofNullable(site).map(new o08()).map(new p08()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.e6(site, (String[]) obj);
}
});
}
public final void o9(Site site) {
Poi poi;
if (site == null || this.f == null || (poi = site.getPoi()) == null || TextUtils.isEmpty(poi.getDescription())) {
return;
}
fa("", Boolean.TRUE);
this.f.d(poi.getDescription());
}
public void onActivityResult(final int i2, int i3, @Nullable Intent intent) {
super/*androidx.fragment.app.Fragment*/.onActivityResult(i2, i3, intent);
if (1021 == i2 && -1 == i3) {
r26.a.a(this, R$id.detail_to_simultaneous_translation, (Bundle) null);
t8();
return;
}
final Task authTask = e4.a().getAuthTask(intent);
if (authTask.isSuccessful()) {
if (authTask.getResult() instanceof AuthAccountPicker) {
com.huawei.maps.app.common.utils.task.a.b(TaskExecutor.SEARCH).d(com.huawei.maps.app.common.utils.task.a.a("DetailFragment", "onActivityResult", new Runnable() {
@Override
public final void run() {
DetailFragment.this.n7(authTask, i2);
}
}));
} else {
l7(e4.a().dataTransform(authTask.getResult()), i2);
}
}
}
public boolean onBackPressed() {
MapHelper.F2().v1(false);
if (this.o0) {
goBack();
return true;
}
if (((Boolean) this.c.u0.getValue()).booleanValue()) {
try {
NavHostFragment.findNavController(this).popBackStack(R$id.SearchMainFragment, false);
this.c.u0.setValue(Boolean.FALSE);
return true;
} catch (IllegalStateException e2) {
hm4.k("DetailFragment", "onBackPressed exception : " + e2.getMessage(), true);
}
}
if (this.i) {
if (qc6.c(this.G) && this.G.P0((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding)) {
return true;
}
this.i = false;
long currentTimeMillis = System.currentTimeMillis();
long j2 = this.g0;
ug3.c(String.valueOf(currentTimeMillis > j2 ? currentTimeMillis - j2 : 0L));
MapMutableLiveData<Boolean> mapMutableLiveData = this.c.P;
Boolean bool = Boolean.FALSE;
mapMutableLiveData.setValue(bool);
this.c.O.setValue(bool);
M3(false);
this.c.Q.setValue(bool);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.o((String) null, "", "text/html", "utf-8", (String) null);
this.c.s.setValue(0);
ve8.p().p0(true);
ve8.p().V(true);
ve8.p().U(false);
return true;
}
DetailOptions detailOptions = this.K;
if (detailOptions != null) {
if (detailOptions.isChildNode() && !this.d0.isEmpty()) {
DetailOptions pop = this.d0.pop();
da(pop);
Optional.ofNullable(pop.getSite()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.o7((Site) obj);
}
});
e9(this.d0.size() == 0);
return true;
}
if (this.K.isFromNearby() && !this.d0.isEmpty()) {
MapHelper.F2().v1(false);
DetailOptions pop2 = this.d0.pop();
da(pop2);
e9(this.d0.size() == 0);
Optional.ofNullable(pop2.getSite()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.p7((Site) obj);
}
});
f17.a();
this.c.E.setValue(Boolean.TRUE);
Optional.ofNullable(this.K.getSite()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.q7((Site) obj);
}
});
return true;
}
MapHelper.F2().d7(true);
MapHelper.F2().c7("");
xu0.i().r(true);
new Handler().postDelayed(new c(), 100L);
if (jh8.D() && this.K.isOnlyData()) {
FavoritesMakerHelper.n().y(false);
try {
NavHostFragment.findNavController(this).popBackStack();
} catch (IllegalArgumentException unused) {
hm4.h("DetailFragment", "navigation destination is unknown to this NavController");
}
jh8.b().setValue(2);
return true;
}
MapHelper.F2().j6();
AbstractLocationHelper.getInstance().resetLocationMarker();
s68.a().i(true);
if (this.K.isHideStartNav()) {
this.K.setHideStartNav(false);
this.N.f.setValue(0);
}
float f3 = getSafeArguments().getFloat("zoomFromSearchInExplore", -1.0f);
CameraPosition n2 = MapHelper.F2().n2();
if (f3 >= 0.0f && n2 != null && !this.t0) {
MapHelper F2 = MapHelper.F2();
LatLng latLng = n2.target;
F2.f5(CameraUpdateFactory.newCameraPosition(CameraPosition.fromLatLngZoom(new LatLng(latLng.latitude, latLng.longitude), f3)));
}
}
boolean z = getSafeArguments().getBoolean("from_card");
hm4.f("DetailFragment", "leave route result, " + z);
if (z) {
AbstractMapUIController.getInstance().showCardPage();
}
DetailReportUtil.p0(this.K, MapSubmitSuccessDialogType.IS_FROM_UPLOAD_IMAGE);
DetailOptions detailOptions2 = this.K;
if (detailOptions2 != null && (detailOptions2.isFromSug() || this.K.isSearchHistorySite())) {
this.K.fromSug(false);
this.K.formSearchHistory(false);
jh8.N(true);
}
return super/*com.huawei.maps.businessbase.ui.BaseFragment*/.onBackPressed();
}
public void onCollectMarkerClick(CollectInfo collectInfo) {
if ("click".equals(collectInfo.getPoiType()) || !TextUtils.isEmpty(collectInfo.getSiteId())) {
collectClickPoi(com.huawei.maps.poi.utils.c.n(collectInfo));
} else {
da(d32.g(new LatLng(collectInfo.getPoiLat(), collectInfo.getPoiLng()), collectInfo.getPoiName(), false, true));
}
}
public void onCommonMarkerClick(CommonAddressRecords commonAddressRecords) {
if (DetailOptions.LONG_CLICK.equals(commonAddressRecords.getPoiType())) {
da(d32.l(new LatLng(commonAddressRecords.getLat(), commonAddressRecords.getLng()), true));
} else {
collectClickPoi(com.huawei.maps.poi.utils.c.o(commonAddressRecords));
}
}
public void onConfigurationChanged(@NonNull Configuration configuration) {
super/*com.huawei.maps.businessbase.ui.BaseFragment*/.onConfigurationChanged(configuration);
this.L.onConfigurationChanged(configuration);
PopRecyclerHelper.e().k(configuration);
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null && ((BaseFragment) this).mBinding != null) {
a32.h().q(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).topImageLayout, (Site) detailViewModel.n.getValue());
}
if (this.o0) {
r8();
}
int i2 = this.d;
int i3 = configuration.orientation;
if (i2 != i3) {
this.d = i3;
AbstractMapUIController.getInstance().onConfigurationChangedPicPage();
}
}
public void onCreate(@Nullable Bundle bundle) {
super/*com.huawei.maps.businessbase.ui.RecordsFragment*/.onCreate(bundle);
it3.x().I();
int i2 = jh8.a;
this.w = i2;
jh8.X((i2 == 0 || i2 == 1) && !jh8.J());
initViewModel();
this.L = new CollectHelper(getFragmentViewModel(CollectAddressViewModel.class), getActivityViewModel(CommonAddressRecordsViewModel.class), this.c);
i9();
WeakNetworkRepository.INSTANCE.addNetworkRetryListener(getClass().getCanonicalName(), this);
this.F0.e().observe(this, new Observer() {
public final void onChanged(Object obj) {
DetailFragment.this.r7((Boolean) obj);
}
});
this.Q0 = new RecyclerSmoothScroller(getContext());
}
public void onDestroy() {
hm4.p("DetailFragment", "detail onDestroy");
super/*androidx.fragment.app.Fragment*/.onDestroy();
AbstractMapUIController.getInstance().unbindScrollView();
Optional.ofNullable(this.c).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.s7((DetailViewModel) obj);
}
});
AbstractMapUIController.getInstance().setIsCheckPoiOffline(false);
AbstractMapUIController.getInstance().toggleBadResultBubble(false);
AbstractMapUIController.getInstance().hideResultBadButton();
AbstractMapUIController.getInstance().setDynamicCardCallBack((DynamicCardCallBack) null);
d4(true);
xb2.b().e();
N8();
M8();
this.L.onDestroy();
P8();
CommentStateViewModel commentStateViewModel = this.n;
if (commentStateViewModel != null) {
commentStateViewModel.b().removeObserver(this.k1);
this.n.c().removeObserver(this.p1);
this.n.a().removeObserver(this.m1);
}
ApiCommentViewModel apiCommentViewModel = this.m;
if (apiCommentViewModel != null) {
apiCommentViewModel.k().removeObserver(this.q1);
}
this.c.B.getCustomCommentData().removeObserver(this.r1);
this.c.B.getWeatherInfo().removeObserver(this.s1);
this.c.B.getLocalTime().removeObserver(this.t1);
this.c.B.getExchangeRate().removeObserver(this.u1);
this.c.B.getTopRankingList().removeObserver(this.w1);
this.c.B.getPopularCitiesBack().removeObserver(this.x1);
this.c.B.getGuides().removeObserver(this.v1);
this.c.B.getIsHaveSelfComment().removeObserver(this.Z1);
this.c.B.getHotelData().removeObserver(this.G1);
this.c.B.getTravelData().removeObserver(this.H1);
this.c.B.getHotelDetailsData().removeObserver(this.J1);
this.c.B.getRestaurantReservationData().removeObserver(this.L1);
this.c.B.getHotelDetailLoading().removeObserver(this.F1);
this.c.B.getTodayHotelDataDetail().removeObserver(this.I1);
this.c.B.getTrivagoListData().removeObserver(this.K1);
this.c.B.getRestaurantData().removeObserver(this.M1);
this.c.B.getDeliveryData().removeObserver(this.N1);
this.c.B.getGasStationData().removeObserver(this.O1);
this.c.B.getDealsInfoData().removeObserver(this.P1);
this.c.B.getIndustryData().removeObserver(this.Q1);
this.c.B.getBusSubwayData().removeObserver(this.R1);
this.c.B.getMenuData().removeObserver(this.S1);
this.c.B.getParkingLotInfoData().removeObserver(this.T1);
this.c.B.getCarChargeInfoData().removeObserver(this.U1);
this.c.B.getPoiPictureList().removeObserver(this.W1);
this.c.B.getNearbyPoiDetailData().removeObserver(this.a2);
this.e.g().removeObserver(this.Y1);
this.f.b().removeObserver(this.X1);
f17.a();
T8();
CustomPopWindow customPopWindow = this.u;
if (customPopWindow != null) {
customPopWindow.o();
}
ve8.p().a();
Optional.ofNullable(this.c).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.t7((DetailViewModel) obj);
}
});
ReservationViewModel reservationViewModel = this.F0;
if (reservationViewModel != null) {
reservationViewModel.f();
this.F0 = null;
}
if (RouteDataManager.b().q() || RouteDataManager.b().p() || RouteDataManager.b().s() || RouteDataManager.b().r()) {
ve8.p().b();
ve8.p().K(MapScrollLayout.Status.EXPANDED);
}
DetailUIHandler detailUIHandler = this.G;
if (detailUIHandler != null) {
detailUIHandler.k0();
this.G.release();
this.G = null;
}
AbstractMapUIController.getInstance().setIsExposureForPRC(true);
AbstractMapUIController.getInstance().setIsExposureForPDC(true);
AbstractMapUIController.getInstance().dismissPoiOfflineDialog();
AbstractMapUIController.getInstance().setIsReportWithRollbackSRP(true);
e9(true);
if (this.O != null) {
this.O = null;
}
if (this.j != null) {
this.j = null;
}
if (this.T0 != null) {
try {
getActivity().getSupportFragmentManager().beginTransaction().remove(this.T0).commitNowAllowingStateLoss();
} catch (IllegalStateException e2) {
hm4.p("DetailFragment", "remove commentsInPoiDetailFragment fail:" + e2.getMessage());
}
this.T0 = null;
this.U0 = null;
}
ez0.a.b();
jh8.T(false);
}
public void onDestroyView() {
BottomViewModel bottomViewModel;
hm4.p("DetailFragment", "detail onDestroyView");
super.onDestroyView();
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).slideOnsearch.setSupportDraggable(false);
a32.h().o();
w59.a.Y((ShareLocationCommonListen) null);
O9(true);
c5();
zu1.c();
jh8.Q(false);
if (!c06.c()) {
it3.x().p();
}
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null && ((LayoutSiteDetailBinding) viewDataBinding).dynamicRv != null) {
((LayoutSiteDetailBinding) viewDataBinding).dynamicRv.removeOnScrollListener(this.g1);
}
LayoutSiteDetailBottomBinding layoutSiteDetailBottomBinding = this.q;
if (layoutSiteDetailBottomBinding != null && this.b0 == layoutSiteDetailBottomBinding.getClickProxy()) {
this.q.setClickProxy(null);
LayoutDetailBottomMorePopWindowBinding layoutDetailBottomMorePopWindowBinding = this.r;
if (layoutDetailBottomMorePopWindowBinding != null) {
layoutDetailBottomMorePopWindowBinding.setClickProxy(null);
}
}
if (this.o0 && (bottomViewModel = this.N) != null) {
bottomViewModel.d.setValue(8);
}
if (this.K != null) {
Optional.ofNullable(MapHelper.F2().n2()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.u7((CameraPosition) obj);
}
});
}
it3.x().W(this.d1);
this.O.detailOptionsData.removeObserver(this.h1);
MapHelper.F2().X5(3);
l9(false);
a9(this.w0);
this.w0 = false;
MapHelper.F2().X5(19);
AbstractMapUIController.getInstance().setShowSiteDetailBottom(false);
ApiCommentViewModel apiCommentViewModel = this.m;
if (apiCommentViewModel != null) {
apiCommentViewModel.h().removeObserver(this.l1);
this.m.p();
}
this.c.f().removeObserver(this.j1);
this.c.g().removeObserver(this.i1);
xr4.Q().W1(false);
PopRecyclerHelper.e().l((PopRecyclerHelper.OnPopItemListener) null);
f5();
WeakNetworkRepository weakNetworkRepository = WeakNetworkRepository.INSTANCE;
String canonicalName = getClass().getCanonicalName();
Objects.requireNonNull(canonicalName);
weakNetworkRepository.removeNetworkRetryListener(canonicalName);
DetailUIHandler detailUIHandler = this.G;
if (detailUIHandler != null) {
detailUIHandler.h0();
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.v7((LayoutSiteDetailBinding) obj);
}
});
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.w7((LayoutSiteDetailBinding) obj);
}
});
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.x7((LayoutSiteDetailBinding) obj);
}
});
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.y7((LayoutSiteDetailBinding) obj);
}
});
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.z7((LayoutSiteDetailBinding) obj);
}
});
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.A7((LayoutSiteDetailBinding) obj);
}
});
}
final MapSafeWebView t = ve8.p().t();
if (t != null) {
LayoutSiteDetailBinding layoutSiteDetailBinding = (LayoutSiteDetailBinding) ((BaseFragment) this).mBinding;
Objects.requireNonNull(layoutSiteDetailBinding);
Optional.ofNullable(layoutSiteDetailBinding.searchWeb.b).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.B7(t, (MapSafeWebView) obj);
}
});
}
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((LayoutSiteDetailBinding) obj).unbind();
}
});
AbstractMapUIController.getInstance().dismissPoiPicturesPage(getActivity());
if (this.E) {
AbstractMapUIController.getInstance().releaseBadBtnListener();
}
DetailOptions detailOptions = this.K;
if (detailOptions != null && detailOptions.isFromNavComplete()) {
this.N.a.setValue((Object) null);
}
L8();
this.H0 = null;
CommentRepliesSharedViewModel commentRepliesSharedViewModel = this.S;
if (commentRepliesSharedViewModel != null) {
commentRepliesSharedViewModel.y().removeObservers(getViewLifecycleOwner());
this.S.m().removeObservers(getViewLifecycleOwner());
}
DynamicPoiCommentAdapter.d = null;
CommentRepliesSharedViewModel commentRepliesSharedViewModel2 = this.S;
if (commentRepliesSharedViewModel2 != null) {
commentRepliesSharedViewModel2.y().removeObservers(this);
this.S.h();
}
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null) {
detailViewModel.r0.removeObservers(getViewLifecycleOwner());
}
MeetkaiPlaceAdsViewModel meetkaiPlaceAdsViewModel = this.k;
if (meetkaiPlaceAdsViewModel != null) {
meetkaiPlaceAdsViewModel.b().removeObserver(this.V1);
}
CommentViewModel commentViewModel = this.X0;
if (commentViewModel != null) {
commentViewModel.a().removeObserver(this.f1);
this.X0.b();
}
tx6.g().f();
}
public void onMapClick(LatLng latLng) {
if (jh8.l && jh8.F()) {
onBackPressed();
}
if (jh8.F()) {
MapHelper.F2().d7(true);
MapHelper.F2().c7("");
xu0.i().r(true);
}
}
public void onOrientationChanged(int i2) {
CustomPopWindow customPopWindow = this.u;
if (customPopWindow != null) {
customPopWindow.o();
}
f5();
tx6.g().f();
}
public void onPause() {
super/*com.huawei.maps.businessbase.ui.BaseFragment*/.onPause();
Optional.ofNullable(this.c).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.C7((DetailViewModel) obj);
}
});
}
public void onRequestPermissionsResult(int i2, @NonNull String[] strArr, @NonNull int[] iArr) {
super/*androidx.fragment.app.Fragment*/.onRequestPermissionsResult(i2, strArr, iArr);
if (i2 == 1025) {
if (tha.d(iArr)) {
hm4.h("DetailFragment", "request permissions fail");
return;
}
if (iArr[0] == 0) {
y8a.Q("Allow");
if (this.a1) {
openPhotoActivity();
} else {
G4(false);
}
} else {
y8a.Q("Deny");
}
PermissionsUtil.j(getActivity(), iArr);
}
}
public void onResume() {
super/*com.huawei.maps.businessbase.ui.BaseFragment*/.onResume();
CollectHelper.Z(false);
ja();
DetailOptions detailOptions = this.K;
if (detailOptions != null) {
DetailReportUtil.G(detailOptions.isSearchOnly());
}
if (this.h != null && this.v0) {
DetailReportUtil.m();
}
DetailOptions detailOptions2 = this.K;
if (detailOptions2 != null && detailOptions2.isLocationMarkerClick()) {
AbstractLocationHelper.getInstance().handleLocationMarkerClick();
}
if (this.z) {
R8(true);
this.z = false;
}
if (jh8.v()) {
T3();
} else {
S3();
}
Optional.ofNullable(this.c).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.D7((DetailViewModel) obj);
}
});
DetailReportUtil.J(this.N);
if (this.B) {
this.B = false;
n4(Boolean.TRUE, false);
}
if (this.c != null) {
Optional.ofNullable((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.E7((LayoutSiteDetailBinding) obj);
}
});
}
if (!jh8.l) {
Optional.ofNullable(getView()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.G7((View) obj);
}
});
}
Z9();
}
public void onScrollFinish(MapScrollLayout.Status status) {
VMInPoiModule vMInPoiModule;
MapScrollLayout.Status status2;
super/*com.huawei.maps.businessbase.ui.BaseFragment*/.onScrollFinish(status);
DetailOptions detailOptions = this.K;
if (detailOptions != null) {
DetailReportUtil.h0(status, detailOptions.isSearchOnly());
}
if (this.d2 && this.c2 && status != (status2 = this.e2)) {
DetailReportUtil.l0(this.d0.size() == 0, f4(status2, status) ? "pullDown" : "pullUp", s4());
}
this.e2 = status;
if (status == MapScrollLayout.Status.COLLAPSED) {
this.c2 = true;
}
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
if (status != MapScrollLayout.Status.EXPANDED) {
((LayoutSiteDetailBinding) viewDataBinding).appBar.t(true, false);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).appBar.post(new o());
return;
}
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null || (vMInPoiModule = this.O) == null) {
return;
}
this.G.J(((LayoutSiteDetailBinding) viewDataBinding).dynamicRv, detailViewModel, vMInPoiModule);
}
}
public void onScrollProgressChanged(final float f3) {
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).o0(f3);
}
});
Optional.ofNullable(this.W).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.I7(f3, (DynamicCardAdapter) obj);
}
});
ve8.p().T(f3);
AbstractMapUIController.getInstance().scrollLocationButton(f3);
AbstractMapUIController.getInstance().scrollWeatherBadge(f3);
if (RouteDataManager.b().q() || RouteDataManager.b().p() || RouteDataManager.b().s() || RouteDataManager.b().r()) {
ve8.p().b();
}
}
public void onStop() {
super/*androidx.fragment.app.Fragment*/.onStop();
CustomPopWindow customPopWindow = this.v;
if (customPopWindow == null || !customPopWindow.q()) {
return;
}
this.v.o();
}
public final void p4() {
Site site = (Site) this.c.n.getValue();
if (site == null) {
return;
}
if (1 == this.C0) {
DetailViewModel detailViewModel = this.c;
detailViewModel.B.startCommentSearch((Site) detailViewModel.n.getValue(), this.B, true);
} else {
this.c.B.getAllCommentSearch(site, true);
}
y8a.p();
}
public final void p5(JsonObject jsonObject) {
this.c0 = false;
if (jsonObject != null) {
this.a0 = jsonObject.deepCopy();
}
}
public final void p6(String str) {
DynamicPoiDetailBean dynamicPoiDetailBean = this.U;
if (dynamicPoiDetailBean == null || this.V == null) {
this.V.setShowExchangeRateConversion(false);
Z4(new int[]{sb2.c}, this.U);
return;
}
if (vi2.a.a(dynamicPoiDetailBean.getSite(), PoiType.COUNTRY_POI.getPoiType())) {
String serviceCountry = ServicePermissionManager.INSTANCE.getServiceCountry();
this.V.setShowExchangeRateConversion(serviceCountry != null && "CN".equals(serviceCountry));
this.U.setConversionResult(str);
Z4(new int[]{sb2.c}, this.U);
} else {
this.V.setShowExchangeRateConversion(false);
Z4(new int[]{sb2.c}, this.U);
}
if (str.split(" ").length > 1) {
this.b1 = str.split(" ")[0];
}
}
public void p9(final Site site) {
Optional.ofNullable(site).map(new o08()).map(new p08()).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.b8(site, (String[]) obj);
}
});
}
public void poiClick(PointOfInterest pointOfInterest) {
if (MapHelper.F2().W3() && !p19.F().O0()) {
Z8();
N8();
M8();
da(d32.w(pointOfInterest));
if (!MapHelper.F2().I2()) {
xu0.i().u(MapHelper.F2().H2(), true);
}
AbstractLocationHelper.getInstance().resetLocationMarker();
}
}
public final String q4(List<PoiTicketsInfo.Ads> list) {
for (int i2 = 0; i2 < list.size(); i2++) {
if (list.get(i2).getScene().equals("poiDetail")) {
return list.get(i2).getChannel();
}
}
return "";
}
public final void q7(Site site) {
this.G.m0(site);
}
public final void q8(Site site) {
fk2.b(new a(site));
}
public final void q9(TabLayout.e eVar) {
TabLayout.TabView tabView;
if (eVar == null || (tabView = eVar.i) == null) {
return;
}
tabView.setLongClickable(false);
TooltipCompat.setTooltipText(eVar.i, (CharSequence) null);
}
public final String r4() {
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null || detailViewModel.n.getValue() == null || ((Site) this.c.n.getValue()).getAddress() == null) {
return null;
}
return ((Site) this.c.n.getValue()).getAddress().getCityId();
}
public final void r5(PoiBasicInfo poiBasicInfo, g7a g7aVar, View view) {
if (poiBasicInfo != null) {
this.p.onEvent(new DIYMapsActionEvent.b(false, poiBasicInfo, (String) g7aVar.b()));
}
}
public final void r7(Boolean bool) {
if (bool.booleanValue()) {
this.F0.e().setValue(Boolean.FALSE);
this.W.notifyDataSetChanged();
}
}
public final void r8() {
if (TextUtils.isEmpty(this.F)) {
hm4.h("DetailFragment", "url is null");
return;
}
if (o9a.d() != TextUtils.equals("dark", SafeUri.getQueryParameter(Uri.parse(this.F), "theme"))) {
if (this.F.contains("theme")) {
String str = this.F;
StringBuilder sb = new StringBuilder();
sb.append("theme=");
sb.append(o9a.d() ? "dark" : "");
this.F = str.replaceAll("(theme=[^&]*)", sb.toString());
} else {
this.F = Uri.parse(this.F).buildUpon().appendQueryParameter("theme", "dark").build().toString();
}
if (UrlUtil.isNetworkUrl(this.F)) {
Optional.ofNullable(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.b).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.f6((MapSafeWebView) obj);
}
});
}
this.r0 = true;
}
}
public final void r9(boolean z) {
if (z) {
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (viewDataBinding != null) {
ConstraintLayout.LayoutParams layoutParams = ((LayoutSiteDetailBinding) viewDataBinding).inlineH5Layout.getLayoutParams();
layoutParams.topToBottom = R$id.web_icon;
layoutParams.goneTopMargin = ct3.b(o41.c(), 20.0f);
((ViewGroup.MarginLayoutParams) layoutParams).topMargin = ct3.b(o41.c(), 8.0f);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).inlineH5Layout.setLayoutParams(layoutParams);
return;
}
return;
}
ViewDataBinding viewDataBinding2 = ((BaseFragment) this).mBinding;
if (viewDataBinding2 != null) {
ConstraintLayout.LayoutParams layoutParams2 = ((LayoutSiteDetailBinding) viewDataBinding2).inlineH5Layout.getLayoutParams();
layoutParams2.topToBottom = R$id.name_layout;
layoutParams2.goneTopMargin = ct3.b(o41.c(), 0.0f);
((ViewGroup.MarginLayoutParams) layoutParams2).topMargin = ct3.b(o41.c(), 0.0f);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).inlineH5Layout.setLayoutParams(layoutParams2);
}
}
public void refreshClick() {
m8();
}
public void resultPOIClick(Site site) {
M8();
N8();
da(d32.z(site, false));
}
public void retry() {
cz9.j(R$string.system_loading_hints);
}
public final String s4() {
Site site = (Site) this.c.n.getValue();
if (site == null) {
return null;
}
return site.getSiteId();
}
public final void s5(PoiBasicInfo poiBasicInfo, g7a g7aVar, View view) {
if (poiBasicInfo != null) {
this.p.onEvent(new DIYMapsActionEvent.b(true, poiBasicInfo, (String) g7aVar.b()));
}
}
public final void s6(CountryGuideData countryGuideData) {
MapMutableLiveData<Site> mapMutableLiveData;
DetailViewModel detailViewModel = this.c;
if (detailViewModel == null || (mapMutableLiveData = detailViewModel.n) == null) {
return;
}
AddressDetail address = ((Site) mapMutableLiveData.getValue()).getAddress();
String siteId = ((Site) this.c.n.getValue()).getSiteId();
if (address == null || siteId == null) {
return;
}
if (pa9.g((Site) this.c.n.getValue())) {
X4(countryGuideData, address.getCountryCode(), true, null);
} else {
X4(countryGuideData, null, true, siteId);
}
}
public final void s8() {
SafeBundle safeArguments = getSafeArguments();
this.o0 = safeArguments.getBoolean("web_view_to_poi_detail");
this.p0 = safeArguments.getBoolean("petal_search_to_poi_detail");
((BaseFragment) this).source = safeArguments.getString("WEB_VIEW_NEARBY_SOURCE");
if (!this.p0) {
d9(62.0f);
}
if (this.o0) {
if (safeArguments.getBoolean("load_native_to_poi_detail")) {
ve8.p().o0();
} else {
ve8.p().O(e40.B0);
}
this.c.i.setValue(8);
this.c.e.setValue(0);
ve8.p().W(false);
((BaseFragment) this).type = "petal_search_detail";
String string = safeArguments.getString("web_view_poi_detail_url");
r9(true);
if (TextUtils.isEmpty(string)) {
return;
}
if (com.huawei.maps.poi.utils.c.c0(string)) {
if (((BaseFragment) this).mBinding != null) {
this.c.e.setValue(8);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).viewClose.setVisibility(8);
}
} else if (((BaseFragment) this).mBinding != null) {
this.c.e.setValue(0);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).viewClose.setVisibility(0);
}
this.q0 = com.huawei.maps.poi.utils.c.d0(string);
WebViewData webViewData = new WebViewData();
if (TextUtils.isEmpty(this.F)) {
webViewData.setUrl(string);
} else {
webViewData.setUrl(this.F);
}
D9(webViewData, false);
this.i = false;
Optional.ofNullable(this.G).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
((DetailUIHandler) obj).N();
}
});
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).nameLayout.setVisibility(4);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.setVisibility(8);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).localSiteNameTextView.setVisibility(8);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).subtitle.setVisibility(8);
Optional.ofNullable(((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).searchWeb.b).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
DetailFragment.this.g6((MapSafeWebView) obj);
}
});
}
}
public final void s9(String str) {
if (tha.a(str)) {
return;
}
MeetkaiAdvertisementCardBean meetkaiAdvertisementCardBean = new MeetkaiAdvertisementCardBean();
meetkaiAdvertisementCardBean.setMeetkaiBannerHtml(str);
meetkaiAdvertisementCardBean.setShowMeetkaiAds(true);
this.V.setShowMeetkaiAds(true);
this.U.setMeetkaiAdvertisementCardBean(meetkaiAdvertisementCardBean);
Z4(new int[]{sb2.q}, this.U);
}
public final void t4() {
int intValue = ((Integer) Optional.ofNullable((Integer) this.c.M.getValue()).orElse(0)).intValue();
ViewDataBinding viewDataBinding = ((BaseFragment) this).mBinding;
if (((LayoutSiteDetailBinding) viewDataBinding).searchWeb.b == null || intValue == 2) {
return;
}
this.s0++;
((LayoutSiteDetailBinding) viewDataBinding).searchWeb.b.evaluateJavascript("javascript:window.sparkle.petalMap.getPOIInfo()", new ValueCallback() {
@Override
public final void onReceiveValue(Object obj) {
DetailFragment.this.O5((String) obj);
}
});
}
public final void t5(Site site) {
if (tha.a(site.getName())) {
site.setName("[Marked Location]");
}
vm1 vm1Var = vm1.a;
final PoiBasicInfo h2 = vm1Var.h(site);
final g7a v = vm1Var.v(h2);
if (!((Boolean) v.a()).booleanValue()) {
this.N.j.setValue(o41.i(o41.c(), R$drawable.ic_add_location, R$color.color_bg_normal));
this.N.k.setValue(Integer.valueOf(R$string.add));
this.q.llDirection.setAlpha(1.0f);
this.q.llDirection.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
DetailFragment.this.s5(h2, v, view);
}
});
return;
}
if (vm1Var.u() && !((Boolean) v.c()).booleanValue()) {
this.q.llDirection.setEnabled(false);
}
this.N.j.setValue(o41.i(o41.c(), R$drawable.ic_add_location, R$color.color_bg_normal));
this.N.k.setValue(Integer.valueOf(R$string.map_site_added));
this.q.llDirection.setAlpha(0.4f);
this.q.llDirection.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
DetailFragment.this.r5(h2, v, view);
}
});
}
public void t8() {
this.A = true;
savePageStatus();
}
public final void t9() {
this.N.g.setValue(8);
LayoutSiteDetailBottomBinding layoutSiteDetailBottomBinding = this.q;
if (layoutSiteDetailBottomBinding != null) {
layoutSiteDetailBottomBinding.detailBottomLayout.setVisibility(0);
}
this.N.k.setValue(Integer.valueOf(R$string.mc_edit));
this.c.u.setValue(0);
this.N.g.setValue(8);
this.N.m.setValue(0);
MapMutableLiveData<Boolean> mapMutableLiveData = this.N.w;
Boolean bool = Boolean.TRUE;
mapMutableLiveData.setValue(bool);
this.N.p.setValue(8);
this.N.o.setValue(0);
this.N.f.setValue(8);
this.K.setHideStartNav(false);
this.N.l.setValue(0);
this.N.v.setValue(bool);
this.c.i.setValue(8);
String cityCode = this.c.C.getCityCode();
if (cityCode == null) {
cityCode = r4();
}
boolean j2 = tx6.g().j(cityCode);
this.N.t.setValue(Integer.valueOf(j2 ? 0 : 8));
U3(j2);
}
public final String u4() {
DynamicPoiDetailBean dynamicPoiDetailBean = this.U;
return (dynamicPoiDetailBean == null || dynamicPoiDetailBean.getSiteJson() == null || this.U.getSiteJson().get("pageId") == null) ? "" : this.U.getSiteJson().get("pageId").getAsString();
}
public final void u5(ap0 ap0Var) {
if (ap0Var == null) {
hm4.h("DetailFragment", "msg:check Result == null");
} else if (ap0Var.a()) {
com.huawei.maps.app.common.utils.task.a.f(new g(), 500L);
} else {
m5.j(ap0Var);
}
}
public final void u6(Boolean bool) {
if (bool.booleanValue()) {
W8();
}
}
public final void u7(CameraPosition cameraPosition) {
this.K.setMapZoom(cameraPosition.zoom);
this.K.needMoveCamera(true);
}
public final void u9(Site site) {
this.V.setShowMeetkaiAds(false);
List<HotelSourceId> sourceIds = site.getSourceIds();
if (tha.b(sourceIds)) {
return;
}
for (HotelSourceId hotelSourceId : sourceIds) {
if (Objects.equals(hotelSourceId.getId(), "MEETKAI")) {
String code = hotelSourceId.getCode();
if (!tha.a(code)) {
this.k.c(code);
return;
}
}
}
}
public final Coordinate v4(Site site, McConstant.McPoiOperationType mcPoiOperationType) {
if (mcPoiOperationType == McConstant.McPoiOperationType.MODIFY && site != null && site.getLocation() != null) {
return site.getLocation();
}
if (this.K.getLatLng() != null) {
return com.huawei.maps.poi.utils.c.w(this.K.getLatLng());
}
CameraPosition n2 = MapHelper.F2().n2();
if (n2 == null) {
return null;
}
LatLng latLng = n2.target;
return new Coordinate(latLng.latitude, latLng.longitude);
}
public final void v6(Site site) {
hm4.p("DetailFragment", "mIsShowOverviewTabObserver:" + site);
if (this.K0 == null) {
return;
}
TabLayout.e eVar = this.L0;
if (eVar != null && eVar.h() != -1) {
this.K0.G(this.L0.h());
}
if (site != null) {
if (pa9.c(site.getPoi())) {
this.L0 = this.K0.A().v(getString(R$string.tab_about)).t("overview");
} else {
this.L0 = this.K0.A().v(getString(R$string.tab_overall)).t("overview");
}
q9(this.L0);
this.K0.f(this.L0, 0, true);
}
}
public final void v7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.G.l0(layoutSiteDetailBinding.dynamicRv);
}
public void v9() {
this.c.Q.setValue(Boolean.TRUE);
this.c.O.setValue(Boolean.FALSE);
M3(false);
((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).noNetworkLayout.noNetworkButton.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
DetailFragment.this.c8(view);
}
});
}
public final List<Site> w4(List<Site> list) {
Site site;
if (list == null) {
return null;
}
ArrayList arrayList = new ArrayList();
for (Site site2 : list) {
if (site2 != null && site2.getBusSubway() != null && site2.getBusSubway().getBusTransportLines() != null && site2.getBusSubway().getBusTransportLines().size() != 0 && (site = (Site) this.c.n.getValue()) != null && site.getSiteId() != null && !site.getSiteId().equals(site2.getSiteId())) {
site2.getBusSubway().setBusTransportLines(c4(site2.getBusSubway().getBusTransportLines()));
arrayList.add(site2);
}
}
return arrayList;
}
public final void w6(Boolean bool) {
int i2;
int h2;
hm4.p("DetailFragment", "mIsShowReviewTabObserver:" + bool);
if (!bool.booleanValue() || this.K0 == null) {
return;
}
TabLayout.e eVar = this.P0;
if (eVar != null && eVar.h() != -1) {
hm4.f("DetailFragment", "tabReviews already exist:" + this.P0.h());
return;
}
TabLayout.e eVar2 = this.N0;
if (eVar2 == null || eVar2.h() == -1) {
TabLayout.e eVar3 = this.M0;
if (eVar3 == null || eVar3.h() == -1) {
TabLayout.e eVar4 = this.L0;
if (eVar4 == null || eVar4.h() == -1) {
i2 = 0;
TabLayout.e t = this.K0.A().v(getString(R$string.tab_review)).t("review");
this.P0 = t;
q9(t);
this.K0.f(this.P0, i2, false);
}
h2 = this.L0.h();
} else {
h2 = this.M0.h();
}
} else {
h2 = this.N0.h();
}
i2 = h2 + 1;
TabLayout.e t2 = this.K0.A().v(getString(R$string.tab_review)).t("review");
this.P0 = t2;
q9(t2);
this.K0.f(this.P0, i2, false);
}
public final void w7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.G.l0(layoutSiteDetailBinding.tvSiteName);
}
public final void w9(Site site) {
if (site == null) {
return;
}
if (k.I4(site)) {
AbstractMapUIController.getInstance().setIsCheckPoiOffline(false);
return;
}
if (TextUtils.equals("[Marked Location]", site.getName())) {
return;
}
if (!AbstractMapUIController.getInstance().isCheckPoiOffline()) {
cz9.p(o41.f(R$string.site_change_tips));
return;
}
final Records records = site.getRecords();
if (records == null) {
return;
}
AbstractMapUIController.getInstance().setIsCheckPoiOffline(false);
AbstractMapUIController.getInstance().showPoiOfflineDialog(new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
DetailFragment.this.d8(records, dialogInterface, i2);
}
});
}
public final void x4(@NonNull th1 th1Var) {
SafeBundle safeBundle = new SafeBundle();
CommentDataInfo a2 = th1Var.a();
if (a2 != null) {
fz0.a();
String nickName = a2.getNickName();
String commentID = a2.getCommentID();
this.S.Q(th1Var);
safeBundle.putParcelable("MODEL_KEY", new CommentReplyInputModel(nickName, commentID, (ChildCommentItem) null, getString(R$string.comment_reply_send), getString(R$string.comment_reply), a2.getSrc()));
try {
nav().navigate(R$id.detailsToCommentInput, safeBundle.getBundle());
} catch (Exception unused) {
hm4.h(getTag(), "Navigation error for comment reply input.");
}
}
}
public final void x6(Boolean bool) {
hm4.p("DetailFragment", "mIsShowToolTabObserver:" + bool);
if (!bool.booleanValue() || this.K0 == null) {
return;
}
TabLayout.e eVar = this.M0;
if (eVar != null && eVar.h() != -1) {
hm4.f("DetailFragment", "tabTools already exist:" + this.M0.h());
return;
}
TabLayout.e eVar2 = this.L0;
int h2 = (eVar2 == null || eVar2.h() == -1) ? 0 : this.L0.h() + 1;
TabLayout.e t = this.K0.A().v(getString(R$string.tab_tool)).t("tool");
this.M0 = t;
q9(t);
this.K0.f(this.M0, h2, false);
}
public final void x7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.G.l0(layoutSiteDetailBinding.localSiteNameTextView);
}
public final void x8(String str) {
y8a.I(str);
this.a1 = true;
PermissionsUtil.u(this, new PermissionsUtil.RequestCallback() {
public final void success() {
DetailFragment.this.openPhotoActivity();
}
});
}
public final void x9(String str) {
if (this.N == null || this.q == null) {
hm4.p("DetailFragment", "icon bottomVm or bottomBing is null!");
return;
}
boolean b2 = p79.b("petal_travels_toast_has_show", false, o41.c());
boolean j2 = tx6.g().j(str);
this.N.t.setValue(Integer.valueOf(j2 ? 0 : 8));
U3(j2);
if (b2 || !j2) {
return;
}
this.q.ivPetalTravels.post(new f());
}
public final void y4(HashMap<String, Integer> hashMap) {
y8a.p();
SafeBundle safeBundle = new SafeBundle();
safeBundle.putParcelable("site", (Parcelable) this.c.n.getValue());
safeBundle.putSerializable("KEY_AVATARS", hashMap);
r26.a.a(this, R$id.detail_to_review_list, safeBundle.getBundle());
t8();
}
public final Void y5(Object obj) {
if (obj instanceof Site) {
this.c.f().setValue((Object) null);
this.c.g().setValue((Object) null);
this.c.f().removeObserver(this.j1);
this.c.g().removeObserver(this.i1);
Site site = (Site) obj;
Site site2 = (Site) this.c.n.getValue();
this.j0 = site2;
Q3(site2, site);
Coordinate location = site.getLocation();
LatLng latLng = qc6.c(location) ? new LatLng(location.getLat(), location.getLng()) : MapHelper.F2().O2();
PointOfInterest pointOfInterest = new PointOfInterest(latLng, site.getSiteId(), site.getName(), (String) null, "", "", (String) null);
this.K.site(site);
this.K.pointOfInterest(pointOfInterest);
this.h1.onChanged(this.K);
this.d0.push(this.K);
e9(this.d0.size() == 0);
da(d32.t(site));
MapHelper.F2().v8(site);
ea();
this.K.needMoveCamera(false);
this.K.showCenter(false);
CameraPosition.builder().target(latLng).build();
}
return null;
}
public final void y6(java.lang.Boolean r4) {
throw new UnsupportedOperationException("Method not decompiled: com.huawei.maps.poi.ui.DetailFragment.y6(java.lang.Boolean):void");
}
public final void y7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.G.l0(layoutSiteDetailBinding.subtabLayout);
}
public void y8() {
if (ct3.A(getActivity()) == ScreenDisplayStatus.NORMAL_AND_LANDSCAPE || ct3.A(getActivity()) == ScreenDisplayStatus.NORMAL_AND_PORTRAIT) {
return;
}
n8(true);
}
public final void y9() {
int y;
int u;
LayoutSiteDetailBottomBinding layoutSiteDetailBottomBinding = this.q;
if (layoutSiteDetailBottomBinding == null) {
hm4.p("DetailFragment", "toast bottomBinding is null!");
return;
}
MapImageView mapImageView = layoutSiteDetailBottomBinding.ivPetalTravels;
int[] iArr = new int[2];
mapImageView.getLocationInWindow(iArr);
int i2 = iArr[0];
int i3 = iArr[1];
hm4.p("DetailFragment", "showPetalTravelsToast locationX = " + i2 + ", locationY = " + i3);
if (i3 == 0 || i2 == 0) {
return;
}
if (getActivity() != null) {
u = getActivity().getWindow().getDecorView().getHeight();
y = getActivity().getWindow().getDecorView().getWidth();
} else {
y = ct3.y(o41.c());
u = ct3.u();
}
final int width = (y - i2) - (mapImageView.getWidth() / 2);
final int i4 = u - i3;
if (getActivity() == null || getActivity().isDestroyed() || getActivity().isFinishing()) {
return;
}
ct3.B(getActivity());
this.q.getRoot().post(new Runnable() {
@Override
public final void run() {
DetailFragment.this.e8(width, i4);
}
});
p79.g("petal_travels_toast_has_show", true, o41.c());
}
public final void z4(@NonNull th1 th1Var, Integer num) {
this.S.Q(th1Var);
SafeBundle safeBundle = new SafeBundle();
CommentDataInfo a2 = th1Var.a();
if (a2 != null) {
safeBundle.putParcelable("MAIN_COMMENT_KEY", a2);
safeBundle.putBoolean("IS_SELF_COMMENT", th1Var.b());
safeBundle.putString("POI_NAME", ((LayoutSiteDetailBinding) ((BaseFragment) this).mBinding).tvSiteName.getText().toString());
DetailViewModel detailViewModel = this.c;
if (detailViewModel != null) {
safeBundle.putParcelable("SITE_KEY", (Parcelable) detailViewModel.n.getValue());
}
if (num != null) {
safeBundle.putInt("CLICKED_REPLY_POSITION", num.intValue());
}
}
t8();
try {
nav().navigate(R$id.detailsToCommentReplies, safeBundle.getBundle());
} catch (Exception unused) {
hm4.h(getTag(), "Navigation error for comment replies fragment.");
}
}
public final Void z5(Object obj) {
this.c.B.startDetailSearch(new Site());
return null;
}
public final void z6(Boolean bool) {
int i2;
int h2;
hm4.p("DetailFragment", "isShowNearbyTabObserver:" + bool);
if (!bool.booleanValue() || this.K0 == null) {
return;
}
TabLayout.e eVar = this.O0;
if (eVar != null && eVar.h() != -1) {
hm4.p("DetailFragment", "tabNearbyFeed already exist:" + this.O0.h());
return;
}
TabLayout.e eVar2 = this.P0;
if (eVar2 == null || eVar2.h() == -1) {
TabLayout.e eVar3 = this.N0;
if (eVar3 == null || eVar3.h() == -1) {
TabLayout.e eVar4 = this.M0;
if (eVar4 == null || eVar4.h() == -1) {
TabLayout.e eVar5 = this.L0;
if (eVar5 == null || eVar5.h() == -1) {
i2 = 0;
TabLayout.e t = this.K0.A().v(getString(R$string.tab_nearby)).t("nearby");
this.O0 = t;
q9(t);
this.K0.f(this.O0, i2, false);
}
h2 = this.L0.h();
} else {
h2 = this.M0.h();
}
} else {
h2 = this.N0.h();
}
} else {
h2 = this.P0.h();
}
i2 = h2 + 1;
TabLayout.e t2 = this.K0.A().v(getString(R$string.tab_nearby)).t("nearby");
this.O0 = t2;
q9(t2);
this.K0.f(this.O0, i2, false);
}
public final void z7(LayoutSiteDetailBinding layoutSiteDetailBinding) {
this.G.j0(layoutSiteDetailBinding);
}
public class i implements TabLayout.OnTabSelectedListener {
public i() {
}
public void onTabReselected(TabLayout.e eVar) {
String str = (String) eVar.j();
DetailFragment detailFragment = DetailFragment.this;
detailFragment.H9(str, ((LayoutSiteDetailBinding) ((BaseFragment) detailFragment).mBinding).dynamicRv);
}
public void onTabSelected(TabLayout.e eVar) {
if (!DetailFragment.this.c1) {
DetailFragment.this.c1 = true;
return;
}
String str = (String) eVar.j();
DetailFragment detailFragment = DetailFragment.this;
detailFragment.H9(str, ((LayoutSiteDetailBinding) ((BaseFragment) detailFragment).mBinding).dynamicRv);
}
public void onTabUnselected(TabLayout.e eVar) {
}
}
public static void Q5(Account account) {
}
public static void m7(Exception exc) {
}
public class k implements MediaProgressCallback {
public k() {
}
@Override
public void onFail() {
}
@Override
public void onSuccess(MediaItem mediaItem, int i) {
}
}
}