和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518

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


package com.jeremyfeinstein.slidingmenu.lib;

import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.cloudserver.PlugInCellEntity;
import com.chinamobile.contacts.im.cloudserver.an;
import com.chinamobile.contacts.im.config.LoginInfoSP;
import com.chinamobile.contacts.im.data.ContactAccessor;
import com.chinamobile.contacts.im.data.MediaPlatformDBManager;
import com.chinamobile.contacts.im.donotdisturbe.DonotDistrubeMainActivity;
import com.chinamobile.contacts.im.enterpriseContact.EnterpriseMainActivity;
import com.chinamobile.contacts.im.login.SettingNewLoginMainActivity;
import com.chinamobile.contacts.im.privacyspace.InputPasswordActivity;
import com.chinamobile.contacts.im.privacyspace.PrivacySpaceActivity;
import com.chinamobile.contacts.im.setting.BrowserActivity;
import com.chinamobile.contacts.im.setting.FunctionIntroductionActivity;
import com.chinamobile.contacts.im.setting.SettingVoiceMailActivity;
import com.chinamobile.contacts.im.sync.SyncActivity;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.view.PluginItemView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.umeng.analytics.AspMobclickAgent;
import java.util.Iterator;

public class e {

    private Activity f4484a;

    private ViewGroup f4485b;
    private LinearLayout c;
    private g d = new g(this);
    private ImageLoader e;
    private DisplayImageOptions f;
    private PluginItemView g;
    private PluginItemView h;
    private PluginItemView i;
    private PluginItemView j;
    private PluginItemView k;
    private PluginItemView l;

    public e(Activity activity, ViewGroup viewGroup) {
        this.f4484a = activity;
        this.f4485b = viewGroup;
        this.c = (LinearLayout) viewGroup.findViewById(C0019R.id.web_plugin_layout);
    }

    public void a() {
        if (this.c != null) {
            this.c.removeAllViews();
            c();
        }
    }

    public void b() {
        f();
        e();
    }

    public void c() {
        this.i = a(C0019R.id.plugin_contacts_backup_view);
        e();
        this.j = a(C0019R.id.plugin_simmax_view);
        this.k = a(C0019R.id.plugin_voice_view);
        this.l = a(C0019R.id.plugin_enterprise_view);
        f();
        if (LoginInfoSP.isLogin(this.f4484a)) {
            g();
        }
    }

    public void a(PluginItemView pluginItemView) {
        an.a().d();
        boolean z = false;
        if ("防打扰".equals(pluginItemView.getName())) {
            if (com.chinamobile.contacts.im.config.j.C(this.f4484a)) {
                z = com.chinamobile.contacts.im.config.j.C(this.f4484a);
            } else if (com.chinamobile.contacts.im.donotdisturbe.d.c.n(this.f4484a) && com.chinamobile.contacts.im.config.j.D(this.f4484a)) {
                z = true;
            }
        }
        if (!z) {
            pluginItemView.setReaded();
        } else {
            pluginItemView.setUnRead();
        }
    }

    public void d() {
        if (com.chinamobile.contacts.im.config.i.s(this.f4484a)) {
            this.j.setVisibility(0);
        } else {
            this.j.setVisibility(8);
        }
        if (com.chinamobile.contacts.im.config.i.t(this.f4484a)) {
            this.k.setVisibility(0);
        } else {
            this.k.setVisibility(8);
        }
        if (com.chinamobile.contacts.im.config.i.u(this.f4484a)) {
            this.l.setVisibility(0);
        } else {
            this.l.setVisibility(8);
        }
    }

    private void e() {
        if (this.g == null) {
            this.g = a(C0019R.id.plugin_disturb_view);
        }
        a(this.g);
    }

    private void f() {
        if (this.h == null) {
            this.h = a(C0019R.id.plugin_privacy_view);
        }
        if (com.chinamobile.contacts.im.config.n.c(this.f4484a)) {
            this.h.setVisibility(0);
            a(this.h);
        } else {
            this.h.setVisibility(8);
        }
    }

