dxh 6 vuotta sitten
vanhempi
commit
91c39e44bc
19 muutettua tiedostoa jossa 1333 lisäystä ja 13 poistoa
  1. 148 13
      app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java
  2. 366 0
      app/src/main/java/com/electric/chargingpile/activity/TopicDetailsActivity.java
  3. 7 0
      app/src/main/java/com/electric/chargingpile/data/AuthSignBean.java
  4. 41 0
      app/src/main/java/com/electric/chargingpile/data/TopicDetailsListBean.java
  5. 13 0
      app/src/main/java/com/electric/chargingpile/util/SystemTypeUtil.java
  6. 173 0
      app/src/main/java/com/electric/chargingpile/view/PullToZoomScrollView3.java
  7. 104 0
      app/src/main/java/com/electric/chargingpile/view/SortTopicPopWindow.java
  8. 108 0
      app/src/main/java/com/electric/chargingpile/view/footer/LoadMoreFooterView.java
  9. BIN
      app/src/main/res/drawable-hdpi/app_show_more_content.png
  10. BIN
      app/src/main/res/drawable-hdpi/app_topic_detaic_popup_icon.png
  11. 27 0
      app/src/main/res/layout/activity_topic_details_info.xml
  12. 85 0
      app/src/main/res/layout/activity_topic_info_top.xml
  13. 128 0
      app/src/main/res/layout/activity_topic_infos_content.xml
  14. 4 0
      app/src/main/res/layout/layout_irecyclerview_load_more_footer.xml
  15. 8 0
      app/src/main/res/layout/layout_irecyclerview_load_more_footer_error_view.xml
  16. 23 0
      app/src/main/res/layout/layout_irecyclerview_load_more_footer_loading_view.xml
  17. 9 0
      app/src/main/res/layout/layout_irecyclerview_load_more_footer_the_end_view.xml
  18. 17 0
      app/src/main/res/layout/layout_irecyclerview_load_more_footer_view.xml
  19. 72 0
      app/src/main/res/layout/topic_sort_popup_dialog.xml

+ 148 - 13
app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.activity;
2 2
3 3
import android.Manifest;
4
import android.annotation.SuppressLint;
4 5
import android.app.Activity;
5 6
import android.app.ProgressDialog;
6 7
import android.content.ContentValues;
@ -60,13 +61,25 @@ import com.electric.chargingpile.util.LoadingDialog;
60 61
import com.electric.chargingpile.util.PublicWay;
61 62
import com.electric.chargingpile.util.Res;
62 63
import com.electric.chargingpile.util.ScreenUtils;
64
import com.electric.chargingpile.util.SystemTypeUtil;
63 65
import com.electric.chargingpile.util.ToastUtil;
64 66
import com.electric.chargingpile.util.UploadUtil;
65 67
import com.electric.chargingpile.view.footer.LoadMoreFooterView;
66 68
import com.umeng.analytics.MobclickAgent;
69
import com.upyun.library.common.ParallelUploader;
70
import com.upyun.library.common.Params;
71
import com.upyun.library.common.SerialUploader;
72
import com.upyun.library.common.UploadEngine;
73
import com.upyun.library.listener.UpCompleteListener;
74
import com.upyun.library.listener.UpProgressListener;
75
import com.upyun.library.utils.UpYunUtils;
67 76
import com.zhy.http.okhttp.OkHttpUtils;
68 77
import com.zhy.http.okhttp.callback.StringCallback;
69 78
79
import org.json.JSONArray;
80
import org.json.JSONException;
81
import org.json.JSONObject;
82
70 83
import java.io.ByteArrayOutputStream;
71 84
import java.io.File;
72 85
import java.io.FileNotFoundException;
@ -143,6 +156,19 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
143 156
144 157
    private TextView publishtopic_choose_topic, mPublishtopicChooseTopic;
145 158
159
    //空间名
160
    public static String SPACE = "formtest";
161
    private String policy = "";
162
    private String OPERATER = "d1evvideo01";
163
//    private String signature = "CuThEAj+xqwwtPotif1l2dT6P8w=";
164
    public static String KEY = "GqSu2v26RI+Xu3yLdsWfynTS/LM=";
165
    @SuppressLint("SdCardPath")
166
//    private static final String SAMPLE_PIC_FILE = "/mnt/sdcard/tdtest.mp4";
167
    private ParallelUploader parallelUploader;
168
//    private SerialUploader serialUploader;
169
    private String picSavePath;
170
171
146 172
    @Override
147 173
    protected void onCreate(Bundle savedInstanceState) {
148 174
        super.onCreate(savedInstanceState);
@ -157,6 +183,27 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
157 183
        dialog = new LoadingDialog(this);
158 184
        dialog.setCanceledOnTouchOutside(false);
159 185
        Init();
186
187
        initYouPaiYun();
188
189
    }
190
191
    /**
192
     *
193
     * 初始化 又拍云
194
     * */
195
    private void initYouPaiYun() {
196
197
        //初始化断点续传 (服务端签名可用)
198
        if(parallelUploader == null){
199
            parallelUploader = new ParallelUploader();
200
            picSavePath = "/d/file/liaoliao/img/" + SystemTypeUtil.stampToDate(System.currentTimeMillis()+"");
201
        }
202
        //图文路径
203
//        String p = "/d/file/liaoliao/img/" + y + "/" + m + "/" + d;
204
        //视频路径
205
//        p = "/d/file/liaoliao/video/" + y + "/" + m + "/" + d;
206
160 207
    }
161 208
162 209
    private void initView() {
@ -186,7 +233,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
186 233
//                    @Override
187 234
//                    public void run() {
188 235
//                        if (Bimp.tempSelectBitmap.size() > 0) {
189
                uploadFeedbackPic();
236
//                uploadFeedbackPic();
190 237
//
191 238
//                        } else {
192 239
//
@ -257,8 +304,9 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
257 304
            return;
258 305
        String fileNames = "";
259 306
        for (int i = 0; i < Bimp.tempSelectBitmap.size(); i++) {
260
            File tempFile = new File(Bimp.tempSelectBitmap.get(i).imagePath.trim());
261
            String fileName = tempFile.getName();
307
//            File tempFile = new File(Bimp.tempSelectBitmap.get(i).imagePath.trim());
308
            String fileNameDir = Bimp.tempSelectBitmap.get(i).imagePath;
309
            String fileName = fileNameDir.substring(fileNameDir.lastIndexOf("\"")+1);
262 310
            if (TextUtils.isEmpty(fileNames))
263 311
                fileNames = fileName;
264 312
            else
@ -281,20 +329,25 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
281 329
                if ("1000".equals(rtnCode)) {
282 330
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
283 331
                    ArrayList<AuthSignBean> signBeans = (ArrayList<AuthSignBean>) JsonUtils.parseToObjectList(rtnMsg, AuthSignBean.class);
332
333
                    if(null != signBeans && signBeans.size()>0){
334
                        File tempFile =new File(Bimp.tempSelectBitmap.get(0).getImagePath().trim());
335
                        String fileName = tempFile.getName();
336
                        //生产policy传的参数
337
                        Map<String, Object> map = new HashMap<>();
338
                        map.put("bucket", "d1evcom01-fs");
339
                        map.put("expiration", (System.currentTimeMillis()+1800)+"");
340
                        map.put("save-key", picSavePath+"/"+tempFile.getName());
341
                        policy = UpYunUtils.getPolicy(map);
342
343
                        formUpload(Bimp.tempSelectBitmap.get(0).getImagePath(),signBeans.get(0).sign, signBeans.get(0).fname);
344
                    }
284 345
                }
285 346
            }
286 347
        });
