7
import android.util.Log;
8 6
import android.view.LayoutInflater;
9 7
import android.view.View;
10 8
import android.view.ViewGroup;
@ -18,14 +16,12 @@ import com.electric.chargingpile.R;
18 16
import com.electric.chargingpile.activity.LoginActivity;
19 17
import com.electric.chargingpile.activity.MainMapActivity;
20 18
import com.electric.chargingpile.adapter.MonthListAdapter;
21
import com.electric.chargingpile.adapter.PingLunAdapter;
22 19
import com.electric.chargingpile.application.MainApplication;
23 20
import com.electric.chargingpile.data.MyOtto;
24 21
import com.electric.chargingpile.data.RankinglistRefreshEvent;
25 22
import com.electric.chargingpile.util.DES3;
26 23
import com.electric.chargingpile.util.JsonUtils;
27 24
import com.electric.chargingpile.util.LoadingDialog;
28
import com.electric.chargingpile.util.PicassoUtil;
29 25
import com.electric.chargingpile.util.ToastUtil;
30 26
import com.electric.chargingpile.util.Util;
31 27
import com.electric.chargingpile.view.CircleImageView;
@ -41,7 +37,6 @@ import org.json.JSONObject;
41 37
import java.net.URLEncoder;
42 38
import java.util.ArrayList;
43 39
44
import de.greenrobot.event.EventBus;
45 40
import okhttp3.Call;
46 41
47 42
public class MonthListFragment extends Fragment {

+ 17 - 2
app/src/main/java/com/electric/chargingpile/fragment/SvVideoShowView.java

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.fragment;
2 2
3 3
import android.app.Activity;
4
import android.net.Uri;
4 5
import android.text.TextUtils;
5 6
import android.util.Log;
6 7
import android.view.LayoutInflater;
@ -17,6 +18,7 @@ import com.electric.chargingpile.data.TalkRecommendBean;
17 18
import com.electric.chargingpile.util.CircleTransform;
18 19
import com.electric.chargingpile.util.JsonUtils;
19 20
import com.electric.chargingpile.util.ToastUtil;
21
import com.electric.chargingpile.view.UpVideoView2;
20 22
import com.electric.chargingpile.view.VideoCommentDialog;
21 23
import com.electric.chargingpile.view.VideoPubilshDialog;
22 24
import com.squareup.picasso.Picasso;
@ -36,6 +38,7 @@ public class SvVideoShowView implements View.OnClickListener {
36 38
    private View view;
37 39
    private ViewGroup viewGroup;
38 40
    private TalkRecommendBean talkRecommendBean;
41
    private UpVideoView2 upVideoView2;
39 42
40 43
41 44
    private LinearLayout sv_show_forward, sv_show_comment_count_ll, sv_show_like_ll,
@ -144,6 +147,16 @@ public class SvVideoShowView implements View.OnClickListener {
144 147
                    .into(sv_show_user_avatar);
145 148
        }
146 149
150
        if (talkRecommendBean.targetType == 23) {
151
            String videoUrl = talkRecommendBean.videoUrl;
152
            videoUrl = "http://uprocess.b0.upaiyun.com/demo/short_video/UPYUN_0.flv";
153
            if (!TextUtils.isEmpty(videoUrl)) {
154
                upVideoView2.setVideoPath(videoUrl);
155
            }
156
        } else if (talkRecommendBean.targetType == 24) {
157
158
        }
159
147 160
        if (talkRecommendBean.likeFlg == 1) {
148 161
//            sv_show_like_img  like
149 162
        } else {
@ -221,7 +234,7 @@ public class SvVideoShowView implements View.OnClickListener {
221 234
    }
222 235
223 236
    private void initPlayer(View view) {
224
237
        upVideoView2 = view.findViewById(R.id.view_show_video);
225 238
    }
226 239
227 240
    private void initZoomPhoto(View view) {
@ -259,7 +272,9 @@ public class SvVideoShowView implements View.OnClickListener {
259 272
    }
260 273
261 274
    public void onDestroy() {
262
275
        if (upVideoView2 != null) {
276
            upVideoView2.release(true);
277
        }
263 278
//释放播放资源
264 279
    }
265 280

+ 0 - 5
app/src/main/java/com/electric/chargingpile/fragment/TotalListFragment.java

@ -12,19 +12,15 @@ import android.widget.ListView;
12 12
import android.widget.RelativeLayout;
13 13
import android.widget.TextView;
14 14
15
import com.alipay.security.mobile.module.commonutils.LOG;
16
import com.bumptech.glide.Glide;
17 15
import com.electric.chargingpile.R;
18 16
import com.electric.chargingpile.activity.LoginActivity;
19 17
import com.electric.chargingpile.activity.MainMapActivity;
20
import com.electric.chargingpile.adapter.MonthListAdapter;
21 18
import com.electric.chargingpile.adapter.TotalListAdapter;
22 19
import com.electric.chargingpile.application.MainApplication;
23 20
import com.electric.chargingpile.data.MyOtto;
24 21
import com.electric.chargingpile.data.RankinglistRefreshEvent;
25 22
import com.electric.chargingpile.util.DES3;
26 23
import com.electric.chargingpile.util.JsonUtils;
27
import com.electric.chargingpile.util.PicassoUtil;
28 24
import com.electric.chargingpile.util.Util;
29 25
import com.electric.chargingpile.view.CircleImageView;
30 26
import com.squareup.otto.Subscribe;
@ -39,7 +35,6 @@ import org.json.JSONObject;
39 35
import java.net.URLEncoder;
40 36
import java.util.ArrayList;
41 37
42
import de.greenrobot.event.EventBus;
43 38
import okhttp3.Call;
44 39
45 40
public class TotalListFragment extends Fragment {

+ 5 - 1
app/src/main/java/com/electric/chargingpile/view/VideoCommentDialog.java

@ -4,6 +4,7 @@ import android.app.Dialog;
4 4
import android.content.Context;
5 5
import android.graphics.Color;
6 6
import android.os.Bundle;
7
import android.support.v7.widget.LinearLayoutManager;
7 8
import android.support.v7.widget.RecyclerView;
8 9
import android.text.Editable;
9 10
import android.text.TextUtils;
@ -141,6 +142,9 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
141 142
        showCommentLv = convertView.findViewById(R.id.show_comment_lv);
142 143
        showCommentEd = convertView.findViewById(R.id.show_comment_ed);
143 144
        showCommentPublish = convertView.findViewById(R.id.show_comment_publish);
145
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
146
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
147
        showCommentLv.setLayoutManager(linearLayoutManager);
144 148
        convertView.findViewById(R.id.show_comment_network_retry).setOnClickListener(this);
145 149
        show_comment_progress_ll.setVisibility(View.VISIBLE);
146 150
        showCommentPublish.addTextChangedListener(new TextWatcher() {
@ -212,7 +216,7 @@ public class VideoCommentDialog extends Dialog implements View.OnClickListener {
212 216
        }
213 217
214 218
        OkHttpUtils
215
                .get()
219
                .post()
216 220
                .params(map)
217 221
                .url(url)
218 222
                .build()

+ 9 - 8
app/src/main/res/layout/item_show_comment.xml

@ -1,15 +1,14 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    android:layout_width="match_parent"
4
    android:layout_height="wrap_content"
5
    android:layout_marginTop="20dp">
4
    android:layout_height="wrap_content">
6 5
7 6
    <LinearLayout
8 7
        android:id="@+id/item_user_comment_like"
9 8
        android:layout_width="wrap_content"
10 9
        android:layout_height="18dp"
11 10
        android:layout_alignParentEnd="true"
12
        android:layout_marginTop="3dp"
11
        android:layout_marginTop="23dp"
13 12
        android:layout_marginEnd="19dp"
14 13
        android:gravity="center_vertical">
15 14
@ -17,7 +16,7 @@
17 16
            android:id="@+id/item_user_like_img"
18 17
            android:layout_width="18dp"
19 18
            android:layout_height="18dp"
20
            android:background="#fff" />
19
            android:background="@drawable/icon_likeed" />
21 20
22 21
        <TextView
23 22
            android:id="@+id/item_user_like_count"
@ -35,8 +34,7 @@
35 34
        android:layout_width="20dp"
36 35
        android:layout_height="20dp"
37 36
        android:layout_marginStart="15dp"
38
        android:layout_marginTop="6dp"
39
        android:background="#3df" />
37
        android:layout_marginTop="26dp" />
40 38
41 39
42 40
    <TextView
@ -44,6 +42,7 @@
44 42
        android:layout_width="wrap_content"
45 43
        android:layout_height="wrap_content"
46 44
        android:layout_marginStart="5dp"
45
        android:layout_marginTop="20dp"
47 46
        android:layout_toEndOf="@+id/item_user_avatar"
48 47
        android:text="12sp12sp12sp"
49 48
        android:textColor="#fff"
@ -77,6 +76,7 @@
77 76
        android:id="@+id/item_user_operation"
78 77
        android:layout_width="wrap_content"
79 78
        android:layout_height="22dp"
79
80 80
        android:layout_below="@+id/item_user_con"
81 81
        android:layout_alignStart="@+id/item_user_name"
82 82
        android:layout_marginTop="10dp"
@ -95,7 +95,7 @@
95 95
                android:layout_width="16dp"
96 96
                android:layout_height="16dp"
97 97
                android:layout_marginStart="9dp"
98
                android:background="#fff" />
98
                android:background="@drawable/icon_comment" />
99 99
100 100
            <TextView
101 101
                android:id="@+id/item_user_report_count"
@ -116,7 +116,8 @@
116 116
            android:gravity="center"
117 117
            android:text="删除"
118 118
            android:textColor="#c2c2c2"
119
            android:textSize="12sp" />
119
            android:textSize="12sp"
120
            android:visibility="gone" />
120 121
    </LinearLayout>
121 122
122 123
    <View

+ 5 - 0
app/src/main/res/layout/view_show_view.xml

@ -8,6 +8,11 @@
8 8
        android:layout_height="match_parent"
9 9
        android:background="#fff0" />
10 10
11
    <com.electric.chargingpile.view.UpVideoView2
12
        android:id="@+id/view_show_video"
13
        android:layout_width="match_parent"
14
        android:layout_height="match_parent"></com.electric.chargingpile.view.UpVideoView2>
15
11 16
    <include layout="@layout/view_show_bottom" />
12 17
13 18
</RelativeLayout>

首页分享图标优化 · e85f381d0b - Gogs: Go Git Service
浏览代码

首页分享图标优化

huyuguo 5 年之前
父节点
当前提交
e85f381d0b

二进制
app/.DS_Store


+ 9 - 0
app/src/main/java/com/electric/chargingpile/adapter/ChatRecommendAdapter.java

@ -234,6 +234,15 @@ public class ChatRecommendAdapter extends RecyclerView.Adapter<IViewHolder> {
234 234
            } else {
235 235
                contentViewHolder.likeNum.setVisibility(View.GONE);
236 236
            }
237
238
            contentViewHolder.image_video_item.setOnClickListener(new View.OnClickListener() {
239
                @Override
240
                public void onClick(View view) {
241
                    if (onRecyclerItemClickListener != null) {
242
                        onRecyclerItemClickListener.onItemClickListener(position, 1);
243
                    }
244
                }
245
            });
237 246
        }
238 247
239 248
    }

+ 0 - 32
app/src/main/java/com/electric/chargingpile/adapter/ChatRecommendItemDecoration.java

@ -1,32 +0,0 @@
1
package com.electric.chargingpile.adapter;
2
3
import android.graphics.Rect;
4
import android.support.v7.widget.RecyclerView;
5
import android.support.v7.widget.StaggeredGridLayoutManager;
6
import android.util.Log;
7
import android.view.View;
8
9
import com.electric.chargingpile.util.DensityUtil;
10
11
public class ChatRecommendItemDecoration extends RecyclerView.ItemDecoration {
12
    private static final String TAG = "ChatRecommendItemDecoration";
13
    private StaggeredGridLayoutManager.LayoutParams layoutParams;
14
15
    @Override
16
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
17
        layoutParams = (StaggeredGridLayoutManager.LayoutParams)view.getLayoutParams();
18
19
        int position = parent.getChildAdapterPosition(view);
20
        Log.d(TAG, "getItemOffsets: " + position + view.getClass() + ":" + parent.getClass());
21
        if (position > 0) {
22
            if (layoutParams.getSpanIndex() %2 == 0) {
23
                outRect.left = DensityUtil.dip2px(view.getContext(), 15);
24
                outRect.right = DensityUtil.dip2px(view.getContext(), 5);
25
            } else {
26
                outRect.right = DensityUtil.dip2px(view.getContext(), 15);
27
                outRect.left = DensityUtil.dip2px(view.getContext(), 5);
28
            }
29
        }
30
31
    }
32
}

+ 36 - 46
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -7,7 +7,6 @@ import android.support.v4.app.Fragment;
7 7
import android.support.v7.widget.RecyclerView;
8 8
import android.support.v7.widget.StaggeredGridLayoutManager;
9 9
import android.text.TextUtils;
10
import android.util.Log;
11 10
import android.view.LayoutInflater;
12 11
import android.view.View;
13 12
import android.view.ViewGroup;
@ -22,7 +21,6 @@ import com.electric.chargingpile.activity.PublishItemsActivity;
22 21
import com.electric.chargingpile.activity.TopicDetailActivity;
23 22
import com.electric.chargingpile.activity.VideoDetaislActivity;
24 23
import com.electric.chargingpile.adapter.ChatRecommendAdapter;
25
import com.electric.chargingpile.adapter.ChatRecommendItemDecoration;
26 24
import com.electric.chargingpile.adapter.TopicDetailAdapter;
27 25
import com.electric.chargingpile.application.MainApplication;
28 26
import com.electric.chargingpile.data.ChatBeanLab;
@ -37,9 +35,18 @@ import com.electric.chargingpile.util.ToastUtil;
37 35
import com.zhy.http.okhttp.OkHttpUtils;
38 36
import com.zhy.http.okhttp.callback.StringCallback;
39 37
38
import java.io.Serializable;
40 39
import java.util.ArrayList;
41 40
import java.util.HashMap;
41
import java.util.List;
42 42
import java.util.Map;
43
44
import io.reactivex.Observable;
45
import io.reactivex.android.schedulers.AndroidSchedulers;
46
import io.reactivex.disposables.Disposable;
47
import io.reactivex.functions.Consumer;
48
import io.reactivex.functions.Predicate;
49
import io.reactivex.schedulers.Schedulers;
43 50
import okhttp3.Call;
44 51
45 52
public class ChatRecommendFragment extends Fragment implements View.OnClickListener {
@ -118,52 +125,35 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
118 125
                    return;
119 126
                }
120 127
121
                if (type == 2) {
122 128
123
                }
129
                final List<ChatRecommendBean> beans = ChatBeanLab.get(getContext()).beans();
130
                ChatRecommendBean bean = beans.get(position - 1);
131
                Disposable disposable = Observable.fromIterable(beans).filter(new Predicate<ChatRecommendBean>() {
132
                    @Override
133
                    public boolean test(ChatRecommendBean chatRecommendBean) throws Exception {
134
                        return chatRecommendBean.targetType != 25;
135
                    }
136
                }).toList().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<List<ChatRecommendBean>>() {
137
                    @Override
138
                    public void accept(List<ChatRecommendBean> list) throws Exception {
139
                        ChatRecommendBean chatRecommendBean = beans.get(position - 1);
124 140
125
//                final ArrayList<ChatRecommendBean> beans = chatRecommendAdapter.getCurrentData();
126
//                ChatRecommendBean bean = beans.get(position - 1);
127
//                if (bean.targetType == ChatRecommendBean.TARGET_TYPE_IMAGE_TOPIC) {
128
//                    Intent intent = new Intent(getActivity(), TopicDetailActivity.class);
129
//                    intent.putExtra("topicId", bean.targetId);
130
//                    startActivity(intent);
131
//                } else {
132
//                    Disposable disposable = Observable
133
//                            .fromIterable(beans)
134
//                            .filter(new Predicate<ChatRecommendBean>() {
135
//                                @Override
136
//                                public boolean test(ChatRecommendBean chatRecommendBean) throws Exception {
137
//                                    return chatRecommendBean.targetType != 25;
138
//                                }
139
//                            }).toList()
140
//                            .subscribeOn(Schedulers.io())
141
//                            .observeOn(AndroidSchedulers.mainThread())
142
//                            .subscribe(new Consumer<List<ChatRecommendBean>>() {
143
//                                @Override
144
//                                public void accept(List<ChatRecommendBean> list) throws Exception {
145
//                                    ChatRecommendBean chatRecommendBean = beans.get(position - 1);
146
//
147
//                                    int index = 0;
148
//                                    for (int i = 0; i < list.size(); i++) {
149
//                                        ChatRecommendBean tmp = list.get(i);
150
//                                        if (tmp.targetType == chatRecommendBean.targetType &&
151
//                                                tmp.targetId == chatRecommendBean.targetId) {
152
//                                            index = i;
153
//                                            break;
154
//                                        }
155
//                                    }
156
//
157
//                                    Intent intent = new Intent(getActivity(), VideoDetaislActivity.class);
158
//                                    intent.putExtra("list", (Serializable) list);
159
//                                    intent.putExtra("pos", index);
160
//                                    startActivity(intent);
161
//
162
//                                }
163
//                            });
164
//                }
165
                // TODO update by huyuguo
166
                Log.d(TAG, "onItemClickListener: position:" + position + ",type:" + type);
141
                        int index = 0;
142
                        for (int i = 0; i < list.size(); i++) {
143
                            ChatRecommendBean tmp = list.get(i);
144
                            if (tmp.targetType == chatRecommendBean.targetType &&
145
                                    tmp.targetId == chatRecommendBean.targetId) {
146
                                index = i;
147
                                break;
148
                            }
149
                        }
150
151
                        Intent intent = new Intent(getActivity(), VideoDetaislActivity.class);
152
                        intent.putExtra("list", (Serializable) list);
153
                        intent.putExtra("pos", index);
154
                        startActivity(intent);
155
                    }
156
                });
167 157
            }
168 158
        });
