首页更多房间
This commit is contained in:
@@ -603,6 +603,10 @@
|
||||
android:name=".home.activity.CollectionRoomActivity"
|
||||
android:label="收藏房间"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".home.activity.HomeMoreRoomActivity"
|
||||
android:label="房间"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".ui.wallet.WalletActivity"
|
||||
android:label="我的钱包"
|
||||
|
@@ -204,7 +204,7 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
mTitleBar.setLeftImageResource(
|
||||
whiteModel ? R.drawable.arrow_left_white : R.drawable.arrow_left);
|
||||
mTitleBar.setCommonBackgroundColor(getResources().getColor(
|
||||
whiteModel ? R.color.transparent : R.color.white)
|
||||
whiteModel ? R.color.transparent : R.color.transparent)
|
||||
);
|
||||
mTitleBar.setLeftClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@@ -0,0 +1,137 @@
|
||||
package com.yizhuan.erban.home.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter;
|
||||
import com.yizhuan.erban.home.bean.HomeTagInfo;
|
||||
import com.yizhuan.erban.home.fragment.HomeTabMapFragment;
|
||||
import com.yizhuan.erban.home.model.HomeModel;
|
||||
import com.yizhuan.erban.ui.widget.OnPageSelectedListener;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class HomeMoreRoomActivity extends BaseActivity implements MainMagicIndicatorAdapter.OnItemSelectListener {
|
||||
|
||||
@BindView(R.id.magic_indicator)
|
||||
MagicIndicator magicIndicator;
|
||||
@BindView(R.id.view_pager)
|
||||
ViewPager viewPager;
|
||||
|
||||
private List<Fragment> mFragments;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_home_more_room);
|
||||
ButterKnife.bind(this);
|
||||
initTitleBar("房间",true);
|
||||
initRoomTitleTab();
|
||||
}
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent(context, HomeMoreRoomActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
private void initRoomTitleTab() {
|
||||
List<CharSequence> mTabInfoList = new ArrayList<>();
|
||||
if (!ListUtils.isListEmpty(mFragments)) {
|
||||
mFragments.clear();
|
||||
}
|
||||
mFragments = new ArrayList<>();
|
||||
|
||||
HomeModel.get().getHomeTag().subscribe((serviceResult, throwable) -> {
|
||||
if (throwable != null) {
|
||||
} else {
|
||||
List<HomeTagInfo> info = serviceResult;
|
||||
for (int i = 0; i < info.size(); i++) {
|
||||
//过滤对象是空和没有标签名同时也没有子标签的情况
|
||||
CharSequence title;
|
||||
int tabId;
|
||||
Fragment fragment;
|
||||
String name = info.get(i).getName();
|
||||
if (name != null) {
|
||||
name = name.trim();
|
||||
}
|
||||
title = name;
|
||||
tabId = info.get(i).getId();
|
||||
fragment = HomeTabMapFragment.newInstance(tabId);
|
||||
mFragments.add(fragment);
|
||||
mTabInfoList.add(title);
|
||||
}
|
||||
|
||||
CommonNavigator commonNavigator = new CommonNavigator(HomeMoreRoomActivity.this);
|
||||
MainMagicIndicatorAdapter magicIndicatorAdapter = new MainMagicIndicatorAdapter(HomeMoreRoomActivity.this, mTabInfoList);
|
||||
magicIndicatorAdapter.setOnItemSelectListener(this);
|
||||
|
||||
commonNavigator.setAdapter(magicIndicatorAdapter);
|
||||
magicIndicator.setNavigator(commonNavigator);
|
||||
|
||||
commonNavigator.getTitleContainer().setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
|
||||
|
||||
viewPager.setOffscreenPageLimit(5);
|
||||
viewPager.setAdapter(new RoomContributeListAdapter(getSupportFragmentManager(),mFragments));
|
||||
viewPager.addOnPageChangeListener(new OnPageSelectedListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
||||
}
|
||||
});
|
||||
ViewPagerHelper.bind(magicIndicator, viewPager);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// protected boolean needSteepStateBar() {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void setStatusBar() {
|
||||
// super.setStatusBar();
|
||||
// StatusBarUtil.transparencyBar(this);
|
||||
// StatusBarUtil.StatusBarLightMode(this);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position, TextView view) {
|
||||
// if (mHomeTitleInfos == null) {
|
||||
// return;
|
||||
// }
|
||||
if (mFragments == null || mFragments.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Fragment fragment = mFragments.get(position);
|
||||
if (fragment == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
viewPager.setCurrentItem(position);
|
||||
|
||||
}
|
||||
}
|
@@ -10,8 +10,10 @@ import android.widget.TextView;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.community.dynamic.view.DynamicDetailActivity;
|
||||
import com.yizhuan.erban.community.widget.DynamicNickDetailWidget;
|
||||
import com.yizhuan.erban.home.bean.HomePlayInfo;
|
||||
@@ -44,16 +46,52 @@ public class HomePlayAdapter extends BaseQuickAdapter<HomePlayInfo, BaseViewHold
|
||||
|
||||
helper.setText(R.id.tv_online_num,item.getOnlineNum()+"")
|
||||
.setText(R.id.tv_title,item.getTitle());
|
||||
// for (int i = 0; i < item.getMicUsers().size(); i++) {
|
||||
// ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_mic_user_one), item.getMicUsers().get(i).getAvatar());
|
||||
// ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_mic_user_two), item.getMicUsers().get(1).getAvatar());
|
||||
// ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_mic_user_three), item.getMicUsers().get(2).getAvatar());
|
||||
// ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_mic_user_four), item.getMicUsers().get(3).getAvatar());
|
||||
// ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_mic_user_five), item.getMicUsers().get(4).getAvatar());
|
||||
// }
|
||||
if (item.getMicUsers().size() < 5){
|
||||
for (int i = 0; i < 5 - item.getMicUserCount(); i++) {
|
||||
HomePlayInfo.MicUsersBean micUsersBean = new HomePlayInfo.MicUsersBean();
|
||||
micUsersBean.setAvatar("");
|
||||
item.getMicUsers().add(micUsersBean);
|
||||
}
|
||||
}
|
||||
|
||||
CircleImageView userOne = helper.getView(R.id.iv_mic_user_one);
|
||||
CircleImageView userTwo = helper.getView(R.id.iv_mic_user_two);
|
||||
CircleImageView userThree = helper.getView(R.id.iv_mic_user_three);
|
||||
CircleImageView userFour = helper.getView(R.id.iv_mic_user_four);
|
||||
CircleImageView userFive = helper.getView(R.id.iv_mic_user_five);
|
||||
|
||||
|
||||
GlideApp.with(mContext)
|
||||
.load(item.getMicUsers().get(0).getAvatar())
|
||||
.placeholder(R.drawable.ic_home_play_empty)
|
||||
.error(R.drawable.ic_home_play_empty)
|
||||
.into(userOne);
|
||||
|
||||
GlideApp.with(mContext)
|
||||
.load(item.getMicUsers().get(1).getAvatar())
|
||||
.placeholder(R.drawable.ic_home_play_empty)
|
||||
.error(R.drawable.ic_home_play_empty)
|
||||
.into(userTwo);
|
||||
|
||||
GlideApp.with(mContext)
|
||||
.load(item.getMicUsers().get(2).getAvatar())
|
||||
.placeholder(R.drawable.ic_home_play_empty)
|
||||
.error(R.drawable.ic_home_play_empty)
|
||||
.into(userThree);
|
||||
|
||||
GlideApp.with(mContext)
|
||||
.load(item.getMicUsers().get(3).getAvatar())
|
||||
.placeholder(R.drawable.ic_home_play_empty)
|
||||
.error(R.drawable.ic_home_play_empty)
|
||||
.into(userFour);
|
||||
|
||||
GlideApp.with(mContext)
|
||||
.load(item.getMicUsers().get(4).getAvatar())
|
||||
.placeholder(R.drawable.ic_home_play_empty)
|
||||
.error(R.drawable.ic_home_play_empty)
|
||||
.into(userFive);
|
||||
|
||||
helper.getView(R.id.ll_join).setOnClickListener(v -> AVRoomActivity.start(mContext,item.getUid()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
@@ -61,6 +62,7 @@ import com.yizhuan.erban.base.list.CommonAdapter;
|
||||
import com.yizhuan.erban.bindadapter.BaseAdapter;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.databinding.FragmentGameHomeBinding;
|
||||
import com.yizhuan.erban.home.activity.HomeMoreRoomActivity;
|
||||
import com.yizhuan.erban.home.adapter.BannerAdapter;
|
||||
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter;
|
||||
import com.yizhuan.erban.home.bean.HomeTagInfo;
|
||||
@@ -162,11 +164,9 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
};
|
||||
//声明AMapLocationClientOption对象
|
||||
public AMapLocationClientOption mLocationOption = null;
|
||||
private List<HomeTitleInfo> mHomeTitleInfos;
|
||||
|
||||
private List<Fragment> mFragments;
|
||||
private volatile boolean isUserLogin;
|
||||
private volatile boolean initHomeTitle;
|
||||
|
||||
|
||||
/**
|
||||
* 动态
|
||||
@@ -209,14 +209,14 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
SharedPreferenceUtils.put("sign_entrance_" + AuthModel.get().getCurrentUid(), 1);
|
||||
break;
|
||||
|
||||
case R.id.layout_empty:
|
||||
getHomeBannerInfo();
|
||||
break;
|
||||
|
||||
//首页榜单
|
||||
case R.id.iv_ranking:
|
||||
CommonWebViewActivity.start(mContext, "http://apibeta.qxjiaoyou.com/modules/erbanRank/index.html");
|
||||
break;
|
||||
|
||||
case R.id.tv_room_more:
|
||||
HomeMoreRoomActivity.start(mContext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,12 +246,14 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
isUserLogin = AuthModel.get().getCurrentUid() != 0;
|
||||
mBinding.rollView.setVisibility(View.GONE);
|
||||
|
||||
//轻寻获取首页数据的接口
|
||||
getHomeBannerInfo();
|
||||
|
||||
initLocation();
|
||||
initGuide();
|
||||
initRefreshView();
|
||||
if (isUserLogin) {
|
||||
initRoomTitleTab();
|
||||
initTitleTab();
|
||||
initBanner();
|
||||
}
|
||||
}
|
||||
|
||||
private void initRefreshView() {
|
||||
@@ -265,6 +267,8 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
|
||||
mBinding.refreshLayout.setOnRefreshListener(() -> {
|
||||
mBinding.refreshLayout.setRefreshing(false);
|
||||
initRoomTitleTab();
|
||||
initBanner();
|
||||
EventBus.getDefault().post(new RefreshHomeDataEvent());
|
||||
});
|
||||
}
|
||||
@@ -287,94 +291,11 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
mLocationClient.setLocationOption(mLocationOption);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化tab
|
||||
*/
|
||||
// private void initRoomTitleTab(List<HomeTitleInfo> homeTitleInfos) {
|
||||
// if (ListUtils.isListEmpty(homeTitleInfos)) {
|
||||
// return;
|
||||
// }
|
||||
// initHomeTitle = true;
|
||||
// UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
// int gender = 3;
|
||||
// if (userInfo != null) {
|
||||
// gender = userInfo.getGender();
|
||||
// }
|
||||
// List<CharSequence> mTabInfoList = new ArrayList<>();
|
||||
// if (!ListUtils.isListEmpty(mFragments)) {
|
||||
// mFragments.clear();
|
||||
// }
|
||||
// mFragments = new ArrayList<>();
|
||||
//
|
||||
// // 审核中模式去掉这个 tab
|
||||
// if (MarketVerifyModel.get().isMarketChecking()) {
|
||||
// Iterator<HomeTitleInfo> iterator = homeTitleInfos.iterator();
|
||||
// while (iterator.hasNext()) {
|
||||
// HomeTitleInfo next = iterator.next();
|
||||
// // 没法准确判断「合拍男神女神」只能是把第一个可以下拉的 item 给删除掉
|
||||
// if (!ListUtils.isListEmpty(next.getOpts())) {
|
||||
// iterator.remove();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (HomeTitleInfo homeTitleInfo : homeTitleInfos) {
|
||||
// //过滤对象是空和没有标签名同时也没有子标签的情况
|
||||
// if (homeTitleInfo == null || (TextUtils.isEmpty(homeTitleInfo.getName()) && !homeTitleInfo.hasSubTitle())) {
|
||||
// continue;
|
||||
// }
|
||||
// Log.e(TAG, "initTitleTab: " + homeTitleInfo);
|
||||
// HomeTitleInfo defaultValue = homeTitleInfo.getDefault(gender);
|
||||
// CharSequence title;
|
||||
// int tabId;
|
||||
// Fragment fragment;
|
||||
// if (defaultValue != null) {
|
||||
// String name = defaultValue.getName();
|
||||
// if (name != null) {
|
||||
// name = name.trim();
|
||||
// }
|
||||
// title = getArrowSpannableString(false, name);
|
||||
// tabId = defaultValue.getId();
|
||||
// fragment = RecommendationFragment.newInstance(String.valueOf(tabId));
|
||||
//
|
||||
// } else {
|
||||
// String name = homeTitleInfo.getName();
|
||||
// if (name != null) {
|
||||
// name = name.trim();
|
||||
// }
|
||||
// title = name;
|
||||
// tabId = homeTitleInfo.getTabId();
|
||||
// fragment = HomeOtherTabFragment.newInstance(tabId);
|
||||
// }
|
||||
// mFragments.add(fragment);
|
||||
// mTabInfoList.add(title);
|
||||
// }
|
||||
//
|
||||
// CommonNavigator commonNavigator = new CommonNavigator(getContext());
|
||||
// MainMagicIndicatorAdapter magicIndicatorAdapter = new MainMagicIndicatorAdapter(getContext(), mTabInfoList);
|
||||
// magicIndicatorAdapter.setOnItemSelectListener(this);
|
||||
// commonNavigator.setAdapter(magicIndicatorAdapter);
|
||||
// mBinding.magicIndicator.setNavigator(commonNavigator);
|
||||
// commonNavigator.getTitleContainer().setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
|
||||
//
|
||||
// mBinding.viewPager.setOffscreenPageLimit(5);
|
||||
// mBinding.viewPager.setAdapter(new RoomContributeListAdapter(getChildFragmentManager(), mFragments));
|
||||
// mBinding.viewPager.addOnPageChangeListener(new OnPageSelectedListener() {
|
||||
// @Override
|
||||
// public void onPageSelected(int position) {
|
||||
// mLastPosition = position;
|
||||
// }
|
||||
// });
|
||||
// ViewPagerHelper.bind(mBinding.magicIndicator, mBinding.viewPager);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 测试tab
|
||||
*/
|
||||
|
||||
private void initRoomTitleTab() {
|
||||
initHomeTitle = true;
|
||||
List<CharSequence> mTabInfoList = new ArrayList<>();
|
||||
if (!ListUtils.isListEmpty(mFragments)) {
|
||||
mFragments.clear();
|
||||
@@ -396,7 +317,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
}
|
||||
title = name;
|
||||
tabId = info.get(i).getId();
|
||||
fragment = HomeTabMapFragment.newInstance(tabId);
|
||||
fragment = HomeTabHomeFragment.newInstance(tabId);
|
||||
mFragments.add(fragment);
|
||||
mTabInfoList.add(title);
|
||||
}
|
||||
@@ -676,19 +597,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
|
||||
@Override
|
||||
public void showByMarketCheckingStatus(List<TagListInfo> tagListInfoList) {
|
||||
if (MarketVerifyModel.get().isMarketChecking() && mHomeTitleInfos != null) {
|
||||
Iterator<HomeTitleInfo> iterator = mHomeTitleInfos.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
HomeTitleInfo next = iterator.next();
|
||||
// 没法准确判断「合拍男神女神」只能是把第一个可以下拉的 item 给删除掉
|
||||
if (!ListUtils.isListEmpty(next.getOpts())) {
|
||||
iterator.remove();
|
||||
initHomeTitle = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
refreshData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -703,9 +612,9 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
|
||||
@Override
|
||||
public void onItemSelect(int position, TextView view) {
|
||||
if (mHomeTitleInfos == null) {
|
||||
return;
|
||||
}
|
||||
// if (mHomeTitleInfos == null) {
|
||||
// return;
|
||||
// }
|
||||
if (mFragments == null || mFragments.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -849,14 +758,11 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
// mBinding.layoutEmpty.setVisibility(View.VISIBLE);
|
||||
// return;
|
||||
// }
|
||||
mBinding.layoutEmpty.setVisibility(View.GONE);
|
||||
initHomeBanner(homeBannerInfo.getFirstPageBannerVos());
|
||||
this.mHomeTitleInfos = homeBannerInfo.getAllVo();
|
||||
if (isUserLogin) {
|
||||
initRoomTitleTab();
|
||||
initTitleTab();
|
||||
}
|
||||
initQxTopBanner(homeBannerInfo.getTopBanners());
|
||||
|
||||
// initHomeBanner(homeBannerInfo.getFirstPageBannerVos());
|
||||
// this.mHomeTitleInfos = homeBannerInfo.getAllVo();
|
||||
|
||||
// initQxTopBanner(homeBannerInfo.getTopBanners());
|
||||
|
||||
}
|
||||
|
||||
@@ -980,16 +886,10 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
|
||||
private void refreshData() {
|
||||
isUserLogin = true;
|
||||
if (!initHomeTitle && mHomeTitleInfos != null) {
|
||||
initRoomTitleTab();
|
||||
initTitleTab();
|
||||
|
||||
}
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
//登录的时候显示位置,更好的
|
||||
Log.i("startLocation", "refreshData");
|
||||
startLocation();
|
||||
|
||||
// 超管不展示开房按钮
|
||||
mBinding.setOpenVisible(!(userInfo != null && userInfo.getPlatformRole() == 1));
|
||||
}
|
||||
@@ -1113,8 +1013,20 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
}
|
||||
|
||||
|
||||
public void initQxTopBanner(List<BannerInfo> bannerList) {
|
||||
public void initBanner() {
|
||||
HomeModel.get().getHomeBanner("1").subscribe((serviceResult, throwable) -> {
|
||||
if (throwable != null) {
|
||||
} else {
|
||||
List<BannerInfo> info = serviceResult;
|
||||
setBanner(info);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void setBanner(List<BannerInfo> bannerList){
|
||||
//审核中状态,去掉跳转房间banner
|
||||
if (MarketVerifyModel.get().isMarketChecking()) {
|
||||
Iterator<BannerInfo> iterator = bannerList.iterator();
|
||||
@@ -1164,7 +1076,6 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
mBinding.rollView.setAnimationDurtion(500);
|
||||
mBinding.rollView.setVisibility(View.VISIBLE);
|
||||
bannerAdapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
|
@@ -0,0 +1,167 @@
|
||||
package com.yizhuan.erban.home.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.trello.rxlifecycle2.android.FragmentEvent;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseFragment;
|
||||
import com.yizhuan.erban.common.NoDataFragment;
|
||||
import com.yizhuan.erban.home.adapter.HomeRoomFragmentAdapter;
|
||||
import com.yizhuan.erban.home.model.HomeModel;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeItem;
|
||||
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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CancellationException;
|
||||
|
||||
/**
|
||||
* 语音排队 没用下拉式的tab
|
||||
*/
|
||||
public class HomeTabHomeFragment extends BaseFragment {
|
||||
public static final int ROWS = 3;
|
||||
private static final String PARAM_TAB_ID = "tabId";
|
||||
private RecyclerView recyclerView;
|
||||
private String tabId;
|
||||
private HomeRoomFragmentAdapter mHomeRoomAdapter;
|
||||
private final Object lock = new Object();
|
||||
/**
|
||||
* 是否包含了banner
|
||||
*/
|
||||
private boolean isContainsBanner = false;
|
||||
|
||||
/**
|
||||
* 用于显示的数据
|
||||
*/
|
||||
private List<HomeItem> totalHomeItemList = new ArrayList<>();
|
||||
|
||||
public static HomeTabHomeFragment newInstance(int tabId) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString(PARAM_TAB_ID, String.valueOf(tabId));
|
||||
HomeTabHomeFragment fragment = new HomeTabHomeFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public HomeTabHomeFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
tabId = getArguments().getString(PARAM_TAB_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_home_room_tab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
super.onFindViews();
|
||||
recyclerView = mView.findViewById(R.id.recycler_view);
|
||||
|
||||
initRecyclerView();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*/
|
||||
private void refreshData() {
|
||||
getData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 请求数据
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void getData() {
|
||||
HomeModel.get()
|
||||
.getHomeTabHome(tabId)
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe((serviceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
if (ListUtils.isListEmpty(serviceResult)) {
|
||||
showNoData();
|
||||
mHomeRoomAdapter.notifyDataSetChanged();
|
||||
}
|
||||
mHomeRoomAdapter.setNewData(serviceResult);
|
||||
mHomeRoomAdapter.notifyDataSetChanged();
|
||||
|
||||
} else {
|
||||
if (!(throwable instanceof CancellationException)) {
|
||||
toast("请求失败,请稍后再试!!" + throwable.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
recyclerView.setItemAnimator(null);
|
||||
mHomeRoomAdapter = new HomeRoomFragmentAdapter(getContext());
|
||||
mHomeRoomAdapter.setEnableLoadMore(false);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), ROWS);
|
||||
mHomeRoomAdapter.setEnableLoadMore(false);
|
||||
recyclerView.setLayoutManager(gridLayoutManager);
|
||||
recyclerView.setAdapter(mHomeRoomAdapter);
|
||||
|
||||
View emptyView = getLayoutInflater().inflate(R.layout.layout_home_empty_no_header, null);
|
||||
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
emptyView.setLayoutParams(lp);
|
||||
mHomeRoomAdapter.setEmptyView(emptyView);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
}
|
||||
|
||||
@SuppressLint("ResourceType")
|
||||
@Override
|
||||
public void showNoData(View view, int drawable, CharSequence charSequence) {
|
||||
if (!checkActivityValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (view == null) {
|
||||
MLog.error(this, "xuwakao, showNoData view is NULL");
|
||||
return;
|
||||
}
|
||||
View status = view.findViewById(R.id.status_layout);
|
||||
if (status == null || status.getId() <= 0) {
|
||||
MLog.error(this, "xuwakao, had not set layout id ");
|
||||
return;
|
||||
}
|
||||
NoDataFragment fragment = NoDataFragment.newInstance(R.layout.layout_home_empty_no_header, drawable, charSequence);
|
||||
fragment.setListener(getLoadListener());
|
||||
getChildFragmentManager().beginTransaction().replace(status.getId(), fragment, STATUS_TAG).commitAllowingStateLoss();
|
||||
}
|
||||
}
|
@@ -25,17 +25,17 @@ import java.util.List;
|
||||
import java.util.concurrent.CancellationException;
|
||||
|
||||
/**
|
||||
* 语音排队 没用下拉式的tab
|
||||
*
|
||||
*/
|
||||
public class HomeTabMapFragment extends BaseFragment {
|
||||
public static final int ROWS = 3;
|
||||
public static final int ROWS = 2;
|
||||
private static final String PARAM_TAB_ID = "tabId";
|
||||
private RecyclerView recyclerView;
|
||||
private String tabId;
|
||||
private int pageIndex = 1;
|
||||
private static final int PAGE_SIZE = 20;
|
||||
private HomeRoomFragmentAdapter mHomeRoomAdapter;
|
||||
private final Object lock = new Object();
|
||||
private static final int PAGE = 1;
|
||||
private static final int PAGE_SIZE = 20;
|
||||
/**
|
||||
* 是否包含了banner
|
||||
*/
|
||||
@@ -70,16 +70,14 @@ public class HomeTabMapFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_home_room_tab;
|
||||
return R.layout.fragment_home_tab_map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
super.onFindViews();
|
||||
recyclerView = mView.findViewById(R.id.recycler_view);
|
||||
|
||||
initRecyclerView();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -90,15 +88,13 @@ public class HomeTabMapFragment extends BaseFragment {
|
||||
getData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 请求数据
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void getData() {
|
||||
HomeModel.get()
|
||||
.getHomeTabMap(tabId,pageIndex, PAGE_SIZE)
|
||||
.getHomeTabMap(tabId,PAGE,PAGE_SIZE)
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe((serviceResult, throwable) -> {
|
||||
|
@@ -8,6 +8,7 @@ import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.community.CommunityConstant;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||
|
||||
@@ -50,13 +51,30 @@ public class HomeModel extends BaseModel {
|
||||
}
|
||||
|
||||
public Single<List<HomeTabMapInfo>> getHomeTabMap(String tabId, int page, int pageSize) {
|
||||
return api.apiHomeTabMap(tabId,String.valueOf(page),String.valueOf(pageSize),String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
return api.apiHomeTabMap(tabId, String.valueOf(page), String.valueOf(pageSize), String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
CommunityConstant.VERSION_VALID_TYPE,
|
||||
AuthModel.get().getTicket())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
public Single<List<HomeTabMapInfo>> getHomeTabHome(String tabId) {
|
||||
return api.apiHomeTabHome(tabId,String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
CommunityConstant.VERSION_VALID_TYPE,
|
||||
AuthModel.get().getTicket())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
public Single<List<BannerInfo>> getHomeBanner(String type) {
|
||||
return api.apiHomeBanner(type,String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
CommunityConstant.VERSION_VALID_TYPE,
|
||||
AuthModel.get().getTicket())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
|
||||
private static final class Helper {
|
||||
public static final HomeModel INSTANCE = new HomeModel();
|
||||
}
|
||||
@@ -89,12 +107,30 @@ public class HomeModel extends BaseModel {
|
||||
@Query("types") String types,
|
||||
@Query("ticket") String ticket);
|
||||
|
||||
|
||||
/**
|
||||
* 首页推荐房间标签
|
||||
* @param uid
|
||||
* @param types
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/tag")
|
||||
Single<ServiceResult<List<HomeTagInfo>>> apiHomeTag(
|
||||
@Query("uid") String uid,
|
||||
@Query("types") String types,
|
||||
@Query("ticket") String ticket);
|
||||
|
||||
/**
|
||||
* 首页更多房间
|
||||
* @param tabId
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @param uid
|
||||
* @param types
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/tab/map")
|
||||
Single<ServiceResult<List<HomeTabMapInfo>>> apiHomeTabMap(
|
||||
@Query("tabId") String tabId,
|
||||
@@ -103,6 +139,37 @@ public class HomeModel extends BaseModel {
|
||||
@Query("uid") String uid,
|
||||
@Query("types") String types,
|
||||
@Query("ticket") String ticket);
|
||||
|
||||
/**
|
||||
* 首页推荐房间
|
||||
* @param tabId
|
||||
* @param uid
|
||||
* @param types
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/tab/home")
|
||||
Single<ServiceResult<List<HomeTabMapInfo>>> apiHomeTabHome(
|
||||
@Query("tabId") String tabId,
|
||||
@Query("uid") String uid,
|
||||
@Query("types") String types,
|
||||
@Query("ticket") String ticket);
|
||||
|
||||
/**
|
||||
* 首页Banner
|
||||
* @param type
|
||||
* @param uid
|
||||
* @param types
|
||||
* @param ticket
|
||||
* @return
|
||||
*/
|
||||
@GET("/home/banner")
|
||||
Single<ServiceResult<List<BannerInfo>>> apiHomeBanner(
|
||||
@Query("type") String type,
|
||||
@Query("uid") String uid,
|
||||
@Query("types") String types,
|
||||
@Query("ticket") String ticket);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ public class LoginCodeActivity extends BaseLoginAct {
|
||||
onFindViews();
|
||||
initData();
|
||||
onSetListener();
|
||||
getSmsCode();
|
||||
// getSmsCode();
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
@@ -0,0 +1,60 @@
|
||||
package com.yizhuan.erban.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ViewConfiguration;
|
||||
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
public class VpSwipeRefreshLayout extends SwipeRefreshLayout {
|
||||
|
||||
private float startY;
|
||||
private float startX;
|
||||
// 记录viewPager是否拖拽的标记
|
||||
private boolean mIsVpDragger;
|
||||
private final int mTouchSlop;
|
||||
|
||||
public VpSwipeRefreshLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
int action = ev.getAction();
|
||||
switch (action) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
// 记录手指按下的位置
|
||||
startY = ev.getY();
|
||||
startX = ev.getX();
|
||||
// 初始化标记
|
||||
mIsVpDragger = false;
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
// 如果viewpager正在拖拽中,那么不拦截它的事件,直接return false;
|
||||
if(mIsVpDragger) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取当前手指位置
|
||||
float endY = ev.getY();
|
||||
float endX = ev.getX();
|
||||
float distanceX = Math.abs(endX - startX);
|
||||
float distanceY = Math.abs(endY - startY);
|
||||
// 如果X轴位移大于Y轴位移,那么将事件交给viewPager处理。
|
||||
if(distanceX > mTouchSlop && distanceX > distanceY) {
|
||||
mIsVpDragger = true;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
// 初始化标记
|
||||
mIsVpDragger = false;
|
||||
break;
|
||||
}
|
||||
// 如果是Y轴位移大于X轴,事件交给swipeRefreshLayout处理。
|
||||
return super.onInterceptTouchEvent(ev);
|
||||
}
|
||||
}
|
44
app/src/main/res/layout/activity_home_more_room.xml
Normal file
44
app/src/main/res/layout/activity_home_more_room.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_F9F9F9"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/bg_home_top"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.yizhuan.erban.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
/>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
app:layout_constraintTop_toBottomOf="@id/magic_indicator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -15,7 +15,7 @@
|
||||
type="Boolean" />
|
||||
</data>
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
<com.yizhuan.erban.utils.VpSwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
@@ -54,14 +54,8 @@
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentScrim="#6956F0"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
app:contentScrim="@color/appColor"
|
||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed|exitUntilCollapsed">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -76,23 +70,46 @@
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:paddingLeft="14dp"
|
||||
android:paddingRight="14dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
android:paddingLeft="14dp"
|
||||
android:paddingRight="15dp"
|
||||
>
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/magic_indicator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center"
|
||||
android:text="更多房间"
|
||||
android:onClick="@{click}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_12"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:drawableRight="@drawable/arrow_right_white"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
app:layout_constraintTop_toBottomOf="@id/magic_indicator"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_indicator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
@@ -137,15 +154,12 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentInsetStart="0dp"
|
||||
app:layout_collapseMode="pin">
|
||||
app:layout_collapseMode="pin"
|
||||
>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -269,37 +283,8 @@
|
||||
</com.yizhuan.erban.common.widget.DragLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_empty"
|
||||
android:onClick="@{click}"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_bg_top"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_marginTop="100dp"
|
||||
android:id="@+id/no_data_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_common_failure" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_data_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_list_data"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</com.yizhuan.erban.utils.VpSwipeRefreshLayout>
|
||||
|
||||
</layout>
|
24
app/src/main/res/layout/fragment_home_tab_map.xml
Normal file
24
app/src/main/res/layout/fragment_home_tab_map.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.yizhuan.erban.home.fragment.HomeOtherTabFragment">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:paddingStart="12.5dp"
|
||||
android:paddingEnd="12.5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</LinearLayout>
|
Reference in New Issue
Block a user