Browse Source

图片上传 发布

dxh 6 years ago
parent
commit
9bf5250502

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

@ -123,7 +123,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
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 128
    private String topicId = "";
129 129
    //空间名
@ -173,6 +173,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
173 173
        mPublishTopicDe.setOnClickListener(this);
174 174
        mPublishtopicChooseTopic = (TextView) findViewById(R.id.publishtopic_choose_topic);
175 175
        publishtopic_choose_topic = (TextView) findViewById(R.id.publishtopic_choose_topic);
176
        publishtopic_word_num = (TextView) findViewById(R.id.publishtopic_word_num);
176 177
        publishtopic_choose_topic.setOnClickListener(this);
177 178
        insertDialog = new ProgressDialog(this);
178 179
        insertDialog.setMessage("正在插入图片...");
@ -237,12 +238,17 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
237 238
                    tv_right.setEnabled(false);
238 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 249
        imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
245 250
251
246 252
    }
247 253
248 254
    private void getYouPaiData() {
@ -834,6 +840,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
834 840
        map.put("topicId", topicId);
835 841
        if (MainApplication.isLogin()) {
836 842
            map.put("userId", MainApplication.userId);
843
            map.put("appToken", MainApplication.messageToken);
837 844
        }
838 845
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
839 846
            @Override

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

@ -85,6 +85,7 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
85 85
        initListeners(findViewById(R.id.make_header_lines));
86 86
87 87
        requestData();
88
//        requestShareData();
88 89
    }
89 90
90 91
    private void initView() {
@ -368,4 +369,26 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
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,6 +60,8 @@ public class WaterFallAdapter extends RecyclerView.Adapter<IViewHolder> {
60 60
    @Override
61 61
    public int getItemCount() {
62 62
        // 加一是因为添加了头部
63
        if(null == talkRecommendBeans)
64
            return 0;
63 65
        return talkRecommendBeans.size();
64 66
    }
65 67

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

@ -237,10 +237,20 @@
237 237
        android:id="@+id/publishtopic_word_num"
238 238
        android:layout_width="wrap_content"
239 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 250
        android:layout_alignParentBottom="true"
241 251
        android:layout_toStartOf="@+id/publishtopic_choose_preview"
242 252
        android:gravity="center_vertical"
243
        android:text="0/500"
253
        android:text="/500"
244 254
        android:textSize="14sp" />
245 255

246 256


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

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

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

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