    private PluginItemView a(int i) {
        PluginItemView pluginItemView = (PluginItemView) this.f4485b.findViewById(i);
        pluginItemView.setTag(new h(this, pluginItemView.getName(), false));
        pluginItemView.setOnClickListener(this.d);
        a(pluginItemView);
        return pluginItemView;
    }

    private void g() {
        if (an.a().g()) {
            an.a().b();
            return;
        }
        Iterator<PlugInCellEntity> it = an.a().f().iterator();
        while (it.hasNext()) {
            a(it.next());
        }
    }

    private void a(PlugInCellEntity plugInCellEntity) {
        h hVar = new h(this, plugInCellEntity.getName(), true);
        hVar.a(plugInCellEntity.getUrl());
        a(hVar, plugInCellEntity.getIconLeftNew());
    }

    private void a(h hVar, String str) {
        if (this.c != null && hVar != null && hVar.c()) {
            PluginItemView pluginItemView = new PluginItemView(this.f4484a, null);
            pluginItemView.setTag(hVar);
            pluginItemView.setName(hVar.b());
            pluginItemView.setIcon(hVar.b());
            pluginItemView.setOnClickListener(this.d);
            pluginItemView.setBackgroundResource(C0019R.drawable.slidingmenu_plugin_item_bg);
            this.c.addView(pluginItemView, 0);
            if (!"V网".equals(hVar.b())) {
                a(pluginItemView.getIconIm(), str);
            }
            a(pluginItemView);
        }
    }

    public void b(PlugInCellEntity plugInCellEntity) {
        plugInCellEntity.setNotice("off");
        an.a().a(plugInCellEntity);
        if ("防打扰".equals(plugInCellEntity.getName())) {
            com.chinamobile.contacts.im.config.j.r(this.f4484a, false);
            com.chinamobile.contacts.im.config.j.s(this.f4484a, false);
        }
    }

    public void c(PlugInCellEntity plugInCellEntity) {
        if ("家庭网".equals(plugInCellEntity.getName())) {
            AspMobclickAgent.onEvent(this.f4484a, "side_bar_homenetwork");
        }
        plugInCellEntity.setNotice("off");
        an.a().a(plugInCellEntity);
        an.a().b(this.f4484a, plugInCellEntity);
    }

    public void a(String str) {
        if (!TextUtils.isEmpty(str)) {
            if (str.equals(b(C0019R.string.slidingmenu_item_contacts_backup))) {
                AspMobclickAgent.onEvent(this.f4484a, "side_bar_sync");
                com.chinamobile.contacts.im.config.d.h(this.f4484a, false);
                a(SyncActivity.class, b(C0019R.string.slidingmenu_item_contacts_backup), 1);
                com.chinamobile.contacts.im.config.j.q(this.f4484a, false);
                return;
            }
            if (str.equals(b(C0019R.string.slidingmenu_item_disturb))) {
                AspMobclickAgent.onEvent(this.f4484a, "side_bar_intercept");
                com.chinamobile.contacts.im.config.j.f(this.f4484a, false);
                com.chinamobile.contacts.im.service.l.b().a((Object) 8231);
                a(DonotDistrubeMainActivity.class);
                return;
            }
            if (str.equals(b(C0019R.string.slidingmenu_item_simmax))) {
                AspMobclickAgent.onEvent(this.f4484a, "side_bar_multinumber");
                an.a(this.f4484a, b(C0019R.string.slidingmenu_item_simmax), 2);
                return;
            }
            if (str.equals(b(C0019R.string.slidingmenu_item_voice))) {
                AspMobclickAgent.onEvent(this.f4484a, "side_bar_voicemail");
                a(SettingVoiceMailActivity.class, b(C0019R.string.slidingmenu_item_voice), 3);
                return;
            }
            if (!str.equals(b(C0019R.string.slidingmenu_item_conference))) {
                if (str.equals(b(C0019R.string.slidingmenu_item_enterprise))) {
                    AspMobclickAgent.onEvent(this.f4484a, "side_bar_enterprise");
                    a(EnterpriseMainActivity.class, b(C0019R.string.slidingmenu_item_enterprise), 4);
                } else if (str.equals(b(C0019R.string.slidingmenu_item_privacy))) {
                    AspMobclickAgent.onEvent(this.f4484a, "side_bar_privacy");
                    a(com.chinamobile.contacts.im.config.n.e(this.f4484a) ? InputPasswordActivity.class : PrivacySpaceActivity.class);
                } else if (!str.equals(b(C0019R.string.slidingmenu_item_alumni)) && str.equals(b(C0019R.string.slidingmenu_item_vip))) {
                    AspMobclickAgent.onEvent(this.f4484a, "side_bar_vip_clicked");
                    a(BrowserActivity.class, "http://txl.cytxl.com.cn/wap/plugs/members.php?token=" + ContactAccessor.getAuth(this.f4484a).l() + "&endpointId=" + ApplicationUtils.getUUID(this.f4484a) + "&version=" + ApplicationUtils.getVersionName(this.f4484a) + "&channel=" + ApplicationUtils.getChannel(this.f4484a), b(C0019R.string.slidingmenu_item_vip));
                }
            }
        }
    }

