Przeglądaj źródła

资讯评论界面,默认不显示输入法;
资讯评论界面添加遗漏的点赞与表情点赞功能

zengjiebin 7 lat temu
rodzic
commit
a7c99d545f

+ 3 - 0
app/src/main/AndroidManifest.xml

@@ -651,8 +651,11 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActArticle"
             android:configChanges="orientation|screenSize|keyboardHidden" />
+        <!--小绵羊 3.4.2 合并资讯与资讯评论界面,且默认不显示输入法-->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActArticleComment"
+            android:windowSoftInputMode="adjustUnspecified|stateHidden"
+            android:configChanges="orientation|keyboardHidden"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActReservation"

+ 50 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpArticleComment.java

@@ -6,12 +6,17 @@ import android.widget.TextView;
 
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.BaseViewHolder;
+import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.UserComment;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.util.ApiUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.TextViewUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.List;
 
@@ -31,8 +36,8 @@ public class AdpArticleComment extends BaseQuickAdapter<UserComment, BaseViewHol
         ImageView article_comment_user_avatar = helper.itemView.findViewById(R.id.article_comment_user_avatar);
         TextView article_comment_user_name = helper.itemView.findViewById(R.id.article_comment_user_name);
         TextView article_comment_num1 = helper.itemView.findViewById(R.id.article_comment_num1);
-        TextView article_comment_num2 = helper.itemView.findViewById(R.id.article_comment_num2);
-        TextView article_comment_num3 = helper.itemView.findViewById(R.id.article_comment_num3);
+        final TextView article_comment_num2 = helper.itemView.findViewById(R.id.article_comment_num2);
+        final TextView article_comment_num3 = helper.itemView.findViewById(R.id.article_comment_num3);
         View article_comment_line_top = helper.itemView.findViewById(R.id.article_comment_line_top);
         ViewUtil.setVisibility(article_comment_line_top, position != 0);
         if(item == null){
@@ -53,6 +58,49 @@ public class AdpArticleComment extends BaseQuickAdapter<UserComment, BaseViewHol
                 Jump2View.getInstance().goActAppCommentDetail(ActivityManager.getInstance().currentActivity(), item.getId());
             }
         });
+
+        article_comment_num2.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                article_comment_num2.setEnabled(false);
+                ApiUtil.postGameUserUserGameCommentLike(item.getId(), new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        G.showToast("操作成功");
+                        item.plusLike();
+                        ViewUtil.setText(article_comment_num2, item.getLike());
+                        article_comment_num2.setEnabled(true);
+                    }
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast("操作失败");
+                        article_comment_num2.setEnabled(true);
+                    }
+                });
+            }
+        });
+        article_comment_num3.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                article_comment_num3.setEnabled(false);
+                ApiUtil.postGameUserUserGameCommentExpressionLike(item.getId(), new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        G.showToast("操作成功");
+                        item.plusExpression();
+                        ViewUtil.setText(article_comment_num3, item.getExpression());
+                        article_comment_num3.setEnabled(true);
+                    }
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast("操作失败");
+                        article_comment_num3.setEnabled(true);
+                    }
+                });
+            }
+        });
         article_comment_user_avatar.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {