Parcourir la Source

下线话题处理

huyuguo 5 ans auparavant
Parent
commit
67341aa295
26 fichiers modifiés avec 166 ajouts et 45 suppressions
  1. 1 1
      app/build.gradle
  2. 1 0
      app/gradle.properties
  3. 28 6
      app/src/main/java/com/electric/chargingpile/activity/TopicDetailActivity.java
  4. 9 7
      app/src/main/java/com/electric/chargingpile/activity/UserPageActivity.java
  5. 11 12
      app/src/main/java/com/electric/chargingpile/adapter/TopicDetailAdapter.java
  6. 3 13
      app/src/main/java/com/electric/chargingpile/adapter/UserPageAdapter.java
  7. 4 4
      app/src/main/java/com/electric/chargingpile/application/MainApplication.java
  8. BIN
      app/src/main/res/drawable-hdpi/loading_icon.png
  9. BIN
      app/src/main/res/drawable-hdpi/topic_offline_icon.png
  10. BIN
      app/src/main/res/drawable-mdpi/loading_icon.png
  11. BIN
      app/src/main/res/drawable-mdpi/no_net_icon.png
  12. BIN
      app/src/main/res/drawable-mdpi/topic_offline_icon.png
  13. BIN
      app/src/main/res/drawable-xhdpi/loading_icon.png
  14. BIN
      app/src/main/res/drawable-xhdpi/no_net_icon.png
  15. BIN
      app/src/main/res/drawable-xhdpi/topic_offline_icon.png
  16. BIN
      app/src/main/res/drawable-xxhdpi/loading_icon.png
  17. BIN
      app/src/main/res/drawable-xxhdpi/no_net_icon.png
  18. BIN
      app/src/main/res/drawable-xxhdpi/topic_offline_icon.png
  19. BIN
      app/src/main/res/drawable-xxxhdpi/loading_icon.png
  20. BIN
      app/src/main/res/drawable-xxxhdpi/no_net_icon.png
  21. BIN
      app/src/main/res/drawable-xxxhdpi/topic_offline_icon.png
  22. 3 2
      app/src/main/res/layout/activity_chat_footer.xml
  23. 51 0
      app/src/main/res/layout/activity_no_net_img.xml
  24. 19 0
      app/src/main/res/layout/activity_topic_detail.xml
  25. 35 0
      app/src/main/res/layout/activity_topic_offline.xml
  26. 1 0
      app/src/main/res/values/color.xml

+ 1 - 1
app/build.gradle

122
    }
122
    }
123
123
124
    dexOptions {
124
    dexOptions {
125
        javaMaxHeapSize "4g"
125
        javaMaxHeapSize "5g"
126
    }
126
    }
127
//    repositories {
127
//    repositories {
128
//        mavenCentral()
128
//        mavenCentral()

+ 1 - 0
app/gradle.properties

17
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
# org.gradle.parallel=true
18
# org.gradle.parallel=true
19
#android.enableAapt2=false
19
#android.enableAapt2=false
20

+ 28 - 6
app/src/main/java/com/electric/chargingpile/activity/TopicDetailActivity.java

3
import android.content.Intent;
3
import android.content.Intent;
4
import android.os.Bundle;
4
import android.os.Bundle;
5
import android.support.annotation.Nullable;
5
import android.support.annotation.Nullable;
6
import android.support.constraint.ConstraintLayout;
6
import android.support.v7.app.AppCompatActivity;
7
import android.support.v7.app.AppCompatActivity;
7
import android.support.v7.widget.RecyclerView;
8
import android.support.v7.widget.RecyclerView;
8
import android.support.v7.widget.StaggeredGridLayoutManager;
9
import android.support.v7.widget.StaggeredGridLayoutManager;
21
import com.electric.chargingpile.data.TopicHomePageBean;
22
import com.electric.chargingpile.data.TopicHomePageBean;
22
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
23
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
23
import com.electric.chargingpile.manager.ProfileManager;
24
import com.electric.chargingpile.manager.ProfileManager;
25
import com.electric.chargingpile.util.BarColorUtil;
24
import com.electric.chargingpile.util.CommonParams;
26
import com.electric.chargingpile.util.CommonParams;
25
import com.electric.chargingpile.util.JsonUtils;
27
import com.electric.chargingpile.util.JsonUtils;
26
import com.electric.chargingpile.util.LoadingDialog;
28
import com.electric.chargingpile.util.LoadingDialog;
53
    public boolean isFirst = false;
