Browse Source

bug修复

dxh 5 years ago
parent
commit
4317594656

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

155
        chargingShareBean.setText("快来看看"+qadata.userVo.nickName+"都在分享什么吧。");
155
        chargingShareBean.setText("快来看看"+qadata.userVo.nickName+"都在分享什么吧。");
156
156
157
        username_text.setText(qadata.userVo.nickName+"");
157
        username_text.setText(qadata.userVo.nickName+"");
158
        username_content.setText(qadata.userVo.carName+"");
158
        if(TextUtils.isEmpty(qadata.userVo.carName))
159
            username_content.setText("");
160
        else
161
            username_content.setText(qadata.userVo.carName+"");
159
        data_info.setText(qadata.userVo.topicNums + "");
162
        data_info.setText(qadata.userVo.topicNums + "");
160
        if (!"".equals(qadata.userVo.headImgUrl)) {
163
        if (!"".equals(qadata.userVo.headImgUrl)) {
161
            Picasso.with(this)
164
            Picasso.with(this)
227
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
230
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
228
            @Override
231
            @Override
229
            public void onItemClickListener(int position, int index) {
232
            public void onItemClickListener(int position, int index) {
233
                if(index == 2)
234
                    return;
230
                startActivity(new Intent(PersonalPageActivity.this, TopicDetailsActivity.class).putExtra("topicId", waterFallAdapter.getCurrentData().get(position).topicId + ""));
235
                startActivity(new Intent(PersonalPageActivity.this, TopicDetailsActivity.class).putExtra("topicId", waterFallAdapter.getCurrentData().get(position).topicId + ""));
231
            }
236
            }
232
        });
237
        });

+ 38 - 4
app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java

5
import android.app.Activity;
5
import android.app.Activity;
6
import android.app.ProgressDialog;
6
import android.app.ProgressDialog;
7
import android.content.Context;
7
import android.content.Context;
8
import android.content.DialogInterface;
8
import android.content.Intent;
9
import android.content.Intent;
10
import android.content.SharedPreferences;
9
import android.content.pm.PackageManager;
11
import android.content.pm.PackageManager;
10
import android.graphics.Bitmap;
12
import android.graphics.Bitmap;
11
import android.graphics.BitmapFactory;
13
import android.graphics.BitmapFactory;
21
import android.os.Message;
23
import android.os.Message;
22
import android.provider.MediaStore;
24
import android.provider.MediaStore;
23
import android.support.v4.app.ActivityCompat;
25
import android.support.v4.app.ActivityCompat;
26
import android.support.v7.app.AlertDialog;
24
import android.telephony.TelephonyManager;
27
import android.telephony.TelephonyManager;
25
import android.text.Editable;
28
import android.text.Editable;
26
import android.text.TextUtils;
29
import android.text.TextUtils;
27
import android.text.TextWatcher;
30
import android.text.TextWatcher;
28
import android.util.Log;
31
import android.util.Log;
32
import android.view.KeyEvent;
29
import android.view.LayoutInflater;
33
import android.view.LayoutInflater;
30
import android.view.View;
34
import android.view.View;
31
import android.view.View.OnClickListener;
35
import android.view.View.OnClickListener;
308
    private ArrayList<String> publishArray = new ArrayList<>();
312
    private ArrayList<String> publishArray = new ArrayList<>();
309
    private int publishCount = 0;
313
    private int publishCount = 0;
310
314
311
    final int reqTopic = -100;
315
    final int reqTopic = 100;
312
316
313
    @Override
317
    @Override
314
    public void onClick(View v) {
318
    public void onClick(View v) {
315
        switch (v.getId()) {
319
        switch (v.getId()) {
320
            case R.id.publishtopic_choose_topic_de:
321
                mPublishtopicChooseTopic.setText("# 选择话题");
322
                mPublishTopicDe.setVisibility(View.GONE);
323
                talkRecommendBean = null;
324
                break;
316
            case R.id.publishtopic_choose_topic:
325
            case R.id.publishtopic_choose_topic:
317
                startActivityForResult(new Intent(this, TopicActivity.class), reqTopic);
326
                startActivityForResult(new Intent(this, TopicActivity.class), reqTopic);
318
                break;
327
                break;
323
                        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
332
                        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
324
                    }
333
                    }
325
                }
334
                }
326
                finish();
335
                showDialogToExit();
336
//                finish();
327
                break;
337
                break;
328
        }
338
        }
329
    }
339
    }
472
    }
482
    }
473
483
474
    @Override
484
    @Override
475
    protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
485
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
476
        super.onActivityResult(requestCode, resultCode, data);
486
        super.onActivityResult(requestCode, resultCode, data);
477
        if (requestCode == -100 && resultCode == -100) {
487
        if (requestCode == reqTopic && resultCode == -100) {
478
            talkRecommendBean = (TalkRecommendBean) data.getSerializableExtra("topic");
488
            talkRecommendBean = (TalkRecommendBean) data.getSerializableExtra("topic");
479
            if (talkRecommendBean != null) {
489
            if (talkRecommendBean != null) {
480
                mPublishtopicChooseTopic.setText("# " + talkRecommendBean.topicName);
490
                mPublishtopicChooseTopic.setText("# " + talkRecommendBean.topicName);
881
            }
891
            }
882
        });
892
        });
883
    }
893
    }
894
895
    private void showDialogToExit(){
896
        AlertDialog.Builder builder = new AlertDialog.Builder(PublishPicTopicActivity.this);
897
        builder.setTitle("提示");
898
        builder.setMessage("确认取消发布?");
899
        builder.setCancelable(false);
900
        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
901
            @Override
902
            public void onClick(DialogInterface dialog, int which) {
903
                finish();
904
            }
905
        });
