"language-java"> 210
211 210
        ImageDisplayUtils.dispalyImg(context, chatRecommendBean.coverImgUrl, simpleViewHolder.info_bg_icon);
212 211
213 212
        if (TextUtils.isEmpty(chatRecommendBean.headImgUrl)) {
@ -330,7 +329,7 @@ public class ChatRecommendAdapter extends RecyclerView.Adapter<IViewHolder> {
330 329
                    String desc = JsonUtils.getKeyResult(response, "desc");
331 330
                    if ("1000".equals(rtnCode)) {
332 331
                        recycler_view_zan_icon.setBackgroundResource(R.drawable.app_talk_main_list_zan_red_icon);
333
                        bean.likeNums ++;
332
                        bean.likeNums++;
334 333
335 334
                        if (bean.likeNums > 999) {
336 335
                            recycler_view_zan.setText("999+");
@ -338,7 +337,7 @@ public class ChatRecommendAdapter extends RecyclerView.Adapter<IViewHolder> {
338 337
                            recycler_view_zan.setText(bean.likeNums + "");
339 338
                        }
340 339
                        recycler_view_zan.setVisibility(View.VISIBLE);
341
                        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)recycler_view_zan_icon.getLayoutParams();
340
                        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) recycler_view_zan_icon.getLayoutParams();
342 341
                        params.rightMargin = DensityUtil.dip2px(context, 5);
343 342
                        recycler_view_zan_icon.setLayoutParams(params);
344 343
                    } else {

+ 14 - 20
app/src/main/java/com/electric/chargingpile/adapter/TopicAdapter.java

@ -5,6 +5,7 @@ import android.support.annotation.NonNull;
5 5
import android.support.v7.widget.RecyclerView;
6 6
import android.text.Html;
7 7
import android.text.TextUtils;
8
import android.util.Log;
8 9
import android.view.LayoutInflater;
9 10
import android.view.View;
10 11
import android.view.View.OnClickListener;
@ -17,6 +18,7 @@ import android.widget.TextView;
17 18
import com.bumptech.glide.Glide;
18 19
import com.bumptech.glide.request.RequestOptions;
19 20
import com.electric.chargingpile.R;
21
import com.electric.chargingpile.data.ChatRecommendBean;
20 22
import com.electric.chargingpile.data.TalkRecommendBean;
21 23
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
22 24
@ -24,11 +26,12 @@ import java.util.ArrayList;
24 26
import java.util.List;
25 27
26 28
public class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.ItemViewHolder> {
27
    private ArrayList<TalkRecommendBean> dataList = new ArrayList<>();
29
    private static final String TAG = "TopicAdapter";
30
    private ArrayList<ChatRecommendBean> dataList = new ArrayList<>();
28 31
    private Context mContext;
29 32
    private int type = 0;
30
    public final static int RECOMENT_TITLE = 0;
31
    public final static int RECOMENT_ITEM = 1;
33
    public final static int RECOMMEND_ITEM = 0; // 推荐话题列表
34
    public final static int SEARCH_ITEM = 1;  // 搜索话题列表
32 35
33 36
    public TopicAdapter(Context c) {
34 37
        mContext = c;
@ -44,7 +47,7 @@ public class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.ItemViewHold
44 47
    @Override
45 48
    public void onBindViewHolder(ItemViewHolder itemViewHolder, int position) {
46 49
        if (position == 0) {
47
            if (type == RECOMENT_TITLE) {
50
            if (type == RECOMMEND_ITEM) {
48 51
                itemViewHolder.mItemTopicLayout.setVisibility(View.VISIBLE);
49 52
            } else {
50 53
                itemViewHolder.mItemTopicLayout.setVisibility(View.GONE);
@ -53,23 +56,14 @@ public class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.ItemViewHold
53 56
            itemViewHolder.mItemTopicLayout.setVisibility(View.GONE);
54 57
        }
55 58
56
        TalkRecommendBean item = getItem(position);
57
        if (type == RECOMENT_ITEM) {
58
            itemViewHolder.mItemTopicName.setText(Html.fromHtml(item.name));
59
        } else {
60
            itemViewHolder.mItemTopicName.setText(item.topicName);
61
        }
62
63
        Glide
64
                .with(itemViewHolder.mItemTopicImg)
65
                .load(TextUtils.isEmpty(item.coverImgUrl) ? "" : item.coverImgUrl)
66
                .apply(requestOptions)
67
                .into(itemViewHolder.mItemTopicImg);
59
        ChatRecommendBean item = getItem(position);
60
        itemViewHolder.mItemTopicName.setText(Html.fromHtml(item.name));
61
        Glide.with(itemViewHolder.mItemTopicImg).load(TextUtils.isEmpty(item.coverImgUrl) ? "" : item.coverImgUrl).apply(requestOptions).into(itemViewHolder.mItemTopicImg);
68 62
    }
69 63
70 64
    RequestOptions requestOptions = new RequestOptions().centerCrop();
71 65
72
    public TalkRecommendBean getItem(int position) {
66
    public ChatRecommendBean getItem(int position) {
73 67
        return dataList.get(position);
74 68
    }
75 69
@ -80,11 +74,11 @@ public class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.ItemViewHold
80 74
    }
81 75
82 76
83
    public void addData(int i, List<TalkRecommendBean> qadata) {
77
    public void addData(int i, List<ChatRecommendBean> beans) {
84 78
        type = i;
85 79
        dataList.clear();
86
        if (qadata != null && qadata.size() > 0) {
87
            dataList.addAll(qadata);
80
        if (beans != null && beans.size() > 0) {
81
            dataList.addAll(beans);
88 82
            notifyDataSetChanged();
89 83
        }
90 84
    }

+ 3 - 2
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

@ -73,9 +73,10 @@ public class MainApplication extends MultiDexApplication {
73 73
    public static String firstPoint = "";
74 74
    public static Boolean firstSsyd;
75 75
    public static String password = "";
76
//    public static String url = "http://59.110.68.162";// 充电桩测试环境
76 77
    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
77
    public static String urlNew = "http://123.56.67.7:83/api/0200";// 一电测试环境
78
//    public static String urlNew = "https://api.touchev.com:83/api/0200";// 一电正式环境
78
//    public static String urlNew = "http://123.56.67.7:83/api/0200";// 一电测试环境
79
    public static String urlNew = "https://api.touchev.com:83/api/0200";// 一电正式环境
79 80
    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
80 81
    //	public static String url = "https://cdz.d1ev.com";
81 82
    public static String build_flag = "0";

+ 30 - 0
app/src/main/java/com/electric/chargingpile/data/ChatRecommendBean.java

@ -33,4 +33,34 @@ public class ChatRecommendBean implements Serializable {
33 33
    public int likeNums;    // 点赞总数
34 34
    public int coverImgW;   // 图片宽度
35 35
    public int coverImgH;   // 图片高度
36
37
    @Override
38
    public String toString() {
39
        return "ChatRecommendBean{" +
40
                "targetId=" + targetId +
41
                ", addUserId=" + addUserId +
42
                ", targetType=" + targetType +
43
                ", title='" + title + '\'' +
44
                ", name='" + name + '\'' +
45
                ", addTime=" + addTime +
46
                ", topicId=" + topicId +
47
                ", joinNums=" + joinNums +
48
                ", visitNums=" + visitNums +
49
                ", coverImgUrl='" + coverImgUrl + '\'' +
50
                ", imgUrls=" + imgUrls +
51
                ", headImgUrl='" + headImgUrl + '\'' +
52
                ", nickName='" + nickName + '\'' +
53
                ", topicName='" + topicName + '\'' +
54
                ", content='" + content + '\'' +
55
                ", shareUrl='" + shareUrl + '\'' +
56
                ", source=" + source +
57
                ", videoUrl='" + videoUrl + '\'' +
58
                ", commentNums=" + commentNums +
59
                ", isTop=" + isTop +
60
                ", likeFlg=" + likeFlg +
61
                ", likeNums=" + likeNums +
62
                ", coverImgW=" + coverImgW +
63
                ", coverImgH=" + coverImgH +
64
                '}';
65
    }
36 66
}

+ 4 - 2
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -196,7 +196,7 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
196 196
                } else if ("8010".equals(code)) {
197 197
                    startActivity(new Intent(getContext(), LoginActivity.class));
198 198
                    ToastUtil.showToast(getContext(), desc, Toast.LENGTH_LONG);
199
                } else  {
199
                } else {
200 200
                    ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
201 201
                }
202 202
            }
@ -216,7 +216,7 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
216 216
        String url = MainApplication.urlNew + "/topic/list.do";
217 217
218 218
        Map<String, String> map = new HashMap<>();
219
        map.put("selected", "1");
219
        map.put("selected", "0");
220 220
        CommonParams.addCommonParams(map);
221 221
222 222
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
@ -273,6 +273,8 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
273 273
                } else {
274 274
                    refreshView.stopLoadMore();
275 275
                }
276
//                Log.d(TAG, "onResponse: " + response);
277
276 278
                String code = JsonUtils.getKeyResult(response, "code");
277 279
                String desc = JsonUtils.getKeyResult(response, "desc");
278 280
                if ("1000".equals(code)) {

+ 1 - 1
app/src/main/res/layout/item_topic.xml

@ -49,7 +49,7 @@
49 49
            android:layout_toEndOf="@+id/item_topic_img"
50 50
            android:ellipsize="end"
51 51
            android:maxLines="2"
52
            android:text="adadasd"
52
            android:text=""
53 53
            android:textColor="#444444"
54 54
            android:textSize="14sp" />
55 55

cdzApp - Gogs: Go Git Service

充电桩app代码

huyuguo 93a7ab9bc0 Update ChatContentListActivity.java 7 years ago
..
libs 5b47557d6a remove 7 years ago
src 93a7ab9bc0 Update ChatContentListActivity.java 7 years ago
.DS_Store 434e445800 隐藏状态栏功能完成 7 years ago
build.gradle a2fcbb9471 视频部分开发 7 years ago
gradle.properties 67341aa295 下线话题处理 7 years ago
proguard-rules.pro d2f405e921 add video play 7 years ago