287 348
//
288
//        //图文路径
289
//        p = "/d/file/liaoliao/img/"+y+"/"+m+"/"+d;
290
//        //视频路径
291
//        p = "/d/file/liaoliao/video/"+y+"/"+m+"/"+d;
292
//        //生产policy传的参数
293
//        Map<String, Object> map = new HashMap<>();
294
//        map.put("bucket","d1evcom01-fs");
295
//        map.put("expiration",expiration);
296
//        map.put("save-key",p+"/"+fname);
297
//        policy =  UpYunUtils.getPolicy(map);
349
350
298 351
    }
299 352
300 353
    final int reqTopic = -100;
@ -967,4 +1020,86 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
967 1020
    }
968 1021
969 1022
1023
    /**
1024
     *
1025
     * 表单上传
1026
     * @param sign
1027
     * @param saveName
1028
     *
1029
     * */
1030
    private void formUpload(String SAMPLE_PIC_FILE, String sign, String saveName) {
1031
        File temp = null;
1032
//        try {
1033
//            temp = getTempFile();
1034
//        } catch (IOException e) {
1035
//            e.printStackTrace();
1036
//        }
1037
1038
        temp = new File(SAMPLE_PIC_FILE);
1039
1040
        final Map<String, Object> paramsMap = new HashMap<>();
1041
        //上传空间
1042
        paramsMap.put(Params.BUCKET, SPACE);
1043
        //保存路径,任选其中一个
1044
        paramsMap.put(Params.SAVE_KEY, picSavePath);
1045
        //添加 CONTENT_LENGTH 参数使用大文件表单上传
1046
        paramsMap.put(Params.CONTENT_LENGTH, temp.length());
1047
1048
1049
        paramsMap.put(Params.CONTENT_MD5, UpYunUtils.md5Hex(temp));
1050
//        paramsMap.put(Params.PATH, savePath);
1051
        //可选参数(详情见api文档介绍)
1052
        paramsMap.put(Params.RETURN_URL, "httpbin.org/post");
1053
        //进度回调,可为空
1054
        UpProgressListener progressListener = new UpProgressListener() {
1055
            @Override
1056
            public void onRequestProgress(long bytesWrite, long contentLength) {
1057
//                bp_form.setProgress((int) ((100 * bytesWrite) / contentLength));
1058
//                tv_form.setText((100 * bytesWrite) / contentLength + "%");
1059
                Log.e(TAG, (100 * bytesWrite) / contentLength + "%");
1060
                Log.e(TAG, bytesWrite + "::" + contentLength);
1061
            }
1062
        };
1063
1064
        //结束回调,不可为空
1065
        UpCompleteListener completeListener = new UpCompleteListener() {
1066
            @Override
1067
            public void onComplete(boolean isSuccess, String result) {
1068
//                tv_form.setText(isSuccess + ":" + result);
1069
                Log.e(TAG, isSuccess + ":" + result);
1070
            }
1071
        };
1072
1073
        //初始化JSONArray,上传预处理(异步)参数详见 http://docs.upyun.com/cloud/image/#_6,
1074
        JSONArray array = new JSONArray();
1075
1076
        //初始化JSONObject
1077
        JSONObject json = new JSONObject();
1078
1079
        //json 添加 name 属性
1080
        try {
1081
            json.put("name", "thumb");
1082
            //json 添加 X_GMKERL_THUMB 属性
1083
//            json.put("x-gmkerl-thumb", "/fw/300/unsharp/true/quality/80/format/png");
1084
//            json.put("x-gmkerl-thumb", "/watermark/url/L2dta2VybC5qcGc=/align/center");
1085
            json.put("x-gmkerl-thumb", picSavePath);
1086
            //json 添加 save_as 属性
1087
            json.put("save_as", saveName);
1088
            //json 添加 notify_url 属性
1089
            json.put("notify_url", "http://httpbin.org/post");
1090
        } catch (JSONException e) {
1091
            e.printStackTrace();
1092
        }
1093
        //将json 对象放入 JSONArray
1094
        array.put(json);
1095
        //添加异步作图参数 APPS
1096
        paramsMap.put("apps", array);
1097
        //表单上传(本地签名方式)
1098
//        UploadEngine.getInstance().formUpload(temp, paramsMap, OPERATER, sign, completeListener, progressListener);
1099
        //表单上传(服务器签名方式)
1100
        UploadEngine.getInstance().formUpload(temp, policy, OPERATER, sign, completeListener, progressListener);
1101
    }
1102
1103
1104
970 1105
}

+ 366 - 0
app/src/main/java/com/electric/chargingpile/activity/TopicDetailsActivity.java

@ -0,0 +1,366 @@
1
package com.electric.chargingpile.activity;
2
3
import android.content.Intent;
4
import android.graphics.Color;
5
import android.os.Bundle;
6
import android.support.annotation.Nullable;
7
import android.support.v7.app.AppCompatActivity;
8
import android.support.v7.widget.LinearLayoutManager;
9
import android.support.v7.widget.StaggeredGridLayoutManager;
10
import android.text.TextUtils;
11
import android.util.Log;
12
import android.view.View;
13
import android.view.ViewTreeObserver;
14
import android.widget.ImageView;
15
import android.widget.LinearLayout;
16
import android.widget.RelativeLayout;
17
import android.widget.TextView;
18
import android.widget.Toast;
19
20
import com.aspsine.irecyclerview.IRecyclerView;
21
import com.aspsine.irecyclerview.OnLoadMoreListener;
22
import com.blankj.utilcode.util.LogUtils;
23
import com.electric.chargingpile.R;
24
import com.electric.chargingpile.adapter.WaterFallAdapter;
25
import com.electric.chargingpile.application.MainApplication;
26
import com.electric.chargingpile.data.ChargingShareBean;
27
import com.electric.chargingpile.data.HomePageBean;
28
import com.electric.chargingpile.data.TalkRecommendBean;
29
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
30
import com.electric.chargingpile.util.ImageDisplayUtils;
31
import com.electric.chargingpile.util.JsonUtils;
32
import com.electric.chargingpile.util.ScreenUtils;
33
import com.electric.chargingpile.util.ToastUtil;
34
import com.electric.chargingpile.view.PullToZoomScrollView3;
35
import com.electric.chargingpile.view.SortPopWindow;
36
import com.electric.chargingpile.view.SortTopicPopWindow;
37
import com.electric.chargingpile.view.footer.LoadMoreFooterView;
38
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
39
import com.zhy.http.okhttp.OkHttpUtils;
40
import com.zhy.http.okhttp.callback.StringCallback;
41
42
import java.util.ArrayList;
43
import java.util.HashMap;
44
import java.util.Map;
45
46
import cn.sharesdk.framework.Platform;
47
import cn.sharesdk.framework.PlatformActionListener;
48
import cn.sharesdk.framework.ShareSDK;
49
import cn.sharesdk.tencent.qq.QQ;
50
import cn.sharesdk.wechat.friends.Wechat;
51
import cn.sharesdk.wechat.moments.WechatMoments;
52
import okhttp3.Call;
53
54
/**
55
 * @desc 话题详情
56
 */
