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

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


package com.tencent.biz.pubaccount.subscript;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.tencent.biz.common.offline.HtmlOffline;
import com.tencent.biz.pubaccount.PublicAccountBrowser;
import com.tencent.biz.pubaccount.troopbarassit.TroopBarAssistantManager;
import com.tencent.biz.pubaccount.util.PublicAccountConfigUtil;
import com.tencent.biz.pubaccount.util.PublicAccountUtil;
import com.tencent.biz.pubaccount.util.PublicTracker;
import com.tencent.biz.ui.CustomGuideView;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.common.config.AppSetting;
import com.tencent.mobileqq.activity.ChatActivity;
import com.tencent.mobileqq.activity.Conversation;
import com.tencent.mobileqq.activity.PublicAccountSearchActivity;
import com.tencent.mobileqq.activity.aio.AIOUtils;
import com.tencent.mobileqq.activity.fling.TopGestureLayout;
import com.tencent.mobileqq.activity.recent.RecentUtil;
import com.tencent.mobileqq.activity.recent.cur.DragFrameLayout;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.IphoneTitleBarActivity;
import com.tencent.mobileqq.app.MessageObserver;
import com.tencent.mobileqq.app.PublicAccountHandler;
import com.tencent.mobileqq.app.ThreadManager;
import com.tencent.mobileqq.data.MessageRecord;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.theme.ThemeUtil;
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.SwipListView;
import com.tencent.widget.XListView;
import cooperation.readinjoy.ReadInJoyHelper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import mqq.os.MqqHandler;
public class SubscriptFeedsActivity extends IphoneTitleBarActivity implements View.OnClickListener, DragFrameLayout.OnDragModeChangedListener, SwipListView.RightIconMenuListener, Observer {
    public static final int f82715a = 1002;
    static final String f4920a = "subscript_feeds_readinjoy_articles";
    public static final int f82716b = 1003;
    public static final String f4921b = "subscript_guid";
    public static final int f82717c = 1004;
    private static final String f4922c = SubscriptFeedsActivity.class.getSimpleName();
    public static final int d = 1005;
    private static final String f4923d = "http://sqimg.qq.com/qq_product_operations/dyzx_folder/index.html?_bid=2312";
    public static final int e = 1006;
    private static final String f4924e = "http://dyzx.mp.qq.com/static/v8/page/subscribecategory.html?_wv=1027&_bid=2278";
    public static final int f = 1007;
    private float f4925a;
    public long f4926a;
    public View f4927a;
    private EditText f4928a;
    private PopupWindow f4929a;
    private SubscriptFeedsAdapter f4930a;
    private SubscriptPicManager f4932a;
    public SubscriptRecommendController f4933a;
    private CustomGuideView f4934a;
    private TopGestureLayout f4935a;
    protected DragFrameLayout f4936a;
    private SwipListView f4938a;
    private ArrayList f4940a;
    private List f4941a;
    protected boolean f4943a;
    private float f4944b;
    public long f4945b;
    private View f4946b;
    public boolean f4947b;
    private long f4948c;
    public boolean f4949c;
    private long f4950d;
    public boolean f4951d;
    private boolean f4952e;
    private boolean f4953f;
    private boolean f4954g;
    private boolean f4955h;
    private int i;
    private boolean f4956i;
    private int h = -1;
    protected int g = 0;
    private XListView.DrawFinishedListener f4939a = new hgh(this);
    MessageObserver f4937a = new hgk(this);
    public MqqHandler f4942a = new hgm(this, ThreadManager.b());
    private SubscriptObserver f4931a = new hgt(this);

