修改BUG
This commit is contained in:
@@ -37,9 +37,11 @@ import com.xscm.moduleutil.event.RoomGiftRunable;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.stx.xhb.xbanner.XBanner;
|
||||
import com.xscm.moduleutil.utils.logger.DataLogger;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Logger;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@@ -194,37 +196,33 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(MqttBean event) {
|
||||
if (event!=null) {
|
||||
|
||||
List<MqttBean> cachedMqttBeans = RoomGiftRunable.getMqttCache();
|
||||
if (cachedMqttBeans == null || cachedMqttBeans.isEmpty()) {
|
||||
mBinding.rl.setVisibility(GONE);
|
||||
} else {
|
||||
mBinding.rl.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (mqttList == null) {
|
||||
mqttList = new ArrayList<>();
|
||||
info = new ArrayList<>();
|
||||
}
|
||||
mqttList.clear();
|
||||
info.clear();
|
||||
// 处理缓存数据
|
||||
for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// 处理每一条 mqttBean 数据
|
||||
mqttList.add(mqttBean.getList());
|
||||
info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
}
|
||||
|
||||
mBinding.marqueeView.startWithList(info);
|
||||
}else {
|
||||
mBinding.rl.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onEvent(MqttBean event) {
|
||||
//
|
||||
// List<MqttBean> cachedMqttBeans = RoomGiftRunable.getMqttCache();
|
||||
// if (cachedMqttBeans == null || cachedMqttBeans.isEmpty()) {
|
||||
// mBinding.rl.setVisibility(GONE);
|
||||
// } else {
|
||||
// mBinding.rl.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// if (mqttList == null) {
|
||||
// mqttList = new ArrayList<>();
|
||||
// info = new ArrayList<>();
|
||||
// }
|
||||
// mqttList.clear();
|
||||
// info.clear();
|
||||
// // 处理缓存数据
|
||||
// for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// // 处理每一条 mqttBean 数据
|
||||
// mqttList.add(mqttBean.getList());
|
||||
// info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
// }
|
||||
//
|
||||
// mBinding.marqueeView.startWithList(info);
|
||||
// }
|
||||
|
||||
public void onEvent1() {
|
||||
|
||||
try {
|
||||
List<MqttBean> cachedMqttBeans = RoomGiftRunable.getMqttCache();
|
||||
if (cachedMqttBeans == null || cachedMqttBeans.isEmpty()) {
|
||||
mBinding.rl.setVisibility(GONE);
|
||||
@@ -245,6 +243,10 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
}
|
||||
|
||||
mBinding.marqueeView.startWithList(info);
|
||||
}catch (Exception e){
|
||||
DataLogger.LogUtil.d("onEvent1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -112,18 +112,17 @@
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/sliding_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabTextColor="#F1ECFF"
|
||||
app:tabTextAppearance="@style/CustomTabTextAppearance"
|
||||
app:tabIndicatorFullWidth="true"
|
||||
app:tabMode="fixed"/>
|
||||
app:tabMode="scrollable"/>
|
||||
<!-- app:tl_indicator_corner_radius="@dimen/dp_3"-->
|
||||
<!-- app:tl_indicator_drawable="@mipmap/tab_dy"-->
|
||||
<!-- app:tl_indicator_height="@dimen/dp_6"-->
|
||||
|
||||
Reference in New Issue
Block a user