@ -0,0 +1,152 @@
1
package com.electric.chargingpile.adapter;
2
3
import android.app.Activity;
4
import android.content.Context;
5
import android.graphics.Bitmap;
6
import android.support.annotation.NonNull;
7
import android.support.v7.widget.RecyclerView;
8
import android.text.TextUtils;
9
import android.util.DisplayMetrics;
10
import android.util.Log;
11
import android.view.LayoutInflater;
12
import android.view.View;
13
import android.view.View.OnClickListener;
14
import android.view.ViewGroup;
15
import android.widget.BaseAdapter;
16
import android.widget.Button;
17
import android.widget.ImageView;
18
import android.widget.TextView;
19
import android.widget.ToggleButton;
20
21
import com.electric.chargingpile.R;
22
import com.electric.chargingpile.data.TalkRecommendBean;
23
import com.electric.chargingpile.util.BitmapCache;
24
import com.electric.chargingpile.util.BitmapCache.ImageCallback;
25
import com.electric.chargingpile.util.CircleTransform;
26
import com.electric.chargingpile.util.ImageItem;
27
import com.electric.chargingpile.util.Res;
28
import com.squareup.picasso.Picasso;
29
30
import java.util.ArrayList;
31
import java.util.List;
32
33
public class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
34
    private ArrayList<TalkRecommendBean> dataList = new ArrayList<>();
35
    private Context mContext;
36
    private int type = 0;
37
    public final static int RECOMENT_TYPE = 0;
38
    public final static int RECOMENT_ITEM = 1;
39
40
    public TopicAdapter(Context c) {
41
        mContext = c;
42
    }
43
44
45
    @Override
46
    public int getItemViewType(int position) {
47
        if (type == RECOMENT_TYPE && position == 0) {
48
            return RECOMENT_TYPE;
49
        } else {
50
            return RECOMENT_ITEM;
51
        }
52
    }
53
54
    @NonNull
55
    @Override
56
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
57
        View view;
58
        if (viewType == RECOMENT_TYPE) {
59
            view = LayoutInflater.from(mContext).inflate(R.layout.title_item_topic, null);
60
            return new TitleViewHolder(view);
61
        } else if (viewType == RECOMENT_ITEM) {
62
            view = LayoutInflater.from(mContext).inflate(R.layout.item_topic, null);
63
            return new ItemViewHolder(view);
64
        }
65
        return null;
66
    }
67
68
    @Override
69
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
70
        int itemViewType = getItemViewType(position);
71
        if (itemViewType == RECOMENT_TYPE) {
72
            TitleViewHolder titleViewHolder = (TitleViewHolder) holder;
73
        } else {
74
            ItemViewHolder itemViewHolder = (ItemViewHolder) holder;
75
            TalkRecommendBean item = getItem(position);
76
            itemViewHolder.mItemTopicName.setText(item.name);
77
78
79
            if (TextUtils.isEmpty(item.coverImgUrl)) {
80
                Picasso.with(mContext)
81
                        .load(R.drawable.icon_face2_0)
82
                        .placeholder(R.drawable.icon_face2_0)
83
                        .error(R.drawable.icon_face2_0)
84
                        .into(itemViewHolder.mItemTopicImg);
85
            } else {
86
                Picasso.with(mContext)
87
                        .load(item.headImgUrl)
88
                        .placeholder(R.drawable.icon_face2_0)
89
                        .error(R.drawable.icon_face2_0)
90
                        .into(itemViewHolder.mItemTopicImg);
91
            }
92
        }
93
    }
94
95
96
    private TalkRecommendBean getItem(int position) {
97
        if (type == RECOMENT_TYPE) {
98
            return dataList.get(position - 1);
99
        } else {
100
            return dataList.get(position);
101
        }
102
    }
103
104
105
    @Override
106
    public int getItemCount() {
107
        if (type == RECOMENT_TYPE) {
108
            return dataList.size() + 1;
109
        } else {
110
            return dataList.size();
111
        }
112
    }
113
114
    public void setType(int i) {
115
        type = i;
116
    }
117
118
    public void addData(List<TalkRecommendBean> qadata) {
119
        if (qadata != null && qadata.size() > 0) {
120
            dataList.addAll(qadata);
121
            notifyDataSetChanged();
122
        }
123
    }
124
125
    /**
126
     * 存放列表项控件句柄
127
     */
128
    static class TitleViewHolder extends RecyclerView.ViewHolder {
129
        public TitleViewHolder(View itemView) {
130
            super(itemView);
131
        }
132
    }