57
public class TopicDetailsActivity extends AppCompatActivity implements View.OnClickListener, PullToZoomScrollView3.ScrollViewListener, OnLoadMoreListener {
58
59
    private String topicId;
60
    private PullToZoomScrollView3 scrollview;
61
    private String topicTitleContent;
62
    private int screenWidth, bgHeight, screenHeight;
63
    private TextView textview, topic_title,topic_content, read_data, join_data, sort_text_info;
64
    private RelativeLayout top_view;
65
    private LinearLayout content_view, ll_sort_view;
66
    private int page = 1;
67
    private int sort = 1;
68
    private String sortType = "agree";//排序 ctime为时间顺序,agree为点赞排序
69
    private LoadMoreFooterView loadMoreFooterView;
70
    private IRecyclerView comment_data;
71
    private StaggeredGridLayoutManager layoutManager;
72
    private WaterFallAdapter waterFallAdapter;
73
    private boolean haveLoadHeaderData;
74
    private ImageView user_avater, user_content_more;
75
76
    @Override
77
    protected void onCreate(@Nullable Bundle savedInstanceState) {
78
        super.onCreate(savedInstanceState);
79
        setContentView(R.layout.activity_topic_details_info);
80
        initView();
81
        initListeners();
82
        initListeners(content_view);
83
84
        requestData();
85
    }
86
87
    private void initView() {
88
        topicId = getIntent().getStringExtra("topicId");
89
        textview = (TextView) findViewById(R.id.textview);
90
        textview.setVisibility(View.GONE);
91
        topic_title = (TextView) findViewById(R.id.topic_title);
92
        topic_content = (TextView) findViewById(R.id.topic_content);
93
        join_data = (TextView) findViewById(R.id.join_data);
94
        read_data = (TextView) findViewById(R.id.read_data);
95
        sort_text_info = (TextView) findViewById(R.id.sort_text_info);
96
        user_avater = (ImageView) findViewById(R.id.user_avater);
97
        user_content_more = (ImageView) findViewById(R.id.user_content_more);
98
        top_view = (RelativeLayout) findViewById(R.id.top_view);
99
        content_view = (LinearLayout) findViewById(R.id.content_view);
100
        ll_sort_view = (LinearLayout) findViewById(R.id.ll_sort_view);
101
        scrollview = (PullToZoomScrollView3) findViewById(R.id.scroll_view);
102
        scrollview.setVerticalScrollBarEnabled(false);
103
        screenHeight = ScreenUtils.getScreenHeight(this);
104
105
    }
106
107
    private void initListeners() {
108
        findViewById(R.id.iv_back).setOnClickListener(this);
109
        findViewById(R.id.textview_share).setOnClickListener(this);
110
        user_content_more.setOnClickListener(this);
111
        //评论
112
        comment_data = (IRecyclerView) findViewById(R.id.recyclerView);
113
//        comment_data.setNestedScrollingEnabled(false);
114
        loadMoreFooterView = (LoadMoreFooterView) comment_data.getLoadMoreFooterView();
115
        //设置布局管理器
116
        waterFallAdapter = new WaterFallAdapter(this);
117
        layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
118
        comment_data.setLayoutManager(layoutManager);
119
        comment_data.setIAdapter(waterFallAdapter);
120
        comment_data.setOnLoadMoreListener(this);
121
        comment_data.setLoadMoreEnabled(true);
122
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
123
            @Override
124
            public void onItemClickListener(int position, int index) {
125
                String topicId = waterFallAdapter.getCurrentData().get(position).topicId+"";
126
                startActivity(new Intent(TopicDetailsActivity.this, TopicDetailsActivity.class).putExtra("topicId", topicId));
127
            }
128
        });
129
    }
130
131
    @Override
132
    public void onClick(View v) {
133
        switch (v.getId()) {
134
            case R.id.user_content_more:
135
                topic_content.setText(contentAll);
136
                user_content_more.setVisibility(View.GONE);
137
                break;
138
            case R.id.textview_share:
139
                ChargingShareBean chargingShareBean = new ChargingShareBean();
140
//                chargingShareBean.setIcon(shareThumbnail);
141
//                chargingShareBean.setTitle(shareTitle);
142
//                chargingShareBean.setUrl(shareUrl);
143
                chargingShareBean.setText("");
144
                showSimpleBottomSheetGrid(chargingShareBean);
145
                break;
146
            case R.id.iv_back:
147
                finish();
148
                break;
149
            case R.id.ll_sort:
150
151
                final SortTopicPopWindow sortPopWindow = new SortTopicPopWindow(TopicDetailsActivity.this);
152
                sortPopWindow.setUi(sort);
153
                sortPopWindow.showPopupWindow(ll_sort_view, new View.OnClickListener() {
154
                    @Override
155
                    public void onClick(View v) {
156
                        switch (v.getId()) {
157
                            case R.id.tv_1:
158
                                sort = 1;
159
                                sortPopWindow.dismiss();
160
                                sort_text_info.setText("最新发布");
161
                                page = 1;
162
                                requestData();
163
                                break;
164
                            case R.id.tv_2:
165
                                sort = 2;
166
                                sortPopWindow.dismiss();
167
                                sort_text_info.setText("最后回复");
168
                                page = 1;
169
                                requestData();
170
                                break;
171
                            case R.id.tv_3:
172
//                                Log.e(TAG, "onClick: 111" );
173
                                sort = 1;
174
                                sortPopWindow.dismiss();
175
                                sort_text_info.setText("最热");
176
                                page = 1;
177
                                requestData();
178
                                break;
179
                        }
180
                    }
181
                });
182
                break;
183
        }
184
    }
185
186
    /**
187
     * 获取上半身的高度后,设置滚动监听
188
     */
189
    private void initListeners(final View listenView) {
190
        ViewTreeObserver vto = listenView.getViewTreeObserver();
191
        vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
192
            @Override
193
            public void onGlobalLayout() {
194
                listenView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
195
                bgHeight = listenView.getHeight() - top_view.getHeight();
196
                scrollview.setScrollViewListener(TopicDetailsActivity.this);
197
            }
198
        });
199
    }
200
201
    @Override
202
    public void onScrollChanged(PullToZoomScrollView3 scrollView, int l, int t, int oldl, int oldt) {
203
        if (t <= 0) {   //设置标题的背景颜色
204
            textview.setVisibility(View.GONE);
205
206
        } else if (t > 0 && t <= bgHeight) { //滑动距离小于banner图的高度时,设置背景和字体颜色颜色透明度渐变
207
            float scale = (float) t / bgHeight;
208
            float alpha = (255 * scale);
209
            textview.setVisibility(View.GONE);
210
211
        } else {    //滑动到banner下面设置普通颜色
212
            textview.setVisibility(View.VISIBLE);
213
        }
214
    }
