导航菜单

页面标题

页面副标题

Fancy Optimizer v4.6.3 - BatteryInfoMainActivity.java 源代码

正在查看: Fancy Optimizer v4.6.3 应用的 BatteryInfoMainActivity.java JAVA 源代码文件

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


package com.fancyclean.boost.batteryinfo.ui.activity;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.media.b;
import android.text.SpannableString;
import android.text.style.AbsoluteSizeSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.adtiny.core.d;
import com.fancyclean.boost.batteryinfo.ui.presenter.BatteryInfoMainPresenter;
import com.fancyclean.boost.batteryinfo.ui.view.BatteryChartCompositeView;
import com.fancyclean.boost.batteryinfo.ui.view.BatteryEstimateView;
import com.fancyclean.boost.batteryinfo.ui.view.BatteryInfoGridView;
import com.fancyclean.boost.main.ui.view.FullSizeScrollView;
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
import com.thinkyeah.common.ui.view.TitleBar;
import gl.d;
import java.util.Locale;
import k6.c;
import v7.a;
import vj.h;
import vj.l;

@d(BatteryInfoMainPresenter.class)
public class BatteryInfoMainActivity extends a<Object> implements m6.a {
    public static final int v = 0;
    public FullSizeScrollView l;
    public View m;
    public ImageView n;
    public TextView o;
    public BatteryEstimateView p;
    public BatteryInfoGridView q;
    public BatteryChartCompositeView r;
    public BatteryChartCompositeView s;
    public Handler t;
    public int u = 0;

    static {
        String str = h.b;
    }

    @Override
    public final void D(int i) {
        String str;
        switch (i) {
            case 1:
                str = "UNKNOWN";
                break;
            case 2:
                str = "GOOD";
                break;
            case 3:
                str = "OVERHEAT";
                break;
            case 4:
                str = "DEAD";
                break;
            case 5:
                str = "OVER VOLTAGE";
                break;
            case 6:
                str = "FAILURE";
                break;
            case 7:
                str = "COLD";
                break;
            default:
                l.a().b(new IllegalArgumentException(b.i("Unknown battery health state: ", i)));
                str = "UNDEFINED";
                break;
        }
        this.q.b(0, str);
    }

    @Override
    public final void N2(c cVar) {
        BatteryEstimateView batteryEstimateView = this.p;
        batteryEstimateView.getClass();
        int i = cVar.b;
        if (i < 0) {
            throw new IllegalArgumentException("voltage smaller than 0");
        }
        float f = cVar.a;
        float f10 = (i * f) / 1000000.0f;
        batteryEstimateView.g.setText(String.format("%.2f Watt", Float.valueOf(f10)));
        if (f10 >= 10.0f) {
            batteryEstimateView.i.setText(batteryEstimateView.getResources().getString(2131887379));
        } else {
            batteryEstimateView.i.setText(batteryEstimateView.getResources().getString(2131887264));
        }
        batteryEstimateView.j.setText(batteryEstimateView.getResources().getString(2131887253));
        V(cVar.b);
        BatteryChartCompositeView batteryChartCompositeView = this.r;
        Locale locale = Locale.US;
        batteryChartCompositeView.setLeftValue(String.format(locale, "%.1f", Float.valueOf(f)));
        this.s.setLeftValue(String.format(locale, "%.1f", Float.valueOf(cVar.c)));
        this.r.a();
        this.s.a();
    }

    @Override
    public final void V(int i) {
        this.q.b(3, String.format(Locale.US, "%d mV", Integer.valueOf(i)));
    }

    public final void finish() {
        com.adtiny.core.d.b().h(this, "I_BatteryInfo", (d.l) null);
        super/*android.app.Activity*/.finish();
    }

    @Override
    public final void l(long j) {
        BatteryEstimateView batteryEstimateView = this.p;
        TextView textView = batteryEstimateView.c;
        Locale locale = Locale.US;
        textView.setText(String.format(locale, "%02d", Long.valueOf(j / 3600000)));
        batteryEstimateView.d.setText(String.format(locale, "%02d", Long.valueOf((j % 3600000) / ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS)));
    }

