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

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


package com.tencent.biz.pubaccount.imageCollection;

import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.ClipboardManager;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.text.style.AbsoluteSizeSpan;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.TextView;
import com.tencent.biz.pubaccount.CustomWebView;
import com.tencent.biz.pubaccount.PublicAccountArticleHandler;
import com.tencent.biz.pubaccount.PublicAccountArticleObserver;
import com.tencent.biz.pubaccount.PublicAccountBrowser;
import com.tencent.biz.pubaccount.util.PublicAccountConfigUtil;
import com.tencent.biz.qrcode.util.QRUtils;
import com.tencent.biz.webviewplugin.Share;
import com.tencent.biz.widgets.ElasticHorScrView;
import com.tencent.biz.widgets.XChooserActivity;
import com.tencent.common.app.AppInterface;
import com.tencent.image.AbstractGifImage;
import com.tencent.image.URLDrawable;
import com.tencent.image.Utils;
import com.tencent.mobileqq.activity.ChatActivityConstants;
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.ForwardUtils;
import com.tencent.mobileqq.activity.recent.RecentFaceDecoder;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.BaseActivity;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.ThreadManager;
import com.tencent.mobileqq.forward.ForwardBaseOption;
import com.tencent.mobileqq.msf.core.NetConnInfoCenter;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.structmsg.AbsShareMsg;
import com.tencent.mobileqq.structmsg.AbsStructMsgItem;
import com.tencent.mobileqq.structmsg.StructMsgElementFactory;
import com.tencent.mobileqq.structmsg.StructMsgForGeneralShare;
import com.tencent.mobileqq.troop.utils.TroopBarUtils;
import com.tencent.mobileqq.util.FaceDecoder;
import com.tencent.mobileqq.utils.DialogUtil;
import com.tencent.mobileqq.webview.swift.WebUiBaseInterface;
import com.tencent.mobileqq.webviewplugin.WebUiUtils;
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.tim.wxapi.WXShareHelper;
import com.tencent.widget.ActionSheet;
import com.tencent.widget.ActionSheetHelper;
import com.tencent.widget.AdapterView;
import com.tencent.widget.ImageCollectionGallery;
import cooperation.qqfav.QfavBuilder;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;
import mqq.app.MobileQQ;
public class ImageCollectionActivity extends BaseActivity implements AdapterView.OnItemClickListener, FaceDecoder.DecodeTaskCompletionListener, WebUiBaseInterface, WebUiUtils.WebUiMethodInterface, AdapterView.OnItemLongClickListener {
    public static final String f82508a = "ImageCollectionActivity";
    public static final String f82509b = "ImageCollectionSSOTAG";
    public static final String f82510c = "mqqapi://readinjoy/apenalbum?src_type=app&version=1&articleid=";
    public static final String d = "articleid";
    public static final String e = "recommend_source";
    public static final String f = "recommend_position";
    public static final String g = "click_source";
    private float f4265a;
    int f4266a;
    private long f4267a;
    private View f4269a;
    private ImageView f4270a;
    private TextView f4271a;
    private PublicAccountArticleHandler f4272a;
    private PublicAccountArticleObserver f4273a;
    private ImageCollectionPagerAdapter f4274a;
    public Share f4275a;
    public ElasticHorScrView f4276a;
    private AppInterface f4277a;
    private RecentFaceDecoder f4278a;
    public ActionSheet f4279a;
    private ImageCollectionGallery f4280a;
    private boolean f4282a;
    private float f4283b;
    int f4284b;
    private View f4285b;
    private ImageView f4286b;
    private TextView f4287b;
    public ElasticHorScrView f4288b;
    private boolean f4290b;
    private float f4291c;
    private int f4292c;
    private View f4293c;
    private ImageView f4294c;
    private TextView f4295c;
    private boolean f4297c;
    private float f4298d;
    private int f4299d;
    private View f4300d;
    private TextView f4301d;
    private boolean f4302d;
    private int f4303e;
    private TextView f4304e;
    private boolean f4305e;
    private int f4306f;
    private TextView f4307f;
    private boolean f4308f;
    private int f4309g;
    private boolean f4310g;
    private int h;
    private int k;
    private String m;
    private String p;
    private String f4311h = "";
    private String f4312i = "";
    private String f4313j = "";
    private String f4314k = "";
    private String l = "";
    private ArrayList f4281a = new ArrayList();
    private String n = "";
    private String o = "";
    private ArrayList f4289b = new ArrayList();
    private ArrayList f4296c = new ArrayList();
    private final Handler f4268a = new Handler();
    private int i = -1;
    private int j = -1;

