导航菜单

页面标题

页面副标题

BetterTogether v3.0.0 - GroupDetailsActivity.java 源代码

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

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


package com.bettertogether.screens.group.details;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.w3;
import androidx.constraintlayout.widget.ConstraintLayout;
import aq.i;
import bg.b;
import cd.f0;
import cd.k;
import com.appsflyer.share.LinkGenerator;
import com.appsflyer.share.ShareInviteHelper;
import com.bettertogether.base.BaseActivity;
import com.bettertogether.cache.preferences.PreferenceData;
import com.bettertogether.charts.Steps;
import com.bettertogether.charts.StepsData;
import com.bettertogether.dialogs.MemberDashboardDialog;
import com.bettertogether.remote.model.common.GroupData;
import com.bettertogether.remote.model.common.UserData;
import com.bettertogether.remote.model.response.DashboardResponse;
import com.bettertogether.screens.chat.view.ChatActivity;
import com.bettertogether.screens.group.edit.EditGroupActivity;
import com.bettertogether.screens.main.MainActivity;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.firebase.messaging.e;
import dd.s;
import dd.v;
import fd.uHnv.aXauN;
import g3.g;
import hd.c;
import hr.m0;
import java.io.Serializable;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import k7.j;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.b0;
import kotlin.jvm.internal.g0;
import lq.m;
import lq.n;
import lq.o;
import lq.x;
import md.l;
import mp.a0;
import pe.f;
import pe.p;
import pe.q;
import pe.r;
import pl.c1;
import s6.t;
import s8.h;
import w1.v2;
import xc.d;
import ys.a;

@Metadata
public final class GroupDetailsActivity extends BaseActivity implements q, j, c, d, w3 {
    public static final t Y = new t(25, 0);
    public final x M;
    public Boolean N;
    public boolean O;
    public ArrayList P;
    public int Q;
    public String R;
    public String S;
    public r T;
    public boolean U;
    public boolean V;
    public int W;
    public int X;

    public boolean f207e;
    public final String i = "group_details_android";

    public final m f208v;
    public final m w;
    public final x x;
    public final m y;

    public GroupDetailsActivity() {
        o oVar = o.d;
        this.f208v = n.a(oVar, new s(this, 15));
        h s3 = e.s(this);
        this.w = n.a(oVar, new l(((a) s3.a).a(e.o(), new xs.c(g0.a(GroupDetailsActivity.class))), new f(this, 5), 10));
        this.x = n.b(new f(this, 4));
        this.y = n.a(oVar, new s(this, 16));
        this.M = n.b(new f(this, 0));
        this.N = Boolean.FALSE;
        this.O = true;
        this.P = new ArrayList();
        this.T = r.d;
    }

    public static void y(GroupDetailsActivity groupDetailsActivity, boolean z, boolean z2, String str, int i) {
        r rVar = r.e;
        if ((i & 2) != 0) {
            z = true;
        }
        boolean z4 = z;
        if ((i & 4) != 0) {
            z2 = false;
        }
        boolean z5 = z2;
        if ((i & 8) != 0) {
            str = null;
        }
        qe.d adapter = groupDetailsActivity.t().p.getAdapter();
        Intrinsics.f(adapter, "null cannot be cast to non-null type com.bettertogether.screens.group.details.adapter.MembersAdapter");
        adapter.b(groupDetailsActivity.u().f732e, rVar, z4, z5, str);
    }

    public static void z(GroupDetailsActivity groupDetailsActivity, boolean z, boolean z2, int i) {
        float f;
        if ((i & 1) != 0) {
            z = false;
        }
        if ((i & 2) != 0) {
            z2 = false;
        }
        k t = groupDetailsActivity.t();
        if (z2) {
            t.n.setAlpha(groupDetailsActivity.Q < groupDetailsActivity.P.size() - 1 ? 1.0f : 0.5f);
            t.n.setEnabled(groupDetailsActivity.Q < groupDetailsActivity.P.size() - 1);
            f = groupDetailsActivity.Q <= 0 ? 0.5f : 1.0f;
            View view = t.j;
            view.setAlpha(f);
            view.setEnabled(groupDetailsActivity.Q > 0);
            return;
        }
        t.n.setAlpha(!z ? 1.0f : 0.5f);
        t.n.setEnabled(!z);
        f = z ? 1.0f : 0.5f;
        View view2 = t.j;
        view2.setAlpha(f);
        view2.setEnabled(z);
    }

