正在查看: BetterTogether v3.0.0 应用的 HealthConnectActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: BetterTogether v3.0.0 应用的 HealthConnectActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bettertogether.healthConnect;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Build;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.View;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.constraintlayout.widget.ConstraintLayout;
import bc.j;
import com.bettertogether.cache.preferences.PreferenceData;
import com.google.firebase.messaging.e;
import e.b;
import f.d;
import hr.m0;
import hr.v1;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.CancellationException;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.g0;
import lq.m;
import lq.n;
import lq.o;
import lq.x;
import md.a0;
import md.k;
import md.y;
import nl.f;
import o9.l0;
import s6.s;
import s6.t;
import s8.h;
import w1.v2;
import xs.c;
import ys.a;
import zc.l;
@Metadata
public final class HealthConnectActivity extends l implements a0 {
public static final t M = new t(20, 0);
public final m f4926e;
public final x f4927i;
public v1 f4928v;
public final x f4929w;
public b f4930x;
public b f4931y;
public HealthConnectActivity() {
h s10 = e.s(this);
this.f4926e = n.a(o.f13215d, new md.l(((a) s10.a).a(e.o(), new c(g0.a(HealthConnectActivity.class))), new md.c(this, 4), 0));
this.f4927i = n.b(new md.c(this, 3));
this.f4929w = n.b(new md.c(this, 0));
}
public final PreferenceData getPreferenceData() {
return (PreferenceData) this.f4927i.getValue();
}
public static void w(HealthConnectActivity healthConnectActivity, Set set) {
Intrinsics.checkNotNullParameter(healthConnectActivity, "this$0");
if (Build.VERSION.SDK_INT >= 34) {
int i10 = 0;
int i11 = healthConnectActivity.getPreferenceData().a.getInt("health_connect_open", 0);
Intrinsics.checkNotNullExpressionValue(set, "it");
if (!set.isEmpty()) {
healthConnectActivity.getPreferenceData().s(0, "health_connect_open");
return;
}
if (i11 < 2) {
healthConnectActivity.getPreferenceData().s(i11 + 1, "health_connect_open");
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(healthConnectActivity);
builder.setCancelable(true);
builder.setTitle(2131951687);
builder.setMessage(2131952052);
builder.create();
builder.setPositiveButton(2131952365, new dd.h(healthConnectActivity, 4));
builder.setNegativeButton(2131951723, new md.b(i10));
builder.show();
}
}
public final View getView() {
ConstraintLayout constraintLayout = y().f4310a;
Intrinsics.checkNotNullExpressionValue(constraintLayout, "binding.root");
return constraintLayout;
}
public final boolean hasFitbitConnected() {
return s.l().f9221b.b();
}
@Override
public final void hideLoadingDialog() {
enableViews();
}
@Override
public final void initViews() {
this.f4931y = registerForActivityResult(new d(), new l0(6));
z().f13778c.getClass();
Intrinsics.checkNotNullParameter("com.google.android.apps.healthdata", "providerPackageName");
int i10 = 0;
this.f4930x = registerForActivityResult(new e4.a("com.google.android.apps.healthdata", 0), new v2(this, 20));
et.d.a("HealthConnectActivity initViews", new Object[0]);
cd.l y10 = y();
Locale locale = Locale.getDefault();
Intrinsics.checkNotNullExpressionValue(locale, "getDefault()");
char c10 = 1;
if (TextUtils.getLayoutDirectionFromLocale(locale) == 1) {
y10.f4311b.f4223c.setRotation(180.0f);
} else {
y10.f4311b.f4223c.setRotation(0.0f);
}
y10.f4311b.f4223c.setOnClickListener(new j(this, 13));
cd.l y11 = y();
y11.f4314e.setTextSize(13.0f);
String str = getString(2131951869) + ", " + getString(2131951865) + ", " + getString(2131952612) + ", " + getString(2131951716);
Intrinsics.checkNotNullExpressionValue(str, "toString(...)");
y11.f4314e.setText(str);
String string = getString(2131952053);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.health_connect_text)");
md.e eVar = new md.e(this, i10);
SpannableString spannableString = new SpannableString(string);
z().getClass();
Pair e10 = y.e(string, "Health Connect");
spannableString.setSpan(eVar, ((Number) e10.f12190d).intValue(), ((Number) e10.f12191e).intValue(), 33);
y().f4313d.setText(spannableString);
y().f4313d.setMovementMethod(LinkMovementMethod.getInstance());
String string2 = getString(2131952051);
Intrinsics.checkNotNullExpressionValue(string2, "getString(R.string.health_connect_info)");
md.e eVar2 = new md.e(this, c10 == true ? 1 : 0);
SpannableString spannableString2 = new SpannableString(string2);
y z4 = z();
String string3 = getString(2131952396);
Intrinsics.checkNotNullExpressionValue(string3, "getString(R.string.privacy_policy)");
z4.getClass();
Pair e11 = y.e(string2, string3);
spannableString2.setSpan(eVar2, ((Number) e11.f12190d).intValue(), ((Number) e11.f12191e).intValue(), 33);
y().f4315f.setText(spannableString2);
y().f4315f.setMovementMethod(LinkMovementMethod.getInstance());
AppCompatCheckBox appCompatCheckBox = y().f4312c;
appCompatCheckBox.setChecked((!z().f13778c.a() || getPreferenceData().e() || hasFitbitConnected()) ? false : true);
appCompatCheckBox.setOnClickListener(new fc.a(6, this, appCompatCheckBox));
if (getPreferenceData().e() || hasFitbitConnected()) {
y().f4312c.setChecked(false);
z().f13778c.p(false);
y z10 = z();
z10.getClass();
f.O(lh.d.b(m0.b), (kotlin.coroutines.a) null, 0, new md.x(z10, null), 3);
}
}
public final void onActivityResult(int i10, int i11, Intent intent) {
super/*zc.u*/.onActivityResult(i10, i11, intent);
f.O(lh.d.b(m0.b), (kotlin.coroutines.a) null, 0, new md.h(i11, this, null), 3);
}
public final void onDestroy() {
super/*androidx.fragment.app.e0*/.onDestroy();
try {
v1 v1Var = this.f4928v;
if (v1Var != null) {
v1Var.c((CancellationException) null);
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
public final void onResume() {
super/*com.bettertogether.base.BaseActivity*/.onResume();
if (((Boolean) z().f13778c.j().f12190d).booleanValue()) {
f.O(lh.d.b(m0.b), (kotlin.coroutines.a) null, 0, new k(this, null), 3);
} else {
y().f4312c.setChecked(false);
}
if (Build.VERSION.SDK_INT >= 34) {
f.O(lh.d.b(m0.b), (kotlin.coroutines.a) null, 0, new md.j(this, (oq.c) null), 3);
}
}
public final ad.a providePresenter() {
return z();
}
@Override
public final void showLoadingDialog() {
disableViews();
}
public final cd.l y() {
return (cd.l) this.f4929w.getValue();
}
public final y z() {
return (y) this.f4926e.getValue();
}
}