From c499eb5a50c6c593b158104c52919982243a6285 Mon Sep 17 00:00:00 2001 From: boomerr <1046702958@qq.com> Date: Wed, 5 Sep 2018 21:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes .../com/fy/weibo/activity/ContentActivity.java | 14 +++++++------- .../main/java/com/fy/weibo/util/HttpUtil.java | 2 ++ app/src/main/res/layout/comment_popupwindow.xml | 5 +---- app/src/main/res/layout/content_layout.xml | 16 +++++++++++++--- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 37c0288b718a7a39d58bb4e1729d02b8ffd0736d..42f7bbe050c9cd4fdf01e6b3b96228fa3d4d266e 100644 GIT binary patch delta 15 XcmbQqGLvP(43?EqCvI$ 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 @@ - + +