    public final void A(boolean z) {
        if (this.P.size() > 0) {
            if (z) {
                this.Q--;
            } else {
                this.Q++;
            }
            z(this, false, true, 1);
            t().u.setText(zf.a.d.format(zf.a.b.parse((String) this.P.get(this.Q))));
            RelativeLayout relativeLayout = t().o;
            Intrinsics.checkNotNullExpressionValue(relativeLayout, "binding.rlSteps");
            if (relativeLayout.getVisibility() == 0) {
                y(this, false, false, (String) this.P.get(this.Q), 4);
            }
            this.R = t().u.getText().toString();
        }
    }

    public final void B(boolean z) {
        Locale locale = Locale.getDefault();
        Intrinsics.checkNotNullExpressionValue(locale, "getDefault()");
        if (TextUtils.getLayoutDirectionFromLocale(locale) == 1) {
            t().D.setBackground(z ? z2.h.getDrawable(this, 2131231299) : z2.h.getDrawable(this, 2131100369));
            t().D.setTextColor(z ? z2.h.getColor(this, 2131100377) : z2.h.getColor(this, 2131100360));
            t().B.setBackground(z ? z2.h.getDrawable(this, 2131100369) : z2.h.getDrawable(this, 2131231206));
            t().B.setTextColor(z ? z2.h.getColor(this, 2131100360) : z2.h.getColor(this, 2131100377));
        } else {
            t().D.setBackground(z ? z2.h.getDrawable(this, 2131231206) : z2.h.getDrawable(this, 2131100369));
            t().D.setTextColor(z ? z2.h.getColor(this, 2131100377) : z2.h.getColor(this, 2131100360));
            t().B.setBackground(z ? z2.h.getDrawable(this, 2131100369) : z2.h.getDrawable(this, 2131231299));
            t().B.setTextColor(z ? z2.h.getColor(this, 2131100360) : z2.h.getColor(this, 2131100377));
        }
        t().o.setVisibility(!z ? 0 : 8);
    }

    public final void C() {
        boolean f = u().f(u().f732e);
        p u4 = u();
        GroupData groupData = u().f732e;
        PreferenceData preferenceData = getPreferenceData();
        u4.getClass();
        boolean z = p.e(groupData, preferenceData) || zf.d.b;
        et.d.c(og.m.i("UserData: isTrial: CheckStartDate:  ", f), new Object[0]);
        t().i.setVisibility(z ? 8 : 0);
    }

    public final void D() {
        UserData userData;
        DashboardResponse dashboard;
        Steps stepsInfo;
        int i;
        boolean z = false;
        if (this.X == 1) {
            GroupData groupData = u().f732e;
            if (groupData != null) {
                TextView textView = t().w;
                DecimalFormat decimalFormat = zf.f.a;
                Integer steps = groupData.getSteps();
                textView.setText(zf.f.d(steps != null ? steps.intValue() : 0));
            }
            z(this, false, true, 1);
            if (this.P.size() <= 0 || (i = this.Q) < 0 || i >= this.P.size()) {
                return;
            }
            y(this, false, false, (String) this.P.get(this.Q), 4);
            return;
        }
        z(this, this.O, false, 2);
        GroupData groupData2 = u().f732e;
        if (groupData2 != null) {
            TextView textView2 = t().w;
            DecimalFormat decimalFormat2 = zf.f.a;
            Integer steps2 = groupData2.getSteps();
            textView2.setText(zf.f.d((steps2 != null ? steps2.intValue() : 0) * 7));
            List members = groupData2.getMembers();
            if ((members != null ? members.size() : 0) > 0) {
                List members2 = groupData2.getMembers();
                if ((members2 == null || (userData = (UserData) members2.get(0)) == null || (dashboard = userData.getDashboard()) == null || (stepsInfo = dashboard.getStepsInfo()) == null) ? false : stepsInfo.isPreviousWeekExists()) {
                    z = true;
                }
            }
            t().j.setAlpha(z ? 1.0f : 0.5f);
            t().j.setEnabled(z);
        }
        y(this, true, this.O, null, 8);
    }

