Merge remote-tracking branch 'origin/develop_new' into develop_new
This commit is contained in:
@@ -51,8 +51,14 @@ public class MyCarAdapter extends BaseAdapter<CarInfo> {
|
||||
|
||||
// 时间
|
||||
if (remainingDay >= 0 && status == CarInfo.STATUS_USER_CAN_USE) {
|
||||
String days;
|
||||
if (item.getExpireDays() > 99){
|
||||
days = item.getExpireDays()+"+";
|
||||
}else {
|
||||
days = item.getExpireDays()+"";
|
||||
}
|
||||
binding.tvCounters.setText(String.format(binding.tvCounters.getResources().getString(R.string.decoration_status_wrapper),
|
||||
binding.tvCounters.getResources().getString(R.string.decoration_remainder) + remainingDay + "天"));
|
||||
binding.tvCounters.getResources().getString(R.string.decoration_remainder) + days + "天"));
|
||||
} else {
|
||||
if (status == CarInfo.STATUS_OFF_SHELF || status == CarInfo.STATUS_OUT_OF_DATE) {
|
||||
binding.tvCounters.setText(String.format(binding.tvCounters.getResources().getString(R.string.decoration_status_wrapper),
|
||||
|
@@ -62,7 +62,13 @@ public class MyHeadWearAdapter extends BaseAdapter<HeadWearInfo> {
|
||||
if (item.getStatus() == 2) { // 过期
|
||||
binding.tvCounters.setText(mContext.getString(R.string.past_due));
|
||||
} else {
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireDays() + mContext.getString(R.string.day));
|
||||
String days;
|
||||
if (item.getExpireDays() > 99){
|
||||
days = item.getExpireDays()+"+";
|
||||
}else {
|
||||
days = item.getExpireDays()+"";
|
||||
}
|
||||
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,7 +46,13 @@ public class MyNamePlateAdapter extends BaseQuickAdapter<NamePlateInfo.Nameplate
|
||||
tvUsed.setText("使用");
|
||||
} else {
|
||||
helper.setText(R.id.tv_counters,mContext.getString(R.string.past_due));
|
||||
helper.setText(R.id.tv_counters,mContext.getString(R.string.decoration_remainder) + item.getExpireDays() + mContext.getString(R.string.day));
|
||||
String days;
|
||||
if (item.getExpireDays() > 99){
|
||||
days = item.getExpireDays()+"+";
|
||||
}else {
|
||||
days = item.getExpireDays()+"";
|
||||
}
|
||||
helper.setText(R.id.tv_counters,mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
|
||||
tvUsed.setVisibility(View.VISIBLE);
|
||||
tvUsed.setEnabled(true);
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ import com.yizhuan.erban.home.bean.HomeTabMapInfo;
|
||||
import com.yizhuan.erban.home.event.HomeDynamicEvent;
|
||||
import com.yizhuan.erban.home.event.RefreshHomeDataEvent;
|
||||
import com.yizhuan.erban.home.model.HomeModel;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.LogUtil;
|
||||
@@ -54,7 +55,6 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
private Handler handler = new Handler();
|
||||
private Runnable runnable;
|
||||
private final List<HomeDynamicInfo> dynamicList = new ArrayList<>();
|
||||
private static final int REFRESH_SPEED = 5000;
|
||||
|
||||
public static HomeDynamicFragment newInstance() {
|
||||
HomeDynamicFragment fragment = new HomeDynamicFragment();
|
||||
@@ -125,6 +125,8 @@ public class HomeDynamicFragment extends BaseFragment{
|
||||
}
|
||||
|
||||
private void refreshData(){
|
||||
int REFRESH_SPEED = InitialModel.get().getDynamicRefresh() > 0?InitialModel.get().getDynamicRefresh()*1000:3000;//默认3秒
|
||||
|
||||
if (ListUtils.isListEmpty(dynamicList) || runnable != null){
|
||||
return;
|
||||
}
|
||||
|
@@ -11,12 +11,14 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.trello.rxlifecycle2.android.FragmentEvent;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.NoDataFragment;
|
||||
import com.yizhuan.erban.home.adapter.HomeRoomFragmentAdapter;
|
||||
import com.yizhuan.erban.home.bean.HomeTabMapInfo;
|
||||
import com.yizhuan.erban.home.model.HomeModel;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.log.MLog;
|
||||
@@ -39,8 +41,7 @@ public class HomeTabHomeFragment extends LazyLoadFragment {
|
||||
private HomeRoomFragmentAdapter mHomeRoomAdapter;
|
||||
private Handler handler = new Handler();
|
||||
private Runnable runnable;
|
||||
//刷新速度
|
||||
private static final int REFRESH_SPEED = 5000;
|
||||
|
||||
|
||||
|
||||
public static HomeTabHomeFragment newInstance(int tabId) {
|
||||
@@ -63,6 +64,7 @@ public class HomeTabHomeFragment extends LazyLoadFragment {
|
||||
tabId = getArguments().getString(PARAM_TAB_ID);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,6 +113,7 @@ public class HomeTabHomeFragment extends LazyLoadFragment {
|
||||
if (ListUtils.isListEmpty(serviceResult)){
|
||||
return;
|
||||
}
|
||||
|
||||
List<HomeTabMapInfo> roomsList = new ArrayList<>(serviceResult);//未处理的数
|
||||
List<HomeTabMapInfo> randomList = new ArrayList<>();//不是置顶的
|
||||
List<HomeTabMapInfo> finalList = new ArrayList<>();//最终的6条数据
|
||||
@@ -143,6 +146,7 @@ public class HomeTabHomeFragment extends LazyLoadFragment {
|
||||
List<HomeTabMapInfo> finalList1 = new ArrayList<>(finalList);//最终的6条数据
|
||||
List<HomeTabMapInfo> randomList1 = new ArrayList<>(randomList);//不是置顶的
|
||||
mHomeRoomAdapter.setNewData(getConvertData(finalList1,randomList1));
|
||||
int REFRESH_SPEED = InitialModel.get().getRoomRefresh() > 0?InitialModel.get().getRoomRefresh()*1000:10000;//默认10秒
|
||||
if (runnable != null){
|
||||
return;
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ public class HomeModel extends BaseModel {
|
||||
|
||||
private final Api api = RxNet.create(Api.class);
|
||||
|
||||
|
||||
public Single<List<HomeDynamicInfo>> getHomeDynamic() {
|
||||
return api.apiHomeDynamics(String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
CommunityConstant.VERSION_VALID_TYPE,
|
||||
|
@@ -55,7 +55,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignTop="@+id/tv_nameplate_name"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textColor="@color/white"
|
||||
tools:text="@string/label_can_use"
|
||||
tools:background="@drawable/bg_my_head_buy"/>
|
||||
|
||||
@@ -65,8 +65,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@id/ll_nameplate_cover"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_below="@id/tv_nameplate_name"
|
||||
android:layout_alignBottom="@+id/ll_nameplate_cover"
|
||||
android:drawableStart="@drawable/ic_time_left"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 122 KiB |
@@ -45,4 +45,8 @@ public interface IInitialModel extends IModel {
|
||||
Single<ServiceResult> reportBaiduAdv();
|
||||
|
||||
int getTeenagerMode();
|
||||
|
||||
int getRoomRefresh();
|
||||
|
||||
int getDynamicRefresh();
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import com.yizhuan.xchat_android_core.DemoCache;
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.certification.CertificationModel;
|
||||
import com.yizhuan.xchat_android_core.home.model.HomeModel;
|
||||
import com.yizhuan.xchat_android_core.im.game.ImGameMode;
|
||||
import com.yizhuan.xchat_android_core.initial.bean.BoxInfo;
|
||||
import com.yizhuan.xchat_android_core.initial.bean.InitInfo;
|
||||
@@ -94,6 +95,14 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
* 家长模式引导 1-强 2- 弱
|
||||
*/
|
||||
private int teenagerMode;
|
||||
/**
|
||||
* 首页房间刷新频率
|
||||
*/
|
||||
private int roomRefresh;
|
||||
/**
|
||||
* 首页动态刷新频率
|
||||
*/
|
||||
private int dynamicRefresh;
|
||||
|
||||
public static IInitialModel get() {
|
||||
if (model == null) {
|
||||
@@ -244,6 +253,10 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
// 家长模式
|
||||
this.teenagerMode = initInfo.getTeenagerMode();
|
||||
|
||||
this.roomRefresh = initInfo.getRoomRefresh();
|
||||
|
||||
this.dynamicRefresh = initInfo.getDynamicRefresh();
|
||||
|
||||
// 客户端更新 URL
|
||||
if (initInfo.getUpdateUrl() != null &&
|
||||
!TextUtils.isEmpty(initInfo.getUpdateUrl().getAndroidUrl())) {
|
||||
@@ -252,6 +265,7 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
|
||||
// 候选域名名单更新
|
||||
DemoCache.saveInitDataApiHost(initInfo.getDomainList());
|
||||
|
||||
}
|
||||
|
||||
public String getPublicChatHallUid() {
|
||||
@@ -435,6 +449,16 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
return teenagerMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRoomRefresh() {
|
||||
return roomRefresh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDynamicRefresh() {
|
||||
return dynamicRefresh;
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
* 客户端初始化
|
||||
|
@@ -60,6 +60,11 @@ public class InitInfo implements Serializable {
|
||||
// 实名认证引导类型,0:不提示,1:强制,2:强引导
|
||||
private int certificationType;
|
||||
|
||||
//首页动态刷新频率
|
||||
private int dynamicRefresh;
|
||||
//首页房间刷新频率
|
||||
private int roomRefresh;
|
||||
|
||||
private boolean gameSwitch;//游戏入口开关
|
||||
private boolean gameRankSwitch;//游戏入口开关
|
||||
|
||||
|
Reference in New Issue
Block a user