215
216
217
    private void requestData() {
218
        String url = MainApplication.urlNew + "/topic/homepage.do";
219
        Map<String, String> map = new HashMap<>();
220
        map.put("topicId", topicId + "");
221
        map.put("sort", sort+"");//1最新发布/2最后回复/3最热
222
        map.put("init", "1");//1返回话题名等信息 0只返回话题下内容列表
223
        map.put("page", page + "");
224
        map.put("limit", "20");
225
        if (MainApplication.isLogin()) {
226
            map.put("user_id", MainApplication.userId);
227
        }
228
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
229
            @Override
230
            public void onError(Call call, Exception e) {
231
                loadMoreFooterView.setStatus(LoadMoreFooterView.Status.ERROR);
232
                if(page>1)
233
                    page -= 1;
234
            }
235
236
            @Override
237
            public void onResponse(String response) {
238
239
                String rtnCode = JsonUtils.getKeyResult(response, "code");
240
                if ("1000".equals(rtnCode)) {
241
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
242
                    HomePageBean qadata = (HomePageBean) JsonUtils.parseToObjectBean(rtnMsg, HomePageBean.class);
243
                    if (!haveLoadHeaderData) {
244
                        haveLoadHeaderData = true;
245
                        initHeaderData(qadata.list);
246
                    }
247
                    if (page == 1)
248
                        waterFallAdapter.setData(qadata.list);
249
                    else
250
                        waterFallAdapter.addData(qadata.list);
251
252
                    if (qadata.list == null || qadata.list.size() < 20) {
253
                        if (page == 1) {
254
                            comment_data.setLoadMoreEnabled(false);
255
                        } else {
256
                            loadMoreFooterView.setStatus(LoadMoreFooterView.Status.THE_END);
257
                            comment_data.setNestedScrollingEnabled(false);
258
                        }
259
                    }
260
                } else if ("02".equals(rtnCode)) {
261
                    ToastUtil.showToast(getApplicationContext(), "已经全部加载完毕", Toast.LENGTH_SHORT);
262
                }
263
            }
264
        });
265
    }
266
267
    private String contentAll = "";
268
    private void initHeaderData(ArrayList<TalkRecommendBean> list) {
269
        if(null != list && list.size()>0){
270
            textview.setText(list.get(0).topicName);
271
            topic_title.setText(list.get(0).topicName);
272
            read_data.setText(list.get(0).visitNums+"");
273
            join_data.setText(list.get(0).joinNums+"");
274
            contentAll = list.get(0).title;
275
            if(TextUtils.isEmpty(contentAll) && contentAll.length()>100){
276
                topic_content.setText(contentAll.substring(0, 100));
277
                user_content_more.setVisibility(View.VISIBLE);
278
            }else {
279
                topic_content.setText(contentAll);
280
            }
281
            ImageDisplayUtils.dispalyImg(this, list.get(0).headImgUrl, user_avater);
282
        }
283
    }
284
285
    @Override
286
    public void onLoadMore() {
287
        page += 1;
288
        requestData();
289
    }
290
291
    private void showSimpleBottomSheetGrid(final ChargingShareBean chargingShareBean) {
292
        final int TAG_SHARE_WECHAT_FRIEND = 0;
293
        final int TAG_SHARE_WECHAT_MOMENT = 1;
294
        final int TAG_SHARE_QQ = 2;
295
        QMUIBottomSheet.BottomGridSheetBuilder builder = new QMUIBottomSheet.BottomGridSheetBuilder(TopicDetailsActivity.this);
296
        QMUIBottomSheet build = builder.addItem(R.drawable.icon_share_wechat, "微信", TAG_SHARE_WECHAT_FRIEND, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
297
                .addItem(R.drawable.icon_share_wechatquan, "朋友圈", TAG_SHARE_WECHAT_MOMENT, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
298
                .addItem(R.drawable.icon_share_qq, "QQ", TAG_SHARE_QQ, QMUIBottomSheet.BottomGridSheetBuilder.FIRST_LINE)
299
                .setOnSheetItemClickListener(new QMUIBottomSheet.BottomGridSheetBuilder.OnSheetItemClickListener() {
300
                    @Override
301
                    public void onClick(QMUIBottomSheet dialog, View itemView) {
302
                        dialog.dismiss();
303
                        int tag = (int) itemView.getTag();
304
                        switch (tag) {
305
                            case TAG_SHARE_WECHAT_FRIEND:
306
                                share(Wechat.NAME, chargingShareBean);
307
                                break;
308
                            case TAG_SHARE_WECHAT_MOMENT:
309
                                share(WechatMoments.NAME, chargingShareBean);
310
                                break;
311
                            case TAG_SHARE_QQ:
312
                                share(QQ.NAME, chargingShareBean);
313
                                break;
314
                        }
315
                    }
316
                }).build();
317
//        build.
318
        build.show();
319
    }
320
321
    private void share(final String name, ChargingShareBean chargingShareBean) {
322
        Platform.ShareParams paramsToShare = new Platform.ShareParams();
323
        paramsToShare.setText(chargingShareBean.getText());
324
        paramsToShare.setTitle(chargingShareBean.getTitle());
325
        paramsToShare.setTitleUrl(chargingShareBean.getUrl());
326
        paramsToShare.setUrl(chargingShareBean.getUrl());
327
        paramsToShare.setImageUrl(chargingShareBean.getIcon());
328
        paramsToShare.setShareType(Platform.SHARE_WEBPAGE);
329
        Platform platform = ShareSDK.getPlatform(name);
330
        platform.setPlatformActionListener(new PlatformActionListener() {
331
            @Override
332
            public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
333
                if (MainApplication.isLogin()) {
334
                    getShareIntegral();
335
                }
336
            }
337
338
            @Override
339
            public void onError(Platform platform, int i, Throwable throwable) {
340
                LogUtils.e(throwable.getMessage());
341
            }
342
343
            @Override
344
            public void onCancel(Platform platform, int i) {
345
            }
346
        });
347
        platform.share(paramsToShare);
348
    }
349
350
    private void getShareIntegral() {
351
        String url = MainApplication.url + "/zhannew/basic/web/index.php/member/insert-task?userid=" + MainApplication.userId;
352
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
353
            @Override
354
            public void onError(Call call, Exception e) {
355
356
            }
357
358
            @Override
359
            public void onResponse(String response) {
360
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
361
                if (rtnCode.equals("01")) {
362
                }
363
            }
364
        });
365
    }
366
}

+ 7 - 0
app/src/main/java/com/electric/chargingpile/data/AuthSignBean.java

@ -0,0 +1,7 @@
1
package com.electric.chargingpile.data;
2
3
public class AuthSignBean {
4
5
    public String fname;
6
    public String sign;
7
}

+ 41 - 0
app/src/main/java/com/electric/chargingpile/data/TopicDetailsListBean.java

@ -0,0 +1,41 @@
1
package com.electric.chargingpile.data;
2
3
public class TopicDetailsListBean {
4
//     "targetId": 13,
5
//             "targetType": 24,
6
//             "title": "早上好。    周五啦,再坚持一天就可以迎来美好的周末了。现在照例先奉上虎嗅早报。    昨晚王兴和阿里的口水仗很是精彩了,不过除了怼阿里,王兴在采访中还说了啥?",
7
//             "topicId": 1,
8
//             "topicName": "你的电动车冬天续航有多少公里?你的电动车冬天续航有多少公里?你的",
9
//             "addUserId": 130690,
10
//             "addTime": 1553823519000,
11
//             "imgUrls": [
12
//             "http://cdn-fs.touchev.com/d/file/liaoliao/img/2019/4/
13
//             "http://cdn-fs.touchev.com/d/file/cars/tuji/117/44/100/1/white9.JPG!w480"
14
//             ],
15
//             "coverImgUrl": "http://cdn-fs.touchev.com/d/file/liaoliao/img/2019/4/02/201915541933276282091.jpeg!w480",
16
//             "headImgUrl": "2018/1381545893914photoIOS.png",
17
//             "nickName": "千秋壹胡",
18
//             "likeNums": 0,
19
//             "commentNums": 0,
20
//             "isTop": 1,
21
//             "likeFlg": 0,
22
//             "source": 2,
23
//             "shareUrl": "https://m.d1ev.com/app.html"
24
    public long targetId;
25
    public int targetType;
26
    public String title;
27
    public int topicId;
28
    public String topicName;
29
    public long addUserId;
30
    public String[] imgUrls;
31
    public String coverImgUrl;
32
    public String headImgUrl;
33
    public String nickName;
34
    public int likeNums;
35
    public int commentNums;
36
    public int isTop;
37
    public int likeFlg;
38
    public int source;
39
    public int shareUrl;
40
41
}

