dxh 5 years ago
parent
commit
34ae39da73

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

@ -21,6 +21,7 @@ import com.electric.chargingpile.adapter.WaterFallAdapter;
21 21
import com.electric.chargingpile.application.MainApplication;
22 22
import com.electric.chargingpile.data.ChargingShareBean;
23 23
import com.electric.chargingpile.data.HomePageBean;
24
import com.electric.chargingpile.iview.RecyclerItemTypeClickListener;
24 25
import com.electric.chargingpile.util.BarColorUtil;
25 26
import com.electric.chargingpile.util.JsonUtils;
26 27
import com.electric.chargingpile.util.NetUtil;
@ -213,6 +214,13 @@ public class PersonalPageActivity extends Activity implements View.OnClickListen
213 214
                requestData();
214 215
            }
215 216
        });
217
218
        waterFallAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
219
            @Override
220
            public void onItemClickListener(int position, int index) {
221
                startActivity(new Intent(PersonalPageActivity.this, TopicDetailsActivity.class).putExtra("topicId", waterFallAdapter.getCurrentData().get(position).topicId+""));
222
            }
223
        });
216 224
    }
217 225
218 226
    @Override
@ -229,6 +237,12 @@ public class PersonalPageActivity extends Activity implements View.OnClickListen
229 237
                break;
230 238
            case R.id.iv_more:
231 239
240
                if (!MainApplication.isLogin()){
241
                    startActivity(new Intent(this.getApplicationContext(),LoginActivity.class));
242
                    ToastUtil.showToast(this.getApplicationContext(),"请先登录", Toast.LENGTH_SHORT);
243
                    return;
244
                }
245
232 246
//                if(null == chargingShareBean){
233 247
//                    getShareData();
234 248
//                    return;

+ 10 - 0
app/src/main/java/com/electric/chargingpile/activity/TalkActivity.java

@ -26,6 +26,7 @@ import com.electric.chargingpile.fragment.QaActivityFragment;
26 26
import com.electric.chargingpile.fragment.TalkRecommendFragment;
27 27
import com.electric.chargingpile.manager.ProfileManager;
28 28
import com.electric.chargingpile.util.BarColorUtil;
29
import com.electric.chargingpile.util.OnDoubleClickListener;
29 30
import com.umeng.analytics.MobclickAgent;
30 31
31 32
import java.util.ArrayList;
@ -77,6 +78,15 @@ public class TalkActivity extends AppCompatActivity implements View.OnClickListe
77 78
        tab_main = (LinearLayout) findViewById(R.id.tab_main);
78 79
        tab_main.setOnClickListener(this);
79 80
        tab_qa = (LinearLayout) findViewById(R.id.tab_qa);
81
        tab_qa.setOnTouchListener(new OnDoubleClickListener(new OnDoubleClickListener.DoubleClickCallback() {
82
83
            @Override
84
            public void onDoubleClick() {
85
                // TODO Auto-generated method stub
86
87
                talkFragment1.refreshList();
88
            }
89
        }));
80 90
        tab_screening = (LinearLayout) findViewById(R.id.tab_screening);
81 91
        tab_find = (RelativeLayout) findViewById(R.id.ll_tab_find);
82 92
        tab_me = (LinearLayout) findViewById(R.id.tab_me);

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

@ -142,6 +142,11 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
142 142
                user_content_more.setVisibility(View.GONE);
143 143
                break;
144 144
            case R.id.textview_share:
145
                if (!MainApplication.isLogin()){
146
                    startActivity(new Intent(this.getApplicationContext(),LoginActivity.class));
147
                    ToastUtil.showToast(this.getApplicationContext(),"请先登录", Toast.LENGTH_SHORT);
148
                    return;
149
                }
145 150
                ChargingShareBean chargingShareBean = new ChargingShareBean();
146 151
//                chargingShareBean.setIcon(shareThumbnail);
147 152
//                chargingShareBean.setTitle(shareTitle);
@ -278,8 +283,8 @@ public class TopicDetailsActivity extends FragmentActivity implements View.OnCli
278 283
            read_data.setText(list.get(0).visitNums+"");
279 284
            join_data.setText(list.get(0).joinNums+"");
