Browse Source

bug修复

dxh 5 years ago
parent
commit
c63f236c01

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

126
126
127
                        if (null != qadata.list && qadata.list.size() > 0) {
127
                        if (null != qadata.list && qadata.list.size() > 0) {
128
//                            shareUrl = qadata.list.get(0).shareUrl;
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
                    if (page == 1)
135
                    if (page == 1)
154
    }
154
    }
155
155
156
    private void initHeaderData(HomePageBean qadata) {
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
        data_info.setText(qadata.userVo.topicNums + "");
159
        data_info.setText(qadata.userVo.topicNums + "");
160
        if (!"".equals(qadata.userVo.headImgUrl)) {
160
        if (!"".equals(qadata.userVo.headImgUrl)) {
161
            Picasso.with(this)
161
            Picasso.with(this)

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

23
import com.aspsine.irecyclerview.IRecyclerView;
23
import com.aspsine.irecyclerview.IRecyclerView;
24
import com.aspsine.irecyclerview.OnLoadMoreListener;
24
import com.aspsine.irecyclerview.OnLoadMoreListener;
25
import com.blankj.utilcode.util.LogUtils;
25
import com.blankj.utilcode.util.LogUtils;
26
import com.blankj.utilcode.util.NetworkUtils;
26
import com.electric.chargingpile.R;
27
import com.electric.chargingpile.R;
27
import com.electric.chargingpile.adapter.WaterFallAdapter;
28
import com.electric.chargingpile.adapter.WaterFallAdapter;
28
import com.electric.chargingpile.application.MainApplication;
29
import com.electric.chargingpile.application.MainApplication;
32
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
33
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
33
import com.electric.chargingpile.util.ImageDisplayUtils;
34
import com.electric.chargingpile.util.ImageDisplayUtils;
34
import com.electric.chargingpile.util.JsonUtils;
35
import com.electric.chargingpile.util.JsonUtils;
36
import com.electric.chargingpile.util.NetUtil;
35
import com.electric.chargingpile.util.ScreenUtils;
37
import com.electric.chargingpile.util.ScreenUtils;
36
import com.electric.chargingpile.util.ToastUtil;
38
import com.electric.chargingpile.util.ToastUtil;
37
import com.electric.chargingpile.view.PullToZoomScrollView3;
39
import com.electric.chargingpile.view.PullToZoomScrollView3;
84
        initListeners();
86
        initListeners();
85
        initListeners(findViewById(R.id.make_header_lines));
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
//        requestShareData();
97
//        requestShareData();
89
    }
98
    }
90
99
106
        scrollview = (PullToZoomScrollView3) findViewById(R.id.scroll_view);
115
        scrollview = (PullToZoomScrollView3) findViewById(R.id.scroll_view);
107
        scrollview.setVerticalScrollBarEnabled(false);
116
        scrollview.setVerticalScrollBarEnabled(false);
108
        screenHeight = ScreenUtils.getScreenHeight(this);
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
    private void initListeners() {
122
    private void initListeners() {
134
        });
144
        });
135
    }
145
    }
136
146
147
    ChargingShareBean chargingShareBean = new ChargingShareBean();
137
    @Override
148
    @Override
