导航菜单

页面标题

页面副标题

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

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

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


package com.olxgroup.panamera.app.users.profile.fragments;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.constraintlayout.helper.widget.Layer;
import androidx.constraintlayout.widget.Group;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.naspers.ragnarok.communication.blockUser.a;
import com.naspers.ragnarok.data.R;
import com.olx.southasia.databinding.ua;
import com.olxgroup.panamera.app.buyers.adDetails.ReportDialog;
import com.olxgroup.panamera.app.buyers.listings.views.VasBadgeListingBottomSheet;
import com.olxgroup.panamera.app.common.utils.g1;
import com.olxgroup.panamera.app.common.utils.h1;
import com.olxgroup.panamera.app.common.utils.k1;
import com.olxgroup.panamera.app.common.utils.o1;
import com.olxgroup.panamera.app.users.auth.activities.LoginActivity;
import com.olxgroup.panamera.app.users.profile.viewModels.OtherProfileViewModel;
import com.olxgroup.panamera.app.users.profile.viewModels.c;
import com.olxgroup.panamera.app.users.profile.viewModels.d;
import com.olxgroup.panamera.app.users.profile.viewModels.e;
import com.olxgroup.panamera.data.common.Constants;
import com.olxgroup.panamera.data.common.utils.IntentFactory;
import com.olxgroup.panamera.domain.buyers.common.entity.BundleActionListener;
import com.olxgroup.panamera.domain.buyers.common.entity.WidgetActionListener;
import com.olxgroup.panamera.domain.buyers.common.repository.BuyersABTestRepository;
import com.olxgroup.panamera.domain.buyers.filter.entity.VisualizationMode;
import com.olxgroup.panamera.domain.buyers.listings.entity.SearchExperienceFeed;
import com.olxgroup.panamera.domain.buyers.listings.repository.RecentViewRepository;
import com.olxgroup.panamera.domain.common.infrastruture.repository.SelectedMarket;
import com.olxgroup.panamera.domain.monetization.utils.AdvertisingExtentionKt;
import com.olxgroup.panamera.domain.users.common.entity.Badge;
import com.olxgroup.panamera.domain.users.common.entity.Categories;
import com.olxgroup.panamera.domain.users.common.entity.Dealer;
import com.olxgroup.panamera.domain.users.common.entity.MutualFriends;
import com.olxgroup.panamera.domain.users.common.entity.OperatingDetail;
import com.olxgroup.panamera.domain.users.common.entity.ProfileData;
import com.olxgroup.panamera.domain.users.common.entity.ShowroomAddress;
import com.olxgroup.panamera.domain.users.common.entity.User;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import kotlin.Function;
import kotlin.Metadata;
import kotlin.Triple;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.FunctionAdapter;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.jvm.internal.StringCompanionObject;
import olx.com.delorean.dialog.BlockUnBlockUserDialog;
import olx.com.delorean.dialog.u;
import olx.com.delorean.domain.utils.DateUtils;
import olx.com.delorean.domain.utils.EventWrapper;

@Metadata
@SourceDebugExtension
public final class OtherProfileFragmentV2 extends Hilt_OtherProfileFragmentV2<ua> implements WidgetActionListener, BundleActionListener, com.olxgroup.panamera.app.buyers.common.viewHolders.i0, View.OnClickListener, BlockUnBlockUserDialog.a, a.c {
    public com.olxgroup.panamera.app.common.helpers.p K0;
    public com.olxgroup.panamera.app.buyers.common.usecases.a L0;
    public SelectedMarket M0;
    public RecentViewRepository N0;
    private OtherProfileViewModel O0;
    private com.naspers.ragnarok.communication.blockUser.a P0;
    private com.olxgroup.panamera.app.buyers.listings.viewModels.c Q0;
    private com.olxgroup.panamera.app.buyers.common.adapters.l R0;
    private boolean T0;
    private MenuItem U0;
    private boolean V0;
    private final String S0 = ", ";
    private final Observer W0 = new Observer() {
        public final void onChanged(Object obj) {
            OtherProfileFragmentV2.f6(OtherProfileFragmentV2.this, (EventWrapper) obj);
        }
    };
    private final Observer X0 = new Observer() {
        public final void onChanged(Object obj) {
            OtherProfileFragmentV2.e6(OtherProfileFragmentV2.this, (com.olxgroup.panamera.app.users.profile.viewModels.c) obj);
        }
    };

    public final class a extends RecyclerView.s {
        public a() {
        }