280 285
            contentAll = list.get(0).title;
281
            if(!TextUtils.isEmpty(contentAll) && contentAll.length()>100){
282
                topic_content.setText(contentAll.substring(0, 100));
286
            if(!TextUtils.isEmpty(contentAll) && contentAll.length()>80){
287
                topic_content.setText(contentAll.substring(0, 80));
283 288
                user_content_more.setVisibility(View.VISIBLE);
284 289
            }else {
285 290
                topic_content.setText(contentAll);

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

@ -184,7 +184,7 @@ public class LayoutAdapter extends RecyclerView.Adapter<IViewHolder> {
184 184
                    .into(simpleViewHolder.user_avater);
185 185
        } else {
186 186
            Picasso.with(context)
187
                    .load(talkRecommendBean.headImgUrl)
187
                    .load("http://cdz.evcharge.cc/zhannew/uploadfile/"+talkRecommendBean.headImgUrl)
188 188
                    .placeholder(R.drawable.icon_face2_0)
189 189
                    .error(R.drawable.icon_face2_0)
190 190
                    .transform(new CircleTransform())

+ 7 - 1
app/src/main/java/com/electric/chargingpile/adapter/TalkRecommendHeaderAdapter.java

@ -90,7 +90,13 @@ public class TalkRecommendHeaderAdapter extends RecyclerView.Adapter<IViewHolder
90 90
        final CollectionCarsHolder collectionCarsHolder = (CollectionCarsHolder) holder;
91 91
        final TalkRecommendBean talkRecommendBean = lists.get(position);
92 92
        collectionCarsHolder.header_title.setText(talkRecommendBean.name);
93
        collectionCarsHolder.header_title_joinin.setText(talkRecommendBean.joinNums + "参与");
93
        if(talkRecommendBean.joinNums > 10000){
94
            String number = talkRecommendBean.joinNums+"";
95
            String number1 = number.substring(0,1);
96
            String number2 = number.substring(1,2);
97
            collectionCarsHolder.header_title_joinin.setText(number1+"."+number2 + "w参与");
98
        }else
99
            collectionCarsHolder.header_title_joinin.setText(talkRecommendBean.joinNums + "参与");
94 100
95 101
        if (!TextUtils.isEmpty(talkRecommendBean.coverImgUrl)) {
96 102
            Picasso.with(context)

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

@ -25,7 +25,7 @@ public class TalkRecommendBean implements Serializable {
25 25
    public String name;
26 26
    public long addTime;
27 27
    public int topicId;
28
    public int joinNums;
28
    public long joinNums;
29 29
    public int visitNums;
30 30
    public String coverImgUrl;
31 31
    public List<String> imgUrls;

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

@ -47,6 +47,13 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
47 47
    private static final String TAG = "TalkRecommendFragment";
48 48
    private int page = 1;
49 49
50
    public void refreshList(){
51
        if(view == null)
52
            return;
53
        page = 1;
54
        requestHeaderData();
55
    }
56
50 57
    @Override
51 58
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
52 59
                             Bundle savedInstanceState) {

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

@ -104,7 +104,7 @@
104 104
            android:layout_marginTop="13dp"
105 105
            android:layout_marginBottom="13dp"
106 106
            android:layout_marginLeft="5dp"
107
            android:text="12"
107
            android:text=""
108 108
            android:textSize="12sp"
109 109
            android:textColor="#565656"/>
110 110
    </LinearLayout>
@ -128,7 +128,7 @@
128 128
            android:layout_marginTop="13dp"
129 129
            android:layout_marginBottom="13dp"
130 130
            android:layout_marginLeft="15dp"
131
            android:text="最发布"
131
            android:text="最发布"
132 132
            android:textSize="12sp"
133 133
            android:textColor="#02b637"/>
134 134

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

@ -7,7 +7,7 @@
7 7
        android:layout_width="match_parent"
8 8
        android:layout_height="wrap_content"
9 9
        android:padding="5dp"
10
        android:background="@drawable/bg_popup_sort">
10
        android:background="@drawable/bg_route_btn_white">
11 11
12 12
        <LinearLayout
13 13
            android:layout_width="match_parent"