dxh 5 ans auparavant
Parent
commit
c63f236c01

+ 6 - 6
app/src/main/java/com/electric/chargingpile/activity/PersonalPageActivity.java

@ -126,10 +126,10 @@ public class PersonalPageActivity extends Activity implements View.OnClickListen
126 126
127 127
                        if (null != qadata.list && qadata.list.size() > 0) {
128 128
//                            shareUrl = qadata.list.get(0).shareUrl;
129
                            chargingShareBean.setIcon(qadata.list.get(0).coverImgUrl);
130
                            chargingShareBean.setTitle(qadata.list.get(0).topicName);
131
                            chargingShareBean.setUrl(qadata.list.get(0).shareUrl);
132
                            chargingShareBean.setText(qadata.list.get(0).title);
129
                            chargingShareBean.setIcon(qadata.userVo.coverImgUrl);
130
                            chargingShareBean.setTitle(qadata.userVo.nickName+"的个人主页");
131
                            chargingShareBean.setUrl(qadata.userVo.shareUrl);
132
                            chargingShareBean.setText("快来看看"+qadata.userVo.nickName+"都在分享什么吧。");
133 133
                        }
134 134
                    }
135 135
                    if (page == 1)
@ -154,8 +154,8 @@ public class PersonalPageActivity extends Activity implements View.OnClickListen
154 154
    }
155 155
156 156
    private void initHeaderData(HomePageBean qadata) {
157
        username_text.setText(qadata.userVo.nickName);
158
        username_content.setText(qadata.userVo.carName);
157
        username_text.setText(qadata.userVo.nickName+"");
158
        username_content.setText(qadata.userVo.carName+"");
159 159
        data_info.setText(qadata.userVo.topicNums + "");
160 160
        if (!"".equals(qadata.userVo.headImgUrl)) {
161 161
            Picasso.with(this)

+ 47 - 10
app/src/main/java/com/electric/chargingpile/activity/TopicDetailsActivity.java

@ -23,6 +23,7 @@ import android.widget.Toast;
23 23
import com.aspsine.irecyclerview.IRecyclerView;
24 24
import com.aspsine.irecyclerview.OnLoadMoreListener;
25 25
import com.blankj.utilcode.util.LogUtils;
26
import com.blankj.utilcode.util.NetworkUtils;
26 27
import com.electric.chargingpile.R;
27 28
import com.electric.chargingpile.adapter.WaterFallAdapter;
28 29
import com.electric.chargingpile.application.MainApplication;
@ -32,6 +33,7 @@ import com.electric.chargingpile.data.TalkRecommendBean;
32 33
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
33 34
import com.electric.chargingpile.util.ImageDisplayUtils;
34 35
import com.electric.chargingpile.util.JsonUtils;
36
import com.electric.chargingpile.util.NetUtil;
35 37
import com.electric.chargingpile.util.ScreenUtils;
36 38
import com.electric.chargingpile.util.ToastUtil;
37 39
import com.electric.chargingpile.view.PullToZoomScrollView3;
@ -84,7 +86,14 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
84 86
        initListeners();
85 87
        initListeners(findViewById(R.id.make_header_lines));
86 88
87
        requestData();
89
        if(NetUtil.CheckNetwork(this)){
90
            requestData();
91
        }else {
92
findViewById(R.id.no_net_view).setVisibility(View.VISIBLE);
93
findViewById(R.id.iv_back_nonet).setOnClickListener(this);
94
findViewById(R.id.request_refresh).setOnClickListener(this);
95
96
        }
88 97
//        requestShareData();
89 98
    }
90 99
@ -106,7 +115,8 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
106 115
        scrollview = (PullToZoomScrollView3) findViewById(R.id.scroll_view);
107 116
        scrollview.setVerticalScrollBarEnabled(false);
108 117
        screenHeight = ScreenUtils.getScreenHeight(this);
109
118
        ImageView iv_ask = (ImageView) findViewById(R.id.iv_ask);
119
        iv_ask.setOnClickListener(this);
110 120
    }
111 121
112 122
    private void initListeners() {
@ -134,9 +144,14 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
134 144
        });
135 145
    }
