dxh vor 5 Jahren
Ursprung
Commit
4317594656

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

@ -155,7 +155,10 @@ public class PersonalPageActivity extends Activity implements View.OnClickListen
155 155
        chargingShareBean.setText("快来看看"+qadata.userVo.nickName+"都在分享什么吧。");
156 156
157 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 162
        data_info.setText(qadata.userVo.topicNums + "");
160 163
        if (!"".equals(qadata.userVo.headImgUrl)) {
161 164
            Picasso.with(this)
@ -227,6 +230,8 @@ public class PersonalPageActivity extends Activity implements View.OnClickListen
227 230
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
228 231
            @Override
229 232
            public void onItemClickListener(int position, int index) {
233
                if(index == 2)
234
                    return;
230 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,7 +5,9 @@ import android.annotation.SuppressLint;
5 5
import android.app.Activity;
6 6
import android.app.ProgressDialog;
7 7
import android.content.Context;
8
import android.content.DialogInterface;
8 9
import android.content.Intent;
10
import android.content.SharedPreferences;
9 11
import android.content.pm.PackageManager;
10 12
import android.graphics.Bitmap;
11 13
import android.graphics.BitmapFactory;
@ -21,11 +23,13 @@ import android.os.Handler;
21 23
import android.os.Message;
22 24
import android.provider.MediaStore;
23 25
import android.support.v4.app.ActivityCompat;
26
import android.support.v7.app.AlertDialog;
24 27
import android.telephony.TelephonyManager;
25 28
import android.text.Editable;
26 29
import android.text.TextUtils;
27 30
import android.text.TextWatcher;
28 31
import android.util.Log;
32
import android.view.KeyEvent;
29 33
import android.view.LayoutInflater;
30 34
import android.view.View;
31 35
import android.view.View.OnClickListener;
@ -308,11 +312,16 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
308 312
    private ArrayList<String> publishArray = new ArrayList<>();
309 313
    private int publishCount = 0;
310 314
311
    final int reqTopic = -100;
315
    final int reqTopic = 100;
312 316
313 317
    @Override
314 318
    public void onClick(View v) {
315 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 325
            case R.id.publishtopic_choose_topic:
317 326
                startActivityForResult(new Intent(this, TopicActivity.class), reqTopic);
318 327
                break;
@ -323,7 +332,8 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
323 332
                        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
324 333
                    }
325 334
                }
326
                finish();
335
                showDialogToExit();
336
//                finish();
327 337
                break;
328 338
        }
329 339
    }
@ -472,9 +482,9 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
472 482
    }
473 483
474 484
    @Override
475
    protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
485
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
476 486
        super.onActivityResult(requestCode, resultCode, data);
477
        if (requestCode == -100 && resultCode == -100) {
487
        if (requestCode == reqTopic && resultCode == -100) {
478 488
            talkRecommendBean = (TalkRecommendBean) data.getSerializableExtra("topic");
479 489
            if (talkRecommendBean != null) {
480 490
                mPublishtopicChooseTopic.setText("# " + talkRecommendBean.topicName);
@ -881,4 +891,28 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
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,8 +138,15 @@ findViewById(R.id.request_refresh).setOnClickListener(this);
138 138
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
139 139
            @Override
140 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,6 +173,14 @@ public class WaterFallAdapter extends RecyclerView.Adapter<IViewHolder> {
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,6 +11,7 @@ import android.view.LayoutInflater;
11 11
import android.view.View;
12 12
import android.view.ViewGroup;
13 13
import android.widget.ImageView;
14
import android.widget.LinearLayout;
14 15
import android.widget.Toast;
15 16
16 17
import com.andview.refreshview.XRefreshView;
@ -47,6 +48,7 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
47 48
    private View view;
48 49
    StaggeredGridLayoutManager layoutManager;
49 50
    private ImageView iv_ask;
51
    private LinearLayout share_info_icon;
50 52
    private static final String TAG = "TalkRecommendFragment";
51 53
    private int page = 1;
52 54
@ -58,14 +60,17 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
58 60
        requestHeaderData();
59 61
    }
60 62
63
    boolean isFirst = false;
61 64
    @Override
62 65
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
63 66
                             Bundle savedInstanceState) {
64 67
        view = inflater.inflate(R.layout.activity_talk_recommend_tj, null);
65 68
        initXRefreshView();
69
        share_info_icon = view.findViewById(R.id.share_info_icon);
66 70
67 71
        String isFirstComeIn = ProfileManager.getInstance().getIsFirstComeIn(getActivity());
68 72
        if(TextUtils.isEmpty(isFirstComeIn)){
73
            isFirst = true;
69 74
            ProfileManager.getInstance().setFirstComeIn(getActivity(), "label");
70 75
            view.findViewById(R.id.share_info_icon).setVisibility(View.VISIBLE);
71 76
        }
@ -164,8 +169,12 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
164 169
                //当前状态为停止滑动状态SCROLL_STATE_IDLE时
165 170
                if (newState == RecyclerView.SCROLL_STATE_IDLE) {
166 171
                    iv_ask.setVisibility(View.VISIBLE);
172
                    if(isFirst)
173
                        share_info_icon.setVisibility(View.VISIBLE);
167 174
                } else if (newState == RecyclerView.SCREEN_STATE_ON) {
168 175
                    iv_ask.setVisibility(View.GONE);
176
                    if(isFirst)
177
                        share_info_icon.setVisibility(View.GONE);
169 178
                }
170 179
            }
171 180
@ -291,4 +300,6 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
291 300
            }
292 301
        });
293 302
    }
303
304
294 305
}

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

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