diff --git a/common/src/main/res/layout/activity_community_details.xml b/common/src/main/res/layout/activity_community_details.xml
index c6e484e63..9535574ca 100644
--- a/common/src/main/res/layout/activity_community_details.xml
+++ b/common/src/main/res/layout/activity_community_details.xml
@@ -38,7 +38,7 @@
android:layout_height="70dp"
android:padding="1dp"
android:scaleType="centerCrop"
- app:riv_oval="true" />
+ app:riv_corner_radius="20dp" />
diff --git a/common/src/main/res/layout/item_comment_view.xml b/common/src/main/res/layout/item_comment_view.xml
index 61cf8c693..10b5dd9a0 100644
--- a/common/src/main/res/layout/item_comment_view.xml
+++ b/common/src/main/res/layout/item_comment_view.xml
@@ -17,6 +17,7 @@
android:id="@+id/avatar"
android:layout_width="30dp"
android:layout_height="30dp"
+ android:scaleType="centerCrop"
android:src="@mipmap/icon_data_empty"
app:riv_oval="true" />
@@ -123,6 +124,7 @@
android:id="@+id/avatar01"
android:layout_width="23dp"
android:layout_height="23dp"
+ android:scaleType="centerCrop"
android:src="@mipmap/icon_data_empty"
app:riv_corner_radius="20dp" />
diff --git a/main/src/main/java/com/yunbao/main/activity/CommunityDetailsActivity.java b/main/src/main/java/com/yunbao/main/activity/CommunityDetailsActivity.java
index c62a2eb6f..867375d17 100644
--- a/main/src/main/java/com/yunbao/main/activity/CommunityDetailsActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/CommunityDetailsActivity.java
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
+import android.text.TextUtils;
import android.util.SparseArray;
import android.view.View;
import android.view.WindowManager;
@@ -30,6 +31,7 @@ import com.yunbao.common.bean.ActiveBean;
import com.yunbao.common.bean.CommentBean;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.dialog.ImagePreviewDialog;
+import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
@@ -44,9 +46,14 @@ import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.NineGridLayout;
import com.yunbao.common.views.TopGradual;
+import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.share.bean.ShareBean;
import com.yunbao.share.ui.SharePopDialog;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -103,6 +110,7 @@ public class CommunityDetailsActivity extends AbsActivity {
activeId = getIntent().getStringExtra(Constants.TO_COMMUNITY_ID);
initView();
initData();
+ EventBus.getDefault().register(this);
}
private void initView() {
@@ -366,6 +374,27 @@ public class CommunityDetailsActivity extends AbsActivity {
});
}
+ /**
+ * 监听关注变化事件
+ */
+ @Subscribe(threadMode = ThreadMode.MAIN)
+ public void onFollowEvent(FollowEvent e) {
+ if (!TextUtils.isEmpty(activeBean.getUser_id()) && activeBean.getUser_id().equals(e.getToUid())) {
+ activeBean.setIs_attention(String.valueOf(e.getIsAttention()));
+ if (e.getIsAttention() == 1) {//关注
+ ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_followed, followIcon);
+ followName.setText(getResources().getString(R.string.following));
+ followName.setTextColor(Color.parseColor("#777777"));
+ followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
+ } else {
+ ImgLoader.display(CommunityDetailsActivity.this, R.mipmap.icon_like_follow, followIcon);
+ followName.setText(getResources().getString(R.string.follow));
+ followName.setTextColor(getResources().getColor(R.color.white));
+ followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
+ }
+ }
+ }
+
@SuppressLint("UseCompatLoadingForDrawables")
private void initData() {
LiveNetManager.get(mContext).getDynamicInfo(activeId, new com.yunbao.common.http.base.HttpCallback() {
diff --git a/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java b/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java
index 0e983498e..ca39f101a 100644
--- a/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java
@@ -86,7 +86,7 @@ public class CommunitySendActivity extends AbsActivity {
private List imgUrlList = new ArrayList<>();
private String videoUrl;
List newCommunityTypeList = new ArrayList<>();
- int talkId;
+ int talkId = 0;
Dialog dialog;
private Uri videoUri;
@@ -129,10 +129,6 @@ public class CommunitySendActivity extends AbsActivity {
return;
}
}
- if (StringUtil.isEmpty(talkContent.getText().toString())) {
- ToastUtil.show(mContext.getResources().getString(com.yunbao.main.R.string.please_input_content));
- return;
- }
List uploadBeanList = new ArrayList<>();
if (isImage) {
for (int i = 0; i < activeImageAdapter.getImageFileList().size(); i++) {