导航菜单

页面标题

页面副标题

BetterTogether v3.0.0 - OnBoardAccountActivity.java 源代码

正在查看: BetterTogether v3.0.0 应用的 OnBoardAccountActivity.java JAVA 源代码文件

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


package com.bettertogether.screens.account.create;

import ae.g;
import ae.m;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.bettertogether.cache.preferences.PreferenceData;
import com.bettertogether.remote.model.request.UpdateUserProfileRequest;
import com.bettertogether.screens.account.create.OnBoardAccountActivity;
import com.bettertogether.screens.intro.IntroActivity;
import com.bettertogether.screens.main.MainActivity;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.fitness.FitnessLocal;
import com.google.android.gms.fitness.LocalRecordingClient;
import com.google.android.gms.fitness.data.LocalDataType;
import com.google.firebase.messaging.e;
import dd.s;
import h.k;
import hd.c;
import hr.m0;
import java.io.File;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.g0;
import lh.d;
import lq.n;
import lq.o;
import lq.x;
import md.l;
import nl.f;
import o9.l0;
import s6.a0;
import s6.t;
import s8.h;
import zd.b;
import zs.a;

@Metadata
public final class OnBoardAccountActivity extends b implements m, c {
    public static final a0 Q = new a0(21, 0);
    public PreferenceData M;
    public int N;
    public boolean O;
    public final x P;

    public final String f4956i = "onboarding_android";

    public final lq.m f4957v;

    public final x f4958w;

    public final lq.m f4959x;

    public UpdateUserProfileRequest f4960y;

    public OnBoardAccountActivity() {
        h s10 = e.s(this);
        a a10 = ((ys.a) s10.a).a(e.o(), new xs.c(g0.a(OnBoardAccountActivity.class)));
        ae.e eVar = new ae.e(this, 3);
        o oVar = o.f13215d;
        this.f4957v = n.a(oVar, new l(a10, eVar, 1));
        this.f4958w = n.b(new ae.e(this, 2));
        this.f4959x = n.a(oVar, new s(this, 4));
        this.f4960y = new UpdateUserProfileRequest(null, null, null, null, null, null, null, null, null, null, null, null, null, false, 16383, null);
        this.N = -1;
        this.P = n.b(new ae.e(this, 0));
    }

    public final void A() {
        D().f4965d.p(false);
        if (((Boolean) D().f4965d.j().f12190d).booleanValue()) {
            f.O(d.b(m0.b), (kotlin.coroutines.a) null, 0, new ae.h(this, null), 3);
        }
    }

    public final cd.a B() {
        return (cd.a) this.P.getValue();
    }

    public final bg.b C() {
        return (bg.b) this.f4959x.getValue();
    }

    public final OnBoardAccountPresenter D() {
        return (OnBoardAccountPresenter) this.f4957v.getValue();
    }

    public final void E(boolean z4) {
        ((PreferenceData) this.f4958w.getValue()).w(true);
        MainActivity.Companion.getClass();
        startActivity(ye.a.b(this, "CreateGroup", z4));
    }

    public final void F() {
        ((PreferenceData) this.f4958w.getValue()).w(true);
        t tVar = IntroActivity.Q;
        we.b bVar = we.b.ONBOARDING;
        tVar.getClass();
        Intent m7 = t.m(this, bVar, "CreateGroup");
        m7.addFlags(268468224);
        startActivity(m7);
    }

