package com.ss.android.ugc.aweme.profile;

import X.0Gp;
import X.1hK;
import X.46i;
import X.4Q7;
import X.9EH;
import X.C1922DhW;
import X.C2302Dne;
import X.C2982Dyc;
import X.C3772ERc;
import X.C3792ERw;
import X.C3974EYw;
import X.C6239FNz;
import X.ERT;
import X.EV4;
import X.EXZ;
import X.LH5;
import X.M12;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.homepage.api.data.HomePageDataViewModel;
import com.ss.android.ugc.aweme.homepage.msadapt.MSAdaptionService;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.profile.ui.AwemeListFragment;
import com.ss.android.ugc.aweme.profile.ui.AwemeListFragmentImpl;
import com.ss.android.ugc.aweme.profile.ui.CropActivity;
import com.ss.android.ugc.aweme.profile.ui.v2.I18nMyProfileFragmentV2;
import com.ss.android.ugc.aweme.profile.ui.v2.I18nUserProfileFragmentV2;
import com.ss.android.ugc.aweme.profile.viewmodel.MyProfileGuideViewModel;
import java.lang.ref.WeakReference;
import java.util.List;
import kotlin.h.b.n;

public abstract class BaseProfileServiceImpl implements IProfileService {
    static {
        Covode.recordClassIndex(98162);
    }

    public int getMessageProfile() {
        return 0;
    }

    public boolean needShowCompleteProfileGuide() {
        return false;
    }

    public boolean showRemindUserCompleteProfileDialog(Context context, String str, String str2, DialogInterface.OnDismissListener onDismissListener) {
        M12.LIZ(context);
        return false;
    }

    public Object getPushSettingCallback() {
        return 4Q7.LIZ;
    }

    public EXZ<Aweme, ?> createAwemeModel() {
        return new EV4();
    }

    public boolean needShowSafeInfoNotice() {
        return C3974EYw.LIZ.needShowSafeInfoNotice();
    }

    public C6239FNz newUserPresenter() {
        return new C6239FNz();
    }

    public Fragment obtainMyProfileFragment() {
        if (MSAdaptionService.LIZJ().LIZ(9EH.LJJIFFI.LIZ())) {
            return new I18nMyProfileFragmentV2();
        }
        return null;
    }

    public boolean needShowCompleteProfileGuideBar() {
        boolean z;
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        User curUser = LJFF.getCurUser();
        n.LIZIZ(curUser, "");
        if (curUser.getProfileCompletion() <= 0.0f || curUser.getProfileCompletion() > 0.7f) {
            z = false;
        } else {
            z = true;
        }
        if (!needShowCompleteProfileGuide() || (!z && !curUser.nicknameUpdateReminder() && !curUser.avatarUpdateReminder())) {
            return false;
        }
        return true;
    }

    public Fragment obtainUserProfileFragment() {
        if (!MSAdaptionService.LIZJ().LIZ(9EH.LJJIFFI.LIZ())) {
            return null;
        }
        I18nUserProfileFragmentV2 i18nUserProfileFragmentV2 = new I18nUserProfileFragmentV2();
        if (MSAdaptionService.LIZJ().LIZJ(9EH.LJJIFFI.LIZ())) {
            i18nUserProfileFragmentV2.LIZ("homepage_hot");
        }
        return i18nUserProfileFragmentV2;
    }

    public void updateProfilePermission(boolean z) {
        MyProfileGuideViewModel myProfileGuideViewModel;
        WeakReference<MyProfileGuideViewModel> weakReference = C3772ERc.LIZIZ;
        if (!(weakReference == null || (myProfileGuideViewModel = (MyProfileGuideViewModel) weakReference.get()) == null)) {
            myProfileGuideViewModel.LJI(new ERT(z));
        }
        C3772ERc.LIZ = z;
    }

    public void mobRefreshInProfileAweme(EXZ<?, ?> exz, List<? extends Aweme> list) {
        M12.LIZ(exz, list);
        if (exz instanceof EV4) {
            ((EV4) exz).LIZ((List<Aweme>) list);
        }
    }