133
134
135
    /**
136
     * 存放列表项控件句柄
137
     */
138
    static class ItemViewHolder extends RecyclerView.ViewHolder {
139
140
        private ImageView mItemTopicImg;
141
        private TextView mItemTopicName;
142
143
        public ItemViewHolder(View itemView) {
144
            super(itemView);
145
146
            mItemTopicImg = (ImageView) itemView.findViewById(R.id.item_topic_img);
147
            mItemTopicName = (TextView) itemView.findViewById(R.id.item_topic_name);
148
149
        }
150
    }
151
152
}

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

@ -308,7 +308,6 @@ public class SvVideoShowView implements View.OnClickListener {
308 308
    }
309 309
310 310
    public void updateView() {
311
//        long targetId = talkRecommendBean.targetId;
312 311
313 312
    }
314 313

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

@ -116,14 +116,6 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
116 116
        layoutAdapter.setOnRecyclerItemClickListener(new RecyclerItemTypeClickListener() {
117 117
            @Override
118 118
            public void onItemClickListener(int position, int type) {
119
//                position--;
120
//                ArrayList<TalkRecommendBean> talkRecommendBeans = layoutAdapter.getCurrentData();
121
//                String targetId = talkRecommendBeans.get(position).targetId+"";
122
//                String targetType = talkRecommendBeans.get(position).targetType+"";
123
//                Intent intent = new Intent(getActivity(), ZoomingPhotoTextActivity.class);
124
//                intent.putExtra("targetId", targetId);
125
//                intent.putExtra("targetType", targetType);
126
//                startActivity(intent);
127 119
                int pos = position - 1;
128 120
                Intent intent = new Intent(getActivity(), VideoDetaislActivity.class);
129 121
                ArrayList<TalkRecommendBean> talkRecommendBeans = layoutAdapter.getCurrentData();
@ -133,22 +125,6 @@ public class TalkRecommendFragment extends Fragment implements View.OnClickListe
133 125
            }
134 126
        });
135 127
136
//        layoutAdapter.setOnItemClickListener(new LayoutAdapter.OnItemClickListener() {
137
//
138
//            @Override
139
//            public void onItemClick(View view) {
140
//                ArrayList<TalkRecommendBean> talkRecommendBeans = layoutAdapter.getCurrentData();
141
//
142
//                int pos = recyclerView.getChildAdapterPosition(view);
143
//                Toast.makeText(getContext(), talkRecommendBeans.get(pos).toString(), Toast.LENGTH_SHORT).show();
144
//                Intent intent = new Intent(getActivity(), VideoDetaislActivity.class);
145
//                intent.putExtra("list", talkRecommendBeans);
146
//                intent.putExtra("pos", pos);
147
//
148
//                startActivity(intent);
149
//
150
//            }
151
//        });
152 128
153 129
        initScrollListener();
154 130

+ 7 - 0
app/src/main/res/drawable/topic_search_con.xml

@ -0,0 +1,7 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:shape="rectangle">
4
5
    <solid android:color="#e8e8e8" />
6
    <corners android:radius="16dp" />
7
</shape>

+ 118 - 0
app/src/main/res/layout/activity_publishtopic.xml

@ -0,0 +1,118 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent">
5
6
    <ImageView
7
        android:id="@+id/publishtopic_back"
8
        android:layout_width="44dp"
9
        android:layout_height="44dp"
10
        android:background="#000" />
11
12
    <TextView
13
        android:layout_width="wrap_content"
14
        android:layout_height="44dp"
15
        android:layout_centerHorizontal="true"
16
        android:gravity="center_vertical"
17
        android:text="发布"
18
        android:textColor="#222"
19
        android:textSize="18sp" />
20
21
    <TextView
22
        android:id="@+id/publishtopic_publish"
23
        android:layout_width="50dp"
24
        android:layout_height="25dp"
25
        android:layout_alignParentEnd="true"
26
        android:layout_centerHorizontal="true"
27
        android:layout_marginTop="@dimen/ui_10_dip"
28
        android:layout_marginEnd="25dp"
29
        android:background="#02B637"
30
        android:gravity="center"
31
        android:text="发布"
32
        android:textColor="#fff"
33
        android:textSize="16sp" />
34
35
    <View
36
        android:layout_width="match_parent"
37
        android:layout_height="1dp"
38
        android:layout_below="@+id/publishtopic_back"