    public final void E(boolean z) {
        t().C.setVisibility(z ? 0 : 8);
        t().G.setVisibility(z ? 0 : 8);
    }

    public final void F() {
        String str;
        List members;
        UserData userData;
        DashboardResponse dashboard;
        Steps stepsInfo;
        StepsData previousWeekData;
        List members2;
        UserData userData2;
        DashboardResponse dashboard2;
        Steps stepsInfo2;
        StepsData previousWeekData2;
        List members3;
        UserData userData3;
        DashboardResponse dashboard3;
        Steps stepsInfo3;
        List members4;
        boolean z = !this.O;
        this.O = z;
        z(this, z, false, 2);
        TextView textView = t().u;
        if (this.O) {
            str = s();
        } else {
            GroupData groupData = u().f732e;
            if (((groupData == null || (members4 = groupData.getMembers()) == null) ? 0 : members4.size()) > 0) {
                if ((groupData == null || (members3 = groupData.getMembers()) == null || (userData3 = (UserData) members3.get(0)) == null || (dashboard3 = userData3.getDashboard()) == null || (stepsInfo3 = dashboard3.getStepsInfo()) == null || !stepsInfo3.isPreviousWeekExists()) ? false : true) {
                    SimpleDateFormat simpleDateFormat = zf.a.d;
                    SimpleDateFormat simpleDateFormat2 = zf.a.b;
                    str = og.m.g(simpleDateFormat.format(simpleDateFormat2.parse((groupData == null || (members2 = groupData.getMembers()) == null || (userData2 = (UserData) members2.get(0)) == null || (dashboard2 = userData2.getDashboard()) == null || (stepsInfo2 = dashboard2.getStepsInfo()) == null || (previousWeekData2 = stepsInfo2.getPreviousWeekData()) == null) ? null : previousWeekData2.getStartDate())), " - ", simpleDateFormat.format(simpleDateFormat2.parse((groupData == null || (members = groupData.getMembers()) == null || (userData = (UserData) members.get(0)) == null || (dashboard = userData.getDashboard()) == null || (stepsInfo = dashboard.getStepsInfo()) == null || (previousWeekData = stepsInfo.getPreviousWeekData()) == null) ? null : previousWeekData.getEndDate())));
                }
            }
            str = null;
        }
        textView.setText(str);
        y(this, true, this.O, null, 8);
        this.S = t().u.getText().toString();
    }

    public final void G(GroupData groupData) {
        Intrinsics.checkNotNullParameter(groupData, "group");
        k t = t();
        Integer goal = groupData.getGoal();
        if (goal != null) {
            t.w.setText(getString(2131951734, Integer.valueOf(goal.intValue())));
        }
        SimpleDateFormat simpleDateFormat = zf.a.d;
        SimpleDateFormat simpleDateFormat2 = zf.a.b;
        String endDate = groupData.getEndDate();
        if (!(endDate == null || endDate.length() == 0)) {
            TextView textView = t.s;
            String endDate2 = groupData.getEndDate();
            Intrinsics.e(endDate2);
            Date parse = simpleDateFormat2.parse(endDate2);
            Intrinsics.e(parse);
            textView.setText(simpleDateFormat.format(parse));
        }
        if (groupData.getCurrentWeek() == null) {
            E(false);
            return;
        }
        Integer currentWeek = groupData.getCurrentWeek();
        Intrinsics.e(currentWeek);
        int intValue = currentWeek.intValue();
        Integer duration = groupData.getDuration();
        Intrinsics.e(duration);
        int intValue2 = duration.intValue();
        Float weeklyTarget = groupData.getWeeklyTarget();
        Intrinsics.e(weeklyTarget);
        float floatValue = weeklyTarget.floatValue();
        if (intValue >= intValue2 || intValue == 0) {
            E(false);
            return;
        }
        u2.m mVar = new u2.m();
        mVar.d(t().E);
        E(true);
        float f = intValue / intValue2;
        et.d.b("horizontal_bias>>>>>" + f, new Object[0]);
        mVar.h(2131363245).d.t = f;
        mVar.a(t().E);
        t().C.setText(zf.f.c(floatValue * (-1.0f)));
    }