169 159

二进制
app/src/main/res/drawable-hdpi/app_share_talk_icon.png


二进制
app/src/main/res/drawable-mdpi/app_share_talk_icon.png


二进制
app/src/main/res/drawable-xhdpi/app_share_talk_icon.png


二进制
app/src/main/res/drawable-xxhdpi/app_share_talk_icon.png


二进制
app/src/main/res/drawable-xxxhdpi/app_share_talk_icon.png


+ 4 - 40
app/src/main/res/layout/fragment_chat_recommend.xml

@ -30,51 +30,15 @@
30 30
        android:id="@+id/chat_share_info_remind"
31 31
        android:layout_width="wrap_content"
32 32
        android:layout_height="wrap_content"
33
        android:layout_alignParentBottom="true"
33
        android:layout_alignTop="@+id/iv_ask"
34
        android:layout_alignBottom="@+id/iv_ask"
34 35
        android:layout_marginRight="3dp"
35
        android:layout_marginBottom="24dp"
36 36
        android:layout_toLeftOf="@+id/iv_ask"
37 37
        android:src="@drawable/chat_share_info_remind" />
38 38
39
    <LinearLayout
40
        android:id="@+id/chat_share_info_remindxx"
41
        android:layout_width="wrap_content"
42
        android:layout_height="40dp"