+ 13 - 0
app/src/main/java/com/electric/chargingpile/util/SystemTypeUtil.java

@ -19,6 +19,8 @@ import java.io.FileInputStream;
19 19
import java.io.IOException;
20 20
import java.lang.reflect.Field;
21 21
import java.lang.reflect.Method;
22
import java.sql.Date;
23
import java.text.SimpleDateFormat;
22 24
import java.util.Properties;
23 25
24 26
/**
@ -236,5 +238,16 @@ public class SystemTypeUtil {
236 238
        }
237 239
    }
238 240
241
    /*
242
     * 将时间戳转换为时间
243
     */
244
    public static String stampToDate(String s){
245
        String res;
246
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd");
247
        long lt = new Long(s);
248
        Date date = new Date(lt);
249
        res = simpleDateFormat.format(date);
250
        return res;
251
    }
239 252
240 253
}

+ 173 - 0
app/src/main/java/com/electric/chargingpile/view/PullToZoomScrollView3.java

@ -0,0 +1,173 @@
1
package com.electric.chargingpile.view;
2
3
import android.animation.ObjectAnimator;
4
import android.content.Context;
5
import android.util.AttributeSet;
6
import android.util.DisplayMetrics;
7
import android.util.TypedValue;
8
import android.view.MotionEvent;
9
import android.view.View;
10
import android.view.ViewGroup;
11
import android.view.WindowManager;
12
import android.widget.LinearLayout;
13
import android.widget.ScrollView;
14
15
/**
16
 *
17
 * 下拉scroll图片放大  标题栏渐变
18
 *
19
 * Created by dxh
20
 */
21
public class PullToZoomScrollView3 extends ScrollView {
22
    private  boolean isonce;//加载该View的布局时是否是第一次加载,是第一次就让其实现OnMeasure里的代码
23
24
    private LinearLayout mParentView;//布局的父布局,ScrollView内部只能有一个根ViewGroup,就是此View
25
    private ViewGroup mTopView;//这个是带背景的上半部分的View,下半部分的View用不到的
26
27
    private int mScreenHeight;//整个手机屏幕的高度,这是为了初始化该View时设置mTopView用的
28
    private int mTopViewHeight;//这个就是mTopView的高度
29
30
    private int mCurrentOffset=0;//当前右侧滚条顶点的偏移量。ScrollView右侧是有滚动条的,当下拉时,
31
    //滚动条向上滑,当向下滑动时,滚动条向下滑动。
32
33
    private ObjectAnimator oa;//这个是对象动画,这个在本View里很简单,也很独立,就在这里申明一下,后面有两个方法
34
    //两个方法是:setT(int t),reset()两个方法用到,其他都和它无关了。
35
36
    public void setScrollViewListener(ScrollViewListener scrollViewListener) {
37
        this.scrollViewListener = scrollViewListener;
38
    }
39
40
    private ScrollViewListener scrollViewListener = null;
41
42
    public PullToZoomScrollView3(Context context) {
43
        super(context);
44
    }
45
46
    public PullToZoomScrollView3(Context context, AttributeSet attrs, int defStyleAttr) {
47
        super(context, attrs, defStyleAttr);
48
    }
49
50
    /**
51
     * 初始化获取高度值,并记录
52
     * @param context
53
     * @param attrs
54
     */
55
    public PullToZoomScrollView3(Context context, AttributeSet attrs) {
56
        super(context, attrs);
57
        this.setOverScrollMode(View.OVER_SCROLL_NEVER);
58
        WindowManager wm= (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
59
        DisplayMetrics metrics=new DisplayMetrics();
60
        wm.getDefaultDisplay().getMetrics(metrics);
61
        mScreenHeight=metrics.heightPixels;
62
        mTopViewHeight=mScreenHeight/3-(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 90, context.getResources().getDisplayMetrics());
63
64
    }
65
66
    /**
67
     * 将记录的值设置到控件上,并只让控件设置一次
68
     * @param widthMeasureSpec
69
     * @param heightMeasureSpec
70
     */
71
    @Override
72
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
73
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
74
        if(!isonce) {
75
            mParentView = (LinearLayout) this.getChildAt(0);
76
            mTopView = (ViewGroup) mParentView.getChildAt(0);
77
            mTopView.getLayoutParams().height = mTopViewHeight;
78
            isonce=true;
79
        }
80
    }
81
82
    private float startY=0;//向下拉动要放大,手指向下滑时,点击的第一个点的Y坐标
83
    private boolean isBig;//是否正在向下拉放大上半部分View
84
    private boolean isTouchOne;//是否是一次连续的MOVE,默认为false,
85
    //在MoVe时,如果发现滑动标签位移量为0,则获取此时的Y坐标,作为起始坐标,然后置为true,为了在连续的Move中只获取一次起始坐标
86
    //当Up弹起时,一次触摸移动完成,将isTouchOne置为false
87
    private float distance=0;//向下滑动到释放的高度差
88
    @Override
89
    public boolean onTouchEvent(MotionEvent ev) {
90
        int action =ev.getAction();
91
        switch (action){
92
            case MotionEvent.ACTION_DOWN:
93
                break;
94
            case MotionEvent.ACTION_MOVE:
95
                if(mCurrentOffset<=0){
96
                    if(!isTouchOne){
97
                        startY=ev.getY();
98
                        isTouchOne=true;
99
                    }
100
                    distance=ev.getY()-startY;
101
                    if(distance>0){
102
                        isBig=true;
103
                        setT((int)-distance/4);
104
                    }
105
                }
106
                break;
107
            case MotionEvent.ACTION_UP:
108
                if(isBig) {
109
                    reset();
110
                    isBig=false;
111
                }
112
                isTouchOne=false;
113
            break;
114
        }
115
        return super.onTouchEvent(ev);
116
    }
117
118
    /**
119
     * 对象动画要有的设置方法
120
     * @param t
121
     */
122
    public void setT(int t) {
123
        scrollTo(0, 0);
124
        if (t < 0) {
125
            mTopView.getLayoutParams().height = mTopViewHeight-t;
126
            mTopView.requestLayout();
127
        }
128
    }
129
130
    /**
131
     * 主要用于释放手指后的回弹效果
132
     */
133
    private void reset() {
134
        if (oa != null && oa.isRunning()) {
135
            return;
136
        }
137
        oa = ObjectAnimator.ofInt(this, "t", (int)-distance / 4, 0);
138
        oa.setDuration(150);
139
        oa.start();
140
    }
141
142
    /**
143
     * 这个是设置向上滑动时,上半部分View滑动速度让其小于下半部分
144
     * @param l
145
     * @param t
146
     * @param oldl
147
     * @param oldt
148
     */
149
    @Override
150
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
151
        super.onScrollChanged(l, t, oldl, oldt);
152
153
        if (scrollViewListener != null) {
154
            scrollViewListener.onScrollChanged(this, l, t, oldl, oldt);
155
        }
156
157
        mCurrentOffset = t;//右边滑动标签相对于顶端的偏移量
158
        //当手势上滑,则右侧滚动条下滑,下滑的高度小于TopView的高度,则让TopView的上滑速度小于DownView的上滑速度
159
        //DownView的上滑速度是滚动条的速度,也就是滚动的距离是右侧滚动条的距离
160
        //则TopView的速度要小,只需要将右侧滚动条的偏移量也就是t缩小一定倍数就行了。我这里除以2速度减小1倍
161
        if (t <= mTopViewHeight&&t>=0&&!isBig) {
162
            mTopView.setTranslationY(t / 2);//使得TopView滑动的速度小于滚轮滚动的速度
163
        }
164
        if(isBig){
165
            scrollTo(0,0);
166
        }
167
168
    }