    public final void H(GroupData groupData, DashboardResponse dashboardResponse) {
        Intrinsics.checkNotNullParameter(groupData, "group");
        Intrinsics.checkNotNullParameter(dashboardResponse, "dashboard");
        k t = t();
        String icon = groupData.getIcon();
        if (icon != null && !new GroupDetailsActivity().isDestroyed()) {
            b bVar = (b) this.y.getValue();
            AppCompatImageView appCompatImageView = t.h;
            Intrinsics.checkNotNullExpressionValue(appCompatImageView, "ivGroupCover");
            bVar.getClass();
            b.c(this, icon, appCompatImageView);
        }
        t.c.b.setOnClickListener(new pe.c(this, groupData, 0));
        Integer timeLeft = groupData.getTimeLeft();
        Integer duration = groupData.getDuration();
        Intrinsics.e(duration);
        int intValue = duration.intValue();
        t.v.setText(timeLeft != null ? timeLeft.intValue() == 1 ? getString(2131951876, timeLeft) : timeLeft.intValue() > 1 ? getString(2131951879, timeLeft) : (timeLeft.intValue() == 0 && g.O(groupData)) ? getString(2131951876, 1) : (timeLeft.intValue() == -1 && g.O(groupData)) ? getString(2131951876, 1) : getString(2131951731) : !groupData.getActive() ? getString(2131951731) : intValue < 2 ? getString(2131952605, Integer.valueOf(intValue)) : getString(2131952611, Integer.valueOf(intValue)));
        List members = groupData.getMembers();
        if (members != null) {
            int size = members.size();
            TextView textView = t.z;
            if (size < 2) {
                textView.setText(getString(2131952244, Integer.valueOf(members.size())));
            } else {
                textView.setText(getString(2131952249, Integer.valueOf(members.size())));
            }
            qe.d adapter = t.p.getAdapter();
            Intrinsics.f(adapter, "null cannot be cast to non-null type com.bettertogether.screens.group.details.adapter.MembersAdapter");
            qe.d dVar = adapter;
            if (this.T == r.d) {
                Integer h2 = u().h();
                Intrinsics.e(h2);
                dVar.f(groupData, members, h2.intValue());
            } else {
                D();
            }
        }
        String prize = groupData.getPrize();
        if (prize != null) {
            t.t.setText(prize);
        }
    }

