[Upload]
删除旧版本的功能代码 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -10,34 +10,31 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.function.notice.R;
|
||||
import com.mogo.eagle.core.function.notice.utils.AnimatorUtilsKt;
|
||||
import com.mogo.eagle.core.function.notice.view.GlobalToolsKt;
|
||||
import com.mogo.eagle.core.function.notice.view.PushItemAnimator;
|
||||
import com.mogo.eagle.core.function.notice.view.SwipeItemLayout;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.function.notice.Config;
|
||||
import com.mogo.eagle.core.function.notice.R;
|
||||
import com.mogo.eagle.core.function.notice.adapter.PushMessageAdapter;
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean;
|
||||
import com.mogo.eagle.core.function.notice.repository.PushRepository;
|
||||
import com.mogo.eagle.core.function.notice.utils.AnimatorUtilsKt;
|
||||
import com.mogo.eagle.core.function.notice.utils.HandlerUtils;
|
||||
import com.mogo.eagle.core.function.notice.view.PushItemAnimator;
|
||||
import com.mogo.eagle.core.function.notice.view.SwipeItemLayout;
|
||||
import com.mogo.eagle.core.function.notice.viewmodel.MessageViewModel;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/1
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHistoryPresenter > implements MessageHistoryView, IMogoMsgCenterListener {
|
||||
public class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHistoryPresenter > implements MessageHistoryView {
|
||||
|
||||
private static final String TAG = "MessageHistoryFragment";
|
||||
|
||||
@@ -143,7 +140,6 @@ class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHis
|
||||
|
||||
mRootView.setOnClickListener( view -> {
|
||||
} );
|
||||
GlobalToolsKt.getApis( getContext() ).getMsgCenterApi().registerMsgCenterListener( this );
|
||||
}
|
||||
|
||||
private void exitSelf() {
|
||||
@@ -178,13 +174,6 @@ class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHis
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgChanged( boolean hasMsg, int amount ) {
|
||||
HandlerUtils.INSTANCE.getMBgHandler().post( () -> {
|
||||
mViewModel.setList( PushRepository.Companion.getPushRepository().getAll() );
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@@ -199,6 +188,5 @@ class MessageHistoryFragment extends MvpFragment< MessageHistoryView, MessageHis
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
GlobalToolsKt.getApis( getContext() ).getMsgCenterApi().unregisterMsgCenterListener( this );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ class PushRepository(mContext: Context) {
|
||||
private val pushViewModel: PushViewModel = PushViewModel(mContext, this)
|
||||
private val pushBeanQueue: Queue<PushBean> = LinkedList()
|
||||
private val statusManager = getApis(mContext).statusManagerApi
|
||||
private val msgCenter = getApis(mContext).msgCenterApi
|
||||
val pushBeanDao by lazy {
|
||||
Room.databaseBuilder(appContext, PushBeanDatabase::class.java, "database_push").build()
|
||||
.pushBeanDao()
|
||||
@@ -59,37 +58,6 @@ class PushRepository(mContext: Context) {
|
||||
}
|
||||
|
||||
init {
|
||||
// 注册push通道监听 type 100时为push消息 lixp TODO
|
||||
// getApis(mContext).getSocketManagerApi(mContext)
|
||||
// .registerOnMessageListener(Config.PUSH_TYPE, object : IMogoOnMessageListener<PushBean> {
|
||||
// override fun target(): Class<PushBean> {
|
||||
// return PushBean::class.java
|
||||
// }
|
||||
//
|
||||
// override fun onMsgReceived(bean: PushBean?) {
|
||||
// Log.d("PushRepository", "pushBean = $bean")
|
||||
// if (bean != null) {
|
||||
// AnalyticsUtils.track(Config.NEWS_ARRIVE, "title", bean.title)
|
||||
// if (bean.mainSchema.isBlank()) {
|
||||
// bean.mainSchema = ""
|
||||
// }
|
||||
// if (bean.imageUrl.isBlank()) {
|
||||
// bean.imageUrl = ""
|
||||
// }
|
||||
// if (bean.appIcon.isBlank()) {
|
||||
// bean.appIcon = ""
|
||||
// }
|
||||
// pushBeanQueue.offer(bean)
|
||||
// }
|
||||
// if ( bean != null) {
|
||||
// HandlerUtils.mBgHandler.post {
|
||||
// pushBeanDao.insertAll(bean)
|
||||
// updateMsgNum()
|
||||
// }
|
||||
// }
|
||||
// startIterate()
|
||||
// }
|
||||
// })
|
||||
HandlerUtils.mBgHandler.postDelayed({
|
||||
updateMsgNum()
|
||||
}, 5000)
|
||||
@@ -102,9 +70,7 @@ class PushRepository(mContext: Context) {
|
||||
updateMsgNum()
|
||||
return
|
||||
}
|
||||
mHandler.post {
|
||||
msgCenter.setMsgStatus(num > 0, num)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun startIterate() {
|
||||
@@ -215,9 +181,6 @@ class PushRepository(mContext: Context) {
|
||||
fun deleteAll() {
|
||||
HandlerUtils.mBgHandler.post {
|
||||
pushBeanDao.deleteAll()
|
||||
mHandler.post {
|
||||
msgCenter.setMsgStatus(false, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user