    private String b(int i) {
        return this.f4484a.getString(i);
    }

    private void a(Class<?> cls, String str, String str2) {
        if (LoginInfoSP.isLogin(this.f4484a)) {
            b(cls, str, str2);
        } else {
            c(cls, str, str2);
        }
    }

    private void a(Class<?> cls, String str, int i) {
        if (LoginInfoSP.isLogin(this.f4484a)) {
            a(cls);
        } else {
            b(cls, str, i);
        }
    }

    private void a(Class<?> cls) {
        this.f4484a.startActivity(new Intent(this.f4484a, cls));
    }

    private void b(Class<?> cls, String str, String str2) {
        Intent intent = new Intent(this.f4484a, cls);
        intent.putExtra("url", str);
        intent.putExtra(MediaPlatformDBManager.KEY_TITLE, str2);
        this.f4484a.startActivity(intent);
    }

    private void c(Class<?> cls, String str, String str2) {
        String uri = new Intent(this.f4484a, cls).toUri(1);
        Intent intent = new Intent(this.f4484a, (Class<?>) SettingNewLoginMainActivity.class);
        intent.putExtra("plugins_intent_uri", uri);
        intent.putExtra("url", str);
        intent.putExtra(MediaPlatformDBManager.KEY_TITLE, str2);
        this.f4484a.startActivity(intent);
    }

    private void b(Class<?> cls, String str, int i) {
        String uri = new Intent(this.f4484a, cls).toUri(1);
        Intent intent = new Intent(this.f4484a, (Class<?>) FunctionIntroductionActivity.class);
        intent.putExtra("plugins_intent_uri", uri);
        intent.putExtra(MediaPlatformDBManager.KEY_TITLE, str);
        intent.putExtra("pluginType", i);
        this.f4484a.startActivity(intent);
    }

    private void a(ImageView imageView, String str) {
        if (this.e == null) {
            h();
        }
        this.e.displayImage(str, imageView, this.f);
    }

    private void h() {
        this.e = ImageLoader.getInstance();
        this.e.init(ImageLoaderConfiguration.createDefault(this.f4484a));
        this.f = new DisplayImageOptions.Builder().showImageOnFail(C0019R.drawable.plugin_default).showImageForEmptyUri(C0019R.drawable.plugin_default).showImageOnLoading(C0019R.drawable.plugin_default).imageScaleType(ImageScaleType.IN_SAMPLE_INT).cacheInMemory(true).cacheOnDisc(true).build();
    }
}