39
        android:background="#ddd" />
40
41
    <ScrollView
42
        android:layout_width="match_parent"
43
        android:layout_height="wrap_content"
44
        android:layout_below="@+id/publishtopic_back">
45
46
        <LinearLayout
47
            android:layout_width="match_parent"
48
            android:layout_height="wrap_content"
49
            android:orientation="vertical"
50
            android:padding="15dp">
51
52
            <EditText
53
                android:id="@+id/publishtopic_con"
54
                android:layout_width="match_parent"
55
                android:layout_height="wrap_content"
56
                android:background="@null"
57
                android:gravity="top"
58
                android:hint="聊聊你的想法......"
59
                android:minHeight="120dp"
60
                android:textColorHint="#555555"
61
                android:textSize="14sp" />
62
63
            <com.electric.chargingpile.view.MyGridView
64
                android:id="@+id/publishtopic_gv"
65
                android:layout_width="match_parent"
66
                android:layout_height="wrap_content" />
67
        </LinearLayout>
68
    </ScrollView>
69
70
71
    <TextView
72
        android:id="@+id/publishtopic_choose_topic"
73
        android:layout_width="wrap_content"
74
        android:layout_height="30dp"
75
        android:layout_alignParentBottom="true"
76
        android:layout_marginStart="15dp"
77
        android:layout_marginBottom="10dp"
78
        android:background="#EE12E812"
79
        android:gravity="center_vertical"
80
        android:orientation="horizontal"
81
        android:paddingStart="@dimen/ui_10_dip"
82
        android:paddingEnd="@dimen/ui_10_dip"
83
        android:text="# 选择话题"
84
        android:textColor="#555"
85
        android:textSize="14sp" />
86
87
    <TextView
88
        android:id="@+id/publishtopic_choose_preview"
89
        android:layout_width="wrap_content"
90
        android:layout_height="49dp"
91
        android:layout_alignParentEnd="true"
92
        android:layout_alignParentBottom="true"
93
        android:layout_marginStart="11dp"
94
        android:gravity="center_vertical"
95
        android:orientation="horizontal"
96
        android:paddingStart="@dimen/ui_10_dip"
97
        android:paddingEnd="15dp"
98
        android:text="预览"
99
        android:textColor="#b2b2b2"
100
        android:textSize="14sp" />
101
102
    <TextView
103
        android:id="@+id/publishtopic_word_num"
104
        android:layout_width="wrap_content"
105
        android:layout_height="49dp"
106
        android:layout_alignParentBottom="true"
107
        android:layout_toStartOf="@+id/publishtopic_choose_preview"
108
        android:gravity="center_vertical"
109
        android:text="0/500"
110
        android:textSize="14sp" />
111
112
113
    <View
114
        android:layout_width="match_parent"
115
        android:layout_height="1dp"
116
        android:layout_above="@+id/publishtopic_choose_preview"
117
        android:background="#ddd" />
118
</RelativeLayout>

+ 127 - 0
app/src/main/res/layout/activity_topic.xml

@ -0,0 +1,127 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:background="#fff">
6
7
    <ImageView
8
        android:id="@+id/topic_back"
9
        android:layout_width="44dp"
10
        android:layout_height="44dp"
11
        android:background="#000" />
12
13
    <TextView
14
        android:layout_width="wrap_content"
15
        android:layout_height="44dp"
16
        android:layout_centerHorizontal="true"
17
        android:gravity="center_vertical"
18
        android:text="发布"
19
        android:textColor="#222"
20
        android:textSize="18sp" />
21
22
    <View
23
        android:layout_width="match_parent"
24
        android:layout_height="1dp"
25
        android:layout_below="@+id/topic_back"
26
        android:background="#ddd" />
27
28
    <View
29
        android:layout_width="match_parent"
30
        android:layout_height="60dp"
31
        android:layout_below="@+id/topic_back" />
32
33
    <RelativeLayout
34
        android:id="@+id/topic_input_ll"
35
        android:layout_width="match_parent"
36
        android:layout_height="30dp"
37
        android:layout_below="@+id/topic_back"
38
        android:layout_margin="15dp"
39
        android:background="@drawable/topic_search_con"
40
        android:orientation="horizontal">
41
42
        <View
43
            android:id="@+id/topic_input_start"
44
            android:layout_width="14dp"
45
            android:layout_height="14dp"
46
            android:layout_centerVertical="true"
47
            android:layout_marginStart="8dp"
48
            android:layout_marginEnd="4dp"