55
    public boolean isFirst = false;
54
    private ImageView chatPublishTips;
56
    private ImageView chatPublishTips;
55
    private ImageView chatPublishIcon;
57
    private ImageView chatPublishIcon;
58
    private ConstraintLayout noNetView;
59
    private ConstraintLayout topicOfflineView;
56
60
57
    @Override
61
    @Override
58
    protected void onCreate(@Nullable Bundle savedInstanceState) {
62
    protected void onCreate(@Nullable Bundle savedInstanceState) {
62
        initListener();
66
        initListener();
63
67
64
        if (NetUtil.CheckNetwork(this)) {
68
        if (NetUtil.CheckNetwork(this)) {
65
            xRefreshView.startRefresh();
69
            loadingDialog.show();
66
            requestData("1");
70
            requestData("1");
67
        } else {
71
        } else {
68
            // TODO by hyg
72
            noNetView.setVisibility(View.VISIBLE);
69
        }
73
        }
70
    }
74
    }
71
75
72
    private void initView() {
76
    private void initView() {
77
        BarColorUtil.initStatusBarColor(TopicDetailActivity.this);
73
        topicId = getIntent().getLongExtra("topicId", 0);
78
        topicId = getIntent().getLongExtra("topicId", 0);
74
        loadingDialog = new LoadingDialog(TopicDetailActivity.this);
79
        loadingDialog = new LoadingDialog(TopicDetailActivity.this);
75
        loadingDialog.setCanceledOnTouchOutside(false);
80
        loadingDialog.setCanceledOnTouchOutside(false);
76
81
77
        titleTextView = findViewById(R.id.titleTextView);
82
        titleTextView = findViewById(R.id.titleTextView);
83
        noNetView = findViewById(R.id.noNetView);
84
        topicOfflineView = findViewById(R.id.topicOfflineView);
85
78
        xRefreshView = findViewById(R.id.xRefreshView);
86
        xRefreshView = findViewById(R.id.xRefreshView);
79
        xRefreshView.setPullLoadEnable(true); // 允许加载更多
87
        xRefreshView.setPullLoadEnable(true); // 允许加载更多
80
        xRefreshView.setPinnedTime(0);
88
        xRefreshView.setPinnedTime(0);
161
    private void initListener() {
169
    private void initListener() {
162
        findViewById(R.id.backImageView).setOnClickListener(this);
170
        findViewById(R.id.backImageView).setOnClickListener(this);
163
        findViewById(R.id.shareTextView).setOnClickListener(this);
171
        findViewById(R.id.shareTextView).setOnClickListener(this);
172
        findViewById(R.id.noNetTry).setOnClickListener(this);
164
    }
173
    }
165
174
166
    @Override
175
    @Override
180
                    ToastUtil.showToast(getApplicationContext().getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
189
                    ToastUtil.showToast(getApplicationContext().getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
181
                }
190
                }
182
                break;
191
                break;
192
            case R.id.noNetTry:
193
                if (NetUtil.CheckNetwork(TopicDetailActivity.this)) {
194
                    noNetView.setVisibility(View.GONE);
195
                    xRefreshView.startRefresh();
196
                    requestData("1");
197
                } else {
198
                    noNetView.setVisibility(View.VISIBLE);
199
                }
200
                break;
183
        }
201
        }
184
202
185
    }
203
    }
229
        Map<String, String> map = new HashMap<>();
247
        Map<String, String> map = new HashMap<>();
230
        map.put("topicId", topicId + "");
248
        map.put("topicId", topicId + "");
231
        map.put("sort", sort + "");              //   1:最新发布 2:最后回复 3:最热
249
        map.put("sort", sort + "");              //   1:最新发布 2:最后回复 3:最热
232
        map.put("init", init);                   //   0:只返回话题下内容列表 1:返回话题名等信息
250
        map.put("init", init);                      //   0:只返回话题下内容列表 1:返回话题名等信息
233
        map.put("page", page + "");
251
        map.put("page", page + "");
234
        map.put("limit", "20");
252
        map.put("limit", "20");
235
        CommonParams.addCommonParams(map);
253
        CommonParams.addCommonParams(map);
237
        OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
