QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 BottomOperationService.java 源代码,内容仅作参考


package com.tencent.mtt.browser.homepage.xhome;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tencent.mtt.R;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.PCGStatManager;
import com.tencent.mtt.browser.homepage.fastcut.report.FastCutReportHelper;
import com.tencent.mtt.browser.homepage.xhome.background.OnOpSkinChangedListener;
import com.tencent.mtt.browser.homepage.xhome.background.XHomeBackgroundSkinOpManager;
import com.tencent.mtt.browser.homepage.xhome.bottom.IBottomOperationService;
import com.tencent.mtt.browser.setting.manager.SkinManagerNew;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.logcontroller.facade.ILogService;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.net.URLEncoder;

public class BottomOperationService implements View.OnClickListener, OnOpSkinChangedListener, IBottomOperationService {

    public static final int f41303a = MttResources.s(11);

    public static final int f41304b = MttResources.s(8);

    public static final String f41305c = "qb://qlight?reurl=" + URLEncoder.encode("https://bbs.mb.qq.com/mobilefb/fb");

    private TextView f41306d;
    private TextView e;

    private void a(Context context, LinearLayout linearLayout) {
        this.f41306d = new TextView(context);
        this.f41306d.setPadding(0, MttResources.s(10), MttResources.s(5), MttResources.s(10));
        this.f41306d.setId(R.id.xhome_bottom_feedback);
        this.f41306d.setText("我要反馈");
        this.f41306d.setGravity(17);
        this.f41306d.setIncludeFontPadding(false);
        this.f41306d.setOnClickListener(this);
        a(this.f41306d);
        this.f41306d.setTextSize(0, f41303a);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 16;
        linearLayout.addView(this.f41306d, layoutParams);
        PCGStatManager.d(this.f41306d, "100109");
        PCGStatManager.e(this.f41306d, "3");
        PCGStatManager.b(this.f41306d, "logging_status", FastCutReportHelper.j());
    }

    private void a(TextView textView) {
        int parseColor;
        if (textView == null) {
            return;
        }
        if (!SkinManagerNew.b().j()) {
            if (SkinManagerNew.b().f()) {
            }
            SimpleSkinBuilder.a(textView).g(R.color.theme_common_color_a2).j(102).f();
            return;
        } else {
            if (XHomeBackgroundSkinOpManager.getInstance().getSkinType() != 2) {
            }
            parseColor = Color.parseColor("#B2FFFFFF");
        }
        textView.setTextColor(parseColor);
    }

    private void b(Context context, LinearLayout linearLayout) {
        View view = new View(context);
        SimpleSkinBuilder.a(view).a(R.color.theme_common_color_a2).c().f();
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(1, f41303a);
        int i = f41304b;
        layoutParams.leftMargin = i;
        layoutParams.rightMargin = i;
        layoutParams.gravity = 16;
        linearLayout.addView(view, layoutParams);
    }

    private void b(TextView textView) {
        int parseColor;
        if (textView == null) {
            return;
        }
        textView.setOnClickListener(this);
        if (!SkinManagerNew.b().j()) {
            if (SkinManagerNew.b().f()) {
            }
            SimpleSkinBuilder.a(textView).g(R.color.theme_common_color_a2).j(102).f();
            return;
        } else {
            if (XHomeBackgroundSkinOpManager.getInstance().getSkinType() != 2) {
            }
            parseColor = Color.parseColor("#B2FFFFFF");
        }
        textView.setTextColor(parseColor);
    }

    private LinearLayout c(Context context) {
        LinearLayout linearLayout = new LinearLayout(context);
        linearLayout.setGravity(1);
        linearLayout.setOrientation(0);
        return linearLayout;
    }

    private void c(Context context, LinearLayout linearLayout) {
        this.e = new TextView(context);
        this.e.setPadding(MttResources.s(5), MttResources.s(10), 0, MttResources.s(10));
        this.e.setId(R.id.xhome_bottom_setting);
        this.e.setText("更多设置");
        this.e.setGravity(17);
        this.e.setIncludeFontPadding(false);
        b(this.e);
        this.e.setTextSize(0, f41303a);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 16;
        linearLayout.addView(this.e, layoutParams);
        PCGStatManager.d(this.e, "100108");
        PCGStatManager.e(this.e, "3");
        PCGStatManager.b(this.e, "logging_status", FastCutReportHelper.j());
    }

    @Override
    public void a() {
        XHomeBackgroundSkinOpManager.getInstance().registerOpSkinListener(this);
    }

    @Override
    public void a(int i, Bitmap bitmap) {
        a(this.f41306d);
        b(this.e);
    }

    @Override
    public void a(boolean z) {
    }

    @Override
    public LinearLayout a(Context context) {
        LinearLayout c2 = c(context);
        c(context, c2);
        b(context, c2);
        a(context, c2);
        return c2;
    }

    @Override
    public void b() {
    }

    @Override
    public void b(boolean z) {
    }

    @Override
    public void c() {
    }

    @Override
    public void d() {
        XHomeBackgroundSkinOpManager.getInstance().unRegisterOpSkinListener(this);
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        int id = view.getId();
        if (id == R.id.xhome_bottom_setting) {
            ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams("qb://setting").d(true));
            FastCutReportHelper.a();
        } else if (id == R.id.xhome_bottom_feedback) {
            ((ILogService) QBContext.getInstance().getService(ILogService.class)).showUserFeedBackToast();
            new UrlParams(f41305c).b(1).e();
            FastCutReportHelper.b();
        }
        EventCollector.getInstance().onViewClicked(view);
    }

    @Override
    public void onSkinChange() {
        a(this.f41306d);
        b(this.e);
    }
}