49
            android:background="#b2de" />
50
51
        <View
52
            android:id="@+id/topic_input_end"
53
            android:layout_width="14dp"
54
            android:layout_height="14dp"
55
            android:layout_alignParentEnd="true"
56
            android:layout_centerVertical="true"
57
            android:layout_marginStart="4dp"
58
            android:layout_marginEnd="8dp"
59
            android:background="#b2de" />
60
61
        <EditText
62
            android:id="@+id/topic_con"
63
            android:layout_width="match_parent"
64
            android:layout_height="match_parent"
65
            android:layout_toStartOf="@+id/topic_input_end"
66
            android:layout_toEndOf="@+id/topic_input_start"
67
            android:background="@null"
68
            android:gravity="center_vertical"
69
            android:hint="请输入你感兴趣的话题"
70
            android:textColorHint="#555555"
71
            android:textSize="14sp" />
72
    </RelativeLayout>
73
74
    <View
75
        android:id="@+id/topic_input_below_line"
76
        android:layout_width="match_parent"
77
        android:layout_height="10dp"
78
        android:layout_below="@+id/topic_input_ll"
79
        android:background="#f4f4f4" />
80
81
    <android.support.v7.widget.RecyclerView
82
        android:id="@+id/topic_rv"
83
        android:layout_width="match_parent"
84
        android:layout_height="match_parent"
85
        android:layout_below="@+id/topic_input_below_line" />
86
87
    <TextView
88
        android:id="@+id/topic_not_con"
89
        android:layout_width="match_parent"
90
        android:layout_height="match_parent"
91
        android:layout_below="@+id/topic_input_below_line"
92
        android:gravity="center"
93
        android:text="还没有任何内容哦,快来抢沙发~"
94
        android:textColor="#555"
95
        android:textSize="14sp"
96
        android:visibility="gone" />
97
98
    <LinearLayout
99
        android:id="@+id/topic_retry_ll"
100
        android:layout_width="match_parent"
101
        android:layout_height="match_parent"
102
        android:layout_below="@+id/topic_input_below_line"
103
        android:gravity="center"
104
        android:orientation="vertical"
105
        android:visibility="gone">
106
107
108
        <TextView
109
            android:layout_width="wrap_content"
110
            android:layout_height="wrap_content"
111
            android:layout_marginBottom="20dp"
112
            android:text="网络跑调了,请重试~"
113
            android:textColor="#555"
114
            android:textSize="14sp" />
115
116
        <TextView
117
            android:id="@+id/topic_retry"
118
            android:layout_width="123dp"
119
            android:layout_height="40dp"
120
            android:background="@drawable/bg_write_stroke"
121
            android:gravity="center"
122
            android:text="点击重试"
123
            android:textColor="#555"
124
            android:textSize="14sp" />
125
126
    </LinearLayout>
127
</RelativeLayout>

+ 28 - 0
app/src/main/res/layout/item_topic.xml

@ -0,0 +1,28 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="60dp"
5
    android:paddingStart="15dp"
6
    android:paddingEnd="15dp">
7
8
    <ImageView
9
        android:id="@+id/item_topic_img"
10
        android:layout_width="50dp"
11
        android:layout_height="43dp"
12
        android:layout_centerVertical="true"
13
        android:background="#000" />
14
15
    <TextView
16
        android:id="@+id/item_topic_name"
17
        android:layout_width="match_parent"
18
        android:layout_height="wrap_content"
19
        android:layout_centerVertical="true"
20
        android:layout_marginStart="10dp"
21
        android:layout_toEndOf="@+id/item_topic_img"
22
        android:ellipsize="end"
23
        android:maxLines="2"
24
        android:text="adadasd"
25
        android:textColor="#444444"
26
        android:textSize="14sp" />
27
28
</RelativeLayout>

+ 17 - 0
app/src/main/res/layout/title_item_topic.xml

@ -0,0 +1,17 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    android:layout_width="match_parent"
5
    android:layout_height="50dp">
6
7
    <TextView
8
        android:layout_width="wrap_content"
9
        android:layout_height="wrap_content"
10
        android:layout_marginStart="15dp"
11
        android:text="推荐话题"
12
        android:textColor="#444444"
13
        android:textSize="15sp"
14
        app:layout_constraintBottom_toTopOf="parent"
15
        app:layout_constraintStart_toStartOf="parent"
16
        app:layout_constraintTop_toBottomOf="parent" />
17
</android.support.constraint.ConstraintLayout>

