2"> 21 21
    public long targetId;
22 22
    public long addUserId;
23
    public int targetType;
23
    public int targetType; // 23:app_talk_video_icon 24:图文 25:话题
24 24
    public String title;
25 25
    public String name;
26 26
    public long addTime;
@ -34,11 +34,13 @@ public class TalkRecommendBean implements Serializable {
34 34
    public String topicName;
35 35
    public String content;
36 36
    public String shareUrl;
37
    public int likeNums;
38 37
    public int source;
39 38
    public String videoUrl;
40 39
    public int commentNums;
41 40
    public int isTop;
42
    public int likeFlg;
41
    public int likeFlg;     // 0:未点赞 1:已点赞
42
    public int likeNums;    // 点赞总数
43
    public int coverImgW;
44
    public int coverImgH;
43 45
44 46
}

+ 250 - 0
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -0,0 +1,250 @@
1
package com.electric.chargingpile.fragment;
2
3
import android.os.Bundle;
4
import android.support.v4.app.Fragment;
5
import android.support.v7.widget.RecyclerView;
6
import android.support.v7.widget.StaggeredGridLayoutManager;
7
import android.text.TextUtils;
8
import android.util.Log;
9
import android.view.LayoutInflater;
10
import android.view.View;
11
import android.view.ViewGroup;
12
import android.widget.ImageView;
13
import android.widget.LinearLayout;
14
import android.widget.Toast;
15
16
import com.andview.refreshview.XRefreshView;
17
import com.electric.chargingpile.R;
18
import com.electric.chargingpile.adapter.ChatRecommendAdapter;
19
import com.electric.chargingpile.adapter.ChatRecommendItemDecoration;
20
import com.electric.chargingpile.application.MainApplication;
21
import com.electric.chargingpile.data.ChatRecommendBean;
22
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
23
import com.electric.chargingpile.manager.ProfileManager;
24
import com.electric.chargingpile.util.JsonUtils;
25
import com.electric.chargingpile.util.NetUtil;
26
import com.electric.chargingpile.util.ToastUtil;
27
import com.zhy.http.okhttp.OkHttpUtils;
28
import com.zhy.http.okhttp.callback.StringCallback;
29
30
import java.util.ArrayList;
31
import java.util.HashMap;
32
import java.util.Map;
33
34
import okhttp3.Call;
35
36
public class ChatRecommendFragment extends Fragment implements View.OnClickListener {
37
    private static final String TAG = "ChatRecommendFragment";
38
    private View view;
39
    private XRefreshView refreshView;
40
    private ImageView iv_ask;
41
    private RecyclerView recyclerView;
42
    private ChatRecommendAdapter chatRecommendAdapter;
43
    private StaggeredGridLayoutManager layoutManager;
44
    private LinearLayout chat_share_info_remind;
45
    private boolean isFirst = false;
46
    private int page = 1;
47
48
    @Override
49
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
50
        view = inflater.inflate(R.layout.fragment_chat_recommend, null);
51
        initViews();
52
        initListener();
53
        return view;
54
    }
55
56
    private void initViews() {
57
        refreshView = view.findViewById(R.id.chat_x_refresh_view);
58
        refreshView.setPullLoadEnable(true);
59
        recyclerView = view.findViewById(R.id.recycler_view_test_rv);
60
        recyclerView.setHasFixedSize(true);
61
62
        iv_ask = view.findViewById(R.id.iv_ask);
63
        chat_share_info_remind = view.findViewById(R.id.chat_share_info_remind);
64
65
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
66
        if (TextUtils.isEmpty(isFirstComeIn)) {
67
            isFirst = true;
68
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
69
            chat_share_info_remind.setVisibility(View.VISIBLE);
70
        } else {
71
            chat_share_info_remind.setVisibility(View.GONE);
72
        }
73
74
        chatRecommendAdapter = new ChatRecommendAdapter(getActivity());
75
        layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
76
        layoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE);
77
        recyclerView.setItemAnimator(null);
78
        recyclerView.setLayoutManager(layoutManager);
79
        recyclerView.addItemDecoration(new ChatRecommendItemDecoration());
80
        // 静默加载模式不能设置footerview
81
        recyclerView.setAdapter(chatRecommendAdapter);
82
//        refreshView.setPinnedTime(1000);
83
//        refreshView.setMoveForHorizontal(true);
84
85
        refreshView.setXRefreshViewListener(new XRefreshView.SimpleXRefreshListener() {
86
            @Override
87
            public void onRefresh(boolean isPullDown) {
88
                page = 1;
89
                requestHeaderData();
90
            }
91
92
            @Override
93
            public void onLoadMore(boolean isSilence) {
94
                page++;
95
                requestData();
96
            }
97
        });
98
99
        refreshView.startRefresh();
100
        requestHeaderData(); // 该页面数据发起请求起点
101
102
        chatRecommendAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
103
            @Override
104
            public void onItemClickListener(int position, int type) {
105
                ToastUtil.showToast(getActivity().getApplicationContext(), "position:" + position + ",type:" + type, Toast.LENGTH_SHORT);
106
                final int pos = position - 1;
107
                final ArrayList<ChatRecommendBean> chatRecommendBeans = chatRecommendAdapter.getCurrentData();
108
109
                if (!NetUtil.CheckNetwork(getActivity())) {
110
                    Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_SHORT).show();
111
                    return;
112
                }
113
114
                if (type == 2) {
115
116
                }
