TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c

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


package com.tencent.biz.pubaccount;

import android.app.Activity;
import android.app.Dialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.tencent.av.utils.UITools;
import com.tencent.biz.ProtoUtils;
import com.tencent.biz.pubaccount.AccountDetail.bean.AccountDetailDynamicInfo;
import com.tencent.biz.pubaccount.AccountDetail.bean.DynamicInfo;
import com.tencent.biz.pubaccount.AccountDetail.model.AccountDetailDynamicDataManager;
import com.tencent.biz.pubaccount.AccountDetail.model.AccountDetailDynamicListModel;
import com.tencent.biz.pubaccount.AccountDetail.view.AccountDetailXListView;
import com.tencent.biz.pubaccount.PaConfigAttr;
import com.tencent.biz.pubaccount.PhotoWallViewForAccountDetail;
import com.tencent.biz.pubaccount.readinjoy.common.ReadInJoyTimeUtils;
import com.tencent.biz.pubaccount.serviceAccountFolder.ServiceAccountFolderManager;
import com.tencent.biz.pubaccount.util.PADetailReportUtil;
import com.tencent.biz.pubaccount.util.ProfileParams;
import com.tencent.biz.pubaccount.util.PublicAccountUtil;
import com.tencent.biz.troopbar.ShareActionSheet;
import com.tencent.biz.webviewplugin.NewerGuidePlugin;
import com.tencent.biz.widgets.ShareAioResultDialog;
import com.tencent.image.URLDrawable;
import com.tencent.image.URLImageView;
import com.tencent.mobileqq.activity.ChatActivity;
import com.tencent.mobileqq.activity.FriendProfileImageAvatar;
import com.tencent.mobileqq.activity.FriendProfileImageModel;
import com.tencent.mobileqq.activity.PublicAccountSearchActivity;
import com.tencent.mobileqq.activity.QQBrowserActivity;
import com.tencent.mobileqq.activity.SplashActivity;
import com.tencent.mobileqq.activity.aio.AIOUtils;
import com.tencent.mobileqq.activity.aio.rebuild.BusinessCmrTmpChatPie;
import com.tencent.mobileqq.activity.aio.rebuild.PublicAccountChatPie;
import com.tencent.mobileqq.activity.recent.RecentUtil;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.BaseActivity;
import com.tencent.mobileqq.app.FontSettingManager;
import com.tencent.mobileqq.app.FriendListObserver;
import com.tencent.mobileqq.app.PublicAccountDataManager;
import com.tencent.mobileqq.app.PublicAccountHandler;
import com.tencent.mobileqq.app.PublicAccountObserver;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.ThreadManager;
import com.tencent.mobileqq.data.AccountDetail;
import com.tencent.mobileqq.data.EqqDetail;
import com.tencent.mobileqq.data.MessageForPic;
import com.tencent.mobileqq.data.MessageForPtt;
import com.tencent.mobileqq.data.MessageForShortVideo;
import com.tencent.mobileqq.data.MessageForStructing;
import com.tencent.mobileqq.data.MessageForText;
import com.tencent.mobileqq.data.MessageRecord;
import com.tencent.mobileqq.data.PublicAccountInfo;
import com.tencent.mobileqq.mp.mobileqq_mp;
import com.tencent.mobileqq.msf.core.NetConnInfoCenter;
import com.tencent.mobileqq.persistence.Entity;
import com.tencent.mobileqq.persistence.EntityManager;
import com.tencent.mobileqq.search.activity.GroupSearchActivity;
import com.tencent.mobileqq.search.util.PAOfflineSearchManager;
import com.tencent.mobileqq.service.troop.TroopConstants;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.structmsg.AbsShareMsg;
import com.tencent.mobileqq.structmsg.StructMsgFactory;
import com.tencent.mobileqq.structmsg.StructMsgForGeneralShare;
import com.tencent.mobileqq.structmsg.StructMsgUtils;
import com.tencent.mobileqq.structmsg.view.StructMsgItemVideo;
import com.tencent.mobileqq.systemmsg.GroupSystemMsgController;
import com.tencent.mobileqq.theme.ThemeUtil;
import com.tencent.mobileqq.troop.utils.TroopBindPublicAccountMgr;
import com.tencent.mobileqq.unifiedebug.UnifiedTraceRouter;
import com.tencent.mobileqq.util.FaceDrawable;
import com.tencent.mobileqq.util.ProfileCardUtil;
import com.tencent.mobileqq.utils.Base64Util;
import com.tencent.mobileqq.utils.DialogUtil;
import com.tencent.mobileqq.utils.NetworkUtil;
import com.tencent.mobileqq.utils.PAStartupTracker;
import com.tencent.mobileqq.utils.QQCustomDialog;
import com.tencent.mobileqq.utils.StackBlur;
import com.tencent.mobileqq.webview.swift.component.SwiftBrowserShareMenuHandler;
import com.tencent.mobileqq.widget.IndexView;
import com.tencent.mobileqq.widget.QQProgressDialog;
import com.tencent.mobileqq.widget.QQToast;
import com.tencent.open.base.MD5Utils;
import com.tencent.qphone.base.util.QLog;
import com.tencent.tim.R;
import com.tencent.widget.ActionSheet;
import com.tencent.widget.ActionSheetHelper;
import com.tencent.widget.Switch;
import com.tencent.widget.immersive.ImmersiveUtils;
import cooperation.qqfav.QfavUtil;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
import mqq.app.NewIntent;
import mqq.manager.TicketManager;
import mqq.observer.BusinessObserver;
import mqq.util.WeakReference;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tencent.im.oidb.cmd0x487.oidb_0x487;
import tencent.mobileim.structmsg.structmsg;
public class AccountDetailActivity extends BaseActivity implements View.OnClickListener {
    static final int A = 2;
    public static final int C = 1;
    public static final int D = 2;
    static int M = 0;
    public static final int f3777a = 1;
    public static final int f3778b = 2;
    static final String f3779b = "0X8005B6D";
    public static final int f82396c = 3;
    static final String f3780c = "0X8005B6E";
    public static final int d = 4;
    public static final String f3781d = "com.tencent.biz.pubaccount.AccountDetailActivity";
    public static final int e = 5;
    public static final String f3782e = "AccountDetailActivity.bindTroop";
    public static final int f = 104;
    public static final String f3783f = "source";
    public static final int g = 105;
    public static final String f3784g = "fromBrowser";
    public static final int h = 106;
    public static final String f3785h = "from_card";
    public static final int i = 108;
    public static final String f3786i = "report_src_param_type";
    public static final int j = 109;
    public static final String f3787j = "report_src_param_name";
    public static final int k = 111;
    public static final int l = 112;
    public static final int m = 113;
    public static final String f3788m = "find.mp.qq.com";
    public static final int n = 114;
    public static final String f3789n = "post.mp.qq.com";
    protected static final int o = 1;
    public static final String f3790o = "article.mp.qq.com";
    protected static final int p = 0;
    protected static final int q = 1;
    public static final String f3791q = "account_type";
    protected static final int r = 2;
    protected static final int s = 3;
    protected static final int t = 4;
    protected static final int u = 5;
    protected static final String f3792u = "http://qun.qq.com/qqweb/m/qun/qun_pub_bind/qun2pub.html?_wv=1027&scode=";
    protected static final String f3793v = "http://qun.qq.com/qqweb/m/qun/qun_pub_bind/qunlist.html?_wv=1027&power=1&scode=";
    protected static final int w = 1;
    protected static final String f3794w = "http://qun.qq.com/qqweb/m/qun/qun_pub_bind/qunlist.html?_wv=1027&scode=";
    protected static final int x = 2;
    static final int y = 3;
    static final int z = 3;
    public int E;
    public int K;
    public float f3795a;
    public Intent f3796a;
    View f3799a;
    public ViewGroup f3800a;
    public Button f3801a;
    public ImageView f3802a;
    public LinearLayout f3803a;
    RelativeLayout f3804a;
    public TextView f3805a;
    public AccountDetailXListView f3806a;
    public AccountDetailAdapter f3807a;
    FriendAvatarWeakReference f3808a;
    public ProfileParams f3811a;
    ShareActionSheet f3812a;
    ShareAioResultDialog f3813a;
    public PublicAccountHandler f3815a;
    public QQAppInterface f3817a;
    public mobileqq_mp.GetPublicAccountDetailInfoResponse f3819a;
    QQProgressDialog f3820a;
    grs f3822a;
    public NewIntent f3824a;
    public BusinessObserver f3825a;
    public View f3827b;
    public Button f3828b;
    public ImageView f3829b;
    LinearLayout f3830b;
    RelativeLayout f3831b;
    TextView f3832b;
    public NewIntent f3834b;
    public BusinessObserver f3835b;
    View f3837c;
    Button f3838c;
    public ImageView f3839c;
    TextView f3840c;
    NewIntent f3842c;
    BusinessObserver f3843c;
    public boolean f3844c;
    public View f3845d;
    public Button f3846d;
    public ImageView f3847d;
    public TextView f3848d;
    NewIntent f3849d;
    BusinessObserver f3850d;
    View f3852e;
    public ImageView f3853e;
    NewIntent f3854e;
    BusinessObserver f3855e;
    protected boolean f3856e;
    protected View f3857f;
    ImageView f3858f;
    public boolean f3859f;
    private View f3860g;
    ImageView f3861g;
    public boolean f3862g;
    public boolean f3864i;
    public String f3866k;
    public String f3868l;
    public boolean f3871n;
    public String f3873p;
    public String f3876r;
    protected String f3878s;
    public boolean f3879s;
    public String f3880t;
    public boolean f3885x;
    public boolean f3886y;
    private boolean f3887z;
    static int v = 100;
    public static double f82394a = 0.4d;
    static double f82395b = 0.4d;
    public static int N = -1;
    public static int O = 1;
    public AccountDetail f3818a = null;
    boolean f3826a = false;
    boolean f3836b = false;
    boolean f3851d = true;
    public ActionSheet f3821a = null;
    public ActionSheet f3833b = null;
    public ActionSheet f3841c = null;
    public int B = 1008;
    public boolean f3863h = true;
    public boolean f3865j = false;
    public int F = 0;
    public int G = 0;
    public int H = 0;
    public int I = 0;
    int J = 0;
    public boolean f3867k = false;
    public boolean f3869l = true;
    public boolean f3870m = true;
    boolean f3872o = false;
    int L = 0;
    public boolean f3874p = false;
    public int P = M;
    boolean f3875q = true;
    final PublicAccountObserver f3816a = new gpj(this);
    public boolean f3877r = false;
    public boolean f3881t = false;
    boolean f3882u = false;
    public boolean f3883v = false;
    public Handler f3798a = new gqg(this);
    PhotoWallViewForAccountDetail.PhotoWallCallback f3810a = new grb(this);
    public Drawable f3797a = null;
    boolean f3884w = false;
    protected int Q = -1;
    protected PaConfigAttr.PaConfigInfo f3809a = new PaConfigAttr.PaConfigInfo();
    public ArrayList f3823a = new ArrayList();
    protected FriendListObserver f3814a = new grg(this);

    @Override
    public boolean doOnCreate(Bundle bundle) {
        this.mNeedStatusTrans = true;
        this.mActNeedImmersive = false;
        super.doOnCreate(bundle);
        this.f3796a = getIntent();
        m1016a(this.f3796a);
        if (this.f3873p != null) {
            A();
        }
        super.addObserver(this.f3816a);
        if (m1024i()) {
            super.addObserver(this.f3814a);
        }
        return true;
    }

