Bladeren bron

modify user avatar

dxh 6 jaren geleden
bovenliggende
commit
f63afae1ee

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

@ -58,7 +58,7 @@ public class VideoCommentAdapter extends RecyclerView.Adapter<VideoCommentAdapte
58 58
                    .into(viewHolder.mItemUserAvatar);
59 59
        } else {
60 60
            Picasso.with(context)
61
                    .load(videoCommentBean.headImgFromUser)
61
                    .load("http://cdz.evcharge.cc/zhannew/uploadfile/"+videoCommentBean.headImgFromUser)
62 62
                    .placeholder(R.drawable.icon_face2_0)
63 63
                    .error(R.drawable.icon_face2_0)
64 64
                    .transform(new CircleTransform())

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

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

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

@ -33,6 +33,12 @@ public class TimeUtil {
33 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 42
    public static String getTimeFormatText(Date date) {
37 43
        if (date == null) {
38 44
            return null;

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

@ -1,22 +1,18 @@
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="match_parent">
5
4
    android:layout_height="match_parent"
5
    android:background="#424242">
6 6
7 7
    <com.electric.chargingpile.view.sview.VerticalViewPager
8 8
        android:id="@+id/pager_video"
9 9
        android:layout_width="match_parent"
10 10
        android:layout_height="match_parent" />
11 11
12
13 12
    <RelativeLayout
14 13
        android:layout_width="match_parent"
15 14
        android:layout_height="48dp">
16 15
17
18
19
20 16
        <ImageView
21 17
            android:id="@+id/vd_title_back"
22 18
            android:layout_width="wrap_content"
@ -34,6 +30,6 @@
34 30
            android:paddingLeft="15dp"
35 31
            android:paddingRight="15dp"
36 32
            android:src="@drawable/icon_more" />
37
38 33
    </RelativeLayout>
34
39 35
</RelativeLayout>

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

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

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

@ -5,13 +5,12 @@
5 5
6 6
    <ImageView
7 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 10
    <com.electric.chargingpile.view.UpVideoView2
12 11
        android:id="@+id/view_show_video"
13 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 15
    <include layout="@layout/view_show_bottom" />
17 16