Browse Source

修改bug

hy 2 years ago
parent
commit
43415667a0

+ 11 - 17
app/src/main/java/com/electric/chargingpile/activity/ChargingCommentActivity.java

44
import androidx.recyclerview.widget.GridLayoutManager;
44
import androidx.recyclerview.widget.GridLayoutManager;
45
import androidx.recyclerview.widget.RecyclerView;
45
import androidx.recyclerview.widget.RecyclerView;
46
46
47
import com.andview.refreshview.utils.Utils;
47
import com.blankj.utilcode.util.CacheUtils;
48
import com.blankj.utilcode.util.CacheUtils;
48
import com.blankj.utilcode.util.EmptyUtils;
49
import com.blankj.utilcode.util.EmptyUtils;
49
import com.blankj.utilcode.util.LogUtils;
50
import com.blankj.utilcode.util.LogUtils;
50
import com.bumptech.glide.Glide;
51
import com.bumptech.glide.Glide;
51
import com.bumptech.glide.load.DataSource;
52
import com.bumptech.glide.load.DataSource;
52
import com.bumptech.glide.load.engine.GlideException;
53
import com.bumptech.glide.load.engine.GlideException;
54
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
55
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
53
import com.bumptech.glide.request.RequestListener;
56
import com.bumptech.glide.request.RequestListener;
57
import com.bumptech.glide.request.RequestOptions;
54
import com.bumptech.glide.request.target.Target;
58
import com.bumptech.glide.request.target.Target;
55
import com.electric.chargingpile.R;
59
import com.electric.chargingpile.R;
56
import com.electric.chargingpile.adapter.GridImageAdapter;
60
import com.electric.chargingpile.adapter.GridImageAdapter;
213
            super.handleMessage(msg);
217
            super.handleMessage(msg);
214
        }
218
        }
215
    };
219
    };
216
    private List<LocalMedia> mSelectionData =new ArrayList<LocalMedia>();
217
218
220
219
    private int mInsterType = -1; //1 插入图片 2 插入视频 -1 未插入数据
221
    private int mInsterType = -1; //1 插入图片 2 插入视频 -1 未插入数据
220
222
254
        findViewById(R.id.imgUpload).setOnClickListener(this);
256
        findViewById(R.id.imgUpload).setOnClickListener(this);
255
        findViewById(R.id.videoUpLoad).setOnClickListener(this);
257
        findViewById(R.id.videoUpLoad).setOnClickListener(this);
256
        commentHint = (TextView) findViewById(R.id.commentHint);
258
        commentHint = (TextView) findViewById(R.id.commentHint);
257
        topicText = (TextView) findViewById(R.id.topicText);
258
        imgAd = (ImageView) findViewById(R.id.imgAd);
259
        imgAd = (ImageView) findViewById(R.id.imgAd);
259
        commentHint.setText(Html.fromHtml("30字以上+图片或15s视频有机会被<font color='#3EC34C'>评为优质评论获得充电优惠券</font>", FROM_HTML_MODE_LEGACY));
260
        commentHint.setText(Html.fromHtml("30字以上+图片或15s视频有机会被<font color='#3EC34C'>评为优质评论获得充电优惠券</font>", FROM_HTML_MODE_LEGACY));
261
        topicText = (TextView) findViewById(R.id.topicText);
262
        topicText.setText(Html.fromHtml("<font color='#6AB650'>╋</font>  话题", FROM_HTML_MODE_LEGACY));
260
263
261
264
262
        rl_comment = (RelativeLayout) findViewById(R.id.rl_comment);
265
        rl_comment = (RelativeLayout) findViewById(R.id.rl_comment);
448
        });
451
        });
449
452
450
        if (MainApplication.mAdComment!=null){
453
        if (MainApplication.mAdComment!=null){
454
451
            String icon = MainApplication.mAdComment.getIcon();
455
            String icon = MainApplication.mAdComment.getIcon();
452
            String adUrl = MainApplication.mAdComment.getUrl();
456
            String adUrl = MainApplication.mAdComment.getUrl();
453
            Glide.with(this).load(MainApplication.url + "/zhannew/uploadfile/" + icon).listener(new RequestListener<Drawable>() {
454
                @Override
455
                public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
456
                    imgAd.setVisibility(View.GONE);
457
                    return false;
458
                }
459
460
                @Override
461
                public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
462
                    imgAd.setVisibility(View.VISIBLE);
463
                    return false;
464
                }
465
            }).into(imgAd);
457
            Glide.with(this).load(MainApplication.url + "/zhannew/uploadfile/" + icon)
458
                    .into(imgAd);
459
            imgAd.setVisibility(View.VISIBLE);
466
            imgAd.setOnClickListener(v->{
460
            imgAd.setOnClickListener(v->{
467
                Intent adfloatIntent = new Intent(this, MyWebViewActivity.class);
461
                Intent adfloatIntent = new Intent(this, MyWebViewActivity.class);
468
                adfloatIntent.putExtra("url", adUrl);
462
                adfloatIntent.putExtra("url", adUrl);
514
        } else if (requestCode == REQUEST_TOPIC_CODE && resultCode == SelectTopicActivity.REESULT_CODE) {
508
        } else if (requestCode == REQUEST_TOPIC_CODE && resultCode == SelectTopicActivity.REESULT_CODE) {
515
            String name = data.getStringExtra("topicBean");
509
            String name = data.getStringExtra("topicBean");
516
            mTopicbean = mGson.fromJson(name, TopicBean.class);
510
            mTopicbean = mGson.fromJson(name, TopicBean.class);
517
            topicText.setText(mTopicbean.getMeg());
511
            topicText.setText(Html.fromHtml("<font color='#6AB650'>#</font>  "+mTopicbean.getMeg(), FROM_HTML_MODE_LEGACY));
518
        }
512
        }
519
    }
513
    }
