1:羽声新版本
This commit is contained in:
@@ -34,7 +34,7 @@ android {
|
||||
enabled = true
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
jvmTarget = '11'
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
@@ -59,6 +59,8 @@ dependencies {
|
||||
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||||
|
||||
implementation project(':moduleroom')
|
||||
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
@@ -16,6 +16,9 @@
|
||||
android:launchMode="singleTask"
|
||||
android:exported="false"
|
||||
/>
|
||||
<activity
|
||||
android:name=".activity.PopularRoomActivity"
|
||||
android:exported="false"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -22,10 +22,13 @@ import com.google.android.flexbox.FlexDirection;
|
||||
import com.google.android.flexbox.FlexWrap;
|
||||
import com.google.android.flexbox.FlexboxLayoutManager;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.RecordSection;
|
||||
import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.bean.SearchAll;
|
||||
import com.xscm.moduleutil.bean.UserResultResp;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ChatLauncher;
|
||||
import com.xscm.moduleutil.widget.dialog.CommonDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -101,7 +104,7 @@ public class SearchActivity extends BaseMvpActivity<SearchPresenter, ActivitySea
|
||||
mBinding.llHistory.setVisibility(View.GONE);
|
||||
MvpPre.getSearchHistory();
|
||||
MvpPre.fuzzyQuery(keyWord);
|
||||
MvpPre.search(keyWord, "2");
|
||||
MvpPre.search(keyWord);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -112,7 +115,7 @@ public class SearchActivity extends BaseMvpActivity<SearchPresenter, ActivitySea
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
MvpPre.saveSearchHistory(mSearchRecordAdapter.getItem(position).t);
|
||||
MvpPre.search(mSearchRecordAdapter.getItem(position).t, "2");
|
||||
MvpPre.search(mSearchRecordAdapter.getItem(position).t);
|
||||
}
|
||||
});
|
||||
//搜索历史点击
|
||||
@@ -145,13 +148,34 @@ public class SearchActivity extends BaseMvpActivity<SearchPresenter, ActivitySea
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mSearchUserResultAdapter.setOnItemClickListener(new SearchUserResultAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onGnsClick(UserResultResp item) {
|
||||
if (item.getRoom_id() != null && !item.getRoom_id().isEmpty() && !"0".equals(item.getRoom_id())) {
|
||||
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(SearchActivity.this, item.getRoom_id() + "", "");
|
||||
|
||||
} else {
|
||||
ChatLauncher.getInstance().launchC2CChat(SearchActivity.this, item.getUser_id() + "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeadImageClick(UserResultResp item) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id() + "").navigation();
|
||||
//
|
||||
}
|
||||
});
|
||||
//房间列表点击时事件
|
||||
mSearchRoomResultAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
RoomSearchResp item = mSearchRoomResultAdapter.getItem(position);
|
||||
if (item != null) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "搜索界面").withString("roomId", item.getId()).navigation();
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getApplicationContext(), item.getRoom_id(), "");
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "搜索界面").withString("roomId", item.getId()).navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -205,40 +229,40 @@ public class SearchActivity extends BaseMvpActivity<SearchPresenter, ActivitySea
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void setSearch(List<RoomSearchResp> data) {
|
||||
public void setSearch(SearchAll data) {
|
||||
mBinding.recycleViewRecord.setVisibility(View.GONE);
|
||||
mBinding.llHistory.setVisibility(View.GONE);
|
||||
mBinding.rlResult.setVisibility(View.VISIBLE);
|
||||
if (data == null || data.size() == 0) {
|
||||
if (data == null || (data.getRooms() == null && data.getUsers() == null)) {
|
||||
mBinding.rlNull.setVisibility(View.VISIBLE);
|
||||
mBinding.nestedscrollview.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.rlNull.setVisibility(View.GONE);
|
||||
mBinding.nestedscrollview.setVisibility(View.VISIBLE);
|
||||
if (data.size() == 0) {
|
||||
if (data.getRooms()==null) {
|
||||
mBinding.recycleViewRoom.setVisibility(View.GONE);
|
||||
mBinding.rlRoom.setVisibility(View.GONE);
|
||||
} else {
|
||||
// roomResultInfoList = room_result.getList();
|
||||
mBinding.recycleViewRoom.setVisibility(View.VISIBLE);
|
||||
mBinding.rlRoom.setVisibility(View.VISIBLE);
|
||||
if (data.size() > 2) {
|
||||
mSearchRoomResultAdapter.setNewData(data.subList(0, 2));
|
||||
if (data.getRooms().size() > 2) {
|
||||
mSearchRoomResultAdapter.setNewData(data.getRooms().subList(0, 2));
|
||||
} else {
|
||||
mSearchRoomResultAdapter.setNewData(data);
|
||||
mSearchRoomResultAdapter.setNewData(data.getRooms());
|
||||
}
|
||||
mBinding.tvRoomCount.setText("全部 " + data.size());
|
||||
mBinding.tvRoomCount.setText("全部 " + data.getRooms().size());
|
||||
}
|
||||
if (data.getUsers() != null && data.getUsers().size() != 0) {
|
||||
mBinding.rlUser.setVisibility(View.VISIBLE);
|
||||
mBinding.recycleViewUser.setVisibility(View.VISIBLE);
|
||||
mSearchUserResultAdapter.setNewData(data.getUsers());
|
||||
} else {
|
||||
mBinding.rlUser.setVisibility(View.GONE);
|
||||
mBinding.recycleViewUser.setVisibility(View.GONE);
|
||||
}
|
||||
// if (user_result != null && user_result.size() != 0) {
|
||||
// mBinding.rlUser.setVisibility(View.VISIBLE);
|
||||
// mBinding.recycleViewUser.setVisibility(View.VISIBLE);
|
||||
// mSearchUserResultAdapter.setNewData(user_result);
|
||||
// } else {
|
||||
mBinding.rlUser.setVisibility(View.GONE);
|
||||
mBinding.recycleViewUser.setVisibility(View.GONE);
|
||||
// }
|
||||
}
|
||||
mSearchRoomResultAdapter.setNewData(data);
|
||||
// mSearchRoomResultAdapter.setNewData(data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.SpanUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
@@ -24,6 +25,7 @@ import com.lihang.ShadowLayout;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.PlaceholderBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.StringUtil;
|
||||
@@ -132,17 +134,7 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
rlMy.setVisibility(View.VISIBLE);
|
||||
rlMyCp.setVisibility(View.GONE);
|
||||
slMy.setShadowColor(Color.parseColor("#7AFE969D"));
|
||||
} else if (index == 3) {
|
||||
r11.setVisibility(View.VISIBLE);
|
||||
r12.setVisibility(View.GONE);
|
||||
r21.setVisibility(View.VISIBLE);
|
||||
r22.setVisibility(View.GONE);
|
||||
r31.setVisibility(View.VISIBLE);
|
||||
r32.setVisibility(View.GONE);
|
||||
rlMy.setVisibility(View.VISIBLE);
|
||||
rlMyCp.setVisibility(View.GONE);
|
||||
slMy.setShadowColor(Color.parseColor("#7AFE969D"));
|
||||
} else if (index == 4) {
|
||||
}else if (index == 3){
|
||||
r11.setVisibility(View.GONE);
|
||||
r12.setVisibility(View.VISIBLE);
|
||||
r21.setVisibility(View.GONE);
|
||||
@@ -153,6 +145,27 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
rlMyCp.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
// else if (index == 3) {
|
||||
// r11.setVisibility(View.VISIBLE);
|
||||
// r12.setVisibility(View.GONE);
|
||||
// r21.setVisibility(View.VISIBLE);
|
||||
// r22.setVisibility(View.GONE);
|
||||
// r31.setVisibility(View.VISIBLE);
|
||||
// r32.setVisibility(View.GONE);
|
||||
// rlMy.setVisibility(View.VISIBLE);
|
||||
// rlMyCp.setVisibility(View.GONE);
|
||||
// slMy.setShadowColor(Color.parseColor("#7AFE969D"));
|
||||
// } else if (index == 4) {
|
||||
// r11.setVisibility(View.GONE);
|
||||
// r12.setVisibility(View.VISIBLE);
|
||||
// r21.setVisibility(View.GONE);
|
||||
// r22.setVisibility(View.VISIBLE);
|
||||
// r31.setVisibility(View.GONE);
|
||||
// r32.setVisibility(View.VISIBLE);
|
||||
// rlMy.setVisibility(View.GONE);
|
||||
// rlMyCp.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
|
||||
recycleView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mAdapter = new BaseQuickAdapter<PlaceholderBean.ListsBean, BaseViewHolder>(R.layout.index_rv_item_ranking_list) {
|
||||
|
||||
@@ -166,7 +179,7 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), helper.getView(R.id.riv_avatar));
|
||||
helper.setText(R.id.tv_no, String.valueOf(item.getRank()));
|
||||
} else if (index == 4) {
|
||||
} else if (index == 3) {
|
||||
rl.setVisibility(View.VISIBLE);
|
||||
helper.getView(R.id.riv_avatar).setVisibility(View.GONE);
|
||||
// ImageUtils.loadHeadCC(item.getHead_picture1(), helper.getView(R.id.iv_three_cp1_head));
|
||||
@@ -188,16 +201,17 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
// if (type == RankingFragment.TYPE_WEALTH) {
|
||||
// return;
|
||||
// }
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", item.getUser_id()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id()).navigation();
|
||||
}
|
||||
});
|
||||
} else if (index == 3) {
|
||||
rl.setVisibility(View.GONE);
|
||||
helper.getView(R.id.riv_avatar).setVisibility(View.VISIBLE);
|
||||
helper.setText(R.id.tv_name, item.getGuild_name());
|
||||
ImageUtils.loadHeadCC(item.getCover(), helper.getView(R.id.riv_avatar));
|
||||
helper.setText(R.id.tv_no, String.valueOf(item.getRank()));
|
||||
}
|
||||
// else if (index == 3) {
|
||||
// rl.setVisibility(View.GONE);
|
||||
// helper.getView(R.id.riv_avatar).setVisibility(View.VISIBLE);
|
||||
// helper.setText(R.id.tv_name, item.getGuild_name());
|
||||
// ImageUtils.loadHeadCC(item.getCover(), helper.getView(R.id.riv_avatar));
|
||||
// helper.setText(R.id.tv_no, String.valueOf(item.getRank()));
|
||||
// }
|
||||
}
|
||||
};
|
||||
recycleView.setAdapter(mAdapter);
|
||||
@@ -274,7 +288,7 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
@Override
|
||||
public void wealthRanking(PlaceholderBean.MyRanking data) {
|
||||
if (data != null) {
|
||||
if (index == 4) {
|
||||
if (index == 3) {
|
||||
GifAvatarOvalView cp1Head = mBinding.includeTopBar.ivMyCp1Head;
|
||||
GifAvatarOvalView cp2Head = mBinding.includeTopBar.ivMyCp2Head;
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), cp1Head);
|
||||
@@ -290,10 +304,14 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
if (index == 0) {
|
||||
tvName.setText(data.getRoom_name());
|
||||
ImageUtils.loadHeadCC(data.getRoom_cover(), riv);
|
||||
} else if (index == 3) {
|
||||
tvName.setText(data.getGuild_name());
|
||||
ImageUtils.loadHeadCC(data.getCover(), riv);
|
||||
} else {
|
||||
}
|
||||
|
||||
// else if (index == 3) {
|
||||
// tvName.setText(data.getGuild_name());
|
||||
// ImageUtils.loadHeadCC(data.getCover(), riv);
|
||||
// }
|
||||
|
||||
else {
|
||||
tvName.setText(data.getNickname());
|
||||
ImageUtils.loadHeadCC(data.getAvatar(), riv);
|
||||
}
|
||||
@@ -358,30 +376,38 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
return;
|
||||
}
|
||||
tvXing1.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
tvXing1.setBackgroundResource(type.equals("4") ? com.xscm.moduleutil.R.mipmap.bangdan3 :com.xscm.moduleutil.R.mipmap.bangdan4);
|
||||
tvXing1.setBackgroundResource(type.equals("3") ? com.xscm.moduleutil.R.mipmap.bangdan3 :com.xscm.moduleutil.R.mipmap.bangdan4);
|
||||
if (type.equals("0")) {
|
||||
tvUsername1.setText(data.getRoom_name());
|
||||
ImageUtils.loadHeadCC(data.getRoom_cover(), imUser1);
|
||||
tvId1.setText(data.getRoom_id() != null ? "ID:" + data.getRoom_id() : "");
|
||||
tvId1.setText(data.getRoom_number() != null ? "ID:" + data.getRoom_number() : "");
|
||||
imUser1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).navigation();
|
||||
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", data.getUser_id()).navigation();
|
||||
}
|
||||
});
|
||||
} else if (type.equals("1") || type.equals("2")) {
|
||||
tvUsername1.setText(data.getNickname());
|
||||
ImageUtils.loadHeadCC(data.getAvatar(), imUser1);
|
||||
tvId1.setText(data.getUser_id() != null ? "ID:" + data.getUser_id() : "");
|
||||
} else if (type.equals("3")) {
|
||||
tvUsername1.setText(data.getGuild_name());
|
||||
ImageUtils.loadHeadCC(data.getCover(), imUser1);
|
||||
tvId1.setText(data.getGuild_special_id() != null ? "ID:" + data.getGuild_special_id() : "");
|
||||
} else {
|
||||
tvId1.setText(data.getUser_code() != null ? "ID:" + data.getUser_code() : "");
|
||||
imUser1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", data.getUser_id()).navigation();
|
||||
}
|
||||
});
|
||||
}
|
||||
// else if (type.equals("3")) {
|
||||
// tvUsername1.setText(data.getGuild_name());
|
||||
// ImageUtils.loadHeadCC(data.getCover(), imUser1);
|
||||
// tvId1.setText(data.getGuild_special_id() != null ? "ID:" + data.getGuild_special_id() : "");
|
||||
// }
|
||||
else {
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), ivOneCp1Hhead);
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar1(), ivOneCp2Hhead);
|
||||
tvUsername1.setText(data.getNickname());
|
||||
tvId1.setText(data.getUser_id1());
|
||||
tvId1.setText(data.getNickname1());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -411,30 +437,32 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
return;
|
||||
}
|
||||
tvXing2.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
tvXing2.setBackgroundResource(type.equals("4") ? com.xscm.moduleutil.R.mipmap.bangdan3 :com.xscm.moduleutil.R.mipmap.bangdan4);
|
||||
tvXing2.setBackgroundResource(type.equals("3") ? com.xscm.moduleutil.R.mipmap.bangdan3 :com.xscm.moduleutil.R.mipmap.bangdan4);
|
||||
if (type.equals("0")) {
|
||||
tvUsername2.setText(data.getRoom_name());
|
||||
ImageUtils.loadHeadCC(data.getRoom_cover(), imUser2);
|
||||
tvId2.setText(data.getRoom_id() != null ? "ID:" + data.getRoom_id() : "");
|
||||
tvId2.setText(data.getRoom_number() != null ? "ID:" + data.getRoom_number() : "");
|
||||
} else if (type.equals("1") || type.equals("2")) {
|
||||
tvUsername2.setText(data.getNickname());
|
||||
ImageUtils.loadHeadCC(data.getAvatar(), imUser2);
|
||||
tvId2.setText(data.getUser_id() != null ? "ID:" + data.getUser_id() : "");
|
||||
tvId2.setText(data.getUser_code() != null ? "ID:" + data.getUser_code() : "");
|
||||
imUser2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", data.getUser_id()).navigation();
|
||||
}
|
||||
});
|
||||
} else if (type.equals("3")) {
|
||||
tvUsername2.setText(data.getGuild_name());
|
||||
ImageUtils.loadHeadCC(data.getCover(), imUser2);
|
||||
tvId2.setText(data.getGuild_special_id() != null ? "ID:" + data.getGuild_special_id() : "");
|
||||
} else {
|
||||
}
|
||||
// else if (type.equals("3")) {
|
||||
// tvUsername2.setText(data.getGuild_name());
|
||||
// ImageUtils.loadHeadCC(data.getCover(), imUser2);
|
||||
// tvId2.setText(data.getGuild_special_id() != null ? "ID:" + data.getGuild_special_id() : "");
|
||||
// }
|
||||
else {
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar1(), ivOneCp1Hhead);
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar1(), ivOneCp2Hhead);
|
||||
tvUsername2.setText(data.getNickname());
|
||||
tvId2.setText(data.getUser_id());
|
||||
tvId2.setText(data.getNickname1());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,30 +491,33 @@ public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, F
|
||||
return;
|
||||
}
|
||||
tvXing3.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
tvXing3.setBackgroundResource(type.equals("4") ? com.xscm.moduleutil.R.mipmap.bangdan3 :com.xscm.moduleutil.R.mipmap.bangdan4);
|
||||
tvXing3.setBackgroundResource(type.equals("3") ? com.xscm.moduleutil.R.mipmap.bangdan3 :com.xscm.moduleutil.R.mipmap.bangdan4);
|
||||
if (type.equals("0")) {
|
||||
tvUsername3.setText(data.getRoom_name());
|
||||
ImageUtils.loadHeadCC(data.getRoom_cover(), imUser3);
|
||||
tvId3.setText(data.getRoom_id() != null ? "ID:" + data.getRoom_id() : "");
|
||||
tvId3.setText(data.getRoom_number() != null ? "ID:" + data.getRoom_number() : "");
|
||||
} else if (type.equals("1") || type.equals("2")) {
|
||||
tvUsername3.setText(data.getNickname());
|
||||
ImageUtils.loadHeadCC(data.getAvatar(), imUser3);
|
||||
tvId3.setText(data.getUser_id() != null ? "ID:" + data.getUser_id() : "");
|
||||
tvId3.setText(data.getUser_code() != null ? "ID:" + data.getUser_code() : "");
|
||||
imUser3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", data.getUser_id()).navigation();
|
||||
}
|
||||
});
|
||||
} else if (type.equals("3")) {
|
||||
tvUsername3.setText(data.getGuild_name());
|
||||
ImageUtils.loadHeadCC(data.getCover(), imUser3);
|
||||
tvId3.setText(data.getGuild_special_id() != null ? "ID:" + data.getGuild_special_id() : "");
|
||||
} else {
|
||||
}
|
||||
// else if (type.equals("3")) {
|
||||
// tvUsername3.setText(data.getGuild_name());
|
||||
// ImageUtils.loadHeadCC(data.getCover(), imUser3);
|
||||
// tvId3.setText(data.getGuild_special_id() != null ? "ID:" + data.getGuild_special_id() : "");
|
||||
// }
|
||||
else {
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), ivOneCp1Hhead);
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), ivOneCp2Hhead);
|
||||
tvUsername3.setText(data.getNickname());
|
||||
tvId3.setText(data.getUser_id());
|
||||
tvId3.setText(data.getNickname1());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
@StringRes
|
||||
private static final int[] TAB_TITLES = new int[]{com.xscm.moduleutil.R.string.room_rank, com.xscm.moduleutil.R.string.wealth_rank,
|
||||
com.xscm.moduleutil.R.string.charm_rank, com.xscm.moduleutil.R.string.guild_rank, com.xscm.moduleutil.R.string.true_love_rank};
|
||||
com.xscm.moduleutil.R.string.charm_rank, com.xscm.moduleutil.R.string.true_love_rank};
|
||||
// com.xscm.moduleutil.R.string.guild_rank,
|
||||
private final Context mContext;
|
||||
|
||||
public SectionsPagerAdapter(Context context, FragmentManager fm) {
|
||||
@@ -41,6 +42,6 @@ public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
||||
@Override
|
||||
public int getCount() {
|
||||
// Show 2 total pages.
|
||||
return 5;
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@@ -35,42 +35,38 @@ public class CarouselBannerAdapter extends BaseBannerAdapter<TopRoom> {
|
||||
textView.setText(data.getUser_list().size()+"人");
|
||||
textView2.setText(data.getRoom_name());
|
||||
ImageView iv = holder.itemView.findViewById(R.id.iv_play);
|
||||
// if (item.getOn_line().equals("1")){
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, iv);
|
||||
// }
|
||||
List<TopRoom.UserList> user_list = data.getUser_list();
|
||||
if (user_list!= null && user_list.size() > 0) {
|
||||
RecyclerView recyclerView = holder.itemView.findViewById(R.id.rv_tags);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
|
||||
// 设置item之间的间隔为负值,实现重叠效果
|
||||
if (recyclerView.getItemDecorationCount() == 0) {
|
||||
recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
|
||||
@NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
// 设置负间距实现重叠效果,根据需要调整数值
|
||||
outRect.left = -dpToPx(holder.itemView.getContext(), 8); // 重叠8dp
|
||||
}
|
||||
|
||||
private int dpToPx(Context context, int dp) {
|
||||
return (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
context.getResources().getDisplayMetrics());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
CarouselImgAdapter adapter = new CarouselImgAdapter();
|
||||
|
||||
// 创建最多包含3个元素的子列表
|
||||
int endIndex = Math.min(user_list.size(), 3);
|
||||
adapter.setNewData(user_list.subList(0, endIndex));
|
||||
recyclerView.setAdapter(adapter);
|
||||
// adapter.setNewData(user_list);
|
||||
// List<TopRoom.UserList> user_list = data.getUser_list();
|
||||
// if (user_list!= null && user_list.size() > 0) {
|
||||
// RecyclerView recyclerView = holder.itemView.findViewById(R.id.rv_tags);
|
||||
// recyclerView.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
//
|
||||
// // 设置item之间的间隔为负值,实现重叠效果
|
||||
// if (recyclerView.getItemDecorationCount() == 0) {
|
||||
// recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
// @Override
|
||||
// public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
|
||||
// @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
// super.getItemOffsets(outRect, view, parent, state);
|
||||
// // 设置负间距实现重叠效果,根据需要调整数值
|
||||
// outRect.left = -dpToPx(holder.itemView.getContext(), 8); // 重叠8dp
|
||||
// }
|
||||
//
|
||||
// private int dpToPx(Context context, int dp) {
|
||||
// return (int) TypedValue.applyDimension(
|
||||
// TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
// context.getResources().getDisplayMetrics());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// CarouselImgAdapter adapter = new CarouselImgAdapter();
|
||||
//
|
||||
// // 创建最多包含3个元素的子列表
|
||||
// int endIndex = Math.min(user_list.size(), 3);
|
||||
// adapter.setNewData(user_list.subList(0, endIndex));
|
||||
// recyclerView.setAdapter(adapter);
|
||||
}
|
||||
// }
|
||||
|
||||
// 设置点击事件
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
|
||||
@@ -4,6 +4,7 @@ import static android.view.View.GONE;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -23,30 +24,28 @@ public class HotAdapter extends BaseMultiItemQuickAdapter<TopRoom, BaseViewHolde
|
||||
super(data);
|
||||
// addItemType(1, R.layout.index_rv_item_room_hot1);
|
||||
addItemType(1, R.layout.index_rv_item_room_hot0);
|
||||
|
||||
|
||||
}
|
||||
// 定义点击事件监听器接口
|
||||
public interface OnRoomClickListener {
|
||||
void onRoomClick(TopRoom room, int position);
|
||||
}
|
||||
|
||||
// 声明监听器实例
|
||||
private OnRoomClickListener mOnRoomClickListener;
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, TopRoom item) {
|
||||
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), helper.getView(R.id.iv_follow_bg));
|
||||
// if (item.getLabel_id().equals("23")){
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.diang_c);
|
||||
// }else if (item.getLabel_id().equals("108")){
|
||||
// helper.setImageResource(R.id.iv_type, R.mipmap.jiaoyou);
|
||||
// }else if (item.getLabel_id().equals("101")){
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.youxi);
|
||||
// }else if (item.getLabel_id().equals("120")){//女神
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nvshen);
|
||||
// }else if (item.getLabel_id().equals("121")){//男神
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nans);
|
||||
// }
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
|
||||
TextView tv_name = helper.getView(R.id.tv_name);
|
||||
tv_name.setText(item.getRoom_name());
|
||||
tv_name.setSelected(true);
|
||||
|
||||
|
||||
ImageView iv = helper.getView(R.id.iv_play);
|
||||
if (item.getUser_list()!=null && item.getUser_list().size() > 0) {
|
||||
iv.setVisibility(View.VISIBLE);
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, iv);
|
||||
}else {
|
||||
iv.setVisibility(GONE);
|
||||
}
|
||||
@@ -57,8 +56,11 @@ public class HotAdapter extends BaseMultiItemQuickAdapter<TopRoom, BaseViewHolde
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form","首页热门列表").withString("roomId", item.getId()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
// 如果外部设置了监听器,则触发外部监听器
|
||||
if (mOnRoomClickListener != null) {
|
||||
mOnRoomClickListener.onRoomClick(item, helper.getAdapterPosition());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -72,7 +74,10 @@ public class HotAdapter extends BaseMultiItemQuickAdapter<TopRoom, BaseViewHolde
|
||||
return String.valueOf(hotValue);
|
||||
}
|
||||
}
|
||||
|
||||
// 提供设置监听器的方法
|
||||
public void setOnRoomClickListener(OnRoomClickListener listener) {
|
||||
this.mOnRoomClickListener = listener;
|
||||
}
|
||||
@Override
|
||||
public void onViewRecycled(@NonNull BaseViewHolder holder) {
|
||||
Logger.e("onViewRecycled", "onViewRecycled");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import static android.app.PendingIntent.getActivity;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.view.View;
|
||||
@@ -9,6 +10,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevoice.R;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
@@ -25,8 +27,8 @@ public class SearchRoomResultAdapter extends BaseQuickAdapter<RoomSearchResp, Ba
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper,RoomSearchResp item) {
|
||||
ImageUtils.loadHeadCC(item.getPicture(), helper.getView(R.id.iv_follow_bg));
|
||||
helper.setText(R.id.tv_name, item.getName());
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), helper.getView(R.id.iv_follow_bg));
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
ImageView iv = helper.getView(R.id.iv_play);
|
||||
// if (item.getIcon()!=null && item.getIcon().size() > 0) {
|
||||
// iv.setVisibility(View.VISIBLE);
|
||||
@@ -34,17 +36,19 @@ public class SearchRoomResultAdapter extends BaseQuickAdapter<RoomSearchResp, Ba
|
||||
// }else {
|
||||
iv.setVisibility(GONE);
|
||||
// }
|
||||
helper.setText(R.id.tv_num, formatHotValue(Integer.parseInt(item.getHot_value())));
|
||||
helper.setText(R.id.tv_num, formatHotValue(Integer.parseInt(item.getHot_value()!=null ? item.getHot_value() : "0")));
|
||||
ImageUtils.loadHeadCC(item.getLabel_icon(), helper.getView(R.id.iv_type));
|
||||
|
||||
helper.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form","首页热门列表").withString("roomId", item.getId()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getId()).navigation();
|
||||
|
||||
}
|
||||
});
|
||||
// helper.setOnClickListener(R.id.iv_play,new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// RoomManager.getInstance().fetchRoomDataAndEnter(mContext.getApplicationContext(), item.getRoom_id() ,"");
|
||||
//
|
||||
//// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form","首页热门列表").withString("roomId", item.getId()).navigation();
|
||||
//// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getId()).navigation();
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
private String formatHotValue(int hotValue) {
|
||||
if (hotValue > 10000) {
|
||||
|
||||
@@ -3,21 +3,36 @@ package com.example.modulevoice.adapter;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevoice.R;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.UserResultResp;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.KeyWordUtil;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.BeautifulNameView;
|
||||
|
||||
/**
|
||||
* 搜索用户的结果
|
||||
*/
|
||||
public class SearchUserResultAdapter extends BaseQuickAdapter<UserResultResp, BaseViewHolder> {
|
||||
private OnItemClickListener mListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
|
||||
void onGnsClick(UserResultResp item);
|
||||
void onHeadImageClick(UserResultResp item);
|
||||
}
|
||||
|
||||
private String keyWord = "";
|
||||
|
||||
@@ -27,34 +42,35 @@ public class SearchUserResultAdapter extends BaseQuickAdapter<UserResultResp, Ba
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, UserResultResp item) {
|
||||
helper.setText(R.id.tv_nick_name, KeyWordUtil.matcherSearchTitle(Color.parseColor("#FFBC00"), item.getNickname(), keyWord));
|
||||
TextView textViewOnLine = helper.getView(R.id.tv_online);
|
||||
textViewOnLine.setText(item.getOnline_text());
|
||||
if (item.getOnline_text().equals("在线")) {
|
||||
Drawable drawable = mContext.getResources().getDrawable(com.xscm.moduleutil.R.mipmap.index_icon_online);
|
||||
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
|
||||
textViewOnLine.setCompoundDrawables(drawable, null, null, null);
|
||||
|
||||
helper.setText(R.id.dy_name_text, KeyWordUtil.matcherSearchTitle(Color.parseColor("#FFBC00"), item.getNickname(), keyWord));
|
||||
helper.setText(R.id.tv_id, "ID:" + item.getUser_code());
|
||||
MeHeadView headView = helper.getView(R.id.dy_head_image);
|
||||
headView.setData(item.getHead_picture(), "", item.getSex());
|
||||
// if (item.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
// helper.setVisible(R.id.gensui, false);
|
||||
// } else {
|
||||
// helper.setVisible(R.id.gensui, true);
|
||||
// }
|
||||
// 先判断不为null,再判断不是空字符串,且不是"0"(三个条件需同时满足)
|
||||
|
||||
if (item.getRoom_id() != null && !item.getRoom_id().isEmpty() && !"0".equals(item.getRoom_id())) {
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.gsui);
|
||||
} else {
|
||||
Drawable drawable = mContext.getResources().getDrawable(com.xscm.moduleutil.R.mipmap.index_icon_offline);
|
||||
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
|
||||
textViewOnLine.setCompoundDrawables(drawable, null, null, null);
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.six);
|
||||
}
|
||||
((BeautifulNameView) helper.getView(R.id.bnv_user_id)).setText(String.format(mContext.getResources().getString(R.string.common_id_formatter), item.getUser_code()));
|
||||
((BeautifulNameView) helper.getView(R.id.bnv_user_id)).setTextColor(!TextUtils.isEmpty(item.getId_color()) ? Color.parseColor(item.getId_color()) : mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_FFCCCCCC));
|
||||
((BeautifulNameView) helper.getView(R.id.bnv_user_id)).setPlay(!TextUtils.isEmpty(item.getId_color()));
|
||||
((BeautifulNameView) helper.getView(R.id.bnv_user_id)).setImgVisible("1".equals(item.getGood_number()));
|
||||
helper.setText(R.id.tv_separation, item.getFans_count());
|
||||
if ("0".equals(item.getFollow())) {
|
||||
helper.setText(R.id.tv_follow, "关注")
|
||||
.setBackgroundRes(R.id.tv_follow, com.xscm.moduleutil.R.drawable.common_sr_btn_bg);
|
||||
((TextView)helper.getView(R.id.tv_follow)).setTextColor(Color.parseColor("#ffffff"));
|
||||
} else {
|
||||
helper.setText(R.id.tv_follow, "已关注")
|
||||
.setBackgroundRes(R.id.tv_follow, com.xscm.moduleutil.R.drawable.common_zr_btn_bg_unfollow);
|
||||
((TextView)helper.getView(R.id.tv_follow)).setTextColor(Color.parseColor("#FFBC00"));
|
||||
}
|
||||
ImageUtils.loadHeadCC(item.getHead_picture(), helper.getView(R.id.riv_user_head));
|
||||
helper.addOnClickListener(R.id.tv_follow);
|
||||
helper.getView(R.id.dy_head_image).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mListener != null) mListener.onHeadImageClick(item);
|
||||
}
|
||||
});
|
||||
|
||||
helper.getView(R.id.gensui).setOnClickListener(v -> {
|
||||
if (mListener!=null){
|
||||
mListener.onGnsClick(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.HomeBean;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,6 +20,12 @@ public class HotListContacts {
|
||||
void finishRefreshLoadMore();
|
||||
|
||||
void getMoreRoomList(List<HomeBean> data);
|
||||
|
||||
void roomInfo(RoomInfoResp resp);
|
||||
|
||||
void showPasswordDialog();
|
||||
|
||||
void enterFail();
|
||||
}
|
||||
|
||||
public interface IHotListPre extends IPresenter {
|
||||
@@ -27,5 +34,7 @@ public class HotListContacts {
|
||||
void getMoreRoomList(String userId);
|
||||
|
||||
void getRoomListTow();
|
||||
|
||||
void getRoomIn(String roomId, String password);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RecordSection;
|
||||
import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.bean.SearchAll;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,7 +16,7 @@ public final class SearchContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void setSearchHistory(List<String> data);
|
||||
|
||||
void setSearch(List<RoomSearchResp> data);
|
||||
void setSearch(SearchAll data);
|
||||
|
||||
void setFuzzyQuery(List<RecordSection> data);
|
||||
|
||||
@@ -31,7 +32,7 @@ public final class SearchContacts {
|
||||
|
||||
void deleteSearchHistory();
|
||||
|
||||
void search(String keyWord,String type);
|
||||
void search(String keyWord);
|
||||
|
||||
void fuzzyQuery(String keyWord);
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ public final class VoiceCategoryContacts {
|
||||
void setRoomId(String roomId);
|
||||
|
||||
void setTopRoom(List<TopRoom> topRooms,int type);
|
||||
|
||||
void finishRefreshLoadMore();
|
||||
}
|
||||
|
||||
public interface IIndexCategoryPre extends IPresenter {
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
|
||||
|
||||
public final class VoiceContacts {
|
||||
@@ -12,6 +13,7 @@ public final class VoiceContacts {
|
||||
// void setBanners(List<BannerResp> list);
|
||||
|
||||
void hideRecommend(boolean hideRecommend,boolean hideGame);
|
||||
void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission);
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +22,9 @@ public final class VoiceContacts {
|
||||
void getBanners();
|
||||
|
||||
void getNameAuthResult(int type);
|
||||
|
||||
void activitiesPermission();//活动弹框权限
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,11 +14,16 @@ import com.example.modulevoice.contacts.HotListContacts;
|
||||
import com.example.modulevoice.databinding.FragmentHotListBinding;
|
||||
import com.example.modulevoice.presenter.HotListPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.HomeBean;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.xscm.moduleutil.utils.ClickUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -104,13 +109,33 @@ public class HotListFragment extends BaseMvpFragment<HotListPresenter, FragmentH
|
||||
MvpPre.getRoomList(2, page+"", "20", "1", label_id);
|
||||
}
|
||||
});
|
||||
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
|
||||
mAdapter.setOnRoomClickListener(new HotAdapter.OnRoomClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
public void onRoomClick(TopRoom room, int position) {
|
||||
if ( ClickUtils.isFastDoubleClick()){
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加索引有效性检查
|
||||
if (position < 0 || position >= mAdapter.getData().size()) {
|
||||
return;
|
||||
}
|
||||
TopRoom item = mAdapter.getItem(position);
|
||||
if (item != null) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form","首页热门列表").withString("roomId", item.getId()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
if (item != null ) {
|
||||
// MessageListenerSingleton.getInstance().joinGroup(item.getRoom_id());
|
||||
// RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), item.getRoom_id() +"","");
|
||||
MessageListenerSingleton.getInstance().joinGroup(item.getRoom_id());
|
||||
|
||||
// 等待一段时间确保退出完成
|
||||
// try {
|
||||
// Thread.sleep(500);
|
||||
// } catch (InterruptedException e) {
|
||||
// Thread.currentThread().interrupt();
|
||||
// }
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), item.getRoom_id(), "");
|
||||
// MvpPre.getRoomIn(item.getRoom_id(), "");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -155,10 +180,26 @@ public class HotListFragment extends BaseMvpFragment<HotListPresenter, FragmentH
|
||||
public void finishRefreshLoadMore() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
CommonAppContext.getInstance().isRoomJoininj=false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMoreRoomList(List<HomeBean> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomInfo(RoomInfoResp resp) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withSerializable("roomInfo", resp).withString("roomId", resp.getRoom_info().getRoom_id()).navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPasswordDialog() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterFail() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.example.modulevoice.fragment;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -21,14 +22,21 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.activity.PopularRoomActivity;
|
||||
import com.example.modulevoice.activity.RankingListActivity;
|
||||
import com.example.modulevoice.adapter.CarouselBannerAdapter;
|
||||
import com.example.modulevoice.contacts.VoiceCategoryContacts;
|
||||
import com.example.modulevoice.databinding.FragmentVoiceCategoryBinding;
|
||||
import com.example.modulevoice.presenter.VoiceCategoryPresenter;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.activity.news.OfficialNoticeActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
@@ -37,9 +45,12 @@ import com.xscm.moduleutil.event.RoomGiftRunable;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.stx.xhb.xbanner.XBanner;
|
||||
import com.xscm.moduleutil.utils.logger.DataLogger;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
import com.zhpan.bannerview.utils.BannerUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Logger;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@@ -122,43 +133,33 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
* type=1时,该值表示房间id;type=2时,表示文章id
|
||||
*/
|
||||
BannerModel bannerModel = (BannerModel) model;
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url",bannerModel.getUrl()).withString("title", "首页横幅").navigation();
|
||||
Intent intent=new Intent(getActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", bannerModel.getUrl());
|
||||
intent.putExtra("title", "首页横幅");
|
||||
startActivity(intent);
|
||||
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", bannerModel.getUrl()).withString("title", "首页横幅").navigation();
|
||||
}
|
||||
});
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
requireActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int screenWidth = displayMetrics.widthPixels;
|
||||
|
||||
int bannerWidth = screenWidth - (20 * 2); // 减去左右边距
|
||||
int bannerHeight = bannerWidth * 9 / 16; // 16:9 比例
|
||||
carouselBannerAdapter = new CarouselBannerAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setRevealWidth(250, 250)
|
||||
.setPageStyle(PageStyle.MULTI_PAGE_SCALE, 0.5f)
|
||||
.setAdapter(carouselBannerAdapter)
|
||||
// .setPageStyle(PageStyle.MULTI_PAGE_OVERLAP, 0.6f)
|
||||
.create();
|
||||
|
||||
|
||||
mBinding.bannerViewPager.setIndicatorVisibility(GONE);
|
||||
mBinding.constraintLayout.setVisibility(GONE);
|
||||
|
||||
carouselBannerAdapter.setOnItemClickListener((view, data, position) -> {
|
||||
// 示例:跳转到房间详情页
|
||||
// 示例:跳转到房间 详情页
|
||||
if (data != null) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS)
|
||||
.withString("form", "首页热门列表")
|
||||
.withString("roomId", data.getRoom_id())
|
||||
.navigation();
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), data.getRoom_id() ,"");
|
||||
}
|
||||
});
|
||||
// mBinding.marqueeView.setOnItemClickListener(new MarqueeView.OnItemClickListener() {
|
||||
// @Override
|
||||
// public void onItemClick(int position, TextView textView) {
|
||||
//
|
||||
// ToastUtils.show("点击了第 " + position + " 个 item");
|
||||
// }
|
||||
// });
|
||||
|
||||
mBinding.tvWg.setOnClickListener(v -> {
|
||||
if (mBinding.marqueeView == null || mqttList == null || mqttList.isEmpty()) {
|
||||
// 可以选择在这里添加日志或提示
|
||||
@@ -177,11 +178,13 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
if (item != null) { // 再次检查 item 是否为 null
|
||||
String roomId = item.getRoom_id(); // 或者 item.getRoomId(); 确保方法名正确
|
||||
if (roomId != null && !roomId.isEmpty()) { // 检查 roomId 是否有效
|
||||
ARouter.getInstance()
|
||||
.build(ARouteConstants.ROOM_DETAILS)
|
||||
.withString("form", "首页热门列表")
|
||||
.withString("roomId", roomId)
|
||||
.navigation();
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), roomId,"");
|
||||
|
||||
// ARouter.getInstance()
|
||||
// .build(ARouteConstants.ROOM_DETAILS)
|
||||
// .withString("form", "首页热门列表")
|
||||
// .withString("roomId", roomId)
|
||||
// .navigation();
|
||||
} else {
|
||||
// Log.d(TAG, "Room ID is null or empty for item at position: " + position);
|
||||
}
|
||||
@@ -192,12 +195,28 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.homePhb.setOnClickListener(v -> {
|
||||
startActivity(new Intent(getContext(), RankingListActivity.class));
|
||||
});
|
||||
|
||||
mBinding.myHome.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM).navigation();
|
||||
});
|
||||
|
||||
mBinding.homeGg.setOnClickListener(v -> {
|
||||
Intent intent=new Intent(getActivity(), OfficialNoticeActivity.class);
|
||||
intent.putExtra("type", "2");
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
mBinding.imX.setOnClickListener(v -> {
|
||||
Intent intent=new Intent(getActivity(), PopularRoomActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(MqttBean event) {
|
||||
if (event!=null) {
|
||||
|
||||
public void onEvent1() {
|
||||
try {
|
||||
List<MqttBean> cachedMqttBeans = RoomGiftRunable.getMqttCache();
|
||||
if (cachedMqttBeans == null || cachedMqttBeans.isEmpty()) {
|
||||
mBinding.rl.setVisibility(GONE);
|
||||
@@ -211,16 +230,27 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
mqttList.clear();
|
||||
info.clear();
|
||||
// 处理缓存数据
|
||||
for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// 处理每一条 mqttBean 数据
|
||||
mqttList.add(mqttBean.getList());
|
||||
info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
|
||||
// 处理每一条 mqttBean 数据
|
||||
// for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// mqttList.addAll(mqttBean.getList());
|
||||
// info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
//// info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
// }
|
||||
|
||||
for (int i=0;i<cachedMqttBeans.size();i++){
|
||||
mqttList.addAll(cachedMqttBeans.get(i).getList());
|
||||
}
|
||||
for (int i=0;i<mqttList.size();i++){
|
||||
info.add(mqttList.get(i).getFromUserName() + "送给" + mqttList.get(i).getToUserName() + "\n" + mqttList.get(i).getGiftName());
|
||||
}
|
||||
|
||||
|
||||
mBinding.marqueeView.startWithList(info);
|
||||
}else {
|
||||
mBinding.rl.setVisibility(View.GONE);
|
||||
} catch (Exception e) {
|
||||
DataLogger.LogUtil.d("onEvent1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
@@ -232,58 +262,73 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
onEvent(null);
|
||||
onEvent1();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCategories(List<RoomTypeModel> list) {
|
||||
// adapter = new MyFragmentPagerAdapter(getChildFragmentManager(), list);
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getActivity(), list));
|
||||
// mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
// mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
// // 数据有效性检查
|
||||
if (list == null || list.isEmpty() || getActivity() == null) {
|
||||
try {
|
||||
ToastUtils.showLong("登录已过期,请重新登录");
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建适配器
|
||||
MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getActivity(), list);
|
||||
mBinding.viewPager.setAdapter(adapter);
|
||||
|
||||
// 设置 TabLayout 与 ViewPager2 的关联
|
||||
new TabLayoutMediator(mBinding.slidingTabLayout, mBinding.viewPager,
|
||||
(tab, position) -> {
|
||||
// 创建自定义布局
|
||||
View customView = LayoutInflater.from(requireContext())
|
||||
.inflate(R.layout.custom_tab_layout, null);
|
||||
@SuppressLint({"MissingInflatedId", "LocalSuppress"})
|
||||
TextView textView = customView.findViewById(R.id.tab_text);
|
||||
textView.setText(list.get(position).getLabel_name());
|
||||
// 边界检查
|
||||
if (position >= 0 && position < list.size() && list.get(position) != null) {
|
||||
// 创建自定义布局
|
||||
View customView = LayoutInflater.from(requireContext())
|
||||
.inflate(R.layout.custom_tab_layout, null);
|
||||
TextView textView = customView.findViewById(R.id.tab_text);
|
||||
textView.setText(list.get(position).getLabel_name());
|
||||
|
||||
// 设置初始状态
|
||||
if (position == 0) {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||
textView.setTextColor(getResources().getColor(android.R.color.white));
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_indicator);
|
||||
} else {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textView.setTextColor(Color.parseColor("#F1ECFF"));
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_unselected_background);
|
||||
// 设置初始状态
|
||||
if (position == 0) {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||
textView.setTextColor(getResources().getColor(android.R.color.white));
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_indicator);
|
||||
} else {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textView.setTextColor(Color.parseColor("#F1ECFF"));
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_unselected_background);
|
||||
}
|
||||
|
||||
tab.setCustomView(customView);
|
||||
}
|
||||
|
||||
tab.setCustomView(customView);
|
||||
}
|
||||
).attach();
|
||||
|
||||
mBinding.slidingTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
View customView = tab.getCustomView();
|
||||
if (customView != null) {
|
||||
TextView textView = customView.findViewById(R.id.tab_text);
|
||||
if (textView != null) {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||
textView.setTextColor(getResources().getColor(android.R.color.white));
|
||||
}
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_indicator);
|
||||
}
|
||||
int position = tab.getPosition();
|
||||
RoomTypeModel roomTypeModel = list.get(position);
|
||||
String categoryId = roomTypeModel.getId();
|
||||
// 通知对应的Fragment更新数据
|
||||
HotListFragment.newInstance(categoryId, TYPE_INDEX);
|
||||
// 边界检查
|
||||
if (position >= 0 && position < list.size()) {
|
||||
View customView = tab.getCustomView();
|
||||
if (customView != null) {
|
||||
TextView textView = customView.findViewById(R.id.tab_text);
|
||||
if (textView != null) {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||
textView.setTextColor(getResources().getColor(android.R.color.white));
|
||||
}
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_indicator);
|
||||
}
|
||||
|
||||
RoomTypeModel roomTypeModel = list.get(position);
|
||||
String categoryId = roomTypeModel.getId();
|
||||
HotListFragment.newInstance(categoryId, TYPE_INDEX);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -306,8 +351,11 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
});
|
||||
|
||||
// 设置默认选中的标签
|
||||
mBinding.slidingTabLayout.selectTab(mBinding.slidingTabLayout.getTabAt(0));
|
||||
if (mBinding.slidingTabLayout.getTabCount() > 0) {
|
||||
mBinding.slidingTabLayout.selectTab(mBinding.slidingTabLayout.getTabAt(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBanners(List<BannerModel> bannerModels) {
|
||||
mBinding.banner.setBannerData(R.layout.index_image_banner, bannerModels);
|
||||
@@ -331,6 +379,11 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
mBinding.bannerViewPager.create(topRooms); // 刷新数据并启动自动播放
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefreshLoadMore() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -341,7 +394,7 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
private List<RoomTypeModel> list;
|
||||
|
||||
|
||||
// public MyFragmentPagerAdapter(FragmentManager fm, List<RoomTypeModel> list) {
|
||||
// public MyFragmentPagerAdapter(FragmentManager fm, List<RoomTypeModel> list) {
|
||||
// super(fm);
|
||||
// this.list = list;
|
||||
// }
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.activity.RankingListActivity;
|
||||
import com.example.modulevoice.activity.SearchActivity;
|
||||
@@ -13,6 +14,10 @@ import com.example.modulevoice.databinding.FragmentVoiceBinding;
|
||||
import com.example.modulevoice.presenter.VoicePresenter;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.dialog.FirstChargeDialog;
|
||||
import com.xscm.moduleutil.dialog.RechargeDialogFragment;
|
||||
import com.xscm.moduleutil.dialog.YouthModelDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -118,12 +123,50 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
// 记录已经显示过青少年模式弹窗
|
||||
SpUtil.setBooleanValue("youth_model_shown", true);
|
||||
dialog.dismiss();
|
||||
MvpPre.activitiesPermission();
|
||||
|
||||
// 在这里可以继续显示其他弹窗,如首充弹窗
|
||||
// showFirstChargeDialog();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2025/10/12 首充好礼
|
||||
private void firstCharge(){
|
||||
FirstChargeDialog firstChargeDialog = new FirstChargeDialog(getActivity());
|
||||
firstChargeDialog.show();
|
||||
firstChargeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
//首充弹窗关闭后,弹首充
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
firstChargeDialog.setOnFirstChargeListener(new FirstChargeDialog.OnFirstChargeListener() {
|
||||
@Override
|
||||
public void onFirstChargeConfirmed(FirstChargeGiftBean giftBean, int type) {
|
||||
String s = "";
|
||||
String gift_bag_id= "";
|
||||
if (giftBean.getGift_bag().size()!=0) {
|
||||
gift_bag_id = giftBean.getGift_bag().get(0).getGift_bag_id();
|
||||
s = giftBean.getGift_bag().get(0).getMoney();
|
||||
}
|
||||
if (s == null) {
|
||||
ToastUtils.showShort("暂无礼物");
|
||||
return;
|
||||
}
|
||||
|
||||
RechargeDialogFragment.show(null, s, getChildFragmentManager(),gift_bag_id,"1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstChargeCancelled() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initListener () {
|
||||
super.initListener();
|
||||
@@ -146,4 +189,13 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
fragments.add(VoiceCategoryFragment.newInstance());
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(fragments, getChildFragmentManager()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission) {
|
||||
if (activitiesPermission != null) {
|
||||
if (activitiesPermission.getFirst_charge_permission() == 1) {
|
||||
firstCharge();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,16 @@ package com.example.modulevoice.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.example.modulevoice.contacts.HotListContacts;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.http.APIException;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.utils.GsonUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
@@ -58,6 +63,68 @@ public class HotListPresenter extends BasePresenter<HotListContacts.View> implem
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2025/6/10 加入房间
|
||||
@Override
|
||||
public void getRoomIn(String roomId, String password) {
|
||||
|
||||
// Type listType = new TypeToken<RoomInfoResp>() {}.getType();
|
||||
// RoomInfoResp restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getRoomInfoResp(), listType);
|
||||
// if (restoredRoomModels!= null ) {
|
||||
// MvpRef.get().roomInfo(restoredRoomModels);
|
||||
// }
|
||||
|
||||
api.roomGetIn(roomId, password, new BaseObserver<RoomInfoResp>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(RoomInfoResp resp) {
|
||||
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
|
||||
String token = resp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
|
||||
String roomId = resp.getRoom_info().getRoom_id(); // 房间 ID
|
||||
String rtm_token=resp.getUser_info().getAgora_rtm_token();
|
||||
SpUtil.setRtmToken(rtm_token);
|
||||
int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
|
||||
boolean enableMic = false; // 是否开启麦克风
|
||||
boolean enableJs=false; // 是否开启角色
|
||||
if (resp.getUser_info().getPit_number()!=0){
|
||||
enableJs=true;
|
||||
}
|
||||
LogUtils.e("token",token);
|
||||
LogUtils.e("roomId:",roomId);
|
||||
// 初始化 Agora 并加入房间
|
||||
AgoraManager.getInstance(getView().getSelfActivity())
|
||||
.joinRoom(token, roomId, uid, enableMic,enableJs);
|
||||
// 2. 加入房间
|
||||
// rtcCore.joinRoom(token, roomId, uid, enableMic);
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().roomInfo(resp);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
if (e instanceof APIException) {
|
||||
APIException apiException = (APIException) e;
|
||||
if (apiException.getCode() == 10000) {
|
||||
MvpRef.get().showPasswordDialog();
|
||||
} else {
|
||||
MvpRef.get().enterFail();
|
||||
}
|
||||
} else {
|
||||
MvpRef.get().enterFail();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMoreRoomList(String userId) {
|
||||
// Type listType = new TypeToken<List<HomeBean>>() {}.getType();
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.blankj.utilcode.util.StringUtils;
|
||||
import com.example.modulevoice.contacts.SearchContacts;
|
||||
import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.bean.SearchAll;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -48,10 +49,10 @@ public class SearchPresenter extends BasePresenter<SearchContacts.View> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void search(String keyWord,String type) {
|
||||
public void search(String keyWord) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A020301, "send_value", keyWord);
|
||||
// MvpRef.get().showLoadings();
|
||||
api.getSearch(keyWord,type, new BaseObserver<List<RoomSearchResp>>() {
|
||||
api.getSearchAll(keyWord, new BaseObserver<SearchAll>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -59,7 +60,7 @@ public class SearchPresenter extends BasePresenter<SearchContacts.View> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoomSearchResp> searchResps) {
|
||||
public void onNext(SearchAll searchResps) {
|
||||
MvpRef.get().setSearch(searchResps);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -41,41 +41,18 @@ public class VoiceCategoryPresenter extends BasePresenter<VoiceCategoryContacts.
|
||||
@Override
|
||||
public void onNext(List<RoomTypeModel> list) {
|
||||
SpUtil.setRoomTypeModel(GsonUtils.getGSON().toJson(list));
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setCategories(list);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// List<RoomTypeModel> list = new ArrayList<RoomTypeModel>();
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// RoomTypeModel roomTypeModel = new RoomTypeModel();
|
||||
// roomTypeModel.setId(i+"");
|
||||
// roomTypeModel.setName("分类"+i);
|
||||
// roomTypeModel.setSort(i+"");
|
||||
// roomTypeModel.setType("1");
|
||||
// list.add(roomTypeModel);
|
||||
// }
|
||||
// MvpRef.get().setCategories(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMediaRoom(String label_id) {
|
||||
// ApiClient.getInstance().getMediaRoom(label_id,new BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String roomId) {
|
||||
// MvpRef.get().setRoomId(roomId);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//// MvpRef.get().disLoadings();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public void getBanners() {
|
||||
@@ -103,11 +80,11 @@ public class VoiceCategoryPresenter extends BasePresenter<VoiceCategoryContacts.
|
||||
@Override
|
||||
public void getCarousels(int type, int page, String page_limit, String is_top, String label_id) {
|
||||
if (type == 1) {//这是获取顶部的推荐房间
|
||||
Type listType = new TypeToken<List<TopRoom>>() {}.getType();
|
||||
List<TopRoom> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getTopRoomTop(), listType);
|
||||
if (restoredRoomModels!= null && restoredRoomModels.size() > 0) {
|
||||
MvpRef.get().setTopRoom(restoredRoomModels,type);
|
||||
}
|
||||
// Type listType = new TypeToken<List<TopRoom>>() {}.getType();
|
||||
// List<TopRoom> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getTopRoomTop(), listType);
|
||||
// if (restoredRoomModels!= null && restoredRoomModels.size() > 0) {
|
||||
// MvpRef.get().setTopRoom(restoredRoomModels,type);
|
||||
// }
|
||||
api.getTopRooms(page+"",page_limit,is_top,label_id,new BaseObserver<List<TopRoom>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -117,16 +94,20 @@ public class VoiceCategoryPresenter extends BasePresenter<VoiceCategoryContacts.
|
||||
@Override
|
||||
public void onNext(List<TopRoom> topRooms) {
|
||||
SpUtil.setTopRoomTop(GsonUtils.getGSON().toJson(topRooms));
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setTopRoom(topRooms,type);
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
|
||||
}
|
||||
});
|
||||
}else if (type == 2){//这是获取所有房间
|
||||
Type listType = new TypeToken<List<TopRoom>>() {}.getType();
|
||||
List<TopRoom> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getTopRoom(), listType);
|
||||
if (restoredRoomModels!= null && restoredRoomModels.size() > 0) {
|
||||
MvpRef.get().setTopRoom(restoredRoomModels, type);
|
||||
}
|
||||
// Type listType = new TypeToken<List<TopRoom>>() {}.getType();
|
||||
// List<TopRoom> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getTopRoom(), listType);
|
||||
// if (restoredRoomModels!= null && restoredRoomModels.size() > 0) {
|
||||
// MvpRef.get().setTopRoom(restoredRoomModels, type);
|
||||
// }
|
||||
api.getTopRooms(page+"",page_limit,is_top,label_id,new BaseObserver<List<TopRoom>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -135,34 +116,14 @@ public class VoiceCategoryPresenter extends BasePresenter<VoiceCategoryContacts.
|
||||
|
||||
@Override
|
||||
public void onNext(List<TopRoom> topRooms) {
|
||||
SpUtil.setTopRoom(GsonUtils.getGSON().toJson(topRooms));
|
||||
// SpUtil.setTopRoom(GsonUtils.getGSON().toJson(topRooms));
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setTopRoom(topRooms,type);
|
||||
|
||||
MvpRef.get().finishRefreshLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// List<TopRoom> topRooms = new ArrayList<TopRoom>();
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// TopRoom topRoom = new TopRoom();
|
||||
// topRoom.setRoom_name("名:"+i);
|
||||
// topRoom.setCover_picture("");
|
||||
// topRoom.setUser_count("123");
|
||||
// topRoom.setUser_list(new ArrayList<TopRoom.UserList>());
|
||||
// TopRoom.UserList userList = new TopRoom.UserList();
|
||||
// userList.setHead_picture("");
|
||||
// topRoom.getUser_list().add(userList);
|
||||
// topRoom.setOn_line("123");
|
||||
// topRoom.setChatrooms("123");
|
||||
// topRoom.setPopularity("123");
|
||||
// topRoom.setRoom_id("123");
|
||||
// topRoom.setLabel_id("123");
|
||||
// topRoom.setVoice("123");
|
||||
// topRoom.setUser_id("123");
|
||||
// topRooms.add(topRoom);
|
||||
// }
|
||||
// MvpRef.get().setTopRoom(topRooms);
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,19 @@ package com.example.modulevoice.presenter;
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulevoice.contacts.VoiceContacts;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class VoicePresenter extends BasePresenter<VoiceContacts.View> implements VoiceContacts.IIndexPre {
|
||||
|
||||
private VoiceContacts.View mView;
|
||||
public VoicePresenter(VoiceContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
this.mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,4 +114,22 @@ public class VoicePresenter extends BasePresenter<VoiceContacts.View> implements
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_NAME_AUTH).withString("from","我的界面").navigation();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activitiesPermission() {
|
||||
api.activitiesPermission(new BaseObserver<ActivitiesPermission>() {
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
addDisposable( d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull ActivitiesPermission activitiesPermission) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().activitiesPermissionSuccess(activitiesPermission);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -31,8 +31,8 @@
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_6"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_search_in"
|
||||
@@ -53,7 +53,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="输入相关的房间名"
|
||||
android:hint="输入相关的房间/用户"
|
||||
android:maxLength="10"
|
||||
android:singleLine="true"
|
||||
android:textColor="#333333"
|
||||
@@ -70,8 +70,7 @@
|
||||
android:paddingRight="@dimen/dp_20"
|
||||
android:text="取消"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
/>
|
||||
android:textSize="@dimen/sp_14" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -99,8 +98,7 @@
|
||||
android:text="历史记录"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="normal"
|
||||
/>
|
||||
android:textStyle="normal" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_delete"
|
||||
@@ -108,7 +106,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -143,24 +141,24 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFF"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_room"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:background="#F4F4F4"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_20">
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="相关房间"
|
||||
android:textColor="#ff9c9c9c"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_count"
|
||||
@@ -178,23 +176,24 @@
|
||||
android:id="@+id/recycle_view_room"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:padding="@dimen/dp_17" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_user"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="@color/color_F9FAFA">
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:text="相关用户"
|
||||
android:textColor="#ff9c9c9c"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -202,8 +201,10 @@
|
||||
android:id="@+id/recycle_view_user"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:padding="@dimen/dp_17" />
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@@ -224,8 +225,7 @@
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,106 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@mipmap/home_bj">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@mipmap/home_bj">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_45"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_45"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/app_name_bg"
|
||||
android:textSize="@dimen/sp_25"
|
||||
android:textStyle="normal"
|
||||
android:layout_marginLeft="@dimen/dp_15"/>
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/app_name_bg"
|
||||
android:textSize="@dimen/sp_25"
|
||||
android:textStyle="normal"
|
||||
android:layout_marginLeft="@dimen/dp_15"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_search"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_search_in"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:src="@drawable/index_level_search" />
|
||||
<TextView
|
||||
android:id="@+id/edit_query"
|
||||
android:id="@+id/ll_search"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_search_in"
|
||||
android:gravity="center_vertical"
|
||||
android:text="请输入ID/房间名称"
|
||||
android:maxLength="10"
|
||||
android:paddingLeft="@dimen/dp_12"
|
||||
android:paddingRight="@dimen/dp_12"
|
||||
android:textColor="#999999"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:src="@drawable/index_level_search"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/edit_query"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="请输入ID/房间名称"
|
||||
android:maxLength="10"
|
||||
android:paddingLeft="@dimen/dp_12"
|
||||
android:paddingRight="@dimen/dp_12"
|
||||
android:textColor="#999999"
|
||||
android:textSize="@dimen/sp_14"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room3"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/index_level_search_o"
|
||||
android:layout_toStartOf="@+id/iv_ranking_list"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="@dimen/dp_11"/>
|
||||
android:id="@+id/iv_room3"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/index_level_search_o"
|
||||
android:layout_toStartOf="@+id/iv_ranking_list"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_11"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ranking_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@+id/iv_room"
|
||||
android:layout_marginEnd="@dimen/dp_11"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_home_rank" />
|
||||
android:id="@+id/iv_ranking_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@+id/iv_room"
|
||||
android:layout_marginEnd="@dimen/dp_11"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_home_rank"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:src="@mipmap/ic_paidui_home"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginEnd="@dimen/dp_11"/>
|
||||
android:id="@+id/iv_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:src="@mipmap/ic_paidui_home"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginEnd="@dimen/dp_11"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.ScrollViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:background="@color/color_transparent" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:background="@color/color_transparent"/>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -1,154 +1,307 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_transparent"
|
||||
app:elevation="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraint_layout"
|
||||
android:id="@+id/app_bar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingRight="16dp"
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
android:background="@color/color_transparent"
|
||||
app:elevation="0dp">
|
||||
|
||||
<!-- <com.stx.xhb.xbanner.XBanner-->
|
||||
<!-- android:id="@+id/banner"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:AutoPlayTime="3000"-->
|
||||
<!-- app:isAutoPlay="true"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintDimensionRatio="340:96"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:pointsVisibility="false"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view_pager"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraint_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:bvp_indicator_visibility="gone"
|
||||
app:layout_constraintDimensionRatio="H,16:9"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingRight="16dp"
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_31"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@mipmap/xiaox_b"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@+id/banner_view_pager">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_h_t"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_hot"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:src="@mipmap/pp"
|
||||
android:visibility="invisible"/>
|
||||
android:id="@+id/rm_home"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/home_rm"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/my_home"
|
||||
app:layout_constraintWidth_percent="0.5"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_hr"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
app:layout_constraintTop_toTopOf="@+id/rm_home"
|
||||
app:layout_constraintStart_toStartOf="@+id/rm_home"
|
||||
android:src="@mipmap/f_h"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginStart="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_20"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_hr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@+id/im_hr"
|
||||
app:layout_constraintTop_toTopOf="@+id/im_hr"
|
||||
android:text="热门房间"
|
||||
android:textColor="#fff1ecff"
|
||||
android:fontFamily="@font/youshebiaotihei"
|
||||
android:textSize="@dimen/sp_17"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_x"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_home_hr"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_home_hr"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_home_hr"
|
||||
android:src="@mipmap/home_xx"
|
||||
android:layout_marginStart="@dimen/dp_16"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view_pager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:bvp_indicator_visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/im_x"
|
||||
app:layout_constraintStart_toStartOf="@+id/im_hr"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_home_hr"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/my_home"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/my_home"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/rm_home"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
android:layout_marginStart="@dimen/dp_14"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_home"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/my_home"
|
||||
app:layout_constraintTop_toTopOf="@+id/my_home"
|
||||
android:text="我的房间"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:textColor="#fff1ecff"
|
||||
android:fontFamily="@font/youshebiaotihei"
|
||||
android:textSize="@dimen/sp_17"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_my_home"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_my_home"
|
||||
android:text="进行一场灵魂深聊"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="@dimen/sp_11"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/home_phb"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/home_phb"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toBottomOf="@+id/my_home"
|
||||
app:layout_constraintStart_toStartOf="@+id/my_home"
|
||||
app:layout_constraintEnd_toEndOf="@+id/my_home"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
android:layout_marginTop="@dimen/dp_8"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_phb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/home_phb"
|
||||
app:layout_constraintTop_toTopOf="@+id/home_phb"
|
||||
android:text="排行榜"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:textColor="#fff1ecff"
|
||||
android:fontFamily="@font/youshebiaotihei"
|
||||
android:textSize="@dimen/sp_17"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_home_phb"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_home_phb"
|
||||
android:text="荣耀之巅 彰显实力"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="@dimen/sp_11"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/home_gg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/home_gg"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_phb"
|
||||
app:layout_constraintStart_toStartOf="@+id/home_phb"
|
||||
app:layout_constraintEnd_toEndOf="@+id/home_phb"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
android:layout_marginTop="@dimen/dp_8"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_gg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/home_gg"
|
||||
app:layout_constraintTop_toTopOf="@+id/home_gg"
|
||||
android:text="官方公告"
|
||||
android:layout_marginStart="@dimen/dp_11"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:textColor="#fff1ecff"
|
||||
android:fontFamily="@font/youshebiaotihei"
|
||||
android:textSize="@dimen/sp_17"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_home_gg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_home_gg"
|
||||
android:text="政策变动一键留痕"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="@dimen/sp_11"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_31"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@mipmap/xiaox_b"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_h_t">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_hot"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:src="@mipmap/pp"
|
||||
android:visibility="invisible"/>
|
||||
|
||||
|
||||
<com.sunfusheng.marqueeview.MarqueeView
|
||||
android:id="@+id/marqueeView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_toStartOf="@+id/tv_wg"
|
||||
android:layout_toEndOf="@+id/tv_hot"
|
||||
app:mvAnimDuration="1000"
|
||||
app:mvInterval="3000"
|
||||
app:mvSingleLine="true"
|
||||
app:mvTextColor="#B49FFF"
|
||||
app:mvTextSize="@dimen/sp_14" />
|
||||
android:id="@+id/marqueeView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_toStartOf="@+id/tv_wg"
|
||||
android:layout_toEndOf="@+id/tv_hot"
|
||||
app:mvAnimDuration="1000"
|
||||
app:mvInterval="3000"
|
||||
app:mvSingleLine="true"
|
||||
app:mvTextColor="#B49FFF"
|
||||
app:mvTextSize="@dimen/sp_14"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_wg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/wg" />
|
||||
android:id="@+id/tv_wg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/wg"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.stx.xhb.xbanner.XBanner
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:AutoPlayTime="3000"
|
||||
app:isAutoPlay="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="340:96"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl"
|
||||
app:pointsVisibility="false" />
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:AutoPlayTime="3000"
|
||||
app:isAutoPlay="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="340:96"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl"
|
||||
app:pointsVisibility="false"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/sliding_tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabTextColor="#F1ECFF"
|
||||
app:tabTextAppearance="@style/CustomTabTextAppearance"
|
||||
app:tabIndicatorFullWidth="true"
|
||||
app:tabMode="fixed"/>
|
||||
<!-- app:tl_indicator_corner_radius="@dimen/dp_3"-->
|
||||
<!-- app:tl_indicator_drawable="@mipmap/tab_dy"-->
|
||||
<!-- app:tl_indicator_height="@dimen/dp_6"-->
|
||||
<!-- app:tl_indicator_margin_bottom="@dimen/dp_3"-->
|
||||
<!-- app:tl_indicator_width="@dimen/dp_28"-->
|
||||
<!-- app:tl_showCateIndicator="true"-->
|
||||
<!-- app:tl_tab_width="@dimen/dp_50"-->
|
||||
<!-- app:tl_textBold="SELECT"-->
|
||||
<!-- app:tl_textSelectColor="@color/white"-->
|
||||
<!-- app:tl_textSelectedSize="@dimen/sp_14"-->
|
||||
<!-- app:tl_textUnselectColor="#F1ECFF"-->
|
||||
<!-- app:tl_textsize="@dimen/sp_12" />-->
|
||||
android:id="@+id/sliding_tab_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
app:tabIndicatorHeight="0dp"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabTextColor="#F1ECFF"
|
||||
app:tabTextAppearance="@style/CustomTabTextAppearance"
|
||||
app:tabIndicatorFullWidth="true"
|
||||
app:tabMode="scrollable"/>
|
||||
<!-- app:tl_indicator_corner_radius="@dimen/dp_3"-->
|
||||
<!-- app:tl_indicator_drawable="@mipmap/tab_dy"-->
|
||||
<!-- app:tl_indicator_height="@dimen/dp_6"-->
|
||||
<!-- app:tl_indicator_margin_bottom="@dimen/dp_3"-->
|
||||
<!-- app:tl_indicator_width="@dimen/dp_28"-->
|
||||
<!-- app:tl_showCateIndicator="true"-->
|
||||
<!-- app:tl_tab_width="@dimen/dp_50"-->
|
||||
<!-- app:tl_textBold="SELECT"-->
|
||||
<!-- app:tl_textSelectColor="@color/white"-->
|
||||
<!-- app:tl_textSelectedSize="@dimen/sp_14"-->
|
||||
<!-- app:tl_textUnselectColor="#F1ECFF"-->
|
||||
<!-- app:tl_textsize="@dimen/sp_12" />-->
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:background="@color/color_transparent" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:background="@color/color_transparent"/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@@ -20,14 +20,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:riv_corner_radius="@dimen/dp_11" />
|
||||
app:riv_corner_radius="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_r11_with"
|
||||
android:scaleType="fitCenter"
|
||||
app:riv_corner_radius="@dimen/dp_11" />
|
||||
<!-- <com.makeramen.roundedimageview.RoundedImageView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:background="@drawable/bg_r11_with"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- app:riv_corner_radius="@dimen/dp_11" />-->
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -40,16 +41,6 @@
|
||||
android:src="@drawable/phonetic"
|
||||
app:layout_constraintStart_toStartOf="@id/ll"
|
||||
app:layout_constraintTop_toTopOf="@id/ll" />
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="@dimen/dp_92"-->
|
||||
<!-- android:layout_height="@dimen/dp_21"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@+id/ll"-->
|
||||
<!-- android:background="@drawable/group"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- >-->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_tags"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,123 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_73"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:background="@drawable/index_bg_search_item">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/index_bg_search_avatar"
|
||||
android:padding="@dimen/dp_5">
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv_user_head"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:background="@drawable/index_bg_search_avatar"
|
||||
app:riv_border_color="#E3E3E3"
|
||||
app:riv_border_width="@dimen/dp_1"
|
||||
app:gav_border_color="#E3E3E3"
|
||||
app:gav_border_width="@dimen/dp_1"
|
||||
app:riv_corner_radius="@dimen/dp_360"
|
||||
tools:src="@color/color_FF88CF" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_6"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="#ff6d7278"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
tools:text="爱沙尼亚" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_follow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:background="@drawable/common_sr_btn_bg"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_14"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingRight="@dimen/dp_14"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:text="关注"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="@dimen/sp_12"></TextView>
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:orientation="horizontal">
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/dy_head_image"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_online"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:drawableLeft="@mipmap/index_icon_online"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_797979"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="在线" />
|
||||
<TextView
|
||||
android:id="@+id/dy_name_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_27"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:text="萌新驾到"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@+id/dy_head_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/dy_head_image" />
|
||||
|
||||
<com.xscm.moduleutil.widget.BeautifulNameView
|
||||
android:id="@+id/bnv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_797979"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="19234"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/dy_head_image"
|
||||
app:layout_constraintStart_toStartOf="@+id/dy_name_text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_separation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:drawableLeft="@mipmap/index_icon_member"
|
||||
android:singleLine="true"
|
||||
android:drawablePadding="@dimen/dp_3"
|
||||
android:textColor="@color/color_797979"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="19234" />
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/gensui"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -36,21 +36,28 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:src="@mipmap/jiaoyou"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ll"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:text="烟花易冷"
|
||||
tools:text="烟花易冷"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_num_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_num_bg"
|
||||
|
||||
@@ -87,25 +87,23 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
android:paddingEnd="@dimen/dp_1"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/im_user2"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@mipmap/huangg2"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_10" />
|
||||
android:scaleType="fitCenter" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
@@ -126,7 +124,7 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:rotation="-20"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_second_cp2_head"
|
||||
@@ -138,7 +136,7 @@
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_toEndOf="@+id/iv_second_cp1_head"
|
||||
android:rotation="20"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_98"
|
||||
@@ -168,7 +166,6 @@
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLength="3"
|
||||
android:text=""
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="10sp" />
|
||||
@@ -219,30 +216,31 @@
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/guanb1" />
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_1_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|top"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:paddingEnd="@dimen/dp_1"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/im_user1"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im1"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center_horizontal|top|center"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/huangg1" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -304,7 +302,6 @@
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLength="3"
|
||||
android:text=""
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="10sp" />
|
||||
@@ -352,12 +349,14 @@
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/guanb3" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_3_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|top"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:paddingEnd="@dimen/dp_1"
|
||||
android:gravity="center_horizontal"
|
||||
|
||||
>
|
||||
|
||||
@@ -365,19 +364,16 @@
|
||||
android:id="@+id/im_user3"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:layout_marginStart="@dimen/dp_17"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:riv_oval="true" />
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:riv_oval="true"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/huangg3"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_5"/>
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -400,7 +396,7 @@
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:rotation="-20"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_three_cp2_head"
|
||||
@@ -412,7 +408,7 @@
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_toEndOf="@+id/iv_three_cp1_head"
|
||||
android:rotation="20"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_98"
|
||||
@@ -440,7 +436,6 @@
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLength="3"
|
||||
android:text=""
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="10sp" />
|
||||
@@ -821,7 +816,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone">
|
||||
>
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
@@ -876,27 +871,30 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:ignore="MissingConstraints">
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_my_cp1_head"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_my_cp2_head"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_toEndOf="@+id/iv_my_cp1_head"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/v_my_cp1_head"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:paddingBottom="@dimen/dp_7"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:src="@mipmap/cp_pt"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user