    @Override
    public final void m(long j) {
        BatteryEstimateView batteryEstimateView = this.p;
        TextView textView = batteryEstimateView.c;
        Locale locale = Locale.US;
        textView.setText(String.format(locale, "%02d", Long.valueOf(j / 3600000)));
        batteryEstimateView.d.setText(String.format(locale, "%02d", Long.valueOf((j % 3600000) / ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS)));
    }

    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(2131558449);
        this.t = new Handler(Looper.getMainLooper());
        TitleBar.a configure = findViewById(2131363196).getConfigure();
        configure.f(getResources().getString(2131887876));
        configure.g(new t4.d(this, 6));
        configure.a();
        this.u = y7.b.a(this).c;
        this.l = (FullSizeScrollView) findViewById(2131363826);
        this.m = findViewById(2131362219);
        this.n = (ImageView) findViewById(2131362412);
        this.o = (TextView) findViewById(2131363531);
        this.p = (BatteryEstimateView) findViewById(2131363744);
        this.q = (BatteryInfoGridView) findViewById(2131363745);
        BatteryChartCompositeView batteryChartCompositeView = (BatteryChartCompositeView) findViewById(2131363758);
        this.r = batteryChartCompositeView;
        batteryChartCompositeView.setSubject(getResources().getString(2131886769));
        this.r.setLeftTitle(getResources().getString(2131887390));
        this.r.setRightTitle(getResources().getString(2131886203));
        this.r.setLeftUnit("mA");
        this.r.setRightUnit("mA");
        this.r.setLineChartContent(0);
        BatteryChartCompositeView batteryChartCompositeView2 = (BatteryChartCompositeView) findViewById(2131363759);
        this.s = batteryChartCompositeView2;
        batteryChartCompositeView2.setSubject(getResources().getString(2131886220));
        this.s.setLeftTitle(getResources().getString(2131887391));
        this.s.setRightTitle(getResources().getString(2131886204));
        String str = com.google.ads.mediation.unity.b.v(this) == 1 ? "℃" : "℉";
        this.s.setLeftUnit(str);
        this.s.setRightUnit(str);
        this.s.setLineChartContent(1);
        if (bundle == null) {
            long currentTimeMillis = System.currentTimeMillis();
            SharedPreferences sharedPreferences = getSharedPreferences("battery_info", 0);
            SharedPreferences.Editor edit = sharedPreferences == null ? null : sharedPreferences.edit();
            if (edit == null) {
                return;
            }
            edit.putLong("last_entered_battery_info_time", currentTimeMillis);
            edit.apply();
        }
    }

    @Override
    public final void r(float f) {
        int i = (int) f;
        this.o.setText(String.format("%d%%", Integer.valueOf(i)));
        int i10 = (i * this.u) / 100;
        String valueOf = String.valueOf(i10);
        String format = String.format(Locale.US, "%s / %d mAh", Integer.valueOf(i10), Integer.valueOf(this.u));
        SpannableString spannableString = new SpannableString(format);
        spannableString.setSpan(new AbsoluteSizeSpan((int) ((Resources.getSystem().getDisplayMetrics().scaledDensity * 15.0f) + 0.5f)), valueOf.length() + 1, format.length(), 34);
        View view = (View) this.q.c.get(1);
        if (view == null) {
            return;
        }
        ((BatteryInfoGridView.a) view.getTag()).a.setText(spannableString);
    }

    @Override
    public final void t1(String str, boolean z10) {
        if (z10) {
            this.l.smoothScrollTo(0, 0);
            this.t.postDelayed(new d.b(7, this, str), 500L);
        } else {
            this.n.setVisibility(8);
            this.p.a(str, false);
        }
    }

    @Override
    public final void x2(String str) {
        this.q.b(2, str);
    }

    @Override
    public final Context getContext() {
        return this;
    }
}