dxh 5 years ago
parent
commit
7d2c807000

+ 15 - 1
app/src/main/java/com/electric/chargingpile/activity/PublishTopicActivity.java

240
                                String policy = signBeans.get(0).policy;
240
                                String policy = signBeans.get(0).policy;
241
                                formUpload(media.getPath(), sign, policy);
241
                                formUpload(media.getPath(), sign, policy);
242
                            }
242
                            }
243
                        }else {
244
                            String desc = JsonUtils.getKeyResult(response, "desc");
245
                            ToastUtil.showToast(getApplicationContext(), desc, Toast.LENGTH_SHORT);
246
                            loadingDialog.dismiss();
243
                        }
247
                        }
244
                    }
248
                    }
245
                });
249
                });
282
    }
286
    }
283
287
284
    private void requestPublishServer(String urls) {
288
    private void requestPublishServer(String urls) {
289
        File file =new File(media.getPath());
290
        long size =0L;
291
        if(file.exists()){
292
            size = file.length();
293
        }
294
285
        String url = MainApplication.urlNew + "/topic/publish.do";
295
        String url = MainApplication.urlNew + "/topic/publish.do";
286
        Map<String, String> map = new HashMap<>();
296
        Map<String, String> map = new HashMap<>();
287
        map.put("content", mPublishtopicCon.getText().toString());
297
        map.put("content", mPublishtopicCon.getText().toString());
288
        map.put("urls", urls);
298
        map.put("urls", urls);
289
        map.put("topicId", talkRecommendBean.targetId + "");
299
        map.put("topicId", talkRecommendBean.targetId + "");
290
        map.put("targetType",  "23");
300
        map.put("targetType",  "23");
301
        map.put("coverImgW",media.getWidth()+"");
302
        map.put("coverImgH",media.getHeight()+"");
303
        map.put("duration",media.getDuration()+"");
304
        map.put("size",size+"");
291
        if (MainApplication.isLogin()) {
305
        if (MainApplication.isLogin()) {
292
            map.put("userId", MainApplication.userId);
306
            map.put("userId", MainApplication.userId);
293
            map.put("appToken", MainApplication.messageToken);
307
            map.put("appToken", MainApplication.messageToken);
344
358
345
                Glide
359
                Glide
346
                        .with(this)
360
                        .with(this)
347
                        .load(Uri.fromFile(new File(media.getPath())))
361
                        .load(Uri.fromFile(new File(media.getCompressPath())))
348
                        .apply(new RequestOptions().centerCrop())
362
                        .apply(new RequestOptions().centerCrop())
349
                        .into(mItemVideo);
363
                        .into(mItemVideo);
350
                mItemVideoLl.setVisibility(View.VISIBLE);
364
                mItemVideoLl.setVisibility(View.VISIBLE);

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

356
            if (imageUrl != null) {
356
            if (imageUrl != null) {
357
                imageList.addAll(imageUrl);
357
                imageList.addAll(imageUrl);
358
            }
358
            }
359
            notifyDataSetChanged();
360
        }
359
        }
361
360
362
        @Override
361
        @Override
399
    }
398
    }
400
399
401
    public void updateView() {
400
    public void updateView() {
401
        if(view==null){
402
            return;
403
        }
402
        String title = talkRecommendBean.title;
404
        String title = talkRecommendBean.title;
403
405
404
        sv_show_tvcon_more.setVisibility(View.GONE);
406
        sv_show_tvcon_more.setVisibility(View.GONE);

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

68
    }
68
    }
69
69
70
    boolean isFirst = false;
70
    boolean isFirst = false;
71
71
    @Override
72
    @Override
72
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
73
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
73
                             Bundle savedInstanceState) {
74
                             Bundle savedInstanceState) {
76
        share_info_icon = view.findViewById(R.id.share_info_icon);
77
        share_info_icon = view.findViewById(R.id.share_info_icon);
77
78
78
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
79
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
79
        if(TextUtils.isEmpty(isFirstComeIn)){
80
        if (TextUtils.isEmpty(isFirstComeIn)) {
80
            isFirst = true;
81
            isFirst = true;
81
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
82
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
82
            view.findViewById(R.id.share_info_icon).setVisibility(View.VISIBLE);
83
            view.findViewById(R.id.share_info_icon).setVisibility(View.VISIBLE);
141
            @Override
142
            @Override
142
            public void onItemClickListener(int position, int type) {
143
            public void onItemClickListener(int position, int type) {
143
                final int pos = position - 1;
144
                final int pos = position - 1;
144
                ArrayList<TalkRecommendBean> talkRecommendBeans = layoutAdapter.getCurrentData();
145
                final ArrayList<TalkRecommendBean> talkRecommendBeans = layoutAdapter.getCurrentData();
145
146
146
                if (!NetUtil.CheckNetwork(getActivity())) {
147
                if (!NetUtil.CheckNetwork(getActivity())) {
147
                    Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_SHORT).show();
148
                    Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_SHORT).show();
168
                            .subscribe(new Consumer<List<TalkRecommendBean>>() {
169
                            .subscribe(new Consumer<List<TalkRecommendBean>>() {
169
                                @Override
170
                                @Override
170
                                public void accept(List<TalkRecommendBean> list) throws Exception {
171
                                public void accept(List<TalkRecommendBean> list) throws Exception {
172
                                    TalkRecommendBean talkRecommendBean = talkRecommendBeans.get(pos);
173
174
                                    int index =0;
175
                                    for (int i = 0; i < list.size(); i++) {
176
                                        TalkRecommendBean tmp = list.get(i);
177
                                        if(tmp.targetType == talkRecommendBean.targetType &&
178
                                        tmp.targetId ==talkRecommendBean.targetId){
179
                                            index = i;
180
                                            break;
181
                                        }
182
                                    }
183
171
                                    Intent intent = new Intent(getActivity(), VideoDetaislActivity.class);
184
                                    Intent intent = new Intent(getActivity(), VideoDetaislActivity.class);
172
                                    intent.putExtra("list", (Serializable) list);
185
                                    intent.putExtra("list", (Serializable) list);
173
                                    intent.putExtra("pos", pos);
186
                                    intent.putExtra("pos", index);
174
                                    startActivity(intent);
187
                                    startActivity(intent);
175
188
176
                                }
189
                                }
192
                //当前状态为停止滑动状态SCROLL_STATE_IDLE时
205
                //当前状态为停止滑动状态SCROLL_STATE_IDLE时
193
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
206
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
194
                    iv_ask.setVisibility(View.VISIBLE);
207
                    iv_ask.setVisibility(View.VISIBLE);
195
                    if(isFirst)
208
                    if (isFirst)
196
                        share_info_icon.setVisibility(View.VISIBLE);
209
                        share_info_icon.setVisibility(View.VISIBLE);
197
                } else if (newState == RecyclerView.SCREEN_STATE_ON) {
210
                } else if (newState == RecyclerView.SCREEN_STATE_ON) {
198
                    iv_ask.setVisibility(View.GONE);
211
                    iv_ask.setVisibility(View.GONE);
199
                    if(isFirst)
212
                    if (isFirst)
200
                        share_info_icon.setVisibility(View.GONE);
213
                        share_info_icon.setVisibility(View.GONE);
201
                }
214
                }
202
            }
215
            }