138
    public void onClick(View v) {
149
    public void onClick(View v) {
139
        switch (v.getId()) {
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
            case R.id.user_content_more:
155
            case R.id.user_content_more:
141
                topic_content.setText(contentAll);
156
                topic_content.setText(contentAll);
142
                user_content_more.setVisibility(View.GONE);
157
                user_content_more.setVisibility(View.GONE);
147
                    ToastUtil.showToast(this.getApplicationContext(),"请先登录", Toast.LENGTH_SHORT);
162
                    ToastUtil.showToast(this.getApplicationContext(),"请先登录", Toast.LENGTH_SHORT);
148
                    return;
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
                showSimpleBottomSheetGrid(chargingShareBean);
167
                showSimpleBottomSheetGrid(chargingShareBean);
156
                break;
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
            case R.id.iv_back:
178
            case R.id.iv_back:
158
                finish();
179
                finish();
159
                break;
180
                break;
181
                                break;
202
                                break;
182
                            case R.id.tv_3:
203
                            case R.id.tv_3:
183
//                                Log.e(TAG, "onClick: 111" );
204
//                                Log.e(TAG, "onClick: 111" );
184
                                sort = 1;
205
                                sort = 3;
185
                                sortPopWindow.dismiss();
206
                                sortPopWindow.dismiss();
186
                                sort_text_info.setText("最热");
207
                                sort_text_info.setText("最热");
187
                                page = 1;
208
                                page = 1;
246
267
247
            @Override
268
            @Override
248
            public void onResponse(String response) {
269
            public void onResponse(String response) {
249
270
                findViewById(R.id.no_net_view).setVisibility(View.GONE);
250
                String rtnCode = JsonUtils.getKeyResult(response, "code");
271
                String rtnCode = JsonUtils.getKeyResult(response, "code");
251
                if ("1000".equals(rtnCode)) {
272
                if ("1000".equals(rtnCode)) {
252
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
273
                    String rtnMsg = JsonUtils.getKeyResult(response, "data");
254
                    if (!haveLoadHeaderData) {
275
                    if (!haveLoadHeaderData) {
255
                        haveLoadHeaderData = true;
276
                        haveLoadHeaderData = true;
256
                        initHeaderData(qadata.list);
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
                        waterFallAdapter.setData(qadata.list);
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
                    else
297
                    else
261
                        waterFallAdapter.addData(qadata.list);
298
                        waterFallAdapter.addData(qadata.list);
262
299

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

142
        }
142
        }
143
143
144
        TalkRecommendBean talkRecommendBean = talkRecommendBeans.get(position - 1);
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
            simpleViewHolder.recycler_view_zan.setVisibility(View.GONE);
150
            simpleViewHolder.recycler_view_zan.setVisibility(View.GONE);
148
        }else if(talkRecommendBean.likeNums > 999){
151
        }else if(talkRecommendBean.likeNums > 999){
149
            simpleViewHolder.recycler_view_zan.setVisibility(View.VISIBLE);
152
            simpleViewHolder.recycler_view_zan.setVisibility(View.VISIBLE);

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

21
        public String carSeriesName;
21
        public String carSeriesName;
22
        public String topicName;
22
        public String topicName;
23
        public String coverImgUrl;
23
        public String coverImgUrl;
24
        public String shareUrl;
24
        public String[] imgUrls;
25
        public String[] imgUrls;
25
        public int topicId;
26
        public int topicId;
26
        public int likeNums;
27
        public int likeNums;

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

391
    }
391
    }
392
392
393
    public void updateView() {
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
    public void initAndPlay() {
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
        android:id="@+id/xrefreshview"
139
        android:id="@+id/xrefreshview"
140
        android:layout_width="match_parent"
140
        android:layout_width="match_parent"
141
        android:layout_height="match_parent"
141
        android:layout_height="match_parent"
142
        android:background="#fff">
142
        android:background="#fff"
143
        android:visibility="visible">
143
144
144
        <android.support.v7.widget.RecyclerView
145
        <android.support.v7.widget.RecyclerView
145
            android:id="@+id/recycler_view_test_rv"
146
            android:id="@+id/recycler_view_test_rv"
148
            android:scrollbars="vertical" />
149
            android:scrollbars="vertical" />
149
    </com.andview.refreshview.XRefreshView>
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
</LinearLayout>
169
</LinearLayout>

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

34
        </LinearLayout>
34
        </LinearLayout>
35
    </com.electric.chargingpile.view.PullToZoomScrollView3>
35
    </com.electric.chargingpile.view.PullToZoomScrollView3>
36
36
37
37
    <RelativeLayout
38
    <RelativeLayout
38
        android:id="@+id/rl_title"
39
        android:id="@+id/rl_title"
39
        android:layout_width="fill_parent"
40
        android:layout_width="fill_parent"
79
    </RelativeLayout>
80
    </RelativeLayout>
80
81
81
</RelativeLayout>
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
</RelativeLayout>
147
</RelativeLayout>

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

149
        app:refreshEnabled="false"
149
        app:refreshEnabled="false"
150
        app:loadMoreFooterLayout="@layout/layout_irecyclerview_load_more_footer"
150
        app:loadMoreFooterLayout="@layout/layout_irecyclerview_load_more_footer"
151
        android:overScrollMode="never"
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
</LinearLayout>
174
</LinearLayout>

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

85
        android:layout_marginTop="150dp"
85
        android:layout_marginTop="150dp"
86
        android:gravity="center_horizontal"
86
        android:gravity="center_horizontal"
87
        android:orientation="vertical"
87
        android:orientation="vertical"
88
        android:visibility="gone">
88
        android:visibility="visible">
89
89
90
        <TextView
90
        <TextView
91
            android:layout_width="123dp"
91
            android:layout_width="123dp"
96
            android:visibility="gone"
96
            android:visibility="gone"
97
            android:textSize="14sp" />
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
        <TextView
109
        <TextView
100
            android:layout_width="wrap_content"
110
            android:layout_width="wrap_content"
101
            android:layout_height="wrap_content"
111
            android:layout_height="wrap_content"

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

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

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

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