520
514

+ 1 - 3
app/src/main/java/com/electric/chargingpile/activity/CommentVideoDetailActivity.java

37
37
38
    private DetailVideo mVideoPlayer;
38
    private DetailVideo mVideoPlayer;
39
    private ImageView mPlayIcon,mBackIcon;
39
    private ImageView mPlayIcon,mBackIcon;
40
    private ProgressBar mProgressBar;
40
41
    private Gson mGson=new Gson();
41
    private Gson mGson=new Gson();
42
    private String pid;
42
    private String pid;
43
    private LoadingDialog mLoadingDialog = null ;
43
    private LoadingDialog mLoadingDialog = null ;
63
        mVideoPlayer = findViewById(R.id.videoPlayer);
63
        mVideoPlayer = findViewById(R.id.videoPlayer);
64
        mBackIcon = findViewById(R.id.backIcon);
64
        mBackIcon = findViewById(R.id.backIcon);
65
        mPlayIcon = findViewById(R.id.playIcon);
65
        mPlayIcon = findViewById(R.id.playIcon);
66
        mProgressBar = findViewById(R.id.progressBar);
67
66
68
        mBackIcon.setOnClickListener(v->{
67
        mBackIcon.setOnClickListener(v->{
69
            finish();
68
            finish();
121
        ImageDisplayUtils.dispalyImg(this, url, thumbImageView);
120
        ImageDisplayUtils.dispalyImg(this, url, thumbImageView);
122
        mVideoPlayer.setThumbImageView(thumbImageView);
121
        mVideoPlayer.setThumbImageView(thumbImageView);
123
        mVideoPlayer.setLooping(true);
122
        mVideoPlayer.setLooping(true);
124
        mVideoPlayer.setGSYVideoProgressListener((progress, secProgress, currentPosition, duration) -> mProgressBar.setProgress(Math.toIntExact(progress)));
125
123
126
        mVideoPlayer.setUp(url, true, "");
124
        mVideoPlayer.setUp(url, true, "");
127
        mVideoPlayer.startPlayLogic();
125
        mVideoPlayer.startPlayLogic();

+ 1 - 0
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

447
                case 2:
447
                case 2:
448
                    try {
448
                    try {
449
                        String data = JsonUtils.getKeyResult(msg.obj.toString(), "data");
449
                        String data = JsonUtils.getKeyResult(msg.obj.toString(), "data");
450
                        Log.e(TAG, "handleMessage: "+data );
450
                        if (!data.equals("")) {
451
                        if (!data.equals("")) {
451
                            String ad_comment = JsonUtils.getKeyResult(data, "ad_comment");
452
                            String ad_comment = JsonUtils.getKeyResult(data, "ad_comment");
452
                            if (EmptyUtils.isNotEmpty(ad_comment)){
453
                            if (EmptyUtils.isNotEmpty(ad_comment)){

+ 8 - 1
app/src/main/java/com/electric/chargingpile/activity/SelectTopicActivity.java

100
                        String data = JsonUtils.getKeyResult(response, "data");
100
                        String data = JsonUtils.getKeyResult(response, "data");
101
                        ArrayList<TopicBean> list = mGson.fromJson(data, new TypeToken<ArrayList<TopicBean>>() {
101
                        ArrayList<TopicBean> list = mGson.fromJson(data, new TypeToken<ArrayList<TopicBean>>() {
102
                        }.getType());
102
                        }.getType());
103
                        list.clear();
104
                        if (list != null && list.size()>0){
103
                        if (list != null && list.size()>0){
105
                            mAdapter.setDatas(list);
104
                            mAdapter.setDatas(list);
106
                            mRecyclerView.setVisibility(View.VISIBLE);
105
                            mRecyclerView.setVisibility(View.VISIBLE);
111
                            noDataText.setVisibility(View.VISIBLE);
110
                            noDataText.setVisibility(View.VISIBLE);
112
                            imgNoData.setVisibility(View.VISIBLE);
111
                            imgNoData.setVisibility(View.VISIBLE);
113
                        }
112
                        }
113
                    }else{
114
                        mRecyclerView.setVisibility(View.GONE);
115
                        noDataText.setVisibility(View.VISIBLE);
116
                        imgNoData.setVisibility(View.VISIBLE);
114
                    }
117
                    }
118
                }else{
119
                    mRecyclerView.setVisibility(View.GONE);
120
                    noDataText.setVisibility(View.VISIBLE);
121
                    imgNoData.setVisibility(View.VISIBLE);
115
                }
122
                }
116
123
117
            }
124
            }

+ 10 - 2
app/src/main/java/com/electric/chargingpile/activity/SingleCommentActivity.java

53
import org.json.JSONArray;
53
import org.json.JSONArray;
54
import org.json.JSONException;
54
import org.json.JSONException;
55
import org.json.JSONObject;
55
import org.json.JSONObject;
56
import org.w3c.dom.Text;
56
57
57
import java.net.URLEncoder;
58
import java.net.URLEncoder;
58
import java.util.ArrayList;
59
import java.util.ArrayList;
149
    public void getCommentData(RankinglistRefreshEvent rankinglistRefreshEvent) {
150
    public void getCommentData(RankinglistRefreshEvent rankinglistRefreshEvent) {
150
//        String url = "http://59.110.68.162/zhannew/basic/web/index.php/tpappcomments/get-sub-comments?id="+pid;
151
//        String url = "http://59.110.68.162/zhannew/basic/web/index.php/tpappcomments/get-sub-comments?id="+pid;
151
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpappcomments/get-sub-comments?id=" + pid;
152
        String url = MainApplication.url + "/zhannew/basic/web/index.php/tpappcomments/get-sub-comments?id=" + pid;
152
        Log.e("getCommentData_url=", url);
153
//        Log.e("getCommentData_url=", url);
153
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
154
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
154
            @Override
155
            @Override
155
            public void onError(Call call, Exception e) {
156
            public void onError(Call call, Exception e) {
239
        }
240
        }
240
        //设置时间
241
        //设置时间
241
        String addtime = JsonUtils.getKeyResult(data, "addtime");
242
        String addtime = JsonUtils.getKeyResult(data, "addtime");
243
        addtime= TextUtils.isEmpty(addtime)?"0":addtime;
242
        tv_ptime.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
244
        tv_ptime.setText(TimeStamp2Date(addtime, "yyyy-MM-dd"));
243
        //设置内容
245
        //设置内容
244
        String content = JsonUtils.getKeyResult(data, "content");
246
        String content = JsonUtils.getKeyResult(data, "content");
247
        String  theme= JsonUtils.getKeyResult(data,"theme");
248
        if (!TextUtils.isEmpty(theme.trim())){
249
            content= "#"+theme+"#"+content;
250
        }
251
245
        if (content.equals("") || content.equals(" ")) {
252
        if (content.equals("") || content.equals(" ")) {
246
            tv_pcontext.setVisibility(View.GONE);
253
            tv_pcontext.setVisibility(View.GONE);
247
        } else {
254
        } else {
255
248
            tv_pcontext.setVisibility(View.VISIBLE);
256
            tv_pcontext.setVisibility(View.VISIBLE);
249
            SpannableString ss = new SpannableString(content);
257
            SpannableString ss = new SpannableString(content);
250
            Pattern pattern = Pattern.compile("#[0-9a-zA-Z,\\u4e00-\\u9fa5]+#");
258
            Pattern pattern = Pattern.compile("#[0-9a-zA-Z,\\u4e00-\\u9fa5]+#");
252
            while (matcher.find()) {
260
            while (matcher.find()) {
253
                int start = matcher.start();
261
                int start = matcher.start();
254
                int end = matcher.end();
262
                int end = matcher.end();
255
                ss.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.topic_blue)), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
263
                ss.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.topic_green)), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
256
            }
264
            }
257
            tv_pcontext.setText(ss);
265
            tv_pcontext.setText(ss);
258
        }
266
        }

+ 12 - 16
app/src/main/java/com/electric/chargingpile/activity/ZhanCommentActivity.java

22
import android.util.Log;
22
import android.util.Log;
23
import android.view.LayoutInflater;
23
import android.view.LayoutInflater;
24
import android.view.View;
24
import android.view.View;
25
import android.view.ViewGroup;
25
import android.view.animation.AnimationUtils;
26
import android.view.animation.AnimationUtils;
26
import android.view.inputmethod.InputMethodManager;
27
import android.view.inputmethod.InputMethodManager;
27
import android.widget.ImageView;
28
import android.widget.ImageView;
36
import androidx.recyclerview.widget.GridLayoutManager;
37
import androidx.recyclerview.widget.GridLayoutManager;
37
import androidx.recyclerview.widget.RecyclerView;
38
import androidx.recyclerview.widget.RecyclerView;
38
39
40
import com.andview.refreshview.utils.Utils;
39
import com.blankj.utilcode.util.CacheUtils;
41
import com.blankj.utilcode.util.CacheUtils;
40
import com.bumptech.glide.Glide;
42
import com.bumptech.glide.Glide;
41
import com.bumptech.glide.load.DataSource;
43
import com.bumptech.glide.load.DataSource;
42
import com.bumptech.glide.load.engine.GlideException;
44
import com.bumptech.glide.load.engine.GlideException;
45
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
46
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
43
import com.bumptech.glide.request.RequestListener;
47
import com.bumptech.glide.request.RequestListener;
48
import com.bumptech.glide.request.RequestOptions;
44
import com.bumptech.glide.request.target.Target;
49
import com.bumptech.glide.request.target.Target;
45
import com.electric.chargingpile.R;
50
import com.electric.chargingpile.R;
46
import com.electric.chargingpile.adapter.GridImageAdapter;
51
import com.electric.chargingpile.adapter.GridImageAdapter;
85
import com.upyun.library.common.UploadEngine;
90
import com.upyun.library.common.UploadEngine;
86
import com.upyun.library.listener.UpCompleteListener;
91
import com.upyun.library.listener.UpCompleteListener;
87
import com.upyun.library.listener.UpProgressListener;
92
import com.upyun.library.listener.UpProgressListener;
93
import com.zhy.autolayout.AutoLinearLayout;
88
import com.zhy.http.okhttp.OkHttpUtils;
94
import com.zhy.http.okhttp.OkHttpUtils;
89
import com.zhy.http.okhttp.callback.StringCallback;
95
import com.zhy.http.okhttp.callback.StringCallback;
90
import com.zhy.view.flowlayout.FlowLayout;
96
import com.zhy.view.flowlayout.FlowLayout;
431
        if (MainApplication.mAdComment!=null){
437
        if (MainApplication.mAdComment!=null){
432
            String icon = MainApplication.mAdComment.getIcon();
438
            String icon = MainApplication.mAdComment.getIcon();
433
            String adUrl = MainApplication.mAdComment.getUrl();
439
            String adUrl = MainApplication.mAdComment.getUrl();
434
            Glide.with(this).load(MainApplication.url + "/zhannew/uploadfile/" + icon).listener(new RequestListener<Drawable>() {
435
                @Override
436
                public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
437
                    imgAd.setVisibility(View.GONE);
438
                    return false;
439
                }
440
441
                @Override
442
                public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
443
                    imgAd.setVisibility(View.VISIBLE);
444
                    return false;
445
                }
446
            }).into(imgAd);
440
            Glide.with(this).load(MainApplication.url + "/zhannew/uploadfile/" + icon)
441
                    .into(imgAd);
442
            imgAd.setVisibility(View.VISIBLE);
447
            imgAd.setOnClickListener(v->{
443
            imgAd.setOnClickListener(v->{
448
                Intent adfloatIntent = new Intent(this, MyWebViewActivity.class);
444
                Intent adfloatIntent = new Intent(this, MyWebViewActivity.class);
449
                adfloatIntent.putExtra("url", adUrl);
445
                adfloatIntent.putExtra("url", adUrl);
450
                startActivity(adfloatIntent);
446
                startActivity(adfloatIntent);
451
            });
447
            });
452
453
        }
448
        }