        public synchronized void onScrolled(RecyclerView recyclerView, int i, int i2) {
            super.onScrolled(recyclerView, i, i2);
            OtherProfileViewModel otherProfileViewModel = OtherProfileFragmentV2.this.O0;
            if (otherProfileViewModel == null) {
                otherProfileViewModel = null;
            }
            otherProfileViewModel.z1(new d.h(OtherProfileFragmentV2.this.w5().f(), OtherProfileFragmentV2.this.w5().c()));
        }
    }

    public class b {
        public static final int[] $EnumSwitchMapping$0;

        static {
            int[] iArr = new int[WidgetActionListener.Type.values().length];
            try {
                iArr[WidgetActionListener.Type.AD_DETAILS.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[WidgetActionListener.Type.FAVOURITE_AD.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[WidgetActionListener.Type.OPEN_VERIFIED_SHEET.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[WidgetActionListener.Type.OPEN_INSPECTED_SHEET.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[WidgetActionListener.Type.VAS_STRIP_CLICKED.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            $EnumSwitchMapping$0 = iArr;
        }
    }

    public static final class c implements androidx.core.view.c0 {
        c() {
        }

        public void a(Menu menu, MenuInflater menuInflater) {
            String userIdFromIntent;
            if (OtherProfileFragmentV2.this.V0) {
                return;
            }
            menuInflater.inflate(com.olx.southasia.l.menu_profile, menu);
            com.olxgroup.panamera.app.users.profile.utils.c.a(OtherProfileFragmentV2.this.getNavigationActivity().M2(), com.olxgroup.panamera.app.users.profile.utils.c.b(menu), com.olx.southasia.e.toolbar_text);
            OtherProfileFragmentV2.this.U0 = menu.findItem(com.olx.southasia.i.menu_block);
            User userFromIntent = OtherProfileFragmentV2.this.getUserFromIntent();
            if (userFromIntent == null || (userIdFromIntent = userFromIntent.getId()) == null) {
                userIdFromIntent = OtherProfileFragmentV2.this.getUserIdFromIntent();
            }
            if (userIdFromIntent != null) {
                OtherProfileFragmentV2 otherProfileFragmentV2 = OtherProfileFragmentV2.this;
                otherProfileFragmentV2.P0 = new com.naspers.ragnarok.communication.blockUser.a(otherProfileFragmentV2.getLifecycle(), userIdFromIntent, otherProfileFragmentV2);
            }
            OtherProfileFragmentV2.this.V0 = true;
        }

        public void b(Menu menu) {
            androidx.core.view.b0.a(this, menu);
        }

        public void c(Menu menu) {
            androidx.core.view.b0.b(this, menu);
        }

        public boolean d(MenuItem menuItem) {
            int itemId = menuItem.getItemId();
            if (itemId == com.olx.southasia.i.menu_report) {
                OtherProfileViewModel otherProfileViewModel = OtherProfileFragmentV2.this.O0;
                (otherProfileViewModel != null ? otherProfileViewModel : null).z1(d.l.a);
                return true;
            }
            if (itemId == com.olx.southasia.i.menu_share) {
                OtherProfileViewModel otherProfileViewModel2 = OtherProfileFragmentV2.this.O0;
                (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).z1(d.m.a);
                return true;
            }
            if (itemId != com.olx.southasia.i.menu_block) {
                return false;
            }
            OtherProfileViewModel otherProfileViewModel3 = OtherProfileFragmentV2.this.O0;
            (otherProfileViewModel3 != null ? otherProfileViewModel3 : null).z1(d.b.a);
            return true;
        }
    }

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

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

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

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

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

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

    private final void A5() {
        getBinding().K.setOnClickListener(this);
        getBinding().h0.setOnClickListener(this);
        getBinding().N.setOnClickListener(this);
        getBinding().Q.setOnClickListener(this);
        getBinding().V.setOnClickListener(this);
        getBinding().a0.setOnClickListener(this);
    }

    private final void B5() {
        com.olxgroup.panamera.app.buyers.common.adapters.l t5 = t5();
        this.R0 = t5;
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        boolean o1 = otherProfileViewModel.o1();
        OtherProfileViewModel otherProfileViewModel2 = this.O0;
        if (otherProfileViewModel2 == null) {
            otherProfileViewModel2 = null;
        }
        t5.l0(o1, otherProfileViewModel2.G1());
        com.olxgroup.panamera.app.buyers.common.adapters.l lVar = this.R0;
        OtherProfileViewModel otherProfileViewModel3 = this.O0;
        lVar.j0((otherProfileViewModel3 != null ? otherProfileViewModel3 : null).n1());
        this.R0.t0("listing_page");
        this.R0.i0(this);
        this.R0.m0(this);
    }

    private final void C5() {
        B5();
    }

    public static final Unit D5(OtherProfileFragmentV2 otherProfileFragmentV2, Triple triple) {
        otherProfileFragmentV2.b6(triple != null ? (String) triple.e() : null);
        return Unit.a;
    }

    private final void E5(String str, String str2) {
        startActivity(olx.com.delorean.a.Q(str, str2));
    }

    private final void F5(User user) {
        Context context;
        if (user.getShowroomAddress() == null || (context = getContext()) == null) {
            return;
        }
        context.startActivity(IntentFactory.getLocationIntent(Double.valueOf(user.getShowroomAddress().getLatitude()), Double.valueOf(user.getShowroomAddress().getLongitude())));
    }

    private final void G5(VasBadgeListingBottomSheet.b bVar) {
        VasBadgeListingBottomSheet.R0.a(bVar).show(getChildFragmentManager().s(), "FilterBottomSheetDialog");
    }

    private final void H5(com.olxgroup.panamera.app.users.profile.viewModels.c cVar) {
        if (cVar instanceof c.n) {
            Q5(((c.n) cVar).a());
            return;
        }
        if (cVar instanceof c.C0041c) {
            L5(((c.C0041c) cVar).a());
            return;
        }
        if (cVar instanceof c.d) {
            M5(((c.d) cVar).a());
            return;
        }
        if (cVar instanceof c.p) {
            c.p pVar = (c.p) cVar;
            shareProfile(pVar.a(), pVar.b());
            return;
        }
        if (cVar instanceof c.a) {
            r5(((c.a) cVar).a());
            return;
        }
        if (cVar instanceof c.k) {
            openLogin(((c.k) cVar).a());
            return;
        }
        if (cVar instanceof c.o) {
            showReportUserDialog(((c.o) cVar).a());
            return;
        }
        if (cVar instanceof c.q) {
            c.q qVar = (c.q) cVar;
            showConfirmUnFollowDialog(qVar.b(), qVar.a());
            return;
        }
        if (cVar instanceof c.s) {
            Y5(true);
            return;
        }
        if (cVar instanceof c.u) {
            Y5(false);
            return;
        }
        if (cVar instanceof c.y) {
            updateFollowCounter(((c.y) cVar).a());
            return;
        }
        if (cVar instanceof c.l) {
            openMyProfile();
            return;
        }
        if (cVar instanceof c.t) {
            c.t tVar = (c.t) cVar;
            openMutualFriendsList(tVar.b(), tVar.a());
            return;
        }
        if (cVar instanceof c.w) {
            openPosting();
            return;
        }
        if (cVar instanceof c.e) {
            showInternetToastMsg();
            return;
        }
        if (cVar instanceof c.x) {
            c.x xVar = (c.x) cVar;
            d6(xVar.a(), xVar.b());
            return;
        }
        if (cVar instanceof c.z) {
            updateList(((c.z) cVar).a());
            return;
        }
        if (cVar instanceof c.m) {
            G5(((c.m) cVar).a());
            return;
        }
        if (cVar instanceof c.v) {
            startActivity(((c.v) cVar).a());
            return;
        }
        if (cVar instanceof c.g) {
            c.g gVar = (c.g) cVar;
            openFollowersList(gVar.a(), gVar.b());
            return;
        }
        if (cVar instanceof c.h) {
            c.h hVar = (c.h) cVar;
            E5(hVar.a(), hVar.b());
            return;
        }
        if (cVar instanceof c.i) {
            openImageFullScreen(((c.i) cVar).a());
            return;
        }
        if (cVar instanceof c.r) {
            Z5(((c.r) cVar).a());
        } else if (cVar instanceof c.j) {
            F5(((c.j) cVar).a());
        } else if (cVar instanceof c.a0) {
            y5();
        }
    }

    private final void I5(com.olxgroup.panamera.app.users.profile.viewModels.e eVar) {
        if (eVar instanceof e.a) {
            showEmptyState();
            return;
        }
        if (eVar instanceof e.b) {
            showLoading();
        } else if (eVar instanceof e.c) {
            e.c cVar = (e.c) eVar;
            S5(cVar.b(), cVar.c());
        }
    }

    private final void J5(boolean z) {
        com.olxgroup.panamera.app.common.utils.v.c(getBinding().Y, !z);
        com.olxgroup.panamera.app.common.utils.v.c(getBinding().X, z);
    }

    private final void K5(String str, boolean z) {
        getBinding().E.setVisibility((str == null || str.length() == 0 || z) ? 4 : 0);
        getBinding().D.setText(str);
    }

    private final void L5(long j) {
        getBinding().M.setText(String.valueOf(j));
    }

    private final void M5(long j) {
        getBinding().P.setText(String.valueOf(j));
    }

    private final void N5(ShowroomAddress showroomAddress) {
        List n;
        String q0;
        Layer layer = getBinding().a0;
        List<OperatingDetail> operatingDetails = showroomAddress != null ? showroomAddress.getOperatingDetails() : null;
        layer.setVisibility((operatingDetails == null || operatingDetails.isEmpty()) ? 8 : 0);
        if (showroomAddress != null) {
            n = kotlin.collections.h.n(showroomAddress.getAddressLine1(), showroomAddress.getAddressLine2(), showroomAddress.getLandmark(), showroomAddress.getLocality(), showroomAddress.getCity(), showroomAddress.getState(), showroomAddress.getPincode());
            ArrayList arrayList = new ArrayList();
            for (Object obj : n) {
                String str = (String) obj;
                if (!(str == null || str.length() == 0)) {
                    arrayList.add(obj);
                }
            }
            TextView textView = getBinding().d0;
            q0 = CollectionsKt___CollectionsKt.q0(arrayList, this.S0, null, null, 0, null, null, 62, null);
            textView.setText(q0);
        }
    }

    private final void O5(String str) {
        com.olxgroup.panamera.app.common.repositoryImpl.e.a.d().g(str, getBinding().B, com.olxgroup.panamera.app.common.utils.f0.q(com.olx.southasia.g.pic_avatar_1));
    }

    private final void P5() {
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        otherProfileViewModel.t0().observe(this, this.W0);
        OtherProfileViewModel otherProfileViewModel2 = this.O0;
        (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).s0().observe(this, this.X0);
    }

    private final void Q5(ProfileData profileData) {
        if (profileData != null) {
            if (profileData.getBannedUser()) {
                y5();
            }
            showMemberSince(DateUtils.getCreationDate(profileData.getCreationDate()));
            Y5(profileData.getShowFollowUnfollow());
            setName(profileData.getName());
            setUserVerify(profileData.getBadges());
            OtherProfileViewModel otherProfileViewModel = this.O0;
            if (otherProfileViewModel == null) {
                otherProfileViewModel = null;
            }
            J5(otherProfileViewModel.l1(profileData.getDealerType()));
            String bio = profileData.getBio();
            OtherProfileViewModel otherProfileViewModel2 = this.O0;
            if (otherProfileViewModel2 == null) {
                otherProfileViewModel2 = null;
            }
            K5(bio, otherProfileViewModel2.l1(profileData.getDealerType()));
            W5(profileData.getDealerType(), profileData.getImage(), profileData.getDefaultImageUserId());
            OtherProfileViewModel otherProfileViewModel3 = this.O0;
            if ((otherProfileViewModel3 != null ? otherProfileViewModel3 : null).l1(profileData.getDealerType())) {
                N5(profileData.getShowroomAddress());
                U5(profileData.getShowroomAddress());
                T5(profileData.getShowroomAddress(), profileData.getName());
            }
        }
    }

    private final void S5(SearchExperienceFeed searchExperienceFeed, VisualizationMode visualizationMode) {
        hideLoading();
        z5();
        if (getBinding().W.getAdapter() == null || this.R0 == null) {
            B5();
            getBinding().W.setLayoutManager(new StaggeredGridLayoutManager(2, 1));
            getBinding().W.addOnScrollListener(new a());
            R5(com.olxgroup.panamera.app.common.helpers.p.b(getBinding().W));
            this.R0.w0(visualizationMode);
            com.olxgroup.panamera.app.buyers.common.adapters.l lVar = this.R0;
            OtherProfileViewModel otherProfileViewModel = this.O0;
            if (otherProfileViewModel == null) {
                otherProfileViewModel = null;
            }
            lVar.I0(otherProfileViewModel.d1());
            this.R0.s0(searchExperienceFeed.getAds());
            this.R0.g0(this);
            getBinding().W.setAdapter(this.R0);
        } else {
            s5(visualizationMode, false);
            this.R0.s0(searchExperienceFeed.getAds());
        }
        OtherProfileViewModel otherProfileViewModel2 = this.O0;
        (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).E1(false);
    }

    private final void T5(ShowroomAddress showroomAddress, String str) {
        String city;
        getBinding().e0.setVisibility((showroomAddress == null && (str == null || str.length() == 0)) ? 8 : 0);
        String str2 = "";
        if (str == null || str.length() == 0) {
            str = "";
        }
        if (showroomAddress != null && (city = showroomAddress.getCity()) != null && city.length() != 0) {
            str2 = showroomAddress.getCity() + ",";
        }
        getBinding().e0.setText(str2 + str);
    }

    private final void U5(ShowroomAddress showroomAddress) {
        Group group = getBinding().c0;
        List<OperatingDetail> operatingDetails = showroomAddress != null ? showroomAddress.getOperatingDetails() : null;
        group.setVisibility((operatingDetails == null || operatingDetails.isEmpty()) ? 8 : 0);
        if (showroomAddress != null) {
            TextView textView = getBinding().g0;
            OtherProfileViewModel otherProfileViewModel = this.O0;
            if (otherProfileViewModel == null) {
                otherProfileViewModel = null;
            }
            textView.setText(otherProfileViewModel.e1(showroomAddress.getOperatingDetails()));
            TextView textView2 = getBinding().f0;
            OtherProfileViewModel otherProfileViewModel2 = this.O0;
            textView2.setText((otherProfileViewModel2 != null ? otherProfileViewModel2 : null).a1(showroomAddress.getOperatingDetails()));
        }
    }

    private final void V5(String str) {
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        boolean k1 = otherProfileViewModel.k1(str);
        OtherProfileViewModel otherProfileViewModel2 = this.O0;
        u5().a(requireActivity(), k1, (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).r1(str));
    }

    private final void W5(Dealer dealer, String str, String str2) {
        Categories dealerWithIcon = dealer != null ? dealer.getDealerWithIcon() : null;
        if (dealerWithIcon == null) {
            setImage(str);
            showDefaultImage(str2);
        } else {
            setImage(str);
            O5(dealerWithIcon.getIconUrl());
            showDefaultImage(str2);
        }
    }

    public static final void X5(OtherProfileFragmentV2 otherProfileFragmentV2, String str, String str2, DialogInterface dialogInterface, int i) {
        otherProfileFragmentV2.a6(str);
        OtherProfileViewModel otherProfileViewModel = otherProfileFragmentV2.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        otherProfileViewModel.z1(new d.c(str2, otherProfileFragmentV2.getCurrentFollowerCounter()));
    }

    private final void Y5(boolean z) {
        if (z) {
            getBinding().K.setVisibility(0);
            getBinding().h0.setVisibility(8);
        } else {
            getBinding().K.setVisibility(8);
            getBinding().h0.setVisibility(0);
        }
    }

    private final void Z5(String str) {
        h1.d(getBinding().H, getString(com.olx.southasia.p.start_following, new Object[]{str}), -1);
    }

    private final void a6(String str) {
        h1.d(getBinding().H, getString(com.olx.southasia.p.start_unfollowed, new Object[]{str}), -1);
    }

    private final void b6(String str) {
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        otherProfileViewModel.z1(new d.C0042d(str));
    }

    private final void c6() {
        MenuItem menuItem = this.U0;
        if (menuItem == null) {
            menuItem = null;
        }
        OtherProfileViewModel otherProfileViewModel = this.O0;
        boolean isUserLogged = (otherProfileViewModel != null ? otherProfileViewModel : null).isUserLogged();
        if (isUserLogged) {
            menuItem.setTitle(this.T0 ? R.string.ragnarok_unblock_user : R.string.ragnarok_block_user);
        }
        menuItem.setVisible(isUserLogged);
    }

    private final void d6(boolean z, int i) {
        com.olxgroup.panamera.app.buyers.common.adapters.l lVar;
        com.olxgroup.panamera.app.buyers.common.adapters.l lVar2 = this.R0;
        if (i < (lVar2 != null ? Integer.valueOf(lVar2.getItemCount()) : null).intValue() && (lVar = this.R0) != null) {
            lVar.notifyItemChanged(i);
        }
        com.olxgroup.panamera.app.buyers.listings.viewModels.c cVar = this.Q0;
        (cVar != null ? cVar : null).H0(z);
    }

    public static final void e6(OtherProfileFragmentV2 otherProfileFragmentV2, com.olxgroup.panamera.app.users.profile.viewModels.c cVar) {
        otherProfileFragmentV2.H5(cVar);
    }

    public static final void f6(OtherProfileFragmentV2 otherProfileFragmentV2, EventWrapper eventWrapper) {
        com.olxgroup.panamera.app.users.profile.viewModels.e eVar = (com.olxgroup.panamera.app.users.profile.viewModels.e) eventWrapper.getContentIfNotHandled();
        if (eVar == null) {
            return;
        }
        otherProfileFragmentV2.I5(eVar);
    }

    private final int getCurrentFollowerCounter() {
        return Integer.parseInt(getBinding().M.getText().toString());
    }

    public final User getUserFromIntent() {
        return Build.VERSION.SDK_INT >= 33 ? (User) com.naspers.ragnarok.universal.ui.ui.message.activity.a.a(getNavigationActivity().getIntent(), "userExtra", User.class) : (User) getNavigationActivity().getIntent().getSerializableExtra("userExtra");
    }

    public final String getUserIdFromIntent() {
        return Build.VERSION.SDK_INT >= 33 ? getNavigationActivity().getIntent().getStringExtra(Constants.USER_ID) : getNavigationActivity().getIntent().getStringExtra(Constants.USER_ID);
    }

    private final void hideLoading() {
        getNavigationActivity().Q2();
    }

    private final void openFollowersList(String str, String str2) {
        startActivity(olx.com.delorean.a.P(str, str2));
    }

    private final void openImageFullScreen(List list) {
        startActivity(olx.com.delorean.a.n1(list));
    }

    private final void openLogin(int i) {
        startActivityForResult(LoginActivity.u3(), i);
    }

    private final void openMutualFriendsList(User user, MutualFriends mutualFriends) {
        startActivity(olx.com.delorean.a.x0(user, mutualFriends));
    }

    private final void openMyProfile() {
        getActivity().o3();
    }

    private final void openPosting() {
        startActivity(olx.com.delorean.a.e1());
    }

    private final void r5(String str) {
        new BlockUnBlockUserDialog(str, this.T0, this).show(requireActivity().getSupportFragmentManager(), BlockUnBlockUserDialog.class.getSimpleName());
    }

    private final void setUserVerify(List list) {
        if (list != null) {
            Iterator it = list.iterator();
            while (it.hasNext()) {
                Badge badge = (Badge) it.next();
                String type = badge != null ? badge.getType() : null;
                if (type != null) {
                    int hashCode = type.hashCode();
                    if (hashCode != 96619420) {
                        if (hashCode != 98566785) {
                            if (hashCode == 106642798 && type.equals("phone")) {
                                getBinding().k0.setVisibility(badge.isEnable() ? 0 : 8);
                            }
                        } else if (type.equals("gplus")) {
                            getBinding().l0.setVisibility(badge.isEnable() ? 0 : 8);
                        }
                    } else if (type.equals("email")) {
                        getBinding().m0.setVisibility(badge.isEnable() ? 0 : 8);
                    }
                }
            }
        }
    }

    private final void shareProfile(String str, String str2) {
        String uri = o1.l(str).toString();
        StringCompanionObject stringCompanionObject = StringCompanionObject.a;
        String format = String.format(getString(com.olx.southasia.p.profile_share), Arrays.copyOf(new Object[]{str2, "OLX", uri}, 3));
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        getNavigationActivity().startActivity(olx.com.delorean.a.W0(g1.a(format, otherProfileViewModel.Z0()), ""));
    }

    private final void showConfirmUnFollowDialog(final String str, final String str2) {
        new u.a(getActivity()).l(getString(com.olx.southasia.p.dialog_unfollow_conversation_ok)).g(getString(android.R.string.cancel)).n(getString(com.olx.southasia.p.dialog_unfollow_conversation_title, new Object[]{str})).e(getString(com.olx.southasia.p.dialog_unfollow_conversation_message)).k(new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                OtherProfileFragmentV2.X5(OtherProfileFragmentV2.this, str, str2, dialogInterface, i);
            }
        }).m();
    }

    private final void showDefaultImage(String str) {
        com.olxgroup.panamera.app.common.utils.c1.d(getBinding().V, com.olxgroup.panamera.app.common.utils.f0.I(str));
    }

    private final void showEmptyState() {
        hideLoading();
        getBinding().J.setVisibility(8);
    }

    private final void showLoading() {
        getNavigationActivity().j3();
    }

    private final void showMemberSince(long j) {
        getBinding().T.setVisibility(0);
        getBinding().T.setText(getString(com.olx.southasia.p.member_since, new Object[]{new com.olxgroup.panamera.app.common.utils.n(getNavigationActivity()).j(Long.valueOf(j))}));
    }

    private final void showReportUserDialog(String str) {
        ReportDialog.v5(getNavigationActivity().getSupportFragmentManager(), 1, str, AdvertisingExtentionKt.ADVERTISING_PROFILE);
    }

    private final com.olxgroup.panamera.app.buyers.common.adapters.l t5() {
        SelectedMarket x5 = x5();
        RecentViewRepository v5 = v5();
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        BuyersABTestRepository X0 = otherProfileViewModel.X0();
        List a2 = com.olxgroup.panamera.app.common.utils.i0.a(getResources().getString(com.olx.southasia.p.inspection_trust_dialog_title));
        OtherProfileViewModel otherProfileViewModel2 = this.O0;
        return new com.olxgroup.panamera.app.buyers.common.adapters.l(x5, v5, X0, a2, false, (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).I1());
    }

    private final void updateFollowCounter(int i) {
        getBinding().M.setText(String.valueOf(i));
    }

    private final void updateList(List list) {
        hideLoading();
        this.R0.I(list);
        OtherProfileViewModel otherProfileViewModel = this.O0;
        if (otherProfileViewModel == null) {
            otherProfileViewModel = null;
        }
        otherProfileViewModel.E1(false);
    }

    private final void y5() {
        k1.a(requireActivity(), getString(com.olx.southasia.p.user_is_banned));
        androidx.fragment.app.r activity = getActivity();
        if (activity != null) {
            activity.finish();
        }
    }

    private final void z5() {
        getBinding().J.setVisibility(8);
    }

    public final void R5(com.olxgroup.panamera.app.common.helpers.p pVar) {
        this.K0 = pVar;
    }

    protected int getLayout() {
        return com.olx.southasia.k.fragment_other_profile_v2;
    }

    public void h0(int i) {
    }

    public void h1(a.b bVar) {
        this.T0 = bVar instanceof a.b.a ? ((a.b.a) bVar).a() : false;
        c6();
    }

    public void i() {
        com.naspers.ragnarok.communication.blockUser.a aVar = this.P0;
        if (aVar == null) {
            aVar = null;
        }
        aVar.b();
    }

    protected void initializeViews() {
        this.O0 = new ViewModelProvider(this).get(OtherProfileViewModel.class);
        com.olxgroup.panamera.app.buyers.listings.viewModels.c cVar = new ViewModelProvider(this).get(com.olxgroup.panamera.app.buyers.listings.viewModels.c.class);
        this.Q0 = cVar;
        if (cVar == null) {
            cVar = null;
        }
        cVar.F0().observe(getViewLifecycleOwner(), new d(new Function1() {
            @Override
            public final Object invoke(Object obj) {
                Unit D5;
                D5 = OtherProfileFragmentV2.D5(OtherProfileFragmentV2.this, (Triple) obj);
                return D5;
            }
        }));
        A5();
        C5();
        P5();
        User userFromIntent = getUserFromIntent();
        if (userFromIntent != null) {
            OtherProfileViewModel otherProfileViewModel = this.O0;
            (otherProfileViewModel != null ? otherProfileViewModel : null).j1(userFromIntent.getId());
            return;
        }
        String userIdFromIntent = getUserIdFromIntent();
        if (userIdFromIntent != null) {
            OtherProfileViewModel otherProfileViewModel2 = this.O0;
            (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).j1(userIdFromIntent);
        }
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        super/*androidx.fragment.app.Fragment*/.onActivityResult(i, i2, intent);
        if (i2 == -1) {
            if (i == 670) {
                OtherProfileViewModel otherProfileViewModel = this.O0;
                (otherProfileViewModel != null ? otherProfileViewModel : null).z1(new d.e(getCurrentFollowerCounter()));
            } else {
                if (i != 11000) {
                    return;
                }
                OtherProfileViewModel otherProfileViewModel2 = this.O0;
                (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).z1(d.l.a);
            }
        }
    }

    @Override
    public void onBundleAction(BundleActionListener.Type type, String str, String str2, String str3) {
    }

    @Override
    public void onClick(View view) {
        Integer valueOf = view != null ? Integer.valueOf(view.getId()) : null;
        int i = com.olx.southasia.i.follow_button;
        if (valueOf != null && valueOf.intValue() == i) {
            OtherProfileViewModel otherProfileViewModel = this.O0;
            (otherProfileViewModel != null ? otherProfileViewModel : null).z1(new d.e(getCurrentFollowerCounter()));
            return;
        }
        int i2 = com.olx.southasia.i.unfollow_button;
        if (valueOf != null && valueOf.intValue() == i2) {
            OtherProfileViewModel otherProfileViewModel2 = this.O0;
            (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).z1(d.o.a);
            return;
        }
        int i3 = com.olx.southasia.i.mutual_friends;
        if (valueOf != null && valueOf.intValue() == i3) {
            OtherProfileViewModel otherProfileViewModel3 = this.O0;
            (otherProfileViewModel3 != null ? otherProfileViewModel3 : null).z1(d.j.a);
            return;
        }
        int i4 = com.olx.southasia.i.start_posting_button;
        if (valueOf != null && valueOf.intValue() == i4) {
            OtherProfileViewModel otherProfileViewModel4 = this.O0;
            (otherProfileViewModel4 != null ? otherProfileViewModel4 : null).z1(d.n.a);
            return;
        }
        int i5 = com.olx.southasia.i.followersContainer;
        if (valueOf != null && valueOf.intValue() == i5) {
            OtherProfileViewModel otherProfileViewModel5 = this.O0;
            (otherProfileViewModel5 != null ? otherProfileViewModel5 : null).z1(d.f.a);
            return;
        }
        int i6 = com.olx.southasia.i.followingContainer;
        if (valueOf != null && valueOf.intValue() == i6) {
            OtherProfileViewModel otherProfileViewModel6 = this.O0;
            (otherProfileViewModel6 != null ? otherProfileViewModel6 : null).z1(d.g.a);
            return;
        }
        int i7 = com.olx.southasia.i.profilePhoto;
        if (valueOf != null && valueOf.intValue() == i7) {
            OtherProfileViewModel otherProfileViewModel7 = this.O0;
            (otherProfileViewModel7 != null ? otherProfileViewModel7 : null).z1(d.k.a);
            return;
        }
        int i8 = com.olx.southasia.i.sellerLocationContainer;
        if (valueOf != null && valueOf.intValue() == i8) {
            OtherProfileViewModel otherProfileViewModel8 = this.O0;
            (otherProfileViewModel8 != null ? otherProfileViewModel8 : null).z1(d.i.a);
        }
    }

    public void onViewCreated(View view, Bundle bundle) {
        super/*com.olxgroup.panamera.app.common.fragments.BaseFragment*/.onViewCreated(view, bundle);
        requireActivity().addMenuProvider(new c(), getViewLifecycleOwner());
    }

    @Override
    public void onWidgetAction(WidgetActionListener.Type type, String str, int i) {
        int i2 = type == null ? -1 : b.$EnumSwitchMapping$0[type.ordinal()];
        if (i2 == 1) {
            OtherProfileViewModel otherProfileViewModel = this.O0;
            (otherProfileViewModel != null ? otherProfileViewModel : null).z1(new d.a(str));
            return;
        }
        if (i2 == 2) {
            OtherProfileViewModel otherProfileViewModel2 = this.O0;
            (otherProfileViewModel2 != null ? otherProfileViewModel2 : null).z1(new d.C0042d(str));
        } else if (i2 == 3 || i2 == 4) {
            V5(str);
        } else {
            if (i2 != 5) {
                return;
            }
            OtherProfileViewModel otherProfileViewModel3 = this.O0;
            (otherProfileViewModel3 != null ? otherProfileViewModel3 : null).z1(new d.p(str, i));
        }
    }

    public final void s5(VisualizationMode visualizationMode, boolean z) {
        com.olxgroup.panamera.app.buyers.common.adapters.l lVar;
        com.olxgroup.panamera.app.buyers.common.adapters.l lVar2 = this.R0;
        if (lVar2 != null) {
            lVar2.w0(visualizationMode);
        }
        com.olxgroup.panamera.app.buyers.common.adapters.l lVar3 = this.R0;
        if (lVar3 != null) {
            OtherProfileViewModel otherProfileViewModel = this.O0;
            if (otherProfileViewModel == null) {
                otherProfileViewModel = null;
            }
            lVar3.I0(otherProfileViewModel.d1());
        }
        if (!z || (lVar = this.R0) == null) {
            return;
        }
        lVar.notifyDataSetChanged();
    }

    public final void setImage(String str) {
        com.olxgroup.panamera.app.common.repositoryImpl.e.a.d().g(str, getBinding().V, com.olxgroup.panamera.app.common.utils.f0.q(com.olx.southasia.g.pic_avatar_1));
    }

    public final void setName(String str) {
        getBinding().U.setText(str);
    }

    public final void showInternetToastMsg() {
        Toast.makeText(getContext(), getString(com.olx.southasia.p.connection_error_subtitle), 0).show();
    }

    public final com.olxgroup.panamera.app.buyers.common.usecases.a u5() {
        com.olxgroup.panamera.app.buyers.common.usecases.a aVar = this.L0;
        if (aVar != null) {
            return aVar;
        }
        return null;
    }

    public final RecentViewRepository v5() {
        RecentViewRepository recentViewRepository = this.N0;
        if (recentViewRepository != null) {
            return recentViewRepository;
        }
        return null;
    }

    public final com.olxgroup.panamera.app.common.helpers.p w5() {
        com.olxgroup.panamera.app.common.helpers.p pVar = this.K0;
        if (pVar != null) {
            return pVar;
        }
        return null;
    }

    public final SelectedMarket x5() {
        SelectedMarket selectedMarket = this.M0;
        if (selectedMarket != null) {
            return selectedMarket;
        }
        return null;
    }
}