169
170
    public interface ScrollViewListener {
171
        void onScrollChanged(PullToZoomScrollView3 scrollView, int l, int t, int oldl, int oldt);
172
    }
173
}

+ 104 - 0
app/src/main/java/com/electric/chargingpile/view/SortTopicPopWindow.java

@ -0,0 +1,104 @@
1
package com.electric.chargingpile.view;
2
3
import android.app.Activity;
4
import android.content.Context;
5
import android.graphics.drawable.ColorDrawable;
6
import android.view.LayoutInflater;
7
import android.view.View;
8
import android.view.ViewGroup.LayoutParams;
9
import android.widget.PopupWindow;
10
import android.widget.TextView;
11
12
import com.electric.chargingpile.R;
13
14
/**
15
 * Created by demon on 2017/8/21.
16
 */
17
18
public class SortTopicPopWindow extends PopupWindow {
19
    private View conentView;
20
    private TextView tv1, tv2, tv3;
21
    private Activity context;
22
23
    public SortTopicPopWindow(final Activity context) {
24
        this.context = context;
25
        LayoutInflater inflater = (LayoutInflater) context
26
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
27
        conentView = inflater.inflate(R.layout.topic_sort_popup_dialog, null);
28
        tv1 = (TextView) conentView.findViewById(R.id.tv_1);
29
        tv2 = (TextView) conentView.findViewById(R.id.tv_2);
30
        tv3 = (TextView) conentView.findViewById(R.id.tv_3);
31
        int h = context.getWindowManager().getDefaultDisplay().getHeight();
32
        int w = context.getWindowManager().getDefaultDisplay().getWidth();
33
        // 设置SelectPicPopupWindow的View
34
        this.setContentView(conentView);
35
        // 设置SelectPicPopupWindow弹出窗体的宽
36
        this.setWidth(w / 2 - 120);
37
        // 设置SelectPicPopupWindow弹出窗体的高
38
        this.setHeight(LayoutParams.WRAP_CONTENT);
39
        // 设置SelectPicPopupWindow弹出窗体可点击
40
        this.setFocusable(true);
41
        this.setOutsideTouchable(true);
42
        // 刷新状态
43
        this.update();
44
        // 实例化一个ColorDrawable颜色为半透明
45
        ColorDrawable dw = new ColorDrawable(0000000000);
46
        // 点back键和其他地方使其消失,设置了这个才能触发OnDismisslistener ,设置其他控件变化等操作
47
        this.setBackgroundDrawable(dw);
48
        // mPopupWindow.setAnimationStyle(android.R.style.Animation_Dialog);
49
        // 设置SelectPicPopupWindow弹出窗体动画效果
50
        this.setAnimationStyle(R.style.AnimationPreview);
51
52
    }
53
54
    public void setUi(int sort) {
55
        //排序 ctime为时间顺序,agree为点赞排序
56
        if (sort == 1) {
57
            tv1.setTextColor(context.getResources().getColor(R.color.lvse));
58
            tv2.setTextColor(context.getResources().getColor(R.color.ui_68));
59
            tv3.setTextColor(context.getResources().getColor(R.color.ui_68));
60
        } else if(sort == 2){
61
            tv1.setTextColor(context.getResources().getColor(R.color.ui_68));
62
            tv2.setTextColor(context.getResources().getColor(R.color.lvse));
63
            tv3.setTextColor(context.getResources().getColor(R.color.ui_68));
64
        }else {
65
            tv1.setTextColor(context.getResources().getColor(R.color.ui_68));
66
            tv2.setTextColor(context.getResources().getColor(R.color.ui_68));
67
            tv3.setTextColor(context.getResources().getColor(R.color.lvse));
68
        }
69
    }
70
71
    public void showPopupWindow(View parent, final View.OnClickListener listener) {
72
        tv1.setOnClickListener(new View.OnClickListener() {
73
            @Override
74
            public void onClick(View v) {
75
                try {
76
                    listener.onClick(v);
77
78
                } catch (Exception e) {
79
                    e.printStackTrace();
80
                }
81
            }
82
        });
83
84
        tv2.setOnClickListener(new View.OnClickListener() {
85
            @Override
86
            public void onClick(View view) {
87
                try {
88
                    listener.onClick(view);
89
90
                } catch (Exception e) {
91
                    e.printStackTrace();
92
                }
93
            }
94
        });
95
        if (!this.isShowing()) {
96
            this.showAsDropDown(parent, parent.getLayoutParams().width / 2, -5);
97
98
        } else {
99
            this.dismiss();
100
        }
101
    }
102
103
104
}

+ 108 - 0
app/src/main/java/com/electric/chargingpile/view/footer/LoadMoreFooterView.java

@ -0,0 +1,108 @@
1
package com.electric.chargingpile.view.footer;
2
3
import android.content.Context;
4
import android.util.AttributeSet;
5
import android.view.LayoutInflater;
6
import android.view.View;
7
import android.widget.FrameLayout;
8
9
import com.electric.chargingpile.R;
10
11
12
/**
13
 * Created by aspsine on 16/3/14.
14
 */
