柬埔寨通 v6.1.5版本的 MD5 值为:9b68581ac30883219d6a25858a099d6b
以下内容为反编译后的 VoiceCourseDetailActivity.java 源代码,内容仅作参考
package net.duohuo.magappx.specialcolumn;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import anet.channel.entity.ConnType;
import butterknife.BindView;
import butterknife.OnClick;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jianpuzhaitong.forum.R;
import com.tencent.open.SocialConstants;
import com.xiaomi.mipush.sdk.Constants;
import java.util.List;
import java.util.Objects;
import net.duohuo.core.ITongdunOperation;
import net.duohuo.core.adapter.DataPage;
import net.duohuo.core.annotation.Extra;
import net.duohuo.core.dataview.DataView;
import net.duohuo.core.dialog.DialogCallBack;
import net.duohuo.core.dialog.IDialog;
import net.duohuo.core.eventbus.Event;
import net.duohuo.core.eventbus.EventBus;
import net.duohuo.core.eventbus.OnEventListener;
import net.duohuo.core.ioc.Ioc;
import net.duohuo.core.net.Net;
import net.duohuo.core.net.Result;
import net.duohuo.core.net.Task;
import net.duohuo.core.util.SafeJsonUtil;
import net.duohuo.magappx.API;
import net.duohuo.magappx.UrlScheme;
import net.duohuo.magappx.circle.show.dataview.LookAllCommentDataView;
import net.duohuo.magappx.circle.show.dataview.ShowCommentChoiceDataView;
import net.duohuo.magappx.collection.ContentCollectionActivity;
import net.duohuo.magappx.common.activity.CommentActivity;
import net.duohuo.magappx.common.activity.CommonCommentActivity;
import net.duohuo.magappx.common.adapter.IncludeEmptyAdapter;
import net.duohuo.magappx.common.base.MagBaseActivity;
import net.duohuo.magappx.common.comp.comment.CommentApplaudView;
import net.duohuo.magappx.common.comp.comment.CommentInfo;
import net.duohuo.magappx.common.dataview.model.Comment;
import net.duohuo.magappx.common.util.CacheUtils;
import net.duohuo.magappx.common.util.TimerUtils;
import net.duohuo.magappx.common.view.MagListView;
import net.duohuo.magappx.common.view.RichContent;
import net.duohuo.magappx.main.login.UserApi;
import net.duohuo.magappx.specialcolumn.bean.ColumnInfoItem;
import net.duohuo.magappx.specialcolumn.bean.ColumnInforBean;
import net.duohuo.magappx.specialcolumn.dataview.ColumnCommentDataView;
import net.duohuo.magappx.specialcolumn.dataview.ColumnContentListDataView;
import net.duohuo.magappx.specialcolumn.dataview.SpecialColumVoiceHeadDataView;
import net.duohuo.magappx.specialcolumn.dataview.SpecialColumnInforDataView;
import net.duohuo.magappx.specialcolumn.dataview.SpecialColumnTextHeadDataView;
import net.duohuo.magappx.specialcolumn.floatingview.FloatViewService;
import net.duohuo.magappx.specialcolumn.floatingview.FloatingView;
public class VoiceCourseDetailActivity extends MagBaseActivity implements DataPage.OnLoadSuccessCallBack {
public static Intent intent;
public static FloatViewService.MyBinder mBinder;
IncludeEmptyAdapter adapter;
TextView allTimeV;
TextView beginTime;
EventBus bus;
CommentApplaudView commentApplaudView;
ShowCommentChoiceDataView commentChoiceDataView;
@Extra
String comment_id;
@Extra
String contentId;
ColumnContentListDataView contentListDataView;
@BindView(R.id.list_empty_image)
ImageView emptyImageV;
@BindView(R.id.listview_empty)
View emptyLayout;
@BindView(R.id.list_empty_text)
TextView emptyTextV;
private boolean isTipPay;
JSONObject jsonObject;
@BindView(R.id.listview)
MagListView listV;
LookAllCommentDataView lookAllCommentDataView;
ImageView playV;
SeekBar seekBar;
SpecialColumnInforDataView specialColumnInforDataView;
SpecialColumVoiceHeadDataView voiceHeadDataView;
CommentInfo commentInfo = new CommentInfo();
public ServiceConnection mServiceConnection = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName componentName) {
}
@Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
VoiceCourseDetailActivity.mBinder = (FloatViewService.MyBinder) iBinder;
VoiceCourseDetailActivity.mBinder.setOnPreparedListener(new FloatViewService.OnPreparedListener() {
@Override
public void onPreparedListener() {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_suspend);
if (VoiceCourseDetailActivity.mBinder != null) {
VoiceCourseDetailActivity.this.seekBar.setMax(VoiceCourseDetailActivity.mBinder.getProgress());
VoiceCourseDetailActivity.mBinder.playMusic();
VoiceCourseDetailActivity.this.allTimeV.setText(TimerUtils.getTime(VoiceCourseDetailActivity.mBinder.getProgress() / 1000));
}
VoiceCourseDetailActivity.this.mHandler.post(VoiceCourseDetailActivity.this.mRunnable);
}
@Override
public void onFinish() {
if (VoiceCourseDetailActivity.intent != null) {
VoiceCourseDetailActivity.this.getApplicationContext().stopService(VoiceCourseDetailActivity.intent);
VoiceCourseDetailActivity.this.getApplicationContext().unbindService(VoiceCourseDetailActivity.this.mServiceConnection);
}
}
});
}
};
JSONObject dataObj = new JSONObject();
public Handler mHandler = new Handler();
public Runnable mRunnable = new Runnable() {
@Override
public void run() {
if (VoiceCourseDetailActivity.mBinder == null || VoiceCourseDetailActivity.this.seekBar == null) {
return;
}
VoiceCourseDetailActivity.this.seekBar.setProgress(VoiceCourseDetailActivity.mBinder.getPlayPosition());
VoiceCourseDetailActivity.this.beginTime.setText(TimerUtils.getTime(VoiceCourseDetailActivity.mBinder.getPlayPosition() / 1000));
VoiceCourseDetailActivity.this.mHandler.postDelayed(VoiceCourseDetailActivity.this.mRunnable, 1000L);
}
};
boolean isFirst = true;
private int page = 1;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
init();
}
protected void init() {
setContentView(R.layout.specialclumn_viocecouser_detail_layout);
setSwipeBackEnable(false);
getNavigator().hideLineV();
this.emptyImageV.setImageResource(R.drawable.exception_no_content);
this.emptyTextV.setText("内容找不到了,请查看其它精彩内容");
SpecialColumVoiceHeadDataView specialColumVoiceHeadDataView = new SpecialColumVoiceHeadDataView(getActivity());
this.voiceHeadDataView = specialColumVoiceHeadDataView;
this.playV = (ImageView) specialColumVoiceHeadDataView.getRootView().findViewById(R.id.play);
this.seekBar = (SeekBar) this.voiceHeadDataView.getRootView().findViewById(R.id.seekbar);
this.beginTime = (TextView) this.voiceHeadDataView.getRootView().findViewById(R.id.begin_time);
this.allTimeV = (TextView) this.voiceHeadDataView.getRootView().findViewById(R.id.all_time);
this.listV.addHeaderView(this.voiceHeadDataView.getRootView());
SpecialColumnInforDataView specialColumnInforDataView = new SpecialColumnInforDataView(getActivity());
this.specialColumnInforDataView = specialColumnInforDataView;
this.listV.addHeaderView(specialColumnInforDataView.getRootView());
ColumnContentListDataView columnContentListDataView = new ColumnContentListDataView(getActivity());
this.contentListDataView = columnContentListDataView;
this.listV.addHeaderView(columnContentListDataView.getRootView());
ShowCommentChoiceDataView showCommentChoiceDataView = new ShowCommentChoiceDataView(this);
this.commentChoiceDataView = showCommentChoiceDataView;
this.listV.addHeaderView(showCommentChoiceDataView.getRootView());
this.commentChoiceDataView.setData("video");
this.commentApplaudView = new CommentApplaudView(this, findViewById(R.id.comment_bar));
initcommentApplaudView();
LookAllCommentDataView lookAllCommentDataView = new LookAllCommentDataView(this);
this.lookAllCommentDataView = lookAllCommentDataView;
this.listV.addFooterView(lookAllCommentDataView.getRootView());
initView();
IncludeEmptyAdapter includeEmptyAdapter = new IncludeEmptyAdapter(getActivity(), API.SpecialColumn.commentList + "?type=1", Comment.class, (Class<? extends DataView>) ColumnCommentDataView.class);
this.adapter = includeEmptyAdapter;
includeEmptyAdapter.param("type_id", this.contentId);
if (!TextUtils.isEmpty(this.comment_id)) {
this.adapter.param("comment_id", this.comment_id);
}
IncludeEmptyAdapter includeEmptyAdapter2 = this.adapter;
Objects.requireNonNull(includeEmptyAdapter2);
includeEmptyAdapter2.set("EMPTY_KEY_HINT", "暂无回复");
IncludeEmptyAdapter includeEmptyAdapter3 = this.adapter;
Objects.requireNonNull(includeEmptyAdapter3);
includeEmptyAdapter3.set("EMPTY_KEY_PIC", Integer.valueOf(R.drawable.exception_no_comment));
this.adapter.set("commenttag", this.commentInfo);
this.adapter.addOnLoadSuccessCallBack(this);
this.adapter.refresh();
this.listV.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.white));
this.listV.setAdapter((ListAdapter) this.adapter);
this.commentChoiceDataView.setCommentChoiceCallback(new ShowCommentChoiceDataView.CommentChoiceCallback() {
@Override
public void isPoster(boolean z) {
VoiceCourseDetailActivity.this.adapter.param("poster", Boolean.valueOf(z));
VoiceCourseDetailActivity.this.adapter.refresh();
}
@Override
public void isHot(boolean z) {
VoiceCourseDetailActivity.this.adapter.param("sort", "hot");
VoiceCourseDetailActivity.this.adapter.refresh();
}
@Override
public void order(boolean z) {
VoiceCourseDetailActivity.this.adapter.param("sort", z ? ContentCollectionActivity.ASC : "desc");
VoiceCourseDetailActivity.this.adapter.refresh();
}
});
this.voiceHeadDataView.setOnchangeMusicListener(new SpecialColumVoiceHeadDataView.OnchangeMusicListener() {
@Override
public void onchangeMusicListener(String str) {
VoiceCourseDetailActivity.this.contentId = str;
VoiceCourseDetailActivity.this.initView();
}
});
this.bus.registerListener(API.Event.clickAll, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
VoiceCourseDetailActivity.this.adapter.refresh();
return super.doInUI(event);
}
});
this.bus.registerListener(API.Event.comment_delete, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
VoiceCourseDetailActivity.this.adapter.refresh();
return super.doInUI(event);
}
});
this.bus.registerListener(API.Event.isMediaPlayer, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
JSONArray jSONArray = SafeJsonUtil.getJSONArray(VoiceCourseDetailActivity.this.dataObj, "audio_list");
if (jSONArray.size() > 1) {
VoiceCourseDetailActivity.this.contentId = SafeJsonUtil.getString(jSONArray, "1");
}
VoiceCourseDetailActivity.this.initView();
return super.doInUI(event);
}
});
this.bus.registerListener(API.Event.redraw, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
if (VoiceCourseDetailActivity.mBinder != null) {
VoiceCourseDetailActivity.this.seekBar.setMax(VoiceCourseDetailActivity.mBinder.getProgress());
VoiceCourseDetailActivity.mBinder.playMusic();
VoiceCourseDetailActivity.this.allTimeV.setText(TimerUtils.getTime(VoiceCourseDetailActivity.mBinder.getProgress() / 1000));
if (VoiceCourseDetailActivity.mBinder.isplaying()) {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_suspend);
} else {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_play);
}
}
VoiceCourseDetailActivity.this.mHandler.post(VoiceCourseDetailActivity.this.mRunnable);
return super.doInUI(event);
}
});
this.bus.registerListener(API.Event.pauseMusic, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_play);
return super.doInUI(event);
}
});
this.bus.registerListener(API.Event.playMusic, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_suspend);
return super.doInUI(event);
}
});
this.bus.clearEvents(API.Event.updateUI);
this.bus.registerListener(API.Event.updateUI, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
if (event.getParams() != null) {
try {
VoiceCourseDetailActivity.this.manageResult((Result) event.getParams()[0]);
} catch (Exception unused) {
}
}
return super.doInUI(event);
}
});
((EventBus) Ioc.get(EventBus.class)).clearEvents(API.Event.STARTFLOATVIEWSERVICE);
this.bus.registerListener(API.Event.STARTFLOATVIEWSERVICE, getClass().getSimpleName(), new OnEventListener() {
@Override
public boolean doInUI(Event event) {
VoiceCourseDetailActivity.this.startService();
return super.doInUI(event);
}
});
}
@Override
public void onNewIntent(Intent intent2) {
super.onNewIntent(intent2);
setIntent(intent2);
init();
}
public void openWindow() {
((EventBus) Ioc.get(EventBus.class)).fireEvent(API.Event.CLOSEAudioService, new Object[0]);
((EventBus) Ioc.get(EventBus.class)).fireEvent(API.Event.CLOSE_VoicePlayback_Service, new Object[0]);
startService();
}
public void startService() {
if (intent == null) {
intent = new Intent(getActivity(), (Class<?>) FloatViewService.class);
}
intent.putExtra("data", this.dataObj.toJSONString());
getApplicationContext().bindService(intent, this.mServiceConnection, 1);
getApplicationContext().startService(intent);
this.playV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (VoiceCourseDetailActivity.mBinder != null) {
if (VoiceCourseDetailActivity.mBinder.isplaying()) {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_play);
VoiceCourseDetailActivity.mBinder.pauseMusic();
} else {
VoiceCourseDetailActivity.this.playV.setImageResource(R.drawable.paycolumn_audio_suspend);
VoiceCourseDetailActivity.mBinder.playMusic();
}
}
}
});
this.seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
if (z) {
VoiceCourseDetailActivity.mBinder.seekToPositon(seekBar.getProgress());
}
VoiceCourseDetailActivity.this.beginTime.setText(TimerUtils.getTime(VoiceCourseDetailActivity.mBinder.getPlayPosition() / 1000));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
VoiceCourseDetailActivity.this.beginTime.setText("00:00");
}
});
}
@OnClick({R.id.comment_view})
public void commentLocation() {
if (this.commentInfo.getCommentCount() == 0) {
commentClick();
} else if (this.listV.getHeaderViewsCount() + this.listV.getFooterViewsCount() == this.listV.getCount()) {
MagListView magListView = this.listV;
magListView.setSelection(magListView.getBottom());
} else {
this.listV.setSelection(9);
}
}
private void initcommentApplaudView() {
this.commentApplaudView.setShareListen(new CommentApplaudView.shareListenClick() {
@Override
public void shareClick() {
VoiceCourseDetailActivity.this.getActivity().findViewById(R.id.navi_action).performClick();
}
});
this.commentApplaudView.setCommentCallBack(new CommentActivity.CommentCallBack() {
@Override
public void onCommentSuccess(String str, String str2) {
VoiceCourseDetailActivity.this.adapter.refresh();
VoiceCourseDetailActivity.this.commentInfo.setCommentCount(VoiceCourseDetailActivity.this.commentInfo.getCommentCount() + 1);
VoiceCourseDetailActivity.this.commentApplaudView.notifyChange();
}
});
this.commentApplaudView.setApplaudCallback(new CommentApplaudView.ApplaudCallBck() {
@Override
public void onApplaudCallBck(Boolean bool) {
bool.booleanValue();
}
});
}
private void setDataComment() {
this.commentInfo.setCommentUrl(API.SpecialColumn.commentReply + "?type=1");
this.commentInfo.addCommentExtra("content_id", this.contentId);
this.commentInfo.setApplaudAddUrl(API.SpecialColumn.applaud + "?type=1");
this.commentInfo.setApplaudCancelUrl(API.SpecialColumn.cancelApplaud + "?type=1");
this.commentInfo.setApplaudKey("type_id");
this.commentInfo.setApplaudValue(this.contentId);
this.commentInfo.setApplaud(SafeJsonUtil.getBoolean(SafeJsonUtil.getJSONObject(this.jsonObject, "data"), "is_applaud"));
this.commentInfo.setShareUrl("http://baidu.com");
this.commentInfo.setApplaudCount(SafeJsonUtil.getInteger(this.jsonObject, "data.applaud_count"));
this.commentInfo.setCommentCount(SafeJsonUtil.getInteger(this.jsonObject, "data.comment_count"));
this.commentInfo.setCommentApplaudAddUrl(API.SpecialColumn.applaud + "?type=2");
this.commentInfo.setCommentApplaudCancelUrl(API.SpecialColumn.cancelApplaud + "?type=2");
this.commentApplaudView.setData(this.commentInfo);
}
public class AnonymousClass18 extends UserApi.LoginCallBack {
AnonymousClass18() {
}
@Override
public void onLogin() {
Intent intent = new Intent(VoiceCourseDetailActivity.this.getActivity(), (Class<?>) CommonCommentActivity.class);
intent.putExtra("uploadType", "1");
intent.putExtra("picupload", ConnType.PK_OPEN);
if (VoiceCourseDetailActivity.this.jsonObject != null) {
intent.putExtra("hint", "回复" + SafeJsonUtil.getString(VoiceCourseDetailActivity.this.jsonObject, "data.user.name") + Constants.COLON_SEPARATOR);
}
CommonCommentActivity.commentCallBack = new CommonCommentActivity.CommentCallBack() {
@Override
public void onCommentSuccess(String str, String str2, String str3, int i, RichContent.Pic pic) {
Net url = Net.url(API.SpecialColumn.commentReply + "?type=1");
url.param("type_id", VoiceCourseDetailActivity.this.contentId);
url.param("content", str);
if (i == 1) {
url.param(SocialConstants.PARAM_IMAGE, str2);
}
if (i == 2 && pic != null) {
url.param("video", pic.videoAid);
url.param(SocialConstants.PARAM_IMAGE, pic.thumbAid);
}
if (!TextUtils.isEmpty(Ioc.getApplicationContext().getString(R.string.android_partner_key))) {
url.param("auth", ((ITongdunOperation) Ioc.get(ITongdunOperation.class)).onEvent(Ioc.getApplicationContext()));
}
if (!TextUtils.isEmpty(str3)) {
url.param("users", str3);
}
url.post(new Task<Result>() {
@Override
public void onResult(Result result) {
if (result.success()) {
CacheUtils.putString(VoiceCourseDetailActivity.this.getActivity(), CacheUtils.commentKey, "");
CacheUtils.putString(VoiceCourseDetailActivity.this.getActivity(), CacheUtils.commentAtUsers, new JSONArray().toJSONString());
VoiceCourseDetailActivity.this.adapter.notifyDataSetChanged();
VoiceCourseDetailActivity.this.commentApplaudView.notifyChange();
}
}
});
}
};
VoiceCourseDetailActivity.this.getActivity().startActivity(intent);
VoiceCourseDetailActivity.this.overridePendingTransition(R.anim.alpha_in, R.anim.alpha_out);
}
}
@OnClick({R.id.comment})
public void commentClick() {
UserApi.afterLogin(getActivity(), new AnonymousClass18());
}
public void initView() {
Net url = Net.url(API.SpecialColumn.contentView);
url.param("id", this.contentId);
url.showToast(false);
url.get(new Task<Result>() {
@Override
public void onResult(Result result) {
VoiceCourseDetailActivity.this.manageResult(result);
}
});
}
public void manageResult(Result result) {
if (result.success()) {
getNavigator().setAction(R.drawable.navi_icon_more, new View.OnClickListener() {
@Override
public void onClick(View view) {
if (VoiceCourseDetailActivity.this.jsonObject != null) {
JSONObject jSONObject = SafeJsonUtil.getJSONObject(SafeJsonUtil.getJSONObject(VoiceCourseDetailActivity.this.jsonObject, "data"), "sharedata");
Intent intent2 = new Intent(VoiceCourseDetailActivity.this.getActivity(), (Class<?>) ColumnShareActivity.class);
intent2.putExtra("sharedata", jSONObject.toJSONString());
VoiceCourseDetailActivity.this.startActivity(intent2);
}
}
});
this.jsonObject = result.json();
JSONObject data = result.getData();
this.dataObj = data;
if ("-1".equals(SafeJsonUtil.getString(data, "has_buy"))) {
FloatViewService.MyBinder myBinder = mBinder;
if (myBinder != null) {
myBinder.stop();
mBinder.cancleHander();
}
Intent intent2 = intent;
if (intent2 != null) {
stopService(intent2);
}
FloatingView.get().remove();
} else {
openWindow();
}
setDataComment();
this.voiceHeadDataView.setData(result.getData());
this.voiceHeadDataView.setBuySucessCallback(new SpecialColumnTextHeadDataView.BuyRefreshCallback() {
@Override
public void onRefresh() {
VoiceCourseDetailActivity.this.initView();
}
@Override
public void onBuyUrl(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
VoiceCourseDetailActivity.this.isTipPay = true;
UrlScheme.toUrl(VoiceCourseDetailActivity.this.getActivity(), str);
}
});
ColumnInforBean columnInforBean = (ColumnInforBean) JSON.parseObject(SafeJsonUtil.getJSONObject(result.json(), "column").toJSONString(), ColumnInforBean.class);
this.specialColumnInforDataView.setData(columnInforBean);
List parseArray = JSON.parseArray(SafeJsonUtil.getJSONArray(result.json(), "contentList").toJSONString(), ColumnInfoItem.class);
this.voiceHeadDataView.set("column_link", columnInforBean.getLink());
this.contentListDataView.set("column_link", columnInforBean.getLink());
this.contentListDataView.setData(parseArray);
return;
}
getActivity().findViewById(R.id.navi_action).setVisibility(8);
getActivity().findViewById(R.id.navi_line).setVisibility(0);
setTitle("详情");
this.emptyLayout.setVisibility(0);
}
@Override
public void onDestroy() {
super.onDestroy();
Handler handler = this.mHandler;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
EventBus eventBus = this.bus;
if (eventBus != null) {
eventBus.unregisterListener(API.Event.clickAll, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.comment_delete, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.redraw, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.pauseMusic, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.updateUI, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.playMusic, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.isMediaPlayer, getClass().getSimpleName());
this.bus.unregisterListener(API.Event.STARTFLOATVIEWSERVICE, getClass().getSimpleName());
}
}
@Override
public void onLoadSuccess(Task task, int i) {
if (task == null || task.getResult() == null) {
return;
}
if (i == 1) {
this.page = i;
}
if (((String) this.adapter.get("isDelete")) != null) {
CommentInfo commentInfo = this.commentInfo;
commentInfo.setCommentCount(commentInfo.getCommentCount() < 1 ? 0 : this.commentInfo.getCommentCount() - 1);
this.commentApplaudView.notifyChange();
this.adapter.set("isDelete", null);
}
if (i == 1 && task.getResult().success()) {
this.adapter.set("is_open_comment_lzl", "1");
this.adapter.param("comment_id", null);
JSONArray list = task.getResult().getList();
if (list != null && list.size() > 0) {
if (!TextUtils.isEmpty(this.comment_id)) {
this.comment_id = null;
this.lookAllCommentDataView.setData(true);
if (this.isFirst) {
this.listV.post(new Runnable() {
@Override
public void run() {
VoiceCourseDetailActivity.this.listV.smoothScrollToPosition(VoiceCourseDetailActivity.this.listV.getBottom());
VoiceCourseDetailActivity.this.isFirst = false;
}
});
return;
}
return;
}
this.lookAllCommentDataView.setData(false);
return;
}
this.lookAllCommentDataView.setData(false);
}
}
@Override
public void onResume() {
super.onResume();
if (this.isTipPay) {
this.isTipPay = false;
((IDialog) Ioc.get(IDialog.class)).showDialog(getActivity(), "是否支付成功", "请确认订单是否支付成功?", "支付失败", "支付成功", new DialogCallBack() {
@Override
public void onClick(int i) {
if (i == -1) {
VoiceCourseDetailActivity.this.initView();
}
}
}).show();
}
}
}