dudu/cdzApp - Gogs: Go Git Service

497 Commits (37a99ea468746fb7ceddc227ac9a31f7dfd54927)

Author SHA1 Message Date
  hy 37a99ea468 完成站点评论详情页展示,移除聊聊推荐界面 4 years ago
  hy 8faf825e4a 完成评论视频上传以及多图上传功能 4 years ago
  hy 78c104f7fc 完成发表评论以及图片、视频选择UI展示 4 years ago
  hy 610a995f96 完成图片视频逻辑,删除无用代码 4 years ago
  hy ccb3b915f4 完成话题详情页数据交互逻辑 4 years ago
  hy bdd557e9bf 完成排行榜功能 4 years ago
  hy 92c3ba194f 完成选择话题功能 4 years ago
  hy c75e35b96c 添加评论提醒dialog 4 years ago
  hy 5d20a86f7c 优化图片资源 4 years ago
  hy 8d1620fba1 排行榜页面添加季度筛选功能 4 years ago
  hy f3a4f0f7f4 修改直流桩可显示电压,交流只显示功率 4 years ago
  hy 86c28bdcb9 更换高德地图SDK以及so文件 4 years ago
  hy d7ea28348c 删除无用代码,并且将文件相关操作的代码适配至Android 12 4 years ago
  hy 0e5aebc0c1 将所有gradle升级至31 4 years ago
  hy 7a2d80db43 修改定位Toast异常提示,修改邀请记录显示 4 years ago
  hy e79f3c3a19 删除无用依赖 4 years ago
  hy 3e008ac643 修复安全漏洞,将分享的SDK初始化所需的值,配置相应Mob的后台 4 years ago
  hy 5a729456b2 第三方SDK延迟初始化 4 years ago
  hy 74f12ef278 3.5.16 版本 4 years ago
  hy c359ad7604 多渠道动态更改用户须知链接 4 years ago
  hy be1b8e7535 根据不同渠道,进行充电桩APP名称更改,以及关键词替换 4 years ago
  hy 9a594d18b9 优化首次获取位置权限时,给予用户相关提示 4 years ago
  hy 50a2415166 权限申请更改为使用时申请 4 years ago
  hy b1d9a73828 3.5.14 正式发版前的文字叙述调整 4 years ago
  hy ddf855489e 更新版本为3.5.14 4 years ago
  hy c8fa0f6466 更正逻辑,优化注销逻辑 4 years ago
  hy 113674aae6 将注销异常弹窗改为定时关闭, 4 years ago
  hy 966f38333e 修复获取验证码返回code 为500时给与提示 4 years ago
  hy 203297a0a2 优化注销页面退出逻辑 4 years ago
  hy 992b5c8ec0 完成注销功能 4 years ago
  hy 9808a5b267 添加注销账号功能,优化充电页button被虚拟按键遮挡 4 years ago
  hy 242ef02c11 修复空指针异常 5 years ago
  hy 86217c6f46 修改因华为市场上架的问题 5 years ago
  hy f5fd73484f 修复已知bug 5 years ago
  hy 9362e31269 添加push,跳转至我的页面 5 years ago
  hy 789da80e9e 添加打点,将url改为正式环境 5 years ago
  hy 7aa4a63b25 修复认证车主,意向车型的bug 5 years ago
  hy 3eb89e60e6 取出无用log 5 years ago
  hy 651b21d2e8 确认订单页面,将结束充电15分后自动结算改为5分钟 5 years ago
  hy 21557c900d 为红包添加健壮性代码 5 years ago
  hy 57b9dff348 修改关于红包弹窗的文字展示 5 years ago
  hy 191ba2c785 修改确认订单页的提示将半小时,改为15分钟 5 years ago
  hy 234767f4a6 调试完成,并完善充电桩支付流程。 5 years ago
  hy f37e052d4b 优化车主认证以及意向车型的展示逻辑 5 years ago
  hy f42bc42a85 完成车主认证上传信息至后台 5 years ago
  hy 59c1b20572 添加确定订单页面,添加优惠券选择dialog, 5 years ago
  hy 93486b3df5 替换充电状态页面的UI 5 years ago
  hy 51d9800fe6 修改个人信息页面,认证车主字体颜色更改 5 years ago
  hy b55ee9bb79 添加在扫描界面时,有未结算账单的提示 5 years ago
  hy 0a905f44c9 充电界面下,如果关闭通知状态,启动20次后开启提醒 5 years ago