255
        OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
238
            @Override
256
            @Override
239
            public void onError(Call call, Exception e) {
257
            public void onError(Call call, Exception e) {
240
258
                loadingDialog.dismiss();
241
                ToastUtil.showToast(getApplicationContext(), "数据获取失败:" + e.getMessage(), Toast.LENGTH_SHORT);
259
                ToastUtil.showToast(getApplicationContext(), "数据获取失败:" + e.getMessage(), Toast.LENGTH_SHORT);
242
                if (page == 1) {
260
                if (page == 1) {
243
                    xRefreshView.stopRefresh();
261
                    xRefreshView.stopRefresh();
249
267
250
            @Override
268
            @Override
251
            public void onResponse(String res) {
269
            public void onResponse(String res) {
252
                // TODO by hyg no network
270
                loadingDialog.dismiss();
253
                String code = JsonUtils.getKeyResult(res, "code");
271
                String code = JsonUtils.getKeyResult(res, "code");
254
                String desc = JsonUtils.getKeyResult(res, "desc");
272
                String desc = JsonUtils.getKeyResult(res, "desc");
255
                if ("1000".equals(code)) {
273
                if ("1000".equals(code)) {
256
                    String data = JsonUtils.getKeyResult(res, "data");
274
                    String data = JsonUtils.getKeyResult(res, "data");
275
                    if ("{}".equals(data)) {
276
                        topicOfflineView.setVisibility(View.VISIBLE);
277
                        return;
278
                    }
257
                    TopicHomePageBean homePageBean = (TopicHomePageBean) JsonUtils.parseToObjectBean(data, TopicHomePageBean.class);
279
                    TopicHomePageBean homePageBean = (TopicHomePageBean) JsonUtils.parseToObjectBean(data, TopicHomePageBean.class);
258
                    if (page == 1) {
280
                    if (page == 1) {
259
                        xRefreshView.stopRefresh();
281
                        xRefreshView.stopRefresh();
260
                        xRefreshView.setLoadComplete(false);
282
                        xRefreshView.setLoadComplete(false);
261
                        topicDetailAdapter.setHeaderData(homePageBean.topicVo);
283
                        topicDetailAdapter.setHeaderData(homePageBean.topicVo);
262
                        topicDetailAdapter.setContentData(homePageBean.list);
284
                        topicDetailAdapter.setContentData(homePageBean.list);
263
264
                        if (homePageBean.list.size() == 0) {
285
                        if (homePageBean.list.size() == 0) {
286
                            xRefreshView.setLoadComplete(true);
265
                            topicDetailAdapter.setFooterData(true);
287
                            topicDetailAdapter.setFooterData(true);
266
                        } else {
288
                        } else {
267
                            topicDetailAdapter.setFooterData(false);
289
                            topicDetailAdapter.setFooterData(false);

+ 9 - 7
app/src/main/java/com/electric/chargingpile/activity/UserPageActivity.java

22
import com.electric.chargingpile.application.MainApplication;
22
import com.electric.chargingpile.application.MainApplication;
23
import com.electric.chargingpile.data.UserHomePageBean;
23
import com.electric.chargingpile.data.UserHomePageBean;
24
import com.electric.chargingpile.data.UserPageBeanLab;
24
import com.electric.chargingpile.data.UserPageBeanLab;
25
import com.electric.chargingpile.util.BarColorUtil;
25
import com.electric.chargingpile.util.CommonParams;
26
import com.electric.chargingpile.util.CommonParams;
26
import com.electric.chargingpile.util.JsonUtils;
27
import com.electric.chargingpile.util.JsonUtils;
27
import com.electric.chargingpile.util.LoadingDialog;
28
import com.electric.chargingpile.util.LoadingDialog;
72
73
73
    private void initView() {
74
    private void initView() {
74
        UserPageBeanLab.get(UserPageActivity.this).clear();
75
        UserPageBeanLab.get(UserPageActivity.this).clear();
75
76
        BarColorUtil.setStatusBarColor(UserPageActivity.this, getResources().getColor(R.color.color_1bb637), 1);
76
        loadingDialog = new LoadingDialog(UserPageActivity.this);
77
        loadingDialog = new LoadingDialog(UserPageActivity.this);
77
        loadingDialog.setCanceledOnTouchOutside(false);
78
        loadingDialog.setCanceledOnTouchOutside(false);
78
79
227
            @Override
228
            @Override
228
            public void onResponse(String s) {
229
            public void onResponse(String s) {
229
                loadingDialog.dismiss();
230
                loadingDialog.dismiss();
230
                if (page == 1) {
231
                    xRefreshView.stopRefresh();
232
                } else {
233
                    xRefreshView.stopLoadMore();
234
                }
235
236
                String code = JsonUtils.getKeyResult(s, "code");
231
                String code = JsonUtils.getKeyResult(s, "code");
237
                if ("1000".equals(code)) {
232
                if ("1000".equals(code)) {
238
                    String data = JsonUtils.getKeyResult(s, "data");
233
                    String data = JsonUtils.getKeyResult(s, "data");
249
                            userPageAdapter.setContentData(userHomePageBean.list);
244
                            userPageAdapter.setContentData(userHomePageBean.list);
250
                        }
245
                        }
251
                        userPageAdapter.setFooterData(false);
246
                        userPageAdapter.setFooterData(false);
247
                        xRefreshView.stopRefresh();
252
                    } else {
248
                    } else {
253
                        if (userHomePageBean.list.size() == 0) {
249
                        if (userHomePageBean.list.size() == 0) {
254
                            xRefreshView.setLoadComplete(true);
250
                            xRefreshView.setLoadComplete(true);
257
                            userPageAdapter.addContentData(userHomePageBean.list);
253
                            userPageAdapter.addContentData(userHomePageBean.list);
258
                            userPageAdapter.setFooterData(false);
254
                            userPageAdapter.setFooterData(false);
259
                        }
255
                        }
256
                        xRefreshView.stopLoadMore();
260
                    }
257
                    }
261
                } else {
258
                } else {
262
                    String desc = JsonUtils.getKeyResult(s, "desc");
259
                    String desc = JsonUtils.getKeyResult(s, "desc");
263
                    ToastUtil.showToast(UserPageActivity.this, desc, Toast.LENGTH_SHORT);
260
                    ToastUtil.showToast(UserPageActivity.this, desc, Toast.LENGTH_SHORT);
261
                    if (page == 1) {
262
                        xRefreshView.stopRefresh();
263
                    } else {
264
                        xRefreshView.stopLoadMore();
265
                    }
264
                }
266
                }
265
267
266
            }
268
            }

+ 11 - 12
app/src/main/java/com/electric/chargingpile/adapter/TopicDetailAdapter.java

2
2
3
import android.app.Activity;
3
import android.app.Activity;
4
import android.content.Context;
4
import android.content.Context;
5
import android.content.Intent;
5
import android.graphics.Rect;
6
import android.graphics.Rect;
6
import android.support.constraint.ConstraintLayout;
7
import android.support.constraint.ConstraintLayout;
7
import android.support.v7.widget.RecyclerView;
8
import android.support.v7.widget.RecyclerView;
16
17
17
import com.aspsine.irecyclerview.IViewHolder;
18
import com.aspsine.irecyclerview.IViewHolder;
18
import com.electric.chargingpile.R;
19
import com.electric.chargingpile.R;
20
import com.electric.chargingpile.activity.UserPageActivity;
19
import com.electric.chargingpile.application.MainApplication;
21
import com.electric.chargingpile.application.MainApplication;
20
import com.electric.chargingpile.data.ChatRecommendBean;
22
import com.electric.chargingpile.data.ChatRecommendBean;
21
import com.electric.chargingpile.data.TopicHomePageBean;
23
import com.electric.chargingpile.data.TopicHomePageBean;
290
        footerViewHolder.footerContainer.setVisibility(showFooter ? View.VISIBLE : View.GONE);
292
        footerViewHolder.footerContainer.setVisibility(showFooter ? View.VISIBLE : View.GONE);
291
293
292
        ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) footerViewHolder.footerView.getLayoutParams();
294
        ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) footerViewHolder.footerView.getLayoutParams();
293
        if (TopicDetailBeanLab.get(context).beans().size() == 0) {
294
            footerViewHolder.footTextView.setText("还没有任何内容哦,快来抢沙发~");
295
            params.height = DensityUtil.dip2px(context, (screenHeight - headerHeight - statusHeight) / 4);
296
            params.bottomMargin = 0;
295
296
        if (beanLab.beans().size() == 0) {
297
            params.height = DensityUtil.dip2px(context, 230);
298
            footerViewHolder.footTextView.setText("还没有任何内容哦,快来抢沙发~");
297
        } else {
299
        } else {
298
            footerViewHolder.footTextView.setText("已经全部加载完毕");
300
            footerViewHolder.footTextView.setText("已经全部加载完毕");
299
            params.height = DensityUtil.dip2px(context, 20);
301
            params.height = DensityUtil.dip2px(context, 20);
300
            params.bottomMargin = DensityUtil.dip2px(context, 10);
301
        }
302
303
        if (showFooter == false) {
304
            params.height = 0;
305
            params.bottomMargin = DensityUtil.dip2px(context, 10);
306
        }
302
        }
307
308
        footerViewHolder.footTextView.setLayoutParams(params);
303
        footerViewHolder.footTextView.setLayoutParams(params);
309
    }
304
    }
310
305
311
    private void showAuthorInfo(int position) {
306
    private void showAuthorInfo(int position) {
312
        // TODO
307
        ChatRecommendBean bean = beanLab.beans().get(position - 1);
308
        Intent intent = new Intent(context, UserPageActivity.class);
309
        intent.putExtra("targetUserId", bean.addUserId + "");
310
        context.startActivity(intent);
313
    }
311
    }
314
312
315
313
327
325
328
    public void setHeaderData(TopicHomePageBean.TopicVo bean) {
326
    public void setHeaderData(TopicHomePageBean.TopicVo bean) {
329
        topicVo = bean;
327
        topicVo = bean;
328
        notifyItemChanged(0);
330
    }
329
    }
331
330
332
    public void setFooterData(Boolean showFooter) {
331
    public void setFooterData(Boolean showFooter) {

+ 3 - 13
app/src/main/java/com/electric/chargingpile/adapter/UserPageAdapter.java

2
2
3
import android.app.Activity;
3
import android.app.Activity;
4
import android.content.Context;
4
import android.content.Context;
5
import android.graphics.Color;
6
import android.support.constraint.ConstraintLayout;
5
import android.support.constraint.ConstraintLayout;
7
import android.support.v7.widget.RecyclerView;
6
import android.support.v7.widget.RecyclerView;
8
import android.support.v7.widget.StaggeredGridLayoutManager;
7
import android.support.v7.widget.StaggeredGridLayoutManager;
94
93
95
    @Override
94
    @Override
96
    public int getItemCount() {
95
    public int getItemCount() {
97
        return beanLab.beans().size() + 1 ;
96
        return beanLab.beans().size() + 1;
98
    }
97
    }
99
98
100
    private void bindContentViewHolder(IViewHolder viewHolder, final int position) {
99
    private void bindContentViewHolder(IViewHolder viewHolder, final int position) {
165
        StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) footerViewHolder.footerContainer.getLayoutParams();
164
        StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) footerViewHolder.footerContainer.getLayoutParams();
166
        layoutParams.setFullSpan(true);
165
        layoutParams.setFullSpan(true);
167
        footerViewHolder.footerContainer.setVisibility(showFooter ? View.VISIBLE : View.GONE);
166
        footerViewHolder.footerContainer.setVisibility(showFooter ? View.VISIBLE : View.GONE);
168
169
        ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams)footerViewHolder.footerView.getLayoutParams();
170
        if (showFooter) {
171
            footerViewHolder.footTextView.setText("已经全部加载完毕");
172
            params.height = DensityUtil.dip2px(context, 20);
173
        } else {
174
            footerViewHolder.footTextView.setText("");
175
            params.height = 1;
176
        }
177
        footerViewHolder.footerView.setLayoutParams(params);
167
        footerViewHolder.footTextView.setText("已经全部加载完毕");
178
    }
168
    }
179
169
180
    /**
170
    /**
227
217
228
    public void setFooterData(Boolean showFooter) {
218
    public void setFooterData(Boolean showFooter) {
229
        this.showFooter = showFooter;
219
        this.showFooter = showFooter;
230
        notifyItemRangeChanged(beanLab.beans().size(), 1);
220
        notifyItemRangeChanged(getItemCount() - 1, 1);
231
    }
221
    }
232
}
222
}

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

73
    public static String firstPoint = "";
73
    public static String firstPoint = "";
74
    public static Boolean firstSsyd;
74
    public static Boolean firstSsyd;
75
    public static String password = "";
75
    public static String password = "";
76
//    public static String url = "http://59.110.68.162";// 充电桩测试环境
77
    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
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";// 一电正式环境
76
    public static String url = "http://59.110.68.162";// 充电桩测试环境
77
//    public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
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";// 一电正式环境
80
    public static String pic_url = "http:/s/cdz.evcharge.cc/zhannew/uploadfile/";
80
    public static String pic_url = "http:/s/cdz.evcharge.cc/zhannew/uploadfile/";
81
    //	public static String url = "https://cdz.d1ev.com";
81
    //	public static String url = "https://cdz.d1ev.com";
82
    public static String build_flag = "0";
82
    public static String build_flag = "0";

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


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


BIN
app/src/main/res/drawable-mdpi/loading_icon.png


BIN
app/src/main/res/drawable-mdpi/no_net_icon.png


BIN
app/src/main/res/drawable-mdpi/topic_offline_icon.png


BIN
app/src/main/res/drawable-xhdpi/loading_icon.png


BIN
app/src/main/res/drawable-xhdpi/no_net_icon.png


BIN
app/src/main/res/drawable-xhdpi/topic_offline_icon.png


BIN
app/src/main/res/drawable-xxhdpi/loading_icon.png


BIN
app/src/main/res/drawable-xxhdpi/no_net_icon.png


BIN
app/src/main/res/drawable-xxhdpi/topic_offline_icon.png


BIN
app/src/main/res/drawable-xxxhdpi/loading_icon.png


BIN
app/src/main/res/drawable-xxxhdpi/no_net_icon.png


BIN
app/src/main/res/drawable-xxxhdpi/topic_offline_icon.png


+ 3 - 2
app/src/main/res/layout/activity_chat_footer.xml

10
        android:id="@+id/footerView"
10
        android:id="@+id/footerView"
11
        android:layout_width="match_parent"
11
        android:layout_width="match_parent"
12
        android:layout_height="20dp"
12
        android:layout_height="20dp"
13
        android:layout_marginBottom="10dp"
13
        app:layout_constraintBottom_toBottomOf="parent"
14
        app:layout_constraintBottom_toBottomOf="parent"
14
        app:layout_constraintEnd_toEndOf="parent"
15
        app:layout_constraintEnd_toEndOf="parent"
15
        app:layout_constraintStart_toStartOf="parent"
16
        app:layout_constraintStart_toStartOf="parent"
17
18
18
        <TextView
19
        <TextView
19
            android:id="@+id/footTextView"
20
            android:id="@+id/footTextView"
20
            android:layout_width="match_parent"
21
            android:layout_height="match_parent"
21
            android:layout_width="wrap_content"
22
            android:layout_height="wrap_content"
22
            android:gravity="center"
23
            android:gravity="center"
23
            android:paddingLeft="30dp"
24
            android:paddingLeft="30dp"
24
            android:paddingRight="30dp"
25
            android:paddingRight="30dp"

+ 51 - 0
app/src/main/res/layout/activity_no_net_img.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:id="@+id/noNetView"
6
    android:layout_width="match_parent"
7
    android:layout_height="match_parent"
8
    android:background="#f4f4f4">
9
10
    <ImageView
11
        android:id="@+id/noNetIcon"
12
        android:layout_width="wrap_content"
13
        android:layout_height="wrap_content"
14
        android:layout_marginTop="90dp"
15
        android:src="@drawable/no_net_icon"
16
        app:layout_constraintEnd_toEndOf="parent"
17
        app:layout_constraintStart_toStartOf="parent"
18
        app:layout_constraintTop_toTopOf="parent" />
19
20
    <TextView
21
        android:id="@+id/noNetLabel"
22
        android:layout_width="wrap_content"
23
        android:layout_height="wrap_content"
24
        android:layout_marginStart="15dp"
25
        android:layout_marginTop="10dp"
26
        android:layout_marginEnd="15dp"
27
        android:text="小主网络跑掉了,请检查网络~"
28
        android:textColor="#555555"
29
        android:textSize="14sp"
30
        app:layout_constraintEnd_toEndOf="parent"
31
        app:layout_constraintStart_toStartOf="parent"
32
        app:layout_constraintTop_toBottomOf="@+id/noNetIcon" />
33
34
    <TextView
35
        android:id="@+id/noNetTry"
36
        android:layout_width="144dp"
37
        android:layout_height="40dp"
38
        android:layout_marginStart="15dp"
39
        android:layout_marginTop="20dp"
40
        android:layout_marginEnd="15dp"
41
        android:background="@drawable/bg_route_line_818181"
42
        android:gravity="center"
43
        android:text="点击重新尝试"
44
        android:textColor="#555555"
45
46
        android:textSize="14sp"
47
        app:layout_constraintEnd_toEndOf="parent"
48
        app:layout_constraintStart_toStartOf="parent"
49
        app:layout_constraintTop_toBottomOf="@+id/noNetLabel" />
50
51
</android.support.constraint.ConstraintLayout>

+ 19 - 0
app/src/main/res/layout/activity_topic_detail.xml

96
        app:layout_constraintRight_toLeftOf="@+id/chatPublishIcon"
96
        app:layout_constraintRight_toLeftOf="@+id/chatPublishIcon"
97
        app:layout_constraintTop_toTopOf="@+id/chatPublishIcon" />
97
        app:layout_constraintTop_toTopOf="@+id/chatPublishIcon" />
98
98
99
    <include
100
        layout="@layout/activity_no_net_img"
101
        android:layout_width="0dp"
102
        android:layout_height="0dp"
103
        android:visibility="gone"
104
        app:layout_constraintBottom_toBottomOf="parent"
105
        app:layout_constraintLeft_toLeftOf="parent"
106
        app:layout_constraintRight_toRightOf="parent"
107
        app:layout_constraintTop_toBottomOf="@+id/navBar" />
108
109
    <include
110
        layout="@layout/activity_topic_offline"
111
        android:layout_width="0dp"
112
        android:layout_height="0dp"
113
        android:visibility="gone"
114
        app:layout_constraintBottom_toBottomOf="parent"
115
        app:layout_constraintLeft_toLeftOf="parent"
116
        app:layout_constraintRight_toRightOf="parent"
117
        app:layout_constraintTop_toBottomOf="@+id/navBar" />
99
118
100
</android.support.constraint.ConstraintLayout>
119
</android.support.constraint.ConstraintLayout>

+ 35 - 0
app/src/main/res/layout/activity_topic_offline.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:id="@+id/topicOfflineView"
8
    android:background="#f4f4f4">
9
10
    <ImageView
11
        android:id="@+id/imageView6"
12
        android:layout_width="wrap_content"
13
        android:layout_height="wrap_content"
14
        android:layout_marginStart="15dp"
15
        android:layout_marginTop="115dp"
16
        android:layout_marginEnd="15dp"
17
        app:layout_constraintEnd_toEndOf="parent"
18
        app:layout_constraintStart_toStartOf="parent"
19
        app:layout_constraintTop_toTopOf="parent"
20
        app:srcCompat="@drawable/topic_offline_icon" />
21
22
    <TextView
23
        android:id="@+id/textView26"
24
        android:layout_width="wrap_content"
25
        android:layout_height="wrap_content"
26
        android:layout_marginStart="15dp"
27
        android:layout_marginTop="10dp"
28
        android:layout_marginEnd="15dp"
29
        android:text="该话题已经下线,别处转转,有更多惊喜"
30
        android:textColor="#555555"
31
        android:textSize="14sp"
32
        app:layout_constraintEnd_toEndOf="parent"
33
        app:layout_constraintStart_toStartOf="parent"
34
        app:layout_constraintTop_toBottomOf="@+id/imageView6" />
35
</android.support.constraint.ConstraintLayout>

+ 1 - 0
app/src/main/res/values/color.xml

169
    <color name="color_ff6600">#ff6600</color>
169
    <color name="color_ff6600">#ff6600</color>
170
    <color name="color_888888">#888888</color>
170
    <color name="color_888888">#888888</color>
171
    <color name="color_fb9349">#fb9349</color>
171
    <color name="color_fb9349">#fb9349</color>
172
    <color name="color_1bb637">#1bb637</color>
172

173

173
    <color name="sv_black">#FF000000</color>
174
    <color name="sv_black">#FF000000</color>
174
    <color name="sv_white">#FFFFFF</color>
175
    <color name="sv_white">#FFFFFF</color>