    @Override
    public boolean doOnCreate(Bundle bundle) {
        Drawable drawable;
        this.f4926a = SystemClock.uptimeMillis();
        PublicTracker.a(null, PublicTracker.f5268a);
        super.doOnCreate(bundle);
        if (Build.VERSION.SDK_INT >= 11) {
            getWindow().setFlags(16777216, 16777216);
        }
        if (Build.VERSION.SDK_INT >= 19) {
            new MqqHandler().postDelayed(new hgu(this), 1000L);
        }
        setContentView(R.layout.f57113name_res_0x7f030300);
        getWindow().setBackgroundDrawable(null);
        this.f4936a = DragFrameLayout.a((Activity) this);
        this.f4936a.a((DragFrameLayout.OnDragModeChangedListener) this, false);
        this.f4943a = true;
        this.g = super.getIntent().getIntExtra(SubscriptRecommendController.f5057b, 0);
        this.f4950d = super.getIntent().getLongExtra("start_time", 0L);
        this.f4953f = super.getIntent().getBooleanExtra(SubscriptRecommendController.f5059d, false);
        this.f4932a = new SubscriptPicManager();
        setTitle(PublicAccountConfigUtil.a(this.app, getApplicationContext()));
        c();
        boolean f2 = SubscriptRecommendController.f(this.app);
        this.rightViewText.setText(R.string.f66126name_res_0x7f0a1e32);
        if (f2) {
            this.rightViewText.setVisibility(0);
        } else {
            this.rightViewText.setVisibility(8);
        }
        this.rightViewImg.setVisibility(8);
        this.rightViewText.setOnClickListener(this);
        this.f4927a = findViewById(R.id.f49070name_res_0x7f0907ca);
        this.f4938a = (SwipListView) findViewById(R.id.f50992name_res_0x7f090f4c);
        SwipListView swipListView = this.f4938a;
        if (ThemeUtil.isInNightMode(this.app)) {
            drawable = getResources().getDrawable(R.color.f38775name_res_0x7f0b0176);
        } else {
            drawable = getResources().getDrawable(R.color.f38698name_res_0x7f0b0129);
        }
        swipListView.setDivider(drawable);
        this.f4938a.setDividerHeight(getResources().getDimensionPixelSize(R.dimen.f40668name_res_0x7f0c04e6));
        this.f4938a.setOnScrollListener(new hgv(this));
        this.f4938a.setDrawFinishedListener(this.f4939a);
        this.f4946b = LayoutInflater.from(this).inflate(R.layout.f58275name_res_0x7f03078a, (ViewGroup) null);
        this.f4946b.setBackgroundDrawable(null);
        ((Button) this.f4946b.findViewById(R.id.f48669btn_cancel_search)).setVisibility(8);
        ((TextView) this.f4946b.findViewById(R.id.f51949name_res_0x7f091309)).setText(String.format(getResources().getString(R.string.f60734name_res_0x7f0a091b), PublicAccountConfigUtil.a(this.app, getApplicationContext())));
        this.f4928a = (EditText) this.f4946b.findViewById(R.id.f48670et_search_keyword);
        this.f4928a.setCursorVisible(false);
        this.f4928a.setOnFocusChangeListener(new hgw(this));
        this.f4938a.a(this.f4946b);
        e();
        this.f4930a = new SubscriptFeedsAdapter(this, this.app, this.f4938a, getLayoutInflater());
        this.f4930a.a(this);
        this.f4938a.setAdapter((ListAdapter) this.f4930a);
        this.f4930a.a(this.f4936a);
        this.f4930a.a(this.f4932a);
        if (!ThemeUtil.isInNightMode(this.app)) {
            this.f4938a.setBackgroundResource(R.color.f38928name_res_0x7f0b020f);
        } else {
            this.f4938a.setBackgroundResource(R.color.f38929name_res_0x7f0b0210);
        }
        this.f4938a.setDragEnable(true);
        this.f4938a.setRightIconMenuListener(this);
        ThreadManager.b(new hgx(this));
        g();
        if (this.f4933a == null) {
            this.f4933a = new SubscriptRecommendController(this, this.app, this.f4932a);
        }
        this.app.setHandler(getClass(), this.f4942a);
        return true;
    }