117
118
                Log.d(TAG, "onItemClickListener: position:" + position + ",type:" + type);
119
            }
120
        });
121
    }
122
123
    private void initListener() {
124
        iv_ask.setOnClickListener(this);
125
        recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
126
            @Override
127
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
128
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
129
                    iv_ask.setVisibility(View.VISIBLE);
130
                    if (isFirst) {
131
                        chat_share_info_remind.setVisibility(View.VISIBLE);
132
                    }
133
                } else if (newState == RecyclerView.SCREEN_STATE_ON) {
134
                    iv_ask.setVisibility(View.GONE);
135
                    if (isFirst) {
136
                        chat_share_info_remind.setVisibility(View.GONE);
137
                    }
138
                }
139
            }
140
141
            @Override
142
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
143
                super.onScrolled(recyclerView, dx, dy);
144
            }
145
        });
146
    }
147
148
    @Override
149
    public void onClick(View view) {
150
        switch (view.getId()) {
151
            case R.id.iv_ask: // 推荐分享
152
                // TODO
153
                break;
154
        }
155
    }
156
157
158
    public void refreshList() {
159
        if (view == null)
160
            return;
161
        refreshView.startRefresh();
162
        page = 1;
163
        requestHeaderData();
164
    }
165
166
    private void requestHeaderData() {
167
        String url = MainApplication.urlNew + "/topic/list.do";
168
        Map<String, String> map = new HashMap<>();
169
        map.put("selected", "1");
170
        if (MainApplication.isLogin()) {
171
            map.put("user_id", MainApplication.userId);
172
        }
173
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
174
            @Override
175
            public void onError(Call call, Exception e) {
176
                if (page == 1) {
177
                    refreshView.stopRefresh();
178
                } else {
179
                    refreshView.stopLoadMore();
180
                }
181
                if (getActivity() != null) {
182
                    ToastUtil.showToast(getActivity().getApplicationContext(), "加载失败,请重试", Toast.LENGTH_SHORT);
183
                }
184
            }
185
186
            @Override
187
            public void onResponse(String response) {
188
                String rtnCode = JsonUtils.getKeyResult(response, "code");
189
                String rtnDesc = JsonUtils.getKeyResult(response, "desc");
190
                if ("1000".equals(rtnCode)) {
191
                    String rtnData = JsonUtils.getKeyResult(response, "data");
192
                    ArrayList<ChatRecommendBean> topicData = (ArrayList<ChatRecommendBean>) JsonUtils.parseToObjectList(rtnData, ChatRecommendBean.class);
193
                    chatRecommendAdapter.setHeaderData(topicData);
194
                    requestData();
195
                } else {
196
                    ToastUtil.showToast(getActivity().getApplicationContext(), rtnDesc, Toast.LENGTH_SHORT);
197
                }
198
            }
199
        });
200
    }
201
202
    private void requestData() {
203
        String url = MainApplication.urlNew + "/topic/info/list.do";
204
        Map<String, String> map = new HashMap<>();
205
        map.put("page", page + "");
206
        map.put("limit", "20");
207
208
        if (MainApplication.isLogin()) {
209
            map.put("user_id", MainApplication.userId);
210
        }
211
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
212
            @Override
213
            public void onError(Call call, Exception e) {
214
                if (page == 1) {
215
                    refreshView.stopRefresh();
216
                } else {
217
                    refreshView.stopLoadMore();
218
                }
219
                ToastUtil.showToast(getActivity().getApplicationContext(), "加载失败,请重试:" + e.getMessage(), Toast.LENGTH_SHORT);
220
            }
221
222
            @Override
223
            public void onResponse(String response) {
224
                if (page == 1) {
225
                    refreshView.stopRefresh();
226
                } else {
227
                    refreshView.stopLoadMore();
228
                }
229
                String rtnCode = JsonUtils.getKeyResult(response, "code");
230
                String rtnDesc = JsonUtils.getKeyResult(response, "desc");
231
                if ("1000".equals(rtnCode)) {
232
                    String rtnData = JsonUtils.getKeyResult(response, "data");
233
                    ArrayList<ChatRecommendBean> chatRecommendBeans = (ArrayList<ChatRecommendBean>) JsonUtils.parseToObjectList(rtnData, ChatRecommendBean.class);
234
                    if (page == 1) {
235
                        refreshView.setLoadComplete(false);
236
                        chatRecommendAdapter.setData(chatRecommendBeans);
237
                    } else {
238
                        chatRecommendAdapter.addData(chatRecommendBeans);
239
                    }
240
241
                    if (chatRecommendBeans.size() == 0) {
242
                        refreshView.setLoadComplete(true);
243
                    }
244
                } else {
245
                    ToastUtil.showToast(getActivity().getApplicationContext(), rtnDesc, Toast.LENGTH_SHORT);
246
                }
247
            }
248
        });
249
    }
250
}

+ 6 - 5
app/src/main/java/com/electric/chargingpile/fragment/QaActivityFragment.java

@ -16,6 +16,7 @@ import android.widget.ListView;
16 16
import android.widget.Toast;
17 17
18 18
import com.electric.chargingpile.R;
19
import com.electric.chargingpile.activity.ChatActivity;
19 20
import com.electric.chargingpile.activity.EditQuestionOneActivity;
20 21
import com.electric.chargingpile.activity.LoginActivity;
21 22
import com.electric.chargingpile.activity.TalkActivity;
@ -44,7 +45,7 @@ import pub.devrel.easypermissions.EasyPermissions;
44 45
/**
45 46
 * @author dxh
46 47
 * @date 2019/3/12
47
 * @deprecated 互动
48
 * 互动
48 49
 */
