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

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


package com.tencent.mtt.msgcenter.aggregation.view;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.tencent.mtt.R;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.ui.widget.QBWebImageView;
import com.tencent.mtt.browser.share.export.socialshare.qqshare.QQShareActivity;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.resource.QBViewInterface;
import com.tencent.mtt.sdkcontext.SDKContext;
import com.tencent.mtt.setting.BaseSettings;
import com.tencent.mtt.view.layout.QBLinearLayout;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import qb.a.e;

public class V3PersonalUnLoginView extends QBLinearLayout implements View.OnClickListener {

    String f67881a;

    final boolean f67882b;

    final boolean f67883c;

    final boolean f67884d;
    final boolean e;
    public QBLinearLayout f;
    public QBLinearLayout g;
    private final QBLinearLayout h;

    public V3PersonalUnLoginView(Context context) {
        super(context);
        this.f67881a = MttResources.l(R.string.acl);
        this.f = null;
        this.g = null;
        int checkCanUseFastLoginForOutUser = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).checkCanUseFastLoginForOutUser(context, 0);
        this.f67882b = (checkCanUseFastLoginForOutUser & 1) == 1;
        this.f67883c = (checkCanUseFastLoginForOutUser & 2) == 2;
        this.f67884d = this.f67882b && this.f67883c && a();
        this.e = this.f67882b && this.f67883c && b();
        this.h = (QBLinearLayout) QBLinearLayout.inflate(context, R.layout.ts, this);
        View findViewById = this.h.findViewById(R.id.login_sheet_main);
        this.f = (QBLinearLayout) this.h.findViewById(R.id.login_sheet_qq_btn);
        this.g = (QBLinearLayout) this.h.findViewById(R.id.login_sheet_wx_btn);
        for (int i : new int[]{R.id.login_sheet_main_bg, R.id.login_sheet_qq_btn, R.id.login_sheet_wx_btn, R.id.login_sheet_pre_head, R.id.login_sheet_switch_btn, R.id.login_sheet_qq_text, R.id.login_sheet_wechat_text, R.id.login_sheet_qq_icon, R.id.login_sheet_wechat_icon}) {
            View findViewById2 = this.h.findViewById(i);
            if (findViewById2 instanceof QBViewInterface) {
                ((QBViewInterface) findViewById2).setUseMaskForNightMode(true);
            } else {
                SimpleSkinBuilder.a(findViewById2).f();
            }
        }
        SimpleSkinBuilder.a(this.f).c(e.K).f();
        SimpleSkinBuilder.a(this.g).c(e.K).f();
        a(this.f67884d || this.e);
        this.f.setOnClickListener(this);
        this.g.setOnClickListener(this);
        this.h.findViewById(R.id.login_sheet_switch_btn).setOnClickListener(this);
        this.h.findViewById(R.id.login_sheet_close_btn).setOnClickListener(this);
        this.h.setOnClickListener(this);
        findViewById.setOnClickListener(null);
    }

    public static boolean a() {
        int previousLoginType = getPreviousLoginType();
        return previousLoginType == 1 || previousLoginType == 4;
    }

    public static boolean b() {
        return getPreviousLoginType() == 2;
    }

    public static int getPreviousLoginType() {
        return BaseSettings.a().getInt("key_pre_login_type", -1);
    }

    void a(boolean z) {
        String str;
        QBLinearLayout qBLinearLayout;
        String str2 = this.f67881a;
        if (str2.length() > 7) {
            String substring = this.f67881a.substring(0, 7);
            str = substring;
            str2 = substring + "\n" + this.f67881a.substring(7);
        } else {
            str = str2;
        }
        TextView textView = (TextView) this.h.findViewById(R.id.login_sheet_title_0);
        TextView textView2 = (TextView) this.h.findViewById(R.id.login_sheet_title_1);
        textView.setText(str2);
        textView2.setText(str);
        int i = 8;
        textView.setVisibility(z ? 8 : 0);
        for (int i2 : new int[]{R.id.login_sheet_pre_head, R.id.login_sheet_pre_type_tips, R.id.login_sheet_switch_btn, R.id.login_sheet_title_1}) {
            this.h.findViewById(i2).setVisibility(z ? 0 : 8);
        }
        if (z) {
            String string = BaseSettings.a().getString("key_pre_login_portrait", "");
            if (TextUtils.isEmpty(string)) {
                string = "https://dldir1.qq.com/invc/tt/QB/Public/usercenter/icon/usercenter_unlogin_icon.png";
            }
            QBWebImageView qBWebImageView = (QBWebImageView) this.h.findViewById(R.id.login_sheet_pre_head);
            qBWebImageView.setIsCircle(true);
            qBWebImageView.setUrl(string);
            qBWebImageView.setEnableNoPicMode(false);
            this.f.setVisibility(this.f67884d ? 0 : 8);
            qBLinearLayout = this.g;
        } else {
            boolean z2 = this.f67882b;
            if (z2 == this.f67883c) {
                this.f.setVisibility(0);
                this.g.setVisibility(0);
                return;
            } else {
                this.f.setVisibility(z2 ? 0 : 8);
                qBLinearLayout = this.g;
            }
        }
        qBLinearLayout.setVisibility(i);
    }

    @Override
    public void onClick(View view) {
        EventCollector.getInstance().onViewClickedBefore(view);
        if (view.getId() == R.id.login_sheet_switch_btn) {
            a(false);
        } else if (view.getId() == R.id.login_sheet_close_btn) {
            setVisibility(8);
        }
        if (view == this.g) {
            Bundle bundle = new Bundle();
            bundle.putInt(QQShareActivity.KEY_FROM_WHERE, 33);
            ((IAccount) SDKContext.getInstance().getService(IAccount.class)).doQuickLoginWechat(bundle);
        } else if (view == this.f) {
            Bundle bundle2 = new Bundle();
            bundle2.putInt(QQShareActivity.KEY_FROM_WHERE, 33);
            ((IAccount) SDKContext.getInstance().getService(IAccount.class)).doQuickLoginQQ(bundle2);
        }
        EventCollector.getInstance().onViewClicked(view);
    }
}