454
449
455
    }
450
    }
546
        } else if (requestCode == REQUEST_TOPIC_CODE && resultCode == SelectTopicActivity.REESULT_CODE) {
541
        } else if (requestCode == REQUEST_TOPIC_CODE && resultCode == SelectTopicActivity.REESULT_CODE) {
547
            String name = data.getStringExtra("topicBean");
542
            String name = data.getStringExtra("topicBean");
548
            mTopicbean = mGson.fromJson(name, TopicBean.class);
543
            mTopicbean = mGson.fromJson(name, TopicBean.class);
549
            topicText.setText(mTopicbean.getMeg());
544
            topicText.setText(Html.fromHtml("<font color='#6AB650'>#</font>  "+mTopicbean.getMeg(), FROM_HTML_MODE_LEGACY));
545
550
        }
546
        }
551
547
552
    }
548
    }
618
    private void getDatas() {
614
    private void getDatas() {
619
        zhan_id = getIntent().getStringExtra("zhan_id");
615
        zhan_id = getIntent().getStringExtra("zhan_id");
620
        show_txt = getIntent().getStringExtra("show_txt");
616
        show_txt = getIntent().getStringExtra("show_txt");
621
        et_pinglun.setHint(show_txt);
617
//        et_pinglun.setHint(show_txt);
622
    }
618
    }