    public static int m1112b(ImageCollectionActivity imageCollectionActivity) {
        int i = imageCollectionActivity.j;
        imageCollectionActivity.j = i + 1;
        return i;
    }

    public static int d(ImageCollectionActivity imageCollectionActivity) {
        int i = imageCollectionActivity.f4299d;
        imageCollectionActivity.f4299d = i + 1;
        return i;
    }

    @Override
    public boolean doOnCreate(Bundle bundle) {
        d();
        super.doOnCreate(bundle);
        e();
        m1130a();
        f();
        g();
        return true;
    }

    @Override
    public void doOnResume() {
        super.doOnResume();
        AbstractGifImage.resumeAll();
        this.f4310g = true;
        super.addObserver(this.f4273a);
        if (this.f4267a != 0) {
            this.f4267a = System.currentTimeMillis();
        }
    }

    @Override
    public void doOnPause() {
        this.f4310g = false;
        super.doOnPause();
        AbstractGifImage.pauseAll();
        c();
    }

    private void c() {
        if (this.i >= 0) {
            ArrayList arrayList = new ArrayList();
            if (this.f4308f) {
                Iterator it = this.f4281a.iterator();
                while (it.hasNext()) {
                    arrayList.add(((PublicAccountArticleObserver.RecommendItemInfo) it.next()).f82434c);
                }
            }
            if (this.i < this.f4296c.size()) {
                this.f4296c.set(this.i, Integer.valueOf((int) (((Integer) this.f4296c.get(this.i)).intValue() + (System.currentTimeMillis() - this.f4267a))));
            } else {
                this.f4296c.add(Integer.valueOf((int) (System.currentTimeMillis() - this.f4267a)));
            }
            this.f4272a.a(this.m, 2, this.f4296c, arrayList);
            for (int i = 0; i < this.f4296c.size(); i++) {
                this.f4296c.set(i, 0);
            }
            super.removeObserver(this.f4273a);
            ReportController.b(null, "dc01332", "Pb_account_lifeservice", this.n, "0X8006F85", "0X8006F85", 0, 0, "", this.m, "" + this.f4289b.size(), "" + this.j);
        }
    }

    @Override
    public void doOnDestroy() {
        this.f4278a.a();
        if (this.f4275a != null) {
            this.f4275a.m1835b();
        }
        super.doOnDestroy();
    }

    @Override
    public boolean isWrapContent() {
        return false;
    }

    private void d() {
        this.m = getIntent().getStringExtra("articleid");
        this.f4303e = getIntent().getIntExtra(e, 0);
        this.f4306f = getIntent().getIntExtra(f, 0);
        this.f4309g = getIntent().getIntExtra(g, 1);
        this.f4277a = (AppInterface) MobileQQ.sMobileQQ.waitAppRuntime(null);
        this.o = this.f4277a.getCurrentAccountUin();
        this.mNeedStatusTrans = false;
    }

