柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 ChatViewOnItemClickManager.java 源代码,内容仅作参考
package net.duohuo.magappx.openimui.adaptre;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.graphics.drawable.AnimationDrawable;
import android.media.MediaPlayer;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import com.alibaba.fastjson.JSONObject;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.jianpuzhaitong.forum.R;
import com.tencent.open.SocialConstants;
import com.umeng.socialize.common.SocializeConstants;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import net.duohuo.core.build.UrlSchemeProxy;
import net.duohuo.core.fresco.FrescoController;
import net.duohuo.core.ioc.Ioc;
import net.duohuo.core.net.Net;
import net.duohuo.core.net.Task;
import net.duohuo.core.util.FileUtil;
import net.duohuo.core.util.SafeJsonUtil;
import net.duohuo.core.util.StrUtil;
import net.duohuo.magapp.chat.MagappChatAccount;
import net.duohuo.magapp.chat.MagappChatCore;
import net.duohuo.magapp.chat.contact.bean.Contact;
import net.duohuo.magapp.chat.conversation.MagappChatConversation;
import net.duohuo.magapp.chat.message.model.MagAudioMessage;
import net.duohuo.magapp.chat.message.model.MagFlashPicMessage;
import net.duohuo.magapp.chat.message.model.MagImageMessage;
import net.duohuo.magapp.chat.message.model.MagVideoMessage;
import net.duohuo.magapp.chat.message.model.MagappCardMessage;
import net.duohuo.magapp.chat.message.model.MagappLocationMessage;
import net.duohuo.magapp.chat.message.model.MagappMessage;
import net.duohuo.magapp.chat.message.model.MagappRedPacketMessage;
import net.duohuo.magappx.SiteConfig;
import net.duohuo.magappx.UrlScheme;
import net.duohuo.magappx.chat.activity.ChatMapActivity;
import net.duohuo.magappx.chat.activity.FlashPicAcitivity;
import net.duohuo.magappx.chat.util.audio.MediaPlayerManager;
import net.duohuo.magappx.chat.view.dialog.BottomGroupPanelDialog;
import net.duohuo.magappx.common.activity.PhotoPagerActivity;
import net.duohuo.magappx.common.util.Constants;
import net.duohuo.magappx.common.view.ActionSheet;
import net.duohuo.magappx.common.view.CommentRedPacketPopupWindow;
import net.duohuo.magappx.main.login.model.UserPreference;
import net.duohuo.magappx.main.user.tool.RedPackCoverActivity;
import net.duohuo.magappx.main.user.tool.RedPackOpenActivity;
import net.duohuo.magappx.main.user.tool.TicketOpenActivity;
import net.duohuo.magappx.openimui.chat.ChatView;
import net.duohuo.magappx.video.videoplay.VideoPicActivity;
public class ChatViewOnItemClickManager {
private AnimationDrawable animation;
private MagAudioMessage audioMessage;
MagappChatConversation conversation;
public ChatView mActivity;
public ChatMsgAdapter msgAdapter;
private boolean isManager = false;
private String group_id = "";
public View.OnClickListener imageClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
int size;
int intValue = ((Integer) view.getTag()).intValue();
ArrayList arrayList = new ArrayList();
List<MagappMessage> messageList = ChatViewOnItemClickManager.this.msgAdapter.getMessageList();
int i = 0;
for (int i2 = 0; i2 < messageList.size(); i2++) {
if (ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(i2).getBodyType() == 3) {
MagImageMessage magImageMessage = (MagImageMessage) messageList.get(i2);
if (magImageMessage.getFromUserId().equals(MagappChatCore.getInstance().getUserid()) && new File(magImageMessage.getLocalPicPath()).exists()) {
arrayList.add(FrescoController.FILE_PERFIX + magImageMessage.getLocalPicPath());
if (i2 == intValue) {
size = arrayList.size();
i = size - 1;
}
} else {
arrayList.add(magImageMessage.getRemotePicPath());
if (i2 == intValue) {
size = arrayList.size();
i = size - 1;
}
}
}
}
String[] strArr = new String[arrayList.size()];
Intent intent = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) PhotoPagerActivity.class);
intent.putExtra(SocialConstants.PARAM_IMAGE, (String[]) arrayList.toArray(strArr));
intent.putExtra("index", i);
intent.putExtra("fromChat", "fromChat");
ChatViewOnItemClickManager.this.mActivity.startActivity(intent);
ChatViewOnItemClickManager.this.mActivity.overridePendingTransition(R.anim.zoomin, R.anim.alpha_out);
}
};
public View.OnClickListener flashPicClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
final MagFlashPicMessage magFlashPicMessage = (MagFlashPicMessage) ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(((Integer) view.getTag()).intValue());
FlashPicAcitivity.flashPicDestoryCallback = new FlashPicAcitivity.FlashPicDestoryCallback() {
@Override
public void callback() {
magFlashPicMessage.setDestory((MagappChatAccount.user_prefix + ((UserPreference) Ioc.get(UserPreference.class)).getUserId()).equals(magFlashPicMessage.getFromUserId()));
ChatViewOnItemClickManager.this.conversation.upMessage2Db(magFlashPicMessage);
ChatViewOnItemClickManager.this.msgAdapter.notifyDataSetChanged();
}
};
if (magFlashPicMessage.getFromUserId().equals(MagappChatCore.getInstance().getUserid()) && new File(magFlashPicMessage.getLocalPicPath()).exists()) {
Intent intent = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) FlashPicAcitivity.class);
intent.putExtra("url", magFlashPicMessage.getLocalPicPath());
ChatViewOnItemClickManager.this.mActivity.startActivity(intent);
ChatViewOnItemClickManager.this.mActivity.overridePendingTransition(R.anim.zoomin, R.anim.alpha_out);
return;
}
Intent intent2 = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) FlashPicAcitivity.class);
intent2.putExtra("url", magFlashPicMessage.getRemotePicPath());
ChatViewOnItemClickManager.this.mActivity.startActivity(intent2);
ChatViewOnItemClickManager.this.mActivity.overridePendingTransition(R.anim.zoomin, R.anim.alpha_out);
}
};
public View.OnClickListener videoClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
MagVideoMessage magVideoMessage = (MagVideoMessage) ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(((Integer) view.getTag()).intValue());
if (((SiteConfig) Ioc.get(SiteConfig.class)).isVideoClose()) {
String[] strArr = {magVideoMessage.getRemotePicPath()};
Intent intent = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) PhotoPagerActivity.class);
intent.putExtra(SocialConstants.PARAM_IMAGE, strArr);
intent.putExtra("index", 0);
intent.putExtra("fromChat", "fromChat");
ChatViewOnItemClickManager.this.mActivity.startActivity(intent);
return;
}
if (magVideoMessage.getFromUserId().equals(MagappChatCore.getInstance().getUserid()) && new File(magVideoMessage.getlocalVideoPath()).exists()) {
Intent intent2 = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) VideoPicActivity.class);
intent2.putExtra("url", magVideoMessage.getlocalVideoPath());
intent2.putExtra("urlPic", magVideoMessage.getLocalPicPath());
ChatViewOnItemClickManager.this.mActivity.startActivity(intent2);
ChatViewOnItemClickManager.this.mActivity.overridePendingTransition(R.anim.zoomin, R.anim.alpha_out);
return;
}
Intent intent3 = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) VideoPicActivity.class);
intent3.putExtra("url", magVideoMessage.getRemoteVideoPath());
intent3.putExtra("urlPic", magVideoMessage.getRemotePicPath());
ChatViewOnItemClickManager.this.mActivity.startActivity(intent3);
ChatViewOnItemClickManager.this.mActivity.overridePendingTransition(R.anim.zoomin, R.anim.alpha_out);
}
};
public View.OnClickListener myViceClick = new AnonymousClass4();
public View.OnClickListener otherViceClick = new AnonymousClass5();
public View.OnClickListener localClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
final MagappLocationMessage magappLocationMessage = (MagappLocationMessage) ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(((Integer) view.getTag()).intValue());
final double latitude = magappLocationMessage.getLatitude();
final double longitude = magappLocationMessage.getLongitude();
final String locationName = magappLocationMessage.getLocationName();
if (!TextUtils.isEmpty(ChatViewOnItemClickManager.this.mActivity.getResources().getString(R.string.googleMapKey))) {
ActionSheet actionSheet = new ActionSheet(ChatViewOnItemClickManager.this.mActivity);
actionSheet.setItems("谷歌地图", "百度地图");
actionSheet.show(ChatViewOnItemClickManager.this.mActivity);
actionSheet.setOnActionClickListener(new ActionSheet.OnActionClickListener<Integer>() {
@Override
public void onAction(Integer num) {
if (num.intValue() == 0) {
ChatViewOnItemClickManager.this.openGoogleMap(latitude, longitude, locationName);
return;
}
Intent intent = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) ChatMapActivity.class);
intent.putExtra(Constants.LATITUDE, latitude);
intent.putExtra(Constants.LONGITUDE, longitude);
intent.putExtra("title", locationName);
intent.putExtra("des", magappLocationMessage.getDetailAddress());
intent.putExtra("isWatching", true);
ChatViewOnItemClickManager.this.mActivity.startActivity(intent);
}
});
return;
}
Intent intent = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) ChatMapActivity.class);
intent.putExtra(Constants.LATITUDE, latitude);
intent.putExtra(Constants.LONGITUDE, longitude);
intent.putExtra("title", locationName);
intent.putExtra("des", magappLocationMessage.getDetailAddress());
intent.putExtra("isWatching", true);
ChatViewOnItemClickManager.this.mActivity.startActivity(intent);
}
};
public View.OnClickListener redPackClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
final int intValue = ((Integer) view.getTag()).intValue();
final MagappRedPacketMessage magappRedPacketMessage = (MagappRedPacketMessage) ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(intValue);
HashMap hashMap = new HashMap();
Contact contact = MagappChatCore.getInstance().getContactManager().getContact(magappRedPacketMessage.getFromUserId(), 1);
if (contact != null) {
hashMap.put("user_head", contact.head);
hashMap.put("user_name", contact.showName);
} else {
hashMap.put("user_head", "");
hashMap.put("user_name", magappRedPacketMessage.getFromUserId());
}
hashMap.put("des", magappRedPacketMessage.getDes());
hashMap.put("link", magappRedPacketMessage.getLink());
hashMap.put("id", magappRedPacketMessage.getId());
hashMap.put("key", magappRedPacketMessage.getKey());
hashMap.put("type", magappRedPacketMessage.getTypeText());
hashMap.put(SocializeConstants.TENCENT_UID, magappRedPacketMessage.getFromUserId());
hashMap.put(RemoteMessageConst.MSGID, magappRedPacketMessage.getMsgId() + "");
hashMap.put(RedPackCoverActivity.BIG_COVER_URL, magappRedPacketMessage.getBigCoverUrl());
hashMap.put("group_id", ChatViewOnItemClickManager.this.group_id);
if (ChatViewOnItemClickManager.this.msgAdapter.isGroup) {
if ("1".equals(magappRedPacketMessage.getExtraValue("hassee"))) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, "https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + magappRedPacketMessage.getId());
return;
}
} else {
if (magappRedPacketMessage.getFromUserId().equals(MagappChatCore.getInstance().getUserid())) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, "https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + magappRedPacketMessage.getId());
return;
}
if ("1".equals(magappRedPacketMessage.getExtraValue("hassee"))) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, "https://app.jpztong.com/mag/operative/v1/redPacket/redpacket?id=" + magappRedPacketMessage.getId());
return;
}
}
CommentRedPacketPopupWindow commentRedPacketPopupWindow = new CommentRedPacketPopupWindow(ChatViewOnItemClickManager.this.mActivity, new JSONObject(hashMap), 0);
commentRedPacketPopupWindow.show(ChatViewOnItemClickManager.this.mActivity);
commentRedPacketPopupWindow.setOnopenCallback(new CommentRedPacketPopupWindow.OnopenCallback() {
@Override
public void onOpen() {
magappRedPacketMessage.addExtra("hassee", "1");
ChatViewOnItemClickManager.this.msgAdapter.notifyItemChanged(intValue);
}
});
}
};
public View.OnClickListener cardClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
final MagappCardMessage magappCardMessage = (MagappCardMessage) ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(((Integer) view.getTag()).intValue());
Intent intent = new Intent(ChatViewOnItemClickManager.this.mActivity, (Class<?>) TicketOpenActivity.class);
HashMap hashMap = new HashMap();
hashMap.put("des", magappCardMessage.getDes());
hashMap.put("id", magappCardMessage.getId());
hashMap.put(SocializeConstants.TENCENT_UID, magappCardMessage.getFromUserId());
hashMap.put("group_id", ChatViewOnItemClickManager.this.group_id);
Contact contact = MagappChatCore.getInstance().getContactManager().getContact(magappCardMessage.getFromUserId(), 1);
if (contact != null) {
hashMap.put("user_head", contact.head);
hashMap.put("user_name", contact.showName);
} else {
hashMap.put("user_head", "");
hashMap.put("user_name", magappCardMessage.getFromUserId());
}
hashMap.put("link", magappCardMessage.getLink());
hashMap.put("num", Integer.valueOf(magappCardMessage.getNum()));
hashMap.put("type_text", magappCardMessage.getTypeText());
hashMap.put(RemoteMessageConst.MSGID, magappCardMessage.getMsgId() + "");
if (ChatViewOnItemClickManager.this.msgAdapter.isGroup) {
if ("1".equals(magappCardMessage.getExtraValue("hassee"))) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, "https://app.jpztong.com/mag/user/v1/card/receiveCardView?id=" + magappCardMessage.getId());
return;
}
} else {
if (magappCardMessage.getFromUserId().equals(MagappChatCore.getInstance().getUserid())) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, "https://app.jpztong.com/mag/user/v1/card/receiveCardView?id=" + magappCardMessage.getId());
return;
}
if ("1".equals(magappCardMessage.getExtraValue("hassee"))) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, "https://app.jpztong.com/mag/user/v1/card/receiveCardView?id=" + magappCardMessage.getId());
return;
}
}
RedPackOpenActivity.onCallBack = new RedPackOpenActivity.OnopenCallback() {
@Override
public void onOpen() {
magappCardMessage.addExtra("hassee", "1");
}
};
intent.putExtra("infos", new JSONObject(hashMap).toString());
ChatViewOnItemClickManager.this.mActivity.startActivityForResult(intent, 6);
ChatViewOnItemClickManager.this.mActivity.overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
}
};
public View.OnClickListener otherHeadClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
MagappMessage magappMessage = ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(((Integer) view.getTag()).intValue());
if (magappMessage.getFromUserId().length() > MagappChatCore.user_prefix.length()) {
if (ChatViewOnItemClickManager.this.isManager && ChatViewOnItemClickManager.this.msgAdapter.isGroup) {
Contact contact = MagappChatCore.getInstance().getContactManager().getContact(magappMessage.getFromUserId(), 1);
new BottomGroupPanelDialog(ChatViewOnItemClickManager.this.mActivity, magappMessage.getFromUserId(), magappMessage.getConversationId(), ChatViewOnItemClickManager.this.group_id, contact != null ? contact.showName : magappMessage.getFromUserId(), ChatViewOnItemClickManager.this.isManager).show();
} else {
UrlSchemeProxy.userHome(ChatViewOnItemClickManager.this.mActivity).userId(magappMessage.getFromUserId().substring(MagappChatCore.user_prefix.length())).go();
}
}
}
};
public View.OnClickListener myHeadClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
UrlSchemeProxy.userHome(ChatViewOnItemClickManager.this.mActivity).userId(Integer.valueOf(((UserPreference) Ioc.get(UserPreference.class)).getUserId())).go();
}
};
public View.OnClickListener onTipClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
UrlScheme.toUrl(ChatViewOnItemClickManager.this.mActivity, SafeJsonUtil.getString(ChatViewOnItemClickManager.this.msgAdapter.getMessageList().get(((Integer) view.getTag()).intValue()).getContent(), "link"));
}
};
public View.OnClickListener giftClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
ChatViewOnItemClickManager.this.mActivity.setGiftAction();
}
};
public ChatViewOnItemClickManager(ChatView chatView, ChatMsgAdapter chatMsgAdapter, MagappChatConversation magappChatConversation) {
this.mActivity = chatView;
this.msgAdapter = chatMsgAdapter;
this.conversation = magappChatConversation;
}
public void setGroupInfor(boolean z, String str) {
this.isManager = z;
this.group_id = str;
}
class AnonymousClass4 implements View.OnClickListener {
AnonymousClass4() {
}
@Override
public void onClick(View view) {
int intValue = ((Integer) view.getTag()).intValue();
ImageView imageView = (ImageView) view.findViewById(R.id.chat_voice_play_me_ani);
imageView.setImageResource(R.drawable.voice_play_me);
if (ChatViewOnItemClickManager.this.animation != null) {
ChatViewOnItemClickManager chatViewOnItemClickManager = ChatViewOnItemClickManager.this;
chatViewOnItemClickManager.stopVoiceAnimation(chatViewOnItemClickManager.animation);
}
if (ChatViewOnItemClickManager.this.audioMessage != null) {
ChatViewOnItemClickManager.this.audioMessage.setPlaying(false);
}
ChatViewOnItemClickManager.this.animation = (AnimationDrawable) imageView.getDrawable();
ChatViewOnItemClickManager.this.animation.start();
ChatViewOnItemClickManager chatViewOnItemClickManager2 = ChatViewOnItemClickManager.this;
chatViewOnItemClickManager2.audioMessage = (MagAudioMessage) chatViewOnItemClickManager2.msgAdapter.getMessageList().get(intValue);
ChatViewOnItemClickManager.this.audioMessage.setPlaying(true);
File file = new File(ChatViewOnItemClickManager.this.audioMessage.getLocalAudioPath());
if (!file.exists()) {
final File file2 = new File(FileUtil.getExternalFilesDir("audio") + "/" + StrUtil.md5(ChatViewOnItemClickManager.this.audioMessage.getLocalAudioPath()));
Net.url(ChatViewOnItemClickManager.this.audioMessage.getRemoteAudioPath()).download(file.getAbsolutePath(), new Task() {
@Override
public void onResult(Object obj) {
if (TextUtils.isEmpty(file2.getAbsolutePath())) {
return;
}
ChatViewOnItemClickManager.this.mActivity.getPlayerManager();
MediaPlayerManager.playSound(file2.getAbsolutePath(), new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
ChatViewOnItemClickManager.this.stopVoiceAnimation(ChatViewOnItemClickManager.this.animation);
ChatViewOnItemClickManager.this.audioMessage.setPlaying(false);
ChatViewOnItemClickManager.this.msgAdapter.notifyDataSetChanged();
}
});
}
});
return;
}
if (TextUtils.isEmpty(file.getAbsolutePath())) {
return;
}
ChatViewOnItemClickManager.this.mActivity.getPlayerManager();
MediaPlayerManager.playSound(file.getAbsolutePath(), new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
ChatViewOnItemClickManager.this.stopVoiceAnimation(ChatViewOnItemClickManager.this.animation);
ChatViewOnItemClickManager.this.audioMessage.setPlaying(false);
ChatViewOnItemClickManager.this.msgAdapter.notifyDataSetChanged();
}
});
}
}
class AnonymousClass5 implements View.OnClickListener {
AnonymousClass5() {
}
@Override
public void onClick(View view) {
int intValue = ((Integer) view.getTag()).intValue();
ImageView imageView = (ImageView) view.findViewById(R.id.chat_voice_play_other_ani);
imageView.setImageResource(R.drawable.voice_play_other);
if (ChatViewOnItemClickManager.this.animation != null) {
ChatViewOnItemClickManager chatViewOnItemClickManager = ChatViewOnItemClickManager.this;
chatViewOnItemClickManager.stopVoiceAnimation(chatViewOnItemClickManager.animation);
}
if (ChatViewOnItemClickManager.this.audioMessage != null) {
ChatViewOnItemClickManager.this.audioMessage.setPlaying(false);
}
ChatViewOnItemClickManager.this.animation = (AnimationDrawable) imageView.getDrawable();
ChatViewOnItemClickManager.this.animation.start();
ChatViewOnItemClickManager chatViewOnItemClickManager2 = ChatViewOnItemClickManager.this;
chatViewOnItemClickManager2.audioMessage = (MagAudioMessage) chatViewOnItemClickManager2.msgAdapter.getMessageList().get(intValue);
ChatViewOnItemClickManager.this.audioMessage.addExtra("hassee", "1");
ChatViewOnItemClickManager.this.audioMessage.setPlaying(true);
final File file = new File(FileUtil.getExternalFilesDir("audio") + "/" + StrUtil.md5(ChatViewOnItemClickManager.this.audioMessage.getRemoteAudioPath()));
if (!file.exists()) {
Net.url(ChatViewOnItemClickManager.this.audioMessage.getRemoteAudioPath()).download(file.getAbsolutePath(), new Task() {
@Override
public void onResult(Object obj) {
if (TextUtils.isEmpty(file.getAbsolutePath())) {
return;
}
ChatViewOnItemClickManager.this.mActivity.getPlayerManager();
MediaPlayerManager.playSound(file.getAbsolutePath(), new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
ChatViewOnItemClickManager.this.stopVoiceAnimation(ChatViewOnItemClickManager.this.animation);
ChatViewOnItemClickManager.this.audioMessage.setPlaying(false);
ChatViewOnItemClickManager.this.msgAdapter.notifyDataSetChanged();
}
});
}
});
} else {
if (TextUtils.isEmpty(file.getAbsolutePath())) {
return;
}
ChatViewOnItemClickManager.this.mActivity.getPlayerManager();
MediaPlayerManager.playSound(file.getAbsolutePath(), new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
ChatViewOnItemClickManager.this.stopVoiceAnimation(ChatViewOnItemClickManager.this.animation);
ChatViewOnItemClickManager.this.audioMessage.setPlaying(false);
ChatViewOnItemClickManager.this.msgAdapter.notifyDataSetChanged();
}
});
}
}
}
public void playVoiceAnimation(AnimationDrawable animationDrawable) {
AnimationDrawable animationDrawable2 = this.animation;
if (animationDrawable2 != null) {
animationDrawable2.stop();
this.animation.selectDrawable(0);
}
this.animation = animationDrawable;
animationDrawable.start();
}
public void stopVoiceAnimation(AnimationDrawable animationDrawable) {
animationDrawable.stop();
animationDrawable.selectDrawable(0);
}
public void openGoogleMap(double d, double d2, String str) {
if (isAvilible(this.mActivity, "com.google.android.apps.maps")) {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("geo:" + d + com.xiaomi.mipush.sdk.Constants.ACCEPT_TIME_SEPARATOR_SP + d2 + "?q=" + str));
intent.setPackage("com.google.android.apps.maps");
this.mActivity.startActivity(intent);
return;
}
this.mActivity.showToast("您尚未安装谷歌地图或地图版本过低");
}
public static boolean isAvilible(Context context, String str) {
List<PackageInfo> installedPackages = context.getPackageManager().getInstalledPackages(0);
ArrayList arrayList = new ArrayList();
if (installedPackages != null) {
for (int i = 0; i < installedPackages.size(); i++) {
arrayList.add(installedPackages.get(i).packageName);
}
}
return arrayList.contains(str);
}
}