    public final void I(UserData userData, int i, Integer num, int i2, Integer num2, boolean z) {
        Intrinsics.checkNotNullParameter(userData, "userData");
        b bVar = MemberDashboardDialog.o0;
        m mVar = this.y;
        b bVar2 = (b) mVar.getValue();
        Serializable serializable = this.T;
        GroupData groupData = u().f732e;
        Integer steps = groupData != null ? groupData.getSteps() : null;
        boolean f = u().f(u().f732e);
        p u4 = u();
        GroupData groupData2 = u().f732e;
        PreferenceData preferenceData = getPreferenceData();
        u4.getClass();
        boolean e3 = p.e(groupData2, preferenceData);
        boolean z2 = zf.d.b;
        f fVar = new f(this, 7);
        Intrinsics.checkNotNullParameter(userData, "userData");
        Intrinsics.checkNotNullParameter(serializable, "selectedSegment");
        Intrinsics.checkNotNullParameter(fVar, "isShowPopup");
        Intrinsics.checkNotNullParameter(bVar2, "imageLoader");
        MemberDashboardDialog memberDashboardDialog = new MemberDashboardDialog();
        Bundle bundle = new Bundle();
        bundle.putSerializable("userData", userData);
        bundle.putInt("myId", i);
        bundle.putInt("groupDuration", i2);
        bundle.putInt("currentWeek", num != null ? num.intValue() : -1);
        bundle.putInt("groupGoal", num2 != null ? num2.intValue() : -1);
        bundle.putBoolean("challengeEnded", z);
        bundle.putSerializable("selectedSegment", serializable);
        bundle.putInt("dailySteps", steps != null ? steps.intValue() : -1);
        bundle.putBoolean("isTrial", f);
        bundle.putBoolean("isRemoteDateAfter", e3);
        bundle.putBoolean("isProUser", z2);
        memberDashboardDialog.setArguments(bundle);
        MemberDashboardDialog.o0 = bVar2;
        Intrinsics.checkNotNullParameter(fVar, "<set-?>");
        MemberDashboardDialog.p0 = fVar;
        if (isFinishing()) {
            return;
        }
        MemberDashboardDialog.o0 = (b) mVar.getValue();
        f fVar2 = new f(this, 6);
        Intrinsics.checkNotNullParameter(fVar2, "<set-?>");
        MemberDashboardDialog.p0 = fVar2;
        memberDashboardDialog.show(getSupportFragmentManager(), "memberDashboard");
    }

    public final void a() {
        finish();
        if (getIntent().getBooleanExtra("launched_from_groups_list", false)) {
            return;
        }
        ye.a aVar = MainActivity.Companion;
        Serializable serializable = u().f732e;
        aVar.getClass();
        Intrinsics.checkNotNullParameter(this, "context");
        Intent a = ye.a.a(this, (String) null);
        a.putExtra("param_group_data", serializable);
        startActivity(a);
    }

    public final String getAnalyticsScreenName() {
        return this.i;
    }

    public final PreferenceData getPreferenceData() {
        return (PreferenceData) this.x.getValue();
    }

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

    public final void hideLoadingDialog() {
        t().m.a();
        t().r.setRefreshing(false);
    }

    public final void hideWeightRecordButton() {
        t().g.d(true);
    }