15
public class LoadMoreFooterView extends FrameLayout {
16
17
    private Status mStatus;
18
19
    private View mLoadingView;
20
21
    private View mErrorView;
22
23
    private View mTheEndView;
24
25
    private OnRetryListener mOnRetryListener;
26
27
    public LoadMoreFooterView(Context context) {
28
        this(context, null);
29
    }
30
31
    public LoadMoreFooterView(Context context, AttributeSet attrs) {
32
        this(context, attrs, 0);
33
    }
34
35
    public LoadMoreFooterView(Context context, AttributeSet attrs, int defStyleAttr) {
36
        super(context, attrs, defStyleAttr);
37
        LayoutInflater.from(context).inflate(R.layout.layout_irecyclerview_load_more_footer_view, this, true);
38
39
        mLoadingView = findViewById(R.id.loadingView);
40
        mErrorView = findViewById(R.id.errorView);
41
        mTheEndView = findViewById(R.id.theEndView);
42
43
        mErrorView.setOnClickListener(new OnClickListener() {
44
            @Override
45
            public void onClick(View v) {
46
                if (mOnRetryListener != null) {
47
                    mOnRetryListener.onRetry(LoadMoreFooterView.this);
48
                }
49
            }
50
        });
51
52
        setStatus(Status.GONE);
53
    }
54
55
    public void setOnRetryListener(OnRetryListener listener) {
56
        this.mOnRetryListener = listener;
57
    }
58
59
    public Status getStatus() {
60
        return mStatus;
61
    }
62
63
    public void setStatus(Status status) {
64
        this.mStatus = status;
65
        change();
66
    }
67
68
    public boolean canLoadMore() {
69
        return mStatus == Status.GONE || mStatus == Status.ERROR;
70
    }
71
72
    private void change() {
73
        switch (mStatus) {
74
            case GONE:
75
                mLoadingView.setVisibility(GONE);
76
                mErrorView.setVisibility(GONE);
77
                mTheEndView.setVisibility(GONE);
78
                break;
79
80
            case LOADING:
81
                mLoadingView.setVisibility(VISIBLE);
82
                mErrorView.setVisibility(GONE);
83
                mTheEndView.setVisibility(GONE);
84
                break;
85
86
            case ERROR:
87
                mLoadingView.setVisibility(GONE);
88
                mErrorView.setVisibility(VISIBLE);
89
                mTheEndView.setVisibility(GONE);
90
                break;
91
92
            case THE_END:
93
                mLoadingView.setVisibility(GONE);
94
                mErrorView.setVisibility(GONE);
95
                mTheEndView.setVisibility(VISIBLE);
96
                break;
97
        }
98
    }
99
100
    public enum Status {
101
        GONE, LOADING, ERROR, THE_END
102
    }
103
104
    public interface OnRetryListener {
105
        void onRetry(LoadMoreFooterView view);
106
    }
107
108
}

BIN
app/src/main/res/drawable-hdpi/app_show_more_content.png


BIN
app/src/main/res/drawable-hdpi/app_topic_detaic_popup_icon.png


+ 27 - 0
app/src/main/res/layout/activity_topic_details_info.xml

@ -0,0 +1,27 @@
1
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
    xmlns:tools="http://schemas.android.com/tools"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:id="@+id/whole_view"
6
    android:scrollbars="none"
7
    android:orientation="vertical">
8
9
    <com.electric.chargingpile.view.PullToZoomScrollView3
10
        android:id="@+id/scroll_view"
11
        android:layout_width="match_parent"
12
        android:layout_height="wrap_content">
13
14
        <LinearLayout
15
            android:layout_width="match_parent"
16
            android:layout_height="wrap_content"
17
            android:gravity="center_horizontal"
18
            android:orientation="vertical">
19
20
            <include layout="@layout/activity_topic_info_top" />
21
22
            <include layout="@layout/activity_topic_infos_content" />
23
        </LinearLayout>
24
    </com.electric.chargingpile.view.PullToZoomScrollView3>
25
26
27
</RelativeLayout>

+ 85 - 0
app/src/main/res/layout/activity_topic_info_top.xml

@ -0,0 +1,85 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="wrap_content"
5
    android:id="@+id/top_view">
6
7
    <RelativeLayout
8
        android:id="@+id/rl_title"
9
        android:layout_width="fill_parent"
10
        android:layout_height="44dp"
11
        android:background="@color/title_background" >
12
13
        <ImageView
14
            android:id="@+id/iv_back"
15
            android:layout_width="wrap_content"
16
            android:layout_height="match_parent"
17
            android:layout_alignParentLeft="true"
18
            android:layout_centerVertical="true"
19
            android:contentDescription="@null"
20
            android:paddingLeft="15dp"
21
            android:paddingRight="15dp"
22
            android:src="@drawable/icon_lvback1119" />
23
24
        <TextView
25
            android:id="@+id/textview"
26
            android:layout_width="match_parent"
27
            android:layout_height="match_parent"
28
            android:layout_centerInParent="true"
29
            android:layout_toRightOf="@+id/iv_back"
30
            android:layout_toLeftOf="@+id/textview_share"
31
            android:gravity="center"
32
            android:singleLine="true"
33
            android:ellipsize="end"
34
            android:text="@string/about_name"
35
            android:textColor="#222222"
36
            android:textSize="16sp" />
37
38
        <TextView
39
            android:id="@+id/textview_share"
40
            android:layout_width="wrap_content"
41
            android:layout_height="match_parent"
42
            android:layout_alignParentRight="true"
43
            android:gravity="center"
44
            android:padding="15dp"
45
            android:text="分享"
46
            android:textColor="#222222"
47
            android:textSize="15sp"/>
48
    </RelativeLayout>
49
    <!--<View-->
50
        <!--android:id="@+id/view_title"-->
51
        <!--android:layout_width="match_parent"-->
52
        <!--android:layout_height="0.5dp"-->
53
        <!---->
54
        <!--android:background="@color/ui_titleline" />-->
55
56
    <LinearLayout
57
        android:layout_width="match_parent"
58
        android:layout_height="101dp"
59
        android:layout_below="@+id/rl_title"
60
        android:orientation="horizontal"
61
        android:gravity="center_vertical">
62
        <ImageView
63
            android:id="@+id/user_avater"
64
            android:layout_width="71dp"
65
            android:layout_height="71dp"
66
            android:layout_marginLeft="15dp"
67
            />
68
        <TextView
69
            android:id="@+id/topic_title"
70
            android:layout_width="match_parent"
71
            android:layout_height="match_parent"
72
            android:layout_marginLeft="5dp"
73
            android:layout_marginRight="15dp"
74
            android:text="111111"
75
            android:gravity="center_vertical"
76
            android:maxLines="2"
77
            android:ellipsize="end"
78
            android:textSize="17sp"
79
            android:textColor="#222222"/>
80
81
    </LinearLayout>
82
83
    <!--</LinearLayout>-->
84
85
</RelativeLayout>

+ 128 - 0
app/src/main/res/layout/activity_topic_infos_content.xml

@ -0,0 +1,128 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:id="@+id/content_view"
6
    xmlns:app="http://schemas.android.com/apk/res-auto"
7
    android:orientation="vertical">
8
9
10
11
    <RelativeLayout
12
        android:layout_width="match_parent"
13
        android:layout_height="wrap_content"
14
        android:minHeight="51dp"
15
        android:orientation="horizontal">
16
        <TextView
17
            android:id="@+id/topic_content"
18
            android:layout_width="match_parent"
19
            android:layout_height="wrap_content"
20
            android:layout_marginLeft="15dp"
21
            android:layout_marginRight="15dp"
22
            android:text="111111"
23
            android:textSize="15sp"
24
            android:textColor="#555555"/>
25
26
        <ImageView
27
            android:id="@+id/user_content_more"
28
            android:layout_width="wrap_content"
29
            android:layout_height="wrap_content"
30
            android:layout_below="@+id/topic_content"
31
            android:layout_marginLeft="15dp"
32
            android:src="@drawable/app_show_more_content"
33
            android:layout_alignParentRight="true"
34
            android:visibility="gone"
35
            />
36
37
    </RelativeLayout>
38
39
    <LinearLayout
40
        android:layout_width="match_parent"
41
        android:layout_height="wrap_content"
42
        android:orientation="horizontal">
43
        <TextView
44
            android:layout_width="wrap_content"
45
            android:layout_height="wrap_content"
46
            android:layout_marginTop="13dp"
47
            android:layout_marginBottom="13dp"
48
            android:layout_marginLeft="15dp"
49
            android:text="阅读"
50
            android:textSize="12sp"
51
            android:textColor="#565656"/>
52
53
        <TextView
54
            android:id="@+id/read_data"
55
            android:layout_width="wrap_content"