136 146
147
    ChargingShareBean chargingShareBean = new ChargingShareBean();
137 148
    @Override
138 149
    public void onClick(View v) {
139 150
        switch (v.getId()) {
151
            case R.id.iv_ask:
152
                startActivity(new Intent(this, PublishItemsActivity.class));
153
//                Toast.makeText(getActivity(), "分享", Toast.LENGTH_SHORT).show();
154
                break;
140 155
            case R.id.user_content_more:
141 156
                topic_content.setText(contentAll);
142 157
                user_content_more.setVisibility(View.GONE);
@ -147,13 +162,19 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
147 162
                    ToastUtil.showToast(this.getApplicationContext(),"请先登录", Toast.LENGTH_SHORT);
148 163
                    return;
149 164
                }
150
                ChargingShareBean chargingShareBean = new ChargingShareBean();
151
//                chargingShareBean.setIcon(shareThumbnail);
152
//                chargingShareBean.setTitle(shareTitle);
153
//                chargingShareBean.setUrl(shareUrl);
154
                chargingShareBean.setText("");
165
                if(null == chargingShareBean.getUrl() || TextUtils.isEmpty(chargingShareBean.getUrl()))
166
                    return;
155 167
                showSimpleBottomSheetGrid(chargingShareBean);
156 168
                break;
169
            case R.id.request_refresh:
170
                if(NetUtil.CheckNetwork(this)){
171
                    requestData();
172
173
                }
174
                break;
175
            case R.id.iv_back_nonet:
176
                finish();
177
                break;
157 178
            case R.id.iv_back:
158 179
                finish();
159 180
                break;
@ -181,7 +202,7 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
181 202
                                break;
182 203
                            case R.id.tv_3:
183 204
//                                Log.e(TAG, "onClick: 111" );
184
                                sort = 1;
205
                                sort = 3;
185 206
                                sortPopWindow.dismiss();
186 207
                                sort_text_info.setText("最热");
187 208
                                page = 1;
@ -246,7 +267,7 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
246 267
247 268
            @Override
248 269
            public void onResponse(String response) {
249
270
                findViewById(R.id.no_net_view).setVisibility(View.GONE);
250 271
                String rtnCode = JsonUtils.getKeyResult(response, "code");
251 272
                if ("1000".equals(rtnCode)) {
252 273
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
@ -254,9 +275,25 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
254 275
                    if (!haveLoadHeaderData) {
255 276
                        haveLoadHeaderData = true;
256 277
                        initHeaderData(qadata.list);
278
279
                        if (null != qadata.list && qadata.list.size() > 0) {
280
                            chargingShareBean.setIcon(qadata.list.get(0).coverImgUrl);
281
                            chargingShareBean.setTitle(qadata.list.get(0).topicName);
282
                            chargingShareBean.setUrl(qadata.list.get(0).shareUrl);
283
                            chargingShareBean.setText(qadata.list.get(0).title);
284
                        }
257 285
                    }
258
                    if (page == 1)
286
                    if (page == 1){
259 287
                        waterFallAdapter.setData(qadata.list);
288
289
                        if(null == qadata.list || qadata.list.size() == 0){
290
                            findViewById(R.id.no_content_view).setVisibility(View.VISIBLE);
291
                            comment_data.setVisibility(View.GONE);
292
                        }else {
293
                            findViewById(R.id.no_content_view).setVisibility(View.GONE);
294
                            comment_data.setVisibility(View.VISIBLE);
295
                        }
296
                    }
260 297
                    else
261 298
                        waterFallAdapter.addData(qadata.list);
262 299

+ 5 - 2
app/src/main/java/com/electric/chargingpile/adapter/LayoutAdapter.java

@ -142,8 +142,11 @@ public class LayoutAdapter extends RecyclerView.Adapter<IViewHolder> {
142 142
        }
143 143
144 144
        TalkRecommendBean talkRecommendBean = talkRecommendBeans.get(position - 1);
145
        simpleViewHolder.recycler_view_title.setText(talkRecommendBean.title);
146
        if(talkRecommendBean.likeNums == 0){
145
        if (TextUtils.isEmpty(talkRecommendBean.title))
146
            simpleViewHolder.recycler_view_title.setText("分享内容");
147
        else
148
            simpleViewHolder.recycler_view_title.setText(talkRecommendBean.title);
149
        if (talkRecommendBean.likeNums == 0) {
147 150
            simpleViewHolder.recycler_view_zan.setVisibility(View.GONE);
148 151
        }else if(talkRecommendBean.likeNums > 999){
149 152
            simpleViewHolder.recycler_view_zan.setVisibility(View.VISIBLE);

+ 1 - 0
app/src/main/java/com/electric/chargingpile/data/HomePageBean.java

@ -21,6 +21,7 @@ public class HomePageBean {
21 21
        public String carSeriesName;
22 22
        public String topicName;
23 23
        public String coverImgUrl;
24
        public String shareUrl;
24 25
        public String[] imgUrls;
25 26
        public int topicId;
26 27
        public int likeNums;

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

@ -391,7 +391,7 @@ public class SvVideoShowView implements View.OnClickListener {
391 391
    }
392 392
393 393
    public void updateView() {
394
        ToastUtil.showToast(activity, "updateView", Toast.LENGTH_LONG);
394
//        ToastUtil.showToast(activity, "updateView", Toast.LENGTH_LONG);
395 395
    }
396 396
397 397
    public void initAndPlay() {

BIN
app/src/main/res/drawable-xxhdpi/icon_main_qa.png


+ 19 - 1
app/src/main/res/layout/activity_personal_page.xml

@ -139,7 +139,8 @@
139 139
        android:id="@+id/xrefreshview"
140 140
        android:layout_width="match_parent"
141 141
        android:layout_height="match_parent"
142
        android:background="#fff">
142
        android:background="#fff"
143
        android:visibility="visible">
143 144
144 145
        <android.support.v7.widget.RecyclerView
145 146
            android:id="@+id/recycler_view_test_rv"
@ -148,4 +149,21 @@
148 149
            android:scrollbars="vertical" />
149 150
    </com.andview.refreshview.XRefreshView>
150 151
152
    <LinearLayout
153
        android:id="@+id/no_content_view"
154
        android:layout_width="match_parent"
155
        android:layout_height="match_parent"
156
        android:gravity="center_horizontal"
157
        android:background="@color/color_white"
158
        android:orientation="vertical">
159
        <TextView
160
            android:layout_width="match_parent"
161
            android:layout_height="wrap_content"
162
            android:gravity="center"
163
            android:text="@string/personal_shar_info_content"
164
            android:layout_marginTop="147dp"
165
            android:textSize="14sp"
166
            android:textColor="#555555"/>
167
    </LinearLayout>
168
151 169
</LinearLayout>

+ 65 - 0
app/src/main/res/layout/activity_topic_details_info.xml

@ -34,6 +34,7 @@
34 34
        </LinearLayout>
35 35
    </com.electric.chargingpile.view.PullToZoomScrollView3>
36 36
37
37 38
    <RelativeLayout
38 39
        android:id="@+id/rl_title"
39 40
        android:layout_width="fill_parent"
@ -79,4 +80,68 @@
79 80
    </RelativeLayout>
80 81
81 82
</RelativeLayout>
83
84
    <ImageView
85
        android:id="@+id/iv_ask"
86
        android:layout_width="56dp"
87
        android:layout_height="56dp"
88
        android:layout_alignParentRight="true"
89
        android:layout_alignParentBottom="true"
90
        android:layout_marginRight="15dp"
91
        android:layout_marginBottom="72dp"
92
        android:src="@drawable/app_share_talk_icon"/>
93
94
    <RelativeLayout
95
        android:layout_width="match_parent"
96
        android:layout_height="match_parent"
97
        android:background="@color/white"
98
        android:id="@+id/no_net_view"
99
        android:visibility="gone">
100
101
        <RelativeLayout
102
            android:id="@+id/rl_title_nonet"
103
            android:layout_width="fill_parent"
104
            android:layout_height="44dp"
105
            android:background="@color/white"
106
            android:visibility="visible">
107
108
            <ImageView
109
                android:id="@+id/iv_back_nonet"
110
                android:layout_width="wrap_content"
111
                android:layout_height="match_parent"
112
                android:layout_alignParentLeft="true"
113
                android:layout_centerVertical="true"
114
                android:contentDescription="@null"
115
                android:paddingLeft="15dp"
116
                android:paddingRight="15dp"
117
                android:src="@drawable/icon_lvback1119" />
118
119
        </RelativeLayout>
120
121
        <TextView
122
            android:id="@+id/banquan"
123
            android:layout_width="wrap_content"
124
            android:layout_height="wrap_content"
125
            android:layout_marginTop="260dp"
126
            android:text="小主网络跑掉了,请检查网络~"
127
            android:gravity="center"
128
            android:layout_centerHorizontal="true"
129
            android:textSize="14sp"
130
            android:textColor="#555555" />
131
132
        <TextView
133
            android:id="@+id/request_refresh"
134
            android:layout_width="144dp"
135
            android:layout_height="40dp"
136
            android:layout_centerHorizontal="true"
137
            android:layout_marginTop="20dp"
138
            android:layout_below="@+id/banquan"
139
            android:text="点击重新尝试"
140
            android:gravity="center"
141
            android:textSize="14sp"
142
            android:textColor="#555555"
143
            android:background="@drawable/bg_route_line_818181"/>
144
145
    </RelativeLayout>
146
82 147
</RelativeLayout>

+ 19 - 0
app/src/main/res/layout/activity_topic_infos_content.xml

@ -149,7 +149,26 @@
149 149
        app:refreshEnabled="false"
150 150
        app:loadMoreFooterLayout="@layout/layout_irecyclerview_load_more_footer"
151 151
        android:overScrollMode="never"
152
        android:visibility="visible"
152 153
        />
153 154
155
    <LinearLayout
156
        android:id="@+id/no_content_view"
157
        android:layout_width="match_parent"
158
        android:layout_height="match_parent"
159
        android:gravity="center_horizontal"
160
        android:background="@color/color_white"
161
        android:orientation="vertical"
162
        android:visibility="gone">
163
        <TextView
164
            android:layout_width="match_parent"
165
            android:layout_height="wrap_content"
166
            android:gravity="center"
167
            android:text="还没有任何内容哦,快来抢沙发~"
168
            android:layout_marginTop="147dp"
169
            android:textSize="14sp"
170
            android:textColor="#555555"/>
171
    </LinearLayout>
172
154 173
155 174
</LinearLayout>

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

@ -85,7 +85,7 @@
85 85
        android:layout_marginTop="150dp"
86 86
        android:gravity="center_horizontal"
87 87
        android:orientation="vertical"
88
        android:visibility="gone">
88
        android:visibility="visible">
89 89
90 90
        <TextView
91 91
            android:layout_width="123dp"
@ -96,6 +96,16 @@
96 96
            android:visibility="gone"
97 97
            android:textSize="14sp" />
98 98
99
        <ProgressBar
100
            android:id="@+id/pull_to_refresh_progress"
101
            style="?android:attr/progressBarStyleSmall"
102
            android:gravity="center"
103
            android:layout_width="wrap_content"
104
            android:layout_height="wrap_content"
105
            android:indeterminateTint="@color/click"
106
            android:layout_gravity="center"
107
            android:indeterminate="true" />
108
99 109
        <TextView
100 110
            android:layout_width="wrap_content"
101 111
            android:layout_height="wrap_content"

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

@ -11,7 +11,7 @@
11 11
        android:layout_centerHorizontal="true"
12 12
13 13
        android:contentDescription="@null"
14
        android:src="@drawable/bg_w_4" />
14
        android:src="@drawable/bg_w_41" />
15 15
16 16
    <ImageView
17 17
        android:layout_width="200dp"

+ 2 - 0
app/src/main/res/values/strings.xml

@ -204,4 +204,6 @@
204 204
    <string name="refresh_load_succeed">Loading succeeded</string>
205 205
    <string name="refresh_load_succeed_nomore">That\'s All!</string>
206 206
    <string name="refresh_load_fail">Loading failed</string>
207
    <string name="personal_shar_info_content">快来分享吧\n
208
小主大家都很期待你的精彩内容哦</string>
207 209
</resources>