    public void updateUserInfo(Fragment fragment, Aweme aweme) {
        if (MSAdaptionService.LIZJ().LIZ(9EH.LJJIFFI.LIZ()) && (fragment instanceof LH5)) {
            ((LH5) fragment).LIZIZ(aweme);
        }
    }

    public void preloadProfile(1hK r3, String str) {
        M12.LIZ(r3, str);
        M12.LIZ(r3, str);
        Aweme aweme = HomePageDataViewModel.LJIILJJIL.LIZ(r3).LJI;
        if (aweme != null && !aweme.getIsPreloadScroll() && TextUtils.equals(str, "page_profile")) {
            aweme.setIsPreloadScroll(true);
            0Gp.LIZ(new C3792ERw(aweme));
        }
    }

    public User queryUser(String str, boolean z, String str2) {
        M12.LIZ(str);
        User LIZ = C2982Dyc.LIZ(str, z, str2);
        n.LIZIZ(LIZ, "");
        return LIZ;
    }

    public String userUrl(String str, String str2, String str3, int i) {
        String LIZ = C2982Dyc.LIZ(str, str2, i, true);
        n.LIZIZ(LIZ, "");
        return LIZ;
    }

    public void queryProfileResponseWithDoubleId(Handler handler, String str, String str2, String str3, int i) {
        Handler handler2 = handler;
        String str4 = str3;
        M12.LIZ(handler2, str4);
        C1922DhW.LIZ().LIZ(handler2, str, str2, str4, i, true);
    }

    public boolean showRemindUserCompleteProfileDialogAfterFollow(Context context, String str, String str2, User user, int i) {
        M12.LIZ(context, user);
        if ((!n.LIZ(str2, "follow") && !n.LIZ(str2, "follow_guide")) || C2302Dne.LIZIZ(user) >= 1000) {
            return false;
        }
        if (i == 1 || i == 2 || i == 4) {
            return showRemindUserCompleteProfileDialog(context, str, "follow_guide", (DialogInterface.OnDismissListener) null);
        }
        return false;
    }

    public AwemeListFragment newBasicAwemeListFragment(int i, int i2, String str, String str2, boolean z, boolean z2) {
        M12.LIZ(str);
        if (str2 == null) {
            str2 = "";
        }
        Bundle bundle = new Bundle();
        AwemeListFragmentImpl awemeListFragmentImpl = new AwemeListFragmentImpl();
        bundle.putInt("type", i2);
        bundle.putString("uid", str);
        bundle.putString("sec_user_id", str2);
        bundle.putBoolean("is_my_profile", z);
        bundle.putBoolean("is_scene_transition_enable", false);
        bundle.putInt("bottom_bar_height", i);
        bundle.putBoolean("should_refresh_on_init_data", z2);
        awemeListFragmentImpl.setArguments(bundle);
        n.LIZIZ(awemeListFragmentImpl, "");
        return awemeListFragmentImpl;
    }

    public void gotoCropActivity(Activity activity, String str, boolean z, float f, int i, int i2, int i3, int i4, int i5, boolean z2) {
        String str2 = str;
        Activity activity2 = activity;
        M12.LIZ(activity2, str2);
        float f2 = f;
        boolean z3 = z;
        int i6 = i3;
        CropActivity.LJIIJJI.LIZ(activity2, str2, z3, f2, i, i2, i6, i4, i5, z2, (Bundle) null);
    }

    public void gotoCropActivity(Activity activity, String str, boolean z, float f, int i, int i2, int i3, int i4, int i5, boolean z2, Bundle bundle) {
        Activity activity2 = activity;
        String str2 = str;
        M12.LIZ(activity2, str2);
        float f2 = f;
        boolean z3 = z;
        int i6 = i4;
        int i7 = i3;
        CropActivity.LJIIJJI.LIZ(activity2, str2, z3, f2, i, i2, i7, i6, i5, z2, bundle);
    }
}
