Commit dcb75e796499d5fe7dd0852b104c12f02480aa9f
1 parent
9cf8f757
更新glide
Showing
3 changed files
with
18 additions
and
4 deletions
app/build.gradle
| @@ -50,7 +50,9 @@ dependencies { | @@ -50,7 +50,9 @@ dependencies { | ||
| 50 | compile 'com.android.support:appcompat-v7:23.4.0' | 50 | compile 'com.android.support:appcompat-v7:23.4.0' |
| 51 | testCompile 'junit:junit:4.12' | 51 | testCompile 'junit:junit:4.12' |
| 52 | compile 'com.android.support:recyclerview-v7:23.4.0' | 52 | compile 'com.android.support:recyclerview-v7:23.4.0' |
| 53 | - compile 'com.github.bumptech.glide:glide:3.7.0' | 53 | +// compile 'com.github.bumptech.glide:glide:3.7.0' |
| 54 | + compile 'com.github.bumptech.glide:glide:4.3.0' | ||
| 55 | + annotationProcessor 'com.github.bumptech.glide:compiler:4.3.0' | ||
| 54 | 56 | ||
| 55 | compile 'com.cnlive:lib_cnutil:3.0.3' | 57 | compile 'com.cnlive:lib_cnutil:3.0.3' |
| 56 | compile 'com.cnlive:lib_cnchat_tc:3.0.1' | 58 | compile 'com.cnlive:lib_cnchat_tc:3.0.1' |
app/src/main/java/com/cnlive/im/ui/CommentActivity.java
| @@ -84,7 +84,8 @@ public class CommentActivity extends AppCompatActivity implements View.OnClickLi | @@ -84,7 +84,8 @@ public class CommentActivity extends AppCompatActivity implements View.OnClickLi | ||
| 84 | edit_comment.setText(""); | 84 | edit_comment.setText(""); |
| 85 | commentAdapter.clearItems(); | 85 | commentAdapter.clearItems(); |
| 86 | getCommentMesaage(); | 86 | getCommentMesaage(); |
| 87 | - } else Toast.makeText(CommentActivity.this, "评论失败", Toast.LENGTH_SHORT).show(); | 87 | + } else |
| 88 | + Toast.makeText(CommentActivity.this, "评论失败 : " + errorMessage.getErrorMessage(), Toast.LENGTH_SHORT).show(); | ||
| 88 | 89 | ||
| 89 | } | 90 | } |
| 90 | }); | 91 | }); |
| @@ -101,7 +102,9 @@ public class CommentActivity extends AppCompatActivity implements View.OnClickLi | @@ -101,7 +102,9 @@ public class CommentActivity extends AppCompatActivity implements View.OnClickLi | ||
| 101 | List<CommentItem> comments = commentPage.getData().getComments(); | 102 | List<CommentItem> comments = commentPage.getData().getComments(); |
| 102 | 103 | ||
| 103 | recyclerView.setAdapter(commentAdapter); | 104 | recyclerView.setAdapter(commentAdapter); |
| 104 | - commentAdapter.addItems(comments); | 105 | + if (comments != null) { |
| 106 | + commentAdapter.addItems(comments); | ||
| 107 | + } | ||
| 105 | 108 | ||
| 106 | 109 | ||
| 107 | } | 110 | } |
| @@ -113,7 +116,8 @@ public class CommentActivity extends AppCompatActivity implements View.OnClickLi | @@ -113,7 +116,8 @@ public class CommentActivity extends AppCompatActivity implements View.OnClickLi | ||
| 113 | commentUtil.programComment(programID, new CommentProgramCallback() { | 116 | commentUtil.programComment(programID, new CommentProgramCallback() { |
| 114 | @Override | 117 | @Override |
| 115 | public void onResponse(CommentProgram commentProgram) { | 118 | public void onResponse(CommentProgram commentProgram) { |
| 116 | - Log.v("commentProgram", commentProgram.getData().getComments().size() + ""); | 119 | + if (commentProgram.getData() != null && commentProgram.getData().getComments() != null) |
| 120 | + Log.v("commentProgram", commentProgram.getData().getComments().size() + ""); | ||
| 117 | 121 | ||
| 118 | } | 122 | } |
| 119 | }); | 123 | }); |
build.gradle
| @@ -6,6 +6,10 @@ buildscript { | @@ -6,6 +6,10 @@ buildscript { | ||
| 6 | maven { | 6 | maven { |
| 7 | url 'https://dl.bintray.com/granzon/cnlive/' | 7 | url 'https://dl.bintray.com/granzon/cnlive/' |
| 8 | } | 8 | } |
| 9 | + maven { | ||
| 10 | + url 'https://maven.google.com/' | ||
| 11 | + name 'Google' | ||
| 12 | + } | ||
| 9 | } | 13 | } |
| 10 | dependencies { | 14 | dependencies { |
| 11 | classpath 'com.android.tools.build:gradle:2.3.3' | 15 | classpath 'com.android.tools.build:gradle:2.3.3' |
| @@ -21,6 +25,10 @@ allprojects { | @@ -21,6 +25,10 @@ allprojects { | ||
| 21 | maven { | 25 | maven { |
| 22 | url 'https://dl.bintray.com/granzon/cnlive/' | 26 | url 'https://dl.bintray.com/granzon/cnlive/' |
| 23 | } | 27 | } |
| 28 | + maven { | ||
| 29 | + url 'https://maven.google.com/' | ||
| 30 | + name 'Google' | ||
| 31 | + } | ||
| 24 | } | 32 | } |
| 25 | } | 33 | } |
| 26 | 34 |