906
        builder.setNegativeButton("取消", null);
907
        builder.create().show();
908
    }
909
910
    @Override
911
    public boolean onKeyUp(int keyCode, KeyEvent event) {
912
        if (keyCode == KeyEvent.KEYCODE_BACK) {
913
            showDialogToExit();
914
            return true;
915
        }
916
        return false;
917
    }
884
}
918
}

+ 9 - 2
app/src/main/java/com/electric/chargingpile/activity/TopicDetailsActivity.java

138
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
138
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
139
            @Override
139
            @Override
140
            public void onItemClickListener(int position, int index) {
140
            public void onItemClickListener(int position, int index) {
141
                String topicId = waterFallAdapter.getCurrentData().get(position).topicId+"";
142
                startActivity(new Intent(TopicDetailsActivity.this, TopicDetailsActivity.class).putExtra("topicId", topicId));
141
                int pos = position - 1;
142
                ArrayList<TalkRecommendBean> talkRecommendBeans = waterFallAdapter.getCurrentData();
143
                Intent intent = new Intent(TopicDetailsActivity.this, VideoDetaislActivity.class);
144
                intent.putExtra("list", talkRecommendBeans);
145
                intent.putExtra("pos", pos);
146
                startActivity(intent);
147
148
//                String topicId = waterFallAdapter.getCurrentData().get(position).topicId+"";
149
//                startActivity(new Intent(TopicDetailsActivity.this, TopicDetailsActivity.class).putExtra("topicId", topicId));
143
            }
150
            }
144
        });
151
        });
145
    }
152
    }

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

173
                    }
173
                    }
174
                }
174
                }
175
            });
175
            });
176
            user_avater.setOnClickListener(new View.OnClickListener() {
177
                @Override
178
                public void onClick(View view) {
179
                    if (onRecyclerItemClickListener != null) {
180
                        onRecyclerItemClickListener.onItemClickListener(getLayoutPosition(), 2);
181
                    }
182
                }
183
            });
176
        }
184
        }
177
    }
185
    }
178
}
186
}

+ 11 - 0
app/src/main/java/com/electric/chargingpile/fragment/TalkRecommendFragment.java

11
import android.view.View;
11
import android.view.View;
12
import android.view.ViewGroup;
12
import android.view.ViewGroup;
13
import android.widget.ImageView;
13
import android.widget.ImageView;
14
import android.widget.LinearLayout;
14
import android.widget.Toast;
15
import android.widget.Toast;
15
16
16
import com.andview.refreshview.XRefreshView;
17
import com.andview.refreshview.XRefreshView;
47
    private View view;
48
    private View view;
48
    StaggeredGridLayoutManager layoutManager;
49
    StaggeredGridLayoutManager layoutManager;
49
    private ImageView iv_ask;
50
    private ImageView iv_ask;
51
    private LinearLayout share_info_icon;
50
    private static final String TAG = "TalkRecommendFragment";
52
    private static final String TAG = "TalkRecommendFragment";
51
    private int page = 1;
53
    private int page = 1;
52
54
58
        requestHeaderData();
60
        requestHeaderData();
59
    }
61
    }
60
62
63
    boolean isFirst = false;
61
    @Override
64
    @Override
62
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
65
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
63
                             Bundle savedInstanceState) {
66
                             Bundle savedInstanceState) {
64
        view = inflater.inflate(R.layout.activity_talk_recommend_tj, null);
67
        view = inflater.inflate(R.layout.activity_talk_recommend_tj, null);
65
        initXRefreshView();
68
        initXRefreshView();
69
        share_info_icon = view.findViewById(R.id.share_info_icon);
66
70
67
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
71
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
68
        if(TextUtils.isEmpty(isFirstComeIn)){
72
        if(TextUtils.isEmpty(isFirstComeIn)){
73
            isFirst = true;
69
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
74
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
70
            view.findViewById(R.id.share_info_icon).setVisibility(View.VISIBLE);
75
            view.findViewById(R.id.share_info_icon).setVisibility(View.VISIBLE);
71
        }
76
        }
164
                //当前状态为停止滑动状态SCROLL_STATE_IDLE时
169
                //当前状态为停止滑动状态SCROLL_STATE_IDLE时
165
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
170
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
166
                    iv_ask.setVisibility(View.VISIBLE);
171
                    iv_ask.setVisibility(View.VISIBLE);
172
                    if(isFirst)
173
                        share_info_icon.setVisibility(View.VISIBLE);
167
                } else if (newState == RecyclerView.SCREEN_STATE_ON) {
174
                } else if (newState == RecyclerView.SCREEN_STATE_ON) {
168
                    iv_ask.setVisibility(View.GONE);
175
                    iv_ask.setVisibility(View.GONE);
176
                    if(isFirst)
177
                        share_info_icon.setVisibility(View.GONE);
169
                }
178
                }
170
            }
179
            }
171
180
291
            }
300
            }
292
        });
301
        });
293
    }
302
    }
303
304
294
}
305
}

+ 1 - 1
app/src/main/res/drawable/bg_yuan_black.xml

3
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4
    <item>
4
    <item>
5
        <shape>
5
        <shape>
6
            <stroke android:width="0.6dp" android:color="@color/white" /><!--边框颜色-->
6
            <stroke android:width="0.6dp" android:color="#000000" /><!--边框颜色-->
7
            <solid android:color="#000000" /><!--填充色-->
7
            <solid android:color="#000000" /><!--填充色-->
8
            <corners android:radius="10dp" />
8
            <corners android:radius="10dp" />
9
9