623
619
624
    private void addComment(ArrayList<String> fileUrlList, String thumUrl) throws Exception {
620
    private void addComment(ArrayList<String> fileUrlList, String thumUrl) throws Exception {

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

38
import com.nostra13.universalimageloader.core.ImageLoader;
38
import com.nostra13.universalimageloader.core.ImageLoader;
39
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
39
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
40
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
40
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
41
import com.shuyu.gsyvideoplayer.GSYVideoManager;
42
import com.shuyu.gsyvideoplayer.model.VideoOptionModel;
41
import com.tencent.bugly.crashreport.CrashReport;
43
import com.tencent.bugly.crashreport.CrashReport;
42
import com.zhy.http.okhttp.OkHttpUtils;
44
import com.zhy.http.okhttp.OkHttpUtils;
43
import com.zhy.http.okhttp.callback.StringCallback;
45
import com.zhy.http.okhttp.callback.StringCallback;
58

60

59
import cn.jpush.android.api.JPushInterface;
61
import cn.jpush.android.api.JPushInterface;
60
import okhttp3.Call;
62
import okhttp3.Call;
63
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
61

64

62

65

63
public class MainApplication extends MultiDexApplication {
66
public class MainApplication extends MultiDexApplication {
207
        if (ProfileManager.getInstance().getPrivacyAgreement(this)) {
210
        if (ProfileManager.getInstance().getPrivacyAgreement(this)) {
208
            MainApplication.initSDK();
211
            MainApplication.initSDK();
209
        }
212
        }
213

214
        //防止进度跳转不准确
215
        VideoOptionModel videoOptionModel =
216
               new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", 1);
217
        ArrayList<VideoOptionModel> list =new ArrayList<VideoOptionModel>();
218
        list.add(videoOptionModel);
219
        GSYVideoManager.instance().setOptionModelList(list);
210
    }
220
    }
211

221

212
    public void initJPush() {
222
    public void initJPush() {

+ 55 - 1
app/src/main/java/com/electric/chargingpile/fragment/DetailsFragment.java

1405
                                    Glide.with(MainApplication.context)
1405
                                    Glide.with(MainApplication.context)
1406
                                            .load(MainApplication.CDN +thumUrl)
1406
                                            .load(MainApplication.CDN +thumUrl)
1407
                                            .into(imgVideo);
1407
                                            .into(imgVideo);
1408
                                }
1409
1408
1409
                                    imgVideo.setOnClickListener(v->{
1410
                                        CommentVideoDetailActivity.actioinStart(getContext(),jsonObject.optString("id"));
1411
                                    });
1412
                                }
1410
                            }else {
1413
                            }else {
1411
1414
1412
                                imgVideo.setVisibility(View.GONE);
1415
                                imgVideo.setVisibility(View.GONE);
1413
                                imgStart.setVisibility(View.GONE);
1416
                                imgStart.setVisibility(View.GONE);
1414
1417
1418
1415
                                if (!fileUrl.equals("")) {
1419
                                if (!fileUrl.equals("")) {
1416
                                    iv_commentPic.setVisibility(View.VISIBLE);
1420
                                    iv_commentPic.setVisibility(View.VISIBLE);
1417
                                    imgLayout.setVisibility(View.VISIBLE);
1421
                                    imgLayout.setVisibility(View.VISIBLE);
1440
                                } else {
1444
                                } else {
1441
                                    imgThree.setVisibility(View.GONE);
1445
                                    imgThree.setVisibility(View.GONE);
1442
                                }
1446
                                }
1447
1448
1449
                                String[] fileUrlArray = null;
1450
                                if (!TextUtils.isEmpty(fileUrl) && !TextUtils.isEmpty(file2Url) &&!TextUtils.isEmpty(file3Url)){
1451
                                    fileUrlArray =new String[]{
1452
                                            MainApplication.url + "/zhannew/uploadfile/"+fileUrl,
1453
                                            MainApplication.url + "/zhannew/uploadfile/"+file2Url,
1454
                                            MainApplication.url + "/zhannew/uploadfile/"+file3Url
1455
                                    };
1456
                                }else  if (!TextUtils.isEmpty(fileUrl) && !TextUtils.isEmpty(file2Url)){
1457
                                    fileUrlArray =new String[]{
1458
                                            MainApplication.url + "/zhannew/uploadfile/"+fileUrl,
1459
                                            MainApplication.url + "/zhannew/uploadfile/"+file2Url
1460
                                    };
1461
                                }else  if (!TextUtils.isEmpty(fileUrl)){
1462
                                    fileUrlArray =new String[]{ MainApplication.url + "/zhannew/uploadfile/"+fileUrl};
1463
                                }
1464
1465
1466
                                String[] finalFileUrlArray = fileUrlArray;
1467
                                iv_commentPic.setOnClickListener(new View.OnClickListener() {
1468
                                    @Override
1469
                                    public void onClick(View v) {
1470
                                        Intent intent = new Intent(getContext(), ImagePagerActivity.class);
1471
                                        // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
1472
                                        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, finalFileUrlArray);
1473
                                        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
1474
                                        startActivity(intent);
1475
                                    }
1476
                                });
1477
                                imgTwo.setOnClickListener(new View.OnClickListener() {
1478
                                    @Override
1479
                                    public void onClick(View v) {
1480
                                        Intent intent = new Intent(getContext(), ImagePagerActivity.class);
1481
                                        // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
1482
                                        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, finalFileUrlArray);
1483
                                        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 1);
1484
                                        startActivity(intent);
1485
                                    }
1486
                                });
