Merge remote-tracking branch 'origin/develop_new' into develop_new
# Conflicts: # app/src/main/java/com/yizhuan/erban/MainActivity.java
@@ -29,15 +29,16 @@ public class HomeRoomFragmentAdapter extends BaseMultiItemQuickAdapter<HomeTabMa
|
|||||||
|
|
||||||
private int mBadgeHeight;
|
private int mBadgeHeight;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
private boolean mIsHome;
|
||||||
/**
|
/**
|
||||||
* 校验跳转房间的频率
|
* 校验跳转房间的频率
|
||||||
*/
|
*/
|
||||||
public HomeRoomFragmentAdapter(Context context, List<HomeTabMapInfo> data) {
|
public HomeRoomFragmentAdapter(Context context, List<HomeTabMapInfo> data,boolean isHome) {
|
||||||
super(data);
|
super(data);
|
||||||
addItemType(HomeTabMapInfo.TYPE_NORMAL,R.layout.item_home_tab_map);
|
addItemType(HomeTabMapInfo.TYPE_NORMAL,R.layout.item_home_tab_map);
|
||||||
addItemType(HomeTabMapInfo.TYPE_EMPTY,R.layout.item_erban_grid_empty);
|
addItemType(HomeTabMapInfo.TYPE_EMPTY,R.layout.item_erban_grid_empty);
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
|
this.mIsHome = isHome;
|
||||||
mBadgeHeight = (int) context.getResources().getDimension(R.dimen.tag_height);
|
mBadgeHeight = (int) context.getResources().getDimension(R.dimen.tag_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,14 +62,23 @@ public class HomeRoomFragmentAdapter extends BaseMultiItemQuickAdapter<HomeTabMa
|
|||||||
helper.setText(R.id.tv_online_number,item.getOnlineNum()+"")
|
helper.setText(R.id.tv_online_number,item.getOnlineNum()+"")
|
||||||
.setText(R.id.tv_title, item.getRoomTitle());
|
.setText(R.id.tv_title, item.getRoomTitle());
|
||||||
// helper.getView(R.id.lock_bg).setVisibility(!TextUtils.isEmpty(homeRoom.getRoomPwd()) ? View.VISIBLE : View.GONE);
|
// helper.getView(R.id.lock_bg).setVisibility(!TextUtils.isEmpty(homeRoom.getRoomPwd()) ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
|
helper.setGone(R.id.iv_tab_label, mIsHome);
|
||||||
|
helper.setGone(R.id.tv_tag_content, mIsHome && !TextUtils.isEmpty(item.getIconContent())).setText(R.id.tv_tag_content,item.getIconContent());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ImageView mIvTabLabel = helper.getView(R.id.iv_tab_label);
|
ImageView mIvTabLabel = helper.getView(R.id.iv_tab_label);
|
||||||
if (!TextUtils.isEmpty(item.getTagPict())) {
|
if (!TextUtils.isEmpty(item.getTagPict()) && !mIsHome) {
|
||||||
mIvTabLabel.setVisibility(View.VISIBLE);
|
mIvTabLabel.setVisibility(View.VISIBLE);
|
||||||
ImageLoadUtils.loadAvatarBig(item.getTagPict(), mIvTabLabel);
|
ImageLoadUtils.loadAvatarBig(item.getTagPict(), mIvTabLabel);
|
||||||
} else {
|
} else {
|
||||||
mIvTabLabel.setVisibility(View.GONE);
|
mIvTabLabel.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ImageView ivCover = helper.getView(R.id.iv_cover);
|
ImageView ivCover = helper.getView(R.id.iv_cover);
|
||||||
if (!TextUtils.isEmpty(item.getAvatar())) {
|
if (!TextUtils.isEmpty(item.getAvatar())) {
|
||||||
ImageLoadUtils.loadAvatarBig(item.getAvatar(), ivCover, R.drawable.default_cover);
|
ImageLoadUtils.loadAvatarBig(item.getAvatar(), ivCover, R.drawable.default_cover);
|
||||||
|
@@ -25,6 +25,15 @@ public class HomeTabMapInfo implements MultiItemEntity, Serializable {
|
|||||||
public static final int TYPE_NORMAL = 1;
|
public static final int TYPE_NORMAL = 1;
|
||||||
private int itemType=0;
|
private int itemType=0;
|
||||||
private String tagPict;
|
private String tagPict;
|
||||||
|
private String iconContent;
|
||||||
|
|
||||||
|
public String getIconContent() {
|
||||||
|
return iconContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIconContent(String iconContent) {
|
||||||
|
this.iconContent = iconContent;
|
||||||
|
}
|
||||||
|
|
||||||
public String getTagPict() {
|
public String getTagPict() {
|
||||||
return tagPict;
|
return tagPict;
|
||||||
|
@@ -23,6 +23,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
@@ -96,6 +97,7 @@ import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
|||||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||||
|
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||||
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@@ -203,7 +205,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
|
|
||||||
//首页榜单
|
//首页榜单
|
||||||
case R.id.iv_ranking:
|
case R.id.iv_ranking:
|
||||||
CommonWebViewActivity.start(mContext, "http://apibeta.qxjiaoyou.com/modules/erbanRank/index.html");
|
CommonWebViewActivity.start(mContext, UriProvider.getRanking());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.tv_room_more:
|
case R.id.tv_room_more:
|
||||||
@@ -243,30 +245,10 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
initRefreshView();
|
initRefreshView();
|
||||||
initTitleTab();
|
initTitleTab();
|
||||||
initRoomConcern();
|
initRoomConcern();
|
||||||
initAppBarListioner();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initAppBarListioner() {
|
|
||||||
// mBinding.appBar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
|
|
||||||
// if (verticalOffset == 0)
|
|
||||||
// {
|
|
||||||
// LogUtils.e("展开状态");
|
|
||||||
// mBinding.collapsingLayout.setContentScrim(null);
|
|
||||||
// }
|
|
||||||
// else if (Math.abs(verticalOffset) >= appBarLayout.getTotalScrollRange())
|
|
||||||
// {
|
|
||||||
// LogUtils.e("折叠状态");
|
|
||||||
// mBinding.collapsingLayout.setContentScrimResource(R.color.color_7154EE);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// LogUtils.e("中间状态");
|
|
||||||
// mBinding.collapsingLayout.setContentScrimResource(R.color.color_7154EE);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRefreshView() {
|
private void initRefreshView() {
|
||||||
|
// scrollToTop();
|
||||||
mBinding.appBar.addOnOffsetChangedListener((appBarLayout, i) -> {
|
mBinding.appBar.addOnOffsetChangedListener((appBarLayout, i) -> {
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
mBinding.refreshLayout.setEnabled(true); //当滑动到顶部的时候开启
|
mBinding.refreshLayout.setEnabled(true); //当滑动到顶部的时候开启
|
||||||
@@ -347,54 +329,8 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
ViewPagerHelper.bind(mBinding.magicIndicatorBottom, mBinding.viewPagerBottom);
|
ViewPagerHelper.bind(mBinding.magicIndicatorBottom, mBinding.viewPagerBottom);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exitRoom(BaseAdapter<GameInfo> adapter, int position) {
|
|
||||||
if (DemoCache.readFirstMatchDialog()) {
|
|
||||||
DemoCache.saveFirstMatchDialog();
|
|
||||||
getDialogManager().showOkCancelDialog("匹配玩家将关闭当前房间(进房限制取消)并解散房内的用户",
|
|
||||||
true, new DialogManager.OkCancelDialogListener() {
|
|
||||||
@Override
|
|
||||||
public void onCancel() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOk() {
|
|
||||||
getDialogManager().showProgressDialog(getActivity());
|
|
||||||
AvRoomModel.get().exitRoom(new CallBack<RoomInfo>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(RoomInfo data) {
|
|
||||||
getDialogManager().dismissDialog();
|
|
||||||
MatchActivity.start(getActivity(), adapter.getItem(position));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFail(int code, String error) {
|
|
||||||
getDialogManager().dismissDialog();
|
|
||||||
toast("退出房间失败");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
getDialogManager().showProgressDialog(getActivity());
|
|
||||||
AvRoomModel.get().exitRoom(new CallBack<RoomInfo>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(RoomInfo data) {
|
|
||||||
getDialogManager().dismissDialog();
|
|
||||||
MatchActivity.start(getActivity(), adapter.getItem(position));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFail(int code, String error) {
|
|
||||||
getDialogManager().dismissDialog();
|
|
||||||
toast("退出房间失败");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void openRoom() {
|
private void openRoom() {
|
||||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||||
@@ -444,19 +380,19 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openCreateRoomTypeDialog() {
|
private void openCreateRoomTypeDialog() {
|
||||||
new CreateRoomDialog(getActivity(), new CreateRoomDialog.OpenRoomListener() {
|
// new CreateRoomDialog(getActivity(), new CreateRoomDialog.OpenRoomListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onNormalRoom() {
|
// public void onNormalRoom() {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void onCpRoom() {
|
// public void onCpRoom() {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_cp_click, "创建陪伴房");
|
// StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_cp_click, "创建陪伴房");
|
||||||
getRoomInfo(RoomInfo.ROOMTYPE_CP);
|
// getRoomInfo(RoomInfo.ROOMTYPE_CP);
|
||||||
}
|
// }
|
||||||
}).openDialog();
|
// }).openDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -594,6 +530,10 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
@Override
|
@Override
|
||||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_SEARCH_RECENT_ENTER_ROOM, "最近进房记录");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_SEARCH_RECENT_ENTER_ROOM, "最近进房记录");
|
||||||
|
if (position == 0){
|
||||||
|
openRoom();
|
||||||
|
return;
|
||||||
|
}
|
||||||
List<HomeConcernsInfo> list = adapter.getData();
|
List<HomeConcernsInfo> list = adapter.getData();
|
||||||
if (position >= 0 && position < list.size()) {
|
if (position >= 0 && position < list.size()) {
|
||||||
HomeConcernsInfo record = list.get(position);
|
HomeConcernsInfo record = list.get(position);
|
||||||
@@ -615,7 +555,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void titleListFail(String msg) {
|
public void titleListFail(String msg) {
|
||||||
|
SingleToastUtil.showToast(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -740,25 +680,6 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
|||||||
getMvpPresenter().getHomeBanner(BANNER_TYPE);
|
getMvpPresenter().getHomeBanner(BANNER_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<View> getHomeBanner(int num) {
|
|
||||||
int count = mBinding.recyclerView.getChildCount();
|
|
||||||
if (count == 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (num < count) {
|
|
||||||
count = num;
|
|
||||||
}
|
|
||||||
List<View> list = new ArrayList<>();
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
View view = mBinding.recyclerView.getChildAt(i);
|
|
||||||
if (view != null) {
|
|
||||||
list.add(view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否要显示首页引导
|
* 判断是否要显示首页引导
|
||||||
*/
|
*/
|
||||||
|
@@ -130,6 +130,7 @@ public class HomeDynamicFragment extends BaseFragment{
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
// dynamicAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
// dynamicAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
||||||
|
|
||||||
dynamicAdapter.addData(0,dynamicList.get(dynamicList.size()-1));
|
dynamicAdapter.addData(0,dynamicList.get(dynamicList.size()-1));
|
||||||
dynamicAdapter.remove(dynamicList.size()-1);
|
dynamicAdapter.remove(dynamicList.size()-1);
|
||||||
dynamicAdapter.notifyDataSetChanged();
|
dynamicAdapter.notifyDataSetChanged();
|
||||||
|
@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.coorchice.library.utils.LogUtils;
|
||||||
import com.trello.rxlifecycle2.android.FragmentEvent;
|
import com.trello.rxlifecycle2.android.FragmentEvent;
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
import com.yizhuan.erban.base.BaseFragment;
|
import com.yizhuan.erban.base.BaseFragment;
|
||||||
@@ -22,6 +23,8 @@ import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
|||||||
import com.yizhuan.xchat_android_library.utils.log.MLog;
|
import com.yizhuan.xchat_android_library.utils.log.MLog;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
@@ -35,8 +38,6 @@ public class HomeTabHomeFragment extends BaseFragment {
|
|||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
private String tabId;
|
private String tabId;
|
||||||
private HomeRoomFragmentAdapter mHomeRoomAdapter;
|
private HomeRoomFragmentAdapter mHomeRoomAdapter;
|
||||||
private final List<HomeTabMapInfo> allRoomList = new ArrayList<>();
|
|
||||||
private final int ROOM_COUNT = 6;
|
|
||||||
private Handler handler = new Handler();
|
private Handler handler = new Handler();
|
||||||
private Runnable runnable;
|
private Runnable runnable;
|
||||||
|
|
||||||
@@ -112,9 +113,23 @@ public class HomeTabHomeFragment extends BaseFragment {
|
|||||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||||
.subscribe((serviceResult, throwable) -> {
|
.subscribe((serviceResult, throwable) -> {
|
||||||
if (throwable == null) {
|
if (throwable == null) {
|
||||||
allRoomList.clear();
|
List<HomeTabMapInfo> roomsList = new ArrayList<>(serviceResult);//未处理的数
|
||||||
allRoomList.addAll(serviceResult);
|
List<HomeTabMapInfo> randomList = new ArrayList<>();//不是置顶的
|
||||||
refreshRoomData();
|
List<HomeTabMapInfo> finalList = new ArrayList<>();//最终的6条数据
|
||||||
|
|
||||||
|
for (int i = 0; i < roomsList.size(); i++) {
|
||||||
|
roomsList.get(i).setItemType(HomeTabMapInfo.TYPE_NORMAL);//对原始数据设置type
|
||||||
|
}
|
||||||
|
for (int i = 0; i < roomsList.size(); i++) {
|
||||||
|
if (roomsList.get(i).isIsTop()){
|
||||||
|
finalList.add(roomsList.get(i));
|
||||||
|
}else {
|
||||||
|
randomList.add(roomsList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sortSeqRoom(finalList);
|
||||||
|
refreshRoomData(finalList,randomList);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!(throwable instanceof CancellationException)) {
|
if (!(throwable instanceof CancellationException)) {
|
||||||
toast("请求失败,请稍后再试!!" + throwable.getMessage());
|
toast("请求失败,请稍后再试!!" + throwable.getMessage());
|
||||||
@@ -126,8 +141,10 @@ public class HomeTabHomeFragment extends BaseFragment {
|
|||||||
/**
|
/**
|
||||||
* 刷新数据
|
* 刷新数据
|
||||||
*/
|
*/
|
||||||
private void refreshRoomData(){
|
private void refreshRoomData(List<HomeTabMapInfo> finalList,List<HomeTabMapInfo> randomList){
|
||||||
mHomeRoomAdapter.setNewData(getConvertData(allRoomList));
|
List<HomeTabMapInfo> finalList1 = new ArrayList<>(finalList);//最终的6条数据
|
||||||
|
List<HomeTabMapInfo> randomList1 = new ArrayList<>(randomList);//不是置顶的
|
||||||
|
mHomeRoomAdapter.setNewData(getConvertData(finalList1,randomList1));
|
||||||
if (runnable != null){
|
if (runnable != null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -135,7 +152,7 @@ public class HomeTabHomeFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
mHomeRoomAdapter.setNewData(getConvertData(allRoomList));
|
mHomeRoomAdapter.setNewData(getConvertData(finalList1,randomList1));
|
||||||
handler.postDelayed(this, 3000);
|
handler.postDelayed(this, 3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,7 +163,7 @@ public class HomeTabHomeFragment extends BaseFragment {
|
|||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
recyclerView.setItemAnimator(null);
|
recyclerView.setItemAnimator(null);
|
||||||
mHomeRoomAdapter = new HomeRoomFragmentAdapter(getContext(),null);
|
mHomeRoomAdapter = new HomeRoomFragmentAdapter(getContext(),null,true);
|
||||||
mHomeRoomAdapter.setEnableLoadMore(false);
|
mHomeRoomAdapter.setEnableLoadMore(false);
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), ROWS);
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), ROWS);
|
||||||
mHomeRoomAdapter.setEnableLoadMore(false);
|
mHomeRoomAdapter.setEnableLoadMore(false);
|
||||||
@@ -161,29 +178,43 @@ public class HomeTabHomeFragment extends BaseFragment {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 转化房间数组,不足6的加上虚位以待
|
* 转化房间数组,不足6的加上虚位以待
|
||||||
* @param itemList
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<HomeTabMapInfo> getConvertData(List<HomeTabMapInfo> itemList) {
|
private List<HomeTabMapInfo> getConvertData(List<HomeTabMapInfo> finalList,List<HomeTabMapInfo> randomList) {
|
||||||
List<HomeTabMapInfo> sixRoomsList = new ArrayList<>(itemList);
|
List<HomeTabMapInfo> finalList1 = new ArrayList<>(finalList);//最终的6条数据
|
||||||
int ROOM_COUNT = 6;
|
List<HomeTabMapInfo> randomList1 = new ArrayList<>(randomList);//不是置顶的
|
||||||
for (int i = 0; i < sixRoomsList.size(); i++) {
|
int ROOM_COUNT = 6;//首页显示6条数据
|
||||||
sixRoomsList.get(i).setItemType(HomeTabMapInfo.TYPE_NORMAL);
|
randomList1 = randomList(randomList1);
|
||||||
}
|
finalList1.addAll(randomList1);
|
||||||
|
|
||||||
if (sixRoomsList.size() >= ROOM_COUNT){
|
if (finalList1.size() >= ROOM_COUNT){
|
||||||
sixRoomsList = randomList(sixRoomsList);
|
finalList1 = finalList1.subList(0,ROOM_COUNT);
|
||||||
sixRoomsList = sixRoomsList.subList(0,ROOM_COUNT);
|
|
||||||
}else {
|
}else {
|
||||||
while (sixRoomsList.size() < ROOM_COUNT){
|
while (finalList1.size() < ROOM_COUNT){
|
||||||
HomeTabMapInfo info = new HomeTabMapInfo();
|
HomeTabMapInfo info = new HomeTabMapInfo();
|
||||||
info.setItemType(HomeTabMapInfo.TYPE_EMPTY);
|
info.setItemType(HomeTabMapInfo.TYPE_EMPTY);
|
||||||
sixRoomsList.add(info);
|
finalList1.add(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sixRoomsList;
|
return finalList1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **************************** 排序 ***********************************
|
||||||
|
*/
|
||||||
|
private void sortSeqRoom(List<HomeTabMapInfo> list) {
|
||||||
|
if (list.size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Collections.sort(list, comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Comparator<HomeTabMapInfo> comp = (o1, o2) -> {
|
||||||
|
int seq = o1.getSeq() - o2.getSeq();
|
||||||
|
return Integer.compare(seq, 0);
|
||||||
|
};
|
||||||
|
|
||||||
private List<HomeTabMapInfo> randomList(List<HomeTabMapInfo> sourceList) {
|
private List<HomeTabMapInfo> randomList(List<HomeTabMapInfo> sourceList) {
|
||||||
if (sourceList == null || sourceList.size() == 0) {
|
if (sourceList == null || sourceList.size() == 0) {
|
||||||
return sourceList;
|
return sourceList;
|
||||||
|
@@ -90,7 +90,7 @@ public class HomeTabMapFragment extends BaseMvpFragment<IHomeTabMapView, HomeTab
|
|||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
recyclerView.setItemAnimator(null);
|
recyclerView.setItemAnimator(null);
|
||||||
mHomeRoomAdapter = new HomeRoomFragmentAdapter(getContext(),null);
|
mHomeRoomAdapter = new HomeRoomFragmentAdapter(getContext(),null,false);
|
||||||
mHomeRoomAdapter.setOnLoadMoreListener(this, recyclerView);
|
mHomeRoomAdapter.setOnLoadMoreListener(this, recyclerView);
|
||||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), ROWS);
|
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), ROWS);
|
||||||
recyclerView.setLayoutManager(gridLayoutManager);
|
recyclerView.setLayoutManager(gridLayoutManager);
|
||||||
|
@@ -406,43 +406,6 @@ public class RecommendationFragment extends BaseFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示引导
|
|
||||||
*/
|
|
||||||
private void showGuide() {
|
|
||||||
if (TuTuGuideHelper.isNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_MAIN_HOME)) {
|
|
||||||
recyclerView.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Fragment fragment = getParentFragment();
|
|
||||||
if (!(fragment instanceof GameHomeFragment)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
List<View> views = ((GameHomeFragment) fragment).getHomeBanner(3);
|
|
||||||
if (views == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int count = recyclerView.getChildCount();
|
|
||||||
if (count < 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
View view = recyclerView.getChildAt(1);
|
|
||||||
if (view == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
view = view.findViewById(R.id.ll_left_content);
|
|
||||||
if (view == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
View finalView = view;
|
|
||||||
TuTuGuideHelper helper = new TuTuGuideHelper(getContext());
|
|
||||||
helper.createHiGuide(() -> helper.createMainHomeGuide(views, finalView));
|
|
||||||
TuTuGuideHelper.setNoNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_MAIN_HOME);
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,7 @@ import com.yizhuan.xchat_android_core.user.AttentionModel;
|
|||||||
import com.yizhuan.xchat_android_core.user.bean.AttentionInfo;
|
import com.yizhuan.xchat_android_core.user.bean.AttentionInfo;
|
||||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||||
|
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||||
import com.yizhuan.xchat_android_library.base.PresenterEvent;
|
import com.yizhuan.xchat_android_library.base.PresenterEvent;
|
||||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||||
|
|
||||||
@@ -372,7 +373,8 @@ public class MainFragmentPresenter extends BaseMvpPresenter<IMainFragmentView> {
|
|||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
public void getHomeConcerns(){
|
public void getHomeConcerns(){
|
||||||
com.yizhuan.erban.home.model.HomeModel.get().getHomeConcerns().subscribe((result, throwable) -> {
|
com.yizhuan.erban.home.model.HomeModel.get().getHomeConcerns().compose(RxHelper.handleException())
|
||||||
|
.subscribe((result, throwable) -> {
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
if (mMvpView != null) {
|
if (mMvpView != null) {
|
||||||
mMvpView.getFollowRoomFail();
|
mMvpView.getFollowRoomFail();
|
||||||
|
@@ -33,6 +33,7 @@ import com.yizhuan.erban.friend.action.AbstractSelectFriendAction;
|
|||||||
import com.yizhuan.erban.friend.view.SelectFriendActivity;
|
import com.yizhuan.erban.friend.view.SelectFriendActivity;
|
||||||
import com.yizhuan.erban.home.adapter.ContactsIndicatorAdapter;
|
import com.yizhuan.erban.home.adapter.ContactsIndicatorAdapter;
|
||||||
import com.yizhuan.erban.home.adapter.FragmentViewPagerAdapter;
|
import com.yizhuan.erban.home.adapter.FragmentViewPagerAdapter;
|
||||||
|
import com.yizhuan.erban.ui.search.event.SearchEvent;
|
||||||
import com.yizhuan.erban.ui.search.presenter.SearchPresenter;
|
import com.yizhuan.erban.ui.search.presenter.SearchPresenter;
|
||||||
import com.yizhuan.erban.ui.search.view.ISearchView;
|
import com.yizhuan.erban.ui.search.view.ISearchView;
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
||||||
@@ -59,6 +60,8 @@ import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
|||||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||||
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -218,9 +221,10 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
mTabInfoList.add(getString(R.string.search_user_tab));
|
mTabInfoList.add(getString(R.string.search_user_tab));
|
||||||
|
|
||||||
List<Fragment> mTabs = new ArrayList<>();
|
List<Fragment> mTabs = new ArrayList<>();
|
||||||
mTabs.add(SearchDetailFragment.newInstance(str,SearchDetailFragment.TYPE_SEARCH_ROOM));
|
SearchDetailFragment roomFrg = new SearchDetailFragment(str,SearchDetailFragment.TYPE_SEARCH_ROOM);
|
||||||
mTabs.add(SearchDetailFragment.newInstance(str,SearchDetailFragment.TYPE_SEARCH_USER));
|
SearchDetailFragment userFrg = new SearchDetailFragment(str,SearchDetailFragment.TYPE_SEARCH_USER);
|
||||||
|
mTabs.add(roomFrg);
|
||||||
|
mTabs.add(userFrg);
|
||||||
ContactsIndicatorAdapter topMagicIndicatorAdapter = new ContactsIndicatorAdapter(this, mTabInfoList,0);
|
ContactsIndicatorAdapter topMagicIndicatorAdapter = new ContactsIndicatorAdapter(this, mTabInfoList,0);
|
||||||
topMagicIndicatorAdapter.setOnItemSelectListener(this);
|
topMagicIndicatorAdapter.setOnItemSelectListener(this);
|
||||||
CommonNavigator commonNavigator = new CommonNavigator(this);
|
CommonNavigator commonNavigator = new CommonNavigator(this);
|
||||||
@@ -557,6 +561,7 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
|||||||
private void showHistory() {
|
private void showHistory() {
|
||||||
hideStatus();
|
hideStatus();
|
||||||
llSearchDetail.setVisibility(View.GONE);
|
llSearchDetail.setVisibility(View.GONE);
|
||||||
|
viewPager.setAdapter(null);
|
||||||
if (mShowHistory) {
|
if (mShowHistory) {
|
||||||
clSearchHistoryContainer.setVisibility(mSearchHistoryList != null && mSearchHistoryList.size() > 0 ?
|
clSearchHistoryContainer.setVisibility(mSearchHistoryList != null && mSearchHistoryList.size() > 0 ?
|
||||||
View.VISIBLE : View.GONE);
|
View.VISIBLE : View.GONE);
|
||||||
|
@@ -1,25 +1,25 @@
|
|||||||
package com.yizhuan.erban.ui.search;
|
package com.yizhuan.erban.ui.search;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.coorchice.library.utils.LogUtils;
|
import com.coorchice.library.utils.LogUtils;
|
||||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||||
|
import com.yizhuan.erban.ui.search.event.SearchEvent;
|
||||||
import com.yizhuan.erban.ui.search.presenter.SearchPresenter;
|
import com.yizhuan.erban.ui.search.presenter.SearchPresenter;
|
||||||
import com.yizhuan.erban.ui.search.view.ISearchView;
|
import com.yizhuan.erban.ui.search.view.ISearchView;
|
||||||
import com.yizhuan.xchat_android_core.Constants;
|
|
||||||
import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo;
|
import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo;
|
||||||
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo;
|
||||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@CreatePresenter(SearchPresenter.class)
|
@CreatePresenter(SearchPresenter.class)
|
||||||
@@ -32,24 +32,29 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
|||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
private SearchAdapter searchAdapter;
|
private SearchAdapter searchAdapter;
|
||||||
|
|
||||||
public static SearchDetailFragment newInstance(String inPutText,int type) {
|
// public static SearchDetailFragment newInstance(String inPutText,int type) {
|
||||||
|
//
|
||||||
|
// Bundle args = new Bundle();
|
||||||
|
//// args.putString("str", inPutText);
|
||||||
|
// args.putInt("type", type);
|
||||||
|
// SearchDetailFragment fragment = new SearchDetailFragment(inPutText,type);
|
||||||
|
// fragment.setArguments(args);
|
||||||
|
// return fragment;
|
||||||
|
// }
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
public SearchDetailFragment(String inPutText,int type){
|
||||||
args.putString("str", inPutText);
|
this.mInPutText = inPutText;
|
||||||
args.putInt("type", type);
|
this.mType = type;
|
||||||
SearchDetailFragment fragment = new SearchDetailFragment();
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
LogUtils.e("onCreate");
|
|
||||||
if (getArguments() != null) {
|
if (getArguments() != null) {
|
||||||
mInPutText = getArguments().getString("str");
|
// mInPutText = getArguments().getString("str");
|
||||||
mType = getArguments().getInt("type");
|
mType = getArguments().getInt("type");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -59,8 +64,8 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFindViews() {
|
public void onFindViews() {
|
||||||
LogUtils.e("onFindViews");
|
|
||||||
recyclerView = mView.findViewById(R.id.recycler_view);
|
recyclerView = mView.findViewById(R.id.recycler_view);
|
||||||
|
initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -68,18 +73,9 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onInitArguments(Bundle bundle) {
|
|
||||||
super.onInitArguments(bundle);
|
|
||||||
if (bundle != null) {
|
|
||||||
this.mInPutText = bundle.getString("str");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initiate() {
|
public void initiate() {
|
||||||
LogUtils.e("initiate");
|
|
||||||
initData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData(){
|
private void initData(){
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1022 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1022 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 41 KiB |
@@ -18,7 +18,7 @@
|
|||||||
android:layout_height="77dp"
|
android:layout_height="77dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="89dp"
|
android:layout_marginTop="89dp"
|
||||||
android:src="@drawable/about_logo"
|
android:src="@mipmap/app_logo"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
|
||||||
|
@@ -23,33 +23,43 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:id="@+id/rv_follow_room"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:paddingStart="@dimen/dp_15"
|
|
||||||
android:paddingEnd="@dimen/dp_15"/>
|
|
||||||
|
|
||||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
|
||||||
android:id="@+id/magic_indicator"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:paddingStart="@dimen/dp_15"
|
|
||||||
android:paddingEnd="@dimen/dp_15"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/rv_follow_room"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
|
||||||
android:id="@+id/view_pager"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||||
app:layout_constraintTop_toBottomOf="@id/magic_indicator"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
/>
|
android:fillViewport="true"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_follow_room"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/dp_15"
|
||||||
|
android:paddingEnd="@dimen/dp_15"/>
|
||||||
|
|
||||||
|
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||||
|
android:id="@+id/magic_indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:paddingStart="@dimen/dp_15"
|
||||||
|
android:paddingEnd="@dimen/dp_15"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rv_follow_room"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/view_pager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -60,20 +60,20 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_nick"
|
android:id="@+id/tv_nick"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginBottom="6dp"
|
android:layout_marginBottom="6dp"
|
||||||
android:drawablePadding="@dimen/space_normal"
|
android:drawablePadding="@dimen/space_normal"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:maxLength="20"
|
||||||
android:layout_marginEnd="@dimen/dp_20"
|
android:layout_marginEnd="@dimen/dp_20"
|
||||||
android:textColor="@color/color_333333"
|
android:textColor="@color/color_333333"
|
||||||
android:textSize="15dp"
|
android:textSize="15dp"
|
||||||
app:layout_constraintEnd_toStartOf="@id/iv_where"
|
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:drawableRight="@drawable/ic_gender_male"
|
tools:drawableRight="@drawable/ic_gender_male"
|
||||||
tools:text="King天地为"
|
tools:text="King天地天地"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"/>
|
app:layout_constraintStart_toStartOf="parent"/>
|
||||||
|
|
||||||
|
@@ -63,6 +63,8 @@
|
|||||||
android:layout_width="@dimen/dp_25"
|
android:layout_width="@dimen/dp_25"
|
||||||
android:layout_height="@dimen/dp_25"
|
android:layout_height="@dimen/dp_25"
|
||||||
android:contentDescription="@string/close"
|
android:contentDescription="@string/close"
|
||||||
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/icon_pm_close"
|
android:src="@drawable/icon_pm_close"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@@ -37,19 +37,16 @@
|
|||||||
android:src="@mipmap/bg_home_top"
|
android:src="@mipmap/bg_home_top"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<!-- <androidx.appcompat.widget.Toolbar-->
|
||||||
android:id="@+id/tool_bar"
|
<!-- android:id="@+id/tool_bar"-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
app:contentInsetStart="0dp"
|
<!-- app:contentInsetStart="0dp"-->
|
||||||
app:layout_collapseMode="pin"
|
<!-- app:layout_collapseMode="pin"-->
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||||
>
|
<!-- >-->
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/title_bar"
|
android:id="@+id/title_bar"
|
||||||
@@ -100,25 +97,15 @@
|
|||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_to_sign_in" />
|
android:src="@drawable/icon_to_sign_in" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_open_room"
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:onClick="@{click}"
|
|
||||||
android:layout_marginEnd="@dimen/dp_10"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:src="@mipmap/ic_open_room" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
<!-- </androidx.appcompat.widget.Toolbar>-->
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/layout_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tool_bar"
|
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||||
android:visibility="visible">
|
android:visibility="visible">
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
@@ -126,21 +113,21 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay"
|
||||||
|
app:expanded="false"
|
||||||
|
tools:expanded="true"
|
||||||
app:elevation="0dp">
|
app:elevation="0dp">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
android:id="@+id/collapsing_layout"
|
android:id="@+id/collapsing_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_scrollFlags="scroll">
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_scrollFlags="scroll">
|
>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_follow_room"
|
android:id="@+id/rv_follow_room"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -148,20 +135,23 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:paddingBottom="@dimen/dp_8"
|
||||||
android:paddingStart="@dimen/dp_15"
|
android:paddingStart="@dimen/dp_15"
|
||||||
android:paddingEnd="@dimen/dp_15"
|
android:paddingEnd="@dimen/dp_15"
|
||||||
android:layout_marginTop="@dimen/dp_8"/>
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/ll_indicator"
|
android:id="@+id/ll_indicator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintTop_toBottomOf="@id/rv_follow_room"
|
app:layout_constraintTop_toBottomOf="@id/rv_follow_room"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:paddingStart="14dp"
|
android:paddingStart="14dp"
|
||||||
android:paddingEnd="15dp"
|
android:paddingEnd="15dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
>
|
>
|
||||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||||
android:id="@+id/magic_indicator"
|
android:id="@+id/magic_indicator"
|
||||||
@@ -213,7 +203,6 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/view_pager"
|
app:layout_constraintTop_toBottomOf="@id/view_pager"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_marginTop="@dimen/dp_15"
|
android:layout_marginTop="@dimen/dp_15"
|
||||||
>
|
>
|
||||||
|
|
||||||
@@ -228,21 +217,6 @@
|
|||||||
/>
|
/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/fl_roll_view" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Group
|
|
||||||
android:id="@+id/home_banner_group"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:constraint_referenced_ids="fl_roll_view" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
@@ -259,7 +233,6 @@
|
|||||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||||
android:id="@+id/magic_indicator_bottom"
|
android:id="@+id/magic_indicator_bottom"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:paddingLeft="14dp"
|
android:paddingLeft="14dp"
|
||||||
android:paddingRight="14dp" />
|
android:paddingRight="14dp" />
|
||||||
|
@@ -86,7 +86,7 @@
|
|||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
tools:src="@drawable/about_logo"/>
|
tools:src="@mipmap/app_logo"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
android:layout_height="59dp"
|
android:layout_height="59dp"
|
||||||
android:layout_marginTop="17dp"
|
android:layout_marginTop="17dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
tools:src="@drawable/about_logo"
|
tools:src="@mipmap/app_logo"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -275,7 +275,7 @@
|
|||||||
android:id="@+id/iv_room_rank_top_1_avatar"
|
android:id="@+id/iv_room_rank_top_1_avatar"
|
||||||
android:layout_width="73dp"
|
android:layout_width="73dp"
|
||||||
android:layout_height="73dp"
|
android:layout_height="73dp"
|
||||||
tools:src="@drawable/about_logo"
|
tools:src="@mipmap/app_logo"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="@dimen/dp_19"
|
android:layout_marginTop="@dimen/dp_19"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
@@ -337,7 +337,7 @@
|
|||||||
android:layout_height="59dp"
|
android:layout_height="59dp"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
tools:src="@drawable/about_logo"
|
tools:src="@mipmap/app_logo"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="10sp" />
|
android:textSize="10sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_tab_label"
|
android:id="@+id/iv_tab_label"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
@@ -72,6 +72,20 @@
|
|||||||
tools:visibility="visible"
|
tools:visibility="visible"
|
||||||
android:visibility="invisible"/>
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tag_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@mipmap/ic_bg_home_room_tag"
|
||||||
|
android:text="我是内容我是内容"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLength="5"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:visibility="invisible"
|
||||||
|
/>
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.makeramen.roundedimageview.RoundedImageView
|
||||||
android:id="@+id/lock_bg"
|
android:id="@+id/lock_bg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="32dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
tools:src="@drawable/about_logo"/>
|
tools:src="@mipmap/app_logo"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_toRightOf="@id/iv_room_rank_avatar"
|
android:layout_toRightOf="@id/iv_room_rank_avatar"
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
android:layout_height="59dp"
|
android:layout_height="59dp"
|
||||||
android:layout_marginTop="17dp"
|
android:layout_marginTop="17dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
tools:src="@drawable/about_logo"
|
tools:src="@mipmap/app_logo"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
android:layout_height="73dp"
|
android:layout_height="73dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="@dimen/dp_19"
|
android:layout_marginTop="@dimen/dp_19"
|
||||||
tools:src="@drawable/about_logo"
|
tools:src="@mipmap/app_logo"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
android:layout_height="59dp"
|
android:layout_height="59dp"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
tools:src="@drawable/about_logo"
|
tools:src="@mipmap/app_logo"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
BIN
app/src/main/res/mipmap-xhdpi/ic_bg_home_room_tag.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
@@ -212,40 +212,40 @@ public class TopicMainActivity extends BaseMvpActivity<IMiniWorldGuestPage, Mini
|
|||||||
mTitleBar.setLeftTextSize(18F);
|
mTitleBar.setLeftTextSize(18F);
|
||||||
mTitleBar.setLeftDrawPadding(SizeUtils.dp2px(this, 17f));
|
mTitleBar.setLeftDrawPadding(SizeUtils.dp2px(this, 17f));
|
||||||
mTitleBar.setLeftClickListener(v -> onLeftClickListener());
|
mTitleBar.setLeftClickListener(v -> onLeftClickListener());
|
||||||
TitleBar.ActionList actionList = new TitleBar.ActionList();
|
// TitleBar.ActionList actionList = new TitleBar.ActionList();
|
||||||
actionList.add(new TitleBar.Action() {
|
// actionList.add(new TitleBar.Action() {
|
||||||
@Override
|
// @Override
|
||||||
public String getText() {
|
// public String getText() {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public int getDrawable() {
|
// public int getDrawable() {
|
||||||
return R.drawable.ic_mini_world_guest_page_more;
|
// return R.drawable.ic_mini_world_guest_page_more;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public int getTextColor() {
|
// public int getTextColor() {
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public int getTextDrawableLeft() {
|
// public int getTextDrawableLeft() {
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void performAction(View view) {
|
// public void performAction(View view) {
|
||||||
if (easyPopup != null) {
|
// if (easyPopup != null) {
|
||||||
easyPopup.showAtAnchorView(view,
|
// easyPopup.showAtAnchorView(view,
|
||||||
VerticalGravity.BELOW,
|
// VerticalGravity.BELOW,
|
||||||
HorizontalGravity.ALIGN_RIGHT,
|
// HorizontalGravity.ALIGN_RIGHT,
|
||||||
UIUtil.dip2px(context, -15),
|
// UIUtil.dip2px(context, -15),
|
||||||
UIUtil.dip2px(context, 15));
|
// UIUtil.dip2px(context, 15));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
mTitleBar.addActions(actionList);
|
// mTitleBar.addActions(actionList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 用于刷新页面判断控件是否展示;*/
|
/** 用于刷新页面判断控件是否展示;*/
|
||||||
|
@@ -95,6 +95,12 @@ public class UriProvider {
|
|||||||
return IM_SERVER_URL.concat("/modules/nobles/intro.html");
|
return IM_SERVER_URL.concat("/modules/nobles/intro.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 贵族介绍页
|
||||||
|
*/
|
||||||
|
public static String getRanking() {
|
||||||
|
return IM_SERVER_URL.concat("/accompany/modules/rank/index.html#/rank");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 等级界面
|
* 等级界面
|
||||||
|