    public final void G() {
        if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this, 241500000) != 0) {
            showErrorMessageDialog("Please update your Google Play services, as this feature requires it to monitor health data");
            return;
        }
        if (jh.o.w(this)) {
            LocalRecordingClient localRecordingClient = FitnessLocal.getLocalRecordingClient(this);
            Intrinsics.checkNotNullExpressionValue(localRecordingClient, "getLocalRecordingClient(this)");
            localRecordingClient.subscribe(LocalDataType.TYPE_CALORIES_EXPENDED).addOnSuccessListener(new a9.h(10, sd.f.i)).addOnFailureListener(new l0(7));
            localRecordingClient.subscribe(LocalDataType.TYPE_STEP_COUNT_DELTA).addOnSuccessListener(new a9.h(11, new g(this, 1))).addOnFailureListener(new l0(8));
        }
    }

    public final void H() {
        UpdateUserProfileRequest updateUserProfileRequest = this.f4960y;
        PreferenceData preferenceData = this.M;
        boolean hasProfileCompleted = updateUserProfileRequest.hasProfileCompleted(preferenceData != null ? preferenceData.k() : false);
        String i10 = new en.o().i(this.f4960y);
        PreferenceData preferenceData2 = this.M;
        et.d.c("CheckData: " + hasProfileCompleted + " \nUserData: " + i10 + " terms: " + (preferenceData2 != null ? Boolean.valueOf(preferenceData2.k()) : null), new Object[0]);
        B().f4087c.setBackground(z2.h.getDrawable(this, hasProfileCompleted ? 2131230928 : 2131231010));
    }

    @Override
    public final String getAnalyticsScreenName() {
        return this.f4956i;
    }

    public final View getView() {
        ConstraintLayout constraintLayout = B().f4085a;
        Intrinsics.checkNotNullExpressionValue(constraintLayout, "binding.root");
        return constraintLayout;
    }

    @Override
    public final void hideLoadingDialog() {
        B().f4108x.setRefreshing(false);
        B().f4102r.a();
        enableViews();
    }

    @Override
    public final void initViews() {
        throw new UnsupportedOperationException("Method not decompiled: com.bettertogether.screens.account.create.OnBoardAccountActivity.initViews():void");
    }

    public final void onActivityResult(int i10, int i11, Intent intent) {
        super/*zc.u*/.onActivityResult(i10, i11, intent);
        if (i10 == 3) {
            if (i11 != -1) {
                B().A.setChecked(false);
                H();
                return;
            }
            showLoadingDialog();
            A();
            signOutFromFitbit();
            B().f4110z.setChecked(false);
            readDailyStepsFromTheRecordingApi(new g(this, 0));
        }
    }

    public final void onBackPressed() {
        if (!this.f4960y.hasAnyChanges()) {
            finish();
            return;
        }
        k kVar = new k((Context) this);
        kVar.u(2131951687);
        kVar.o(2131951894);
        final int i10 = 0;
        kVar.s(2131951893, new DialogInterface.OnClickListener(this) {

            public final OnBoardAccountActivity f588e;

            {
                this.f588e = this;
            }

            @Override
            public final void onClick(DialogInterface dialogInterface, int i11) {
                int i12 = i10;
                zc.l lVar = this.f588e;
                switch (i12) {
                    case 0:
                        a0 a0Var = OnBoardAccountActivity.Q;
                        Intrinsics.checkNotNullParameter(lVar, "this$0");
                        lVar.finish();
                        break;
                    default:
                        a0 a0Var2 = OnBoardAccountActivity.Q;
                        Intrinsics.checkNotNullParameter(lVar, "this$0");
                        lVar.hideLoadingDialog();
                        break;
                }
            }
        });
        final int i11 = 1;
        kVar.q(2131951723, new DialogInterface.OnClickListener(this) {

            public final OnBoardAccountActivity f588e;

            {
                this.f588e = this;
            }

            @Override
            public final void onClick(DialogInterface dialogInterface, int i112) {
                int i12 = i11;
                zc.l lVar = this.f588e;
                switch (i12) {
                    case 0:
                        a0 a0Var = OnBoardAccountActivity.Q;
                        Intrinsics.checkNotNullParameter(lVar, "this$0");
                        lVar.finish();
                        break;
                    default:
                        a0 a0Var2 = OnBoardAccountActivity.Q;
                        Intrinsics.checkNotNullParameter(lVar, "this$0");
                        lVar.hideLoadingDialog();
                        break;
                }
            }
        });
        kVar.f().show();
    }

    public final void onFitbitConnectError() {
        B().f4110z.setChecked(false);
    }

    public final void onFitbitConnectSuccess() {
        B().f4110z.setChecked(true);
        A();
        zc.l.signOutFromGoogle$default(this, (Function0) null, (Function0) null, 3, (Object) null);
        B().A.setChecked(false);
    }

    public final void onImageFileReady(Pair pair) {
        Intrinsics.checkNotNullParameter(pair, "result");
        File file = (File) pair.f12191e;
        if (file != null) {
            bg.b C = C();
            ImageView imageView = B().f4088d;
            Intrinsics.checkNotNullExpressionValue(imageView, "binding.btnAvatar");
            C.getClass();
            bg.b.e(this, file, imageView, true);
            this.f4960y.setUserAvatar(file);
            H();
        }
    }

    public final void onResume() {
        super/*com.bettertogether.base.BaseActivity*/.onResume();
        et.d.a("OnBoardAccountActivity onResume", new Object[0]);
        if (this.O && ag.f.d(this) && !D().f4965d.a()) {
            this.O = false;
            B().A.setChecked(true);
            PreferenceData preferenceData = this.M;
            if (preferenceData != null) {
                preferenceData.y(true);
            }
            PreferenceData preferenceData2 = this.M;
            if ((preferenceData2 == null || preferenceData2.b("HAS_USER_SUBSCRIBED_THE_RECORDING_API", false)) ? false : true) {
                G();
            }
        }
        cd.a B = B();
        AppCompatCheckBox appCompatCheckBox = B.A;
        PreferenceData preferenceData3 = this.M;
        appCompatCheckBox.setChecked(preferenceData3 != null ? preferenceData3.e() : false);
        B.f4110z.setChecked(hasFitbitConnected());
        this.O = false;
    }

    public final ad.a providePresenter() {
        return D();
    }

    @Override
    public final void showLoadingDialog() {
        disableViews();
        B().f4102r.b();
    }

    public final void userOneSignalTags(com.bettertogether.remote.model.common.UserData r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.bettertogether.screens.account.create.OnBoardAccountActivity.userOneSignalTags(com.bettertogether.remote.model.common.UserData):void");
    }

    @Override
    public final void x(String str, String str2) {
        Intrinsics.checkNotNullParameter(str, "displayDate");
        Intrinsics.checkNotNullParameter(str2, "requestDate");
        this.f4960y.setBirthDate(str2);
        B().f4092h.setText(str);
        H();
    }

    @Override
    public final void y(rd.a aVar, float f10, String str) {
        Intrinsics.checkNotNullParameter(aVar, "heightSystem");
        Intrinsics.checkNotNullParameter(str, "displayValue");
        int ordinal = aVar.ordinal();
        if (ordinal == 0) {
            B().f4103s.setChecked(true);
        } else if (ordinal == 1) {
            B().f4104t.setChecked(true);
        }
        B().f4095k.setText(str);
        this.f4960y.setHeight(Float.valueOf(f10));
        H();
    }
}