diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 37c0288..42f7bbe 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/src/main/java/com/fy/weibo/activity/ContentActivity.java b/app/src/main/java/com/fy/weibo/activity/ContentActivity.java index 088d7cd..d08223b 100644 --- a/app/src/main/java/com/fy/weibo/activity/ContentActivity.java +++ b/app/src/main/java/com/fy/weibo/activity/ContentActivity.java @@ -94,7 +94,7 @@ public void initData() { TextView commentCounts = findViewById(R.id.comment_counts); TextView shareCounts = findViewById(R.id.share_counts); TextView thumbUpCounts = findViewById(R.id.thumb_up_counts); - ImageView commentImage=findViewById(R.id.comment);//评论点击处, + Button commentButton=findViewById(R.id.comment_btn);//评论点击处, weiBoText.setMaxLines(100); weiBoText.setText(weiBo.getText()); RequestOptions options = new RequestOptions().placeholder(new ColorDrawable(Color.WHITE)); @@ -122,7 +122,7 @@ public void initData() { imgRecyclerView.setAdapter(adapter); } - commentImage.setOnClickListener(this);//评论点击事件 + commentButton.setOnClickListener(this);//评论点击事件 } @@ -163,7 +163,7 @@ public void setComments(List comments) { @Override public void onClick(View v) { switch(v.getId()){ - case R.id.comment: + case R.id.comment_btn: WeiBo userInfo = (WeiBo) getIntent().getSerializableExtra("weibo"); String id=userInfo.getIdstr(); showPopupWindow(ContentActivity.this,R.layout.comment_popupwindow, Constants.ACCESS_TOKEN,id); @@ -194,16 +194,16 @@ public void onClick(View view) { case R.id.btn_comfirm: String CcommentText= String.valueOf(editText.getText()); Map info=new HashMap<>() ; - info.put("token",access_token); + info.put("access_token",access_token); info.put("id",id); - info.put("commentInfo",CcommentText); + info.put("comment",CcommentText); HttpUtil.getHttpUtil().post(POST_WEIBO_COMMENT,info,new Callback() { @Override public void onFailure(Call call, IOException e) { runOnUiThread(new Runnable() { @Override public void run() { - Toast.makeText(ContentActivity.this, "fail", Toast.LENGTH_SHORT).show(); + Toast.makeText(ContentActivity.this, "发送失败", Toast.LENGTH_SHORT).show(); finish(); } }); @@ -214,7 +214,7 @@ public void onResponse(Call call, Response response) throws IOException { runOnUiThread(new Runnable() { @Override public void run() { - Toast.makeText(ContentActivity.this, "success", Toast.LENGTH_SHORT).show(); + Toast.makeText(ContentActivity.this, "发送成功", Toast.LENGTH_SHORT).show(); } }); diff --git a/app/src/main/java/com/fy/weibo/util/HttpUtil.java b/app/src/main/java/com/fy/weibo/util/HttpUtil.java index e1ee8b4..f648a28 100644 --- a/app/src/main/java/com/fy/weibo/util/HttpUtil.java +++ b/app/src/main/java/com/fy/weibo/util/HttpUtil.java @@ -84,6 +84,8 @@ public void post(String baseUrl, Map params, Callback callback) FormBody.Builder formBodyBuilder = new FormBody.Builder(); for (Entry entry : params.entrySet()) { + Log.e("key",entry.getKey()); + Log.e("Value",entry.getValue()); formBodyBuilder.add(entry.getKey(), entry.getValue()); } FormBody formBody = formBodyBuilder.build(); diff --git a/app/src/main/res/layout/comment_popupwindow.xml b/app/src/main/res/layout/comment_popupwindow.xml index 9cb93ec..23356f7 100644 --- a/app/src/main/res/layout/comment_popupwindow.xml +++ b/app/src/main/res/layout/comment_popupwindow.xml @@ -4,10 +4,6 @@ android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match_parent"> - - - + @@ -71,6 +73,14 @@ - + +