    public final void initViews() {
        Bundle extras;
        ArrayList arrayList;
        List members;
        UserData userData;
        DashboardResponse dashboard;
        Steps stepsInfo;
        StepsData dailyData;
        List members2;
        UserData userData2;
        DashboardResponse dashboard2;
        Steps stepsInfo2;
        StepsData dailyData2;
        int intExtra;
        et.d.a("GroupDetailActivity initViews", new Object[0]);
        k t = t();
        Locale locale = Locale.getDefault();
        Intrinsics.checkNotNullExpressionValue(locale, "getDefault()");
        if (TextUtils.getLayoutDirectionFromLocale(locale) == 1) {
            t.b.c.setRotation(180.0f);
            Drawable drawable = z2.h.getDrawable(this, 2131231299);
            TextView textView = t.D;
            textView.setBackground(drawable);
            textView.setTextColor(z2.h.getColor(this, 2131100377));
        } else {
            t.b.c.setRotation(0.0f);
            Drawable drawable2 = z2.h.getDrawable(this, 2131231206);
            TextView textView2 = t.D;
            textView2.setBackground(drawable2);
            textView2.setTextColor(z2.h.getColor(this, 2131100377));
        }
        t.b.c.setOnClickListener(new pe.a(this, 0));
        f0 f0Var = t.b;
        ((ImageView) f0Var.d).setVisibility(0);
        Object obj = f0Var.e;
        ((ImageView) obj).setVisibility(0);
        ((ImageView) f0Var.d).setOnClickListener(new pe.a(this, 1));
        ((ImageView) obj).setOnClickListener(new pe.a(this, 2));
        t.q.setOnClickListener(new pe.b(this, t, 0));
        t.r.setOnRefreshListener(this);
        Bundle extras2 = getIntent().getExtras();
        if (extras2 != null) {
            if (extras2.containsKey("group")) {
                GroupData serializableExtra = getIntent().getSerializableExtra("group");
                Intrinsics.f(serializableExtra, "null cannot be cast to non-null type com.bettertogether.remote.model.common.GroupData");
                GroupData groupData = serializableExtra;
                p u4 = u();
                u4.getClass();
                Intrinsics.checkNotNullParameter(groupData, "group");
                u4.f732e = groupData;
                aq.e eVar = new aq.e(new aq.e(new i(a0.d(groupData), new if.d(18, new pe.n(u4, 9)), 0), new me.r(21, new pe.n(u4, 10)), 2), new me.r(22, new pe.n(u4, 11)), 0);
                Intrinsics.checkNotNullExpressionValue(eVar, "fun setGroup(group: Grou…   .addDisposable()\n    }");
                com.bumptech.glide.d.m(u4, eVar);
            } else if (extras2.containsKey("group_id") && (intExtra = getIntent().getIntExtra("group_id", -1)) != -1) {
                p u5 = u();
                u5.getClass();
                aq.e eVar2 = new aq.e(new aq.e(new i(a0.d(Integer.valueOf(intExtra)), new if.d(19, new pe.n(u5, 0)), 0), new me.r(25, new pe.n(u5, 1)), 2), new me.r(26, new pe.n(u5, 2)), 0);
                Intrinsics.checkNotNullExpressionValue(eVar2, "fun fetchGroup(groupId: …   .addDisposable()\n    }");
                com.bumptech.glide.d.m(u5, eVar2);
            }
        }
        et.d.a("GroupDetailActivity initSegment", new Object[0]);
        if (!this.V) {
            this.Q = 0;
            try {
                GroupData groupData2 = u().f732e;
                String startDate = (groupData2 == null || (members2 = groupData2.getMembers()) == null || (userData2 = (UserData) members2.get(0)) == null || (dashboard2 = userData2.getDashboard()) == null || (stepsInfo2 = dashboard2.getStepsInfo()) == null || (dailyData2 = stepsInfo2.getDailyData()) == null) ? null : dailyData2.getStartDate();
                String endDate = (groupData2 == null || (members = groupData2.getMembers()) == null || (userData = (UserData) members.get(0)) == null || (dashboard = userData.getDashboard()) == null || (stepsInfo = dashboard.getStepsInfo()) == null || (dailyData = stepsInfo.getDailyData()) == null) ? null : dailyData.getEndDate();
                arrayList = (startDate == null || endDate == null) ? new ArrayList() : zf.a.g(startDate, endDate);
            } catch (Exception e3) {
                e3.printStackTrace();
                arrayList = new ArrayList();
            }
            this.P = arrayList;
            if (arrayList.size() > 0) {
                this.Q = this.P.size();
                A(true);
            }
            this.V = this.P.size() > 0;
            t().j.setVisibility(this.V ? 0 : 8);
            t().n.setVisibility(this.V ? 0 : 8);
            t().u.setText(s());
            this.S = t().u.getText().toString();
        }
        et.d.a("GroupDetailActivity initTabArrows inside", new Object[0]);
        t().j.setOnClickListener(new pe.a(this, 4));
        t().n.setOnClickListener(new pe.a(this, 5));
        k t2 = t();
        t2.B.setOnClickListener(new pe.b(this, t2, 1));
        t2.D.setOnClickListener(new pe.b(this, t2, 2));
        et.d.a("GroupDetailActivity initTabArrows end", new Object[0]);
        C();
        Bundle extras3 = getIntent().getExtras();
        if (extras3 != null && extras3.containsKey("open_subs_screen") && extras3.getBoolean("open_subs_screen") && !getPreferenceData().c() && !zf.d.b) {
            b0 b0Var = new b0();
            b0Var.d = true;
            nl.f.f(lh.d.b(m0.b), new pe.j(b0Var, this, (oq.c) null));
        }
        if (kotlin.jvm.internal.o.M(getPreferenceData()) || (extras = getIntent().getExtras()) == null || !extras.containsKey("open_story_for_new_user") || extras.getString("open_story_for_new_user") == null || Build.VERSION.SDK_INT < 33) {
            return;
        }
        jh.o.v(this, new pe.e(this, 1));
    }