    private void e() {
        super.setContentView(R.layout.f56846name_res_0x7f0301f5);
        this.f4265a = getResources().getDisplayMetrics().density;
        this.f4280a = (ImageCollectionGallery) findViewById(R.id.f49443gallery);
        this.f4280a.setSpacing(getResources().getDimensionPixelSize(R.dimen.f39505name_res_0x7f0c005b));
        this.f4280a.setOnItemSelectedListener(new gxv(this));
        this.f4280a.setOnItemClickListener(new gyg(this));
        this.f4280a.setOnTouchListener(new gyl(this));
        this.f4280a.setOnItemLongClickListener(this);
        this.f4280a.setOnOverScrollListener(new gym(this));
        this.f4278a = new RecentFaceDecoder(this.app, this, false);
        this.f4269a = findViewById(R.id.f48073title);
        this.f4269a.setOnClickListener(new gyn(this));
        this.f4271a = (TextView) findViewById(R.id.f47677ivTitleBtnLeft);
        this.f4271a.setOnClickListener(new gyo(this));
        this.f4270a = (ImageView) findViewById(R.id.f48300ivTitleBtnRightImage);
        this.f4270a.setOnClickListener(new gyp(this));
        this.f4286b = (ImageView) findViewById(R.id.f49870name_res_0x7f090aea);
        this.f4287b = (TextView) findViewById(R.id.f49871name_res_0x7f090aeb);
        this.f4285b = findViewById(R.id.f49872name_res_0x7f090aec);
        this.f4285b.setOnClickListener(new gyq(this));
        this.f4295c = (TextView) findViewById(R.id.f49873name_res_0x7f090aed);
        this.f4295c.setMovementMethod(ScrollingMovementMethod.getInstance());
        this.f4301d = (TextView) findViewById(R.id.f49874name_res_0x7f090aee);
        this.f4293c = findViewById(R.id.f49875name_res_0x7f090aef);
        this.f4304e = (TextView) findViewById(R.id.f49876name_res_0x7f090af0);
        findViewById(R.id.f49877name_res_0x7f090af1).setOnClickListener(new gyr(this));
        this.f4294c = (ImageView) findViewById(R.id.f49878name_res_0x7f090af2);
        this.f4307f = (TextView) findViewById(R.id.f49879name_res_0x7f090af3);
        findViewById(R.id.f49880name_res_0x7f090af4).setOnClickListener(new gxw(this));
    }

    private void f() {
        this.f4272a = (PublicAccountArticleHandler) this.f4277a.getBusinessHandler(93);
        this.f4273a = new gxx(this);
    }

    private void g() {
        if (!TextUtils.isEmpty(this.m)) {
            ThreadManager.b(new gxy(this));
        }
    }

    public void h() {
        boolean z = false;
        b();
        if (this.f4278a != null && !TextUtils.isEmpty(this.n)) {
            this.f4286b.setImageDrawable(this.f4278a.a(1008, this.n));
            this.f4286b.setVisibility(0);
            this.f4286b.setOnClickListener(new gxz(this));
        }
        this.f4270a.setVisibility(0);
        this.f4280a.setVisibility(0);
        this.f4285b.setVisibility(0);
        b(0);
        if (PublicAccountConfigUtil.f5199e && this.f4282a) {
            z = true;
        }
        if (z) {
            this.f4301d.setOnClickListener(new gya(this));
        } else {
            this.f4301d.setVisibility(4);
        }
        if (z) {
            this.f4293c.setOnClickListener(new gyb(this));
        } else {
            this.f4293c.setVisibility(4);
        }
    }

    public void i() {
        b();
        findViewById(R.id.f49882name_res_0x7f090af6).setVisibility(0);
    }

    public String m1129a() {
        return this.f4312i == null ? "" : this.f4312i;
    }