49 50
public class QaActivityFragment extends Fragment implements View.OnClickListener, EasyPermissions.PermissionCallbacks {
50 51
    private static final String TAG = "QaActivity";
@ -58,19 +59,19 @@ public class QaActivityFragment extends Fragment implements View.OnClickListener
58 59
    private long exitTime = 0;
59 60
    private static final int RC_CAMERA_PERM = 123;
60 61
    private View view;
61
    private TalkActivity talkActivity;
62
    private ChatActivity chatActivity;
62 63
63 64
    @Override
64 65
    public void onAttach(Context context) {
65 66
        super.onAttach(context);
66
        talkActivity = (TalkActivity) context;
67
        chatActivity = (ChatActivity) context;
67 68
    }
68 69
69 70
    @Override
70 71
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
71 72
                             Bundle savedInstanceState) {
72 73
        view = inflater.inflate(R.layout.activity_fram_qa, null);
73
        BarColorUtil.initStatusBarColor(talkActivity);
74
        BarColorUtil.initStatusBarColor(chatActivity);
74 75
        initViews();
75 76
        initListener();
76 77
        isRefresh = true;
@ -179,7 +180,7 @@ public class QaActivityFragment extends Fragment implements View.OnClickListener
179 180
                        datas.add(qadata.get(i));
180 181
                    }
181 182
                    if (isFirst) {
182
                        adapter = new QADataFramAdapter(datas, talkActivity);
183
                        adapter = new QADataFramAdapter(datas, chatActivity);
183 184
                        lv_info.setAdapter(adapter);
184 185
                        isFirst = false;
185 186
                    } else {

+ 6 - 7
app/src/main/java/com/electric/chargingpile/fragment/TalkRecommendFragment.java

@ -140,7 +140,7 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
140 140
//                            // 刷新完成必须调用此方法停止加载
141 141
//                            xRefreshView.stopLoadMore();
142 142
//                        }
143
//                    }
143
//                    }œ
144 144
//                }, 1000);
145 145
            }
146 146
        });