43
        android:layout_alignParentBottom="true"
44
        android:layout_marginBottom="24dp"
45
        android:layout_toLeftOf="@+id/iv_ask"
46
        android:gravity="center_vertical"
47
        android:orientation="horizontal"
48
        android:visibility="gone">
49
50
        <RelativeLayout
51
            android:layout_width="wrap_content"
52
            android:layout_height="match_parent"
53
            android:background="@drawable/bg_yuan_black">
54
55
            <TextView
56
                android:id="@+id/chat_share_info"
57
                android:layout_width="wrap_content"
58
                android:layout_height="match_parent"
59
                android:gravity="center"
60
                android:paddingLeft="10dp"
61
                android:paddingRight="10dp"
62
                android:text="分享内容获电币"
63
                android:textColor="@color/white" />
64
        </RelativeLayout>
65
66
67
        <ImageView
68
            android:layout_width="15dp"
69
            android:layout_height="15dp"
70
            android:layout_marginLeft="-5dp"
71
            android:alpha="0.5"
72
            android:src="@drawable/app_sanjiao_right" />
73
    </LinearLayout>
74
75 39
    <include
76
        android:visibility="gone"
77 40
        layout="@layout/activity_no_net_img"
78 41
        android:layout_width="match_parent"
79
        android:layout_height="match_parent" />
42
        android:layout_height="match_parent"
43
        android:visibility="gone" />
80 44
</RelativeLayout>