56
            android:layout_height="wrap_content"
57
            android:layout_marginTop="13dp"
58
            android:layout_marginBottom="13dp"
59
            android:layout_marginLeft="5dp"
60
            android:text=""
61
            android:textSize="12sp"
62
            android:textColor="#565656"/>
63
64
        <TextView
65
            android:layout_width="wrap_content"
66
            android:layout_height="wrap_content"
67
            android:layout_marginTop="13dp"
68
            android:layout_marginBottom="13dp"
69
            android:layout_marginLeft="30dp"
70
            android:text="阅读"
71
            android:textSize="12sp"
72
            android:textColor="#565656"/>
73
74
        <TextView
75
            android:id="@+id/join_data"
76
            android:layout_width="wrap_content"
77
            android:layout_height="wrap_content"
78
            android:layout_marginTop="13dp"
79
            android:layout_marginBottom="13dp"
80
            android:layout_marginLeft="5dp"
81
            android:text="12"
82
            android:textSize="12sp"
83
            android:textColor="#565656"/>
84
    </LinearLayout>
85
86
    <View
87
        android:layout_width="match_parent"
88
        android:layout_height="10dp"
89
        android:background="@color/title_line"/>
90
91
    <LinearLayout
92
        android:id="@+id/ll_sort_view"
93
        android:layout_width="match_parent"
94
        android:layout_height="50dp"
95
        android:orientation="horizontal"
96
        android:gravity="center_vertical">
97
        <TextView
98
            android:id="@+id/sort_text_info"
99
            android:layout_width="wrap_content"
100
            android:layout_height="wrap_content"
101
            android:layout_marginTop="13dp"
102
            android:layout_marginBottom="13dp"
103
            android:layout_marginLeft="15dp"
104
            android:text="最热发布"
105
            android:textSize="12sp"
106
            android:textColor="#02b637"/>
107
108
        <ImageView
109
            android:layout_width="16dp"
110
            android:layout_height="16dp"
111
            android:layout_marginLeft="5dp"
112
            android:src="@drawable/app_topic_detaic_popup_icon"
113
            android:layout_alignParentRight="true"
114
            />
115
    </LinearLayout>
116
117
    <com.aspsine.irecyclerview.IRecyclerView
118
        android:id="@+id/recyclerView"
119
        android:layout_width="match_parent"
120
        android:layout_height="match_parent"
121
        app:loadMoreEnabled="true"
122
        app:refreshEnabled="false"
123
        app:loadMoreFooterLayout="@layout/layout_irecyclerview_load_more_footer"
124
        android:overScrollMode="never"
125
        />
126
127
128
</LinearLayout>

+ 4 - 0
app/src/main/res/layout/layout_irecyclerview_load_more_footer.xml

@ -0,0 +1,4 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<com.electric.chargingpile.view.footer.LoadMoreFooterView xmlns:android="http://schemas.android.com/apk/res/android"
3
                                              android:layout_width="match_parent"
4
                                              android:layout_height="48dp"/>

+ 8 - 0
app/src/main/res/layout/layout_irecyclerview_load_more_footer_error_view.xml

@ -0,0 +1,8 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:id="@+id/tvError"
4
    android:layout_width="match_parent"
5
    android:layout_height="36dp"
6
    android:gravity="center"
7
    android:layout_gravity="center"
8
    android:text="加载失败,请重试..." />

+ 23 - 0
app/src/main/res/layout/layout_irecyclerview_load_more_footer_loading_view.xml

@ -0,0 +1,23 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:id="@+id/full_view"
4
    android:layout_width="match_parent"
5
    android:layout_height="48dp"
6
    android:background="@color/color_white"
7
    android:gravity="center"
8
    android:orientation="horizontal">
9
<ProgressBar
10
    android:id="@+id/progressBar"
11
    android:indeterminateTint="#cecece"
12
    android:layout_width="20dp"
13
    android:layout_height="20dp"
14
    android:layout_gravity="center" />
15
16
    <TextView
17
        android:layout_width="wrap_content"
18
        android:layout_height="wrap_content"
19
        android:layout_marginLeft="10dp"
20
        android:text="加载中…"
21
        android:textSize="13sp"
22
        android:textColor="#565656"/>
23
</LinearLayout>

+ 9 - 0
app/src/main/res/layout/layout_irecyclerview_load_more_footer_the_end_view.xml

@ -0,0 +1,9 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:id="@+id/tvTheEnd"
4
    android:layout_width="match_parent"
5
    android:layout_height="48dp"
6
    android:gravity="center"
7
    android:text="已经显示全部了"
8
    android:layout_gravity="center"
9
    android:background="@color/color_white"/>

+ 17 - 0
app/src/main/res/layout/layout_irecyclerview_load_more_footer_view.xml

@ -0,0 +1,17 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<merge xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="48dp">
5
    <include
6
        android:id="@+id/theEndView"
7
        layout="@layout/layout_irecyclerview_load_more_footer_the_end_view" />
8
9
    <include
10
        android:id="@+id/errorView"
11
        layout="@layout/layout_irecyclerview_load_more_footer_error_view" />
12
13
    <include
14
        android:id="@+id/loadingView"
15
        layout="@layout/layout_irecyclerview_load_more_footer_loading_view" />
16
17
</merge>

+ 72 - 0
app/src/main/res/layout/topic_sort_popup_dialog.xml

@ -0,0 +1,72 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:orientation="vertical" android:layout_width="match_parent"
4
    android:layout_height="match_parent">
5
6
    <RelativeLayout
7
        android:layout_width="match_parent"
8
        android:layout_height="wrap_content"
9
        android:padding="5dp"
10
        android:background="@drawable/bg_popup_sort">
11
12
        <LinearLayout
13
            android:layout_width="match_parent"
14
            android:layout_height="wrap_content"
15
            android:padding="5dp"
16
            android:orientation="vertical">
17
18
            <TextView
19
                android:id="@+id/tv_1"
20
                android:layout_width="match_parent"
21
                android:layout_height="44dp"
22
                android:padding="5dp"
23
                android:gravity="center"
24
                android:text="最新发布"
25
                android:textSize="14sp"
26
                android:textColor="@color/lvse"/>
27
28
            <View
29
                android:layout_width="match_parent"
30
                android:layout_height="0.5dp"
31
                android:paddingLeft="5dp"
32
                android:paddingRight="5dp"
33
                android:background="@color/ui_6d"/>
34
35
36
            <TextView
37
                android:id="@+id/tv_2"
38
                android:layout_width="match_parent"
39
                android:layout_height="44dp"
40
                android:padding="5dp"
41
                android:gravity="center"
42
                android:text="最后回复"
43
                android:textSize="14sp"
44
                android:textColor="@color/ui_68"/>
45
46
            <View
47
                android:layout_width="match_parent"
48
                android:layout_height="0.5dp"
49
                android:paddingLeft="5dp"
50
                android:paddingRight="5dp"
51
                android:background="@color/ui_6d"/>
52
53
54
            <TextView
55
                android:id="@+id/tv_3"
56
                android:layout_width="match_parent"
57
                android:layout_height="44dp"
58
                android:padding="5dp"
59
                android:gravity="center"
60
                android:text="最热"
61
                android:textSize="14sp"
62
                android:textColor="@color/ui_68"/>
63
64
65
        </LinearLayout>
66
67
68
    </RelativeLayout>
69
    
70
71
72
</LinearLayout>