29268d2d14876a6bba94eacL74">74
75
|
import com.electric.chargingpile.view.REditText;
|
|
75
|
76
|
import com.electric.chargingpile.view.RatingBarView;
|
|
76
|
77
|
|
|
|
78
|
import com.google.gson.Gson;
|
|
77
|
79
|
import com.luck.picture.lib.PictureSelector;
|
|
78
|
80
|
import com.luck.picture.lib.animators.AnimationType;
|
|
79
|
81
|
import com.luck.picture.lib.config.PictureConfig;
|
|
|
@ -148,6 +150,7 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
|
|
148
|
150
|
private static final int PHOTO_REQUEST_CAMERA = 1;
|
|
149
|
151
|
private static final int PHOTO_REQUEST_GALLERY = 2;
|
|
150
|
152
|
private static final int PHOTO_REQUEST_CUT = 3;
|
|
|
153
|
private static final int REQUEST_TOPIC_CODE = 102;
|
|
151
|
154
|
public static android.view.animation.Animation animation;
|
|
152
|
155
|
public static TextView textView;
|
|
153
|
156
|
public static RelativeLayout relativeLayout;
|
|
|
@ -155,6 +158,7 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
|
|
155
|
158
|
private InputMethodManager imm = null;
|
|
156
|
159
|
private static final int RC_ALBUM_PERM = 123;
|
|
157
|
160
|
public static final int REQUEST_CODE_CHOOSE = 336;
|
|
|
161
|
private final Gson mGson=new Gson();
|
|
158
|
162
|
Handler handler = new Handler() {
|
|
159
|
163
|
public void handleMessage(Message msg) {
|
|
160
|
164
|
switch (msg.what) {
|
|
|
@ -452,7 +456,7 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
|
|
452
|
456
|
});
|
|
453
|
457
|
topicText.setOnClickListener(v->{
|
|
454
|
458
|
//跳转至话题页
|
|
455
|
|
SelectTopicActivity.actionStart(this);
|
|
|
459
|
SelectTopicActivity.actionStart(this,REQUEST_TOPIC_CODE);
|
|
456
|
460
|
});
|
|
457
|
461
|
}
|
|
458
|
462
|
|
|
|
@ -521,7 +525,12 @@ public class ZhanCommentActivity extends AppCompatActivity implements View.OnCli
|
|
521
|
525
|
insertImagesSync(data);
|
|
522
|
526
|
}
|
|
523
|
527
|
}
|
|
|
528
|
}else if (requestCode==REQUEST_TOPIC_CODE && resultCode == SelectTopicActivity.REESULT_CODE){
|
|
|
529
|
String name=data.getStringExtra("topicBean");
|
|
|
530
|
TopicBean bean = mGson.fromJson(name, TopicBean.class);
|
|
|
531
|
topicText.setText(bean.getMeg());
|
|
524
|
532
|
}
|
|
|
533
|
|
|
525
|
534
|
}
|
|
526
|
535
|
|
|
527
|
536
|
/**
|
|
|
@ -9,13 +9,26 @@ import androidx.annotation.NonNull;
|
|
9
|
9
|
import androidx.recyclerview.widget.RecyclerView;
|
|
10
|
10
|
|
|
11
|
11
|
import com.electric.chargingpile.R;
|
|
|
12
|
import com.electric.chargingpile.data.TopicBean;
|
|
12
|
13
|
|
|
13
|
14
|
import org.jetbrains.annotations.NotNull;
|
|
14
|
15
|
import org.w3c.dom.Text;
|
|
15
|
16
|
|
|
|
17
|
import java.util.ArrayList;
|
|
|
18
|
|
|
16
|
19
|
public class CommentTopicAdapter extends RecyclerView.Adapter<CommentTopicAdapter.ViewHolder> {
|
|
17
|
20
|
|
|
18
|
21
|
private OnItemClickListener mListener;
|
|
|
22
|
private ArrayList<TopicBean> mDatas=new ArrayList<>();
|
|
|
23
|
|
|
|
24
|
public ArrayList<TopicBean> getDatas() {
|
|
|
25
|
return mDatas;
|
|
|
26
|
}
|
|
|
27
|
|
|
|
28
|
public void setDatas(ArrayList<TopicBean> mDatas) {
|
|
|
29
|
this.mDatas = mDatas;
|
|
|
30
|
notifyDataSetChanged();
|
|
|
31
|
}
|
|
19
|
32
|
|
|
20
|
33
|
public OnItemClickListener getListener() {
|
|
21
|
34
|
return mListener;
|
|
|
@ -39,7 +52,9 @@ public class CommentTopicAdapter extends RecyclerView.Adapter<CommentTopicAdapte
|
|
39
|
52
|
|
|
40
|
53
|
@Override
|
|
41
|
54
|
public void onBindViewHolder(@NonNull @NotNull ViewHolder holder, int position) {
|
|
42
|
|
holder.title.setText("标题"+position);
|
|
|
55
|
TopicBean data = mDatas.get(position);
|
|
|
56
|
|
|
|
57
|
holder.title.setText(data.getMeg());
|
|
43
|
58
|
holder.participateText.setText("内容够"+position+"参与");
|
|
44
|
59
|
holder.onlookersText.setText("标题"+position+"围观");
|
|
45
|
60
|
holder.itemView.setOnClickListener(v->{
|
|
|
@ -50,7 +65,7 @@ public class CommentTopicAdapter extends RecyclerView.Adapter<CommentTopicAdapte
|
|
50
|
65
|
|
|
51
|
66
|
@Override
|
|
52
|
67
|
public int getItemCount() {
|
|
53
|
|
return 20;
|
|
|
68
|
return mDatas.size();
|
|
54
|
69
|
}
|
|
55
|
70
|
|
|
56
|
71
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
@ -0,0 +1,32 @@
|
|
|
1
|
package com.electric.chargingpile.data;
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
public class TopicBean {
|
|
|
5
|
private String id;
|
|
|
6
|
private String meg;
|
|
|
7
|
private String icon;
|
|
|
8
|
|
|
|
9
|
public String getId() {
|
|
|
10
|
return id;
|
|
|
11
|
}
|
|
|
12
|
|
|
|
13
|
public void setId(String id) {
|
|
|
14
|
this.id = id;
|
|
|
15
|
}
|
|
|
16
|
|
|
|
17
|
public String getMeg() {
|
|
|
18
|
return meg;
|
|
|
19
|
}
|
|
|
20
|
|
|
|
21
|
public void setMeg(String meg) {
|
|
|
22
|
this.meg = meg;
|
|
|
23
|
}
|
|
|
24
|
|
|
|
25
|
public String getIcon() {
|
|
|
26
|
return icon;
|
|
|
27
|
}
|
|
|
28
|
|
|
|
29
|
public void setIcon(String icon) {
|
|
|
30
|
this.icon = icon;
|
|
|
31
|
}
|
|
|
32
|
}
|
|
|
@ -200,11 +200,15 @@
|
|
200
|
200
|
|
|
201
|
201
|
|
|
202
|
202
|
<TextView
|
|
|
203
|
android:paddingEnd="11dp"
|
|
|
204
|
android:paddingStart="11dp"
|
|
|
205
|
android:paddingBottom="6dp"
|
|
|
206
|
android:paddingTop="6dp"
|
|
203
|
207
|
android:layout_marginBottom="13dp"
|
|
204
|
208
|
android:id="@+id/topicText"
|
|
205
|
209
|
android:background="@drawable/bg_topic_tab"
|
|
206
|
|
android:layout_width="66dp"
|
|
207
|
|
android:layout_height="28dp"
|
|
|
210
|
android:layout_width="wrap_content"
|
|
|
211
|
android:layout_height="wrap_content"
|
|
208
|
212
|
android:layout_marginStart="15dp"
|
|
209
|
213
|
android:gravity="center"
|
|
210
|
214
|
android:text="╋ 话题"
|