    private void e() {
        boolean z = true;
        String str = AppSetting.g + this.app.m4704d() + "subscript_guid";
        if (!this.app.getPreferences().getBoolean(str, true) || !SubscriptRecommendController.f(this.app)) {
            z = false;
        }
        if (z) {
            this.app.getPreferences().edit().putBoolean(str, false).commit();
            try {
                Resources resources = getResources();
                this.f4929a = new PopupWindow();
                this.f4934a = new CustomGuideView(this);
                this.f4934a.g = resources.getColor(R.color.f38773name_res_0x7f0b0174);
                this.f4934a.f = resources.getColor(R.color.f38774name_res_0x7f0b0175);
                this.f4934a.f83332a = AIOUtils.a(2, 14, resources);
                this.f4934a.e = AIOUtils.a(12.0f, resources);
                this.f4934a.f6542a = AIOUtils.a(30.0f, resources);
                this.f4934a.f83333b = AIOUtils.a(7.0f, resources);
                this.f4934a.h = AIOUtils.a(12.0f, resources);
                this.f4934a.f83334c = AIOUtils.a(3.0f, resources);
                this.f4934a.f6546a = "点击查看更多精彩内容";
                this.f4934a.setOnClickListener(this);
                this.f4934a.setId(R.id.f47371name_res_0x7f090125);
                this.f4929a.setContentView(this.f4934a);
                this.f4929a.setFocusable(false);
                this.f4929a.setOutsideTouchable(false);
                this.f4929a.setWidth(this.f4934a.b());
                this.f4929a.setHeight(-2);
                this.rightViewText.post(new hgy(this, getResources().getDisplayMetrics().widthPixels, this.f4934a.b()));
            } catch (Exception e2) {
                if (QLog.isColorLevel()) {
                    QLog.e(f4922c, 2, "showSubscriptCenterGuideWindow, " + e2);
                }
            }
        }
    }

    public void f() {
        if (this.f4929a != null && this.f4929a.isShowing()) {
            this.f4934a.setOnClickListener(null);
            try {
                this.f4929a.dismiss();
            } catch (Exception e2) {
                if (QLog.isColorLevel()) {
                    QLog.e(f4922c, 2, "closeSubscriptCenterGuideWindow, " + e2);
                }
            }
        }
    }

    @Override
    public void doOnResume() {
        SubscriptHandler subscriptHandler;
        super.doOnResume();
        super.findViewById(R.id.f48922name_res_0x7f090736).setVisibility(SubscriptRecommendController.m1395c(this.app) ? 0 : 8);
        if (this.f4947b) {
            if (ReadInJoyHelper.m11178c(this.app) && (subscriptHandler = (SubscriptHandler) this.app.getBusinessHandler(64)) != null) {
                subscriptHandler.b(this.app.getCurrentAccountUin());
            }
            this.f4947b = false;
        }
        if (this.f4954g) {
            String m1389a = SubscriptRecommendController.m1389a(this.app);
            Intent intent = new Intent(this, PublicAccountBrowser.class);
            if (TextUtils.isEmpty(m1389a)) {
                m1389a = f4923d;
            }
            intent.putExtra("url", m1389a);
            intent.putExtra("uin", this.app.m4704d());
            intent.putExtra("fromLocalUrl", true);
            intent.putExtra(PublicAccountBrowser.h, true);
            intent.putExtra(PublicAccountBrowser.j, "关闭");
            intent.putExtra(PublicAccountBrowser.e, true);
            intent.putExtra(PublicAccountBrowser.j, PublicAccountConfigUtil.a(this.app, (Context) this));
            intent.putExtra(PublicAccountBrowser.r, 1001);
            startActivity(intent);
            overridePendingTransition(R.anim.f37675name_res_0x7f040091, R.anim.f37542name_res_0x7f04000c);
            if (QLog.isColorLevel()) {
                QLog.d(f4922c, 2, "subscript full recommend need show !");
            }
            this.f4954g = false;
            ReportController.b(this.app, "dc01331", "", "", "0X8006505", "0X8006505", 0, 0, "", "", "", "");
        }
        m1388a();
        b();
    }

    @Override
    public void doOnPause() {
        super.doOnPause();
        if (this.f4936a != null) {
            this.f4936a.m3749a();
        }
    }

    @Override
    public void doOnDestroy() {
        if (this.app != null) {
            this.app.removeHandler(getClass());
        }
        if (this.f4942a != null) {
            this.f4942a.removeCallbacksAndMessages(null);
            this.f4942a = null;
        }
        removeObserver(this.f4937a);
        removeObserver(this.f4931a);
        if (this.app != null && this.app.m4635a() != null) {
            this.app.m4635a().deleteObserver(this);
        }
        if (this.f4938a != null) {
            this.f4938a.setAdapter((ListAdapter) null);
            this.f4938a.setDrawFinishedListener(null);
        }
        if (this.f4930a != null) {
            this.f4930a.a();
            this.f4930a = null;
        }
        this.f4941a = null;
        this.f4940a = null;
        if (this.f4933a != null) {
            this.f4933a.f();
        }
        this.f4936a.a((DragFrameLayout.OnDragModeChangedListener) this);
        this.f4932a.a();
        this.f4932a = null;
        if (this.f4950d != 0) {
            this.f4950d = System.currentTimeMillis() - this.f4950d;
            ReportController.b(this.app, "dc01332", "Pb_account_lifeservice", "0", "0X80064CC", "0X80064CC", 0, 0, "" + (this.f4953f ? 1 : 0), "" + this.f4950d, "", "");
            this.f4950d = 0L;
            this.f4953f = false;
        }
        super.doOnDestroy();
    }

