Browse Source

modify user avatar

dxh 6 years ago
parent
commit
f63afae1ee

+ 1 - 1
app/src/main/java/com/electric/chargingpile/adapter/VideoCommentAdapter.java

58
                    .into(viewHolder.mItemUserAvatar);
58
                    .into(viewHolder.mItemUserAvatar);
59
        } else {
59
        } else {
60
            Picasso.with(context)
60
            Picasso.with(context)
61
                    .load(videoCommentBean.headImgFromUser)
61
                    .load("http://cdz.evcharge.cc/zhannew/uploadfile/"+videoCommentBean.headImgFromUser)
62
                    .placeholder(R.drawable.icon_face2_0)
62
                    .placeholder(R.drawable.icon_face2_0)
63
                    .error(R.drawable.icon_face2_0)
63
                    .error(R.drawable.icon_face2_0)
64
                    .transform(new CircleTransform())
64
                    .transform(new CircleTransform())

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

5
import android.support.v4.view.PagerAdapter;
5
import android.support.v4.view.PagerAdapter;
6
import android.support.v4.view.ViewPager;
6
import android.support.v4.view.ViewPager;
7
import android.text.TextUtils;
7
import android.text.TextUtils;
8
import android.util.Log;
9
import android.view.LayoutInflater;
8
import android.view.LayoutInflater;
10
import android.view.View;
9
import android.view.View;
11
import android.view.ViewGroup;
10
import android.view.ViewGroup;
25
import com.electric.chargingpile.data.TalkRecommendBean;
24
import com.electric.chargingpile.data.TalkRecommendBean;
26
import com.electric.chargingpile.util.CircleTransform;
25
import com.electric.chargingpile.util.CircleTransform;
27
import com.electric.chargingpile.util.JsonUtils;
26
import com.electric.chargingpile.util.JsonUtils;
27
import com.electric.chargingpile.util.TimeUtil;
28
import com.electric.chargingpile.util.ToastUtil;
28
import com.electric.chargingpile.util.ToastUtil;
29
import com.electric.chargingpile.view.AlertDialog;
29
import com.electric.chargingpile.view.AlertDialog;
30
import com.electric.chargingpile.view.UpVideoView2;
30
import com.electric.chargingpile.view.UpVideoView2;
41
import java.util.Map;
41
import java.util.Map;
42
42
43
import okhttp3.Call;
43
import okhttp3.Call;
44
import tv.danmaku.ijk.media.player.IMediaPlayer;
45
44
46
public class SvVideoShowView implements View.OnClickListener {
45
public class SvVideoShowView implements View.OnClickListener {
47
46
139
        sv_show_like_tv.setText(talkRecommendBean.likeNums + "");
138
        sv_show_like_tv.setText(talkRecommendBean.likeNums + "");
140
        sv_show_tvcon.setText(talkRecommendBean.content);
139
        sv_show_tvcon.setText(talkRecommendBean.content);
141
        sv_show_user_name.setText(talkRecommendBean.nickName);
140
        sv_show_user_name.setText(talkRecommendBean.nickName);
142
        sv_show_user_time.setText("" + talkRecommendBean.addTime);
141
        String time = TimeUtil.getTimeFormatText(talkRecommendBean.addTime);
142
        sv_show_user_time.setText(time);
143
        sv_show_topic_con.setText(talkRecommendBean.topicName);
143
        sv_show_topic_con.setText(talkRecommendBean.topicName);
144
144
145
        if (TextUtils.isEmpty(talkRecommendBean.headImgUrl)) {
145
        if (TextUtils.isEmpty(talkRecommendBean.headImgUrl)) {
151
                    .into(sv_show_user_avatar);
151
                    .into(sv_show_user_avatar);
152
        } else {
152
        } else {
153
            Picasso.with(activity)
153
            Picasso.with(activity)
154
                    .load(talkRecommendBean.headImgUrl)
154
                    .load("http://cdz.evcharge.cc/zhannew/uploadfile/"+talkRecommendBean.headImgUrl)
155
                    .placeholder(R.drawable.icon_face2_0)
155
                    .placeholder(R.drawable.icon_face2_0)
156
                    .error(R.drawable.icon_face2_0)
156
                    .error(R.drawable.icon_face2_0)
157
                    .transform(new CircleTransform())
157
                    .transform(new CircleTransform())
329
        }
329
        }
330
    }
330
    }
331
331
332
    private void playVideo(String urlPath){
332
    private void playVideo(String urlPath) {
333
        upVideoView2.setVideoPath(urlPath);
333
        upVideoView2.setVideoPath(urlPath);
334
        NetworkUtils.NetworkType networkType = NetworkUtils.getNetworkType();
334
        NetworkUtils.NetworkType networkType = NetworkUtils.getNetworkType();
335
        switch (networkType) {
335
        switch (networkType) {

+ 6 - 0
app/src/main/java/com/electric/chargingpile/util/TimeUtil.java

33
        return df.format(d);
33
        return df.format(d);
34
    }
34
    }
35

35

36
    public static String getTimeFormatText(long date) {
37
        Date date1 = new Date(date);
38
        return getTimeFormatText(date1);
39
    }
40

41

36
    public static String getTimeFormatText(Date date) {
42
    public static String getTimeFormatText(Date date) {
37
        if (date == null) {
43
        if (date == null) {
38
            return null;
44
            return null;

+ 3 - 7
app/src/main/res/layout/activity_videodetails.xml

1
<?xml version="1.0" encoding="utf-8"?>
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent">
5
4
    android:layout_height="match_parent"
5
    android:background="#424242">
6
6
7
    <com.electric.chargingpile.view.sview.VerticalViewPager
7
    <com.electric.chargingpile.view.sview.VerticalViewPager
8
        android:id="@+id/pager_video"
8
        android:id="@+id/pager_video"
9
        android:layout_width="match_parent"
9
        android:layout_width="match_parent"
10
        android:layout_height="match_parent" />
10
        android:layout_height="match_parent" />
11
11
12
13
    <RelativeLayout
12
    <RelativeLayout
14
        android:layout_width="match_parent"
13
        android:layout_width="match_parent"
15
        android:layout_height="48dp">
14
        android:layout_height="48dp">
16
15
17
18
19
20
        <ImageView
16
        <ImageView
21
            android:id="@+id/vd_title_back"
17
            android:id="@+id/vd_title_back"
22
            android:layout_width="wrap_content"
18
            android:layout_width="wrap_content"
34
            android:paddingLeft="15dp"
30
            android:paddingLeft="15dp"
35
            android:paddingRight="15dp"
31
            android:paddingRight="15dp"
36
            android:src="@drawable/icon_more" />
32
            android:src="@drawable/icon_more" />
37
38
    </RelativeLayout>
33
    </RelativeLayout>
34
39
</RelativeLayout>
35
</RelativeLayout>

+ 8 - 1
app/src/main/res/layout/view_show_bottom.xml

24
            <TextView
24
            <TextView
25
                android:layout_width="wrap_content"
25
                android:layout_width="wrap_content"
26
                android:layout_height="wrap_content"
26
                android:layout_height="wrap_content"
27
                android:layout_marginStart="4dp"
27
                android:text="转发"
28
                android:text="转发"
29
                android:textColor="#888888"
28
                android:textSize="12sp" />
30
                android:textSize="12sp" />
29
31
30
        </LinearLayout>
32
        </LinearLayout>
47
                android:id="@+id/sv_show_comment_count_tv"
49
                android:id="@+id/sv_show_comment_count_tv"
48
                android:layout_width="wrap_content"
50
                android:layout_width="wrap_content"
49
                android:layout_height="wrap_content"
51
                android:layout_height="wrap_content"
52
                android:layout_marginStart="4dp"
50
                android:textColor="#888888"
53
                android:textColor="#888888"
51
                android:textSize="12sp" />
54
                android:textSize="12sp" />
52
55
71
                android:id="@+id/sv_show_like_tv"
74
                android:id="@+id/sv_show_like_tv"
72
                android:layout_width="wrap_content"
75
                android:layout_width="wrap_content"
73
                android:layout_height="wrap_content"
76
                android:layout_height="wrap_content"
77
                android:layout_marginStart="4dp"
74
                android:textColor="#888888"
78
                android:textColor="#888888"
75
                android:textSize="12sp" />
79
                android:textSize="12sp" />
76
80
94
            <TextView
98
            <TextView
95
                android:layout_width="wrap_content"
99
                android:layout_width="wrap_content"
96
                android:layout_height="wrap_content"
100
                android:layout_height="wrap_content"
101
                android:layout_marginStart="4dp"
97
                android:text="写评论"
102
                android:text="写评论"
103
104
                android:textColor="#c2c2c2"
98
                android:textSize="12sp" />
105
                android:textSize="12sp" />
99
106
100
        </LinearLayout>
107
        </LinearLayout>
158
            android:layout_height="wrap_content"
165
            android:layout_height="wrap_content"
159
            android:layout_below="@+id/sv_show_user_name"
166
            android:layout_below="@+id/sv_show_user_name"
160
            android:layout_alignStart="@+id/sv_show_user_name"
167
            android:layout_alignStart="@+id/sv_show_user_name"
161
            android:textColor="#fff"
168
            android:textColor="#888888"
162
            android:textSize="12sp" />
169
            android:textSize="12sp" />
163
    </RelativeLayout>
170
    </RelativeLayout>
164
171

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

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