和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1
以下内容为反编译后的 Message139ListView.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.mms139;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.view.View;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.mms2.ui.NotificationManagerPopMain;
import com.chinamobile.contacts.im.ui.ICloudActivity;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.utils.an;
import com.chinamobile.contacts.im.utils.ap;
import com.chinamobile.contacts.im.utils.ba;
import com.chinamobile.contacts.im.view.HintsDialog;
import com.chinamobile.contacts.im.view.ProgressDialog;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBar;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBarPopAdapter;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionBarPopNavi;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionMenu;
import com.chinamobile.contacts.im.view.actionbar.IcloudActionMode;
import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList;
import java.util.regex.Matcher;
@SuppressLint({"NewApi"})
public class Message139ListView extends ICloudActivity implements View.OnClickListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, ap<Cursor>, IcloudActionBarPopNavi.OnPopNaviItemClickListener, IcloudActionMode.Callback, com.chinamobile.contacts.im.voicemail.b.a {
public static boolean f2531a = false;
public static final SparseBooleanArray f2532b = new SparseBooleanArray();
private c c;
private ListView d;
private a f;
private ArrayList<String> h;
private Context i;
private IcloudActionBarPopNavi j;
private ProgressDialog k;
private IcloudActionBar m;
private LinearLayout n;
private View o;
private View p;
private TextView q;
private final String e = Message139ListView.class.getSimpleName();
private String g = null;
private boolean l = true;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(C0019R.layout.message_139_list_view);
this.l = true;
this.i = this;
k.a((Context) this);
f();
d();
this.q = (TextView) findViewById(C0019R.id.button_text);
this.q.setOnClickListener(this);
this.d = (ListView) findViewById(C0019R.id.listView1);
this.d.setCacheColorHint(0);
this.d.setDivider(null);
this.d.setOnItemClickListener(this);
this.d.setOnItemLongClickListener(this);
this.c = new c(getApplicationContext());
this.c.a(this);
this.d.setAdapter((ListAdapter) this.c);
this.n = (LinearLayout) findViewById(C0019R.id.message139_blank_layout);
if (NotificationManagerPopMain.a(this.i, "cn.cj.pe").booleanValue()) {
this.q.setText("进入邮箱");
} else {
this.q.setText("下载139邮箱客户端");
}
}
private void d() {
e();
IcloudActionBarPopAdapter icloudActionBarPopAdapter = new IcloudActionBarPopAdapter(this.i, this.h);
this.j = new IcloudActionBarPopNavi(this.i, icloudActionBarPopAdapter);
this.j.setOnPopNaviItemClickListener(this);
this.m.setDisplayAsUpTitleIBMore(C0019R.drawable.iab_green_more, new f(this, icloudActionBarPopAdapter));
}
private void e() {
this.h = this.h == null ? new ArrayList<>() : this.h;
this.h.add("清空记录");
this.h.add("批量删除");
}
private void f() {
this.m = getIcloudActionBar();
this.m.setNavigationMode(3);
this.m.setDisplayAsUpTitle(getResources().getString(C0019R.string.mms_139_from));
this.m.setDisplayAsUpBack(C0019R.drawable.iab_green_back, this);
}
@Override
public void onResume() {
super.onResume();
k.a().a((ap) this);
k.a().k();
if (this.q != null) {
if (NotificationManagerPopMain.a(this.i, "cn.cj.pe").booleanValue()) {
this.q.setText("进入邮箱");
} else {
this.q.setText("下载139邮箱客户端");
}
}
}
@Override
public void onPause() {
super.onPause();
k.a().m();
k.a().b((ap) this);
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
if (!f2531a) {
if (NotificationManagerPopMain.a(this.i, "cn.cj.pe").booleanValue()) {
new Intent();
Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage("cn.cj.pe");
launchIntentForPackage.setFlags(337641472);
startActivity(launchIntentForPackage);
} else {
this.f = ((Message139ListItem) view).getMessage139Item();
a(this.i, this.f.a());
}
MobclickAgent.onEvent(this, "mail139_onItemClick");
return;
}
Message139ListItem message139ListItem = (Message139ListItem) view;
l();
CheckBox checkBox = (CheckBox) this.mActionMode.getViewById(C0019R.id.mca_ib_select);
if (f2532b.size() == this.c.getCount()) {
checkBox.setChecked(false);
} else {
checkBox.setChecked(true);
}
message139ListItem.b();
}
private void a(boolean z, int i) {
int count = this.c.getCount() - 1;
this.d.getHeight();
this.d.setSelection(count);
}
@Override
public void a(an<Cursor> anVar, Cursor cursor, boolean z) {
if (this.c.getCursor() != cursor) {
this.c.changeCursor(cursor);
k.a().c();
}
boolean r = k.a().r();
if (this.l) {
if (!r) {
this.l = false;
}
a(false, 0);
}
}
@Override
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long j) {
if (!f2531a) {
j();
a().put(i, true);
l();
this.n.setVisibility(0);
}
return true;
}
public void a(Context context, String str) {
if (str.contains("[")) {
str = str.substring(0, str.indexOf("["));
}
Matcher matcher = ba.c.matcher(str);
while (matcher.find()) {
Uri parse = Uri.parse(str.substring(matcher.start(), matcher.end()));
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(parse);
context.startActivity(intent);
}
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case C0019R.id.iab_back_area:
finish();
return;
case C0019R.id.button_text:
if (f2531a) {
Toast.makeText(this.i, "请选择至少一封邮件", 1000).show();
return;
}
if (NotificationManagerPopMain.a(this.i, "cn.cj.pe").booleanValue()) {
new Intent();
Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage("cn.cj.pe");
launchIntentForPackage.setFlags(337641472);
startActivity(launchIntentForPackage);
return;
}
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("http://pushemail.10086.cn"));
startActivity(intent);
return;
default:
return;
}
}
@Override
public void OnPopNaviClick(int i) {
switch (i) {
case 0:
g();
return;
case 1:
j();
l();
this.n.setVisibility(0);
return;
default:
return;
}
}
private void g() {
HintsDialog hintsDialog = new HintsDialog(this.i, "清空邮件记录", "清空所有的邮件记录吗?");
if (com.chinamobile.contacts.im.config.j.q(this.i)) {
hintsDialog.setShowCheckBox2();
hintsDialog.setCheckBox2Text(this.i.getResources().getString(C0019R.string.delete_backup_recycle));
hintsDialog.setCheckBox2State(com.chinamobile.contacts.im.config.j.r(this.i));
}
hintsDialog.setButton(new g(this, hintsDialog), C0019R.string.setting_clear);
hintsDialog.show();
}
private void h() {
HintsDialog hintsDialog = new HintsDialog(this.i, "删除邮件记录", "删除选中的邮件记录吗?");
if (com.chinamobile.contacts.im.config.j.q(this.i)) {
hintsDialog.setShowCheckBox2();
hintsDialog.setCheckBox2Text(this.i.getResources().getString(C0019R.string.delete_backup_recycle));
hintsDialog.setCheckBox2State(com.chinamobile.contacts.im.config.j.r(this.i));
}
hintsDialog.setButton(new i(this, hintsDialog), C0019R.string.msg_139_context_menu_option_delete);
hintsDialog.show();
}
private void a(boolean z) {
if (!z) {
i();
}
f2531a = z;
}
private void i() {
if (f2532b != null) {
f2532b.clear();
}
}
public SparseBooleanArray a() {
return f2532b;
}
private void j() {
a(true);
startIcloudActionMode(this);
}
@Override
public boolean onPrepareActionMode(IcloudActionMode icloudActionMode, IcloudActionMenu icloudActionMenu) {
this.mActionMode = icloudActionMode;
TextView textView = (TextView) this.mActionMode.getViewById(C0019R.id.mca_title);
textView.setText("已选");
textView.setMinWidth(ApplicationUtils.dip2px(this, 120.0f));
this.o = this.mActionMode.getViewById(C0019R.id.mca_delete_layout);
this.p = this.mActionMode.getViewById(C0019R.id.mca_delete_icon);
icloudActionMode.getViewById(C0019R.id.mca_ib_select).setVisibility(0);
return false;
}
public void b() {
i();
l();
}
public void c() {
i();
for (int i = 0; i < this.c.getCount(); i++) {
f2532b.put(i, true);
}
l();
}
@Override
public boolean onActionItemClicked(IcloudActionMode icloudActionMode, View view) {
switch (view.getId()) {
case C0019R.id.mca_delete_layout:
h();
return true;
case C0019R.id.mca_ex_area:
k();
return true;
case C0019R.id.mca_ib_select:
if (((CheckBox) view).isChecked()) {
b();
return true;
}
c();
return true;
default:
return true;
}
}
public void k() {
destoryIcloudActionMode();
}
private void l() {
this.c.notifyDataSetChanged();
a(a());
if (f2532b != null) {
this.mActionMode.updateCount(f2532b.size());
}
}
@Override
public boolean onCreateActionMode(IcloudActionMode icloudActionMode, IcloudActionMenu icloudActionMenu) {
icloudActionMenu.setBottomMenu(C0019R.layout.message139_multichoice_action);
icloudActionMenu.setTopMenu(C0019R.layout.mca_custom_top_select);
return false;
}
private void a(SparseBooleanArray sparseBooleanArray) {
if (this.o != null) {
if (sparseBooleanArray.size() > 0) {
this.o.setOnClickListener(this.mActionMode);
this.p.setEnabled(true);
this.o.setClickable(true);
} else {
this.o.setOnClickListener(null);
this.p.setEnabled(false);
this.o.setClickable(false);
}
}
}
@Override
public void onDestroyActionMode(IcloudActionMode icloudActionMode) {
a(false);
this.n.setVisibility(8);
this.c.notifyDataSetChanged();
}
@Override
public void a(int i, View view) {
l();
CheckBox checkBox = (CheckBox) this.mActionMode.getViewById(C0019R.id.mca_ib_select);
if (f2532b.size() == this.c.getCount()) {
checkBox.setChecked(false);
} else {
checkBox.setChecked(true);
}
}
}