    public final void onActivityResult(int i, int i2, Intent intent) {
        if (i2 == -1 && i == 1450) {
            String stringExtra = intent != null ? intent.getStringExtra("weeklyWeight") : null;
            Float valueOf = intent != null ? Float.valueOf(intent.getFloatExtra("targetWeight", 0.0f)) : null;
            int intExtra = intent != null ? intent.getIntExtra("currentWeek", 0) : 0;
            this.W = intExtra;
            Boolean valueOf2 = Boolean.valueOf(intExtra > 0 && valueOf != null && stringExtra != null && Float.parseFloat(stringExtra) <= valueOf.floatValue());
            this.N = valueOf2;
            if (Intrinsics.c(valueOf2, Boolean.TRUE)) {
                this.f207e = true;
            } else {
                this.f207e = false;
            }
        }
        super/*androidx.fragment.app.e0*/.onActivityResult(i, i2, intent);
    }

    public final void onBackPressed() {
        super/*androidx.activity.o*/.onBackPressed();
        a();
    }

    public final void onDialogDismiss() {
        if (this.f207e && this.W == 1 && getSupportFragmentManager().D("RateUsDialog") == null && !isFinishing()) {
            kotlin.jvm.internal.o.Q0(this, getPreferenceData(), this, new pe.g(this, true, 1));
        }
    }

    public final boolean onMenuItemClick(MenuItem menuItem) {
        Intrinsics.checkNotNullParameter(menuItem, "item");
        int itemId = menuItem.getItemId();
        if (itemId == 2131361883) {
            x(false);
            return true;
        }
        if (itemId != 2131361888) {
            return true;
        }
        w();
        return true;
    }

    public final void onRefresh() {
        u().g();
    }

