首次提交信息
This commit is contained in:
1
modulevoice/.gitignore
vendored
Normal file
1
modulevoice/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
64
modulevoice/build.gradle
Normal file
64
modulevoice/build.gradle
Normal file
@@ -0,0 +1,64 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.modulevoice'
|
||||
compileSdk 35
|
||||
|
||||
defaultConfig {
|
||||
minSdk 24
|
||||
targetSdk 35
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation libs.appcompat
|
||||
implementation libs.material
|
||||
implementation project(':moduleUtil')
|
||||
implementation project(':moduletablayout')
|
||||
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
implementation libs.lifecycle.livedata.ktx
|
||||
implementation libs.lifecycle.viewmodel.ktx
|
||||
|
||||
implementation 'com.alibaba:arouter-api:1.5.2'
|
||||
//annotationProcessor
|
||||
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
|
||||
|
||||
implementation project(':moduleroom')
|
||||
}
|
||||
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
21
modulevoice/proguard-rules.pro
vendored
Normal file
21
modulevoice/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.example.modulevoice;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.modulevoice", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
21
modulevoice/src/main/AndroidManifest.xml
Normal file
21
modulevoice/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher_app"
|
||||
android:roundIcon="@mipmap/ic_launcher_round_app"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/BaseAppTheme">
|
||||
<activity
|
||||
android:name=".activity.SearchActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.RankingListActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="false"
|
||||
/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.example.modulevoice.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.activity.ui.main.SectionsPagerAdapter;
|
||||
import com.example.modulevoice.databinding.ActivityRankingListBinding;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
/**
|
||||
*@author lxj
|
||||
*@data 2025/5/15
|
||||
*@description: 排行榜
|
||||
*/
|
||||
public class RankingListActivity extends BaseAppCompatActivity<ActivityRankingListBinding> {
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setTitle("排行榜");
|
||||
SectionsPagerAdapter sectionsPagerAdapter = new SectionsPagerAdapter(this, getSupportFragmentManager());
|
||||
mBinding.viewPager.setAdapter(sectionsPagerAdapter);
|
||||
mBinding.tabs.setupWithViewPager( mBinding.viewPager);
|
||||
setupCustomTabs();
|
||||
}
|
||||
private void setupCustomTabs() {
|
||||
TabLayout tabs = findViewById(R.id.tabs);
|
||||
|
||||
// 为每个tab创建自定义视图
|
||||
for (int i = 0; i < tabs.getTabCount(); i++) {
|
||||
TabLayout.Tab tab = tabs.getTabAt(i);
|
||||
if (tab != null) {
|
||||
TextView customView = new TextView(this);
|
||||
customView.setText(tab.getText());
|
||||
customView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); // 未选中时的字体大小
|
||||
customView.setTextColor(Color.parseColor("#999999")); // 未选中时的灰色
|
||||
customView.setGravity(Gravity.CENTER);
|
||||
customView.setSingleLine(true); // 确保不换行显示
|
||||
customView.setEllipsize(TextUtils.TruncateAt.END); // 超出部分显示省略号
|
||||
|
||||
tab.setCustomView(customView);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置选中监听器
|
||||
tabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
if (tab.getCustomView() != null) {
|
||||
TextView textView = (TextView) tab.getCustomView();
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14); // 选中时的字体大小
|
||||
textView.setTextColor(Color.BLACK); // 选中时的黑色
|
||||
textView.setSingleLine(true); // 确保不换行显示
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
if (tab.getCustomView() != null) {
|
||||
TextView textView = (TextView) tab.getCustomView();
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); // 未选中时的字体大小
|
||||
textView.setTextColor(Color.parseColor("#999999")); // 未选中时的灰色
|
||||
textView.setSingleLine(true); // 确保不换行显示
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
}
|
||||
});
|
||||
|
||||
// 设置初始选中tab的样式(如果有的话)
|
||||
if (tabs.getTabCount() > 0 && tabs.getSelectedTabPosition() >= 0) {
|
||||
TabLayout.Tab selectedTab = tabs.getTabAt(tabs.getSelectedTabPosition());
|
||||
if (selectedTab != null && selectedTab.getCustomView() != null) {
|
||||
TextView textView = (TextView) selectedTab.getCustomView();
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
textView.setTextColor(Color.BLACK);
|
||||
textView.setSingleLine(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_ranking_list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package com.example.modulevoice.activity;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.StringUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.adapter.SearchHistoryAdapter;
|
||||
import com.example.modulevoice.adapter.SearchRecordAdapter;
|
||||
import com.example.modulevoice.adapter.SearchRoomResultAdapter;
|
||||
import com.example.modulevoice.adapter.SearchUserResultAdapter;
|
||||
import com.example.modulevoice.contacts.SearchContacts;
|
||||
import com.example.modulevoice.databinding.ActivitySearchBinding;
|
||||
import com.example.modulevoice.presenter.SearchPresenter;
|
||||
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.UserResultResp;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.dialog.CommonDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* 搜索页面
|
||||
*/
|
||||
public class SearchActivity extends BaseMvpActivity<SearchPresenter, ActivitySearchBinding> implements SearchContacts.View, CommonDialog.OnClickListener {
|
||||
private String keyWord;
|
||||
private List<RoomSearchResp> roomResultInfoList = new ArrayList<>();
|
||||
|
||||
|
||||
private SearchHistoryAdapter mSearchHistoryAdapter;
|
||||
private SearchRecordAdapter mSearchRecordAdapter;
|
||||
private SearchRoomResultAdapter mSearchRoomResultAdapter;
|
||||
private SearchUserResultAdapter mSearchUserResultAdapter;
|
||||
private CommonDialog commonDialog;
|
||||
|
||||
@Override
|
||||
protected SearchPresenter bindPresenter() {
|
||||
return new SearchPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
//搜索记录
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
mBinding.recycleViewRecord.setLayoutManager(linearLayoutManager);
|
||||
mBinding.recycleViewRecord.setAdapter(mSearchRecordAdapter = new SearchRecordAdapter());
|
||||
mSearchRecordAdapter.bindToRecyclerView(mBinding.recycleViewRecord);
|
||||
mSearchRecordAdapter.setEmptyView(R.layout.index_view_empty);
|
||||
//搜索历史
|
||||
FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager(this);
|
||||
flexboxLayoutManager.setFlexDirection(FlexDirection.ROW);
|
||||
flexboxLayoutManager.setFlexWrap(FlexWrap.WRAP);
|
||||
mBinding.recycleViewHistory.setLayoutManager(flexboxLayoutManager);
|
||||
mBinding.recycleViewHistory.setAdapter(mSearchHistoryAdapter = new SearchHistoryAdapter());
|
||||
|
||||
//搜索到用户数据
|
||||
mBinding.recycleViewUser.setLayoutManager(new LinearLayoutManager(this));
|
||||
mBinding.recycleViewUser.setAdapter(mSearchUserResultAdapter = new SearchUserResultAdapter());
|
||||
//搜索到房间信息
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2);
|
||||
mBinding.recycleViewRoom.setLayoutManager(gridLayoutManager);
|
||||
mBinding.recycleViewRoom.setAdapter(mSearchRoomResultAdapter = new SearchRoomResultAdapter());
|
||||
|
||||
mBinding.editQuery.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
keyWord = mBinding.editQuery.getText().toString();
|
||||
MvpPre.saveSearchHistory(keyWord);
|
||||
if (StringUtils.isEmpty(keyWord)) {
|
||||
mBinding.ivClose.setImageLevel(1);
|
||||
mBinding.ivClose.performClick();
|
||||
} else {
|
||||
mSearchUserResultAdapter.setKeyWord(keyWord);
|
||||
mSearchRecordAdapter.setKeyWord(keyWord);
|
||||
mBinding.ivClose.setImageLevel(2);
|
||||
mBinding.llHistory.setVisibility(View.GONE);
|
||||
MvpPre.getSearchHistory();
|
||||
MvpPre.fuzzyQuery(keyWord);
|
||||
MvpPre.search(keyWord, "2");
|
||||
}
|
||||
}
|
||||
});
|
||||
MvpPre.getSearchHistory();
|
||||
|
||||
//快捷搜索列表点击
|
||||
mSearchRecordAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
MvpPre.saveSearchHistory(mSearchRecordAdapter.getItem(position).t);
|
||||
MvpPre.search(mSearchRecordAdapter.getItem(position).t, "2");
|
||||
}
|
||||
});
|
||||
//搜索历史点击
|
||||
mSearchHistoryAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
mBinding.editQuery.setText(mSearchHistoryAdapter.getItem(position));
|
||||
try {
|
||||
mBinding.editQuery.setSelection(mSearchHistoryAdapter.getItem(position).length());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
//关注或取消关注
|
||||
mSearchUserResultAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
UserResultResp item = mSearchUserResultAdapter.getItem(position);
|
||||
MvpPre.followUser(item.getUser_id(), item.getFollow().equals("0") ? 1 : 2, position);
|
||||
}
|
||||
});
|
||||
//用户列表点击事件
|
||||
mSearchUserResultAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
UserResultResp item = mSearchUserResultAdapter.getItem(position);
|
||||
if (item != null) {
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_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) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getApplicationContext(), item.getId() ,"");
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "搜索界面").withString("roomId", item.getId()).navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.ivDelete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (commonDialog == null) {
|
||||
commonDialog = new CommonDialog(SearchActivity.this);
|
||||
commonDialog.setmOnClickListener(SearchActivity.this);
|
||||
}
|
||||
commonDialog.show();
|
||||
}
|
||||
});
|
||||
mBinding.ivClose.setOnClickListener(v -> {
|
||||
if (!StringUtils.isEmpty(keyWord)) {
|
||||
mBinding.editQuery.setText("");
|
||||
}
|
||||
mBinding.recycleViewRecord.setVisibility(View.GONE);
|
||||
mBinding.llHistory.setVisibility(View.VISIBLE);
|
||||
mBinding.rlResult.setVisibility(View.GONE);
|
||||
});
|
||||
mBinding.tvRoomCount.setOnClickListener(v -> {
|
||||
mSearchRoomResultAdapter.setNewData(roomResultInfoList);
|
||||
mBinding.rlRoom.setVisibility(View.GONE);
|
||||
mBinding.rlUser.setVisibility(View.GONE);
|
||||
mBinding.recycleViewUser.setVisibility(View.GONE);
|
||||
});
|
||||
mBinding.tvCancel.setOnClickListener(v -> finish());
|
||||
mBinding.editQuery.requestFocus();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_search;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索历史
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void setSearchHistory(List<String> data) {
|
||||
mSearchHistoryAdapter.setNewData(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索的结果
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void setSearch(List<RoomSearchResp> data) {
|
||||
mBinding.recycleViewRecord.setVisibility(View.GONE);
|
||||
mBinding.llHistory.setVisibility(View.GONE);
|
||||
mBinding.rlResult.setVisibility(View.VISIBLE);
|
||||
if (data == null || data.size() == 0) {
|
||||
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) {
|
||||
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));
|
||||
} else {
|
||||
mSearchRoomResultAdapter.setNewData(data);
|
||||
}
|
||||
mBinding.tvRoomCount.setText("全部 " + data.size());
|
||||
}
|
||||
// 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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 模糊快捷查询
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void setFuzzyQuery(List<RecordSection> data) {
|
||||
mBinding.recycleViewRecord.setVisibility(View.VISIBLE);
|
||||
mBinding.llHistory.setVisibility(View.GONE);
|
||||
mBinding.rlResult.setVisibility(View.GONE);
|
||||
mSearchRecordAdapter.setNewData(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关注成功
|
||||
*
|
||||
* @param type
|
||||
* @param postion
|
||||
*/
|
||||
@Override
|
||||
public void followUserSuccess(int type, int postion) {
|
||||
UserResultResp item = mSearchUserResultAdapter.getItem(postion);
|
||||
item.setFollow(type == 1 ? "1" : "0");
|
||||
mSearchUserResultAdapter.notifyItemChanged(postion, item);
|
||||
// type 1关注 2取消关注
|
||||
// EventBus.getDefault().post(new FamilyTrendFollowEvent(null, 1, item.getUser_id()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeftClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightClick() {
|
||||
MvpPre.deleteSearchHistory();
|
||||
MvpPre.getSearchHistory();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A020302);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.example.modulevoice.activity.ui.main;
|
||||
|
||||
import static androidx.lifecycle.Transformations.map;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class PageViewModel extends ViewModel {
|
||||
|
||||
private MutableLiveData<Integer> mIndex = new MutableLiveData<>();
|
||||
private LiveData<String> mText = map(mIndex, input -> "Hello world from section: " + input);
|
||||
|
||||
public void setIndex(int index) {
|
||||
mIndex.setValue(index);
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,535 @@
|
||||
package com.example.modulevoice.activity.ui.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
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;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.contacts.PlaceholderContacts;
|
||||
import com.example.modulevoice.databinding.FragmentRankingListBinding;
|
||||
import com.example.modulevoice.presenter.PlaceholderPresenter;
|
||||
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;
|
||||
import com.xscm.moduleutil.widget.BeautifulNameView;
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView;
|
||||
import com.xscm.moduleutil.widget.GifAvatarOvalView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/7/11
|
||||
* @description: 榜单
|
||||
*/
|
||||
public class PlaceholderFragment extends BaseMvpFragment<PlaceholderPresenter, FragmentRankingListBinding> implements PlaceholderContacts.View {
|
||||
private int index;
|
||||
private static final String ARG_SECTION_NUMBER = "section_number";
|
||||
private TextView tvDay, tvWeek, tvMonth;
|
||||
private String currentType = "日榜"; // 默认选中日榜
|
||||
private BaseQuickAdapter<PlaceholderBean.ListsBean, BaseViewHolder> mAdapter;
|
||||
|
||||
public static PlaceholderFragment newInstance(int index) {
|
||||
PlaceholderFragment fragment = new PlaceholderFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(ARG_SECTION_NUMBER, index);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
index = getArguments().getInt(ARG_SECTION_NUMBER);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PlaceholderPresenter bindPresenter() {
|
||||
return new PlaceholderPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
tvDay = mBinding.tvDay;
|
||||
tvWeek = mBinding.tvWeek;
|
||||
tvMonth = mBinding.tvMonth;
|
||||
|
||||
// 设置点击事件
|
||||
tvDay.setOnClickListener(v -> switchTab("日榜"));
|
||||
tvWeek.setOnClickListener(v -> switchTab("周榜"));
|
||||
tvMonth.setOnClickListener(v -> switchTab("月榜"));
|
||||
|
||||
// 默认加载日榜数据
|
||||
loadRankingData("日榜");
|
||||
|
||||
ShadowLayout slMy = mBinding.includeTopBar.slMy;
|
||||
RelativeLayout r11 = mBinding.includeTopBar.r11;
|
||||
RelativeLayout r12 = mBinding.includeTopBar.r12;
|
||||
RelativeLayout r21 = mBinding.includeTopBar.r21;
|
||||
RelativeLayout r22 = mBinding.includeTopBar.r22;
|
||||
RelativeLayout r31 = mBinding.includeTopBar.r31;
|
||||
RelativeLayout r32 = mBinding.includeTopBar.r32;
|
||||
RelativeLayout rlMy = mBinding.includeTopBar.rlMy;
|
||||
RelativeLayout rlMyCp = mBinding.includeTopBar.rlMyCp;
|
||||
RecyclerView recycleView = mBinding.includeTopBar.recycleView;
|
||||
|
||||
if (index == 0) {
|
||||
slMy.setShadowColor(Color.parseColor("#618F6FFF"));
|
||||
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);
|
||||
} else if (index == 1) {
|
||||
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("#70F7B500"));
|
||||
} else if (index == 2) {
|
||||
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 == 3){
|
||||
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);
|
||||
}
|
||||
|
||||
// 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) {
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, PlaceholderBean.ListsBean item) {
|
||||
helper.setText(R.id.tv_charm, StringUtil.toWan2(item.getTotal(),1));
|
||||
RelativeLayout rl = helper.getView(R.id.r_3_2);
|
||||
if (index == 0) {
|
||||
rl.setVisibility(View.GONE);
|
||||
helper.getView(R.id.riv_avatar).setVisibility(View.VISIBLE);
|
||||
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 == 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));
|
||||
// ImageUtils.loadHeadCC(item.getHead_picture2(), helper.getView(R.id.iv_three_cp2_head));
|
||||
// helper.setText(R.id.tv_charm, item.getNumber());
|
||||
// helper.setText(R.id.tv_name, item.getNickname1());
|
||||
helper.setText(R.id.tv_no, String.valueOf(item.getRank()));
|
||||
// ((BeautifulNameView) helper.getView(R.id.bnv_rank_list)).setTextColor(!TextUtils.isEmpty(item.getId_color()) ? Color.parseColor(item.getId_color()) : getResources().getColor(R.color.color_FF333333));
|
||||
// ((BeautifulNameView) helper.getView(R.id.bnv_rank_list)).setText(item.getNickname2());
|
||||
} else if (index == 1 || index == 2) {
|
||||
rl.setVisibility(View.GONE);
|
||||
helper.getView(R.id.riv_avatar).setVisibility(View.VISIBLE);
|
||||
helper.setText(R.id.tv_name, item.getNickname());
|
||||
helper.setText(R.id.tv_no, String.valueOf(item.getRank()));
|
||||
ImageUtils.loadHeadCC(item.getAvatar(), helper.getView(R.id.riv_avatar));
|
||||
helper.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (type == RankingFragment.TYPE_WEALTH) {
|
||||
// return;
|
||||
// }
|
||||
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()));
|
||||
// }
|
||||
}
|
||||
};
|
||||
recycleView.setAdapter(mAdapter);
|
||||
mAdapter.bindToRecyclerView(recycleView);
|
||||
CommonEmptyView commonEmptyView = new CommonEmptyView(getContext());
|
||||
commonEmptyView.setEmptyText("暂无上榜");
|
||||
mAdapter.setEmptyView(commonEmptyView);
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(tvDay, ColorManager.getInstance().getPrimaryColorInt(), 79);
|
||||
tvDay.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
}
|
||||
|
||||
private void switchTab(String type) {
|
||||
if (currentType.equals(type)) return; // 避免重复点击
|
||||
// 更新 UI 状态
|
||||
updateTabState(type);
|
||||
// 请求对应榜单数据
|
||||
loadRankingData(type);
|
||||
}
|
||||
|
||||
private void loadRankingData(String type) {
|
||||
// 调用 Presenter 获取对应榜单的数据
|
||||
if (type.equals("日榜")) {
|
||||
MvpPre.wealthRanking(index + "", "1");
|
||||
} else if (type.equals("周榜")) {
|
||||
MvpPre.wealthRanking(index + "", "2");
|
||||
} else if (type.equals("月榜")) {
|
||||
MvpPre.wealthRanking(index + "", "3");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTabState(String selectedType) {
|
||||
currentType = selectedType;
|
||||
// if (selectedType.equals("日榜")) {
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(tvDay, ColorManager.getInstance().getPrimaryColorInt(), 79);
|
||||
// tvDay.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
// } else {
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(tvDay,com.xscm.moduleutil.R.color.color_0DFFB9, 79);
|
||||
// tvDay.setTextColor(Color.parseColor("#FF333333"));
|
||||
// }
|
||||
// if (selectedType.equals("周榜")) {
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(tvWeek, ColorManager.getInstance().getPrimaryColorInt(), 79);
|
||||
// tvWeek.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
// }else {
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(tvWeek,com.xscm.moduleutil.R.color.color_0DFFB9, 79);
|
||||
// tvWeek.setTextColor(Color.parseColor("#FF333333"));
|
||||
// }
|
||||
// if (selectedType.equals("月榜")) {
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(tvMonth, ColorManager.getInstance().getPrimaryColorInt(), 79);
|
||||
// tvMonth.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
// }else {
|
||||
// ThemeableDrawableUtils.setThemeableRoundedBackground(tvMonth,com.xscm.moduleutil.R.color.color_0DFFB9, 79);
|
||||
// tvMonth.setTextColor(Color.parseColor("#FF333333"));
|
||||
// }
|
||||
int selectedColor = ContextCompat.getColor(getContext(), android.R.color.white);
|
||||
int unselectedColor = ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FF333333); // 确保这个颜色在资源文件中定义
|
||||
|
||||
tvDay.setBackgroundResource(selectedType.equals("日榜") ? com.xscm.moduleutil.R.drawable.cs : com.xscm.moduleutil.R.drawable.bg_r80_hui);
|
||||
tvDay.setTextColor(selectedType.equals("日榜") ? selectedColor : unselectedColor);
|
||||
|
||||
tvWeek.setBackgroundResource(selectedType.equals("周榜") ? com.xscm.moduleutil.R.drawable.cs : com.xscm.moduleutil.R.drawable.bg_r80_hui);
|
||||
tvWeek.setTextColor(selectedType.equals("周榜") ? selectedColor : unselectedColor);
|
||||
|
||||
tvMonth.setBackgroundResource(selectedType.equals("月榜") ? com.xscm.moduleutil.R.drawable.cs : com.xscm.moduleutil.R.drawable.bg_r80_hui);
|
||||
tvMonth.setTextColor(selectedType.equals("月榜") ? selectedColor : unselectedColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_ranking_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wealthRanking(PlaceholderBean.MyRanking data) {
|
||||
if (data != null) {
|
||||
if (index == 3) {
|
||||
GifAvatarOvalView cp1Head = mBinding.includeTopBar.ivMyCp1Head;
|
||||
GifAvatarOvalView cp2Head = mBinding.includeTopBar.ivMyCp2Head;
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), cp1Head);
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar1(), cp2Head);
|
||||
TextView tv_my_name = mBinding.includeTopBar.tvMyName;
|
||||
TextView tvid = mBinding.includeTopBar.tvMyId;
|
||||
tv_my_name.setText(data.getNickname());
|
||||
tvid.setText(data.getUser_code());
|
||||
|
||||
} else {
|
||||
TextView tvName = mBinding.includeTopBar.tvName;
|
||||
GifAvatarOvalView riv = mBinding.includeTopBar.riv;
|
||||
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 {
|
||||
tvName.setText(data.getNickname());
|
||||
ImageUtils.loadHeadCC(data.getAvatar(), riv);
|
||||
}
|
||||
|
||||
riv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", myInfo.getUser_id()).navigation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
TextView tvCharm = mBinding.includeTopBar.tvCharm;
|
||||
TextView tvRankState = mBinding.includeTopBar.tvRankState;
|
||||
TextView tvRankNo = mBinding.includeTopBar.tvRankNo;
|
||||
|
||||
tvCharm.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
if (data.getRank().equals("-1")) {
|
||||
tvRankState.setText("暂未上榜");
|
||||
tvRankNo.setText(new SpanUtils().append("距上榜差 ").append(data.getDiff() + "").setBold().setForegroundColor(Color.parseColor("#FFFF8ACC")).setFontSize(12, true).create());
|
||||
} else {
|
||||
if (data.getRank().equals("1")) {
|
||||
tvRankState.setText("第1名");
|
||||
tvRankNo.setText("继续加油哦~");
|
||||
} else {
|
||||
tvRankState.setText(String.format("第%s名", data.getRank()));
|
||||
tvRankNo.setText(new SpanUtils().append("距上一名差 ").append(data.getDiff() + "").setBold().setForegroundColor(Color.parseColor("#FFFF8ACC")).setFontSize(12, true).create());
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNo1(PlaceholderBean.ListsBean data, String type) {
|
||||
TextView tvUsername1 = mBinding.includeTopBar.tvUsername1;
|
||||
BeautifulNameView beautifulViewFirst = mBinding.includeTopBar.beautifulViewFirst;
|
||||
TextView tvXing1 = mBinding.includeTopBar.tvXing1;
|
||||
GifAvatarOvalView imUser1 = mBinding.includeTopBar.imUser1;
|
||||
ImageView imVip1 = mBinding.includeTopBar.ivVip1;
|
||||
ImageView imLevel1 = mBinding.includeTopBar.ivLevel1;
|
||||
TextView tvId1 = mBinding.includeTopBar.tvId1;
|
||||
GifAvatarOvalView ivOneCp1Hhead = mBinding.includeTopBar.ivOneCp1Head;
|
||||
GifAvatarOvalView ivOneCp2Hhead = mBinding.includeTopBar.ivOneCp2Head;
|
||||
|
||||
|
||||
if (data == null) {
|
||||
// 设置默认值或清空内容
|
||||
tvUsername1.setText("");
|
||||
beautifulViewFirst.setText("");
|
||||
tvXing1.setText("");
|
||||
imUser1.setImageResource(0); // 设置默认图片资源
|
||||
imVip1.setImageResource(0); // 设置默认图片资源
|
||||
imLevel1.setImageResource(0); // 设置默认图片资源
|
||||
tvId1.setText("");
|
||||
ivOneCp1Hhead.setImageResource(0); // 设置默认图片资源
|
||||
ivOneCp2Hhead.setImageResource(0); // 设置默认图片资源
|
||||
return;
|
||||
}
|
||||
tvXing1.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
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_number() != null ? "ID:" + data.getRoom_number() : "");
|
||||
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("1") || type.equals("2")) {
|
||||
tvUsername1.setText(data.getNickname());
|
||||
ImageUtils.loadHeadCC(data.getAvatar(), imUser1);
|
||||
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.getNickname1());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNo2(PlaceholderBean.ListsBean data, String type) {
|
||||
TextView tvUsername2 = mBinding.includeTopBar.tvUsername2;
|
||||
BeautifulNameView beautifulViewSecond = mBinding.includeTopBar.beautifulViewSecond;
|
||||
TextView tvXing2 = mBinding.includeTopBar.tvXing2;
|
||||
GifAvatarOvalView imUser2 = mBinding.includeTopBar.imUser2;
|
||||
ImageView imVip2 = mBinding.includeTopBar.ivVip2;
|
||||
ImageView imLevel2 = mBinding.includeTopBar.ivLevel2;
|
||||
TextView tvId2 = mBinding.includeTopBar.tvId2;
|
||||
GifAvatarOvalView ivOneCp1Hhead = mBinding.includeTopBar.ivSecondCp1Head;
|
||||
GifAvatarOvalView ivOneCp2Hhead = mBinding.includeTopBar.ivSecondCp2Head;
|
||||
|
||||
if (data == null) {
|
||||
tvUsername2.setText("");
|
||||
beautifulViewSecond.setText("");
|
||||
tvXing2.setText("");
|
||||
imUser2.setImageResource(0); // 设置默认图片资源
|
||||
imVip2.setImageResource(0); // 设置默认图片资源
|
||||
imLevel2.setImageResource(0); // 设置默认图片资源
|
||||
tvId2.setText("");
|
||||
ivOneCp1Hhead.setImageResource(0); // 设置默认图片资源
|
||||
ivOneCp2Hhead.setImageResource(0); // 设置默认图片资源
|
||||
return;
|
||||
}
|
||||
tvXing2.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
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_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_code() != null ? "ID:" + data.getUser_code() : "");
|
||||
imUser2.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")) {
|
||||
// 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.getNickname1());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNo3(PlaceholderBean.ListsBean data, String type) {
|
||||
TextView tvUsername3 = mBinding.includeTopBar.tvUsername3;
|
||||
BeautifulNameView beautifulViewThird = mBinding.includeTopBar.beautifulViewThird;
|
||||
TextView tvXing3 = mBinding.includeTopBar.tvXing3;
|
||||
GifAvatarOvalView imUser3 = mBinding.includeTopBar.imUser3;
|
||||
ImageView imVip3 = mBinding.includeTopBar.ivVip3;
|
||||
ImageView imLevel3 = mBinding.includeTopBar.ivLevel3;
|
||||
TextView tvId3 = mBinding.includeTopBar.tvId3;
|
||||
GifAvatarOvalView ivOneCp1Hhead = mBinding.includeTopBar.ivSecondCp1Head;
|
||||
GifAvatarOvalView ivOneCp2Hhead = mBinding.includeTopBar.ivSecondCp2Head;
|
||||
|
||||
if (data == null) {
|
||||
tvUsername3.setText("");
|
||||
beautifulViewThird.setText("");
|
||||
tvXing3.setText("");
|
||||
imUser3.setImageResource(0); // 设置默认图片资源
|
||||
imVip3.setImageResource(0); // 设置默认图片资源
|
||||
imLevel3.setImageResource(0); // 设置默认图片资源
|
||||
tvId3.setText("");
|
||||
ivOneCp1Hhead.setImageResource(0); // 设置默认图片资源
|
||||
ivOneCp2Hhead.setImageResource(0); // 设置默认图片资源
|
||||
return;
|
||||
}
|
||||
tvXing3.setText(StringUtil.toWan2(data.getTotal(),1));
|
||||
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_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_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 {
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), ivOneCp1Hhead);
|
||||
ImageUtils.loadHeadCC(data.getUser_avatar(), ivOneCp2Hhead);
|
||||
tvUsername3.setText(data.getNickname());
|
||||
tvId3.setText(data.getNickname1());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setList(List<PlaceholderBean.ListsBean> list) {
|
||||
if (list == null) {
|
||||
// 如果传入的数据为null,清空Adapter的数据
|
||||
mAdapter.getData().clear();
|
||||
mAdapter.notifyDataSetChanged();
|
||||
} else {
|
||||
// 如果传入的数据不为null,设置Adapter的数据
|
||||
mAdapter.setNewData(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.example.modulevoice.activity.ui.main;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
|
||||
/**
|
||||
* A [FragmentPagerAdapter] that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
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.true_love_rank};
|
||||
// com.xscm.moduleutil.R.string.guild_rank,
|
||||
private final Context mContext;
|
||||
|
||||
public SectionsPagerAdapter(Context context, FragmentManager fm) {
|
||||
super(fm);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
// getItem is called to instantiate the fragment for the given page.
|
||||
// Return a PlaceholderFragment.
|
||||
return PlaceholderFragment.newInstance(position );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return mContext.getResources().getString(TAB_TITLES[position]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
// Show 2 total pages.
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulevoice.R;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.zhpan.bannerview.BaseBannerAdapter;
|
||||
import com.zhpan.bannerview.BaseViewHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CarouselBannerAdapter extends BaseBannerAdapter<TopRoom> {
|
||||
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
@Override
|
||||
protected void bindData(BaseViewHolder<TopRoom> holder, TopRoom data, int position, int pageSize) {
|
||||
ImageUtils.loadHeadCC(data.getRoom_cover(), holder.itemView.findViewById(R.id.iv_follow_bg));
|
||||
TextView textView= holder.itemView.findViewById(R.id.tv_num);
|
||||
TextView textView2= holder.itemView.findViewById(R.id.tv_room_name);
|
||||
|
||||
textView.setText(data.getUser_list().size()+"人");
|
||||
textView2.setText(data.getRoom_name());
|
||||
ImageView iv = holder.itemView.findViewById(R.id.iv_play);
|
||||
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);
|
||||
// }
|
||||
|
||||
// 设置点击事件
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(holder.itemView, data, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(View view, TopRoom data, int position);
|
||||
}
|
||||
@Override
|
||||
public int getLayoutId(int viewType) {
|
||||
return R.layout.index_item_carousel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevoice.R;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class CarouselImgAdapter extends BaseQuickAdapter<TopRoom.UserList, BaseViewHolder> {
|
||||
public CarouselImgAdapter() {
|
||||
super(R.layout.index_item_image);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, TopRoom.UserList item) {
|
||||
ImageUtils.loadHeadCC(item.getAvatar(), helper.getView(R.id.riv_user_head));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevoice.R;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HotAdapter extends BaseMultiItemQuickAdapter<TopRoom, BaseViewHolder> {
|
||||
public HotAdapter(List<TopRoom> data) {
|
||||
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));
|
||||
|
||||
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);
|
||||
}else {
|
||||
iv.setVisibility(GONE);
|
||||
}
|
||||
helper.setText(R.id.tv_num, formatHotValue(Integer.parseInt(item.getHot_value())));
|
||||
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.getRoom_id()).navigation();
|
||||
// 如果外部设置了监听器,则触发外部监听器
|
||||
if (mOnRoomClickListener != null) {
|
||||
mOnRoomClickListener.onRoomClick(item, helper.getAdapterPosition());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private String formatHotValue(int hotValue) {
|
||||
if (hotValue > 10000) {
|
||||
return String.format("%.1fw", hotValue / 10000.0);
|
||||
} else {
|
||||
return String.valueOf(hotValue);
|
||||
}
|
||||
}
|
||||
// 提供设置监听器的方法
|
||||
public void setOnRoomClickListener(OnRoomClickListener listener) {
|
||||
this.mOnRoomClickListener = listener;
|
||||
}
|
||||
@Override
|
||||
public void onViewRecycled(@NonNull BaseViewHolder holder) {
|
||||
Logger.e("onViewRecycled", "onViewRecycled");
|
||||
// ImageView imageView = holder.getView(R.id.riv);
|
||||
// if (imageView != null) {
|
||||
// imageView.setImageDrawable(null);
|
||||
// Glide.with(imageView.getContext()).clear(imageView);
|
||||
// }
|
||||
super.onViewRecycled(holder);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevoice.R;
|
||||
|
||||
/**
|
||||
* 历史记录
|
||||
*/
|
||||
public class SearchHistoryAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
|
||||
public SearchHistoryAdapter() {
|
||||
super(R.layout.index_item_history);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, String item) {
|
||||
helper.setText(R.id.tv_text, item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevoice.R;
|
||||
import com.xscm.moduleutil.bean.RecordSection;
|
||||
import com.xscm.moduleutil.utils.KeyWordUtil;
|
||||
|
||||
/**
|
||||
* 模糊搜索结果
|
||||
*/
|
||||
public class SearchRecordAdapter extends BaseSectionQuickAdapter<RecordSection, BaseViewHolder> {
|
||||
|
||||
|
||||
private String keyWord = "";
|
||||
|
||||
public SearchRecordAdapter() {
|
||||
super(R.layout.index_item_record, R.layout.index_item_tecord_head, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RecordSection item) {
|
||||
helper.setText(R.id.tv_text, KeyWordUtil.matcherSearchTitle(Color.parseColor("#FFBC00"), item.t, keyWord));
|
||||
helper.addOnClickListener(R.id.tv_text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convertHead(BaseViewHolder helper, RecordSection item) {
|
||||
helper.setText(R.id.tv_head, item.header);
|
||||
}
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import static android.app.PendingIntent.getActivity;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 搜索房间结果
|
||||
*/
|
||||
public class SearchRoomResultAdapter extends BaseQuickAdapter<RoomSearchResp, BaseViewHolder> {
|
||||
|
||||
|
||||
public SearchRoomResultAdapter() {
|
||||
super(R.layout.index_item_search_room_result);
|
||||
}
|
||||
|
||||
@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());
|
||||
ImageView iv = helper.getView(R.id.iv_play);
|
||||
// if (item.getIcon()!=null && item.getIcon().size() > 0) {
|
||||
// iv.setVisibility(View.VISIBLE);
|
||||
// ImageUtils.loadRes(com.qxcm.moduleutil.R.drawable.voice_play, iv);
|
||||
// }else {
|
||||
iv.setVisibility(GONE);
|
||||
// }
|
||||
helper.setText(R.id.tv_num, formatHotValue(Integer.parseInt(item.getHot_value())));
|
||||
ImageUtils.loadHeadCC(item.getLabel_icon(), helper.getView(R.id.iv_type));
|
||||
|
||||
helper.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter( helper.itemView.getContext(), item.getId() ,"");
|
||||
|
||||
// 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) {
|
||||
return String.format("%.1fw", hotValue / 10000.0);
|
||||
} else {
|
||||
return String.valueOf(hotValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.example.modulevoice.adapter;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
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.UserResultResp;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.KeyWordUtil;
|
||||
import com.xscm.moduleutil.widget.BeautifulNameView;
|
||||
|
||||
/**
|
||||
* 搜索用户的结果
|
||||
*/
|
||||
public class SearchUserResultAdapter extends BaseQuickAdapter<UserResultResp, BaseViewHolder> {
|
||||
|
||||
|
||||
private String keyWord = "";
|
||||
|
||||
public SearchUserResultAdapter() {
|
||||
super(R.layout.index_item_search_user_result);
|
||||
}
|
||||
|
||||
@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);
|
||||
} 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);
|
||||
}
|
||||
((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);
|
||||
}
|
||||
|
||||
|
||||
public void setKeyWord(String keyWord) {
|
||||
this.keyWord = keyWord;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.example.modulevoice.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
public class HotListContacts {
|
||||
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void roomList(List<TopRoom> data, int type);
|
||||
|
||||
void finishRefreshLoadMore();
|
||||
|
||||
void getMoreRoomList(List<HomeBean> data);
|
||||
|
||||
void roomInfo(RoomInfoResp resp);
|
||||
|
||||
void showPasswordDialog();
|
||||
|
||||
void enterFail();
|
||||
}
|
||||
|
||||
public interface IHotListPre extends IPresenter {
|
||||
void getRoomList(int type,String page,String page_limit,String is_top,String label_id);
|
||||
|
||||
void getMoreRoomList(String userId);
|
||||
|
||||
void getRoomListTow();
|
||||
|
||||
void getRoomIn(String roomId, String password);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.example.modulevoice.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.PlaceholderBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PlaceholderContacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void wealthRanking(PlaceholderBean.MyRanking data);
|
||||
void setNo1(PlaceholderBean.ListsBean data,String type);
|
||||
void setNo2(PlaceholderBean.ListsBean data,String type);
|
||||
void setNo3(PlaceholderBean.ListsBean data,String type);
|
||||
void setList(List<PlaceholderBean.ListsBean > list);
|
||||
}
|
||||
|
||||
public interface IPres extends IPresenter {
|
||||
void wealthRanking(String ranking_type,String type);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.example.modulevoice.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
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 java.util.List;
|
||||
|
||||
public final class SearchContacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void setSearchHistory(List<String> data);
|
||||
|
||||
void setSearch(List<RoomSearchResp> data);
|
||||
|
||||
void setFuzzyQuery(List<RecordSection> data);
|
||||
|
||||
void followUserSuccess(int type, int postion);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface ISearchPre extends IPresenter {
|
||||
void getSearchHistory();
|
||||
|
||||
void saveSearchHistory(String keyWord);
|
||||
|
||||
void deleteSearchHistory();
|
||||
|
||||
void search(String keyWord,String type);
|
||||
|
||||
void fuzzyQuery(String keyWord);
|
||||
|
||||
void followUser(String userId, int type, int postion);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.example.modulevoice.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class VoiceCategoryContacts {
|
||||
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void setCategories(List<RoomTypeModel> list);
|
||||
|
||||
|
||||
void setBanners(List<BannerModel> bannerModels);
|
||||
|
||||
void setRoomId(String roomId);
|
||||
|
||||
void setTopRoom(List<TopRoom> topRooms,int type);
|
||||
}
|
||||
|
||||
public interface IIndexCategoryPre extends IPresenter {
|
||||
void getCategories();
|
||||
|
||||
void getMediaRoom(String type);
|
||||
|
||||
void getCarousels(int type, int page,String page_limit,String is_top,String label_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.example.modulevoice.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
|
||||
public final class VoiceContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
// void setBanners(List<BannerResp> list);
|
||||
|
||||
void hideRecommend(boolean hideRecommend,boolean hideGame);
|
||||
|
||||
}
|
||||
|
||||
public interface IIndexPre extends IPresenter {
|
||||
|
||||
void getBanners();
|
||||
|
||||
void getNameAuthResult(int type);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.example.modulevoice.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.adapter.HotAdapter;
|
||||
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.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;
|
||||
|
||||
public class HotListFragment extends BaseMvpFragment<HotListPresenter, FragmentHotListBinding> implements HotListContacts.View {
|
||||
private String label_id;
|
||||
private HotAdapter mAdapter;
|
||||
private String tag;
|
||||
private int page;
|
||||
|
||||
public static HotListFragment newInstance(String type, String tag) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("label_id", type);
|
||||
args.putString("tag", tag);
|
||||
HotListFragment fragment = new HotListFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
label_id = arguments.getString("label_id");
|
||||
tag = arguments.getString("tag");
|
||||
page = 1; // 重置page
|
||||
}
|
||||
|
||||
@Override
|
||||
protected HotListPresenter bindPresenter() {
|
||||
return new HotListPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getRoomList(2, "1", "20", "1", label_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
if (tag.equals(VoiceCategoryFragment.TYPE_HOT)) {
|
||||
mBinding.tvHot.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.tvHot.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mAdapter = new HotAdapter(null);
|
||||
// mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
||||
mBinding.recycleView.setAdapter(mAdapter);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2);
|
||||
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
return 1;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.recycleView.setLayoutManager(gridLayoutManager);
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getRoomList(2, page+"", "20", "1", label_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
mAdapter.setNewData(new ArrayList<>());
|
||||
MvpPre.getRoomList(2, page+"", "20", "1", label_id);
|
||||
}
|
||||
});
|
||||
|
||||
mAdapter.setOnRoomClickListener(new HotAdapter.OnRoomClickListener() {
|
||||
|
||||
@Override
|
||||
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 ) {
|
||||
// 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(), "");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_hot_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomList(List<TopRoom> data, int type) {
|
||||
if (data != null && data.size() > 0) {
|
||||
if (page == 1) {
|
||||
mAdapter.setNewData(data); // 刷新时替换数据
|
||||
} else {
|
||||
// 检查是否有重复数据
|
||||
boolean hasDuplicate = false;
|
||||
List<TopRoom> currentData = mAdapter.getData();
|
||||
if (!currentData.isEmpty() && data.size() > 0) {
|
||||
// 检查第一条数据是否已经存在
|
||||
TopRoom firstNewData = data.get(0);
|
||||
for (TopRoom item : currentData) {
|
||||
if (item.getRoom_id().equals(firstNewData.getRoom_id())) {
|
||||
hasDuplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasDuplicate) {
|
||||
mAdapter.addData(data); // 加载更多时添加数据
|
||||
}
|
||||
}
|
||||
} else if (page == 1) {
|
||||
// 如果是刷新且没有数据,清空列表
|
||||
mAdapter.setNewData(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefreshLoadMore() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
@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() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
package com.example.modulevoice.fragment;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevoice.R;
|
||||
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.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.event.MqttBean;
|
||||
import com.xscm.moduleutil.event.RoomGiftRunable;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.stx.xhb.xbanner.XBanner;
|
||||
import com.xscm.moduleutil.utils.logger.DataLogger;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Logger;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 声播
|
||||
*/
|
||||
public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresenter, FragmentVoiceCategoryBinding> implements VoiceCategoryContacts.View {
|
||||
|
||||
public static final String TYPE_ME = "-1";
|
||||
public static final String TYPE_RECOMMEND = "-2";
|
||||
public static final String TYPE_HOT = "-3";
|
||||
public static final String TYPE_ORDER = "-4";
|
||||
public static final String TYPE_INDEX = "index";
|
||||
|
||||
private List<TopRoom> roomList;
|
||||
|
||||
private List<MqttBean.ListBean> mqttList;
|
||||
private List<String> info;
|
||||
CarouselBannerAdapter carouselBannerAdapter;
|
||||
|
||||
public static VoiceCategoryFragment newInstance() {
|
||||
return new VoiceCategoryFragment();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
// EventBus.getDefault().register(this);
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void bannerRefresh(BannerRefreshEvent event) {
|
||||
//// MvpPre.getBanners();
|
||||
// MvpPre.getCarousels();//顶部推荐
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected VoiceCategoryPresenter bindPresenter() {
|
||||
return new VoiceCategoryPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getBanners();
|
||||
MvpPre.getCarousels(1, 1, "10", "2", "");//顶部推荐
|
||||
MvpPre.getCategories();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
|
||||
mBinding.banner.loadImage(new XBanner.XBannerAdapter() {
|
||||
@Override
|
||||
public void loadBanner(XBanner banner, Object model, View view, int position) {
|
||||
BannerModel bannerModel = (BannerModel) model;
|
||||
ImageUtils.loadCenterCrop((String) bannerModel.getXBannerUrl(), (ImageView) view);
|
||||
}
|
||||
});
|
||||
mBinding.banner.setOnItemClickListener(new XBanner.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(XBanner banner, Object model, View view, int position) {
|
||||
// if (ProxyChecker.isProxySet(context)) {
|
||||
// ToastUtils.show("使用代理禁止访问");
|
||||
// return;
|
||||
// }
|
||||
/**
|
||||
* 1房间2文章3链接 其他详情图
|
||||
*
|
||||
* type=1时,该值表示房间id;type=2时,表示文章id
|
||||
*/
|
||||
BannerModel bannerModel = (BannerModel) model;
|
||||
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;
|
||||
|
||||
carouselBannerAdapter = new CarouselBannerAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setRevealWidth(250, 250)
|
||||
.setAdapter(carouselBannerAdapter)
|
||||
.create();
|
||||
// mBinding.bannerViewPager
|
||||
// .setPageMargin(15)
|
||||
// .setRevealWidth(250, 250)
|
||||
// .setPageStyle(PageStyle.MULTI_PAGE_SCALE, 0.5f)
|
||||
// .setAdapter(carouselBannerAdapter)
|
||||
// .create();
|
||||
|
||||
|
||||
mBinding.bannerViewPager.setIndicatorVisibility(GONE);
|
||||
mBinding.constraintLayout.setVisibility(GONE);
|
||||
|
||||
carouselBannerAdapter.setOnItemClickListener((view, data, position) -> {
|
||||
// 示例:跳转到房间详情页
|
||||
if (data != null) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), data.getRoom_id() ,"");
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS)
|
||||
// .withString("form", "首页热门列表")
|
||||
// .withString("roomId", data.getRoom_id())
|
||||
// .navigation();
|
||||
}
|
||||
});
|
||||
mBinding.tvWg.setOnClickListener(v -> {
|
||||
if (mBinding.marqueeView == null || mqttList == null || mqttList.isEmpty()) {
|
||||
// 可以选择在这里添加日志或提示
|
||||
// Log.w(TAG, "MarqueeView or mqttList is null/empty, cannot handle click.");
|
||||
return; // 直接返回,不执行后续操作
|
||||
}
|
||||
try {
|
||||
int position = mBinding.marqueeView.getPosition();
|
||||
// 检查 position 是否有效
|
||||
if (position < 0 || position >= mqttList.size()) {
|
||||
// Log.w(TAG, "Invalid position from MarqueeView: " + position);
|
||||
return; // 位置无效,直接返回
|
||||
}
|
||||
// 获取对应的 MqttBean.ListBean 对象
|
||||
MqttBean.ListBean item = mqttList.get(position);
|
||||
if (item != null) { // 再次检查 item 是否为 null
|
||||
String roomId = item.getRoom_id(); // 或者 item.getRoomId(); 确保方法名正确
|
||||
if (roomId != null && !roomId.isEmpty()) { // 检查 roomId 是否有效
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
// Log.w(TAG, "Item at position " + position + " is null in mqttList.");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void onEvent(MqttBean event) {
|
||||
//
|
||||
// List<MqttBean> cachedMqttBeans = RoomGiftRunable.getMqttCache();
|
||||
// if (cachedMqttBeans == null || cachedMqttBeans.isEmpty()) {
|
||||
// mBinding.rl.setVisibility(GONE);
|
||||
// } else {
|
||||
// mBinding.rl.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// if (mqttList == null) {
|
||||
// mqttList = new ArrayList<>();
|
||||
// info = new ArrayList<>();
|
||||
// }
|
||||
// mqttList.clear();
|
||||
// info.clear();
|
||||
// // 处理缓存数据
|
||||
// for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// // 处理每一条 mqttBean 数据
|
||||
// mqttList.add(mqttBean.getList());
|
||||
// info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
// }
|
||||
//
|
||||
// mBinding.marqueeView.startWithList(info);
|
||||
// }
|
||||
|
||||
public void onEvent1() {
|
||||
try {
|
||||
List<MqttBean> cachedMqttBeans = RoomGiftRunable.getMqttCache();
|
||||
if (cachedMqttBeans == null || cachedMqttBeans.isEmpty()) {
|
||||
mBinding.rl.setVisibility(GONE);
|
||||
} else {
|
||||
mBinding.rl.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (mqttList == null) {
|
||||
mqttList = new ArrayList<>();
|
||||
info = new ArrayList<>();
|
||||
}
|
||||
mqttList.clear();
|
||||
info.clear();
|
||||
// 处理缓存数据
|
||||
|
||||
// 处理每一条 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);
|
||||
} catch (Exception e) {
|
||||
DataLogger.LogUtil.d("onEvent1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_voice_category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
onEvent1();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCategories(List<RoomTypeModel> list) {
|
||||
// // 数据有效性检查
|
||||
if (list == null || list.isEmpty() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建适配器
|
||||
MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getActivity(), list);
|
||||
mBinding.viewPager.setAdapter(adapter);
|
||||
|
||||
// 设置 TabLayout 与 ViewPager2 的关联
|
||||
new TabLayoutMediator(mBinding.slidingTabLayout, mBinding.viewPager,
|
||||
(tab, position) -> {
|
||||
// 边界检查
|
||||
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);
|
||||
}
|
||||
|
||||
tab.setCustomView(customView);
|
||||
}
|
||||
}
|
||||
).attach();
|
||||
|
||||
mBinding.slidingTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
int position = tab.getPosition();
|
||||
// 边界检查
|
||||
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
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
// 直接通过 TabLayout 设置未选中状态的文字大小
|
||||
View customView = tab.getCustomView();
|
||||
if (customView != null) {
|
||||
TextView textView = customView.findViewById(R.id.tab_text);
|
||||
if (textView != null) {
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textView.setTextColor(Color.parseColor("#F1ECFF"));
|
||||
}
|
||||
customView.setBackgroundResource(com.xscm.moduleutil.R.drawable.tab_unselected_background);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
}
|
||||
});
|
||||
|
||||
// 设置默认选中的标签
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setRoomId(String roomId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopRoom(List<TopRoom> topRooms, int type) {
|
||||
// if (topRooms == null || topRooms.isEmpty() || topRooms.size() < 1) {
|
||||
// mBinding.constraintLayout.setVisibility(View.GONE);
|
||||
// return;
|
||||
// }else {
|
||||
mBinding.constraintLayout.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
roomList = topRooms;
|
||||
mBinding.bannerViewPager.create(topRooms); // 刷新数据并启动自动播放
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStateAdapter {
|
||||
|
||||
private List<RoomTypeModel> list;
|
||||
|
||||
|
||||
// public MyFragmentPagerAdapter(FragmentManager fm, List<RoomTypeModel> list) {
|
||||
// super(fm);
|
||||
// this.list = list;
|
||||
// }
|
||||
public MyFragmentPagerAdapter(@NonNull FragmentActivity fragmentActivity, List<RoomTypeModel> list) {
|
||||
super(fragmentActivity);
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
RoomTypeModel roomTypeModel = list.get(position);
|
||||
String categoryId = roomTypeModel.getId();
|
||||
return HotListFragment.newInstance(categoryId, TYPE_INDEX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Fragment getItem(int position) {
|
||||
// RoomTypeModel model = list.get(position);
|
||||
// return HotListFragment.newInstance(model.getId(), TYPE_INDEX);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getCount() {
|
||||
// return list.size();
|
||||
// }
|
||||
//
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public CharSequence getPageTitle(int position) {
|
||||
// RoomTypeModel model = list.get(position);
|
||||
// return model.getLabel_name();
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.example.modulevoice.fragment;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.activity.RankingListActivity;
|
||||
import com.example.modulevoice.activity.SearchActivity;
|
||||
import com.example.modulevoice.contacts.VoiceContacts;
|
||||
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.dialog.YouthModelDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoiceBinding> implements VoiceContacts.View {
|
||||
// private MyInfoResp mMyInfoResp;
|
||||
|
||||
public static VoiceFragment newInstance () {
|
||||
return new VoiceFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData () {
|
||||
MvpPre.getConfig();//
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView () {
|
||||
|
||||
|
||||
mBinding.llSearch.setOnClickListener(v -> {
|
||||
// ARouter.getInstance().build(ARouteConstants.INDEX_SEARCH).navigation();
|
||||
|
||||
});
|
||||
|
||||
mBinding.ivRoom.setOnClickListener(v -> {
|
||||
//我的房间
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM).navigation();
|
||||
});
|
||||
|
||||
// mBinding.ivRoom2.setOnClickListener(v -> {
|
||||
//// ARouter.getInstance().build(ARouteConstants.INDEX_RANKING_LIST).navigation();
|
||||
// });
|
||||
|
||||
mBinding.ivRoom3.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(getContext(), SearchActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
mBinding.ivRankingList.setOnClickListener(v -> {
|
||||
startActivity(new Intent(getContext(), RankingListActivity.class));
|
||||
});
|
||||
// 检查是否需要显示青少年模式弹窗
|
||||
if (!shouldShowYouthModelDialog()) {
|
||||
showYouthModelDialog();
|
||||
}
|
||||
|
||||
|
||||
// InviteDialog inviteDialog=new InviteDialog(getContext());
|
||||
// inviteDialog.show();
|
||||
// inviteDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
// @Override
|
||||
// public void onDismiss(DialogInterface dialog) {
|
||||
// //邀请弹窗关闭后,弹首充
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// HeavenGiftDialog heavenGiftDialog=new HeavenGiftDialog(getContext());
|
||||
// heavenGiftDialog.show();
|
||||
// heavenGiftDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
// @Override
|
||||
// public void onDismiss(DialogInterface dialog) {
|
||||
// //首充弹窗关闭后,弹首充
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// FirstChargeDialog firstChargeDialog=new FirstChargeDialog(getContext());
|
||||
// firstChargeDialog.show();
|
||||
// firstChargeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
// @Override
|
||||
// public void onDismiss(DialogInterface dialog) {
|
||||
// //首充弹窗关闭后,弹首充
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
private boolean shouldShowYouthModelDialog() {
|
||||
// 从 SharedPreferences 中获取是否已经显示过青少年模式弹窗
|
||||
boolean isYouthModelShown = SpUtil.getBooleanValue("youth_model_shown",false);
|
||||
return isYouthModelShown;
|
||||
}
|
||||
private void showYouthModelDialog() {
|
||||
YouthModelDialog youthModelDialog = new YouthModelDialog(getContext(), null);
|
||||
youthModelDialog.show();
|
||||
youthModelDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
// 记录已经显示过青少年模式弹窗
|
||||
SpUtil.setBooleanValue("youth_model_shown", true);
|
||||
dialog.dismiss();
|
||||
|
||||
// 在这里可以继续显示其他弹窗,如首充弹窗
|
||||
// showFirstChargeDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void initListener () {
|
||||
super.initListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId () {
|
||||
return R.layout.fragment_voice;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VoicePresenter bindPresenter () {
|
||||
return new VoicePresenter(this, getContext());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void hideRecommend ( boolean hideRecommend, boolean hideGame){
|
||||
List<Fragment> fragments = new ArrayList<>();
|
||||
fragments.add(VoiceCategoryFragment.newInstance());
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(fragments, getChildFragmentManager()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
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;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class HotListPresenter extends BasePresenter<HotListContacts.View> implements HotListContacts.IHotListPre {
|
||||
HotListContacts.View mView;
|
||||
|
||||
public HotListPresenter(HotListContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRoomList(int type, String page, String page_limit, String is_top, String label_id) {
|
||||
Type listType = new TypeToken<List<TopRoom>>() {}.getType();
|
||||
List<TopRoom> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getTopRoom(), listType);
|
||||
if (restoredRoomModels!= null && restoredRoomModels.size() > 0 ) {
|
||||
// MvpRef.get().roomList(restoredRoomModels, type);
|
||||
}
|
||||
api.getTopRooms(page+"",page_limit,is_top,label_id,new BaseObserver<List<TopRoom>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<TopRoom> topRooms) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
HotListContacts.View view = MvpRef.get();
|
||||
if (view != null) {
|
||||
if (topRooms != null) {
|
||||
SpUtil.setTopRoom("");
|
||||
SpUtil.setTopRoom(GsonUtils.getGSON().toJson(topRooms));
|
||||
view.roomList(topRooms, type);
|
||||
} else {
|
||||
view.roomList(new ArrayList<>(), type);
|
||||
}
|
||||
view.finishRefreshLoadMore();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 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();
|
||||
// List<HomeBean> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtils.getHomeBean(), listType);
|
||||
// if (restoredRoomModels != null && restoredRoomModels.size() > 0) {
|
||||
// MvpRef.get().getMoreRoomList(restoredRoomModels);
|
||||
// }
|
||||
// ApiClient.getInstance().homepageBend(userId, new BaseObserver<List<HomeBean>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(List<HomeBean> roomModels) {
|
||||
//// MvpRef.get().roomList(roomModels);
|
||||
//
|
||||
//// SpUtils.setHomeBean(GsonUtils.getGSON().toJson(roomModels));
|
||||
//// MvpRef.get().getMoreRoomList(roomModels);
|
||||
//
|
||||
// String newHomeBeanJson = GsonUtils.getGSON().toJson(roomModels);
|
||||
// // 从本地缓存中读取现有的数据
|
||||
// String existingHomeBeanJson = SpUtils.getHomeBean();
|
||||
// // 比较新获取的数据和缓存中的数据是否一致
|
||||
// if (!newHomeBeanJson.equals(existingHomeBeanJson)) {
|
||||
// // 如果不一致,保存新数据到本地缓存
|
||||
// SpUtils.setHomeBean(newHomeBeanJson);
|
||||
// // 并调用方法处理新数据
|
||||
// MvpRef.get().getMoreRoomList(roomModels);
|
||||
// }else {
|
||||
// MvpRef.get().finishRefreshLoadMore();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// MvpRef.get().finishRefreshLoadMore();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
// TODO: 2025/4/23 推荐
|
||||
@Override
|
||||
public void getRoomListTow() {
|
||||
// Type listType = new TypeToken<List<RoomModel>>() {}.getType();
|
||||
// List<RoomModel> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtils.getRoomModel(), listType);
|
||||
// if (restoredRoomModels != null && restoredRoomModels.size() > 0) {
|
||||
// MvpRef.get().roomList(restoredRoomModels);
|
||||
// }
|
||||
// ApiClient.getInstance().getNewRoomList(new BaseObserver<List<RoomModel>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(List<RoomModel> roomModels) {
|
||||
//
|
||||
//// MvpRef.get().roomList(roomModels);
|
||||
// String newHomeBeanJson = GsonUtils.getGSON().toJson(roomModels);
|
||||
// // 从本地缓存中读取现有的数据
|
||||
// String existingHomeBeanJson = SpUtils.getRoomModel();
|
||||
// // 比较新获取的数据和缓存中的数据是否一致
|
||||
// if (!newHomeBeanJson.equals(existingHomeBeanJson)) {
|
||||
// // 如果不一致,保存新数据到本地缓存
|
||||
// SpUtils.setRoomModel(newHomeBeanJson);
|
||||
// // 并调用方法处理新数据
|
||||
// MvpRef.get().roomList(roomModels);
|
||||
// }else {
|
||||
// MvpRef.get().finishRefreshLoadMore();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// MvpRef.get().finishRefreshLoadMore();
|
||||
// }
|
||||
// });
|
||||
|
||||
// List<RoomModel> roomModels = new ArrayList<RoomModel>();
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// RoomModel roomModel = new RoomModel();
|
||||
// roomModel.setRoom_id("1");
|
||||
// roomModel.setRoom_code("1");
|
||||
// roomModel.setUser_id("1");
|
||||
// roomModel.setRoom_name("房间名称"+i);
|
||||
// roomModel.setLabel_id("23");
|
||||
// roomModel.setType_id("1");
|
||||
// roomModel.setPopularity("1");
|
||||
// roomModel.setLabel_name("1");
|
||||
// roomModel.setOwner_picture("1");
|
||||
// roomModel.setOwner_sex("1");
|
||||
// roomModel.setHolder("1");
|
||||
// roomModel.setHolder_picture("1");
|
||||
// roomModel.setHolder_sex("1");
|
||||
// roomModel.setOwner_nickname("名称"+i);
|
||||
// roomModel.setHolder_nickname("h名称"+i);
|
||||
// roomModel.setIs_owner(1);
|
||||
// roomModel.setLocked(1);
|
||||
//
|
||||
// roomModels.add(roomModel);
|
||||
// }
|
||||
//
|
||||
// MvpRef.get().roomList(roomModels);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.example.modulevoice.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.blankj.utilcode.util.ObjectUtils;
|
||||
import com.example.modulevoice.contacts.PlaceholderContacts;
|
||||
import com.xscm.moduleutil.bean.PlaceholderBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class PlaceholderPresenter extends BasePresenter<PlaceholderContacts.View> implements PlaceholderContacts.IPres {
|
||||
public PlaceholderPresenter(PlaceholderContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wealthRanking(String ranking_type, String type) {
|
||||
api.wealthRanking(ranking_type, type, new BaseObserver<PlaceholderBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(PlaceholderBean placeholderBean) {
|
||||
MvpRef.get().wealthRanking(placeholderBean.getMy_ranking());
|
||||
|
||||
if (!ObjectUtils.isEmpty(placeholderBean.getLists())) {
|
||||
List<PlaceholderBean.ListsBean> lists = placeholderBean.getLists();
|
||||
MvpRef.get().setNo1(lists.get(0),ranking_type);
|
||||
if (lists.size() > 1) {
|
||||
MvpRef.get().setNo2(lists.get(1),ranking_type);
|
||||
}else {
|
||||
MvpRef.get().setNo2(null,ranking_type);
|
||||
}
|
||||
if (lists.size() > 2) {
|
||||
MvpRef.get().setNo3(lists.get(2),ranking_type);
|
||||
}else {
|
||||
MvpRef.get().setNo3(null,ranking_type);
|
||||
}
|
||||
if (lists.size() > 3) {
|
||||
MvpRef.get().setList(lists.subList(3, lists.size()));
|
||||
}else {
|
||||
MvpRef.get().setList(null);
|
||||
}
|
||||
}else {
|
||||
MvpRef.get().setNo1(null,ranking_type);
|
||||
MvpRef.get().setNo2(null,ranking_type);
|
||||
MvpRef.get().setNo3(null,ranking_type);
|
||||
MvpRef.get().setList(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.example.modulevoice.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
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.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class SearchPresenter extends BasePresenter<SearchContacts.View> implements SearchContacts.ISearchPre {
|
||||
|
||||
private List<String> mHistory = new ArrayList<>();
|
||||
|
||||
public SearchPresenter(SearchContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSearchHistory() {
|
||||
String data = SpUtil.getSearchHistory();
|
||||
if (!StringUtils.isEmpty(data)) {
|
||||
mHistory = JSON.parseArray(data, String.class);
|
||||
} else {
|
||||
mHistory.clear();
|
||||
}
|
||||
MvpRef.get().setSearchHistory(mHistory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSearchHistory(String keyWord) {
|
||||
mHistory.remove(keyWord);
|
||||
mHistory.add(0, keyWord);
|
||||
SpUtil.saveSearchHistory(JSON.toJSONString(mHistory));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSearchHistory() {
|
||||
SpUtil.saveSearchHistory("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void search(String keyWord,String type) {
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.A020301, "send_value", keyWord);
|
||||
// MvpRef.get().showLoadings();
|
||||
api.getSearch(keyWord,type, new BaseObserver<List<RoomSearchResp>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoomSearchResp> searchResps) {
|
||||
MvpRef.get().setSearch(searchResps);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fuzzyQuery(String keyWord) {
|
||||
// ApiClient.getInstance().getSearch(keyWord, new BaseObserver<SearchResp>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(SearchResp searchResp) {
|
||||
// List<RecordSection> data = new ArrayList<>();
|
||||
// RoomResultResp room_result = searchResp.getRoom_result();
|
||||
// List<RoomResultResp.RoomResultInfo> list = room_result.getList();
|
||||
// if (list != null && list.size() != 0) {
|
||||
// data.add(new RecordSection(true, "相关房间"));
|
||||
// for (RoomResultResp.RoomResultInfo item : list) {
|
||||
// data.add(new RecordSection(item.getRoom_name()));
|
||||
// }
|
||||
// }
|
||||
// List<UserResultResp> user_result = searchResp.getUser_result();
|
||||
// if (user_result != null && user_result.size() != 0) {
|
||||
// data.add(new RecordSection(true, "相关用户"));
|
||||
// for (UserResultResp item : user_result) {
|
||||
// data.add(new RecordSection(item.getNickname()));
|
||||
// }
|
||||
// }
|
||||
// MvpRef.get().setFuzzyQuery(data);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
MvpRef.get().setFuzzyQuery(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void followUser(String userId, int type, int postion) {
|
||||
// MvpRef.get().showLoadings();
|
||||
// ApiClient.getInstance().followUser(userId, type, new BaseObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(String s) {
|
||||
// MvpRef.get().followUserSuccess(type, postion);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// MvpRef.get().disLoadings();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.example.modulevoice.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulevoice.contacts.VoiceCategoryContacts;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.xscm.moduleutil.bean.BannerModel;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.TopRoom;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.utils.GsonUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class VoiceCategoryPresenter extends BasePresenter<VoiceCategoryContacts.View> implements VoiceCategoryContacts.IIndexCategoryPre {
|
||||
VoiceCategoryContacts.View mView;
|
||||
public VoiceCategoryPresenter(VoiceCategoryContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCategories() {
|
||||
Type listType = new TypeToken<List<RoomTypeModel>>() {}.getType();
|
||||
List<RoomTypeModel> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtil.getRoomTypeModel(), listType);
|
||||
if (restoredRoomModels!= null && restoredRoomModels.size() > 0) {
|
||||
MvpRef.get().setCategories(restoredRoomModels);
|
||||
}
|
||||
api.getRoomCategories(new BaseObserver<List<RoomTypeModel>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoomTypeModel> list) {
|
||||
SpUtil.setRoomTypeModel(GsonUtils.getGSON().toJson(list));
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setCategories(list);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMediaRoom(String label_id) {
|
||||
}
|
||||
|
||||
public void getBanners() {
|
||||
// Type listType = new TypeToken<List<BannerModel>>() {}.getType();
|
||||
// List<BannerModel> restoredRoomModels = GsonUtils.getGSON().fromJson(SpUtils.getHomeBanner(), listType);
|
||||
// MvpRef.get().setBanners(restoredRoomModels);
|
||||
api.getBanners(new BaseObserver<List<BannerModel>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<BannerModel> bannerModels) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setBanners(bannerModels);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
@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);
|
||||
// }
|
||||
api.getTopRooms(page+"",page_limit,is_top,label_id,new BaseObserver<List<TopRoom>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
}
|
||||
});
|
||||
}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);
|
||||
// }
|
||||
api.getTopRooms(page+"",page_limit,is_top,label_id,new BaseObserver<List<TopRoom>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<TopRoom> topRooms) {
|
||||
// SpUtil.setTopRoom(GsonUtils.getGSON().toJson(topRooms));
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().setTopRoom(topRooms,type);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.example.modulevoice.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulevoice.contacts.VoiceContacts;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
public class VoicePresenter extends BasePresenter<VoiceContacts.View> implements VoiceContacts.IIndexPre {
|
||||
|
||||
public VoicePresenter(VoiceContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBanners() {
|
||||
// NewApi.getInstance().getBannerList(new BaseObserver<List<BannerResp>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(List<BannerResp> bannerResp) {
|
||||
// MvpRef.get().setBanners(bannerResp);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void getConfig() {
|
||||
// api.appUpdate(new com.qpyy.libcommon.http.BaseObserver<AppUpdateModel>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(AppUpdateModel appUpdateModel) {
|
||||
// String channelId = "default";
|
||||
// try {
|
||||
// channelId = MetaDataUtils.getMetaDataInApp("TD_CHANNEL_ID");
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// MvpRef.get().hideRecommend((appUpdateModel != null && appUpdateModel.getChannels() != null
|
||||
// && appUpdateModel.getChannels().contains(channelId))
|
||||
// || (appUpdateModel != null && !appUpdateModel.isShowRecommend())
|
||||
// , (appUpdateModel != null && appUpdateModel.getChannels() != null
|
||||
// && appUpdateModel.getChannels().contains(channelId))
|
||||
// || (appUpdateModel != null && !appUpdateModel.isShowGame()));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
MvpRef.get().hideRecommend(false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNameAuthResult(int type) {
|
||||
// NewApi.getInstance().getNameAuthResult(new com.qpyy.libcommon.api.BaseObserver<NameAuthResult>(false) {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// addDisposable(d);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(NameAuthResult result) {
|
||||
// if (result.getApp_status() == 2) {
|
||||
// ARouter.getInstance().build(ARouteConstants.AUTH_RESULT_PAGE).withString("failStr", result.getReason()).withInt("examineType", 1).withInt("returnResult", 3).navigation();
|
||||
// } else if (result.getApp_status() == 0) {
|
||||
//// ToastUtils.show("审核中");
|
||||
// ARouter.getInstance().build(ARouteConstants.AUTH_RESULT_PAGE).withString("failStr", result.getReason()).withInt("examineType", 1).withInt("returnResult", 1).navigation();
|
||||
// } else if (result.getApp_status() == 1) {
|
||||
//// ToastUtils.show("已认证");
|
||||
// ARouter.getInstance().build(ARouteConstants.AUTH_RESULT_PAGE).withString("failStr", result.getReason()).withInt("examineType", 1).withInt("returnResult", 2).navigation();
|
||||
// } else if (result.getApp_status() == 3) {
|
||||
// go2NameAuth(type);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onErrorCode(int code) {
|
||||
// super.onErrorCode(code);
|
||||
// if (code == ErrorCode.AUTH_NOT_EXIT) {
|
||||
// go2NameAuth(type);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
private void go2NameAuth(int type) {
|
||||
// if (type == 0) {
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_NAME_AUTH).withString("from","我的界面").navigation();
|
||||
// }
|
||||
}
|
||||
}
|
||||
170
modulevoice/src/main/res/drawable/ic_launcher_background.xml
Normal file
170
modulevoice/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
30
modulevoice/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
30
modulevoice/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
11
modulevoice/src/main/res/drawable/index_bg_search_avatar.xml
Normal file
11
modulevoice/src/main/res/drawable/index_bg_search_avatar.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:startColor="@color/color_F9FAFA"
|
||||
android:endColor="@color/color_DFFFFE"
|
||||
android:angle="180"/>
|
||||
|
||||
<corners android:radius="@dimen/dp_180"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/color_white"/>
|
||||
|
||||
<corners android:radius="@dimen/dp_14"/>
|
||||
</shape>
|
||||
10
modulevoice/src/main/res/drawable/shape_search_in.xml
Normal file
10
modulevoice/src/main/res/drawable/shape_search_in.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="@dimen/dp_295" android:height="@dimen/dp_32">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/white" />
|
||||
<corners android:radius="@dimen/dp_31" />
|
||||
<stroke android:width="2dp" android:color="@color/color_FF333333" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
70
modulevoice/src/main/res/layout/activity_ranking_list.xml
Normal file
70
modulevoice/src/main/res/layout/activity_ranking_list.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?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"
|
||||
tools:context=".activity.RankingListActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<com.xscm.moduleutil.widget.CustomTopBar
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
app:tabIndicatorHeight="10dp"
|
||||
app:tabIndicator="@mipmap/tab_x"
|
||||
app:tabTextColor="#F1ECFF"
|
||||
app:tabSelectedTextColor="@color/white"
|
||||
app:tabTextAppearance="@style/CustomTabTextAppearance"
|
||||
app:tabIndicatorFullWidth="true"
|
||||
app:tabIndicatorColor="@null"
|
||||
app:tabMode="fixed"/>
|
||||
<!-- app:tabBackground="@mipmap/real_img"-->
|
||||
<!-- app:tabInlineLabel="true"-->
|
||||
<!-- app:tabContentStart="@dimen/dp_23"-->
|
||||
<!-- app:tabGravity="center"-->
|
||||
<!-- app:tabIconTint="@color/color_FF333333"-->
|
||||
<!-- app:tabIconTintMode="add"-->
|
||||
<!-- app:tabIndicatorAnimationDuration="@integer/material_motion_duration_long_1"-->
|
||||
<!-- app:tabIndicator="@color/color_FF333333"-->
|
||||
<!-- app:tabIndicatorAnimationMode="elastic"-->
|
||||
<!-- app:tabIndicatorColor="@color/color_FF333333"-->
|
||||
<!-- app:tabIndicatorFullWidth="true"-->
|
||||
<!-- app:tabIndicatorGravity="center"-->
|
||||
<!-- app:tabIndicatorHeight="@dimen/dp_23"-->
|
||||
<!-- app:tabMaxWidth="@dimen/dp_23"-->
|
||||
<!-- app:tabMinWidth="@dimen/dp_23"-->
|
||||
<!-- app:tabMode="auto"-->
|
||||
<!-- app:tabPadding="@dimen/dp_23"-->
|
||||
<!-- app:tabRippleColor="@color/color_FF333333"-->
|
||||
<!-- app:tabSelectedTextAppearance="@dimen/dp_23"-->
|
||||
<!-- app:tabSelectedTextColor="@color/color_FF333333"-->
|
||||
<!-- app:tabTextAppearance="@dimen/dp_23"-->
|
||||
<!-- app:tabTextColor="@color/color_FF333333"-->
|
||||
<!-- app:tabUnboundedRipple="true"-->
|
||||
<!-- />-->
|
||||
|
||||
<com.xscm.moduleutil.widget.ScrollViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tabs"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
248
modulevoice/src/main/res/layout/activity_search.xml
Normal file
248
modulevoice/src/main/res/layout/activity_search.xml
Normal file
@@ -0,0 +1,248 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginBottom="@dimen/dp_13"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
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_marginBottom="@dimen/dp_6"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_search_in"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginLeft="@dimen/dp_11"
|
||||
android:layout_marginRight="@dimen/dp_7"
|
||||
android:src="@drawable/index_level_search" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_query"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="输入相关的房间名"
|
||||
android:maxLength="10"
|
||||
android:singleLine="true"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/dp_20"
|
||||
android:text="取消"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- 搜索历使 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="历史记录"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="normal"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 正在搜索 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view_record"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
<!-- 搜索结果 -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/nestedscrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<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">
|
||||
|
||||
<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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:text="全部 7"
|
||||
android:textColor="#ffa6a6a6"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
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">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:text="相关用户"
|
||||
android:textColor="#ff9c9c9c"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view_user"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF"
|
||||
android:padding="@dimen/dp_17" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_null"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_110"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:text="什么也没有~"
|
||||
android:textColor="#ffbdbdbc"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
15
modulevoice/src/main/res/layout/custom_tab_layout.xml
Normal file
15
modulevoice/src/main/res/layout/custom_tab_layout.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
39
modulevoice/src/main/res/layout/fragment_hot_list.xml
Normal file
39
modulevoice/src/main/res/layout/fragment_hot_list.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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">
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/tv_hot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:text="平台推荐"
|
||||
android:textColor="#333333"
|
||||
android:paddingStart="@dimen/dp_6"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/dp_6"
|
||||
android:paddingRight="@dimen/dp_6"
|
||||
android:paddingBottom="@dimen/dp_80" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</layout>
|
||||
95
modulevoice/src/main/res/layout/fragment_ranking_list.xml
Normal file
95
modulevoice/src/main/res/layout/fragment_ranking_list.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_transparent"
|
||||
android:clipChildren="false">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintDimensionRatio="340:25"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<TextView
|
||||
android:id="@+id/tv_day"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="日榜"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_week"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r80_hui"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:text="周榜"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_month"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:background="@drawable/bg_r80_hui"
|
||||
android:gravity="center"
|
||||
android:text="月榜"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/include_top_bar"
|
||||
layout="@layout/ranking_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_70"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
106
modulevoice/src/main/res/layout/fragment_voice.xml
Normal file
106
modulevoice/src/main/res/layout/fragment_voice.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
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">
|
||||
|
||||
<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"/>
|
||||
|
||||
<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: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"/>
|
||||
|
||||
<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" />
|
||||
|
||||
<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"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.ScrollViewPager
|
||||
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" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
139
modulevoice/src/main/res/layout/fragment_voice_category.xml
Normal file
139
modulevoice/src/main/res/layout/fragment_voice_category.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?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">
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
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: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">
|
||||
|
||||
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:bvp_indicator_visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<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">
|
||||
|
||||
<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" />
|
||||
|
||||
|
||||
<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" />
|
||||
|
||||
|
||||
</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" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
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" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:background="@color/color_transparent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
7
modulevoice/src/main/res/layout/index_image_banner.xml
Normal file
7
modulevoice/src/main/res/layout/index_image_banner.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.makeramen.roundedimageview.RoundedImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:riv_corner_radius="@dimen/dp_14" />
|
||||
83
modulevoice/src/main/res/layout/index_item_carousel.xml
Normal file
83
modulevoice/src/main/res/layout/index_item_carousel.xml
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_6">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_follow_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/default_avatar"
|
||||
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" />-->
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play"
|
||||
android:layout_width="@dimen/dp_17"
|
||||
android:layout_height="@dimen/dp_11"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:src="@drawable/phonetic"
|
||||
app:layout_constraintStart_toStartOf="@id/ll"
|
||||
app:layout_constraintTop_toTopOf="@id/ll" />
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_tags"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:layout_marginBottom="@dimen/dp_9"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ll"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:listitem="@layout/index_item_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_num"
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginEnd="@dimen/dp_9"
|
||||
android:layout_marginBottom="@dimen/dp_9"
|
||||
android:gravity="center"
|
||||
android:drawableLeft="@mipmap/ren"
|
||||
android:text="200人"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/ll"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:gravity="center"
|
||||
android:textColor="#F1ECFF"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll"
|
||||
tools:text="标题" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
22
modulevoice/src/main/res/layout/index_item_history.xml
Normal file
22
modulevoice/src/main/res/layout/index_item_history.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:background="@drawable/index_bg_tag"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="45865"></TextView>
|
||||
|
||||
</RelativeLayout>
|
||||
19
modulevoice/src/main/res/layout/index_item_image.xml
Normal file
19
modulevoice/src/main/res/layout/index_item_image.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/riv_user_head"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_13"
|
||||
android:layout_centerHorizontal="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_6"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
27
modulevoice/src/main/res/layout/index_item_record.xml
Normal file
27
modulevoice/src/main/res/layout/index_item_record.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="#FFF"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:src="@mipmap/index_icon_search"></ImageView>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:text="马恩岛"
|
||||
android:textColor="#6D7278"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rl_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_marginLeft="@dimen/dp_1"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_follow_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/default_avatar"
|
||||
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>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:src="@mipmap/jiaoyou"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ll"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_34"
|
||||
android:text="烟花易冷"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:src="@drawable/phonetic"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_name"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="烟花易冷"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_name"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/view_num_bg"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@drawable/bg_r15_4d000000"
|
||||
android:gravity="center|left"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:src="@mipmap/f_h" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:text="99"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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>
|
||||
|
||||
|
||||
<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">
|
||||
|
||||
<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="在线" />
|
||||
|
||||
<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_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>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
19
modulevoice/src/main/res/layout/index_item_tecord_head.xml
Normal file
19
modulevoice/src/main/res/layout/index_item_tecord_head.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_33"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#F4F4F4">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_head"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
tools:text="相关房间"
|
||||
android:textColor="#ff9c9c9c"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</RelativeLayout>
|
||||
123
modulevoice/src/main/res/layout/index_rv_item_ranking_list.xml
Normal file
123
modulevoice/src/main/res/layout/index_rv_item_ranking_list.xml
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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_48"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_no"
|
||||
android:layout_width="@dimen/dp_38"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12"
|
||||
tools:text="1" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv_avatar"
|
||||
android:layout_width="@dimen/dp_36"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:src="@color/color_FF88CF"
|
||||
app:riv_border_color="#FFFA447D"
|
||||
app:gav_border_color="#FFFA447D"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_3_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_three_cp1_head"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:src="@color/white" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_three_cp2_head"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_toRightOf="@+id/iv_three_cp1_head"
|
||||
android:src="@color/white" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/cp_pt"
|
||||
android:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLength="6"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="利力星" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/bnv_rank_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_level"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
android:layout_marginRight="@dimen/dp_14"
|
||||
android:drawableStart="@mipmap/xing"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_25"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top2"
|
||||
tools:text="6777" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
121
modulevoice/src/main/res/layout/index_rv_item_room_hot0.xml
Normal file
121
modulevoice/src/main/res/layout/index_rv_item_room_hot0.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rl_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_marginLeft="@dimen/dp_1"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_15">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_follow_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/default_avatar"
|
||||
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>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type"
|
||||
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="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
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"
|
||||
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:src="@drawable/phonetic"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="烟花易冷"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_name" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/view_num_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:gravity="center|left"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:src="@mipmap/f_h" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:text="99"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
30
modulevoice/src/main/res/layout/index_view_empty.xml
Normal file
30
modulevoice/src/main/res/layout/index_view_empty.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_110"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/common_img_empty" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:text="什么也没有~"
|
||||
android:textColor="#ffbdbdbc"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
993
modulevoice/src/main/res/layout/ranking_list.xml
Normal file
993
modulevoice/src/main/res/layout/ranking_list.xml
Normal file
@@ -0,0 +1,993 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:ignore="ResourceName">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/dp_12"
|
||||
android:paddingEnd="@dimen/dp_12"
|
||||
tools:background="@color/color_FF9BB1FF">
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/view_top2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
app:layout_constraintEnd_toStartOf="@+id/view_top1"
|
||||
app:layout_constraintHorizontal_chainStyle="spread"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top1" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_top1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_106"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
app:layout_constraintEnd_toStartOf="@+id/view_top3"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toEndOf="@id/view_top2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_top3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_96"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toEndOf="@id/view_top1"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top1" />
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv_2"
|
||||
android:layout_width="@dimen/dp_58"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top2"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top2"
|
||||
app:layout_constraintVertical_bias="0.7"
|
||||
app:riv_oval="true" />
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top2"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:paddingStart="@dimen/dp_20"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/guanb2" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_2_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_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:layout_centerInParent="true"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@mipmap/huangg2"
|
||||
android:scaleType="fitCenter" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_2_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center|top"
|
||||
android:visibility="gone"
|
||||
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_second_cp1_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:rotation="-20"
|
||||
/>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_second_cp2_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_toEndOf="@+id/iv_second_cp1_head"
|
||||
android:rotation="20"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_98"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:src="@mipmap/cp_second"
|
||||
android:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:layout_marginTop="@dimen/dp_63"
|
||||
android:gravity="center"
|
||||
android:text="TOP 2"
|
||||
android:textColor="#4586DD"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_username2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:text=""
|
||||
android:textColor="#ff666666"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_xing2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_25"
|
||||
android:background="@mipmap/bangdan4"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="9070" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top1"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top1"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:scaleType="centerCrop"
|
||||
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_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:layout_centerInParent="true"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im1"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/huangg1" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_1_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center|top"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_one_cp1_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
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_one_cp2_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_toEndOf="@+id/iv_one_cp1_head"
|
||||
android:rotation="20"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_98"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:src="@mipmap/cp_one"
|
||||
android:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:layout_marginTop="@dimen/dp_62"
|
||||
android:gravity="center"
|
||||
android:text="TOP 1"
|
||||
android:textColor="#D74D2C"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_username1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:text=""
|
||||
android:textColor="#ff666666"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_xing1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_25"
|
||||
android:background="@mipmap/bangdan4"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="9070" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top3"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_gravity="center"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
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_horizontal"
|
||||
android:paddingEnd="@dimen/dp_1"
|
||||
android:gravity="center_horizontal"
|
||||
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/im_user3"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
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_centerInParent="true"
|
||||
android:src="@mipmap/huangg3"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/r_3_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_7"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_three_cp1_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:rotation="-20"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/iv_three_cp2_head"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_toEndOf="@+id/iv_three_cp1_head"
|
||||
android:rotation="20"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_98"
|
||||
android:layout_height="@dimen/dp_54"
|
||||
android:src="@mipmap/cp_three"
|
||||
android:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:layout_marginTop="@dimen/dp_63"
|
||||
android:gravity="center"
|
||||
android:text="TOP 3"
|
||||
android:textColor="#E3B464"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_username3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:text=""
|
||||
android:textColor="#ff666666"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_xing3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="@dimen/dp_25"
|
||||
android:background="@mipmap/bangdan4"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="9070" />
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@mipmap/huangg2"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top2"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top2" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg_two"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_110"
|
||||
android:paddingStart="@dimen/dp_20"
|
||||
android:scaleType="center"
|
||||
android:src="@mipmap/guanb2"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_bg_one"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/iv_bg_one"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv_1"
|
||||
android:layout_width="@dimen/dp_67"
|
||||
android:layout_height="@dimen/dp_67"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top1"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintHorizontal_bias="0.487"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top1"
|
||||
app:layout_constraintVertical_bias="0.6"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@mipmap/huangg1"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top1"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top1" />
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv_3"
|
||||
android:layout_width="@dimen/dp_58"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top3"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top3"
|
||||
app:layout_constraintVertical_bias="0.7"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@mipmap/huangg3"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top3"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
app:layout_constraintTop_toTopOf="@id/view_top3" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg_one"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_70"
|
||||
android:scaleType="center"
|
||||
android:src="@mipmap/guanb1"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toRightOf="@+id/iv_bg_two"
|
||||
|
||||
app:layout_constraintRight_toLeftOf="@id/iv_bg_three"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg_three"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
android:scaleType="center"
|
||||
android:src="@mipmap/guanb3"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_bg_one"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_bg_one"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="@dimen/dp_90"
|
||||
android:maxLength="10"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top2"
|
||||
tools:text="我是一个温柔的大树" />
|
||||
|
||||
<com.xscm.moduleutil.widget.BeautifulNameView
|
||||
android:id="@+id/beautiful_view_second"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:maxWidth="@dimen/dp_90"
|
||||
android:maxLength="10"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top1"
|
||||
tools:text="我是一个温柔的大树" />
|
||||
|
||||
<com.xscm.moduleutil.widget.BeautifulNameView
|
||||
android:id="@+id/beautiful_view_first"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:maxWidth="@dimen/dp_90"
|
||||
android:maxLength="10"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_top3"
|
||||
tools:text="我是一个温柔的大树" />
|
||||
|
||||
<com.xscm.moduleutil.widget.BeautifulNameView
|
||||
android:id="@+id/beautiful_view_third"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:background="@mipmap/common_bg_rank_wealth_sr"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_28"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_top2"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_name2"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
tools:text="677777" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:background="@mipmap/common_bg_rank_wealth_sr"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_28"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_name1"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
tools:text="6777" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:background="@mipmap/common_bg_rank_wealth_sr"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_28"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_8"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_top3"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_name3"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
tools:text="6777" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_vip2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top2"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top2"
|
||||
app:layout_constraintTop_toBottomOf="@id/beautiful_view_second">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip2"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_level2"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_vip1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top1"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top1"
|
||||
app:layout_constraintTop_toBottomOf="@id/beautiful_view_first">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip1"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_level1"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_vip3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_top3"
|
||||
app:layout_constraintStart_toStartOf="@id/view_top3"
|
||||
app:layout_constraintTop_toBottomOf="@id/beautiful_view_third">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip3"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_level3"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:scaleType="fitCenter" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/common_bg_top_r15_white"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingBottom="@dimen/dp_68"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/fl_2"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<com.lihang.ShadowLayout
|
||||
android:id="@+id/sl_my"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:hl_cornerRadius_leftTop="@dimen/dp_15"
|
||||
app:hl_cornerRadius_rightTop="@dimen/dp_15"
|
||||
app:hl_shadowColor="#618F6FFF"
|
||||
app:hl_shadowHidden="true"
|
||||
app:hl_shadowHiddenBottom="false"
|
||||
app:hl_shadowHiddenLeft="false"
|
||||
app:hl_shadowHiddenRight="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:background="@mipmap/bangdan"
|
||||
android:paddingLeft="@dimen/dp_20"
|
||||
android:paddingRight="@dimen/dp_20">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_my"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:ignore="MissingConstraints"
|
||||
>
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv"
|
||||
android:layout_width="@dimen/dp_37"
|
||||
android:layout_height="@dimen/dp_37"
|
||||
app:gav_border_color="@color/color_FF5872FF"
|
||||
app:gav_border_width="@dimen/dp_1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_border_color="@color/color_FF5872FF"
|
||||
app:riv_border_width="@dimen/dp_1"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:layout_toEndOf="@id/riv"
|
||||
android:layout_toRightOf="@+id/riv"
|
||||
app:layout_constraintStart_toEndOf="@id/riv"
|
||||
app:layout_constraintTop_toTopOf="@id/riv"
|
||||
tools:text="Alan Bates" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:background="@mipmap/bangdan2"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_25"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:layout_toRightOf="@id/riv"
|
||||
android:layout_alignBottom="@id/riv"
|
||||
tools:text="9070" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_my_cp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
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: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:scaleType="fitCenter"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/v_my_cp1_head"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:src="@mipmap/cp_pt"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:layout_toEndOf="@id/v_my_cp1_head"
|
||||
android:layout_toRightOf="@+id/v_my_cp1_head"
|
||||
app:layout_constraintStart_toEndOf="@id/v_my_cp1_head"
|
||||
app:layout_constraintTop_toTopOf="@id/v_my_cp1_head"
|
||||
tools:text="Alan Bates" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:gravity="center"
|
||||
android:layout_toEndOf="@id/tv_my_name"
|
||||
android:layout_toRightOf="@+id/tv_my_name"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_my_name"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_my_name"
|
||||
tools:text="ID:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:layout_toEndOf="@id/v_my_cp1_head"
|
||||
android:layout_toRightOf="@+id/v_my_cp1_head"
|
||||
android:layout_below="@id/tv_my_name"
|
||||
tools:text="9070"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_charm_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:layout_toEndOf="@id/tv_my_charm"
|
||||
android:layout_toRightOf="@+id/tv_my_charm"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_my_charm"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_my_charm"
|
||||
android:layout_below="@+id/tv_my_id"
|
||||
tools:text="ID:"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_rank_no"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_FFA8A8A8"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="距上榜差 1232" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_rank_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:text=""
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_rank_no"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.lihang.ShadowLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
modulevoice/src/main/res/mipmap-xxhdpi/jiaoyou.webp
Normal file
BIN
modulevoice/src/main/res/mipmap-xxhdpi/jiaoyou.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
BIN
modulevoice/src/main/res/mipmap-xxxhdpi/me_head_bg.png
Normal file
BIN
modulevoice/src/main/res/mipmap-xxxhdpi/me_head_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
modulevoice/src/main/res/mipmap-xxxhdpi/xing.webp
Normal file
BIN
modulevoice/src/main/res/mipmap-xxxhdpi/xing.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
3
modulevoice/src/main/res/values-en-rUs/strings.xml
Normal file
3
modulevoice/src/main/res/values-en-rUs/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||
|
||||
</resources>
|
||||
16
modulevoice/src/main/res/values-night/themes.xml
Normal file
16
modulevoice/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
10
modulevoice/src/main/res/values/colors.xml
Normal file
10
modulevoice/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
</resources>
|
||||
3
modulevoice/src/main/res/values/strings.xml
Normal file
3
modulevoice/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="common_id_formatter" translatable="false" tools:ignore="ResourceName">ID: %s</string>
|
||||
</resources>
|
||||
16
modulevoice/src/main/res/values/themes.xml
Normal file
16
modulevoice/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.QxLive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.modulevoice;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user