1487
                                imgThree.setOnClickListener(new View.OnClickListener() {
1488
                                    @Override
1489
                                    public void onClick(View v) {
1490
                                        Intent intent = new Intent(getContext(), ImagePagerActivity.class);
1491
                                        // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
1492
                                        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, finalFileUrlArray);
1493
                                        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 2);
1494
                                        startActivity(intent);
1495
                                    }
1496
                                });
1443
                            }
1497
                            }
1444
                            //父级评分
1498
                            //父级评分
1445
                            String grade = jsonObject.optString("star_level");
1499
                            String grade = jsonObject.optString("star_level");

+ 2 - 11
app/src/main/java/com/electric/chargingpile/fragment/NewMyMessageFragment.java

87
    }
87
    }
88
88
89
    private void sp() {
89
    private void sp() {
90
        SharedPreferences sharedPreferences = getActivity().getSharedPreferences("userInfo",
90
        SharedPreferences sharedPreferences = MainApplication.context.getSharedPreferences("userInfo",
91
                Activity.MODE_PRIVATE);
91
                Activity.MODE_PRIVATE);
92
        password = sharedPreferences.getString("password", "");
92
        password = sharedPreferences.getString("password", "");
93
        username = sharedPreferences.getString("yonghuming", "");
93
        username = sharedPreferences.getString("yonghuming", "");
135
                                for (int j = 0; j < jsonArray.length(); j++) {
135
                                for (int j = 0; j < jsonArray.length(); j++) {
136
                                    JSONObject jsonObject4 = (JSONObject) jsonArray
136
                                    JSONObject jsonObject4 = (JSONObject) jsonArray
137
                                            .opt(j);
137
                                            .opt(j);
138
                                    String is_play = TextUtils.isEmpty( jsonObject4.getString("is_play"))?"": jsonObject4.getString("is_play")  ; //0 审核未通过 item隐藏,1 审核通过,item显示
139
                                    String type = TextUtils.isEmpty(jsonObject4.getString("type"))?"":jsonObject4.getString("type"); //23 视频,24 图片
140
                                    if (type.equals("23")){
141
                                        if (is_play.equals("1")){
142
                                            datas.add(jsonObject4);
143
                                        }
144
                                    }else{
145
                                        datas.add(jsonObject4);
146
                                    }
138
                                    datas.add(jsonObject4);
147
                                }
139
                                }
148
                                Log.d("comments_size", datas.size() + "");
149
                                if (datas.size() == 0) {
140
                                if (datas.size() == 0) {
150
                                    web_content.setVisibility(View.GONE);
141
                                    web_content.setVisibility(View.GONE);
151
                                    ll_tishi.setVisibility(View.VISIBLE);
142
                                    ll_tishi.setVisibility(View.VISIBLE);

+ 20 - 18
app/src/main/java/com/electric/chargingpile/video/DetailVideo.java

3
import android.content.Context;
3
import android.content.Context;
4
import android.util.AttributeSet;
4
import android.util.AttributeSet;
5
import android.view.MotionEvent;
5
import android.view.MotionEvent;
6
import android.widget.ImageView;
6
7
7
import com.electric.chargingpile.R;
8
import com.electric.chargingpile.R;
8
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
9
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;
9
10
11
import moe.codeest.enviews.ENPlayView;
12
10
public class DetailVideo extends StandardGSYVideoPlayer {
13
public class DetailVideo extends StandardGSYVideoPlayer {
11
14
12
15
30
    }
33
    }
31
34
32
35
36
33
    @Override
37
    @Override
34
    protected void touchSurfaceMoveFullLogic(float absDeltaX, float absDeltaY) {
38
    protected void touchSurfaceMoveFullLogic(float absDeltaX, float absDeltaY) {
35
        super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY);
39
        super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY);
60
    protected void changeUiToPreparingShow() {
64
    protected void changeUiToPreparingShow() {
61
        super.changeUiToPreparingShow();
65
        super.changeUiToPreparingShow();
62
        setViewShowState(mTopContainer, INVISIBLE);
66
        setViewShowState(mTopContainer, INVISIBLE);
63
        setViewShowState(mBottomContainer, INVISIBLE);
64
        setViewShowState(mLoadingProgressBar, INVISIBLE);
67
        setViewShowState(mLoadingProgressBar, INVISIBLE);
65
        setViewShowState(mStartButton, INVISIBLE);
68
66
    }
69
    }
67
70
68
    @Override
71
    @Override
69
    protected void changeUiToPlayingBufferingShow() {
72
    protected void changeUiToPlayingBufferingShow() {
70
        super.changeUiToPlayingBufferingShow();
73
        super.changeUiToPlayingBufferingShow();
71
        setViewShowState(mTopContainer, INVISIBLE);
74
        setViewShowState(mTopContainer, INVISIBLE);
72
        setViewShowState(mBottomContainer, INVISIBLE);
75
73
        setViewShowState(mLoadingProgressBar, INVISIBLE);
76
        setViewShowState(mLoadingProgressBar, INVISIBLE);
74
        setViewShowState(mStartButton, INVISIBLE);
77
75
    }
78
    }
76
79
77
    @Override
80
    @Override
78
    protected void changeUiToPlayingShow() {
81
    protected void changeUiToPlayingShow() {
79
        super.changeUiToPlayingShow();
82
        super.changeUiToPlayingShow();
80
        setViewShowState(mTopContainer, INVISIBLE);
83
        setViewShowState(mTopContainer, INVISIBLE);
81
        setViewShowState(mBottomContainer, INVISIBLE);
84
82
        setViewShowState(mLoadingProgressBar, INVISIBLE);
85
        setViewShowState(mLoadingProgressBar, INVISIBLE);
83
        setViewShowState(mStartButton, INVISIBLE);
86
84
87
85
    }
88
    }
86
89
88
    protected void changeUiToCompleteShow() {
91
    protected void changeUiToCompleteShow() {
89
        super.changeUiToCompleteShow();
92
        super.changeUiToCompleteShow();
90
        setViewShowState(mTopContainer, INVISIBLE);
93
        setViewShowState(mTopContainer, INVISIBLE);
91
        setViewShowState(mBottomContainer, INVISIBLE);
94
92
        setViewShowState(mLoadingProgressBar, INVISIBLE);
95
        setViewShowState(mLoadingProgressBar, INVISIBLE);
93
        setViewShowState(mStartButton, INVISIBLE);
96
94
    }
97
    }
95
98
96
    @Override
99
    @Override
97
    protected void changeUiToPauseShow() {
100
    protected void changeUiToPauseShow() {
98
        super.changeUiToPauseShow();
101
        super.changeUiToPauseShow();
99
        setViewShowState(mTopContainer, INVISIBLE);
102
        setViewShowState(mTopContainer, INVISIBLE);
100
        setViewShowState(mBottomContainer, INVISIBLE);
103
101
        setViewShowState(mLoadingProgressBar, INVISIBLE);
104
        setViewShowState(mLoadingProgressBar, INVISIBLE);
102
        setViewShowState(mStartButton, INVISIBLE);
105
103
    }
106
    }
104
107
105
    @Override
108
    @Override
106
    protected void changeUiToNormal() {
109
    protected void changeUiToNormal() {
107
        super.changeUiToNormal();
110
        super.changeUiToNormal();
108
        setViewShowState(mTopContainer, INVISIBLE);
111
        setViewShowState(mTopContainer, INVISIBLE);
109
        setViewShowState(mBottomContainer, INVISIBLE);
112
110
        setViewShowState(mLoadingProgressBar, INVISIBLE);
113
        setViewShowState(mLoadingProgressBar, INVISIBLE);
111
        setViewShowState(mStartButton, INVISIBLE);
114
112
    }
115
    }
113
116
114
    @Override
117
    @Override
115
    public void startAfterPrepared() {
118
    public void startAfterPrepared() {
116
        super.startAfterPrepared();
119
        super.startAfterPrepared();
117
        setViewShowState(mTopContainer, INVISIBLE);
120
        setViewShowState(mTopContainer, INVISIBLE);
118
        setViewShowState(mBottomContainer, INVISIBLE);
121
119
        setViewShowState(mLoadingProgressBar, INVISIBLE);
122
        setViewShowState(mLoadingProgressBar, INVISIBLE);
120
        setViewShowState(mStartButton, INVISIBLE);
123
121
    }
124
    }
122
125
123
    @Override
126
    @Override
124
    protected void changeUiToPlayingBufferingClear() {
127
    protected void changeUiToPlayingBufferingClear() {
125
        super.changeUiToPlayingBufferingClear();
128
        super.changeUiToPlayingBufferingClear();
126
        setViewShowState(mTopContainer, INVISIBLE);
129
        setViewShowState(mTopContainer, INVISIBLE);
127
        setViewShowState(mBottomContainer, INVISIBLE);
130
128
        setViewShowState(mLoadingProgressBar, INVISIBLE);
131
        setViewShowState(mLoadingProgressBar, INVISIBLE);
129
        setViewShowState(mStartButton, INVISIBLE);
132
130
    }
133
    }
131
134
132
    @Override
135
    @Override
133
    protected void changeTextureViewShowType() {
136
    protected void changeTextureViewShowType() {
134
        super.changeTextureViewShowType();
137
        super.changeTextureViewShowType();
135
        setViewShowState(mTopContainer, INVISIBLE);
138
        setViewShowState(mTopContainer, INVISIBLE);
136
        setViewShowState(mBottomContainer, INVISIBLE);
137
        setViewShowState(mLoadingProgressBar, INVISIBLE);
139
        setViewShowState(mLoadingProgressBar, INVISIBLE);
138
        setViewShowState(mStartButton, INVISIBLE);
140
139
    }
141
    }
140
}
142
}

+ 3 - 1
app/src/main/res/layout/activity_charging_comment.xml

183
                android:paddingTop="12dp"
183
                android:paddingTop="12dp"
184
                android:paddingBottom="12dp"
184
                android:paddingBottom="12dp"
185
                android:background="@color/white"
185
                android:background="@color/white"
186
                android:hint="对本次充电感受如何?跟其他车友分享一下吧~"
186
                android:hint="有什么想吐槽的吗?来跟其他车友分享一下吧~"
187
                android:textColorHint="@color/ui_68"
187
                android:textColorHint="@color/ui_68"
188
                android:textColor="@color/ui_62"
188
                android:textColor="@color/ui_62"
189
                android:textSize="13sp"
189
                android:textSize="13sp"
249
                />
249
                />
250
250
251
            <ImageView
251
            <ImageView
252
                android:layout_marginEnd="12dp"
253
                android:layout_marginStart="12dp"
252
                android:visibility="gone"
254
                android:visibility="gone"
253
                android:id="@+id/imgAd"
255
                android:id="@+id/imgAd"
254
                android:layout_marginTop="30dp"
256
                android:layout_marginTop="30dp"

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

1542
                android:layout_height="34dp"
1542
                android:layout_height="34dp"
1543
                android:gravity="center"
1543
                android:gravity="center"
1544
                tools:text="您有一笔订,点击查看详情..."
1544
                tools:text="您有一笔订,点击查看详情..."
1545
                android:textColor="@color/huimain"
1545
                android:textColor="#FA1C1C"
1546
                android:textSize="13sp" />
1546
                android:textSize="13sp" />
1547
1547
1548
            <ImageView
1548
            <ImageView

+ 1 - 13
app/src/main/res/layout/activity_video_detail.xml

24
        app:layout_constraintEnd_toEndOf="@+id/videoPlayer"
24
        app:layout_constraintEnd_toEndOf="@+id/videoPlayer"
25
        app:layout_constraintStart_toStartOf="@+id/videoPlayer"
25
        app:layout_constraintStart_toStartOf="@+id/videoPlayer"
26
        app:layout_constraintTop_toTopOf="@+id/videoPlayer" />
26
        app:layout_constraintTop_toTopOf="@+id/videoPlayer" />
27
    <!-- 自定义进度条 -->
28
    <ProgressBar
29
        app:layout_constraintEnd_toEndOf="parent"
30
        app:layout_constraintStart_toStartOf="parent"
31
        android:layout_marginBottom="10dp"
32
        app:layout_constraintBottom_toBottomOf="parent"
33
        android:id="@+id/progressBar"
34
        style="@android:style/Widget.ProgressBar.Horizontal"
35
        android:layout_width="match_parent"
36
        android:layout_height="1dp"
37
        android:max="100"
38
        android:progressDrawable="@drawable/video_player_progressbar"
39
        tools:progress="50" />
27
40
    <ImageView
28
    <ImageView
41
        android:layout_marginTop="25dp"
29
        android:layout_marginTop="25dp"
42
        app:layout_constraintTop_toTopOf="parent"
30
        app:layout_constraintTop_toTopOf="parent"

+ 3 - 1
app/src/main/res/layout/activity_zhan_comment.xml

189
                android:layout_marginBottom="7dp"
189
                android:layout_marginBottom="7dp"
190
                android:background="@color/white"
190
                android:background="@color/white"
191
                android:gravity="left|top"
191
                android:gravity="left|top"
192
                android:hint="您的充电体验、站点吐槽、充电趣事,来和其他车友分享吧~"
192
                android:hint="有什么想吐槽的吗?来跟其他车友分享一下吧~"
193
                android:paddingLeft="15dp"
193
                android:paddingLeft="15dp"
194
                android:paddingTop="12dp"
194
                android:paddingTop="12dp"
195
                android:paddingRight="15dp"
195
                android:paddingRight="15dp"
258
                />
258
                />
259
259
260
            <ImageView
260
            <ImageView
261
                android:layout_marginEnd="12dp"
262
                android:layout_marginStart="12dp"
261
                android:visibility="gone"
263
                android:visibility="gone"
262
                android:id="@+id/imgAd"
264
                android:id="@+id/imgAd"
263
                android:layout_marginTop="30dp"
265
                android:layout_marginTop="30dp"

+ 91 - 8
app/src/main/res/layout/layout_video_detail.xml

14
    </FrameLayout>
14
    </FrameLayout>
15
15
16
16
17
    <RelativeLayout
18
        android:id="@+id/thumb"
19
        android:layout_width="match_parent"
20
        android:layout_height="match_parent"
21
        android:layout_alignParentStart="true"
22
        android:layout_alignParentLeft="true"
23
        android:layout_alignParentTop="true"
24
        android:layout_alignParentEnd="true"
25
        android:layout_alignParentRight="true"
26
        android:layout_alignParentBottom="true"
27
        android:background="#000000"
28
        android:scaleType="fitCenter" />
17
29
30
    <LinearLayout
31
        android:id="@+id/layout_bottom"
32
        android:layout_width="match_parent"
33
        android:layout_height="40dp"
34
        android:layout_alignParentBottom="true"
35
        android:background="#99000000"
36
        android:gravity="center_vertical"
37
        android:orientation="horizontal"
38
        android:visibility="invisible"
39
        tools:visibility="visible">
40
        <ImageView
41
            tools:src="@drawable/video_click_pause_selector"
42
            android:layout_marginStart="10dp"
43
            android:id="@+id/start"
44
            android:layout_width="30dp"
45
            android:layout_height="30dp"
46
            android:layout_centerHorizontal="true"
47
            android:layout_centerVertical="true"
48
            android:layout_gravity="center_vertical" />
18
49
19
    <moe.codeest.enviews.ENDownloadView
50
        <TextView
51
            android:id="@+id/current"
52
            android:layout_width="wrap_content"
53
            android:layout_height="wrap_content"
54
            android:layout_marginLeft="16dp"
55
            android:text="00:00"
56
            android:textColor="#ffffff" />
20
57
58
        <SeekBar
59
            android:id="@+id/progress"
60
            android:layout_width="0dp"
61
            android:layout_height="wrap_content"
62
            android:layout_gravity="center_vertical"
63
            android:layout_weight="1.0"
64
            android:background="@null"
65
            android:max="100"
66
            android:maxHeight="4dp"
67
            android:minHeight="4dp"
68
            android:paddingTop="8dp"
69
            android:paddingBottom="8dp"
70
            android:progressDrawable="@drawable/video_seek_progress"
71
            android:thumb="@drawable/video_seek_thumb" />
72
73
        <TextView
74
            android:id="@+id/total"
75
            android:layout_width="wrap_content"
76
            android:layout_height="wrap_content"
77
            android:layout_marginRight="16dp"
78
            android:text="00:00"
79
            android:textColor="#ffffff" />
80
    </LinearLayout>
81
82
    <ProgressBar
83
        android:id="@+id/bottom_progressbar"
84
        style="?android:attr/progressBarStyleHorizontal"
85
        android:layout_width="match_parent"
86
        android:layout_height="1.5dp"
87
        android:layout_alignParentBottom="true"
88
        android:max="100"
89
        android:progressDrawable="@drawable/video_progress"
90
        tools:visibility="visible" />
91
92
    <ImageView
93
        android:id="@+id/back_tiny"
94
        android:layout_width="24dp"
95
        android:layout_height="24dp"
96
        android:layout_marginLeft="6dp"
97
        android:layout_marginTop="6dp"
98
        android:visibility="gone" />
99
100
    <moe.codeest.enviews.ENDownloadView
21
        android:id="@+id/loading"
101
        android:id="@+id/loading"
22
        android:layout_width="28dp"
102
        android:layout_width="28dp"
23
        android:layout_height="28dp"
103
        android:layout_height="28dp"
25
        android:layout_centerVertical="true"
105
        android:layout_centerVertical="true"
26
        android:visibility="invisible" />
106
        android:visibility="invisible" />
27
107
28
    <moe.codeest.enviews.ENPlayView
29
        android:id="@+id/start"
30
        android:layout_width="60dp"
31
        android:layout_height="60dp"
32
        android:layout_centerHorizontal="true"
33
        android:layout_centerVertical="true"
34
        android:layout_gravity="center_vertical" />
35
108
36
109
110
    <ImageView
111
        android:id="@+id/small_close"
112
        android:layout_width="30dp"
113
        android:layout_height="30dp"
114
        android:paddingLeft="10dp"
115
        android:paddingTop="10dp"
116
        android:scaleType="centerInside"
117
        android:src="@drawable/video_small_close"
118
        android:visibility="gone" />
119
37
120
38
</RelativeLayout>
121
</RelativeLayout>