浏览代码

图片上传 发布

dxh 6 年之前
父节点
当前提交
9bf5250502

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

123
    private static final int RC_ALBUM_PERM = 123;
123
    private static final int RC_ALBUM_PERM = 123;
124
124
125
125
126
    private TextView publishtopic_choose_topic, mPublishtopicChooseTopic;
126
    private TextView publishtopic_choose_topic, mPublishtopicChooseTopic, publishtopic_word_num;
127
127
128
    private String topicId = "";
128
    private String topicId = "";
129
    //空间名
129
    //空间名
173
        mPublishTopicDe.setOnClickListener(this);
173
        mPublishTopicDe.setOnClickListener(this);
174
        mPublishtopicChooseTopic = (TextView) findViewById(R.id.publishtopic_choose_topic);
174
        mPublishtopicChooseTopic = (TextView) findViewById(R.id.publishtopic_choose_topic);
175
        publishtopic_choose_topic = (TextView) findViewById(R.id.publishtopic_choose_topic);
175
        publishtopic_choose_topic = (TextView) findViewById(R.id.publishtopic_choose_topic);
176
        publishtopic_word_num = (TextView) findViewById(R.id.publishtopic_word_num);
176
        publishtopic_choose_topic.setOnClickListener(this);
177
        publishtopic_choose_topic.setOnClickListener(this);
177
        insertDialog = new ProgressDialog(this);
178
        insertDialog = new ProgressDialog(this);
178
        insertDialog.setMessage("正在插入图片...");
179
        insertDialog.setMessage("正在插入图片...");
237
                    tv_right.setEnabled(false);
238
                    tv_right.setEnabled(false);
238
                    tv_right.setBackgroundColor(Color.parseColor("color_9ed3ae"));
239
                    tv_right.setBackgroundColor(Color.parseColor("color_9ed3ae"));
239
                }
240
                }
241
                if(TextUtils.isEmpty(s))
242
                    publishtopic_word_num.setText("0");
243
                else
244
                    publishtopic_word_num.setText(s.length()+"");
240
            }
245
            }
241
        });
246
        });
242
247
243
248
244
        imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
249
        imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
245
250
251
246
    }
252
    }
247
253
248
    private void getYouPaiData() {
254
    private void getYouPaiData() {
834
        map.put("topicId", topicId);
840
        map.put("topicId", topicId);
835
        if (MainApplication.isLogin()) {
841
        if (MainApplication.isLogin()) {
836
            map.put("userId", MainApplication.userId);
842
            map.put("userId", MainApplication.userId);
843
            map.put("appToken", MainApplication.messageToken);
837
        }
844
        }
838
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
845
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
839
            @Override
846
            @Override

+ 23 - 0
app/src/main/java/com/electric/chargingpile/activity/TopicDetailsActivity.java

85
        initListeners(findViewById(R.id.make_header_lines));
85
        initListeners(findViewById(R.id.make_header_lines));
86
86
87
        requestData();
87
        requestData();
88
//        requestShareData();
88
    }
89
    }
89
90
90
    private void initView() {
91
    private void initView() {
368
            }
369
            }
369
        });
370
        });
370
    }
371
    }
372
373
    private void requestShareData() {
374
        String url = MainApplication.urlNew + "/topic/share.do";
375
        Map<String, String> map = new HashMap<>();
376
        map.put("topicId", topicId + "");
377
//        map.put("targetType", targetType);
378
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
379
            @Override
380
            public void onError(Call call, Exception e) {
381
            }
382
383
            @Override
384
            public void onResponse(String response) {
385
386
                String rtnCode = JsonUtils.getKeyResult(response, "code");
387
                if ("1000".equals(rtnCode)) {
388
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
389
                    HomePageBean qadata = (HomePageBean) JsonUtils.parseToObjectBean(rtnMsg, HomePageBean.class);
390
                }
391
            }
392
        });
393
    }
371
}
394
}

+ 2 - 0
app/src/main/java/com/electric/chargingpile/adapter/WaterFallAdapter.java

60
    @Override
60
    @Override
61
    public int getItemCount() {
61
    public int getItemCount() {
62
        // 加一是因为添加了头部
62
        // 加一是因为添加了头部
63
        if(null == talkRecommendBeans)
64
            return 0;
63
        return talkRecommendBeans.size();
65
        return talkRecommendBeans.size();
64
    }
66
    }
65
67

+ 11 - 1
app/src/main/res/layout/activity_publish_picture_content.xml

237
        android:id="@+id/publishtopic_word_num"
237
        android:id="@+id/publishtopic_word_num"
238
        android:layout_width="wrap_content"
238
        android:layout_width="wrap_content"
239
        android:layout_height="49dp"
239
        android:layout_height="49dp"
240
        android:layout_toLeftOf="@+id/publishtopic_word"
241
        android:layout_alignParentBottom="true"
242
        android:gravity="center_vertical"
243
        android:text="0"
244
        android:textSize="14sp" />
245

246
    <TextView
247
        android:id="@+id/publishtopic_word"
248
        android:layout_width="wrap_content"
249
        android:layout_height="49dp"
240
        android:layout_alignParentBottom="true"
250
        android:layout_alignParentBottom="true"
241
        android:layout_toStartOf="@+id/publishtopic_choose_preview"
251
        android:layout_toStartOf="@+id/publishtopic_choose_preview"
242
        android:gravity="center_vertical"
252
        android:gravity="center_vertical"
243
        android:text="0/500"
253
        android:text="/500"
244
        android:textSize="14sp" />
254
        android:textSize="14sp" />
245

255

246

256


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

61
            android:gravity="center"
61
            android:gravity="center"
62
            android:singleLine="true"
62
            android:singleLine="true"
63
            android:ellipsize="end"
63
            android:ellipsize="end"
64
            android:text="@string/about_name"
64
            android:text=""
65
            android:textColor="#222222"
65
            android:textColor="#222222"
66
            android:textSize="16sp" />
66
            android:textSize="16sp" />
67
67

+ 2 - 2
app/src/main/res/layout/activity_topic_infos_content.xml

25
            android:layout_height="match_parent"
25
            android:layout_height="match_parent"
26
            android:layout_marginLeft="5dp"
26
            android:layout_marginLeft="5dp"
27
            android:layout_marginRight="15dp"
27
            android:layout_marginRight="15dp"
28
            android:text="111111"
28
            android:text=""
29
            android:gravity="center_vertical"
29
            android:gravity="center_vertical"
30
            android:maxLines="2"
30
            android:maxLines="2"
31
            android:ellipsize="end"
31
            android:ellipsize="end"
45
            android:layout_height="wrap_content"
45
            android:layout_height="wrap_content"
46
            android:layout_marginLeft="15dp"
46
            android:layout_marginLeft="15dp"
47
            android:layout_marginRight="15dp"
47
            android:layout_marginRight="15dp"
48
            android:text="111111"
48
            android:text=""
49
            android:textSize="15sp"
49
            android:textSize="15sp"
50
            android:textColor="#555555"/>
50
            android:textColor="#555555"/>
51
51