    @Override
    public void doOnNewIntent(Intent intent) {
        super.doOnNewIntent(intent);
        this.f3797a = null;
        this.f3796a = intent;
        m1016a(this.f3796a);
        if (this.f3873p != null) {
            A();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void doOnPause() {
        super.doOnPause();
        this.f3869l = false;
        this.f3820a = null;
    }

    @Override
    public void doOnDestroy() {
        super.doOnDestroy();
        super.removeObserver(this.f3816a);
        super.removeObserver(this.f3814a);
    }

    @Override
    public void onWindowFocusChanged(boolean z2) {
        super.onWindowFocusChanged(z2);
        if (z2) {
            PAStartupTracker.a(PAStartupTracker.f94591c, null, this.f3873p);
            this.f3874p = true;
            return;
        }
        this.f3874p = false;
    }

    @Override
    public void requestWindowFeature(Intent intent) {
        requestWindowFeature(1);
        getWindow().setFormat(-3);
    }

    @Override
    public void doOnBackPressed() {
        boolean z2 = this.f3811a != null;
        boolean z3 = !this.f3869l;
        if (z2 && this.f3869l) {
            moveTaskToBack(true);
        } else if (z2 && z3 && super.isTaskRoot()) {
            super.startActivity(new Intent(this, SplashActivity.class));
        }
        if (!mo1007d()) {
            c(f3780c);
        }
        if (getIntent().getBooleanExtra(NewerGuidePlugin.u, false)) {
            Intent intent = new Intent();
            intent.putExtra(NewerGuidePlugin.v, mo1007d());
            intent.putExtra("uin", this.f3873p);
            setResult(-1, intent);
        }
        super.doOnBackPressed();
    }

    void p() {
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "initView");
        }
        super.setContentView(R.layout.f56346name_res_0x7f030001);
        this.f3795a = super.getResources().getDisplayMetrics().density;
        q();
        r();
        s();
        u();
        this.f3860g = super.findViewById(R.id.f47688name_res_0x7f090264);
        if (ThemeUtil.isInNightMode(this.f3817a)) {
            if (this.f3860g != null) {
                this.f3860g.setVisibility(0);
            }
        } else if (this.f3860g != null) {
            this.f3860g.setVisibility(8);
        }
        this.f3830b = (LinearLayout) super.findViewById(R.id.f47685name_res_0x7f090261);
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "initView exit");
        }
    }

    void q() {
        int i2;
        int i3;
        this.f3831b = (RelativeLayout) super.findViewById(R.id.f47674name_res_0x7f090256);
        this.f3831b.setOnClickListener(null);
        if (j()) {
            i2 = (int) (60.0f * this.f3795a);
            i3 = (int) (4.0f * this.f3795a);
        } else {
            i2 = (int) (75.0f * this.f3795a);
            i3 = (int) (25.0f * this.f3795a);
        }
        this.f3831b.setLayoutParams(new RelativeLayout.LayoutParams(-1, i2));
        this.f3831b.setPadding(0, i3, 0, 0);
        this.H = i2;
        this.f3852e = super.findViewById(R.id.f47675name_res_0x7f090257);
        this.f3852e.setOnClickListener(this);
        this.f3832b = (TextView) super.findViewById(R.id.f48299ivTitleBtnRightText);
        this.f3832b.setText("");
        this.f3839c = (ImageView) super.findViewById(R.id.f48300ivTitleBtnRightImage);
        this.f3839c.setBackgroundDrawable(null);
        this.f3839c.setVisibility(0);
        this.f3839c.setOnClickListener(this);
        this.f3858f = (ImageView) super.findViewById(R.id.f47679name_res_0x7f09025b);
        this.f3861g = (ImageView) super.findViewById(R.id.f47680name_res_0x7f09025c);
    }

    void r() {
        this.f3837c = super.findViewById(R.id.f47661name_res_0x7f090249);
        this.f3837c.setVisibility(8);
        this.J = this.f3837c.getLayoutParams().height;
        this.f3845d = super.findViewById(R.id.f47662name_res_0x7f09024a);
        this.f3845d.setVisibility(8);
        this.f3827b = super.findViewById(R.id.f47664name_res_0x7f09024c);
        this.f3827b.setVisibility(8);
        super.setTitle(R.string.f60656name_res_0x7f0a08cc);
        this.f3820a = new QQProgressDialog(this, super.getTitleBarHeight());
        this.f3820a.setCanceledOnTouchOutside(true);
        this.f3838c = (Button) super.findViewById(R.id.f47687name_res_0x7f090263);
        this.f3838c.setOnClickListener(this);
        this.f3846d = (Button) super.findViewById(R.id.f47663name_res_0x7f09024b);
        this.f3846d.setOnClickListener(this);
        this.f3846d.setVisibility(8);
    }

    void s() {
        this.f3806a = (AccountDetailXListView) super.findViewById(R.id.f47673name_res_0x7f090255);
        this.G = getWindowManager().getDefaultDisplay().getHeight();
        this.f3804a = (RelativeLayout) super.findViewById(R.id.f47665name_res_0x7f09024d);
        this.f3847d = (ImageView) super.findViewById(R.id.f47666name_res_0x7f09024e);
        this.f3803a = new LinearLayout(this);
        this.f3803a.setOrientation(1);
        this.f3803a.setBackgroundColor(Color.parseColor("#FFFFFF"));
        this.f3802a = (ImageView) super.findViewById(R.id.f47668icon);
        this.f3853e = (ImageView) super.findViewById(R.id.f47667name_res_0x7f09024f);
        this.f3829b = (ImageView) super.findViewById(R.id.f47671name_res_0x7f090253);
        this.f3805a = (TextView) super.findViewById(R.id.f47670name_res_0x7f090252);
        this.f3848d = (TextView) super.findViewById(R.id.f47672name_res_0x7f090254);
        this.f3807a = new AccountDetailAdapter(this);
        if (Build.VERSION.SDK_INT >= 9) {
            this.f3806a.setOverScrollMode(2);
        }
        this.f3806a.setDividerHeight(0);
        this.f3806a.setOnScrollListener(new gpw(this));
        this.f3806a.setRefreshCallback(new gqj(this));
    }

    public int d() {
        View childAt = this.f3806a.getChildAt(0);
        if (childAt == null) {
            return 0;
        }
        return childAt.getTop();
    }

    public class AccountDetailAdapter extends BaseAdapter {
        private LayoutInflater f3888a;
        final int f82397a = 0;
        final int f82398b = 1;
        final int f82399c = 2;
        final int d = 3;
        final int e = 4;
        private ArrayList f3890a = new ArrayList();
        private ArrayList f3891b = new ArrayList();

        protected AccountDetailAdapter(Context context) {
            this.f3888a = LayoutInflater.from(context);
            AccountDetailDynamicInfo a2 = AccountDetailDynamicDataManager.a(AccountDetailActivity.this.f3817a).a(AccountDetailActivity.this.f3873p);
            if (a2 != null) {
                a(a2.a(), a2.f3755a);
                a(a2.b());
            }
        }

        public int a() {
            return this.f3890a.size();
        }

        public int b() {
            return this.f3891b.size();
        }

        public void a(ArrayList arrayList, boolean z) {
            if (z) {
                this.f3890a.clear();
            }
            if (arrayList != null && !arrayList.isEmpty()) {
                this.f3890a.addAll(arrayList);
            }
        }

        public void a(ArrayList arrayList) {
            this.f3891b.clear();
            if (arrayList != null && !arrayList.isEmpty()) {
                this.f3891b.addAll(arrayList);
            }
        }

        @Override
        public int getCount() {
            if (AccountDetailActivity.this.f3872o) {
                if (!AccountDetailActivity.this.f3826a || AccountDetailActivity.this.m1022g()) {
                    return 3;
                }
                return this.f3890a.size() + 2;
            }
            return 2;
        }

        @Override
        public DynamicInfo getItem(int i) {
            if (i > 1) {
                return (DynamicInfo) this.f3890a.get(i - 2);
            }
            return null;
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public int getItemViewType(int i) {
            if (!AccountDetailActivity.this.f3872o) {
                return i != 0 ? 3 : 0;
            } else if (i == 0) {
                return 0;
            } else {
                if (i == 1) {
                    return 1;
                }
                if (AccountDetailActivity.this.f3826a) {
                    if (AccountDetailActivity.this.m1022g()) {
                        return 4;
                    }
                    return 2;
                }
                return 3;
            }
        }

        @Override
        public int getViewTypeCount() {
            return AccountDetailActivity.this.f3872o ? 3 : 2;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            grr grrVar;
            grp grpVar;
            grq grqVar;
            grq grqVar2 = null;
            int itemViewType = getItemViewType(i);
            if (view == null) {
                switch (itemViewType) {
                    case 0:
                        view = this.f3888a.inflate(R.layout.f56347name_res_0x7f030002, viewGroup, false);
                        view.setOnClickListener(null);
                        LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.f47689name_res_0x7f090265);
                        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) linearLayout.getLayoutParams();
                        AccountDetailActivity.this.G = AccountDetailActivity.this.getWindowManager().getDefaultDisplay().getHeight();
                        layoutParams.height = (int) (AccountDetailActivity.this.G * AccountDetailActivity.f82394a);
                        linearLayout.setLayoutParams(layoutParams);
                        grqVar = null;
                        grrVar = null;
                        break;
                    case 1:
                        view = this.f3888a.inflate(R.layout.f56348name_res_0x7f030003, viewGroup, false);
                        AccountDetailActivity.this.I = view.getLayoutParams().height;
                        grr grrVar2 = new grr(this);
                        a(view, grrVar2);
                        view.setTag(grrVar2);
                        grrVar = grrVar2;
                        grqVar = null;
                        break;
                    case 2:
                        view = this.f3888a.inflate(R.layout.f56845name_res_0x7f0301f4, viewGroup, false);
                        grp grpVar2 = new grp(this);
                        grpVar2.f71933a = (URLImageView) view.findViewById(R.id.f49864name_res_0x7f090ae4);
                        grpVar2.f71931a = (TextView) view.findViewById(R.id.f49868name_res_0x7f090ae8);
                        grpVar2.f71934b = (TextView) view.findViewById(R.id.f49869name_res_0x7f090ae9);
                        grpVar2.f100252c = (TextView) view.findViewById(R.id.f49867name_res_0x7f090ae7);
                        grpVar2.f100250a = (ImageView) view.findViewById(R.id.f49866name_res_0x7f090ae6);
                        grpVar2.f100251b = (ImageView) view.findViewById(R.id.f49865name_res_0x7f090ae5);
                        view.setTag(grpVar2);
                        grqVar = null;
                        grrVar = null;
                        grqVar2 = grpVar2;
                        break;
                    case 3:
                        view = AccountDetailActivity.this.f3803a;
                        if (AccountDetailActivity.this.f3872o) {
                            view.setMinimumHeight(AccountDetailActivity.this.e());
                            grqVar = null;
                            grrVar = null;
                            break;
                        } else {
                            view.setMinimumHeight(AccountDetailActivity.this.f());
                            grqVar = null;
                            grrVar = null;
                            break;
                        }
                    case 4:
                        view = this.f3888a.inflate(R.layout.f56844name_res_0x7f0301f3, viewGroup, false);
                        grq grqVar3 = new grq(this);
                        grqVar3.f71935a = (TextView) view.findViewById(R.id.f49862name_res_0x7f090ae2);
                        grqVar3.f100253a = (ImageView) view.findViewById(R.id.f49861name_res_0x7f090ae1);
                        grqVar3.f100254b = (TextView) view.findViewById(R.id.f49863name_res_0x7f090ae3);
                        view.setMinimumHeight(AccountDetailActivity.this.e());
                        view.setTag(grqVar3);
                        grqVar = grqVar3;
                        grrVar = null;
                        break;
                    default:
                        grqVar = null;
                        grrVar = null;
                        break;
                }
                grq grqVar4 = grqVar;
                grpVar = grqVar2;
                grqVar2 = grqVar4;
            } else {
                switch (itemViewType) {
                    case 0:
                        grpVar = null;
                        grrVar = null;
                        break;
                    case 1:
                        grrVar = (grr) view.getTag();
                        grpVar = null;
                        break;
                    case 2:
                        grrVar = null;
                        grpVar = (grp) view.getTag();
                        break;
                    case 3:
                        view = AccountDetailActivity.this.f3803a;
                        if (AccountDetailActivity.this.f3872o) {
                            view.setMinimumHeight(AccountDetailActivity.this.e());
                            grpVar = null;
                            grrVar = null;
                            break;
                        } else {
                            view.setMinimumHeight(AccountDetailActivity.this.f());
                            grpVar = null;
                            grrVar = null;
                            break;
                        }
                    case 4:
                        grrVar = null;
                        grqVar2 = (grq) view.getTag();
                        grpVar = null;
                        break;
                    default:
                        grpVar = null;
                        grrVar = null;
                        break;
                }
            }
            if (itemViewType == 2 && grpVar != null) {
                a(grpVar, view, i);
            }
            if (itemViewType == 4 && grqVar2 != null) {
                a(grqVar2, view);
            }
            if (itemViewType == 1 && grrVar != null) {
                AccountDetailActivity.this.a(grrVar.f100255a, grrVar.f100256b);
            }
            return view;
        }

        void a(grq grqVar, View view) {
            if (AccountDetailActivity.this.f3875q) {
                if (AccountDetailActivity.this.P == AccountDetailActivity.M) {
                    grqVar.f71935a.setText(R.string.f66446name_res_0x7f0a1f72);
                    view.setClickable(false);
                    grqVar.f71935a.setVisibility(0);
                    grqVar.f100254b.setVisibility(4);
                    grqVar.f100253a.setVisibility(4);
                } else if (AccountDetailActivity.this.P == AccountDetailActivity.N) {
                    grqVar.f71935a.setText(R.string.f60669name_res_0x7f0a08d9);
                    grqVar.f71935a.setPadding(0, (int) (AccountDetailActivity.this.f3795a * 5.0f), 0, (int) (AccountDetailActivity.this.f3795a * 5.0f));
                    grqVar.f100253a.setImageResource(R.drawable.f41831name_res_0x7f0202f2);
                    view.setClickable(true);
                    grqVar.f100254b.setVisibility(0);
                } else if (AccountDetailActivity.this.P == AccountDetailActivity.O) {
                    grqVar.f71935a.setText(R.string.f66449name_res_0x7f0a1f75);
                    view.setClickable(false);
                    grqVar.f100253a.setImageResource(R.drawable.f42656name_res_0x7f02062f);
                    grqVar.f71935a.setPadding(0, (int) (AccountDetailActivity.this.f3795a * 5.0f), 0, (int) (AccountDetailActivity.this.f3795a * 5.0f));
                    grqVar.f100254b.setVisibility(4);
                }
            }
            grqVar.f100254b.setOnClickListener(new grl(this, grqVar));
        }

        void a(grp grpVar, View view, int i) {
            String str;
            boolean z = false;
            DynamicInfo item = getItem(i);
            if (item == null) {
                if (QLog.isColorLevel()) {
                    QLog.d(AccountDetailActivity.f3781d, 2, "setDataForDynamicMsg:" + AccountDetailActivity.this.f3818a.uin + "动态消息为空");
                }
            } else if (item.f3757a == null) {
                if (QLog.isColorLevel()) {
                    QLog.d(AccountDetailActivity.f3781d, 2, "setDataForDynamicMsg:" + AccountDetailActivity.this.f3818a.uin + "动态消息的消息属性为空");
                }
            } else {
                int i2 = item.f3757a.f82381a;
                if (i2 == 2) {
                    z = true;
                }
                String str2 = item.A;
                Long valueOf = Long.valueOf(item.f3757a.f82383c);
                String str3 = item.f3757a.f3761a;
                if (QLog.isColorLevel()) {
                    QLog.d(AccountDetailActivity.f3781d, 2, "setDataForDynamicMsg:title =" + str2 + "--coverUrl=--jumpUrl=" + str3 + "--isVideoMsg =" + z);
                }
                if (z) {
                    grpVar.f100252c.setVisibility(0);
                    grpVar.f100251b.setVisibility(0);
                    grpVar.f100250a.setVisibility(0);
                    if (item.f3759a != null) {
                        str = item.f3759a.f3763a;
                        grpVar.f100252c.setText(UITools.a(item.f3759a.f82386b));
                    }
                    str = "";
                } else {
                    grpVar.f100252c.setVisibility(4);
                    grpVar.f100251b.setVisibility(4);
                    grpVar.f100250a.setVisibility(4);
                    if (item.f3758a != null) {
                        str = item.f3758a.f82384a;
                    }
                    str = "";
                }
                if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2) || valueOf.longValue() <= 0) {
                    if (QLog.isColorLevel()) {
                        QLog.d(AccountDetailActivity.f3781d, 2, "setDataForDynamicMsg:" + AccountDetailActivity.this.f3818a.uin + "动态消息内容不合法");
                        return;
                    }
                    return;
                }
                Resources resources = AccountDetailActivity.this.getResources();
                ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#dddfe2"));
                grpVar.f71933a.setImageDrawable(URLDrawable.getDrawable(str, AIOUtils.a(124.0f, resources), AIOUtils.a(95.0f, resources), (Drawable) colorDrawable, (Drawable) colorDrawable, true));
                grpVar.f71931a.setText(str2);
                grpVar.f71934b.setText(ReadInJoyTimeUtils.d(valueOf.longValue()));
                view.setOnClickListener(new grm(this, i2, str3, item));
            }
        }

        public void m1026a(DynamicInfo dynamicInfo) {
            if (AccountDetailActivity.this.f3817a != null && AccountDetailActivity.this.f3817a.m4707d()) {
                QQToast.a(AccountDetailActivity.this, (int) R.string.f59806name_res_0x7f0a057a, 1).b(AccountDetailActivity.this.getResources().getDimensionPixelSize(R.dimen.f39450title_bar_height));
                return;
            }
            if (QLog.isColorLevel()) {
                QLog.d(AccountDetailActivity.f3781d, 2, "open full play activity, articleID : " + dynamicInfo.f3757a.f3760a + ",vid : " + dynamicInfo.f3759a.f3765c);
            }
            Bundle a2 = a(dynamicInfo);
            Activity activity = AccountDetailActivity.this.getActivity();
            Intent intent = new Intent(activity, MultiVideoPlayActivity.class);
            intent.putExtras(a2);
            activity.overridePendingTransition(R.anim.f37574name_res_0x7f04002c, R.anim.f37575name_res_0x7f04002d);
            AccountDetailActivity.this.startActivity(intent);
        }

        private Bundle a(DynamicInfo dynamicInfo) {
            boolean z = true;
            Bundle bundle = new Bundle();
            bundle.putString(VideoUIController.f4212o, AccountDetailActivity.this.f3873p);
            bundle.putString(VideoUIController.f4213p, AccountDetailActivity.this.f3818a.name);
            bundle.putString(VideoUIController.l, dynamicInfo.f3759a.f3764b);
            bundle.putString(VideoUIController.f4209k, ReadInJoyTimeUtils.a(dynamicInfo.f3757a.f82383c, true));
            bundle.putString(VideoUIController.f4204e, String.valueOf(dynamicInfo.f3759a.f82386b));
            bundle.putString(VideoUIController.g, String.valueOf(dynamicInfo.f3759a.d));
            bundle.putString(VideoUIController.f4206h, String.valueOf(dynamicInfo.f3759a.f82387c));
            bundle.putString("VIDEO_VID", dynamicInfo.f3759a.f3765c);
            bundle.putString(VideoUIController.f4210m, dynamicInfo.f3759a.f3763a);
            bundle.putString(VideoUIController.f4216s, String.valueOf(dynamicInfo.f3757a.f3760a));
            if (dynamicInfo.f3759a.f82385a == 2 || dynamicInfo.f3759a.f82385a == 3) {
                z = false;
            }
            bundle.putBoolean(VideoUIController.f4211n, z);
            Bundle bundle2 = new Bundle();
            bundle2.putString(StructMsgItemVideo.dy, dynamicInfo.f3759a.f3765c);
            bundle2.putString(StructMsgItemVideo.dz, dynamicInfo.f3759a.f3765c);
            bundle2.putInt(StructMsgItemVideo.dB, dynamicInfo.f3759a.f82386b);
            bundle2.putInt(StructMsgItemVideo.dE, dynamicInfo.f3759a.d);
            bundle2.putInt(StructMsgItemVideo.dF, dynamicInfo.f3759a.f82387c);
            bundle2.putInt(StructMsgItemVideo.dG, dynamicInfo.f3759a.f82386b);
            bundle2.putString(StructMsgItemVideo.dH, AccountDetailActivity.this.f3873p);
            bundle2.putString(PublicAccountChatPie.az, AccountDetailActivity.this.f3873p);
            bundle2.putString(StructMsgItemVideo.dI, AccountDetailActivity.this.f3818a.name);
            bundle2.putInt(StructMsgItemVideo.dx, dynamicInfo.f3759a.f82385a);
            bundle2.putString(StructMsgItemVideo.dJ, String.valueOf(dynamicInfo.f3757a.f3760a));
            bundle2.putInt(AppConstants.Key.bN, 5);
            bundle2.putBoolean(AppConstants.Key.bM, false);
            bundle2.putString(AppConstants.Key.bh, dynamicInfo.f3759a.f3763a);
            bundle2.putString(AppConstants.Key.bf, dynamicInfo.f3759a.f3764b);
            bundle2.putString("video_url", dynamicInfo.f3759a.f3765c);
            bundle2.putString("title", dynamicInfo.A);
            bundle2.putString(AppConstants.Key.br, ReadInJoyTimeUtils.d(dynamicInfo.f3757a.f82383c));
            bundle2.putString(AppConstants.Key.bJ, dynamicInfo.A);
            bundle.putByteArray(VideoUIController.f82504c, ((StructMsgForGeneralShare) StructMsgFactory.a(bundle2)).getBytes());
            bundle.putString(VideoUIController.f4207i, dynamicInfo.A);
            return bundle;
        }

        void a(View view, grr grrVar) {
            grrVar.f100255a = (Button) view.findViewById(R.id.f47691name_res_0x7f090267);
            grrVar.f100256b = (Button) view.findViewById(R.id.f47692name_res_0x7f090268);
            int width = (int) (AccountDetailActivity.this.getWindowManager().getDefaultDisplay().getWidth() * 0.13d);
            grrVar.f100255a.setPadding(0, 0, width, 0);
            grrVar.f100256b.setPadding(width, 0, 0, 0);
            grrVar.f100255a.setOnClickListener(new grn(this));
            grrVar.f100256b.setOnClickListener(new gro(this));
        }

        public void m1025a() {
            AccountDetailActivity.this.f3826a = true;
            if (AccountDetailActivity.this.m1022g()) {
                AccountDetailActivity.this.f3806a.a(false);
                AccountDetailActivity.this.f3836b = true;
            } else {
                AccountDetailActivity.this.f3806a.a(true);
            }
            notifyDataSetChanged();
        }

        public void m1027b() {
            AccountDetailActivity.this.f3826a = false;
            AccountDetailActivity.this.f3806a.a(false);
            notifyDataSetChanged();
        }
    }

    public void t() {
        if (this.f3836b) {
            this.f3806a.setAdapter((ListAdapter) null);
            this.f3806a.a(true);
            this.f3806a.setAdapter((ListAdapter) this.f3807a);
        }
        this.f3836b = false;
    }

    boolean m1022g() {
        this.f3875q = this.f3807a.a() == 0;
        return this.f3875q && (this.P == M || this.P == N || this.P == O);
    }

    void u() {
        this.f3801a = (Button) super.findViewById(R.id.f47682name_res_0x7f09025e);
        this.f3828b = (Button) super.findViewById(R.id.f47683name_res_0x7f09025f);
        int width = (int) (getWindowManager().getDefaultDisplay().getWidth() * 0.13d);
        this.f3801a.setPadding(0, 0, width, 0);
        this.f3828b.setPadding(width, 0, 0, 0);
        this.f3801a.setOnClickListener(new gqu(this));
        this.f3828b.setOnClickListener(new grf(this));
    }

    public void a(Button button, Button button2) {
        if (this.f3826a) {
            button.setTextColor(Color.parseColor("#000000"));
            button2.setTextColor(Color.parseColor("#777777"));
            return;
        }
        button.setTextColor(Color.parseColor("#777777"));
        button2.setTextColor(Color.parseColor("#000000"));
    }

    void v() {
        super.finish();
        PublicAccountSearchActivity.a(this, "");
    }

    void m1016a(Intent intent) {
        ProfileParams profileParams;
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "init");
        }
        this.f3817a = (QQAppInterface) super.getAppRuntime();
        Bundle extras = intent.getExtras();
        if (extras != null && (profileParams = (ProfileParams) extras.getParcelable(ProfileParams.f82791a)) != null) {
            this.f3811a = profileParams;
        }
        this.f3873p = a(intent);
        this.f3866k = intent.getStringExtra(f3786i);
        this.f3868l = intent.getStringExtra(f3787j);
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "[sopType]:" + this.f3866k + ",[sopName]:" + this.f3868l);
        }
        this.f3876r = intent.getStringExtra("extvalue");
        this.f3878s = intent.getStringExtra("exttype");
        if (!TextUtils.isEmpty(this.f3876r)) {
            if ("2".equals(this.f3878s)) {
                this.f3859f = true;
            } else if ("1".equals(this.f3878s)) {
                this.f3862g = true;
            }
        }
        if (this.f3873p != null && this.f3817a != null) {
            this.f3815a = (PublicAccountHandler) this.f3817a.getBusinessHandler(11);
            p();
            Q();
            b(intent);
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "init exit");
            }
        }
    }

    void b(Intent intent) {
        this.f3887z = intent.getBooleanExtra(f3784g, false);
        this.L = intent.getIntExtra("source", 0);
        switch (this.L) {
            case 1:
                this.K = 2;
                break;
            case 2:
                this.K = 3;
                break;
            case 3:
                this.K = 12;
                break;
            case 4:
                this.K = 0;
                break;
            case 5:
                this.K = 1;
                break;
            case 104:
                this.K = 4;
                break;
            case 105:
                this.K = 5;
                break;
            case 106:
                this.K = 6;
                break;
            case 108:
                this.K = 8;
                break;
            case 109:
                this.K = 9;
                break;
            case 111:
                this.K = 11;
                break;
            case 112:
                this.K = 50;
                break;
            case 114:
                this.K = 13;
                break;
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "[fromwhere]:" + this.K);
        }
        ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8005A24", "0X8005A24", this.K, 0, "", "", "", "");
    }

    public void b(int i2) {
        this.f3827b.postDelayed(new grh(this, i2), 500L);
    }

    public boolean mo1001a() {
        Bundle m8778a;
        EntityManager createEntityManager = this.f3817a.getEntityManagerFactory().createEntityManager();
        this.f3818a = (AccountDetail) createEntityManager.a(AccountDetail.class, this.f3873p);
        createEntityManager.m7241a();
        if (this.f3818a == null) {
            return false;
        }
        try {
            this.f3819a = new mobileqq_mp.GetPublicAccountDetailInfoResponse();
            this.f3819a.mergeFrom(this.f3818a.accountData);
            this.f3818a.newGroupInfoList = this.f3819a.config_group_info_new.get();
            if (this.f3819a.unified_account_descrpition.has()) {
                this.f3818a.unifiedDesrpition = this.f3819a.unified_account_descrpition.get();
                this.f3818a.parser();
            } else {
                this.f3818a.seqno = 0;
            }
        } catch (Exception e2) {
        }
        if (m1024i() && (m8778a = ((TroopBindPublicAccountMgr) this.f3817a.getManager(131)).m8778a(this.f3873p)) != null) {
            this.f3885x = m8778a.getBoolean("mIsAbleBindTroop", false);
            ArrayList<String> stringArrayList = m8778a.getStringArrayList("mBindedTroopUins");
            if (stringArrayList != null && stringArrayList.size() > 0) {
                this.f3823a.clear();
                this.f3823a.addAll(stringArrayList);
            }
            if (QLog.isColorLevel()) {
                QLog.d(f3782e, 2, "loadCache, hit cache");
            }
        }
        return true;
    }

    public void g() {
        ThreadManager.m4814b().postDelayed(new gri(this), 10L);
    }

    public void w() {
        PAStartupTracker.a(null, PAStartupTracker.e, this.f3873p);
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, PublicAccountManager.f4076i);
        }
        b(R.string.f60667name_res_0x7f0a08d7);
        if (this.f3842c != null) {
            this.f3842c.setObserver(null);
        }
        this.f3842c = new NewIntent(super.getApplicationContext(), PublicAccountServlet.class);
        this.f3842c.putExtra("cmd", PublicAccountManager.f4076i);
        mobileqq_mp.UnFollowRequest unFollowRequest = new mobileqq_mp.UnFollowRequest();
        unFollowRequest.uin.set((int) Long.parseLong(this.f3873p));
        unFollowRequest.account_type.set(b());
        this.f3842c.putExtra("data", unFollowRequest.toByteArray());
        this.f3843c = new grj(this);
        this.f3842c.setObserver(this.f3843c);
        this.f3817a.startServlet(this.f3842c);
        this.E++;
        PublicAccountUtil.b(this.f3817a, this.f3873p);
        if (ServiceAccountFolderManager.d(this.f3817a, this.f3873p)) {
            RecentUtil.b(this.f3817a, String.valueOf(this.f3873p), PublicAccountUtil.a(this.f3817a, this.f3873p));
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "unfollow exit");
        }
    }

    public void h() {
        ThreadManager.m4814b().postDelayed(new grk(this), 10L);
    }

    public void n() {
        PAStartupTracker.a(null, PAStartupTracker.d, this.f3873p);
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "follow uin=" + this.f3873p);
        }
        this.f3864i = true;
        this.f3827b.postDelayed(new gpk(this), 3000L);
        b(R.string.f60668name_res_0x7f0a08d8);
        this.f3834b = new NewIntent(super.getApplicationContext(), PublicAccountServlet.class);
        this.f3834b.putExtra("cmd", PublicAccountManager.f4075h);
        mobileqq_mp.FollowRequest followRequest = new mobileqq_mp.FollowRequest();
        if (!TextUtils.isEmpty(this.f3876r) && this.f3862g) {
            followRequest.ext.set(this.f3876r);
        }
        followRequest.uin.set((int) Long.parseLong(this.f3873p));
        followRequest.account_type.set(b());
        this.f3834b.putExtra("data", followRequest.toByteArray());
        this.f3835b = new gpl(this);
        this.f3834b.setObserver(this.f3835b);
        this.f3817a.startServlet(this.f3834b);
        this.E++;
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "follow exit");
        }
    }

    public void x() {
        if (this.f3811a != null) {
            a(this);
        }
    }

    void a(Activity activity) {
        if (this.f3813a == null) {
            this.f3813a = new ShareAioResultDialog(activity);
        }
        this.f3813a.a("关注成功");
        gpn gpnVar = new gpn(this, activity);
        this.f3813a.a(this.f3817a.getApplication().getString(R.string.f60782name_res_0x7f0a094b) + "应用", gpnVar);
        this.f3813a.a(gpnVar);
        this.f3813a.show();
    }

    public void mo1020e() {
        if (this.f3818a != null) {
            a(this.f3873p, this.B, this.f3818a.name, ChatActivity.class);
        }
    }

    public static void a(QQAppInterface qQAppInterface, String str, Intent intent) {
        if (intent != null && intent.hasExtra("source")) {
            switch (intent.getIntExtra("source", 0)) {
                case 1:
                    ReportController.b(qQAppInterface, "dc01332", "Pb_account_lifeservice", str, "0X800574C", "0X800574C", 0, 0, str, "", "", "");
                    return;
                case 2:
                    ReportController.b(qQAppInterface, "dc01332", "Pb_account_lifeservice", str, "0X800574D", "0X800574D", 0, 0, str, "", "", "");
                    return;
                case 3:
                    ReportController.b(qQAppInterface, "dc01332", "Pb_account_lifeservice", str, "0X800574E", "0X800574E", 0, 0, str, "", "", "");
                    return;
                case 4:
                    ReportController.b(qQAppInterface, "dc01332", "Pb_account_lifeservice", str, "0X800589D", "0X800589D", 0, 0, str, "", "", "");
                    return;
                default:
                    return;
            }
        }
    }

    protected void y() {
        if (this.f3821a == null) {
            this.f3821a = (ActionSheet) ActionSheetHelper.a(this, (View) null);
            this.f3821a.a(R.string.f60682name_res_0x7f0a08e6, 5);
            this.f3821a.a(R.string.f60683name_res_0x7f0a08e7, 5);
            if (mo1008e()) {
                this.f3821a.a(R.string.f60657name_res_0x7f0a08cd, 3);
            }
            this.f3821a.d(R.string.f63203cancel);
            this.f3821a.setOnDismissListener(new gpo(this));
            this.f3821a.a(new gpp(this));
        }
        if (!this.f3821a.isShowing()) {
            this.f3877r = false;
            this.f3821a.show();
        }
    }

    public void z() {
        JSONObject a2 = a(this, this.f3873p);
        Intent intent = new Intent(getActivity(), QQBrowserActivity.class);
        intent.putExtra("BSafeReportPost", true);
        if (a2 != null) {
            try {
                intent.putExtra("SafeReportData", a2.toString().getBytes("utf-8"));
            } catch (UnsupportedEncodingException e2) {
                e2.printStackTrace();
            }
        }
        intent.putExtra("hide_more_buttonbutton", true);
        intent.putExtra("ishiderefresh", true);
        intent.putExtra("ishidebackforward", true);
        startActivity(intent.putExtra("url", "http://jubao.mp.qq.com/mobile/reportAccount"));
    }

    public JSONObject a(BaseActivity baseActivity, String str) {
        int i2;
        try {
            List a2 = baseActivity.app.m4635a().a(str, 0, new int[]{-1000, -2000, MessageRecord.MSG_TYPE_MEDIA_PTT, MessageRecord.MSG_TYPE_STRUCT_MSG, MessageRecord.MSG_TYPE_MEDIA_SHORTVIDEO}, 40);
            ArrayList arrayList = new ArrayList();
            if (a2 != null) {
                for (int size = a2.size(); size > 0; size--) {
                    if (((MessageRecord) a2.get(size - 1)).issend == 0) {
                        arrayList.add(a2.get(size - 1));
                        if (arrayList.size() > 4) {
                            break;
                        }
                    }
                }
            }
            JSONObject jSONObject = new JSONObject();
            JSONArray jSONArray = new JSONArray();
            JSONObject jSONObject2 = new JSONObject();
            JSONObject jSONObject3 = new JSONObject();
            String account = this.f3817a.getAccount();
            jSONObject3.put(SwiftBrowserShareMenuHandler.f34814a, account);
            String skey = ((TicketManager) this.f3817a.getManager(2)).getSkey(this.f3817a.getCurrentAccountUin());
            String valueOf = String.valueOf(NetConnInfoCenter.getServerTime());
            jSONObject3.put("skey", skey);
            jSONObject3.put("mpUin", str);
            jSONObject3.put("timestamp", "" + valueOf);
            jSONObject3.put("scene", "201");
            jSONObject3.put("subAppname", "profile");
            jSONObject3.put("sign", MD5Utils.b(account + str + 201 + valueOf + "jubao@article@123").toLowerCase());
            if (arrayList != null) {
                for (int i3 = 0; i3 < arrayList.size(); i3++) {
                    JSONObject jSONObject4 = new JSONObject();
                    JSONObject jSONObject5 = new JSONObject();
                    MessageRecord messageRecord = (MessageRecord) arrayList.get(i3);
                    if (messageRecord instanceof MessageForText) {
                        jSONObject5.put("text", messageRecord.f88923msg);
                        i2 = 1;
                    } else if (messageRecord instanceof MessageForPic) {
                        jSONObject5.put("fileUuid", ((MessageForPic) messageRecord).uuid);
                        i2 = 2;
                    } else if (messageRecord instanceof MessageForPtt) {
                        jSONObject5.put("fileUuid", ((MessageForPtt) messageRecord).urlAtServer);
                        jSONObject5.put("fileType", ((MessageForPtt) messageRecord).busiType);
                        i2 = 3;
                    } else if (messageRecord instanceof MessageForShortVideo) {
                        jSONObject5.put("fileUuid", ((MessageForShortVideo) messageRecord).uuid.substring(1));
                        i2 = 4;
                    } else if (!(messageRecord instanceof MessageForStructing)) {
                        i2 = 0;
                    } else {
                        jSONObject5.put("text", new String(StructMsgUtils.a(QfavUtil.a(((AbsShareMsg) StructMsgFactory.a(messageRecord.msgData)).getXmlBytes()), 0), "utf-8"));
                        i2 = 5;
                    }
                    jSONObject4.put("content", jSONObject5);
                    jSONObject4.put("messageType", "" + i2);
                    jSONArray.put(i3, jSONObject4);
                }
                jSONObject.put("msgNum", "" + arrayList.size());
                jSONObject.put("messageList", Base64Util.encodeToString(jSONArray.toString().getBytes("utf-8"), 0));
            }
            jSONObject2.put("Verify", jSONObject3);
            jSONObject2.put("reportData", jSONObject);
            return jSONObject2;
        } catch (Exception e2) {
            return null;
        }
    }

    public boolean mo1008e() {
        return (this.f3818a == null || AppConstants.f17385aq.equals(this.f3818a.uin) || !this.f3818a.isShowFollowButton) ? false : true;
    }

    public void c(int i2) {
        if (this.f3820a != null) {
            this.f3820a.b(i2);
            if (!this.f3820a.isShowing()) {
                this.f3820a.show();
            }
        }
    }

    public void A() {
        ThreadManager.m4814b().postDelayed(new gpq(this), 10L);
    }

    String a(Intent intent) {
        if (intent != null) {
            return intent.getStringExtra("uin");
        }
        if (this.f3811a == null) {
            return null;
        }
        return this.f3811a.m1445a().f82796b;
    }

    public void m1019a(AccountDetail accountDetail) {
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "saveAccountDetailToDBAndCache");
        }
        EntityManager createEntityManager = this.f3817a.getEntityManagerFactory().createEntityManager();
        if (this.f3818a != null && this.f3818a.getId() != -1) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, accountDetail.name);
            }
            this.f3818a.clone(accountDetail);
            if (!createEntityManager.mo7244a((Entity) this.f3818a)) {
                createEntityManager.m7245a(AccountDetail.class);
            }
        } else {
            this.f3818a = accountDetail;
            createEntityManager.m7242a((Entity) accountDetail);
        }
        createEntityManager.m7241a();
        PublicAccountDataManager publicAccountDataManager = (PublicAccountDataManager) this.f3817a.getManager(55);
        if (publicAccountDataManager != null && accountDetail != null) {
            publicAccountDataManager.a(this.f3818a);
            if (accountDetail.followType == 1) {
                publicAccountDataManager.a(PublicAccountInfo.createPublicAccount(accountDetail, 0L));
            }
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "saveAccountDetailToDBAndCache exit");
        }
    }

    public void b(AccountDetail accountDetail) {
        if (accountDetail != null) {
            EntityManager createEntityManager = this.f3817a.getEntityManagerFactory().createEntityManager();
            createEntityManager.m7248b((Entity) accountDetail);
            createEntityManager.m7241a();
        }
    }

    public void b(String str) {
        if (!TextUtils.isEmpty(str)) {
            Intent intent = new Intent(this, PublicAccountBrowser.class);
            if (this.f3817a != null && !TextUtils.isEmpty(this.f3873p) && !TextUtils.isEmpty(this.f3817a.getAccount())) {
                String replace = str.replace("${puin}", this.f3873p).replace("${uin}", this.f3817a.getAccount());
                intent.putExtra("uin", this.f3817a.getCurrentAccountUin());
                intent.putExtra("url", replace);
                if (QLog.isColorLevel()) {
                    QLog.d(f3781d, 2, "jumpWebView url=" + replace);
                }
                intent.putExtra("puin", this.f3873p);
                String mo999a = mo999a();
                if (!TextUtils.isEmpty(mo999a)) {
                    intent.putExtra("source_name", mo999a);
                }
                super.startActivity(intent);
            }
        }
    }

    public String mo999a() {
        if (this.f3818a == null) {
            return "";
        }
        return this.f3818a.name;
    }

    public void a(String str, int i2, String str2, Class cls) {
        a(str, i2, str2, cls, false);
    }

    public void a(String str, int i2, String str2, Class cls, boolean z2) {
        Intent intent = new Intent();
        intent.setComponent(new ComponentName(this, cls));
        Bundle bundle = new Bundle();
        bundle.putString("uin", str);
        bundle.putInt("uintype", i2);
        bundle.putString(AppConstants.Key.h, str2);
        intent.putExtras(bundle);
        intent.setFlags(67108864);
        boolean booleanExtra = this.f3796a.getBooleanExtra(PublicAccountUtil.f5266j, false);
        if (this.f3859f) {
            intent.putExtra(AppConstants.Key.G, -1);
            intent.putExtra(AppConstants.Key.F, this.f3876r);
            this.f3859f = false;
        }
        if (booleanExtra) {
            super.finish();
        }
        intent.putExtra(BusinessCmrTmpChatPie.an, z2);
        intent.putExtra("jump_from", 2);
        super.startActivity(intent);
    }

    public void a(PaConfigAttr.PaConfigInfo paConfigInfo, Switch r5) {
        boolean z2 = paConfigInfo.d == 1;
        this.f3863h = false;
        r5.setChecked(z2);
    }

    public void mo1021f() {
        ThreadManager.m4814b().postDelayed(new gps(this), 10L);
    }

    public void a(PaConfigAttr.PaConfigInfo paConfigInfo, Switch r10, boolean z2) {
        b(R.string.f60666name_res_0x7f0a08d6);
        NewIntent newIntent = new NewIntent(super.getApplicationContext(), PublicAccountServlet.class);
        this.f3849d = newIntent;
        newIntent.putExtra("cmd", PublicAccountManager.o);
        mobileqq_mp.SetFunctionFlagRequset setFunctionFlagRequset = new mobileqq_mp.SetFunctionFlagRequset();
        setFunctionFlagRequset.version.set(1);
        setFunctionFlagRequset.uin.set((int) Long.parseLong(this.f3873p));
        int i2 = paConfigInfo.e;
        int i3 = z2 ? 1 : 2;
        setFunctionFlagRequset.type.set(i2);
        setFunctionFlagRequset.value.set(i3);
        setFunctionFlagRequset.account_type.set(b());
        newIntent.putExtra("data", setFunctionFlagRequset.toByteArray());
        this.f3850d = new gpt(this, paConfigInfo, r10, i3, i2, z2);
        newIntent.setObserver(this.f3850d);
        this.f3817a.startServlet(newIntent);
        this.E++;
    }

    public void a(int i2, boolean z2) {
        this.f3818a.accountData = this.f3819a.toByteArray();
        if (i2 == 3) {
            this.f3818a.isSyncLbs = true;
            this.f3818a.isAgreeSyncLbs = z2;
        }
        mo1021f();
    }

    public void b(PaConfigAttr.PaConfigInfo paConfigInfo, Switch r9, boolean z2) {
        this.f3865j = true;
        QQCustomDialog m9154a = DialogUtil.m9154a((Context) this, 0);
        m9154a.setCanceledOnTouchOutside(false);
        String str = paConfigInfo.f3968d;
        if (3 == paConfigInfo.e) {
            str = String.format(getString(R.string.f59213name_res_0x7f0a0327), mo999a());
        }
        m9154a.setTitle("温馨提示");
        m9154a.setMessage(str);
        m9154a.setOnCancelListener(new gpu(this, paConfigInfo, r9));
        gpv gpvVar = new gpv(this, paConfigInfo, r9, z2);
        m9154a.setNegativeButton("取消", gpvVar);
        m9154a.setPositiveButton("确定", gpvVar);
        try {
            m9154a.show();
        } catch (Exception e2) {
        }
    }

    public void a(boolean z2) {
        if (this.f3818a != null) {
            this.f3818a.isConfirmed = z2;
        }
    }

    void a(ViewGroup viewGroup, PaConfigAttr.PaConfigInfo paConfigInfo, int i2) {
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "addPublicAccountDetailItem");
        }
        if (!a(paConfigInfo)) {
            if (paConfigInfo.f3964a == 3) {
                if (paConfigInfo.f82421c == 10) {
                    this.f3799a = n(paConfigInfo);
                } else if (paConfigInfo.f82421c == 7) {
                    this.f3799a = e(paConfigInfo);
                } else if (paConfigInfo.f82421c == 8) {
                    this.f3799a = f(paConfigInfo);
                } else if (paConfigInfo.f82421c == 11) {
                    this.f3799a = i(paConfigInfo);
                } else if (paConfigInfo.f82421c == 20) {
                    this.f3799a = j(paConfigInfo);
                } else if (paConfigInfo.f82421c == 2) {
                    this.f3799a = k(paConfigInfo);
                } else if (paConfigInfo.f82421c == 17) {
                    this.f3799a = l(paConfigInfo);
                } else if (paConfigInfo.f82421c == 19) {
                    this.f3799a = a(paConfigInfo, 9);
                } else if (paConfigInfo.f82421c == 18) {
                    this.f3799a = a(paConfigInfo, 10);
                } else if (paConfigInfo.f82421c == 22) {
                    this.f3799a = m(paConfigInfo);
                } else if (QLog.isColorLevel()) {
                    QLog.d(f3781d, 2, "unhandled event_id: " + paConfigInfo.f82421c);
                    return;
                } else {
                    return;
                }
            } else if (paConfigInfo.f3964a == 1) {
                this.f3799a = p(paConfigInfo);
            } else if (paConfigInfo.f3964a == 2) {
                this.f3799a = o(paConfigInfo);
            } else if (paConfigInfo.f3964a == 4) {
                this.f3799a = g(paConfigInfo);
            } else if (paConfigInfo.f3964a == 5) {
                this.f3799a = h(paConfigInfo);
            } else {
                this.f3799a = m1013a();
            }
            if (this.f3799a != null) {
                this.f3799a.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
                this.f3799a.setBackgroundResource(R.drawable.f41082name_res_0x7f020004);
                int i3 = (int) (10.0f * this.f3795a);
                int i4 = (int) (15.0f * this.f3795a);
                if (paConfigInfo.f3964a == 4) {
                    this.f3799a.setPadding(i4, i4, i4, i4);
                } else if (paConfigInfo.f3964a == 2 || (paConfigInfo.f3964a == 5 && !paConfigInfo.f3969e.equals("[]"))) {
                    this.f3799a.setPadding(i4, 0, i4, 0);
                } else {
                    this.f3799a.setPadding(i4, i3, i4, i3);
                }
                viewGroup.addView(this.f3799a);
                b(viewGroup);
                this.Q = i2;
                this.f3857f = this.f3799a;
                this.f3809a.f3964a = paConfigInfo.f3964a;
                this.f3809a.f3969e = paConfigInfo.f3969e;
                if (QLog.isColorLevel()) {
                    QLog.d(f3781d, 2, "addPublicAccountDetailItem exit");
                }
            }
        }
    }

    public void B() {
        this.f3841c = ActionSheet.a(this);
        this.f3841c.m10334a((CharSequence) getString(R.string.f60661name_res_0x7f0a08d1, new Object[]{mo999a()}));
        this.f3841c.a(R.string.f60684name_res_0x7f0a08e8, 3);
        this.f3841c.d(R.string.f63203cancel);
        this.f3841c.setOnDismissListener(new gpx(this));
        this.f3841c.a(new gpy(this));
        if (!this.f3841c.isShowing()) {
            this.f3879s = false;
            this.f3841c.show();
        }
    }

    public void m1018a(PaConfigAttr.PaConfigInfo paConfigInfo, int i2) {
        this.f3833b = (ActionSheet) ActionSheetHelper.b(this, (View) null);
        this.f3833b.a(R.string.f66032name_res_0x7f0a1dd4, 5, false);
        this.f3833b.a(R.string.f66033name_res_0x7f0a1dd5, 5, false);
        if (i2 == 1 || i2 == 2) {
            this.f3833b.e(0);
        } else {
            this.f3833b.e(1);
        }
        if (i2 == 1 || i2 == 2) {
        }
        this.f3833b.d(R.string.f63203cancel);
        this.f3833b.setOnDismissListener(new gpz(this));
        this.f3833b.a(new gqa(this, paConfigInfo));
        if (!this.f3833b.isShowing()) {
            this.f3881t = false;
            this.f3833b.show();
        }
    }

    public void b(PaConfigAttr.PaConfigInfo paConfigInfo, int i2) {
        int i3;
        b(R.string.f60666name_res_0x7f0a08d6);
        NewIntent newIntent = new NewIntent(super.getApplicationContext(), PublicAccountServlet.class);
        this.f3854e = newIntent;
        newIntent.putExtra("cmd", PublicAccountManager.o);
        mobileqq_mp.SetFunctionFlagRequset setFunctionFlagRequset = new mobileqq_mp.SetFunctionFlagRequset();
        setFunctionFlagRequset.version.set(1);
        setFunctionFlagRequset.uin.set((int) Long.parseLong(this.f3873p));
        int i4 = paConfigInfo.e;
        if (i2 == 1) {
            ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8005A2B", "0X8005A2B", 0, 0, "", "", "", "");
            i3 = 1;
        } else {
            ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8005A2A", "0X8005A2A", 0, 0, "", "", "", "");
            i3 = 3;
        }
        setFunctionFlagRequset.type.set(i4);
        setFunctionFlagRequset.value.set(i3);
        setFunctionFlagRequset.account_type.set(b());
        newIntent.putExtra("data", setFunctionFlagRequset.toByteArray());
        this.f3855e = new gqb(this, paConfigInfo, i3, i2);
        newIntent.setObserver(this.f3855e);
        this.f3817a.startServlet(newIntent);
        this.E++;
    }

    public void o() {
        if (this.f3818a != null) {
            this.f3818a.accountData = this.f3819a.toByteArray();
        }
    }

    public void mo1015a(int i2) {
        if (this.f3818a != null) {
            this.f3818a.mShowMsgFlag = i2;
        }
    }

    public void m1017a(PaConfigAttr.PaConfigInfo paConfigInfo) {
        int i2 = paConfigInfo.d;
        this.f3863h = false;
        if (i2 == 1 || i2 == 2) {
            this.f3840c.setText(R.string.f66032name_res_0x7f0a1dd4);
        } else {
            this.f3840c.setText(R.string.f66033name_res_0x7f0a1dd5);
        }
    }

    public void d(int i2) {
        Toast.makeText(getApplicationContext(), i2, 0).show();
    }

    public ViewGroup m1014a() {
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "createGroupLayout");
        }
        LinearLayout linearLayout = new LinearLayout(this);
        linearLayout.setOrientation(1);
        linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "createGroupLayout exit");
        }
        return linearLayout;
    }

    public List a(List list, boolean z2) {
        if (!z2) {
            ArrayList arrayList = new ArrayList(2);
            int size = list.size();
            for (int i2 = 0; i2 < size; i2++) {
                PaConfigAttr.PaConfigInfo paConfigInfo = (PaConfigAttr.PaConfigInfo) list.get(i2);
                if (paConfigInfo.f3964a == 3 && (paConfigInfo.f82421c == 7 || paConfigInfo.f82421c == 8)) {
                    arrayList.add(paConfigInfo);
                }
            }
            return arrayList;
        }
        return list;
    }

    public boolean a(PaConfigAttr paConfigAttr, int i2, int i3, boolean z2, boolean z3) {
        return a(paConfigAttr, i2, i3, z3);
    }

    boolean a(PaConfigAttr paConfigAttr, int i2, int i3, boolean z2) {
        int i4;
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "addPublicAccountGroup start");
        }
        List list = paConfigAttr.f3962a;
        if (list == null) {
            return false;
        }
        ViewGroup m1014a = m1014a();
        if (paConfigAttr.f3963c == 1) {
            Iterator it = paConfigAttr.f3962a.iterator();
            while (it.hasNext()) {
                PaConfigAttr.PaConfigInfo paConfigInfo = (PaConfigAttr.PaConfigInfo) it.next();
                if (TextUtils.isEmpty(paConfigInfo.f3969e)) {
                    it.remove();
                } else if (paConfigInfo.f82420b == 1 && this.f3818a.followType != 1) {
                    it.remove();
                }
            }
            if (paConfigAttr.f3962a.size() >= 3) {
                a(m1014a, paConfigAttr.f3962a);
                this.f3803a.addView(m1014a);
                b(this.f3803a);
                return false;
            }
            return false;
        }
        int size = list.size();
        if (size <= 0) {
            return true;
        }
        if (i2 > 0 && size > 0 && z2) {
            View view = new View(this);
            view.setLayoutParams(new LinearLayout.LayoutParams(-1, (int) (9.0f * this.f3795a)));
            view.setBackgroundColor(Color.parseColor("#f0f0f0"));
            m1014a.addView(view);
        }
        int i5 = 0;
        while (i5 < size) {
            if (size > 1) {
                if (i5 == 0) {
                    i4 = 1;
                } else {
                    i4 = i5 == size + (-1) ? 2 : 3;
                }
            } else if (size <= 3) {
                i4 = 0;
            } else if (i2 == 1) {
                i4 = 1;
            } else {
                i4 = i2 == i3 + (-1) ? 2 : 3;
            }
            a(m1014a, (PaConfigAttr.PaConfigInfo) list.get(i5), i4);
            i5++;
        }
        this.f3803a.addView(m1014a);
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "addPublicAccountGroup exit");
        }
        return true;
    }

    private boolean a(PaConfigAttr.PaConfigInfo paConfigInfo) {
        if ((paConfigInfo.f3964a == 3 && (paConfigInfo.f82421c == 3 || paConfigInfo.f82421c == 16 || paConfigInfo.f82421c == 21 || paConfigInfo.f82421c == 13)) || paConfigInfo.e == 5) {
            return true;
        }
        return paConfigInfo.f82420b == 1 && this.f3818a.followType != 1;
    }

    protected void C() {
        int length = this.f3818a.name.length();
        if (length > 8 && length < 13) {
            this.f3805a.setTextSize(2, 20.0f);
        }
        this.f3805a.setText(this.f3818a.name);
    }

    public void l() {
        R();
        this.f3848d.setVisibility(0);
        if (this.f3818a != null) {
            C();
            if (!TextUtils.isEmpty(this.f3818a.certifiedDescription)) {
                this.f3848d.setText(this.f3818a.certifiedDescription);
            }
            int i2 = this.f3818a.certifiedGrade;
            boolean z2 = this.f3818a.isShowFollowButton;
            D();
            if (i2 != 0) {
                this.f3829b.setVisibility(0);
            }
            if (!z2) {
                this.f3827b.setVisibility(8);
                this.f3856e = true;
                this.f3851d = false;
            } else {
                F();
            }
            if (this.f3818a.followType != 1) {
                this.f3839c.setImageResource(R.drawable.f41079name_res_0x7f020001);
                this.f3839c.setContentDescription(getResources().getString(R.string.f60958name_res_0x7f0a09fb));
            } else {
                this.f3839c.setImageResource(R.drawable.f42296name_res_0x7f0204c3);
                this.f3839c.setContentDescription(getString(R.string.f60885name_res_0x7f0a09b2));
            }
            this.f3846d.setText(R.string.f66034name_res_0x7f0a1dd6);
        }
    }

    void D() {
        if (TextUtils.isEmpty(this.f3818a.configBackgroundColor)) {
            this.f3818a.configBackgroundColor = "3d7fe3";
        }
        if (!TextUtils.isEmpty(this.f3818a.configBackgroundImg)) {
            this.f3847d.setBackgroundDrawable(URLDrawable.getDrawable(this.f3818a.configBackgroundImg));
        } else {
            ThreadManager.m4814b().postDelayed(new gqc(this), 10L);
        }
        try {
            this.f3847d.setImageDrawable(new ColorDrawable(Color.parseColor("#E6" + this.f3818a.configBackgroundColor.substring(0, 6))));
        } catch (StringIndexOutOfBoundsException e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "configBackgroundColor length is not 6!");
            }
        }
    }

    public void E() {
        this.G = getWindowManager().getDefaultDisplay().getHeight();
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.f3804a.getLayoutParams();
        RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.f3802a.getLayoutParams();
        RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) this.f3853e.getLayoutParams();
        if (!mo1006c()) {
            if (FontSettingManager.a() == 20.0f) {
                v = 80;
                if (Build.BOARD.equals("mx")) {
                    v = 64;
                }
                f82395b = 0.32d;
            } else if (FontSettingManager.a() == 18.0f) {
                v = 88;
                if (Build.BOARD.equals("mx")) {
                    v = 71;
                }
                f82395b = 0.36d;
            } else if (FontSettingManager.a() == 17.0f) {
                v = 94;
                f82395b = 0.38d;
                if (Build.BOARD.equals("mx")) {
                    v = 75;
                }
            } else {
                v = 100;
                f82395b = 0.4d;
                if (Build.BOARD.equals("mx")) {
                    v = 80;
                }
            }
            layoutParams.height = (int) (this.G * f82394a);
            layoutParams2.height = (int) (v * this.f3795a);
            layoutParams2.width = (int) (v * this.f3795a);
            layoutParams2.topMargin = (int) ((layoutParams.height * f82395b) - ((v * this.f3795a) / 2.0f));
            layoutParams3.height = (int) ((v + 8) * this.f3795a);
            layoutParams3.width = layoutParams3.height;
            layoutParams3.topMargin = (int) (layoutParams2.topMargin - (4.0f * this.f3795a));
            this.f3804a.setLayoutParams(layoutParams);
            this.f3802a.setLayoutParams(layoutParams2);
            this.f3853e.setLayoutParams(layoutParams3);
        }
    }

    public void e(int i2) {
        double d2;
        double d3;
        int height = this.f3804a.getHeight() - i2;
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.f3802a.getLayoutParams();
        RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) this.f3853e.getLayoutParams();
        if (!mo1006c()) {
            double d4 = f82394a;
            if (j()) {
                d2 = 0.2d;
                d3 = 0.2d;
            } else {
                d2 = 0.2237d;
                d3 = 0.1763d;
            }
            double d5 = ((f82395b * d4) - 0.05d) / (d4 - 0.3d);
            double d6 = (height - (this.G * 0.3d)) / ((d4 - 0.3d) * this.G);
            if (height > d2 * this.G) {
                if (height <= this.G * 0.3d) {
                    layoutParams.height = (int) (30.0f * this.f3795a);
                    layoutParams.width = (int) (30.0f * this.f3795a);
                    layoutParams.topMargin = (int) ((((this.G * 0.1d) * 2.5d) - (layoutParams.height / 2)) - i2);
                    layoutParams2.height = (int) (32.0f * this.f3795a);
                    layoutParams2.width = layoutParams2.height;
                    layoutParams2.topMargin = (int) (layoutParams.topMargin - (1.0f * this.f3795a));
                } else if (height >= this.G * d4) {
                    layoutParams.height = (int) (v * this.f3795a);
                    layoutParams.width = layoutParams.height;
                    layoutParams.topMargin = (int) (((height * f82395b) - (layoutParams.height / 2)) + i2);
                    layoutParams2.height = (int) (layoutParams.height + (8.0f * this.f3795a));
                    layoutParams2.width = layoutParams2.height;
                    layoutParams2.topMargin = (int) (layoutParams.topMargin - (4.0f * this.f3795a));
                } else {
                    layoutParams.height = (int) ((30.0d + ((v - 30) * d6)) * this.f3795a);
                    layoutParams.width = layoutParams.height;
                    layoutParams.topMargin = (int) (((((height - (this.G * 0.3d)) * d5) + ((this.G * 0.1d) * 0.5d)) - (layoutParams.height / 2)) + i2);
                    layoutParams2.height = (int) (layoutParams.height + ((1.0d + (7.0d * d6)) * this.f3795a));
                    layoutParams2.width = layoutParams2.height;
                    layoutParams2.topMargin = (int) (layoutParams.topMargin - (((1.0d + (7.0d * d6)) * this.f3795a) / 2.0d));
                }
            } else {
                layoutParams.height = (int) (30.0f * this.f3795a);
                layoutParams.width = (int) (30.0f * this.f3795a);
                layoutParams.topMargin = (int) ((((this.G * 0.1d) * 2.5d) - (layoutParams.height / 2)) - (d3 * this.G));
                layoutParams2.height = (int) (32.0f * this.f3795a);
                layoutParams2.width = layoutParams2.height;
                layoutParams2.topMargin = (int) (layoutParams.topMargin - (1.0f * this.f3795a));
            }
            this.f3802a.post(new gqe(this, layoutParams, layoutParams2));
            f(height);
        }
    }

    public boolean mo1006c() {
        return this.f3818a == null;
    }

    void f(int i2) {
        double d2;
        LinearLayout linearLayout = (LinearLayout) super.findViewById(R.id.f47681name_res_0x7f09025d);
        View findViewById = super.findViewById(R.id.f47684name_res_0x7f090260);
        if (j()) {
            d2 = 0.1d;
        } else {
            d2 = 0.1172d;
        }
        if (i2 < d2 * this.G) {
            this.f3831b.setBackgroundColor(c());
            this.f3858f.setVisibility(0);
            this.f3858f.setBackgroundDrawable(FaceDrawable.a(this.f3817a, 1, this.f3873p));
            this.f3861g.setVisibility(0);
            if (this.f3872o) {
                linearLayout.setVisibility(0);
                findViewById.setVisibility(0);
                this.f3804a.setVisibility(4);
                a(this.f3801a, this.f3828b);
            }
        } else if (this.f3858f.getVisibility() == 0) {
            this.f3831b.setBackgroundColor(0);
            this.f3858f.setVisibility(8);
            this.f3861g.setVisibility(8);
            linearLayout.setVisibility(8);
            findViewById.setVisibility(8);
            this.f3804a.setVisibility(0);
            a(this.f3801a, this.f3828b);
        }
    }

    public int c() {
        if (this.f3818a.configBackgroundColor.equals("") || this.f3818a.configBackgroundColor.equals(null)) {
            this.f3818a.configBackgroundColor = "3d7fe3";
        }
        return Color.parseColor("#" + this.f3818a.configBackgroundColor.substring(0, 6));
    }

    public void g(int i2) {
        int i3;
        int i4;
        float f2;
        if (Build.VERSION.SDK_INT >= 11 && i2 >= 0) {
            if (FontSettingManager.a() == 20.0f) {
                i3 = (int) (0.45d * this.G);
                i4 = (int) (0.35d * this.G);
            } else if (FontSettingManager.a() == 18.0f) {
                i3 = (int) (0.42d * this.G);
                i4 = (int) (0.32d * this.G);
            } else if (FontSettingManager.a() == 17.0f) {
                i3 = (int) (0.4d * this.G);
                i4 = (int) (0.3d * this.G);
            } else {
                i3 = (int) (0.39d * this.G);
                i4 = (int) (0.29d * this.G);
            }
            int height = this.f3804a.getHeight() - i2;
            if (Build.VERSION.SDK_INT < 11) {
                if (height <= i4) {
                    this.f3805a.setVisibility(8);
                    this.f3829b.setVisibility(8);
                    this.f3848d.setVisibility(8);
                    return;
                }
                this.f3805a.setVisibility(0);
                if (a() != 0) {
                    this.f3829b.setVisibility(0);
                    this.f3848d.setVisibility(0);
                }
            } else if (height <= i3 && height >= i4) {
                if (height - i4 <= 0.01d * this.G) {
                    f2 = 0.05f;
                } else if (height - i4 <= 0.02d * this.G) {
                    f2 = 0.15f;
                } else if (height - i4 <= 0.03d * this.G) {
                    f2 = 0.25f;
                } else if (height - i4 <= 0.04d * this.G) {
                    f2 = 0.35f;
                } else if (height - i4 <= 0.05d * this.G) {
                    f2 = 0.45f;
                } else if (height - i4 <= 0.06d * this.G) {
                    f2 = 0.55f;
                } else if (height - i4 <= 0.07d * this.G) {
                    f2 = 0.65f;
                } else if (height - i4 <= this.G * 0.08d) {
                    f2 = 0.75f;
                } else if (height - i4 <= this.G * 0.08d) {
                    f2 = 0.85f;
                } else {
                    f2 = 0.95f;
                }
                this.f3805a.setAlpha(f2);
                this.f3829b.setAlpha(f2);
                this.f3848d.setAlpha(f2);
            } else if (height < i4) {
                this.f3805a.setAlpha(0.0f);
                this.f3829b.setAlpha(0.0f);
                this.f3848d.setAlpha(0.0f);
            } else {
                this.f3805a.setAlpha(1.0f);
                this.f3829b.setAlpha(1.0f);
                this.f3848d.setAlpha(1.0f);
            }
        }
    }

    public void F() {
        if (mo1007d()) {
            this.f3856e = true;
        } else {
            this.f3856e = false;
        }
    }

    public int a() {
        if (this.f3818a != null) {
            return this.f3818a.certifiedGrade;
        }
        return 0;
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        switch (motionEvent.getAction()) {
            case 0:
                if (this.f3864i) {
                    this.f3882u = true;
                    return true;
                }
                break;
            case 1:
            case 2:
            case 3:
                if (this.f3882u) {
                    this.f3882u = false;
                    return true;
                }
                break;
        }
        return super.dispatchTouchEvent(motionEvent);
    }

    public void mo1000a() {
        List list;
        this.f3803a.removeAllViews();
        this.f3800a = null;
        if (this.f3818a != null) {
            List list2 = this.f3818a.paConfigAttrs;
            list = list2 == null ? PaConfigAttr.a(this.f3818a.newGroupInfoList) : list2;
        } else {
            list = null;
        }
        if (list != null) {
            int size = list.size();
            boolean z2 = false;
            for (int i2 = 0; i2 < size; i2++) {
                z2 = a((PaConfigAttr) list.get(i2), i2, size, true, z2);
            }
        }
        N();
    }

    void G() {
        this.f3838c.setVisibility(0);
        this.f3830b.setVisibility(0);
        this.f3804a.setVisibility(8);
        this.f3831b.setBackgroundColor(0);
        this.f3858f.setVisibility(8);
        this.f3861g.setVisibility(8);
    }

    public void i() {
        boolean z2 = false;
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "updateView");
        }
        this.f3872o = a(this.f3818a);
        if (this.f3872o && !TextUtils.isEmpty(this.f3873p)) {
            AccountDetailDynamicListModel.a(this.f3817a, Long.parseLong(this.f3873p));
        }
        if (mo1004b()) {
            this.f3845d.setVisibility(0);
            this.f3845d.setOnClickListener(this);
        } else {
            this.f3845d.setVisibility(8);
        }
        if (this.f3819a != null && this.f3819a.show_flag.has() && this.f3819a.show_flag.get() == 2) {
            z2 = true;
        }
        if (z2) {
            G();
        } else {
            l();
            mo1000a();
            I();
            E();
            H();
            this.f3807a.m1025a();
            this.f3806a.setAdapter((ListAdapter) this.f3807a);
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "updateView exit");
        }
    }

    public void H() {
        if (mo1007d()) {
            PublicAccountDataManager publicAccountDataManager = (PublicAccountDataManager) this.f3817a.getManager(55);
            if (publicAccountDataManager != null && this.f3818a != null && publicAccountDataManager.a(1008, this.f3818a.uin)) {
                this.f3846d.setVisibility(0);
                this.f3837c.setVisibility(0);
            } else {
                this.f3846d.setVisibility(8);
                this.f3837c.setVisibility(8);
            }
            this.f3827b.setVisibility(8);
        } else {
            this.f3827b.setVisibility(0);
            this.f3827b.setOnClickListener(this);
            this.f3837c.setVisibility(0);
        }
        if (this.f3846d.getVisibility() == 8 && this.f3827b.getVisibility() == 8) {
            this.f3837c.setVisibility(8);
        }
    }

    void I() {
        if (this.f3818a != null && this.f3818a.followType != 1) {
            this.f3846d.setVisibility(8);
        }
    }

    public void J() {
        if (this.f3820a != null && this.f3820a.isShowing()) {
            this.f3820a.dismiss();
        }
    }

    public void K() {
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "firstFetch");
        }
        mo1005c();
        i();
        this.f3804a.postDelayed(new gqf(this), 500L);
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "firstFetch exit");
        }
    }

    public void a(AccountDetail accountDetail, boolean z2) {
        ThreadManager.m4814b().postDelayed(new gqh(this, accountDetail, z2), 10L);
    }

    public void mo1005c() {
        L();
        S();
    }

    void L() {
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "sendPublicAccountDetailInfoRequest");
        }
        if (this.f3824a != null) {
            this.f3824a.setObserver(null);
        }
        this.f3824a = new NewIntent(super.getApplicationContext(), PublicAccountServlet.class);
        this.f3824a.putExtra("cmd", PublicAccountManager.f4074g);
        mobileqq_mp.GetPublicAccountDetailInfoRequest getPublicAccountDetailInfoRequest = new mobileqq_mp.GetPublicAccountDetailInfoRequest();
        getPublicAccountDetailInfoRequest.versionInfo.set("6.5.5,3,1834");
        getPublicAccountDetailInfoRequest.version.set(1);
        if (this.f3818a != null) {
            getPublicAccountDetailInfoRequest.seqno.set(this.f3818a.seqno);
        } else {
            getPublicAccountDetailInfoRequest.seqno.set(0);
        }
        try {
            getPublicAccountDetailInfoRequest.uin.set((int) Long.parseLong(this.f3873p));
        } catch (Exception e2) {
        }
        this.f3824a.putExtra("data", getPublicAccountDetailInfoRequest.toByteArray());
        this.f3825a = new gqk(this);
        this.f3824a.setObserver(this.f3825a);
        this.f3817a.startServlet(this.f3824a);
        this.E++;
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "sendPublicAccountDetailInfoRequest exit");
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add("menu");
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onMenuOpened(int i2, Menu menu) {
        return false;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.f3867k = true;
        if (this.f3820a != null) {
            this.f3820a.dismiss();
        }
        this.f3820a = null;
        if (this.f3822a != null) {
            this.f3817a.removeObserver(this.f3822a);
            this.f3822a = null;
        }
        if (this.f3824a != null) {
            this.f3824a.setObserver(null);
        }
        if (this.f3842c != null) {
            this.f3842c.setObserver(null);
        }
        if (this.f3834b != null) {
            this.f3834b.setObserver(null);
        }
        if (this.f3849d != null) {
            this.f3849d.setObserver(null);
            this.f3849d = null;
        }
        if (this.f3854e != null) {
            this.f3854e.setObserver(null);
            this.f3854e = null;
        }
        if (this.f3808a != null) {
            this.f3808a.b();
        }
        if (this.f3813a != null) {
            this.f3813a.dismiss();
        }
    }

    @Override
    public void onClick(View view) {
        if (view == this.f3838c) {
            v();
        } else if (view == this.f3827b) {
            c(f3779b);
            this.f3870m = false;
            n();
            F();
            this.f3827b.setEnabled(false);
            this.f3827b.postDelayed(new gql(this), 1000L);
            ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8005A25", "0X8005A25", this.K, 0, "", "", "", "");
            PADetailReportUtil.a().a(4, this.f3873p, 0, GroupSearchActivity.f91900b, PAOfflineSearchManager.a().a(this.f3873p));
        } else if (view == this.f3846d) {
            mo1020e();
            ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8004E44", "0X8004E44", 0, 0, this.f3873p, "", "", "");
            ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8005A26", "0X8005A26", 0, 0, "", "", "", "");
        } else if (view == this.f3852e) {
            doOnBackPressed();
        } else if (view == this.f3839c) {
            if (mo1009f()) {
                M();
            } else {
                y();
            }
        }
    }

    public boolean mo1009f() {
        return this.f3818a == null || this.f3818a.followType != 1;
    }

    void c(String str) {
        if (this.f3811a != null) {
            String e2 = this.f3811a.e();
            String b2 = this.f3811a.b();
            String c2 = this.f3811a.c();
            if (TextUtils.isEmpty(e2)) {
                e2 = "";
            }
            if (TextUtils.isEmpty(b2)) {
                b2 = "";
            }
            if (TextUtils.isEmpty(c2)) {
                c2 = "";
            }
            long currentTimeMillis = System.currentTimeMillis();
            StringBuilder sb = new StringBuilder();
            sb.append(e2).append(",").append("app").append(",").append(b2).append(",").append(c2).append(",").append(currentTimeMillis);
            ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", "", str, str, 0, 1, 0, sb.toString(), "", "", "");
        }
    }

    public String mo1002b() {
        if (this.f3880t == null && this.f3818a != null) {
            this.f3880t = "http://share.mp.qq.com/cgi/share.php?uin=" + this.f3873p + "&account_flag=" + this.f3818a.accountFlag + "&jumptype=1&card_type=public_account";
        }
        return this.f3880t;
    }

    public void M() {
        if (!TextUtils.isEmpty(this.f3873p) && mo998a() != null) {
            if (this.f3812a == null) {
                this.f3812a = new ShareActionSheet(this.f3817a, this, mo998a(), b(), mo1002b());
            }
            this.f3812a.m1766a();
            PublicAccountHandler.a(this.f3817a, this.f3873p, "Pb_account_lifeservice", "mp_msg_sys_10", "pbshare_click");
        }
    }

    public ShareActionSheet.Detail mo998a() {
        if (this.f3818a == null) {
            return null;
        }
        return new ShareActionSheet.Detail(this.f3818a.uin, this.f3818a.name, this.f3818a.summary);
    }

    public void d(String str) {
        Dialog dialog = new Dialog(this, R.style.f67750qZoneInputDialog);
        dialog.setContentView(R.layout.f57486name_res_0x7f030475);
        ((TextView) dialog.findViewById(R.id.f52660name_res_0x7f0915d0)).setVisibility(8);
        TextView textView = (TextView) dialog.findViewById(R.id.f52661name_res_0x7f0915d1);
        TextView textView2 = (TextView) dialog.findViewById(R.id.f52662name_res_0x7f0915d2);
        TextView textView3 = (TextView) dialog.findViewById(R.id.f52663name_res_0x7f0915d3);
        textView.setText(str);
        textView.setGravity(3);
        textView2.setText(R.string.f63203cancel);
        textView3.setText(R.string.f64278name_res_0x7f0a16f5);
        dialog.setCanceledOnTouchOutside(false);
        textView2.setOnClickListener(new gqm(this, dialog));
        textView3.setOnClickListener(new gqn(this, str));
        try {
            dialog.show();
        } catch (Exception e2) {
        }
    }

    public int b() {
        return 1;
    }

    boolean m1023h() {
        if (this.f3818a == null) {
        }
        return false;
    }

    public boolean mo1004b() {
        if (this.f3818a != null) {
            if (this.f3818a.followType == 1) {
                return m1023h();
            }
            return (this.L == 5 || this.L == 113) && m1023h();
        }
        return false;
    }

    private void b(ViewGroup viewGroup) {
        View view = new View(this);
        view.setLayoutParams(new LinearLayout.LayoutParams(-1, (int) (0.7d * this.f3795a)));
        view.setBackgroundColor(Color.parseColor("#dedfe0"));
        viewGroup.addView(view);
    }

    protected View e(PaConfigAttr.PaConfigInfo paConfigInfo) {
        if (TextUtils.isEmpty(paConfigInfo.f3971g) || TextUtils.isEmpty(paConfigInfo.f3970f)) {
            return null;
        }
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        TextView textView = (TextView) inflate.findViewById(R.id.f48073title);
        String str = paConfigInfo.f3965a;
        String str2 = paConfigInfo.f3966b;
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        textView.setText(str);
        inflate.setOnClickListener(new gqo(this, paConfigInfo, str2));
        return inflate;
    }

    protected View f(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        String str = paConfigInfo.f3972h;
        if (str != null) {
            String trim = str.trim();
            if (Pattern.compile("[\\d-]+?").matcher(trim).matches()) {
                ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
                inflate.setOnClickListener(new gqp(this, trim, paConfigInfo));
                return inflate;
            }
            return null;
        }
        return null;
    }

    protected View g(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56651name_res_0x7f030132, (ViewGroup) null);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        return inflate;
    }

    protected View m1013a() {
        return super.getLayoutInflater().inflate(R.layout.f56651name_res_0x7f030132, (ViewGroup) null);
    }

    protected View h(PaConfigAttr.PaConfigInfo paConfigInfo) {
        boolean z2 = false;
        if (this.f3872o && paConfigInfo.f3965a.contains("历史")) {
            return null;
        }
        View inflate = super.getLayoutInflater().inflate(R.layout.f56835name_res_0x7f0301ea, (ViewGroup) null);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        String str = paConfigInfo.f3967c;
        if (!TextUtils.isEmpty(str)) {
            inflate.findViewById(R.id.f49827name_res_0x7f090abf).setVisibility(0);
            inflate.setOnClickListener(new gqq(this, str, paConfigInfo));
            z2 = true;
        } else {
            inflate.findViewById(R.id.f49827name_res_0x7f090abf).setVisibility(8);
        }
        try {
            a(z2, (LinearLayout) inflate.findViewById(R.id.f49826name_res_0x7f090abe), new JSONArray(paConfigInfo.f3969e));
        } catch (JSONException e2) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "RICH_PIC_TEXT:pic json error!");
            }
            e2.printStackTrace();
        }
        return inflate;
    }

    protected View i(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gqr(this, paConfigInfo));
        return inflate;
    }

    protected View j(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gqs(this, paConfigInfo));
        return inflate;
    }

    protected View k(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gqt(this, paConfigInfo));
        return inflate;
    }

    protected View l(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gqv(this, paConfigInfo));
        return inflate;
    }

    protected View a(PaConfigAttr.PaConfigInfo paConfigInfo, int i2) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gqw(this, i2, paConfigInfo));
        return inflate;
    }

    protected View m(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = super.getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        String str = paConfigInfo.f3967c;
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gqx(this, str, paConfigInfo));
        return inflate;
    }

    protected void a(ViewGroup viewGroup, List list) {
        PhotoWallViewForAccountDetail photoWallViewForAccountDetail = new PhotoWallViewForAccountDetail(this);
        photoWallViewForAccountDetail.setPhotoWallCallback(this.f3810a);
        photoWallViewForAccountDetail.a(this, list);
        photoWallViewForAccountDetail.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
        viewGroup.addView(photoWallViewForAccountDetail);
    }

    public View n(PaConfigAttr.PaConfigInfo paConfigInfo) {
        if (paConfigInfo.e != 6) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "Unhandled ConfigInfo(" + paConfigInfo.f3964a + ", " + paConfigInfo.f82421c + ", " + paConfigInfo.e + UnifiedTraceRouter.f);
                return null;
            }
            return null;
        }
        View inflate = super.getLayoutInflater().inflate(R.layout.f58222name_res_0x7f030755, (ViewGroup) null);
        this.f3840c = (TextView) inflate.findViewById(R.id.f49039name_res_0x7f0907ab);
        if (paConfigInfo.d == 1 || paConfigInfo.d == 2) {
            this.f3840c.setText(R.string.f66032name_res_0x7f0a1dd4);
        } else {
            this.f3840c.setText(R.string.f66033name_res_0x7f0a1dd5);
        }
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        inflate.setOnClickListener(new gqy(this, paConfigInfo));
        return inflate;
    }

    public View o(PaConfigAttr.PaConfigInfo paConfigInfo) {
        View inflate = getLayoutInflater().inflate(R.layout.f58246name_res_0x7f03076d, (ViewGroup) null);
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        Switch r0 = (Switch) inflate.findViewById(R.id.f49008name_res_0x7f09078c);
        if (paConfigInfo.d == 1) {
            r0.setChecked(true);
        } else {
            r0.setChecked(false);
        }
        a(paConfigInfo.e, paConfigInfo.d == 1);
        r0.setOnCheckedChangeListener(new gqz(this, paConfigInfo, r0));
        return inflate;
    }

    protected View p(PaConfigAttr.PaConfigInfo paConfigInfo) {
        if (this.f3872o && paConfigInfo.f3965a.contains("历史")) {
            return null;
        }
        View inflate = getLayoutInflater().inflate(R.layout.f56750name_res_0x7f030195, (ViewGroup) null);
        a(inflate, paConfigInfo.i);
        String str = paConfigInfo.f3967c;
        ((TextView) inflate.findViewById(R.id.f48073title)).setText(paConfigInfo.f3965a);
        ((TextView) inflate.findViewById(R.id.f47982content)).setText(paConfigInfo.f3966b);
        inflate.setOnClickListener(new gra(this, str, paConfigInfo));
        return inflate;
    }

    void N() {
        a(this.f3803a);
        P();
        O();
    }

    protected void O() {
        if (this.f3818a != null && !TextUtils.isEmpty(this.f3818a.certifiedEnterprise)) {
            b(this.f3803a);
            View inflate = getLayoutInflater().inflate(R.layout.f56843name_res_0x7f0301f2, (ViewGroup) null);
            String str = "";
            if (!TextUtils.isEmpty(this.f3818a.certifiedWeixin)) {
                str = this.f3818a.certifiedWeixin + "\n";
            }
            ((TextView) inflate.findViewById(R.id.f49860name_res_0x7f090ae0)).setText(str + this.f3818a.certifiedEnterprise);
            this.f3803a.addView(inflate);
        }
    }

    protected void P() {
        if (this.f3818a != null && !TextUtils.isEmpty(this.f3818a.summary)) {
            View inflate = getLayoutInflater().inflate(R.layout.f56843name_res_0x7f0301f2, (ViewGroup) null);
            ((TextView) inflate.findViewById(R.id.f49860name_res_0x7f090ae0)).setText(this.f3818a.summary);
            ((ImageView) inflate.findViewById(R.id.f47701name_res_0x7f090271)).setVisibility(8);
            ((TextView) inflate.findViewById(R.id.f48073title)).setText(R.string.f60686name_res_0x7f0a08ea);
            this.f3803a.addView(inflate);
        }
    }

    public void d(EqqDetail eqqDetail) {
        this.f3815a.m4584a();
    }

    public Drawable m1012a(Bitmap bitmap) {
        if (bitmap == null) {
            return null;
        }
        try {
            Bitmap a2 = a(bitmap);
            StackBlur.a(a2, 1);
            return new BitmapDrawable(a2);
        } catch (OutOfMemoryError e2) {
            return null;
        }
    }

    public void a(View view, String str) {
        if (!TextUtils.isEmpty(str)) {
            ImageView imageView = (ImageView) view.findViewById(R.id.f47701name_res_0x7f090271);
            imageView.setImageDrawable(URLDrawable.getDrawable(str));
            imageView.setVisibility(0);
        }
    }

    public void a(boolean z2, LinearLayout linearLayout, JSONArray jSONArray) {
        int length = jSONArray.length();
        if (length > 0) {
            for (int i2 = 0; i2 < 3 && i2 + 1 <= length; i2++) {
                int i3 = (int) (6.0f * this.f3795a);
                int i4 = (int) (32.0f * this.f3795a);
                ImageView imageView = new ImageView(this);
                imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(i4, i4);
                if (i2 == 2) {
                    i3 = 0;
                }
                layoutParams.setMargins(0, 0, i3, 0);
                imageView.setLayoutParams(layoutParams);
                try {
                    if (TextUtils.isEmpty(jSONArray.getString(i2))) {
                        imageView.setImageResource(R.drawable.f42060name_res_0x7f0203d7);
                    } else {
                        imageView.setImageDrawable(URLDrawable.getDrawable(jSONArray.getString(i2)));
                    }
                } catch (JSONException e2) {
                    e2.printStackTrace();
                }
                linearLayout.addView(imageView);
            }
        }
    }

    public void e(String str) {
        ReportController.b(this.f3817a, "dc01332", "Pb_account_lifeservice", this.f3873p, "0X8005A27", "0X8005A27", 0, 0, str == null ? "" : str, "", "", "");
    }

    Bitmap a(Bitmap bitmap) {
        int i2;
        int i3;
        int i4 = 0;
        int width = getWindowManager().getDefaultDisplay().getWidth();
        int height = (int) (getWindowManager().getDefaultDisplay().getHeight() * f82394a);
        int height2 = bitmap.getHeight();
        int width2 = bitmap.getWidth();
        if (width2 * height > height2 * width) {
            i2 = (width * height2) / height;
            i3 = (width2 - i2) / 2;
        } else {
            int i5 = (height * width2) / width;
            int i6 = (height2 - i5) / 2;
            height2 = i5;
            i2 = width2;
            i3 = 0;
            i4 = i6;
        }
        return Bitmap.createBitmap(bitmap, i3, i4, i2, height2);
    }

    public static String a(String str) {
        if (str != null) {
            try {
                int indexOf = str.indexOf("article_id=");
                if (indexOf > 0) {
                    String substring = str.substring(indexOf + 11);
                    int indexOf2 = substring.indexOf(IndexView.f95329b);
                    if (indexOf2 >= 0) {
                        return substring.substring(0, indexOf2);
                    }
                    return substring;
                }
            } catch (Exception e2) {
            }
        }
        return "";
    }

    public boolean mo1007d() {
        int i2 = -1;
        if (this.f3818a != null) {
            i2 = this.f3818a.followType;
        }
        return i2 == 1;
    }

    public class FriendAvatarWeakReference {
        public FriendProfileImageAvatar f82400a;
        gru f3892a;
        WeakReference f3893a;

        public FriendAvatarWeakReference(QQAppInterface qQAppInterface, AccountDetailActivity accountDetailActivity) {
            this.f82400a = new FriendProfileImageAvatar(qQAppInterface);
            this.f82400a.f85081b = accountDetailActivity.f3873p;
            this.f3893a = new WeakReference(accountDetailActivity);
            this.f3892a = new gru(accountDetailActivity);
        }

        public void a() {
            FriendProfileImageModel.ProfileImageInfo profileImageInfo = new FriendProfileImageModel.ProfileImageInfo();
            profileImageInfo.f9756e = this.f82400a.f85081b;
            profileImageInfo.f9751a = null;
            if (this.f3893a.get() != null) {
                this.f82400a.a((BaseActivity) this.f3893a.get(), profileImageInfo);
                this.f82400a.a(this.f3892a);
                this.f82400a.b((BaseActivity) this.f3893a.get());
                new grt(this, profileImageInfo).execute(new Void[0]);
            }
        }

        public void b() {
            if (this.f3893a.get() != null) {
                this.f82400a.a((FriendProfileImageModel.InfoUpdateListener) null);
                this.f82400a.a((BaseActivity) this.f3893a.get());
            }
        }
    }

    protected void Q() {
        if (TextUtils.isEmpty(this.f3873p)) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "updateHDFace uin is null");
            }
        } else if (!NetworkUtil.i(this)) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "updateHDFace not wifi, so need't update");
            }
        } else {
            this.f3808a = new FriendAvatarWeakReference(this.f3817a, this);
            this.f3808a.a();
        }
    }

    Drawable m1011a() {
        if (this.f3797a != null) {
            return this.f3797a;
        }
        File file = new File(ProfileCardUtil.m9027a(this.f3873p));
        if (file.isFile()) {
            f(file.getAbsolutePath());
            return FaceDrawable.a(this.f3817a, 1, this.f3873p);
        }
        FaceDrawable a2 = FaceDrawable.a(this.f3817a, 1, this.f3873p);
        if (this.f3822a == null) {
            this.f3822a = new grs(this);
            addObserver(this.f3822a);
            return a2;
        }
        return a2;
    }

    public void R() {
        if (TextUtils.isEmpty(this.f3873p)) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "setHDFace uin is null");
                return;
            }
            return;
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "setHDFace again");
        }
        this.f3802a.setBackgroundDrawable(m1011a());
    }

    void f(String str) {
        if (!this.f3884w) {
            this.f3884w = true;
            ThreadManager.m4814b().post(new grc(this, str));
        }
    }

    public void a(FriendProfileImageModel.ProfileImageInfo profileImageInfo) {
        if (profileImageInfo == null) {
            if (QLog.isColorLevel()) {
                QLog.d(f3781d, 2, "updateCurrentImage currentImage is null");
                return;
            }
            return;
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3781d, 2, "updateCurrentImage uin=" + profileImageInfo.f9756e + ", state=" + profileImageInfo.h);
        }
        if (profileImageInfo.h == 6) {
            f(profileImageInfo.f9755d);
        }
    }

    public void S() {
        long j2;
        if (m1024i()) {
            try {
                j2 = Long.parseLong(this.f3873p);
            } catch (Exception e2) {
                j2 = -1;
            }
            if (QLog.isColorLevel()) {
                QLog.d(f3782e, 2, "getBindedTroops:" + j2);
            }
            if (j2 != -1) {
                oidb_0x487.ReqBody reqBody = new oidb_0x487.ReqBody();
                reqBody.uint32_channel.set(1);
                reqBody.uint64_subscribe_code.set(j2);
                ProtoUtils.a(this.f3817a, new grd(this), reqBody.toByteArray(), TroopConstants.ah, 1159, 0);
            }
        }
    }

    @Override
    public void doOnResume() {
        super.doOnResume();
        if (this.f3886y) {
            if (QLog.isColorLevel()) {
                QLog.d(f3782e, 2, "doOnResume, isClickedBindTroopItem==true");
            }
            S();
            this.f3886y = false;
        }
    }

    protected void a(ViewGroup viewGroup) {
        if (m1024i()) {
            int size = this.f3823a.size();
            if (QLog.isColorLevel()) {
                QLog.d(f3782e, 2, "addBindedTroopItem:" + size + "," + this.f3885x);
            }
            if (size != 0 || this.f3885x) {
                View inflate = LayoutInflater.from(this).inflate(R.layout.f57067name_res_0x7f0302d2, viewGroup, false);
                LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.f49826name_res_0x7f090abe);
                View findViewById = inflate.findViewById(R.id.f47982content);
                this.f3800a = linearLayout;
                if (size == 0) {
                    if (this.f3818a != null) {
                        ReportController.b(this.f3817a, "dc01332", "Grp_public", "", "connect", "exp_num", 0, 0, "", "", "", this.f3818a.uin);
                    }
                    findViewById.setVisibility(0);
                    linearLayout.setVisibility(8);
                } else {
                    if (this.f3818a != null) {
                        ReportController.b(this.f3817a, "dc01332", "Grp_public", "", "connect", "exp_grp", 0, 0, "", "", "", this.f3818a.uin);
                    }
                    linearLayout.setVisibility(0);
                    findViewById.setVisibility(8);
                }
                for (int i2 = 0; i2 < size; i2++) {
                    ImageView imageView = new ImageView(this);
                    int i3 = (int) (32.0f * this.f3795a);
                    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(i3, i3);
                    layoutParams.leftMargin = (int) (6.0f * this.f3795a);
                    imageView.setLayoutParams(layoutParams);
                    imageView.setImageDrawable(this.f3817a.m4618a((String) this.f3823a.get(i2)));
                    imageView.setTag(this.f3823a.get(i2));
                    linearLayout.addView(imageView);
                }
                inflate.setOnClickListener(new gre(this, size));
                viewGroup.addView(inflate);
                b(viewGroup);
            }
        }
    }

    protected boolean m1024i() {
        boolean z2 = true;
        if (this.f3818a != null && PublicAccountUtil.a(this.f3818a.accountFlag) != -2) {
            z2 = false;
        }
        if (QLog.isColorLevel()) {
            QLog.d(f3782e, 2, "needShowBindTroopItem:" + z2);
        }
        return z2;
    }

    public boolean a(int i2) {
        structmsg.StructMsg a2 = GroupSystemMsgController.a().a(Long.valueOf(GroupSystemMsgController.a().b()));
        if (a2 == null) {
            return false;
        }
        int i3 = a2.msg_type.get();
        long j2 = a2.msg_seq.get();
        long j3 = a2.req_uin.get();
        int i4 = a2.f109470msg.sub_type.get();
        int i5 = a2.f109470msg.src_id.get();
        int i6 = a2.f109470msg.sub_src_id.get();
        int i7 = a2.f109470msg.group_msg_type.get();
        List list = a2.f109470msg.actions.get();
        if (list == null || i2 >= list.size()) {
            return false;
        }
        this.f3817a.m4626a().m4431a().a(i3, j2, j3, i4, i5, i6, i7, (structmsg.SystemMsgActionInfo) ((structmsg.SystemMsgAction) list.get(i2)).action_info.get(), i2);
        return true;
    }

    protected static boolean a(AccountDetail accountDetail) {
        boolean z2 = true;
        if (accountDetail == null) {
            return false;
        }
        int a2 = PublicAccountUtil.a(accountDetail.accountFlag);
        if (a2 != -2 && a2 != -3 && a2 != -4 && PublicAccountUtil.a(accountDetail.accountFlag2) != -8) {
            z2 = false;
        }
        return z2;
    }

    public int e() {
        return (((this.G - this.H) - this.I) - this.J) - 1;
    }

    public int f() {
        return ((this.G - this.H) - this.J) - 1;
    }

    private boolean j() {
        return ImmersiveUtils.isSupporImmersive() != 1;
    }
}