导航菜单

页面标题

页面副标题

零界绘 v1.0.2 - ReadFontActivity.java 源代码

正在查看: 零界绘 v1.0.2 应用的 ReadFontActivity.java JAVA 源代码文件

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


package com.junyue.novel.modules.reader.ui;

import android.view.View;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.junyue.basic.activity.BaseActivity;
import com.junyue.basic.widget.StatusLayout;
import com.junyue.novel.modules.reader.adapter.FontRvAdapter;
import com.junyue.novel.modules.reader.bean.CorrectTag;
import com.junyue.novel.modules.reader.bean.Font;
import com.junyue.novel.modules_reader.R;
import com.junyue.novel.sharebean.NovelDetail;
import com.junyue.novel.sharebean.NovelDetailWithChapters;
import com.junyue.novel.sharebean.SimpleChapterBean;
import com.junyue.novel.sharebean.SimpleNovelBean;
import com.junyue.novel.sharebean.reader.TxtChapter;
import f.p.c.r.h;
import f.p.c.r.j;
import f.p.g.g.d.h.c;
import f.p.g.g.d.h.d;
import f.p.g.g.d.h.e;
import i.b0.c.u;
import i.t;
import java.util.List;
import kotlin.jvm.functions.Function1;

@j({d.class})
public final class ReadFontActivity extends BaseActivity implements e {
    public final i.d E = f.n.a.a.a.a(this, R.id.rv_font);
    public final i.d F = f.n.a.a.a.a(this, R.id.tv_font_preview);
    public Font G;
    public boolean H;
    public final FontRvAdapter I;
    public final i.d J;
    public StatusLayout K;

    public static final class a implements View.OnClickListener {
        public a() {
        }

        @Override
        public final void onClick(View view) {
            ReadFontActivity.this.H0();
        }
    }

    public static final class b extends u implements Function1<Font, t> {
        public b() {
            super(1);
        }

        public final void b(Font font) {
            i.b0.c.t.e(font, "it");
            ReadFontActivity readFontActivity = ReadFontActivity.this;
            readFontActivity.H = readFontActivity.G.c() != font.c();
            ReadFontActivity.this.h1().setTypeface(font.d(ReadFontActivity.this));
        }

        public Object invoke(Object obj) {
            b((Font) obj);
            return t.a;
        }
    }

    public ReadFontActivity() {
        f.p.g.g.d.i.r.a b2 = f.p.g.g.d.i.r.a.b();
        i.b0.c.t.d(b2, "ReadSettingManager.getInstance()");
        Font g2 = b2.g();
        i.b0.c.t.d(g2, "ReadSettingManager.getInstance().readFont");
        this.G = g2;
        this.I = new FontRvAdapter(new b());
        this.J = h.d(this, 0, 1, null);
    }

    @Override
    public void D(TxtChapter txtChapter) {
        i.b0.c.t.e(txtChapter, "current");
        e.a.b(this, txtChapter);
    }

    @Override
    public void H0() {
        StatusLayout statusLayout = this.K;
        if (statusLayout == null) {
            i.b0.c.t.t("mSl");
            throw null;
        }
        statusLayout.A();
        f1().P();
    }

    @Override
    public int I0() {
        return R.layout.activity_read_font;
    }

    @Override
    public void O0() {
        g1().setAdapter(this.I);
        StatusLayout q = StatusLayout.q(findViewById(R.id.ll_container));
        i.b0.c.t.d(q, "StatusLayout.createDefau…d.ll_container)\n        )");
        this.K = q;
        if (q == null) {
            i.b0.c.t.t("mSl");
            throw null;
        }
        q.setRetryOnClickListener(new a());
        if (this.G.j()) {
            return;
        }
        h1().setTypeface(this.G.d(this));
    }

    @Override
    public void R() {
        e.a.c(this);
    }

    @Override
    public void S(List<? extends Font> list) {
        i.b0.c.t.e(list, "font");
        this.I.D(list);
        this.I.F(getContext());
        StatusLayout statusLayout = this.K;
        if (statusLayout != null) {
            statusLayout.B();
        } else {
            i.b0.c.t.t("mSl");
            throw null;
        }
    }

    @Override
    public void b(Throwable th, Object obj) {
        StatusLayout statusLayout = this.K;
        if (statusLayout != null) {
            statusLayout.t();
        } else {
            i.b0.c.t.t("mSl");
            throw null;
        }
    }

    public final c f1() {
        return (c) this.J.getValue();
    }

    public void finish() {
        if (this.H) {
            setResult(-1);
        }
        super/*android.app.Activity*/.finish();
    }

    @Override
    public void g(List<? extends SimpleNovelBean> list) {
        i.b0.c.t.e(list, "novels");
        e.a.h(this, list);
    }

    public final RecyclerView g1() {
        return (RecyclerView) this.E.getValue();
    }

    public final TextView h1() {
        return (TextView) this.F.getValue();
    }

    @Override
    public void l() {
        e.a.d(this);
    }

    public void onDestroy() {
        super.onDestroy();
        this.I.G();
    }

    @Override
    public void p0(NovelDetail novelDetail) {
        i.b0.c.t.e(novelDetail, "novelDetail");
        e.a.j(this, novelDetail);
    }

    @Override
    public void s(int i, int i2, boolean z) {
        e.a.a(this, i, i2, z);
    }

    @Override
    public void t(List<? extends CorrectTag> list) {
        i.b0.c.t.e(list, "tags");
        e.a.i(this, list);
    }

    @Override
    public void v0(NovelDetailWithChapters novelDetailWithChapters) {
        e.a.f(this, novelDetailWithChapters);
    }

    @Override
    public void z(List<? extends SimpleChapterBean> list) {
        i.b0.c.t.e(list, "chapters");
        e.a.e(this, list);
    }
}