    private View a(int i) {
        List arrayList;
        List arrayList2;
        View inflate = super.getLayoutInflater().inflate(R.layout.f56706name_res_0x7f030169, (ViewGroup) null);
        this.f4276a = (ElasticHorScrView) inflate.findViewById(R.id.f48773name_res_0x7f0906a1);
        this.f4288b = (ElasticHorScrView) inflate.findViewById(R.id.f48775name_res_0x7f0906a3);
        if (i == 1) {
            this.f4288b.setVisibility(8);
        }
        GridView gridView = (GridView) inflate.findViewById(R.id.f48774name_res_0x7f0906a2);
        GridView gridView2 = (GridView) inflate.findViewById(R.id.f48776name_res_0x7f0906a4);
        TextView textView = (TextView) inflate.findViewById(R.id.f47786action_sheet_title);
        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) textView.getLayoutParams();
        layoutParams.topMargin = (int) (13.0f * this.f4265a);
        textView.setLayoutParams(layoutParams);
        textView.setText(R.string.f63203cancel);
        textView.setOnClickListener(new gyc(this));
        if (Build.VERSION.SDK_INT >= 9) {
            this.f4276a.setOverScrollMode(2);
            this.f4288b.setOverScrollMode(2);
        }
        gridView2.setSmoothScrollbarEnabled(false);
        List[] a2 = a();
        if (a2.length > 0) {
            arrayList = a2[0];
        } else {
            arrayList = new ArrayList(0);
        }
        if (a2.length > 1) {
            arrayList2 = a2[1];
        } else {
            arrayList2 = new ArrayList(0);
        }
        int size = arrayList.size();
        gridView.setNumColumns(size);
        ViewGroup.LayoutParams layoutParams2 = gridView.getLayoutParams();
        layoutParams2.width = (int) ((((size - 1) * 10) + (size * 75) + 3) * this.f4265a);
        gridView.setLayoutParams(layoutParams2);
        gridView.setAdapter((ListAdapter) new PublicAccountBrowser.ActionSheetItemAdapter(this, 0, arrayList));
        gridView.setSelector(new ColorDrawable(0));
        gridView.setOnItemClickListener(this);
        int i2 = layoutParams2.width;
        this.f4284b = i2;
        int size2 = arrayList2.size();
        ViewGroup.LayoutParams layoutParams3 = gridView2.getLayoutParams();
        layoutParams3.width = (int) (((size2 * 75) + ((size2 - 1) * 10) + 3) * this.f4265a);
        gridView2.setLayoutParams(layoutParams3);
        gridView2.setNumColumns(size2);
        gridView2.setAdapter((ListAdapter) new PublicAccountBrowser.ActionSheetItemAdapter(this, 0, arrayList2));
        gridView2.setSelector(new ColorDrawable(0));
        gridView2.setOnItemClickListener(this);
        int i3 = layoutParams3.width;
        this.f4266a = i3;
        inflate.post(new gyd(this, i2, i3));
        return inflate;
    }

    private List[] a() {
        ArrayList arrayList = new ArrayList();
        PublicAccountBrowser.ActionSheetItem actionSheetItem = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem.f4003a = super.getString(R.string.f60742name_res_0x7f0a0923);
        actionSheetItem.B = R.drawable.f41658name_res_0x7f020245;
        actionSheetItem.f4004a = true;
        actionSheetItem.C = 2;
        actionSheetItem.f4005b = "";
        arrayList.add(actionSheetItem);
        PublicAccountBrowser.ActionSheetItem actionSheetItem2 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem2.f4003a = super.getString(R.string.f60749name_res_0x7f0a092a);
        actionSheetItem2.B = R.drawable.f41659name_res_0x7f020246;
        actionSheetItem2.f4004a = true;
        actionSheetItem2.C = 3;
        actionSheetItem2.f4005b = "";
        arrayList.add(actionSheetItem2);
        PublicAccountBrowser.ActionSheetItem actionSheetItem3 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem3.f4003a = super.getString(R.string.f60759name_res_0x7f0a0934);
        actionSheetItem3.B = R.drawable.f41661name_res_0x7f020248;
        actionSheetItem3.C = 9;
        actionSheetItem3.f4005b = "";
        arrayList.add(actionSheetItem3);
        PublicAccountBrowser.ActionSheetItem actionSheetItem4 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem4.f4003a = super.getString(R.string.f60760name_res_0x7f0a0935);
        actionSheetItem4.B = R.drawable.f41655name_res_0x7f020242;
        actionSheetItem4.C = 10;
        actionSheetItem4.f4005b = "";
        arrayList.add(actionSheetItem4);
        PublicAccountBrowser.ActionSheetItem actionSheetItem5 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem5.f4003a = super.getString(R.string.f60747name_res_0x7f0a0928);
        actionSheetItem5.f4004a = true;
        actionSheetItem5.B = R.drawable.f43106name_res_0x7f0207f1;
        actionSheetItem5.C = 4;
        actionSheetItem5.f4005b = "";
        arrayList.add(actionSheetItem5);
        ArrayList arrayList2 = new ArrayList();
        PublicAccountBrowser.ActionSheetItem actionSheetItem6 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem6.f4003a = super.getString(R.string.f60758name_res_0x7f0a0933);
        actionSheetItem6.f4004a = true;
        actionSheetItem6.B = R.drawable.f41111name_res_0x7f020021;
        actionSheetItem6.C = 6;
        actionSheetItem6.f4005b = "";
        arrayList2.add(actionSheetItem6);
        PublicAccountBrowser.ActionSheetItem actionSheetItem7 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem7.f4003a = super.getString(R.string.f60744name_res_0x7f0a0925);
        actionSheetItem7.B = R.drawable.f41105name_res_0x7f02001b;
        actionSheetItem7.f4004a = true;
        actionSheetItem7.C = 1;
        actionSheetItem7.f4005b = "";
        arrayList2.add(actionSheetItem7);
        PublicAccountBrowser.ActionSheetItem actionSheetItem8 = new PublicAccountBrowser.ActionSheetItem();
        actionSheetItem8.f4003a = super.getString(R.string.f60746name_res_0x7f0a0927);
        actionSheetItem8.B = R.drawable.f41121name_res_0x7f02002b;
        actionSheetItem8.f4004a = true;
        actionSheetItem8.C = 11;
        actionSheetItem8.f4005b = "";
        arrayList2.add(actionSheetItem8);
        return new ArrayList[]{arrayList, arrayList2};
    }

    public void m1131a(int i) {
        if (!isFinishing() && this.f4274a != null) {
            if (this.f4279a == null) {
                this.f4279a = (ActionSheet) ActionSheetHelper.a(this, (View) null);
                this.f4279a.b(a(i), (LinearLayout.LayoutParams) null);
            } else {
                this.f4279a.b(a(i), (LinearLayout.LayoutParams) null);
            }
            try {
                if (!this.f4279a.isShowing()) {
                    this.f4279a.show();
                    if (i == 1) {
                        this.k = 2;
                    } else {
                        this.k = 1;
                    }
                }
            } catch (Exception e2) {
            }
        }
    }

    @Override
    public void onItemClick(android.widget.AdapterView adapterView, View view, int i, long j) {
        String valueOf;
        Object tag = view.getTag();
        if (tag != null) {
            if (this.f4279a.isShowing()) {
                this.f4279a.dismiss();
            }
            int i2 = ((PublicAccountBrowser.ActionSheetItemViewHolder) tag).f4008a.C;
            String m1129a = m1129a();
            if (i2 == 1) {
                ((ClipboardManager) getSystemService("clipboard")).setText(m1129a);
                QRUtils.a(3, (int) R.string.f60645name_res_0x7f0a08c1);
                e(8);
            } else if (i2 == 11) {
                Pattern.compile("http://.*.mp.qq.com.*").matcher(m1129a);
                String str = null;
                try {
                    str = URLEncoder.encode(m1129a, "UTF-8");
                } catch (UnsupportedEncodingException e2) {
                    if (QLog.isColorLevel()) {
                        QLog.d(f82508a, 2, "encode url failed, because UTF-8 is unknown");
                    }
                }
                String str2 = "http://jubao.mp.qq.com/mobile/report?qq=" + this.o + "&mp_uin=" + this.n + "&scene=200&sub_appname=article_webview&timestamp=" + String.valueOf(NetConnInfoCenter.getServerTime()) + "&sign=" + MD5Utils.b(str + 200 + valueOf + "jubao@article@123").toLowerCase() + "&article_url=" + str;
                Intent intent = new Intent(this, QQBrowserActivity.class);
                intent.putExtra("url", str2);
                intent.putExtra("hide_more_button", true);
                startActivity(intent);
                e(9);
            } else if (i2 == 2) {
                j();
                e(1);
            } else if (i2 == 4) {
                Intent intent2 = new Intent(XChooserActivity.i, Uri.parse(m1129a));
                intent2.putExtra("normal", true);
                try {
                    startActivity(intent2);
                } catch (ActivityNotFoundException e3) {
                    QRUtils.a(2, (int) R.string.f60665name_res_0x7f0a08d5);
                }
                e(5);
            } else if (i2 == 3) {
                this.f4275a.m1833a(m1129a, 2, false);
                e(2);
            } else if (i2 == 6) {
                a(m1129a, true);
                e(6);
            } else if (i2 == 9 || i2 == 10) {
                if (i2 == 9) {
                    e(3);
                } else {
                    e(4);
                }
                int i3 = -1;
                if (!WXShareHelper.a().m10253a()) {
                    i3 = R.string.f64448name_res_0x7f0a179f;
                } else if (!WXShareHelper.a().m10254b()) {
                    i3 = R.string.f64449name_res_0x7f0a17a0;
                }
                if (i3 != -1) {
                    QRUtils.a(0, i3);
                } else if (i2 == 9) {
                    this.f4275a.m1833a(m1129a, 3, true);
                } else {
                    this.f4275a.m1833a(m1129a, 4, true);
                }
            }
        }
    }

    protected void a(String str, boolean z) {
        if (this.f4277a != null) {
            String currentAccountUin = this.f4277a.getCurrentAccountUin();
            QfavBuilder.a(str).c(currentAccountUin).a(this, currentAccountUin, 101, null);
        }
    }

    private void j() {
        AbsShareMsg a2 = new AbsShareMsg.Builder(StructMsgForGeneralShare.class).a("web", this.f4312i, f82510c + this.m, "", "").a("[分享]" + this.f4313j).a();
        String str = this.l;
        AbsStructMsgItem a3 = StructMsgElementFactory.a(2);
        a3.a(str, this.f4313j, this.f4314k, 1);
        a2.addItem(a3);
        Intent intent = new Intent();
        intent.putExtra(AppConstants.Key.G, -3);
        intent.putExtra(AppConstants.Key.ci, a2.getBytes());
        ForwardBaseOption.a(this, intent, 3);
    }

    @Override
    public void doOnActivityResult(int i, int i2, Intent intent) {
        switch (i) {
            case 3:
                if (i2 == -1) {
                    ForwardUtils.a((QQAppInterface) getAppRuntime(), this, getApplicationContext(), intent, null);
                    return;
                }
                return;
            case 21:
                if (i2 == -1) {
                    a(intent.getExtras());
                    return;
                }
                return;
            case 100:
                if (intent != null) {
                    this.p = intent.getStringExtra("comment");
                    this.f4290b = intent.getBooleanExtra("anonymous", false);
                    if (i2 == 0) {
                        a(this.p);
                        return;
                    } else if (i2 == -1) {
                        a("");
                        ThreadManager.b(new gye(this));
                        return;
                    } else {
                        return;
                    }
                }
                return;
            case 101:
                QfavBuilder.a(this, intent);
                return;
            default:
                return;
        }
    }

    private void a(boolean z) {
        if (this.f4295c != null) {
            this.f4295c.setVisibility(z ? 0 : 8);
        }
    }

    private void b(int i) {
        if (this.f4295c != null && i >= 0 && i < this.f4289b.size()) {
            int i2 = this.f4292c + 1;
            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(i2 + "/" + this.f4289b.size());
            spannableStringBuilder.append((CharSequence) (TroopBarUtils.y + ((PublicAccountArticleObserver.PhotoItemInfo) this.f4289b.get(i)).f82431b));
            spannableStringBuilder.setSpan(new AbsoluteSizeSpan(20, true), 0, String.valueOf(i2).length(), 18);
            this.f4295c.setText(spannableStringBuilder);
            this.f4295c.scrollTo(0, 0);
        }
    }

    private void a(String str) {
        if (this.f4301d != null) {
            this.f4301d.setText(str);
        }
    }

    public void c(int i) {
        if (this.f4304e != null && i >= 0) {
            this.f4304e.setText(String.valueOf(i));
        }
    }

    public void d(int i) {
        if (this.f4307f != null && i >= 0) {
            this.f4307f.setText(String.valueOf(i));
        }
    }

    public void k() {
        Intent intent = new Intent(this, ImageCollectionCommentActivity.class);
        if (!TextUtils.isEmpty(this.p)) {
            intent.putExtra("comment", this.p);
        }
        intent.putExtra("anonymous", this.f4290b);
        startActivityForResult(intent, 100);
    }

    public void l() {
        if (!TextUtils.isEmpty(this.f4311h)) {
            Intent intent = new Intent(this, PublicAccountBrowser.class);
            intent.putExtra("uin", this.o);
            intent.putExtra("url", this.f4311h);
            intent.putExtra("puin", this.n);
            startActivity(intent);
        }
        NetConnInfoCenter.getServerTime();
        ReportController.b(null, "dc01332", "Pb_account_lifeservice", this.n, "0X8006F9E", "0X8006F9E", 0, 0, "", this.m, "", "");
    }

    public void m() {
        this.f4272a.a(this.m, this.f4297c);
        if (this.f4297c) {
            this.f4297c = false;
            this.f4294c.setImageResource(R.drawable.f42679name_res_0x7f020646);
            this.h--;
        } else {
            this.f4297c = true;
            this.f4294c.setImageResource(R.drawable.f42642name_res_0x7f020621);
            this.h++;
        }
        d(this.h);
    }

    public void n() {
        m1131a(1);
    }

    public void o() {
        b(this.f4292c);
        a(true);
        this.f4270a.setVisibility(0);
        if (!TextUtils.isEmpty(this.n)) {
            this.f4286b.setVisibility(0);
        }
        this.f4287b.setVisibility(8);
        this.f4280a.a(true);
        this.f4280a.b(true);
        this.f4280a.setRotateEnable(true);
        this.f4280a.setOnItemLongClickListener(this);
        c(this.f4305e);
    }

    public void p() {
        a(false);
        this.f4270a.setVisibility(8);
        this.f4286b.setVisibility(8);
        this.f4287b.setVisibility(0);
        this.f4280a.a(false);
        this.f4280a.b(false);
        this.f4280a.setRotateEnable(false);
        this.f4280a.setOnItemLongClickListener(null);
        c(false);
    }

    @Override
    public void a(int i, int i2, String str, Bitmap bitmap) {
        if (bitmap != null && str != null && str.length() != 0) {
            this.f4286b.setImageBitmap(bitmap);
            if (QLog.isColorLevel()) {
                QLog.d(f82508a, 2, "onDecodeTaskCompleted->uin:" + str);
            }
        }
    }

    public void b(boolean z) {
        if (isActivityResume()) {
            Dialog dialog = new Dialog(this, R.style.f67726name_res_0x7f0d020a);
            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
            dialog.setContentView(R.layout.f56848name_res_0x7f0301f7);
            if (!z) {
                ((TextView) dialog.findViewById(R.id.f49888name_res_0x7f090afc)).setText(R.string.f66439name_res_0x7f0a1f6b);
            }
            dialog.show();
            this.f4268a.postDelayed(new gyf(this, dialog), 1000L);
        }
    }

    public void q() {
        this.f4305e = !this.f4305e;
        c(this.f4305e);
    }

    private void c(boolean z) {
        if (z) {
            this.f4269a.setVisibility(8);
            this.f4285b.setVisibility(8);
            return;
        }
        this.f4269a.setVisibility(0);
        this.f4285b.setVisibility(0);
    }

    public void a(PublicAccountArticleObserver.RecommendItemInfo recommendItemInfo, int i) {
        Intent intent = new Intent(this, ImageCollectionActivity.class);
        intent.putExtra("articleid", recommendItemInfo.f82434c);
        intent.putExtra(e, recommendItemInfo.f82432a);
        intent.putExtra(f, i);
        intent.putExtra(g, 2);
        startActivity(intent);
        ReportController.b(null, "dc01332", "Pb_account_lifeservice", "" + this.n, "0X8006F83", "0X8006F83", 0, 0, recommendItemInfo.f82434c, this.m, "" + i, "" + this.f4281a.size());
    }

    @Override
    public boolean mo1348a(com.tencent.widget.AdapterView adapterView, View view, int i, long j) {
        if (i < 0 || i >= this.f4289b.size()) {
            return false;
        }
        r();
        return true;
    }

    private void r() {
        View a2 = this.f4280a.a();
        if (a2 == null) {
            QQToast.a(this, getString(R.string.f64627name_res_0x7f0a1852), 0).m9833a();
            return;
        }
        Drawable drawable = ((ImageView) a2.findViewById(R.id.f47145image)).getDrawable();
        if (drawable == null || !(drawable instanceof URLDrawable)) {
            QQToast.a(this, getString(R.string.f64627name_res_0x7f0a1852), 0).m9833a();
            return;
        }
        URLDrawable uRLDrawable = (URLDrawable) drawable;
        if (uRLDrawable.getStatus() != 1) {
            QQToast.a(this, getString(R.string.f64627name_res_0x7f0a1852), 0).m9833a();
            return;
        }
        ActionSheet actionSheet = (ActionSheet) ActionSheetHelper.a(this, (View) null);
        actionSheet.a(R.string.f64805name_res_0x7f0a1904, 1);
        actionSheet.a(R.string.f64810name_res_0x7f0a1909, 1);
        actionSheet.d(R.string.f63203cancel);
        actionSheet.a(new gyh(this, actionSheet, uRLDrawable));
        actionSheet.show();
    }

    public void a(URLDrawable uRLDrawable, String str) {
        Bundle bundle = new Bundle();
        bundle.putInt(AppConstants.Key.G, 1);
        File file = new File(AppConstants.cw);
        if (!file.exists()) {
            file.mkdirs();
        }
        String str2 = AppConstants.cw + Utils.Crc64String(uRLDrawable.getURL().toString());
        if (!new File(str2).exists()) {
            try {
                str2 = uRLDrawable.saveTo(str2);
            } catch (IOException e2) {
                if (QLog.isColorLevel()) {
                    QLog.e(ChatActivityConstants.C, 2, "IOException", e2);
                }
            }
        }
        bundle.putBoolean(AppConstants.Key.ae, true);
        bundle.putString(AppConstants.Key.af, str);
        bundle.putString(AppConstants.Key.L, str2);
        bundle.putString(AppConstants.Key.ag, uRLDrawable.getURL().toString());
        bundle.putString(AppConstants.Key.S, str2);
        Intent intent = new Intent();
        intent.putExtras(bundle);
        ForwardBaseOption.a(this, intent, 21);
    }

    public void a(URLDrawable uRLDrawable) {
        if (uRLDrawable.getStatus() == 1) {
            new File(AppConstants.bH).mkdirs();
            String str = AppConstants.bH + Utils.Crc64String(uRLDrawable.getURL().toString());
            File file = new File(str);
            if (!file.exists()) {
                try {
                    if (file.createNewFile()) {
                        b(uRLDrawable, file.getPath());
                        return;
                    }
                    return;
                } catch (IOException e2) {
                    QQToast.a(this, getString(R.string.f64114name_res_0x7f0a1651), 0).m9833a();
                    return;
                }
            }
            DialogUtil.m9154a((Context) this, 230).setTitle(getString(R.string.f64116name_res_0x7f0a1653)).setMessage(getString(R.string.f64118name_res_0x7f0a1655)).setPositiveButton(getString(R.string.f64117name_res_0x7f0a1654), new gyj(this, uRLDrawable, str)).setNegativeButton(getString(R.string.aeo), new gyi(this)).show();
        }
    }

    public void b(URLDrawable uRLDrawable, String str) {
        new gyk(this, uRLDrawable, str).execute(new Void[0]);
    }

    private void a(Bundle bundle) {
        Intent a2 = AIOUtils.a(new Intent(this, SplashActivity.class), (int[]) null);
        a2.putExtras(new Bundle(bundle));
        startActivity(a2);
        finish();
    }

    private void e(int i) {
        String str;
        if (this.k == 1) {
            str = "0X8006F9F";
        } else {
            str = "0X800704C";
        }
        ReportController.b(null, "dc01332", "Pb_account_lifeservice", "" + this.n, str, str, 0, 0, "", this.m, "" + i, "");
    }

    @Override
    public String getCurrentUrl() {
        return null;
    }

    @Override
    public CustomWebView getWebView() {
        return null;
    }

    @Override
    public void hideQQBrowserButton() {
    }

    @Override
    public void setBottomBarVisible(boolean z) {
    }

    @Override
    public boolean isActivityResume() {
        return this.f4310g;
    }

    @Override
    public void showActionSheet() {
    }

    @Override
    public boolean isFullScreen() {
        return true;
    }

    protected void m1130a() {
        if (this.f4300d == null) {
            this.f4300d = findViewById(R.id.f49881name_res_0x7f090af5);
        }
        this.f4300d.setVisibility(0);
    }

    protected void b() {
        if (this.f4300d != null) {
            this.f4300d.setVisibility(8);
        }
    }
}