修改交友布局
This commit is contained in:
1
modulecircle/.gitignore
vendored
Normal file
1
modulecircle/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
64
modulecircle/build.gradle
Normal file
64
modulecircle/build.gradle
Normal file
@@ -0,0 +1,64 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.android)
|
||||
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.modulecircle'
|
||||
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 = '11'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation libs.appcompat
|
||||
implementation libs.material
|
||||
implementation libs.activity
|
||||
implementation libs.constraintlayout
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.ext.junit
|
||||
androidTestImplementation libs.espresso.core
|
||||
|
||||
|
||||
|
||||
implementation(libs.arouter.api.v150)
|
||||
//annotationProcessor
|
||||
annotationProcessor libs.arouter.compiler
|
||||
implementation project(':moduleUtil')
|
||||
implementation project(':moduletablayout')
|
||||
implementation project(':modulevocal')
|
||||
}
|
||||
|
||||
apply plugin: 'com.alibaba.arouter' // ⚠️ 添加这一行
|
||||
21
modulecircle/proguard-rules.pro
vendored
Normal file
21
modulecircle/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.modulecircle;
|
||||
|
||||
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.modulecircle", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
27
modulecircle/src/main/AndroidManifest.xml
Normal file
27
modulecircle/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true">
|
||||
<activity
|
||||
android:name=".activity.DynamicDetailActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".activity.DynamicListActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"/>
|
||||
<activity
|
||||
android:name=".activity.ReleaseActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,469 @@
|
||||
package com.example.modulecircle.activity;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulecircle.R;
|
||||
import com.example.modulecircle.contacts.CircleContacts;
|
||||
import com.example.modulecircle.databinding.ActivityDynamicDetailBinding;
|
||||
import com.example.modulecircle.presenter.CirclePresenter;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.adapter.CirleListAdapter;
|
||||
import com.xscm.moduleutil.adapter.CommentAdapter;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.event.GiftRewardEvent;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ChatLauncher;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.dialog.CommentDialogFragment;
|
||||
import com.xscm.moduleutil.widget.dialog.RewardGiftDialogFragment;
|
||||
import com.xscm.moduleutil.widget.dialog.ShareDialog;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/3
|
||||
* @description: 语圈详情
|
||||
*/
|
||||
@Route(path = ARouteConstants.DYNAMIC_DETAIL)
|
||||
public class DynamicDetailActivity extends BaseMvpActivity<CirclePresenter, ActivityDynamicDetailBinding> implements
|
||||
CircleContacts.View, CommentAdapter.OnCommentInteractionListener {
|
||||
private String zone_id;
|
||||
CirleListAdapter cirleListAdapter;
|
||||
private CommentAdapter commentAdapter;
|
||||
private int currentReplyId = 0; // 记录当前正在回复的评论ID
|
||||
private String TreplyTo = "";
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.topicId(zone_id, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("动态详情");
|
||||
zone_id = getIntent().getStringExtra("zone_id");
|
||||
|
||||
mBinding.tvSend.setOnClickListener(this::onClick);
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||
cirleListAdapter = new CirleListAdapter(CirleListAdapter.PAGE_HOME);
|
||||
mBinding.recycleView.setAdapter(cirleListAdapter);
|
||||
cirleListAdapter.setOnItemClickListener(new CirleListAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onDianzanClick(CircleListBean item) {
|
||||
MvpPre.likeZone(item.getId() + "");
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
if (position != -1) {
|
||||
// 更新点赞状态
|
||||
item.setIs_like(item.getIs_like() == 1 ? 0 : 1);
|
||||
// 局部刷新
|
||||
cirleListAdapter.updateLikeStatusOnly(position, item.getIs_like());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeadImageClick(CircleListBean item) {
|
||||
// Toast.makeText(getApplicationContext(), "查看主页:" + item.getNickname(), Toast.LENGTH_SHORT).show();
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id() + "").navigation();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onZsClick(CircleListBean item) {
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
RewardGiftDialogFragment.show(String.valueOf(item.getId()),item.getUser_id() + "",position, getSupportFragmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDiandianClick(CircleListBean item) {
|
||||
ShareDialog shareDialog = new ShareDialog(DynamicDetailActivity.this, item.getContent(), item.getShare_url(), item.getId()+"",3,item.getUser_id() + "",item);
|
||||
shareDialog.setOnShareDataListener(new ShareDialog.OnShareDataListener() {
|
||||
|
||||
@Override
|
||||
public void onShareDataLoaded(String id) {
|
||||
MvpPre.deleteZone(id);
|
||||
}
|
||||
});
|
||||
shareDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPinglunClick(CircleListBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelaClick(CircleListBean item) {
|
||||
CommentDialogFragment.show(String.valueOf(item.getId()), getSupportFragmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGensui(CircleListBean item) {
|
||||
if (item.getRoom_id()!=null && !item.getRoom_id().equals("0")) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
}else {
|
||||
ChatLauncher.getInstance().launchC2CChat(DynamicDetailActivity.this, item.getUser_id()+"");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.rvComment.setLayoutManager(new LinearLayoutManager(this));
|
||||
commentAdapter = new CommentAdapter(new ArrayList<>());
|
||||
mBinding.rvComment.setAdapter(commentAdapter);
|
||||
commentAdapter.setOnCommentInteractionListener(this);
|
||||
|
||||
|
||||
// mBinding.etInput.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
// if (hasFocus) {
|
||||
// new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
// mBinding.scrollView.fullScroll(View.FOCUS_DOWN);
|
||||
// }, 200);
|
||||
// }
|
||||
// });
|
||||
|
||||
// 在 initData() 中添加:
|
||||
final View rootView = findViewById(android.R.id.content);
|
||||
final View inputBar = mBinding.clInput;
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
|
||||
int keyboardHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
|
||||
|
||||
if (keyboardHeight > 0) {
|
||||
// 键盘弹出时,将输入栏上移
|
||||
inputBar.setTranslationY(-keyboardHeight);
|
||||
|
||||
// 安全地滚动列表(添加空列表检查)
|
||||
if (commentAdapter.getItemCount() > 0) {
|
||||
try {
|
||||
mBinding.rvComment.smoothScrollToPosition(commentAdapter.getItemCount() - 1);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// 防止意外情况
|
||||
mBinding.rvComment.scrollToPosition(commentAdapter.getItemCount() - 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 键盘收起时复位
|
||||
inputBar.setTranslationY(0);
|
||||
}
|
||||
return insets;
|
||||
});
|
||||
|
||||
|
||||
// 点击输入框自动弹出键盘
|
||||
mBinding.etInput.setOnClickListener(v -> {
|
||||
mBinding.etInput.requestFocus();
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(mBinding.etInput, InputMethodManager.SHOW_IMPLICIT);
|
||||
});
|
||||
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(GiftRewardEvent event) {
|
||||
cirleListAdapter.notifyItemChanged(event.getPoints());
|
||||
}
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_send) {
|
||||
if (mBinding.etInput.getText().toString().isEmpty()) {
|
||||
ToastUtils.showShort("请输入评论内容");
|
||||
return;
|
||||
}
|
||||
// 判断是回复还是普通评论
|
||||
if (currentReplyId != 0) {
|
||||
// 回复某条评论
|
||||
comZone(zone_id, mBinding.etInput.getText().toString(), String.valueOf(currentReplyId), TreplyTo);
|
||||
} else {
|
||||
// 普通评论
|
||||
comZone(zone_id, mBinding.etInput.getText().toString(), "0", TreplyTo);
|
||||
}
|
||||
// 清空输入框但不清除焦点,保留软键盘
|
||||
mBinding.etInput.setText("");
|
||||
mBinding.etInput.requestFocus(); // 保持焦点
|
||||
}
|
||||
}
|
||||
|
||||
private void comZone(String zoneId, String content, String pid, String replyTo) {
|
||||
MvpPre.commentZone(zoneId, content, pid, replyTo);
|
||||
mBinding.etInput.setText("");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_dynamic_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CirclePresenter bindPresenter() {
|
||||
return new CirclePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCategories(List<HeatedBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpandColumn(List<ExpandColumnBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
MvpPre.topicId(zone_id, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleDetail(CircleListBean bean) {
|
||||
List<CircleListBean> beanList = new ArrayList<>();
|
||||
beanList.add(bean);
|
||||
cirleListAdapter.setNewData(beanList);
|
||||
MvpPre.getCommentList(zone_id, "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCommentList(CommentBean commentBean) {
|
||||
if (commentBean != null) {
|
||||
mBinding.tvNum.setText("全部评论(" + commentBean.getTotal() + ")");
|
||||
commentAdapter.updateData(commentBean.getList()); // 假设 CommentBean 包含评论列表
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commentZone() {
|
||||
// MvpPre.getCommentList(zone_id, "1", "10");
|
||||
MvpPre.topicId(zone_id, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishComment() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputBoxShow(int id, String s, int position, String replyTo) {
|
||||
mBinding.etInput.requestFocus();
|
||||
|
||||
// 2. 自动弹出软键盘
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||
if (imm != null) {
|
||||
imm.showSoftInput(mBinding.etInput, InputMethodManager.SHOW_IMPLICIT);
|
||||
}
|
||||
}, 200);
|
||||
|
||||
// 3. 可选:预填回复内容(如@用户)
|
||||
if (!TextUtils.isEmpty(s)) {
|
||||
mBinding.etInput.setText(s);
|
||||
mBinding.etInput.setSelection(s.length()); // 光标移至末尾
|
||||
}
|
||||
|
||||
// 4. 记录被回复的评论ID(用于后续提交)
|
||||
currentReplyId = id; // 需要在Activity中声明这个字段
|
||||
TreplyTo = replyTo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetaleClick(int id, int position) {
|
||||
deleteComment1(id,position);
|
||||
// MvpPre.deleteComment(id+"");
|
||||
}
|
||||
private void deleteComment1(int commentId, int position) {
|
||||
// 创建并显示确认对话框
|
||||
new ConfirmDialog(this,
|
||||
"提示",
|
||||
"确定要删除此评论吗?",
|
||||
"确认",
|
||||
"取消",
|
||||
v -> {
|
||||
// 点击“确认”按钮时执行删除操作
|
||||
MvpPre.deleteComment(String.valueOf(commentId));
|
||||
// 移除数据(假设 commentAdapter 是你的 RecyclerView 适配器)
|
||||
// commentAdapter.removeItem(position);
|
||||
},
|
||||
v -> {
|
||||
// 点击“取消”按钮时什么都不做
|
||||
},false,0).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCommentLongClick(CommentBean.CommentDetailsBean comment,CommentBean.CommentDetailsBean.Replies reply, int position) {
|
||||
String[] options ;
|
||||
if (comment.getUser_id() == SpUtil.getUserId()){
|
||||
options = new String[]{"复制", "删除", "回复", "取消"};
|
||||
}else {
|
||||
if (reply!=null) {
|
||||
if (reply.getUser_id() == SpUtil.getUserId()) {
|
||||
options = new String[]{"复制", "删除", "回复", "取消"};
|
||||
} else {
|
||||
options = new String[]{"复制", "回复", "取消"};
|
||||
}
|
||||
}else {
|
||||
options = new String[]{"复制", "回复", "取消"};
|
||||
}
|
||||
}
|
||||
|
||||
// new AlertDialog.Builder(this)
|
||||
// .setItems(options, (dialog, which) -> {
|
||||
// switch (which) {
|
||||
// case 0: // 复制
|
||||
// copyComment(comment.getContent());
|
||||
// break;
|
||||
// case 1: // 删除
|
||||
// deleteComment(comment.getId(), position);
|
||||
// break;
|
||||
// case 2: // 回复
|
||||
// onInputBoxShow(comment.getId(), "", position,"");
|
||||
// break;
|
||||
// case 3: // 取消
|
||||
// dialog.dismiss();
|
||||
// break;
|
||||
// }
|
||||
// })
|
||||
// .setCancelable(true)
|
||||
// .create()
|
||||
// .show();
|
||||
|
||||
// 创建底部对话框
|
||||
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
|
||||
View dialogView = getLayoutInflater().inflate(com.xscm.moduleutil.R.layout.dialog_bottom_sheet_actions, null);
|
||||
|
||||
// 初始化视图
|
||||
LinearLayout container = dialogView.findViewById(com.xscm.moduleutil.R.id.ll_options_container);
|
||||
|
||||
// 动态添加选项
|
||||
for (int i = 0; i < options.length; i++) {
|
||||
TextView textView = new TextView(this);
|
||||
textView.setText(options[i]);
|
||||
textView.setTextSize(16);
|
||||
textView.setPadding(
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_16),
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_14),
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_16),
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_14)
|
||||
);
|
||||
|
||||
// 设置点击效果
|
||||
textView.setBackgroundResource(com.xscm.moduleutil.R.drawable.bg_bottom_sheet_item);
|
||||
final int optionIndex = i;
|
||||
textView.setOnClickListener(v -> {
|
||||
handleOptionClick(optionIndex, comment,reply, position);
|
||||
bottomSheetDialog.dismiss();
|
||||
});
|
||||
|
||||
container.addView(textView);
|
||||
|
||||
// 添加分割线(除了最后一个)
|
||||
if (i < options.length - 1) {
|
||||
View divider = new View(this);
|
||||
divider.setBackgroundColor(ContextCompat.getColor(this, com.xscm.moduleutil.R.color.color_FFEEEEEE));
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_1)
|
||||
);
|
||||
divider.setLayoutParams(params);
|
||||
container.addView(divider);
|
||||
}
|
||||
}
|
||||
|
||||
bottomSheetDialog.setContentView(dialogView);
|
||||
bottomSheetDialog.show();
|
||||
}
|
||||
private void handleOptionClick(int optionIndex, CommentBean.CommentDetailsBean comment,CommentBean.CommentDetailsBean.Replies reply, int position) {
|
||||
if (comment.getUser_id() == SpUtil.getUserId()||reply!=null) {
|
||||
// 当前用户的评论选项
|
||||
switch (optionIndex) {
|
||||
case 0: // 复制
|
||||
if (reply!=null) {
|
||||
copyComment(reply.getContent());
|
||||
}else {
|
||||
copyComment(comment.getContent());
|
||||
}
|
||||
break;
|
||||
case 1: // 删除
|
||||
if (reply!=null) {
|
||||
// deleteComment(reply.getId(), position);
|
||||
deleteComment1(reply.getId(), position);
|
||||
}else {
|
||||
// deleteComment(comment.getId(), position);
|
||||
deleteComment1(comment.getId(), position);
|
||||
}
|
||||
break;
|
||||
case 2: // 回复
|
||||
if (reply!=null){
|
||||
onInputBoxShow(reply.getPid(), "", position, reply.getReply_to_user()+"");
|
||||
}else {
|
||||
onInputBoxShow(comment.getId(), "", position, "");
|
||||
}
|
||||
break;
|
||||
// 取消选项不需要处理
|
||||
}
|
||||
} else {
|
||||
// 其他用户的评论选项
|
||||
switch (optionIndex) {
|
||||
case 0: // 复制
|
||||
if (reply!=null) {
|
||||
copyComment(reply.getContent());
|
||||
}else {
|
||||
copyComment(comment.getContent());
|
||||
}
|
||||
break;
|
||||
case 1: // 回复
|
||||
if (reply!=null){
|
||||
onInputBoxShow(reply.getPid(), "", position, reply.getReply_to_user()+"");
|
||||
}else {
|
||||
onInputBoxShow(comment.getId(), "", position, "");
|
||||
}
|
||||
break;
|
||||
// 取消选项不需要处理
|
||||
}
|
||||
}
|
||||
}
|
||||
// 具体操作方法
|
||||
private void copyComment(String content) {
|
||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("comment", content);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
Toast.makeText(this, "已复制", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
private void deleteComment(int commentId, int position) {
|
||||
// 调用删除API
|
||||
MvpPre.deleteComment(String.valueOf(commentId));
|
||||
// 临时移除数据
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.example.modulecircle.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.LeadingMarginSpan;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulecircle.R;
|
||||
import com.example.modulecircle.contacts.CircleContacts;
|
||||
import com.example.modulecircle.databinding.ActivityDynamicListBinding;
|
||||
import com.example.modulecircle.presenter.CirclePresenter;
|
||||
import com.example.modulevocal.activity.UserHomepageActivity;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.adapter.CirleListAdapter;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.event.GiftRewardEvent;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ChatLauncher;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.dialog.RewardGiftDialogFragment;
|
||||
import com.xscm.moduleutil.widget.dialog.ShareDialog;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/3
|
||||
*@description: 广场中顶部的热议点击进入的列表展示
|
||||
*/
|
||||
@Route(path = ARouteConstants.CIRCLE_LIST)
|
||||
public class DynamicListActivity extends BaseMvpActivity<CirclePresenter, ActivityDynamicListBinding> implements CircleContacts.View {
|
||||
|
||||
private HeatedBean heatedBean;
|
||||
CirleListAdapter cirleListAdapter;
|
||||
@Override
|
||||
protected void initData() {
|
||||
heatedBean= getIntent().getParcelableExtra("heatedBean");
|
||||
mBinding.topBar.setTitle(heatedBean.getTitle());
|
||||
MvpPre.topicId(heatedBean.getTopic_id(),1);
|
||||
ImageUtils.loadHeadCC(heatedBean.getPic(),mBinding.ivAvatar);
|
||||
mBinding.tvTitle.setText(heatedBean.getTitle());
|
||||
mBinding.tvDescription.setText(heatedBean.getCount()+"条动态");
|
||||
SpannableString spannableString=new SpannableString(heatedBean.getContent());
|
||||
spannableString.setSpan(new LeadingMarginSpan.Standard(36),0,heatedBean.getContent().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
mBinding.tvContent.setText(spannableString);
|
||||
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||
cirleListAdapter = new CirleListAdapter(CirleListAdapter.PAGE_HOME);
|
||||
mBinding.recycleView.setAdapter(cirleListAdapter);
|
||||
cirleListAdapter.setOnItemClickListener(new CirleListAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onDianzanClick(CircleListBean item) {
|
||||
MvpPre.likeZone(item.getId()+"");
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
if (position != -1) {
|
||||
// 更新点赞状态
|
||||
item.setIs_like(item.getIs_like() == 1 ? 0 : 1);
|
||||
// 局部刷新
|
||||
// cirleListAdapter.notifyItemChanged(position);
|
||||
cirleListAdapter.updateLikeStatusOnly(position, item.getIs_like());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeadImageClick(CircleListBean item) {
|
||||
// Toast.makeText(getApplicationContext(), "查看主页:" + item.getNickname(), Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(DynamicListActivity.this, UserHomepageActivity.class);
|
||||
intent.putExtra("userId", item.getUser_id()+"");
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onZsClick(CircleListBean item) {
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
RewardGiftDialogFragment.show(String.valueOf(item.getId()),item.getUser_id()+"",position, getSupportFragmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDiandianClick(CircleListBean item) {
|
||||
ShareDialog shareDialog= new ShareDialog(DynamicListActivity.this,item.getContent(),item.getShare_url(),item.getId()+"",3,item.getUser_id()+"",item);
|
||||
shareDialog.setOnShareDataListener(new ShareDialog.OnShareDataListener(){
|
||||
|
||||
@Override
|
||||
public void onShareDataLoaded(String id) {
|
||||
MvpPre.deleteZone(id);
|
||||
}
|
||||
});
|
||||
shareDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPinglunClick(CircleListBean item) {
|
||||
// CommentDialogFragment.show(String.valueOf(item.getId()), getSupportFragmentManager());
|
||||
Intent intent = new Intent(DynamicListActivity.this, DynamicDetailActivity.class);
|
||||
intent.putExtra("zone_id", item.getId() + "");
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelaClick(CircleListBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGensui(CircleListBean item) {
|
||||
if (item.getRoom_id()!=null && !item.getRoom_id().equals("0")) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
}else {
|
||||
ChatLauncher.getInstance().launchC2CChat(DynamicListActivity.this, item.getUser_id()+"");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_dynamic_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CirclePresenter bindPresenter() {
|
||||
return new CirclePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCategories(List<HeatedBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
cirleListAdapter.setNewData(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpandColumn(List<ExpandColumnBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
// ToastUtils.show("成功");
|
||||
// MvpPre.topicId(heatedBean.getTopic_id(),1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleDetail(CircleListBean bean) {
|
||||
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(GiftRewardEvent event) {
|
||||
cirleListAdapter.notifyItemChanged(event.getPoints());
|
||||
}
|
||||
@Override
|
||||
public void getCommentList(CommentBean commentBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commentZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishComment() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
package com.example.modulecircle.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulecircle.R;
|
||||
import com.example.modulecircle.contacts.ReleaseContract;
|
||||
import com.example.modulecircle.databinding.ActivityReleaseBinding;
|
||||
import com.example.modulecircle.adapter.MultiSelectAdapter;
|
||||
import com.example.modulecircle.presenter.ReleasePresenter;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.adapter.UserPhotoWallAdapter;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.location.LocationProvider;
|
||||
import com.xscm.moduleutil.utils.location.LocationServiceFactory;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/28
|
||||
* @description: 发布动态
|
||||
*/
|
||||
public class ReleaseActivity extends BaseMvpActivity<ReleasePresenter, ActivityReleaseBinding> implements ReleaseContract.View {
|
||||
UserPhotoWallAdapter mUserPhotoWallAdapter;
|
||||
List<String> list=new ArrayList<>();
|
||||
private List<String> uploadedUrls = new ArrayList<>();//真实图片地址
|
||||
final int maxNum = 1200;
|
||||
private List<String> topicId=new ArrayList<>();
|
||||
private String city1;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("动态发布");
|
||||
|
||||
mBinding.tvSz.setText("0/" + maxNum);
|
||||
mBinding.etG.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) {
|
||||
if (s.length() == maxNum) {
|
||||
mBinding.tvSz.setText("您输入的字数已超过限制");
|
||||
} else {
|
||||
mBinding.tvSz.setText((maxNum - s.length()) + "/" + maxNum);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.rvPhotoWall.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
mBinding.rvPhotoWall.setAdapter(mUserPhotoWallAdapter = new UserPhotoWallAdapter());
|
||||
mUserPhotoWallAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
String item = list.get(position);
|
||||
if (item.equals(UserPhotoWallAdapter.ADD_PHOTO)) {
|
||||
// 点击的是“+”号,启动图片选择
|
||||
startChoosePhoto(1, PictureConfig.CHOOSE_REQUEST, false, 9);
|
||||
} else {
|
||||
// 查看大图或其他操作
|
||||
}
|
||||
|
||||
// int id = view.getId();
|
||||
// UserImgList item = mUserPhotoWallAdapter.getItem(position);
|
||||
// if (id == com.qxcm.moduleutil.R.id.iv_close) {
|
||||
//// MvpPre.deletePhoto(item.getId(), position);
|
||||
// } else {
|
||||
// if ("0".equals(item.getId())) {
|
||||
// startChoosePhoto(PictureMimeType.ofImage(), PictureConfig.REQUEST_CAMERA, true, 9);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
});
|
||||
mUserPhotoWallAdapter.setOnItemChildLongClickListener(new BaseQuickAdapter.OnItemChildLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemChildLongClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
mUserPhotoWallAdapter.setLongClickPos(position);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
updateAdapterData(); // 初始化时更新适配器数据
|
||||
list = new ArrayList<>();
|
||||
list.add("ADD_PHOTO"); // 最后一项是“添加图片”
|
||||
mUserPhotoWallAdapter.setNewData(list);
|
||||
mUserPhotoWallAdapter.setDelete(true);
|
||||
|
||||
mBinding.rl1.setOnClickListener(this::onClick);
|
||||
mBinding.tvFb.setOnClickListener(this::onClick);
|
||||
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
// 请求定位权限
|
||||
ActivityCompat.requestPermissions(
|
||||
(Activity) this,
|
||||
new String[]{
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
},
|
||||
1001 // 自定义常量,比如 1001
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
LocationProvider provider = LocationServiceFactory.createBestProvider(this);
|
||||
provider.getLastKnownLocation(this, new LocationProvider.LocationCallback() {
|
||||
@Override
|
||||
public void onLocationReceived(double latitude, double longitude, String city) {
|
||||
city1=city;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorMessage) {
|
||||
Toast.makeText(ReleaseActivity.this, "定位失败:" + errorMessage, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvFb, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvFb.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
//更新适配器数据的方法
|
||||
private void updateAdapterData() {
|
||||
list.clear();
|
||||
list.addAll(uploadedUrls); // 添加真实图片
|
||||
list.add(UserPhotoWallAdapter.ADD_PHOTO); // 最后加上 ADD_PHOTO
|
||||
mUserPhotoWallAdapter.setNewData(list);
|
||||
}
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.rl_1) {
|
||||
dialog();
|
||||
}else if (view.getId()==R.id.tv_fb){
|
||||
if (mBinding.etG.getText().toString().isEmpty()){
|
||||
ToastUtils.showShort("请输入发布内容");
|
||||
return;
|
||||
}
|
||||
MvpPre.publishZone(TextUtils.join(",", uploadedUrls),mBinding.etG.getText().toString(),TextUtils.join(",", topicId),"",city1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void dialog() {
|
||||
MvpPre.topicList("1","30");
|
||||
}
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode, boolean isVideo, int type) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(isVideo)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .maxSelectNum(type)
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(true)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
switch (requestCode) {
|
||||
case PictureConfig.CHOOSE_REQUEST:
|
||||
List<LocalMedia> localMediaList = PictureSelector.obtainSelectorList(data);
|
||||
|
||||
if (localMediaList != null && !localMediaList.isEmpty()) {
|
||||
List<File> imageFiles = new ArrayList<>();
|
||||
for (LocalMedia media : localMediaList) {
|
||||
String path = media.isCompressed() ? media.getCompressPath() : media.getRealPath();
|
||||
imageFiles.add(new File(path));
|
||||
}
|
||||
|
||||
// 开始批量上传
|
||||
MvpPre.batchUploadFiles(imageFiles, 0); // 第二个参数是你原来的 type
|
||||
|
||||
}
|
||||
// if (localMedia != null && localMedia.size() != 0) {
|
||||
// LocalMedia imgMedia = localMedia.get(0);
|
||||
// String url;
|
||||
// if (imgMedia.isCompressed()) {
|
||||
// url = imgMedia.getCompressPath();
|
||||
// } else {
|
||||
// url = imgMedia.getRealPath();
|
||||
// }
|
||||
// MvpPre.uploadFile(new File(url), 0);
|
||||
// }
|
||||
break;
|
||||
case PictureConfig.REQUEST_CAMERA:
|
||||
List<LocalMedia> localMedia1 = PictureSelector.obtainSelectorList(data);
|
||||
if (localMedia1 != null && localMedia1.size() != 0) {
|
||||
LocalMedia imgMedia = localMedia1.get(0);
|
||||
// MvpPre.uploadFile(new File(imgMedia.getRealPath()), 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_release;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ReleasePresenter bindPresenter() {
|
||||
return new ReleasePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void topicList(List<HeatedBean> list) {
|
||||
// 示例数据
|
||||
// List<String> topics = Arrays.asList("话题1", "话题2", "话题3", "话题4");
|
||||
|
||||
List<String> topics = new ArrayList<>();
|
||||
for (HeatedBean bean : list) {
|
||||
topics.add(bean.getTitle());
|
||||
}
|
||||
|
||||
|
||||
BottomSheetDialog dialog = new BottomSheetDialog(this);
|
||||
dialog.setContentView(R.layout.bottom_sheet_recyclerview);
|
||||
View bottomSheet = dialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
|
||||
if (bottomSheet != null) {
|
||||
bottomSheet.setBackgroundResource(android.R.color.transparent); // 设置为透明
|
||||
}
|
||||
RecyclerView recyclerView = dialog.findViewById(R.id.rv_options);
|
||||
TextView btnCancel = dialog.findViewById(R.id.btn_cancel);
|
||||
TextView btnConfirm = dialog.findViewById(R.id.btn_confirm);
|
||||
btnConfirm.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
assert recyclerView != null;
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
MultiSelectAdapter adapter = new MultiSelectAdapter(list);
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
btnCancel.setOnClickListener(v -> dialog.dismiss());
|
||||
|
||||
btnConfirm.setOnClickListener(v -> {
|
||||
topicId=new ArrayList<>();
|
||||
List<HeatedBean> selectedTopics = adapter.getSelectedItems();
|
||||
// 返回结果给调用页面(可使用接口或 onActivityResult 等方式)
|
||||
Log.d("Selected Topics", selectedTopics.toString());
|
||||
List<String> selectedTopicIds = new ArrayList<>();
|
||||
for (HeatedBean topic : selectedTopics) {
|
||||
selectedTopicIds.add(topic.getTitle());
|
||||
}
|
||||
|
||||
for (HeatedBean topic : selectedTopics){
|
||||
topicId.add(topic.getTopic_id());
|
||||
}
|
||||
// 示例:更新 UI
|
||||
((TextView)findViewById(R.id.tv_ht)).setText("已选:" + TextUtils.join(",", selectedTopicIds));
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upLoadSuccess(String url, int type, int index, int total) {
|
||||
if (index >= 0 && index < uploadedUrls.size()) {
|
||||
uploadedUrls.add(index, url); // 插入到对应位置
|
||||
} else {
|
||||
uploadedUrls.add(url); // 添加到最后
|
||||
}
|
||||
|
||||
if (uploadedUrls.size() == total) {
|
||||
updateAdapterData(); // 所有图片上传完成,更新适配器数据
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publishSuccess() {
|
||||
ToastUtils.showShort("发布成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
if (requestCode == 1001) {
|
||||
LocationProvider provider = LocationServiceFactory.createBestProvider(this);
|
||||
provider.getLastKnownLocation(this, new LocationProvider.LocationCallback() {
|
||||
@Override
|
||||
public void onLocationReceived(double latitude, double longitude, String city) {
|
||||
Toast.makeText(ReleaseActivity.this, "当前位置:" + city, Toast.LENGTH_SHORT).show();
|
||||
city1=city;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String errorMessage) {
|
||||
Toast.makeText(ReleaseActivity.this, "定位失败:" + errorMessage, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.example.modulecircle.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulecircle.R;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CircleCategoryAdapter extends RecyclerView.Adapter<CircleCategoryAdapter.ViewHolder> {
|
||||
private List<HeatedBean> dataList;
|
||||
private OnItemClickListener onItemClickListener;
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
public CircleCategoryAdapter(List<HeatedBean> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_circle_category, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
HeatedBean model = dataList.get(position);
|
||||
holder.tvTitle.setText(model.getTitle());
|
||||
holder.tvTitleContent.setText(model.getCount()+"条动态");
|
||||
if (model.getPic()==null){
|
||||
holder.ivIcon.setImageResource(com.xscm.moduleutil.R.mipmap.default_avatar);
|
||||
}else {
|
||||
ImageUtils.loadHeadCC(model.getPic(), holder.ivIcon);
|
||||
// 加载图片等逻辑
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null && model != null) {
|
||||
onItemClickListener.onItemClick(holder.itemView, model, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataList != null ? dataList.size() : 0;
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvTitle;
|
||||
ImageView ivIcon;
|
||||
TextView tvTitleContent;
|
||||
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvTitle = itemView.findViewById(R.id.tvTitle);
|
||||
ivIcon = itemView.findViewById(R.id.ivAvatar);
|
||||
tvTitleContent = itemView.findViewById(R.id.tvDescription);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(View view, HeatedBean data, int position);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.example.modulecircle.adapter;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulecircle.R;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.zhpan.bannerview.BaseBannerAdapter;
|
||||
import com.zhpan.bannerview.BaseViewHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CirleCategoryBannerAdapter extends BaseBannerAdapter<BaseListData> {
|
||||
List<HeatedBean> list;
|
||||
private OnItemClickListener onItemClickListener;
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void bindData(BaseViewHolder<BaseListData> holder, BaseListData data, int position, int pageSize) {
|
||||
CircleCategoryAdapter adapter = new CircleCategoryAdapter(data.getData());
|
||||
RecyclerView recyclerView = holder.itemView.findViewById(R.id.recyclerView);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(holder.itemView.getContext(), 2));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
adapter.setOnItemClickListener(new CircleCategoryAdapter.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(View view, HeatedBean data, int position) {
|
||||
onItemClickListener.onItemClick(view, data, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId(int viewType) {
|
||||
return R.layout.item_cirle_category_grid;
|
||||
}
|
||||
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(View view, HeatedBean data, int position);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.example.modulecircle.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulecircle.R;
|
||||
import com.xscm.moduleutil.adapter.OneImageYuanJiaoAdapter;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.MyGridView;
|
||||
import com.xscm.moduleutil.widget.img.FullScreenUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ExpandColumnAdapter extends BaseQuickAdapter<ExpandColumnBean, BaseViewHolder> {
|
||||
public ExpandColumnAdapter() {
|
||||
super(R.layout.item_expand_column);
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onDianzanClick(ExpandColumnBean item);
|
||||
|
||||
void onHeadImageClick(ExpandColumnBean item);
|
||||
|
||||
void onZsClick(ExpandColumnBean item);
|
||||
|
||||
void onDiandianClick(ExpandColumnBean item);
|
||||
|
||||
void onPinglunClick(ExpandColumnBean item);
|
||||
|
||||
void onRelaClick(ExpandColumnBean item);
|
||||
|
||||
void onGnsClick(ExpandColumnBean item);
|
||||
}
|
||||
|
||||
private OnItemClickListener mListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, ExpandColumnBean item) {
|
||||
helper.addOnClickListener(R.id.dy_head_image);
|
||||
|
||||
//先让单图,多图,音频的布局显示
|
||||
helper.getView(R.id.dy_image_recyc).setVisibility(View.VISIBLE);
|
||||
helper.setText(R.id.tv_agree,(item.getAgree()!=null?item.getAgree():"0")+"岁");
|
||||
//昵称
|
||||
helper.setText(R.id.dy_name_text, item.getNickname());
|
||||
helper.setText(R.id.tv_address, item.getLoginip());
|
||||
if (item.getUser_id().equals(SpUtil.getUserId()+"")){
|
||||
helper.setVisible(R.id.gensui, false);
|
||||
}else {
|
||||
helper.setVisible(R.id.gensui, true);
|
||||
}
|
||||
|
||||
if (item.getRoom_id() != 0) {
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.gsui);
|
||||
} else {
|
||||
helper.getView(R.id.gensui).setBackgroundResource(com.xscm.moduleutil.R.mipmap.six);
|
||||
}
|
||||
|
||||
helper.getView(com.xscm.moduleutil.R.id.dy_head_image).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onHeadImageClick(item);
|
||||
});
|
||||
|
||||
helper.getView(R.id.gensui).setOnClickListener(v -> {
|
||||
if (mListener != null) mListener.onGnsClick(item);
|
||||
});
|
||||
|
||||
//头像
|
||||
// ImageUtils.loadHeadCC(item.getAvatar(), (ImageView) helper.getView(R.id.dy_head_image));
|
||||
MeHeadView headView = helper.getView(R.id.dy_head_image);
|
||||
headView.setData(item.getAvatar(), "", item.getSex());
|
||||
|
||||
if (item.getHome_bgimages() != null && !item.getHome_bgimages().isEmpty()) {
|
||||
// String[] arrIv = item.getHome_bgimages().toArray(new String[item.getHome_bgimages().size()]);
|
||||
String[] arrIv = item.getHome_bgimages().split(",");
|
||||
int length = arrIv.length;
|
||||
|
||||
|
||||
OneImageYuanJiaoAdapter oneImageYuanJiaoAdapter = new OneImageYuanJiaoAdapter(mContext);
|
||||
MyGridView recyclerView = helper.getView(R.id.dy_image_recyc);
|
||||
recyclerView.setNumColumns(3);
|
||||
recyclerView.setAdapter(oneImageYuanJiaoAdapter);
|
||||
oneImageYuanJiaoAdapter.getList_adapter().clear();
|
||||
|
||||
for (int j = 0; j < arrIv.length; j++) {
|
||||
oneImageYuanJiaoAdapter.getList_adapter().add(arrIv[j]);
|
||||
}
|
||||
|
||||
oneImageYuanJiaoAdapter.notifyDataSetChanged();
|
||||
|
||||
recyclerView.setOnItemClickListener((parent, view, position, id) -> {
|
||||
FullScreenUtil.showFullScreenDialog(mContext, position, oneImageYuanJiaoAdapter.getList_adapter());
|
||||
});
|
||||
}else {
|
||||
helper.getView(R.id.dy_image_recyc).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
LinearLayout llContainer = helper.getView(R.id.ll_image_container);
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
|
||||
List<String> images = item.getIcon(); // 获取图片列表
|
||||
|
||||
for (String url : images) {
|
||||
if (url.contains("http")) {
|
||||
|
||||
ImageView imageView = new ImageView(mContext);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_37),
|
||||
mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
|
||||
);
|
||||
params.setMargins(0, 0, mContext.getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
|
||||
imageView.setLayoutParams(params);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView);
|
||||
|
||||
llContainer.addView(imageView);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.example.modulecircle.adapter;
|
||||
|
||||
import android.util.SparseBooleanArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulecircle.R;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/17
|
||||
*@description: 这是发布动态选择话题的适配器,多选状态
|
||||
*/
|
||||
public class MultiSelectAdapter extends RecyclerView.Adapter<MultiSelectAdapter.ViewHolder> {
|
||||
private List<HeatedBean> options;
|
||||
private SparseBooleanArray selectedPositions = new SparseBooleanArray();
|
||||
|
||||
public MultiSelectAdapter(List<HeatedBean> options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_multi_select, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
HeatedBean item = options.get(position);
|
||||
|
||||
boolean isSelected = selectedPositions.get(position, false);
|
||||
|
||||
holder.tvOption.setText(item.getTitle());
|
||||
holder.checkbox.setSelected(isSelected);
|
||||
holder.checkbox.setOnClickListener(v -> {
|
||||
boolean newState = !isSelected;
|
||||
selectedPositions.put(position, newState);
|
||||
holder.checkbox.setSelected(newState);
|
||||
notifyItemChanged(position); // 刷新当前项
|
||||
});
|
||||
|
||||
// 点击整个 item 也可以触发选中/取消
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
boolean currentState = selectedPositions.get(position, false);
|
||||
boolean newState = !currentState;
|
||||
selectedPositions.put(position, newState);
|
||||
holder.checkbox.setSelected(newState);
|
||||
notifyItemChanged(position);
|
||||
});
|
||||
|
||||
// holder.itemView.setOnClickListener(v -> {
|
||||
// boolean isChecked = selectedPositions.get(position, false);
|
||||
// if (isChecked) {
|
||||
// selectedPositions.delete(position);
|
||||
// } else {
|
||||
// selectedPositions.put(position, true);
|
||||
// }
|
||||
// notifyItemChanged(position);
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return options.size();
|
||||
}
|
||||
|
||||
public List<HeatedBean> getSelectedItems() {
|
||||
List<HeatedBean> selected = new ArrayList<>();
|
||||
for (int i = 0; i < options.size(); i++) {
|
||||
if (selectedPositions.get(i)) {
|
||||
selected.add(options.get(i));
|
||||
}
|
||||
}
|
||||
return selected;
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
View checkbox;
|
||||
TextView tvOption;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
checkbox = itemView.findViewById(R.id.v_checkbox);
|
||||
tvOption = itemView.findViewById(R.id.tv_option);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.example.modulecircle.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CircleContacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
|
||||
void setCategories(List<HeatedBean> list);
|
||||
|
||||
void setCircleList(List<CircleListBean> list);
|
||||
|
||||
void setExpandColumn(List<ExpandColumnBean> list);
|
||||
|
||||
void setLikeZone();
|
||||
|
||||
void setCircleDetail(CircleListBean bean);
|
||||
|
||||
void getCommentList(CommentBean commentBean);
|
||||
void commentZone();
|
||||
void finishComment();
|
||||
}
|
||||
|
||||
public interface IIndexPre extends IPresenter {
|
||||
void getCategories();
|
||||
|
||||
void getCircleList(String page,String page_limit);
|
||||
|
||||
void getExpandColumn(String type,String page,String page_limit);//获取扩列数据
|
||||
|
||||
void likeZone(String zone_id);
|
||||
|
||||
void topicId(String topic_id,int type);//type:这是让区分是什么地方获得数据,type=1:动态列表,type=2:动态详情
|
||||
|
||||
void deleteZone(String zone_id);
|
||||
|
||||
void getCommentList(String id,String page,String page_limit);
|
||||
void commentZone(String id,String content,String pid,String reply_to);
|
||||
|
||||
void deleteComment(String id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.example.modulecircle.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class ReleaseContract {
|
||||
public interface View extends IView<Activity> {
|
||||
void topicList(List<HeatedBean> list);
|
||||
void upLoadSuccess(String url, int type, int index, int total);
|
||||
|
||||
void publishSuccess();
|
||||
}
|
||||
|
||||
public interface IIndexPre extends IPresenter {
|
||||
void topicList(String page, String page_limit);
|
||||
|
||||
void uploadFile(File file, int type,int index,int sice);
|
||||
|
||||
void publishZone(String images,String content,String topic_id,String room_id,String ip);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
package com.example.modulecircle.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulecircle.R;
|
||||
import com.example.modulecircle.activity.DynamicListActivity;
|
||||
import com.example.modulecircle.adapter.CirleCategoryBannerAdapter;
|
||||
import com.xscm.moduleutil.adapter.CirleListAdapter;
|
||||
import com.example.modulecircle.contacts.CircleContacts;
|
||||
import com.example.modulecircle.databinding.FragmentCircleCategoryBinding;
|
||||
import com.example.modulecircle.presenter.CirclePresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.BaseListData;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.event.GiftRewardEvent;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ChatLauncher;
|
||||
import com.xscm.moduleutil.widget.dialog.RewardGiftDialogFragment;
|
||||
import com.xscm.moduleutil.widget.dialog.ShareDialog;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.zhpan.bannerview.indicator.DrawableIndicator;
|
||||
import com.zhpan.indicator.base.IIndicator;
|
||||
import com.zhpan.indicator.enums.IndicatorSlideMode;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 语圈中的发现界面
|
||||
*/
|
||||
public class CircleCategoryFragment extends BaseMvpFragment<CirclePresenter, FragmentCircleCategoryBinding> implements CircleContacts.View {
|
||||
CirleCategoryBannerAdapter cirleCategoryBannerAdapter;
|
||||
CirleListAdapter cirleListAdapter;
|
||||
private int page;
|
||||
|
||||
public static CircleCategoryFragment newInstance() {
|
||||
return new CircleCategoryFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getCategories();
|
||||
MvpPre.getCircleList("1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// MvpPre.getCategories();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@SuppressLint("WrongConstant")
|
||||
@Override
|
||||
protected void initView() {
|
||||
cirleCategoryBannerAdapter = new CirleCategoryBannerAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(1)
|
||||
.setScrollDuration(0)
|
||||
.setRevealWidth(0, 0)
|
||||
.setIndicatorVisibility(View.VISIBLE)
|
||||
.setIndicatorView(getVectorDrawableIndicator())
|
||||
.setIndicatorSlideMode(IndicatorSlideMode.NORMAL)
|
||||
.setAdapter(cirleCategoryBannerAdapter)
|
||||
.setAutoPlay(false);
|
||||
// .create();/**/
|
||||
|
||||
mBinding.constraintLayout.setVisibility(View.GONE);
|
||||
cirleCategoryBannerAdapter.setOnItemClickListener((view, data, position) -> {
|
||||
// 示例:跳转到房间详情页
|
||||
if (data != null) {
|
||||
// ARouter.getInstance().build(ARouteConstants.DYNAMIC_LIST)
|
||||
// .withString("id", data.getId()).navigation();
|
||||
Intent intent = new Intent(getActivity(), DynamicListActivity.class);
|
||||
intent.putExtra("heatedBean", data);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
cirleListAdapter = new CirleListAdapter(CirleListAdapter.PAGE_HOME);
|
||||
mBinding.recycleView.setAdapter(cirleListAdapter);
|
||||
cirleListAdapter.setOnItemClickListener(new CirleListAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onDianzanClick(CircleListBean item) {
|
||||
MvpPre.likeZone(item.getId() + "");
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
if (position != -1) {
|
||||
// 更新点赞状态
|
||||
item.setIs_like(item.getIs_like() == 1 ? 0 : 1);
|
||||
// 局部刷新
|
||||
cirleListAdapter.updateLikeStatusOnly(position, item.getIs_like());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeadImageClick(CircleListBean item) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id() + "").navigation();
|
||||
// Intent intent = new Intent(getActivity(), UserHomepageActivity.class);
|
||||
// intent.putExtra("userId", item.getUser_id()+"");
|
||||
// startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onZsClick(CircleListBean item) {//打赏
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
RewardGiftDialogFragment.show(String.valueOf(item.getId()),item.getUser_id()+"",position, getChildFragmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDiandianClick(CircleListBean item) {//点击点点,分享等
|
||||
ShareDialog shareDialog = new ShareDialog(getContext(), item.getContent(),item.getShare_url(),item.getId()+"",3,item.getUser_id()+"",item);
|
||||
shareDialog.setOnShareDataListener(new ShareDialog.OnShareDataListener() {
|
||||
|
||||
@Override
|
||||
public void onShareDataLoaded(String id) {
|
||||
MvpPre.deleteZone(id);
|
||||
}
|
||||
});
|
||||
shareDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPinglunClick(CircleListBean item) {
|
||||
ARouter.getInstance().build(ARouteConstants.DYNAMIC_DETAIL).withString("zone_id", item.getId()+"").navigation();
|
||||
// Intent intent = new Intent(getActivity(), DynamicDetailActivity.class);
|
||||
// intent.putExtra("zone_id", item.getId() + "");
|
||||
// startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelaClick(CircleListBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGensui(CircleListBean item) {
|
||||
if (item.getRoom_id()!=null && !item.getRoom_id().equals("0")) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
}else {
|
||||
ChatLauncher.getInstance().launchC2CChat(getActivity(), item.getUser_id()+"");
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getCircleList(page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
MvpPre.getCircleList(page + "", "10");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEvent(GiftRewardEvent event) {
|
||||
cirleListAdapter.notifyItemChanged(event.getPoints()-1);
|
||||
}
|
||||
private IIndicator getVectorDrawableIndicator() {
|
||||
int dp6 = getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_6);
|
||||
return new DrawableIndicator(getContext())
|
||||
.setIndicatorGap(getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_2_5))
|
||||
.setIndicatorDrawable(com.xscm.moduleutil.R.drawable.banner_indicator_nornal, com.xscm.moduleutil.R.drawable.banner_indicator_focus)
|
||||
.setIndicatorSize(getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_13), dp6, getResources().getDimensionPixelOffset(com.xscm.moduleutil.R.dimen.dp_13), dp6);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initListener() {
|
||||
super.initListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_circle_category;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CirclePresenter bindPresenter() {
|
||||
return new CirclePresenter(this, getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCategories(List<HeatedBean> list) {
|
||||
// 将原始数据拆分为多个子列表,每个子列表最多包含4个元素
|
||||
mBinding.constraintLayout.setVisibility(View.VISIBLE);
|
||||
// 添加到 bannerViewPager 的是分页后的列表
|
||||
mBinding.bannerViewPager.create(baseListData(list, 4));
|
||||
// mBinding.bannerViewPager.addData(baseListData(list, 4));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
if (page == 1) {
|
||||
cirleListAdapter.setNewData(list);
|
||||
}else {
|
||||
if (list!=null && list.size() > 0){
|
||||
cirleListAdapter.addData(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpandColumn(List<ExpandColumnBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
MvpPre.getCircleList(page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleDetail(CircleListBean bean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCommentList(CommentBean commentBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commentZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishComment() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
// 拆分函数
|
||||
private <T> List<List<T>> splitListIntoChunks(List<T> list, int chunkSize) {
|
||||
List<List<T>> chunks = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i += chunkSize) {
|
||||
chunks.add(list.subList(i, Math.min(i + chunkSize, list.size())));
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
||||
private List<BaseListData<HeatedBean>> baseListData(List<HeatedBean> list, int chunkSize) {
|
||||
List<BaseListData<HeatedBean>> baseListData = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i += chunkSize) {
|
||||
BaseListData<HeatedBean> baseListData1 = new BaseListData<>();
|
||||
baseListData1.setData(list.subList(i, Math.min(i + chunkSize, list.size())));
|
||||
baseListData.add(baseListData1);
|
||||
}
|
||||
return baseListData;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.example.modulecircle.fragment;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import com.example.modulecircle.R;
|
||||
import com.example.modulecircle.activity.ReleaseActivity;
|
||||
import com.example.modulecircle.contacts.CircleContacts;
|
||||
import com.example.modulecircle.databinding.FragmentCircleBinding;
|
||||
import com.example.modulecircle.presenter.CirclePresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.bean.MyBagBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
*语圈
|
||||
*/
|
||||
public class CircleFragment extends BaseMvpFragment<CirclePresenter, FragmentCircleBinding> implements CircleContacts.View {
|
||||
private List<MyBagBean> list;
|
||||
public static CircleFragment newInstance () {
|
||||
return new CircleFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData () {
|
||||
list=new ArrayList<>();
|
||||
list.add(new MyBagBean("发现", "1"));
|
||||
list.add(new MyBagBean("扩列", "2"));
|
||||
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), list));
|
||||
mBinding.tabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.tabLayout.setCurrentTab(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView () {
|
||||
|
||||
mBinding.ivRelease.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId()==R.id.iv_release){//发布
|
||||
startActivity(new Intent(getContext(), ReleaseActivity.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initListener () {
|
||||
super.initListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId () {
|
||||
return R.layout.fragment_circle;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CirclePresenter bindPresenter () {
|
||||
return new CirclePresenter(this, getContext());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setCategories(List<HeatedBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpandColumn(List<ExpandColumnBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleDetail(CircleListBean bean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCommentList(CommentBean commentBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commentZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishComment() {
|
||||
|
||||
}
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<MyBagBean> list;
|
||||
|
||||
|
||||
public MyFragmentPagerAdapter(FragmentManager fm, List<MyBagBean> list) {
|
||||
super(fm);
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
if ("1".equals(model.getMyBagType())){
|
||||
return CircleCategoryFragment.newInstance();
|
||||
}else {
|
||||
return ExpandColumnFragment.newInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
return model.getMyBagTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.example.modulecircle.fragment;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.example.modulecircle.R;
|
||||
import com.example.modulecircle.adapter.ExpandColumnAdapter;
|
||||
import com.example.modulecircle.contacts.CircleContacts;
|
||||
import com.example.modulecircle.databinding.FragmentExpandColumnBinding;
|
||||
import com.example.modulecircle.presenter.CirclePresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ChatLauncher;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import org.angmarch.views.NiceSpinner;
|
||||
import org.angmarch.views.OnSpinnerItemSelectedListener;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/28
|
||||
*@description: 动态中的扩列fragemnt
|
||||
*/
|
||||
public class ExpandColumnFragment extends BaseMvpFragment<CirclePresenter, FragmentExpandColumnBinding> implements CircleContacts.View {
|
||||
|
||||
private ExpandColumnAdapter expandColumnAdapter;
|
||||
private String type="2";
|
||||
private int page;
|
||||
@Override
|
||||
protected CirclePresenter bindPresenter() {
|
||||
return new CirclePresenter(this,getActivity());
|
||||
}
|
||||
|
||||
public static ExpandColumnFragment newInstance() {
|
||||
return new ExpandColumnFragment();
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
List<String> dataset = new LinkedList<>(Arrays.asList("只看女生", "只看男生", "查看全部"));
|
||||
mBinding.niceSpinner.attachDataSource(dataset);
|
||||
mBinding.niceSpinner.setOnSpinnerItemSelectedListener(new OnSpinnerItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(NiceSpinner parent, View view, int position, long id) {
|
||||
// 示例使用的是 String 类型,但你的数据类型可以是任意的
|
||||
String item = (String) parent.getItemAtPosition(position);
|
||||
LogUtils.e("@@@",item);
|
||||
mBinding.niceSpinner.setText(item);
|
||||
if (item.equals("只看女生")){
|
||||
type="2";
|
||||
}else if (item.equals("只看男生")){
|
||||
type="1";
|
||||
}else {
|
||||
type="0";
|
||||
}
|
||||
MvpPre.getExpandColumn(type,"1", "10");
|
||||
// mBinding.niceSpinner.getItemAtPosition(position);
|
||||
}
|
||||
});
|
||||
mBinding.niceSpinner.setText("只看女生");
|
||||
mBinding.niceSpinner.setBackground(null);
|
||||
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
expandColumnAdapter = new ExpandColumnAdapter();
|
||||
mBinding.recyclerView.setAdapter(expandColumnAdapter);
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getExpandColumn(type,page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
MvpPre.getExpandColumn(type,page+"", "10");
|
||||
}
|
||||
});
|
||||
|
||||
expandColumnAdapter.setOnItemClickListener(new ExpandColumnAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onDianzanClick(ExpandColumnBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeadImageClick(ExpandColumnBean item) {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id()).navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onZsClick(ExpandColumnBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDiandianClick(ExpandColumnBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPinglunClick(ExpandColumnBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelaClick(ExpandColumnBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGnsClick(ExpandColumnBean item) {
|
||||
if ( item.getRoom_id()!=0){
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页热门列表").withString("roomId", item.getRoom_id()+"").navigation();
|
||||
}else {
|
||||
ChatLauncher.getInstance().launchC2CChat(getActivity(), item.getUser_id()+"");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getExpandColumn(type,"1", "10");
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_expand_column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCategories(List<HeatedBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpandColumn(List<ExpandColumnBean> list) {
|
||||
if (page==1) {
|
||||
expandColumnAdapter.setNewData(list);
|
||||
}else {
|
||||
if (list!=null && list.size()>0){
|
||||
expandColumnAdapter.addData(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleDetail(CircleListBean bean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCommentList(CommentBean commentBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commentZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishComment() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package com.example.modulecircle.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulecircle.contacts.CircleContacts;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.CommentBean;
|
||||
import com.xscm.moduleutil.bean.ExpandColumnBean;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class CirclePresenter extends BasePresenter<CircleContacts.View> implements CircleContacts.IIndexPre {
|
||||
|
||||
public CirclePresenter(CircleContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCategories() {
|
||||
|
||||
api.getCategories(new BaseObserver<List<HeatedBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<HeatedBean> heatedBeanList) {
|
||||
MvpRef.get().setCategories(heatedBeanList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCircleList(String page, String page_limit) {
|
||||
|
||||
api.getCircleList(page,page_limit,new BaseObserver<List<CircleListBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<CircleListBean> circleListBeans) {
|
||||
MvpRef.get().setCircleList(circleListBeans);
|
||||
MvpRef.get().finishComment();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//获取扩列数据
|
||||
@Override
|
||||
public void getExpandColumn(String type, String page, String page_limit) {
|
||||
api.getExpandColumn(type, page, page_limit, new BaseObserver<List<ExpandColumnBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<ExpandColumnBean> expandColumnBeans) {
|
||||
MvpRef.get().setExpandColumn(expandColumnBeans);
|
||||
MvpRef.get().finishComment();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// List<String> images=new ArrayList<>();
|
||||
// images.add("https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E7%BE%8E%E5%A5%B3%E5%9B%BE%E7%89%87&hs=0&pn=0&spn=0&di=7490230549689139201&pi=0&rn=1&tn=baiduimagedetail&is=2160705940%2C3901940110&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=2056927850%2C430353020&os=2160705940%2C3901940110&simid=3513174432%2C352671812&adpicid=0&lpn=0&ln=0&fm=&sme=&cg=girl&bdtype=0&oriquery=&objurl=https%3A%2F%2Fq4.itc.cn%2Fimages01%2F20240627%2Fd30dbf39840a4c0bbeb277a6d773db2f.jpeg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bf5i7_z%26e3Bv54AzdH3FwAzdH3F0blaabmca_8d8n8lbaa&gsm=&islist=&querylist=");
|
||||
// images.add("https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E7%BE%8E%E5%A5%B3%E5%9B%BE%E7%89%87&hs=0&pn=0&spn=0&di=7490230549689139201&pi=0&rn=1&tn=baiduimagedetail&is=2160705940%2C3901940110&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=2056927850%2C430353020&os=2160705940%2C3901940110&simid=3513174432%2C352671812&adpicid=0&lpn=0&ln=0&fm=&sme=&cg=girl&bdtype=0&oriquery=&objurl=https%3A%2F%2Fq4.itc.cn%2Fimages01%2F20240627%2Fd30dbf39840a4c0bbeb277a6d773db2f.jpeg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bf5i7_z%26e3Bv54AzdH3FwAzdH3F0blaabmca_8d8n8lbaa&gsm=&islist=&querylist=");
|
||||
// images.add("https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E7%BE%8E%E5%A5%B3%E5%9B%BE%E7%89%87&hs=0&pn=0&spn=0&di=7490230549689139201&pi=0&rn=1&tn=baiduimagedetail&is=2160705940%2C3901940110&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=2056927850%2C430353020&os=2160705940%2C3901940110&simid=3513174432%2C352671812&adpicid=0&lpn=0&ln=0&fm=&sme=&cg=girl&bdtype=0&oriquery=&objurl=https%3A%2F%2Fq4.itc.cn%2Fimages01%2F20240627%2Fd30dbf39840a4c0bbeb277a6d773db2f.jpeg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bf5i7_z%26e3Bv54AzdH3FwAzdH3F0blaabmca_8d8n8lbaa&gsm=&islist=&querylist=");
|
||||
// images.add("https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E7%BE%8E%E5%A5%B3%E5%9B%BE%E7%89%87&hs=0&pn=0&spn=0&di=7490230549689139201&pi=0&rn=1&tn=baiduimagedetail&is=2160705940%2C3901940110&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=2056927850%2C430353020&os=2160705940%2C3901940110&simid=3513174432%2C352671812&adpicid=0&lpn=0&ln=0&fm=&sme=&cg=girl&bdtype=0&oriquery=&objurl=https%3A%2F%2Fq4.itc.cn%2Fimages01%2F20240627%2Fd30dbf39840a4c0bbeb277a6d773db2f.jpeg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bf5i7_z%26e3Bv54AzdH3FwAzdH3F0blaabmca_8d8n8lbaa&gsm=&islist=&querylist=");
|
||||
// List<ExpandColumnBean> expandColumnBeans=new ArrayList<>();
|
||||
// for (int i = 0; i < 10; i++){
|
||||
// ExpandColumnBean bean=new ExpandColumnBean();
|
||||
// bean.setId(""+i);
|
||||
// bean.setSex(i % 2 == 0 ? "2" : "1");
|
||||
// bean.setNickname("萌新驾到"+i);
|
||||
// bean.setAvatar("");
|
||||
// bean.setBirthday("2023-05-05");
|
||||
// bean.setLoginip("西安市");
|
||||
// bean.setHome_bgimages(images);
|
||||
// expandColumnBeans.add(bean);
|
||||
// }
|
||||
// MvpRef.get().setExpandColumn(expandColumnBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void likeZone(String zone_id) {
|
||||
api.likeZone(zone_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().setLikeZone();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void topicId(String topic_id,int type) {
|
||||
if (type == 1) {//这是获取动态列表
|
||||
api.topicId(topic_id, new BaseObserver<List<CircleListBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<CircleListBean> circleListBeans) {
|
||||
MvpRef.get().setCircleList(circleListBeans);
|
||||
}
|
||||
});
|
||||
}else if (type == 2){//这是获取动态详情
|
||||
api.zoneDetail(topic_id, new BaseObserver<CircleListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CircleListBean circleListBeans) {
|
||||
MvpRef.get().setCircleDetail(circleListBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteZone(String zone_id) {
|
||||
api.deleteZone(zone_id, new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().setLikeZone();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getCommentList(String id, String page, String page_limit) {
|
||||
api.getCommentList(id, page, page_limit, new BaseObserver<CommentBean>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CommentBean commentBean) {
|
||||
MvpRef.get().getCommentList(commentBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commentZone(String id, String content, String pid, String reply_to) {
|
||||
api.commentZone(id, content, pid, reply_to, new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().commentZone();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteComment(String id) {
|
||||
api.deleteComment(id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().commentZone();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.example.modulecircle.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulecircle.contacts.ReleaseContract;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.utils.oss.OSSOperUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class ReleasePresenter extends BasePresenter<ReleaseContract.View> implements ReleaseContract.IIndexPre {
|
||||
public ReleasePresenter(ReleaseContract.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void topicList(String page, String page_limit) {
|
||||
api.topicList(page, page_limit, new BaseObserver<List<HeatedBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<HeatedBean> heatedBeanList) {
|
||||
MvpRef.get().topicList(heatedBeanList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void batchUploadFiles(List<File> files, int type) {
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
uploadFile(files.get(i), type, i, files.size());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadFile(File file, int type,int index,int size) {
|
||||
// MvpRef.get().showLoadings("上传中...");
|
||||
String url = OSSOperUtils.getPath(file, type);
|
||||
OSSOperUtils.newInstance().putObjectMethod(url, file.getPath(), new OSSOperUtils.OssCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (isViewAttach()) {
|
||||
MvpRef.get().upLoadSuccess(OSSOperUtils.AliYunOSSURLFile + url, type, index, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail() {
|
||||
if (isViewAttach()) {
|
||||
ToastUtils.show("上传失败");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publishZone(String images, String content, String topic_id, String room_id,String ip) {
|
||||
api.publishZone(images, content, topic_id, room_id,ip, new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().publishSuccess();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
170
modulecircle/src/main/res/drawable/ic_launcher_background.xml
Normal file
170
modulecircle/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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"
|
||||
android:drawable="@drawable/icon_pay_select" />
|
||||
|
||||
<!-- 默认状态(未选中) -->
|
||||
<item android:drawable="@drawable/icon_pay_unselect" />
|
||||
</selector>
|
||||
127
modulecircle/src/main/res/layout/activity_dynamic_detail.xml
Normal file
127
modulecircle/src/main/res/layout/activity_dynamic_detail.xml
Normal file
@@ -0,0 +1,127 @@
|
||||
<?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.DynamicDetailActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 顶部标题栏 -->
|
||||
<com.xscm.moduleutil.widget.CustomTopBar
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<!-- 主内容 RecyclerView -->
|
||||
<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_12"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_cirle_list" />
|
||||
|
||||
<!-- 评论列表 ScrollView -->
|
||||
<ScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r16_fff">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 全部评论标题 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:gravity="center|left"
|
||||
android:text="全部评论(56)"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 刷新控件包裹的评论 RecyclerView -->
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srlEnableLoadMore="false"
|
||||
app:srlEnableRefresh="false">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_comment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
<!-- <!– 分割线 –>-->
|
||||
<!-- <View-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_0_5"-->
|
||||
<!-- android:background="#ccc" />-->
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<!-- 输入区域,始终位于底部 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/cl_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:background="#ffffff"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="@dimen/dp_8">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_input"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@drawable/bg_r80_hui"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="就差你一个神评论~"
|
||||
android:paddingStart="@dimen/dp_12"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_send"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_send"
|
||||
android:layout_width="@dimen/dp_79"
|
||||
android:layout_height="@dimen/dp_31"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/cs"
|
||||
android:gravity="center"
|
||||
android:text="发送"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
144
modulecircle/src/main/res/layout/activity_dynamic_list.xml
Normal file
144
modulecircle/src/main/res/layout/activity_dynamic_list.xml
Normal file
@@ -0,0 +1,144 @@
|
||||
<?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.DynamicListActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.xscm.moduleutil.widget.CustomTopBar
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<!-- 头像 -->
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/ivAvatar"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_23"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_bar"
|
||||
app:riv_corner_radius="@dimen/dp_4" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="#萌新驾到"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@id/ivAvatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivAvatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_ry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@mipmap/reyi"
|
||||
app:layout_constraintStart_toEndOf="@id/ivAvatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
|
||||
|
||||
<!-- 描述 -->
|
||||
<TextView
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:ellipsize="none"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="热议 3.24W条动态"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintStart_toEndOf="@id/item_ry"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_11"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:lineSpacingExtra="@dimen/dp_4"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/ivAvatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDescription" />
|
||||
|
||||
<!-- <com.scwang.smartrefresh.layout.SmartRefreshLayout-->
|
||||
<!-- android:id="@+id/smart_refresh_layout"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="0dp"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_content"-->
|
||||
<!-- app:srlEnableLoadMore="true"-->
|
||||
<!-- app:srlEnableRefresh="false">-->
|
||||
|
||||
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/recycle_view"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:overScrollMode="never"-->
|
||||
<!-- tools:listitem="@layout/item_cirle_list" />-->
|
||||
|
||||
|
||||
<!-- </com.scwang.smartrefresh.layout.SmartRefreshLayout>-->
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_content"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="false">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_content" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"/>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
123
modulecircle/src/main/res/layout/activity_release.xml
Normal file
123
modulecircle/src/main/res/layout/activity_release.xml
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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.ReleaseActivity">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_FFF8F8F8">
|
||||
|
||||
<com.xscm.moduleutil.widget.CustomTopBar
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_r16_ffeff2f8"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_bar">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_ht"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:layout_marginBottom="@dimen/dp_9"
|
||||
android:gravity="center"
|
||||
android:text="选择话题"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:src="@mipmap/up_t" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_180"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_r10_white"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_1">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_g"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="left|top"
|
||||
android:hint="此刻想和大家分享点什么"
|
||||
android:maxLength="1200"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sz"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:layout_below="@+id/et_g"
|
||||
android:gravity="bottom"
|
||||
android:text="0/1200"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_photo_wall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_marginStart="@dimen/dp_38"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_38"
|
||||
android:background="@drawable/cs"
|
||||
android:gravity="center"
|
||||
android:text="立即发布"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rv_photo_wall" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
</layout>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/dilog"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:orientation="vertical"
|
||||
android:elevation="0dp"
|
||||
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:text="选择话题"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/color_0DFFB9" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_options"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_16"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
67
modulecircle/src/main/res/layout/fragment_circle.xml
Normal file
67
modulecircle/src/main/res/layout/fragment_circle.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_45"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.example.moduletablayout.CustomSlidingTabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:tl_indicator_corner_radius="@dimen/dp_3"
|
||||
app:tl_indicator_drawable="@mipmap/tab_x"
|
||||
app:tl_indicator_height="@dimen/dp_6"
|
||||
app:tl_indicator_margin_bottom="@dimen/dp_3"
|
||||
app:tl_showCateIndicator="true"
|
||||
app:tl_indicator_margin_top="@dimen/dp_10"
|
||||
app:tl_indicator_gravity="BOTTOM"
|
||||
app:tl_tab_width="@dimen/dp_50"
|
||||
app:tl_textBold="SELECT"
|
||||
app:tl_textSelectColor="@color/color_2B2823"
|
||||
app:tl_textSelectedSize="@dimen/sp_16"
|
||||
app:tl_textUnselectColor="@color/color_FF999999"
|
||||
app:tl_textsize="@dimen/sp_14" />
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_release"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@mipmap/release_n"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginRight="@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>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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=".fragment.CircleCategoryFragment">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
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"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraint_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_145"
|
||||
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="visible"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<!-- <com.scwang.smartrefresh.layout.SmartRefreshLayout-->
|
||||
<!-- android:id="@+id/smart_refresh_layout"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/app_bar_layout"-->
|
||||
<!-- app:srlEnableLoadMore="true"-->
|
||||
<!-- app:srlEnableRefresh="false">-->
|
||||
|
||||
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/recycle_view"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:paddingLeft="@dimen/dp_6"-->
|
||||
<!-- android:paddingRight="@dimen/dp_6"-->
|
||||
<!-- android:paddingBottom="@dimen/dp_50" />-->
|
||||
|
||||
|
||||
<!-- </com.scwang.smartrefresh.layout.SmartRefreshLayout>-->
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar_layout"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="false">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar_layout" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_20"/>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
58
modulecircle/src/main/res/layout/fragment_expand_column.xml
Normal file
58
modulecircle/src/main/res/layout/fragment_expand_column.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context=".fragment.ExpandColumnFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingBottom="@dimen/dp_16"
|
||||
android:paddingEnd="@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="@dimen/dp_24"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="扩列交友" />
|
||||
|
||||
<org.angmarch.views.NiceSpinner
|
||||
android:id="@+id/nice_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@color/transparent"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:arrowDrawable="@mipmap/up_x"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="false">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingBottom="@dimen/dp_12" />
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
67
modulecircle/src/main/res/layout/item_circle_category.xml
Normal file
67
modulecircle/src/main/res/layout/item_circle_category.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<!-- res/layout/item_circle_category.xml -->
|
||||
<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="wrap_content"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingStart="@dimen/dp_12"
|
||||
android:paddingEnd="@dimen/dp_12"
|
||||
tools:ignore="RtlSymmetry">
|
||||
|
||||
<!-- 头像 -->
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/ivAvatar"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:src="@mipmap/default_avatar"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="@dimen/dp_4"/>
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:text="#萌新驾到"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintStart_toEndOf="@id/ivAvatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
android:layout_marginStart="@dimen/dp_4" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_ry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:src="@mipmap/reyi"
|
||||
app:layout_constraintStart_toEndOf="@id/ivAvatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
/>
|
||||
|
||||
<!-- 描述 -->
|
||||
<TextView
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:text="热议 3.24W条动态"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="none"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
app:layout_constraintStart_toEndOf="@id/item_ry"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/recyclerView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
176
modulecircle/src/main/res/layout/item_expand_column.xml
Normal file
176
modulecircle/src/main/res/layout/item_expand_column.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15sp"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingRight="15sp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/dy_head_image"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/l_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_toRightOf="@+id/dy_head_image"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dy_name_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textStyle="bold"
|
||||
android:text="萌新驾到"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/im_dj"-->
|
||||
<!-- android:layout_width="@dimen/dp_37"-->
|
||||
<!-- android:layout_height="@dimen/dp_15"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_9"-->
|
||||
<!-- />-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_image_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_agree"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="25"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dy_time_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="·IP属地:"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="西安市"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignBottom="@+id/l_1"
|
||||
android:layout_gravity="right|center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gensui"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/no_follow"
|
||||
android:gravity="center"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/diandian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_14"
|
||||
android:background="@mipmap/shequ_dongtai_gengduo"
|
||||
android:gravity="center"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/aaa"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<com.xscm.moduleutil.widget.MyGridView
|
||||
android:id="@+id/dy_image_recyc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:numColumns="3"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<!-- <com.makeramen.roundedimageview.RoundedImageView-->
|
||||
<!-- android:id="@+id/dy_oneimage_iv"-->
|
||||
<!-- android:layout_width="200dp"-->
|
||||
<!-- android:layout_height="200dp"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:riv_corner_radius="5dp" />-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
32
modulecircle/src/main/res/layout/item_multi_select.xml
Normal file
32
modulecircle/src/main/res/layout/item_multi_select.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<!-- <CheckBox-->
|
||||
<!-- android:id="@+id/cb_option"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:focusable="false"-->
|
||||
<!-- android:clickable="false"/>-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_option"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="#333"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/v_checkbox"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:background="@drawable/selector_custom_checkbox"
|
||||
android:focusable="false"
|
||||
android:clickable="true"/>
|
||||
</LinearLayout>
|
||||
16
modulecircle/src/main/res/values-night/themes.xml
Normal file
16
modulecircle/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
modulecircle/src/main/res/values/colors.xml
Normal file
10
modulecircle/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>
|
||||
4
modulecircle/src/main/res/values/strings.xml
Normal file
4
modulecircle/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
</resources>
|
||||
16
modulecircle/src/main/res/values/themes.xml
Normal file
16
modulecircle/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.modulecircle;
|
||||
|
||||
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