    @Override
    public void finish() {
        super.finish();
        TroopBarAssistantManager.a().e(this.app);
    }

    private void g() {
        ThreadManager.b(new hgz(this));
        if (TroopBarAssistantManager.a().m1409a(this.app)) {
            TroopBarAssistantManager.a().a(this.app.getEntityManagerFactory().createEntityManager(), this.app);
        }
        addObserver(this.f4937a);
        addObserver(this.f4931a);
        this.app.m4635a().addObserver(this);
        if (ReadInJoyHelper.m11178c(this.app)) {
            this.f4940a = m1382a();
            SubscriptHandler subscriptHandler = (SubscriptHandler) this.app.getBusinessHandler(64);
            if (subscriptHandler != null) {
                subscriptHandler.b(this.app.getCurrentAccountUin());
            }
        }
        HtmlOffline.b("2278", this.app, true, new hha(this));
    }

    public void m1388a() {
        if (this.f4943a) {
            this.f4933a.g();
            this.f4943a = false;
        } else {
            this.f4933a.h();
        }
        this.f4930a.a(this.f4933a);
    }

    public void b() {
        try {
            if (this.f4942a != null) {
                this.f4942a.removeMessages(1002);
                this.f4942a.sendEmptyMessage(1002);
            }
        } catch (Exception e2) {
            if (QLog.isColorLevel()) {
                QLog.e(f4922c, 2, "refreshTroopBarAccountList, error: ", e2);
            }
        }
    }

    public void c() {
        if (this.leftView != null) {
            ThreadManager.a(new hhb(this), 5, null, true);
        }
    }

    private void h() {
        if (this.f4941a != null && this.f4941a.size() > 0) {
            ArrayList arrayList = new ArrayList();
            arrayList.addAll(this.f4941a);
            ThreadManager.a(new hgi(this, arrayList), 5, null, false);
        }
    }