@ -300,7 +300,6 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
300 300
301 301
    private void requestData() {
302 302
        String url = MainApplication.urlNew + "/topic/info/list.do";
303
//        Log.e(TAG, "getQAData: "+url );
304 303
        Map<String, String> map = new HashMap<>();
305 304
        map.put("page", page + "");
306 305
        if (MainApplication.isLogin()) {
@ -318,12 +317,12 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
318 317
319 318
            @Override
320 319
            public void onResponse(String response) {
321
                if (page == 1)
320
                if (page == 1) {
322 321
                    xRefreshView.stopRefresh();
323
                else
322
                } else {
324 323
                    xRefreshView.setLoadComplete(true);
324
                }
325 325
326
                Log.e(TAG, "onResponse: " + response);
327 326
                String rtnCode = JsonUtils.getKeyResult(response, "code");
328 327
                if ("1000".equals(rtnCode)) {
329 328
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
@ -332,8 +331,8 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
332 331
                        layoutAdapter.setData(qadata);
333 332
                    else
334 333
                        layoutAdapter.addData(qadata);
335
                    Log.e(TAG, "onResponse: qadata" + qadata.size());
336
//                    Log.e(TAG, "onResponse01: "+datas.size() );
334
                    Log.d(TAG, "onResponsexxx:" + response);
335
                    Log.e(TAG, "onResponsexxx: qadata.size = " + qadata.size());
337 336
                } else if ("02".equals(rtnCode)) {
338 337
                    ToastUtil.showToast(getActivity().getApplicationContext(), "已经全部加载完毕", Toast.LENGTH_SHORT);
339 338
                }

+ 41 - 0
app/src/main/java/com/electric/chargingpile/view/ViewChatHeaderRecyclerView.java

@ -0,0 +1,41 @@
1
package com.electric.chargingpile.view;
2
3
import android.content.Context;
4
import android.support.annotation.Nullable;
5
import android.support.v4.view.ViewPager;
6
import android.support.v7.widget.RecyclerView;
7
import android.util.AttributeSet;
8
import android.util.Log;
9
import android.view.MotionEvent;
10
import android.view.ViewParent;
11
12
public class ViewChatHeaderRecyclerView extends RecyclerView {
13
    private static final String TAG = "ViewChatHeaderRecyclerV";
14
    private boolean interceptTouch = true;
15
16
    public ViewChatHeaderRecyclerView(Context context) {
17
        super(context);
18
    }
19
20
    public ViewChatHeaderRecyclerView(Context context, @Nullable AttributeSet attrs) {
21
        super(context, attrs);
22
    }
23
24
    public ViewChatHeaderRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
25
        super(context, attrs, defStyle);
26
    }
27
28
    @Override
29
    public boolean dispatchTouchEvent(MotionEvent ev) {
30
        // interceptTouch 是自定义属性控制是否拦截事件
31
        if (interceptTouch) { // 禁止ViewPager的滑动事件
32
            ViewParent parent = this;
33
            while (!((parent = parent.getParent()) instanceof ViewPager)) {
34
                // nop
35
            }
36
            parent.requestDisallowInterceptTouchEvent(true);
37
        }
38
39
        return super.dispatchTouchEvent(ev);
40
    }
41
}

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


+ 10 - 0
app/src/main/res/drawable-hdpi/corner_view.xml

@ -0,0 +1,10 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
    <solid android:color="#ffffff"></solid>
4
    <corners android:radius="4dp" />
5
    <padding
6
        android:bottom="1dp"
7
        android:left="3dp"
8
        android:right="3dp"
9
        android:top="1dp" />
10
</shape>

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


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


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


BIN
app/src/main/res/drawable-xhdpi/xh_s_btn_normal.9.png


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


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


+ 2 - 2
app/src/main/res/drawable/bg_yuan_black.xml

@ -3,8 +3,8 @@
3 3
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4 4
    <item>
5 5
        <shape>
6
            <stroke android:width="0.6dp" android:color="#000000" /><!--边框颜色-->
7
            <solid android:color="#000000" /><!--填充色-->
6
            <stroke android:width="0.6dp" android:color="#00000000" /><!--边框颜色-->
7
            <solid android:color="#80000000" /><!--填充色-->
8 8
            <corners android:radius="10dp" />
9 9
10 10
        </shape>

+ 264 - 0
app/src/main/res/layout/activity_chat.xml

@ -0,0 +1,264 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout 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
    tools:context=".activity.ChatActivity">
8
9
    <RelativeLayout
10
        android:id="@+id/act_bar"
11
        android:layout_width="match_parent"
12
        android:layout_height="44dp"
13
        android:background="@color/white">
14
15
        <LinearLayout
16
            android:layout_width="match_parent"
17
            android:layout_height="match_parent"
18
            android:layout_centerInParent="true"
19
            android:gravity="center"
20
            android:minWidth="100dp"
21
            android:orientation="horizontal">
22
23
            <TextView
24
                android:id="@+id/act_bar_title_recommend"
25
                android:layout_width="wrap_content"
26
                android:layout_height="match_parent"
27
                android:layout_centerInParent="true"
28
                android:gravity="center"
29
                android:paddingLeft="5dp"
30
                android:paddingRight="5dp"
31
                android:text="推荐"
32
                android:textColor="@color/ui_62"
33
                android:textSize="18sp" />
34
35
            <View
36
                android:layout_width="1dp"
37
                android:layout_height="15dp"
38
                android:background="@color/ui_6d" />
39
40
            <TextView
41
                android:id="@+id/act_bar_title_help"
42
                android:layout_width="wrap_content"
43
                android:layout_height="match_parent"
44
                android:gravity="center"
45
                android:paddingLeft="5dp"
46
                android:paddingRight="5dp"
47
                android:text="互助"
48
                android:textColor="@color/ui_68"
49
                android:textSize="18sp" />
50
51
        </LinearLayout>
52
53
        <TextView
54
            android:id="@+id/act_bar_help_question"
55
            android:layout_width="wrap_content"
56
            android:layout_height="match_parent"
57
            android:layout_alignParentRight="true"
58
            android:gravity="center"
59
            android:paddingLeft="15dp"
60
            android:paddingRight="15dp"
61
            android:text="待回答问题"
62
            android:textColor="@color/lvse"
63
            android:textSize="16sp" />
64
65
        <ImageView
66
            android:id="@+id/act_bar_help_search"
67
            android:layout_width="wrap_content"
68
            android:layout_height="wrap_content"
69
            android:layout_alignParentLeft="true"
70
            android:padding="15dp"
71
            android:src="@drawable/icon_qa_search" />
72
73
        <View
74
            android:id="@+id/act_bar_bottom_line"
75
            android:layout_width="match_parent"
76
            android:layout_height="0.5dp"
77
            android:layout_alignParentBottom="true"
78
            android:background="@color/ui_6d" />
79
    </RelativeLayout>
80
81
    <android.support.v4.view.ViewPager
82
        android:id="@+id/chat_view_pager"
83
        android:layout_width="match_parent"
84
        android:layout_height="match_parent"
85
        android:layout_above="@+id/ll_tab"
86
        android:layout_below="@+id/act_bar"
87
        android:background="@color/ui_f4" />
88
89
    <!-- 底部导航 -->
90
    <LinearLayout
91
        android:id="@+id/ll_tab"
92
        android:layout_width="match_parent"
93
        android:layout_height="49dp"
94
        android:layout_alignParentBottom="true"
95
        android:background="@color/white"
96
        android:orientation="horizontal"
97
        android:visibility="visible">
98
99
100
        <LinearLayout
101
            android:id="@+id/tab_main"
102
            android:layout_width="0dp"
103
            android:layout_height="match_parent"
104
            android:layout_weight="1"
105
            android:orientation="vertical">
106
107
            <ImageView
108
                android:id="@+id/iv_main"
109
                android:layout_width="wrap_content"
110
                android:layout_height="wrap_content"
111
                android:layout_gravity="center_horizontal"
112
                android:layout_marginTop="8dp"
113
                android:src="@drawable/icon_main_index" />
114
115
            <TextView
116
                android:id="@+id/tv_main"
117
                android:layout_width="wrap_content"
118
                android:layout_height="wrap_content"
119
                android:layout_gravity="center_horizontal"
120
                android:layout_marginTop="2dp"
121
                android:text="首页"
122
                android:textColor="@color/ui_64"
123
                android:textSize="10sp" />
124
125
        </LinearLayout>
126
127
        <LinearLayout
128
            android:id="@+id/tab_qa"
129
            android:layout_width="0dp"
130
            android:layout_height="match_parent"
131
            android:layout_weight="1"
132
            android:orientation="vertical">
133
134
            <ImageView
135
                android:layout_width="wrap_content"
136
                android:layout_height="wrap_content"
137
                android:layout_gravity="center_horizontal"
138
                android:layout_marginTop="8dp"
139
                android:src="@drawable/app_tab_chat_icon1" />
140
            <!--android:src="@drawable/icon_main_qa_selected" />-->
141
142
            <TextView
143
                android:layout_width="wrap_content"
144
                android:layout_height="wrap_content"
145
                android:layout_gravity="center_horizontal"
146
                android:layout_marginTop="2dp"
147
                android:text="@string/string_tab_qa"
148
                android:textColor="@color/ui_64"
149
                android:textSize="10sp" />
150
151
        </LinearLayout>
152
153
        <LinearLayout
154
            android:id="@+id/tab_screening"
155
            android:layout_width="0dp"
156
            android:layout_height="match_parent"
157
            android:layout_weight="1"
158
            android:orientation="vertical">
159
160
            <ImageView
161
                android:layout_width="wrap_content"
162
                android:layout_height="wrap_content"
163
                android:layout_gravity="center_horizontal"
164
                android:layout_marginTop="8dp"
165
                android:src="@drawable/icon_main_scan" />
166
167
            <TextView
168
                android:layout_width="wrap_content"
169
                android:layout_height="wrap_content"
170
                android:layout_gravity="center_horizontal"
171
                android:layout_marginTop="2dp"
172
                android:text="充电"
173
                android:textColor="@color/ui_64"
174
                android:textSize="10sp" />
175
176
        </LinearLayout>
177
178
        <RelativeLayout
179
            android:id="@+id/ll_tab_find"
180
            android:layout_width="0px"
181
            android:layout_height="match_parent"
182
            android:layout_weight="1">
183
184
            <ImageView
185
                android:id="@+id/iv_find"
186
                android:layout_width="wrap_content"
187
                android:layout_height="wrap_content"
188
                android:layout_centerHorizontal="true"
189
                android:layout_marginTop="8dp"
190
                android:src="@drawable/icon_main_find" />
191
192
            <ImageView
193
                android:id="@+id/iv_point"
194
                android:layout_width="wrap_content"
195
                android:layout_height="wrap_content"
196
                android:layout_alignTop="@+id/iv_find"
197
                android:layout_marginLeft="3dp"
198
                android:layout_toRightOf="@+id/iv_find"
199
                android:src="@drawable/icon_havemessage1201"
200
                android:visibility="gone" />
201
202
203
            <TextView
204
                android:id="@+id/tv_find"
205
                android:layout_width="wrap_content"
206
                android:layout_height="wrap_content"
207
                android:layout_below="@+id/iv_find"
208
                android:layout_centerHorizontal="true"
209
                android:layout_gravity="center_horizontal"
210
                android:layout_marginTop="2dp"
211
                android:text="发现"
212
                android:textColor="@color/ui_64"
213
                android:textSize="10sp" />
214
215
        </RelativeLayout>
216
217
        <LinearLayout
218
            android:id="@+id/tab_me"
219
            android:layout_width="0dp"
220
            android:layout_height="match_parent"
221
            android:layout_weight="1"
222
            android:orientation="vertical">
223
224
            <RelativeLayout
225
                android:id="@+id/rl_our_f"
226
                android:layout_width="wrap_content"
227
                android:layout_height="wrap_content"
228
                android:layout_gravity="center_horizontal"
229
                android:layout_marginTop="8dp">
230
231
                <ImageView
232
                    android:id="@+id/iv_our"
233
                    android:layout_width="wrap_content"
234
                    android:layout_height="wrap_content"
235
                    android:layout_centerInParent="true"
236
                    android:scaleType="centerInside"
237
                    android:src="@drawable/icon_tab_main_me" />
238
239
                <TextView
240
                    android:id="@+id/tv_msg_num"
241
                    android:layout_width="wrap_content"
242
                    android:layout_height="wrap_content"
243
                    android:layout_toRightOf="@+id/iv_our"
244
                    android:background="@drawable/bg_smallred"
245
                    android:gravity="center"
246
                    android:text="13"
247
                    android:textColor="@color/white"
248
                    android:textSize="9sp"
249
                    android:visibility="gone" />
250
            </RelativeLayout>
251
252
            <TextView
253
                android:layout_width="wrap_content"
254
                android:layout_height="wrap_content"
255
                android:layout_gravity="center_horizontal"
256
                android:layout_marginTop="2dp"
257
                android:text="我的"
258
                android:textColor="@color/ui_64"
259
                android:textSize="10sp" />
260
        </LinearLayout>
261
262
    </LinearLayout>
263
264
</RelativeLayout>

+ 1 - 0
app/src/main/res/layout/activity_talk.xml

@ -82,6 +82,7 @@
82 82
        android:layout_width="match_parent"
83 83
        android:layout_height="match_parent"
84 84
        android:layout_below="@+id/rl_title"
85
        android:background="#f4f4f4"
85 86
        android:layout_above="@+id/ll_tab"/>
86 87
87 88
    <LinearLayout

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

@ -7,7 +7,7 @@
7 7
        android:id="@+id/xrefreshview"
8 8
        android:layout_width="match_parent"
9 9
        android:layout_height="match_parent"
10
        android:background="#fff">
10
        android:background="@color/ui_f4">
11 11
12 12
        <android.support.v7.widget.RecyclerView
13 13
            android:id="@+id/recycler_view_test_rv"

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

@ -17,9 +17,9 @@
17 17
        android:scaleType="centerCrop" />
18 18

19 19
    <ImageView
20
        android:id="@+id/iv_header_mask"
21 20
        android:layout_width="match_parent"
22 21
        android:layout_height="match_parent"
22
        android:alpha="0.5"
23 23
        android:background="#000000" />
24 24

25 25
    <TextView

+ 34 - 21
app/src/main/res/layout/app_talk_item_recylerview.xml

@ -4,9 +4,10 @@
4 4
    android:id="@+id/card_view"
5 5
    android:layout_width="match_parent"
6 6
    android:layout_height="wrap_content"
7
    android:layout_margin="5dp"
8
    android:background="?android:attr/selectableItemBackground"
9
    android:minHeight="100dp"
7
    android:layout_marginLeft="5dp"
8
    android:layout_marginTop="10dp"
9
    android:layout_marginRight="5dp"
10
    android:background="#ffffff"
10 11
    android:paddingBottom="5dp">
11 12
12 13
    <RelativeLayout
@ -19,8 +20,7 @@
19 20
            android:id="@+id/info_bg_icon"
20 21
            android:layout_width="wrap_content"
21 22
            android:layout_height="wrap_content"
22
            android:minWidth="200dp"
23
            android:minHeight="160dp" />
23
            android:scaleType="fitXY" />
24 24
25 25
        <ImageView
26 26
            android:id="@+id/info_id_video_icon"
@ -28,6 +28,21 @@
28 28
            android:layout_height="wrap_content"
29 29
            android:layout_centerInParent="true"
30 30
            android:src="@drawable/app_talk_video_icon" />
31
32
        <ImageView
33
            android:id="@+id/topic_back"
34
            android:layout_width="match_parent"
35
            android:layout_height="match_parent"
36
            android:alpha="0.5"
37
            android:background="@color/black" />
38
39
        <TextView
40
            android:id="@+id/topic_title"
41
            android:layout_width="wrap_content"
42
            android:layout_height="wrap_content"
43
            android:layout_centerInParent="true"
44
            android:textColor="@color/white"
45
            android:textSize="14sp" />
31 46
    </RelativeLayout>
32 47
33 48
    <TextView
@ -35,16 +50,12 @@
35 50
        android:layout_width="wrap_content"
36 51
        android:layout_height="wrap_content"
37 52
        android:layout_alignRight="@+id/info_bg_icon_bg"
38
        android:layout_marginRight="10dp"
39 53
        android:layout_marginTop="10dp"
40
        android:paddingTop="1dp"
41
        android:paddingBottom="1dp"
42
        android:paddingLeft="2dp"
43
        android:paddingRight="2dp"
54
        android:layout_marginRight="10dp"
55
        android:background="@color/white"
44 56
        android:text="置顶"
45
        android:textSize="14sp"
46 57
        android:textColor="@color/color_fb9349"
47
        android:background="@color/white"/>
58
        android:textSize="14sp" />
48 59
49 60
    <TextView
50 61
        android:id="@+id/recycler_view_title"
@ -54,11 +65,11 @@
54 65
        android:layout_alignLeft="@+id/info_bg_icon_bg"
55 66
        android:layout_alignRight="@+id/info_bg_icon_bg"
56 67
        android:layout_marginBottom="16dp"
57
        android:paddingTop="11dp"
58
        android:paddingLeft="10dp"
59
        android:paddingRight="10dp"
60 68
        android:ellipsize="end"
61 69
        android:maxLines="3"
70
        android:paddingLeft="10dp"
71
        android:paddingTop="11dp"
72
        android:paddingRight="10dp"
62 73
        android:text="123"
63 74
        android:textColor="@color/color_222222"
64 75
        android:textSize="15sp" />
@ -82,18 +93,19 @@
82 93
83 94
            <ImageView
84 95
                android:id="@+id/recycler_view_zan_icon"
85
                android:layout_width="15dp"
86
                android:layout_height="13dp"
96
                android:layout_width="16dp"
97
                android:layout_height="16dp"
87 98
                android:layout_centerVertical="true"
88 99
                android:layout_marginRight="5dp"
89 100
                android:layout_toLeftOf="@+id/recycler_view_zan"
90 101
                android:background="@drawable/app_talk_main_list_zan_icon" />
102
91 103
            <TextView
92 104
                android:id="@+id/recycler_view_zan"
93 105
                android:layout_width="wrap_content"
94 106
                android:layout_height="wrap_content"
95 107
                android:layout_centerVertical="true"
96
                android:paddingRight="15dp"
108
                android:layout_marginRight="10dp"
97 109
                android:text="456"
98 110
                android:textColor="@color/color_888888"
99 111
                android:textSize="13sp" />
@ -104,18 +116,19 @@
104 116
            android:id="@+id/user_avater"
105 117
            android:layout_width="20dp"
106 118
            android:layout_height="20dp"
107
            android:layout_centerVertical="true"/>
119
            android:layout_centerVertical="true"
120
            android:layout_marginLeft="10dp" />
108 121
109 122
        <TextView
110 123
            android:id="@+id/user_avater_name"
111 124
            android:layout_width="match_parent"
112 125
            android:layout_height="wrap_content"
113 126
            android:layout_centerVertical="true"
114
            android:singleLine="true"
115
            android:ellipsize="end"
116 127
            android:layout_toLeftOf="@+id/recycler_view_zan_icon_view"
117 128
            android:layout_toRightOf="@+id/user_avater"
129
            android:ellipsize="end"
118 130
            android:paddingLeft="5dp"
131
            android:singleLine="true"
119 132
            android:text="456"
120 133
            android:textColor="@color/color_888888"
121 134
            android:textSize="13sp" />

+ 62 - 0
app/src/main/res/layout/fragment_chat_recommend.xml

@ -0,0 +1,62 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
4
    android:layout_width="match_parent"
5
    android:layout_height="match_parent">
6
    <com.andview.refreshview.XRefreshView
7
        android:id="@+id/chat_x_refresh_view"
8
        android:layout_width="match_parent"
9
        android:layout_height="match_parent">
10
        <android.support.v7.widget.RecyclerView
11
            android:id="@+id/recycler_view_test_rv"
12
            android:layout_width="match_parent"
13
            android:layout_height="match_parent"
14
            android:scrollbars="vertical" />
15
    </com.andview.refreshview.XRefreshView>
16
17
    <ImageView
18
        android:id="@+id/iv_ask"
19
        android:layout_width="wrap_content"
20
        android:layout_height="wrap_content"
21
        android:layout_alignParentRight="true"
22
        android:layout_alignParentBottom="true"
23
        android:layout_marginRight="15dp"
24
        android:layout_marginBottom="22dp"
25
        android:src="@drawable/app_share_talk_icon" />
26
27
    <LinearLayout
28
        android:id="@+id/chat_share_info_remind"
29
        android:layout_width="wrap_content"
30
        android:layout_height="40dp"
31
        android:layout_alignParentBottom="true"
32
        android:layout_marginBottom="24dp"
33
        android:layout_toLeftOf="@+id/iv_ask"
34
        android:gravity="center_vertical"
35
        android:orientation="horizontal"
36
        android:visibility="visible">
37
38
        <RelativeLayout
39
            android:layout_width="wrap_content"
40
            android:layout_height="match_parent"
41
            android:background="@drawable/bg_yuan_black">
42
43
            <TextView
44
                android:id="@+id/chat_share_info"
45
                android:layout_width="wrap_content"
46
                android:layout_height="match_parent"
47
                android:gravity="center"
48
                android:paddingLeft="10dp"
49
                android:paddingRight="10dp"
50
                android:text="分享内容获电币"
51
                android:textColor="@color/white" />
52
        </RelativeLayout>
53
54
55
        <ImageView
56
            android:layout_width="15dp"
57
            android:layout_height="15dp"
58
            android:layout_marginLeft="-5dp"
59
            android:alpha="0.5"
60
            android:src="@drawable/app_sanjiao_right" />
61
    </LinearLayout>
62
</RelativeLayout>

+ 12 - 0
app/src/main/res/layout/view_chat_header_recommend.xml

@ -0,0 +1,12 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    android:id="@+id/chat_header_linear_layout"
5
    android:layout_width="wrap_content"
6
    android:layout_height="wrap_content">
7
    <com.electric.chargingpile.view.ViewChatHeaderRecyclerView
8
        android:id="@+id/chat_header_recycler_view"
9
        android:layout_width="wrap_content"
10
        android:layout_height="wrap_content" />
11
12
</LinearLayout>

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

@ -0,0 +1,51 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    android:id="@+id/card_view"
5
    android:layout_width="94dp"
6
    android:layout_height="85dp"
7
    android:layout_marginTop="15dp"
8
    android:layout_marginBottom="15dp">
9
10
    <ImageView
11
        android:id="@+id/iv_header_bg"
12
        android:layout_width="match_parent"
13
        android:layout_height="match_parent"
14
        android:background="#44000000"
15
        android:minWidth="94dp"
16
        android:minHeight="85dp"
17
        android:scaleType="centerCrop" />
18
19
    <ImageView
20
        android:layout_width="match_parent"
21
        android:layout_height="match_parent"
22
        android:alpha="0.5"
23
        android:background="#000000" />
24
25
    <TextView
26
        android:id="@+id/header_title"
27
        android:layout_width="wrap_content"
28
        android:layout_height="wrap_content"
29
        android:ellipsize="end"
30
        android:maxLines="2"
31
        android:paddingLeft="5dp"
32
        android:paddingTop="5dp"
33
        android:paddingRight="5dp"
34
        android:text="1111"
35
        android:textColor="@color/white"
36
        android:textSize="12sp" />
37
38
    <TextView
39
        android:id="@+id/header_title_joinin"
40
        android:layout_width="wrap_content"
41
        android:layout_height="wrap_content"
42
        android:layout_alignBottom="@+id/iv_header_bg"
43
        android:layout_marginBottom="2dp"
44
        android:ellipsize="end"
45
        android:padding="5dp"
46
        android:singleLine="true"
47
        android:text="1111"
48
        android:textColor="@color/white"
49
        android:textSize="9sp" />
50
51
</RelativeLayout>

+ 136 - 0
app/src/main/res/layout/view_chat_recommend.xml

@ -0,0 +1,136 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
4
    android:id="@+id/card_view"
5
    android:layout_width="match_parent"
6
    android:layout_height="wrap_content"
7
    android:layout_marginBottom="10dp"
8
    android:background="#ffffff"
9
    android:paddingBottom="5dp">
10
11
    <RelativeLayout
12
        android:id="@+id/info_bg_icon_bg"
13
        android:layout_width="wrap_content"
14
        android:layout_height="wrap_content"
15
        android:gravity="center">
16
17
        <ImageView
18
            android:id="@+id/info_bg_icon"
19
            android:layout_width="wrap_content"
20
            android:layout_height="wrap_content"
21
            android:scaleType="fitXY" />
22
23
        <ImageView
24
            android:id="@+id/info_id_video_icon"
25
            android:layout_width="wrap_content"
26
            android:layout_height="wrap_content"
27
            android:layout_centerInParent="true"
28
            android:src="@drawable/app_talk_video_icon" />
29
30
        <ImageView
31
            android:id="@+id/topic_back"
32
            android:layout_width="match_parent"
33
            android:layout_height="match_parent"
34
            android:alpha="0.5"
35
            android:background="@color/black" />
36
37
        <TextView
38
            android:id="@+id/topic_title"
39
            android:layout_width="wrap_content"
40
            android:layout_height="wrap_content"
41
            android:layout_centerInParent="true"
42
            android:textColor="@color/white"
43
            android:textSize="14sp" />
44
    </RelativeLayout>
45
46
    <TextView
47
        android:id="@+id/is_top_view"
48
        android:layout_width="wrap_content"
49
        android:layout_height="wrap_content"
50
        android:layout_alignRight="@+id/info_bg_icon_bg"
51
        android:layout_marginTop="10dp"
52
        android:layout_marginRight="10dp"
53
        android:background="@color/white"
54
        android:text="置顶"
55
        android:textColor="@color/color_fb9349"
56
        android:textSize="14sp" />
57
58
    <TextView
59
        android:id="@+id/recycler_view_title"
60
        android:layout_width="wrap_content"
61
        android:layout_height="wrap_content"
62
        android:layout_below="@+id/info_bg_icon_bg"
63
        android:layout_alignLeft="@+id/info_bg_icon_bg"
64
        android:layout_alignRight="@+id/info_bg_icon_bg"
65
        android:layout_marginBottom="16dp"
66
        android:ellipsize="end"
67
        android:maxLines="3"
68
        android:paddingLeft="10dp"
69
        android:paddingTop="11dp"
70
        android:paddingRight="10dp"
71
        android:text="123"
72
        android:textColor="@color/ui_62"
73
        android:textSize="15sp" />
74
75
    <RelativeLayout
76
        android:id="@+id/bottom_view"
77
        android:layout_width="wrap_content"
78
        android:layout_height="wrap_content"
79
        android:layout_below="@+id/recycler_view_title"
80
        android:layout_alignLeft="@+id/info_bg_icon_bg"
81
        android:layout_alignRight="@+id/info_bg_icon_bg">
82
83
        <LinearLayout
84
            android:id="@+id/recycler_view_zan_icon_view"
85
            android:layout_width="wrap_content"
86
            android:layout_height="wrap_content"
87
            android:layout_alignParentRight="true"
88
            android:layout_centerVertical="true"
89
            android:gravity="center_vertical"
90
            android:orientation="horizontal">
91
92
            <ImageView
93
                android:id="@+id/recycler_view_zan_icon"
94
                android:layout_width="16dp"
95
                android:layout_height="16dp"
96
                android:layout_centerVertical="true"
97
                android:layout_marginRight="5dp"
98
                android:layout_toLeftOf="@+id/recycler_view_zan"
99
                android:background="@drawable/app_talk_main_list_zan_icon" />
100
101
            <TextView
102
                android:id="@+id/recycler_view_zan"
103
                android:layout_width="wrap_content"
104
                android:layout_height="wrap_content"
105
                android:layout_centerVertical="true"
106
                android:layout_marginRight="10dp"
107
                android:text="456"
108
                android:textColor="@color/ui_68"
109
                android:textSize="13sp" />
110
111
        </LinearLayout>
112
113
        <ImageView
114
            android:id="@+id/user_avater"
115
            android:layout_width="20dp"
116
            android:layout_height="20dp"
117
            android:layout_centerVertical="true"
118
            android:layout_marginLeft="10dp" />
119
120
        <TextView
121
            android:id="@+id/user_avater_name"
122
            android:layout_width="match_parent"
123
            android:layout_height="wrap_content"
124
            android:layout_centerVertical="true"
125
            android:layout_toLeftOf="@+id/recycler_view_zan_icon_view"
126
            android:layout_toRightOf="@+id/user_avater"
127
            android:ellipsize="end"
128
            android:paddingLeft="5dp"
129
            android:singleLine="true"
130
            android:text="456"
131
            android:textColor="@color/ui_68"
132
            android:textSize="13sp" />
133
134
    </RelativeLayout>
135
136
</RelativeLayout>

+ 2 - 1
videolibrary/picture_library/build.gradle

@ -21,7 +21,8 @@ android {
21 21
dependencies {
22 22
    compile 'com.android.support:appcompat-v7:26.1.0'
23 23
    compile 'com.android.support:recyclerview-v7:26.1.0'
24
    compile 'com.github.bumptech.glide:glide:4.1.1'
24
//    compile 'com.github.bumptech.glide:glide:4.1.1'
25
    compile 'com.github.bumptech.glide:glide:4.2.0'
25 26
    compile 'com.github.chrisbanes:PhotoView:1.3.0'
26 27
    compile 'io.reactivex.rxjava2:rxjava:2.0.5'
27 28
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'

cdzApp - Gogs: Go Git Service

充电桩app代码

dxh 06bd894653 init 7 anos atrás
..
KeyMacCDZ.jks 06bd894653 init 7 anos atrás