    public final void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        Intrinsics.checkNotNullParameter(strArr, "permissions");
        Intrinsics.checkNotNullParameter(iArr, "grantResults");
        if (i == 1003) {
            if ((!(iArr.length == 0)) && iArr[0] == 0) {
                et.d.a("onRequestPermissionsResult NOTIFICATION_PERMISSION granted", new Object[0]);
            }
        }
        super/*androidx.fragment.app.e0*/.onRequestPermissionsResult(i, strArr, iArr);
    }

    public final void onResume() {
        super.onResume();
        if (isFinishing()) {
            return;
        }
        if (Intrinsics.c(this.N, Boolean.TRUE)) {
            this.N = Boolean.FALSE;
            new v().show(getSupportFragmentManager(), "WeeklyTargetWeightDialog");
        }
        u().g();
    }

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

    public final java.lang.String s() {
        throw new UnsupportedOperationException("Method not decompiled: com.bettertogether.screens.group.details.GroupDetailsActivity.s():java.lang.String");
    }

    public final void showLoadingDialog() {
        t().m.b();
    }

    public final void showWeightRecordButton(int i, float f, float f2, String str, boolean z, String str2, Integer num, boolean z2) {
        Intrinsics.checkNotNullParameter(str, "measureType");
        FloatingActionButton floatingActionButton = t().g;
        Intrinsics.checkNotNullExpressionValue(floatingActionButton, "this");
        fs.d.L(floatingActionButton, z2);
        fs.d.x(floatingActionButton);
        floatingActionButton.setOnClickListener(new fe.c(f, f2, i, 2, this, num, str, str2, z));
    }

    public final k t() {
        return (k) this.M.getValue();
    }

    public final p u() {
        return (p) this.w.getValue();
    }

    public final void v(GroupData groupData) {
        vl.h hVar;
        if (!cn.b.e().d("useAppsFlyerForDynamicLinks")) {
            showLoadingDialog();
            Intrinsics.checkNotNullParameter(kh.a.N, "<this>");
            synchronized (vl.h.class) {
                al.g c = al.g.c();
                synchronized (vl.h.class) {
                    hVar = (vl.h) c.b(vl.h.class);
                }
                Intrinsics.checkNotNullExpressionValue(hVar, "getInstance()");
                c1.F(hVar, new z8.r(25, groupData, this)).addOnSuccessListener(new a9.h(17, new pe.e(this, 4))).addOnFailureListener(new v2(this, 29));
                return;
            }
            Intrinsics.checkNotNullExpressionValue(hVar, "getInstance()");
            c1.F(hVar, new z8.r(25, groupData, this)).addOnSuccessListener(new a9.h(17, new pe.e(this, 4))).addOnFailureListener(new v2(this, 29));
            return;
        }
        p u4 = u();
        f fVar = new f(this, 1);
        f fVar2 = new f(this, 2);
        Intrinsics.checkNotNullParameter(this, "<this>");
        Intrinsics.checkNotNullParameter(u4, aXauN.tjCRVyIjuyfdbZ);
        Intrinsics.checkNotNullParameter(groupData, "group");
        Intrinsics.checkNotNullParameter(fVar, "showLoadingDialog");
        Intrinsics.checkNotNullParameter(fVar2, "hideLoadingDialog");
        fVar.invoke();
        UserData userData = u4.f731d;
        Intrinsics.e(userData);
        String source = userData.getSource();
        LinkGenerator generateInviteUrl = ShareInviteHelper.generateInviteUrl(this);
        generateInviteUrl.addParameter("source", source);
        generateInviteUrl.addParameter("af_sub1", source);
        generateInviteUrl.addParameter("deep_link_sub1", source);
        String inviteUrl = groupData.getInviteUrl();
        UserData userData2 = u4.f731d;
        Intrinsics.e(userData2);
        Log.e("WhichISCalledFirst", "inviteMembers: CodeChecking  " + ag.f.g(jh.h.c(inviteUrl, userData2.getSource()).toString()));
        String inviteUrl2 = groupData.getInviteUrl();
        UserData userData3 = u4.f731d;
        Intrinsics.e(userData3);
        generateInviteUrl.addParameter("af_dp", ag.f.g(jh.h.c(inviteUrl2, userData3.getSource()).toString()));
        String inviteUrl3 = groupData.getInviteUrl();
        UserData userData4 = u4.f731d;
        Intrinsics.e(userData4);
        generateInviteUrl.addParameter("deep_link_value", ag.f.g(jh.h.c(inviteUrl3, userData4.getSource()).toString()));
        generateInviteUrl.addParameter("request_from", "appsFlyer");
        generateInviteUrl.addParameter("af_siteid", "BetterTogether");
        generateInviteUrl.addParameter("af_web_dp", "https://www.bettertogether-app.com/mobile-link/");
        generateInviteUrl.addParameter("af_title", getString(2131951687));
        generateInviteUrl.addParameter("af_description", getString(2131952361));
        generateInviteUrl.addParameter("af_android_url", "https://play.google.com/store/apps/details?id=com.bettertogether.us");
        generateInviteUrl.addParameter("af_ios_url", "https://apps.apple.com/app/id1503465416");
        generateInviteUrl.addParameter("af_ios_fallback_url", "https://apps.apple.com/app/id1503465416");
        generateInviteUrl.addParameter("af_ios_image_url", "https://www.bettertogether-app.com/wp-content/uploads/2022/12/BT-Full-Color-Large_2x-8-1-1024x496.png");
        generateInviteUrl.setBrandDomain("links.bettertogether-app.com");
        generateInviteUrl.generateLink(this, new ag.b(this, fVar2));
    }

    public final void w() {
        Serializable serializable = u().f732e;
        Integer h2 = u().h();
        if (serializable == null || h2 == null) {
            return;
        }
        int intValue = h2.intValue();
        Intent n = EditGroupActivity.M.n(this);
        n.putExtra("group", serializable);
        n.putExtra("myId", intValue);
        startActivity(n);
    }

    public final void x(boolean z) {
        Serializable serializable = u().f732e;
        if (serializable != null) {
            Intent intent = new Intent((Context) this, (Class<?>) ChatActivity.class);
            intent.setFlags(268435456);
            intent.putExtra("group", serializable);
            intent.putExtra("ask notification permission", z);
            startActivity(intent);
        }
    }
}