    @Override
    public void onClick(View view) {
        int i;
        int i2;
        int i3;
        PublicAccountHandler publicAccountHandler;
        switch (view.getId()) {
            case R.id.f47371name_res_0x7f090125:
                ReportController.b(this.app, "dc01331", "", "", "0X8006572", "0X8006572", 0, 0, "", "", "", "");
                PublicAccountSearchActivity.a(this, PublicAccountConfigUtil.a(this.app, (Context) this), null, f4924e);
                SubscriptRecommendController.b(this.app, false);
                f();
                return;
            case R.id.f48299ivTitleBtnRightText:
                ReportController.b(this.app, "dc01332", "Pb_account_lifeservice", "", SubscriptConstants.j, SubscriptConstants.j, 0, 0, "", "", "", "");
                PublicAccountSearchActivity.a(this, PublicAccountConfigUtil.a(this.app, (Context) this), null, f4924e);
                SubscriptRecommendController.b(this.app, false);
                f();
                return;
            case R.id.f49914name_res_0x7f090b16:
                Object tag = view.getTag(R.id.f47363name_res_0x7f09011d);
                String str = tag != null ? (String) tag : "";
                Object tag2 = view.getTag(R.id.f47364name_res_0x7f09011e);
                String str2 = tag2 != null ? (String) tag2 : "";
                ActionSheet actionSheet = (ActionSheet) ActionSheetHelper.a(this, (View) null);
                actionSheet.m10334a((CharSequence) String.format(getResources().getString(R.string.f60729name_res_0x7f0a0916), str2));
                actionSheet.a(R.string.f60684name_res_0x7f0a08e8, 3);
                actionSheet.d(R.string.f63203cancel);
                actionSheet.a(new hgj(this, str, actionSheet));
                actionSheet.show();
                return;
            case R.id.f49958name_res_0x7f090b42:
                Object tag3 = view.getTag(R.id.f47363name_res_0x7f09011d);
                String str3 = tag3 != null ? (String) tag3 : "";
                ReportController.b(this.app, "dc01332", "Pb_account_lifeservice", "", SubscriptConstants.f, SubscriptConstants.f, 0, 0, "", "", "", "");
                ReportController.b(this.app, "dc01331", "", "", SubscriptConstants.o, SubscriptConstants.o, 0, 0, "", "", "", "");
                TroopBarAssistantManager.a().d(str3, this.app);
                b();
                RecentUtil.b(this.app, str3, PublicAccountUtil.a(this.app, str3));
                this.app.m4635a().m5081c(str3, 1008);
                MqqHandler handler = this.app.getHandler(Conversation.class);
                if (handler != null) {
                    handler.sendEmptyMessage(1014);
                }
                Iterator it = this.f4941a.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        i = 0;
                    } else {
                        SubscriptionFeed subscriptionFeed = (SubscriptionFeed) it.next();
                        if (subscriptionFeed.f5074a != null && subscriptionFeed.f5074a.equals(str3)) {
                            i = subscriptionFeed.h;
                        }
                    }
                }
                ReportController.b(null, "dc01332", "Pb_account_lifeservice", str3, "0X80064D0", "0X80064D0", 0, 0, "" + i, "", "", "");
                return;
            case R.id.f51041name_res_0x7f090f7d:
                if (((Integer) view.getTag(R.id.f47361name_res_0x7f09011b)).intValue() == SubscriptFeedsAdapter.d) {
                    Object tag4 = view.getTag(R.id.f47362name_res_0x7f09011c);
                    Object tag5 = view.getTag(R.id.f47363name_res_0x7f09011d);
                    String str4 = tag5 != null ? (String) tag5 : "";
                    Integer valueOf = Integer.valueOf(tag5 != null ? ((Integer) tag4).intValue() : 0);
                    if (valueOf.intValue() > 0) {
                        ReportController.b(this.app, "dc01332", "Pb_account_lifeservice", "", SubscriptConstants.f4918d, SubscriptConstants.f4918d, 0, 0, "", "", "", "");
                    } else {
                        ReportController.b(this.app, "dc01332", "Pb_account_lifeservice", "", SubscriptConstants.f4919e, SubscriptConstants.f4919e, 0, 0, "", "", "", "");
                    }
                    ReportController.b(this.app, "dc01331", "", "", SubscriptConstants.n, SubscriptConstants.n, 0, 0, "", "", "", "");
                    if (TextUtils.isEmpty(TroopBarAssistantManager.a().a(str4)) && (publicAccountHandler = (PublicAccountHandler) this.app.getBusinessHandler(11)) != null) {
                        publicAccountHandler.m4583a();
                    }
                    Object tag6 = view.getTag(R.id.f47364name_res_0x7f09011e);
                    String str5 = tag6 != null ? (String) tag6 : "";
                    Intent intent = new Intent(this, ChatActivity.class);
                    intent.putExtra("uintype", 1008);
                    intent.putExtra("uin", str4);
                    intent.putExtra(AppConstants.Key.h, str5);
                    intent.putExtra("start_time", System.currentTimeMillis());
                    intent.putExtra(SubscriptRecommendController.f5060e, valueOf);
                    startActivity(intent);
                    f();
                    return;
                }
                return;
            case R.id.f51049name_res_0x7f090f85:
            case R.id.f51050name_res_0x7f090f86:
                Object tag7 = view.getTag(R.id.f47363name_res_0x7f09011d);
                String str6 = tag7 != null ? (String) tag7 : "";
                if (!TroopBarAssistantManager.a().m1411a(str6, this.app)) {
                    TroopBarAssistantManager.a().e(str6, this.app);
                    ReportController.b(null, "dc01331", "", "", "0X8006112", "0X8006112", 0, 0, "", "", "", "");
                    int m1412b = TroopBarAssistantManager.a().m1412b();
                    Iterator it2 = this.f4941a.iterator();
                    while (true) {
                        if (!it2.hasNext()) {
                            i3 = 0;
                        } else {
                            SubscriptionFeed subscriptionFeed2 = (SubscriptionFeed) it2.next();
                            if (subscriptionFeed2.f5074a != null && subscriptionFeed2.f5074a.equals(str6)) {
                                i3 = subscriptionFeed2.h;
                            }
                        }
                    }
                    ReportController.b(null, "dc01332", "Pb_account_lifeservice", str6, "0X80064CD", "0X80064CD", 0, 0, "" + i3, "" + m1412b, "", "");
                } else {
                    TroopBarAssistantManager.a().f(str6, this.app);
                    int m1412b2 = TroopBarAssistantManager.a().m1412b();
                    Iterator it3 = this.f4941a.iterator();
                    while (true) {
                        if (!it3.hasNext()) {
                            i2 = 0;
                        } else {
                            SubscriptionFeed subscriptionFeed3 = (SubscriptionFeed) it3.next();
                            if (subscriptionFeed3.f5074a != null && subscriptionFeed3.f5074a.equals(str6)) {
                                i2 = subscriptionFeed3.h;
                            }
                        }
                    }
                    ReportController.b(null, "dc01332", "Pb_account_lifeservice", str6, "0X80064CE", "0X80064CE", 0, 0, "" + i2, "" + m1412b2, "", "");
                }
                b();
                return;
            case R.id.f51051name_res_0x7f090f87:
            case R.id.f51053name_res_0x7f090f89:
            case R.id.f51054name_res_0x7f090f8a:
            case R.id.f51055name_res_0x7f090f8b:
            case R.id.f51056name_res_0x7f090f8c:
                ReportController.b(null, "dc01331", "", "", "0X8006155", "0X8006155", 0, 0, "", "", "", "");
                Intent intent2 = new Intent("android.intent.action.MAIN");
                intent2.putExtra("channel_id", 0);
                intent2.putExtra(ReadInJoyHelper.f71112c, 9);
                ArrayList arrayList = new ArrayList();
                if (this.f4940a != null && this.f4940a.size() == 4) {
                    int i4 = 0;
                    while (true) {
                        int i5 = i4;
                        if (i5 < 4) {
                            arrayList.add(Long.valueOf(((ReadInJoyArticle) this.f4940a.get(i5)).mArticleID));
                            i4 = i5 + 1;
                        } else {
                            intent2.putExtra(ReadInJoyHelper.ap, arrayList);
                            if (view.getId() == R.id.f51053name_res_0x7f090f89 || view.getId() == R.id.f51054name_res_0x7f090f8a || view.getId() == R.id.f51055name_res_0x7f090f8b || view.getId() == R.id.f51056name_res_0x7f090f8c) {
                                ReadInJoyArticle readInJoyArticle = (ReadInJoyArticle) this.f4940a.get(((Integer) view.getTag()).intValue());
                                intent2.putExtra(ReadInJoyHelper.aq, Long.valueOf(readInJoyArticle != null ? readInJoyArticle.mArticleID : -1L));
                            } else {
                                intent2.putExtra(ReadInJoyHelper.aq, 0L);
                            }
                        }
                    }
                } else if (QLog.isColorLevel()) {
                    QLog.d(f4922c, 2, "subscription folder jump to readinjoy with ReadInJoyArticles wrong param");
                }
                this.f4947b = true;
                ReadInJoyHelper.a(this.app, this, intent2);
                f();
                return;
            default:
                return;
        }
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        int b2;
        int m;
        float x = motionEvent.getX();
        float y = motionEvent.getY();
        if (this.f4938a == null || this.f4930a == null) {
            return super.dispatchTouchEvent(motionEvent);
        }
        if (this.i == 0) {
            int[] iArr = new int[2];
            this.f4938a.getLocationOnScreen(iArr);
            this.i = iArr[1];
        }
        switch (motionEvent.getAction()) {
            case 0:
                this.f4925a = x;
                this.f4944b = y;
                this.f4955h = false;
                int height = this.f4938a.getHeight();
                if (y >= this.i) {
                    if (this.f4933a != null && this.f4933a.g == 1 && this.f4933a.f5061a != null) {
                        View findViewById = this.f4933a.f5061a.findViewById(R.id.f51062name_res_0x7f090f92);
                        int[] iArr2 = new int[2];
                        findViewById.getLocationOnScreen(iArr2);
                        if (y >= iArr2[1]) {
                            if (y < findViewById.getHeight() + iArr2[1]) {
                                this.f4955h = true;
                                break;
                            }
                        }
                    } else if (y < height + this.i && (b2 = this.f4938a.b((int) x, ((int) y) - this.i)) != -1 && (m = b2 - this.f4938a.m()) >= 0 && m < this.f4930a.getCount()) {
                        if (m == this.h) {
                            this.f4955h = true;
                        }
                        if (this.f4930a.getItem(m).equals(SubscriptRecommendController.f5056a)) {
                            this.f4955h = true;
                            break;
                        }
                    }
                }
                break;
            case 1:
            case 3:
                ((ViewGroup) this.mContentView).requestDisallowInterceptTouchEvent(false);
                this.f4955h = false;
                break;
            case 2:
                if (Math.abs(x - this.f4925a) > Math.abs(y - this.f4944b)) {
                    if (x - this.f4925a > 20.0f) {
                        if (this.f4955h) {
                            ((ViewGroup) this.mContentView).requestDisallowInterceptTouchEvent(true);
                            break;
                        }
                    } else if (x - this.f4925a < -20.0f) {
                        ((ViewGroup) this.mContentView).requestDisallowInterceptTouchEvent(true);
                        break;
                    }
                } else if (Math.abs(y - this.f4944b) > 20.0f) {
                }
                break;
        }
        return super.dispatchTouchEvent(motionEvent);
    }

    @Override
    public void update(Observable observable, Object obj) {
        if (obj instanceof MessageRecord) {
            MessageRecord messageRecord = (MessageRecord) obj;
            if (!messageRecord.isSendFromLocal()) {
                runOnUiThread(new hgl(this));
            }
            if (!messageRecord.isSendFromLocal() || messageRecord.msgtype != -2002) {
                b();
            }
        }
    }

    public void a(List list) {
        if ((this.f4936a == null || this.f4936a.m3747a() == -1) && this.f4930a != null && this.f4927a != null) {
            if (list != null) {
                this.f4941a = list;
            }
            this.f4930a.a(this.f4941a);
            if (this.f4930a.g == -1) {
                if (!this.f4933a.f5071a) {
                    this.f4930a.g = 0;
                    this.f4930a.f = 1;
                } else if (this.f4941a.size() <= 2) {
                    this.f4930a.g = 0;
                    this.f4930a.f = 0;
                } else if (this.f4941a.size() <= 10) {
                    this.f4930a.g = 1;
                    this.f4930a.f = 0;
                } else {
                    this.f4930a.g = 0;
                    this.f4930a.f = 1;
                }
                if ((!this.f4954g && SubscriptRecommendController.m1392a(this.app)) || PublicAccountUtil.m1482a(this.app)) {
                    if (this.f4941a.size() == 0) {
                        this.f4930a.g = 0;
                        this.f4930a.f = 0;
                    } else {
                        this.f4930a.g = 1;
                        this.f4930a.f = 0;
                    }
                    if (QLog.isColorLevel()) {
                        QLog.d(f4922c, 2, "subscript inner recommend need show !");
                    }
                    if (this.f4933a.f5071a) {
                        this.f4930a.g = 0;
                        this.f4930a.f = 0;
                    }
                }
                a(true, false, false);
                if (this.f4941a == null || this.f4941a.isEmpty()) {
                    TroopBarAssistantManager.a().m1417c(this.app);
                }
            }
        }
    }

    private void i() {
        boolean isInNightMode = ThemeUtil.isInNightMode(this.app);
        if (this.f4930a.getCount() == 0) {
            ((TextView) this.f4927a.findViewById(R.id.f51608name_res_0x7f0911b4)).setText(R.string.f60716name_res_0x7f0a0909);
            this.f4927a.setVisibility(0);
            if (!isInNightMode) {
                this.f4927a.setBackgroundResource(R.color.f38928name_res_0x7f0b020f);
            } else {
                this.f4927a.setBackgroundResource(R.color.f38929name_res_0x7f0b0210);
            }
            this.f4938a.setBackgroundResource(R.drawable.f47029trans);
            this.f4938a.setEnabled(false);
            if (this.f4933a != null) {
                this.f4933a.d();
                return;
            }
            return;
        }
        this.f4927a.setVisibility(8);
        if (!isInNightMode) {
            this.f4938a.setBackgroundResource(R.color.f38928name_res_0x7f0b020f);
        } else {
            this.f4938a.setBackgroundResource(R.color.f38929name_res_0x7f0b0210);
        }
        this.f4938a.setEnabled(true);
    }

    public void a(boolean z, boolean z2, boolean z3) {
        if (z || z2 || z3) {
            this.f4951d = true;
            this.f4930a.b();
            this.f4930a.notifyDataSetChanged();
            i();
        }
        if (this.f4933a != null && this.f4930a != null && !this.f4956i && this.f4933a.f5071a && this.f4930a.g == 0 && this.f4930a.f4975b && this.f4930a.f == 0) {
            this.f4956i = true;
            this.f4933a.a();
        }
    }

    private ArrayList m1382a() {
        ArrayList arrayList;
        try {
            String string = ReadInJoyHelper.m11162a(this.app, 1).getString(f4920a, "");
            if (TextUtils.isEmpty(string)) {
                arrayList = null;
            } else {
                arrayList = (ArrayList) SubscriptFeedsUtils.a(string);
            }
            return arrayList;
        } catch (IOException e2) {
            e2.printStackTrace();
            return null;
        } catch (ClassNotFoundException e3) {
            e3.printStackTrace();
            return null;
        } catch (Exception e4) {
            e4.printStackTrace();
            return null;
        }
    }

    public boolean a(ArrayList arrayList) {
        boolean z = true;
        if (arrayList == null) {
            return false;
        }
        SharedPreferences m11162a = ReadInJoyHelper.m11162a(this.app, 1);
        try {
            String a2 = SubscriptFeedsUtils.a(arrayList);
            if (TextUtils.isEmpty(a2)) {
                z = false;
            } else {
                SharedPreferences.Editor edit = m11162a.edit();
                edit.putString(f4920a, a2);
                ReadInJoyHelper.a(edit, true);
            }
            return z;
        } catch (IOException e2) {
            e2.printStackTrace();
            return false;
        } catch (Exception e3) {
            e3.printStackTrace();
            return false;
        }
    }

    @Override
    public void a(boolean z, int i, DragFrameLayout dragFrameLayout) {
        SubscriptionFeed subscriptionFeed;
        if (this.f4936a.m3747a() == -1 && dragFrameLayout.m3748a() != null && dragFrameLayout.m3748a().getId() == R.id.f51045name_res_0x7f090f81 && (subscriptionFeed = (SubscriptionFeed) dragFrameLayout.m3748a().getTag(R.id.f47362name_res_0x7f09011c)) != null) {
            ReportController.b(null, "dc01332", "Pb_account_lifeservice", subscriptionFeed.f5074a, "0X80064D1", "0X80064D1", 0, 0, "" + subscriptionFeed.h, "", "", "");
            subscriptionFeed.a();
            c();
            this.f4942a.removeMessages(1002);
            this.f4942a.sendEmptyMessage(1002);
        }
    }

    @Override
    public void a(View view) {
        this.h = ((Integer) view.getTag(R.id.f47360name_res_0x7f09011a)).intValue();
        a(false);
    }

    @Override
    public void b(View view) {
        this.h = -1;
        a(true);
    }

    private void a(boolean z) {
        if (this.f4935a == null) {
            ViewGroup viewGroup = (ViewGroup) getWindow().getDecorView();
            View childAt = viewGroup.getChildAt(0);
            if (childAt != null && (childAt instanceof DragFrameLayout)) {
                viewGroup = (ViewGroup) childAt;
            }
            View childAt2 = viewGroup.getChildAt(0);
            if (childAt2 instanceof TopGestureLayout) {
                this.f4935a = (TopGestureLayout) childAt2;
            }
        }
        if (this.f4935a != null) {
            this.f4935a.setInterceptTouchFlag(z);
        }
    }

    public static void d() {
        Intent intent = new Intent(BaseApplicationImpl.f6970a, SubscriptFeedsActivity.class);
        intent.putExtra(SubscriptRecommendController.f5057b, 1);
        intent.setFlags(67108864);
        BaseApplicationImpl.f6970a.startActivity(intent);
    }
}