@ -27,7 +33,7 @@ public class VideoPubilshDialog extends Dialog implements View.OnClickListener {
27 33
    private TextView videoPublishTopicCon;
28 34
    private LinearLayout videoPublishUserLl;
29 35
    private ImageView videoPublishUserAvatar;
30
    private TextView videoPublishUserName;
36
    private TextView videoPublishUserName,videoPublishCon;
31 37
32 38
    @Override
33 39
    protected void onCreate(Bundle savedInstanceState) {
@ -37,12 +43,37 @@ public class VideoPubilshDialog extends Dialog implements View.OnClickListener {
37 43
        videoPublishClose = inflate.findViewById(R.id.video_publish_close);
38 44
        videoPublishTopic = inflate.findViewById(R.id.video_publish_topic);
39 45
        videoPublishTopicCon = inflate.findViewById(R.id.video_publish_topic_con);
46
        videoPublishCon = inflate.findViewById(R.id.video_publish_con);
40 47
        videoPublishUserLl = inflate.findViewById(R.id.video_publish_user_ll);
41 48
        videoPublishUserAvatar = inflate.findViewById(R.id.video_publish_user_avatar);
42 49
        videoPublishUserName = inflate.findViewById(R.id.video_publish_user_name);
43 50
44 51
        videoPublishClose.setOnClickListener(this);
45 52
53
54
        videoPublishTopicCon.setText(talkRecommendBean.title);
55
        videoPublishCon.setText(talkRecommendBean.title);
56
57
        if (TextUtils.isEmpty(talkRecommendBean.headImgUrl)) {
58
            Picasso.with(context)
59
                    .load(R.drawable.icon_face2_0)
60
                    .placeholder(R.drawable.icon_face2_0)
61
                    .error(R.drawable.icon_face2_0)
62
                    .transform(new CircleTransform())
63
                    .into(videoPublishUserAvatar);
64
        } else {
65
            Picasso.with(context)
66
                    .load(talkRecommendBean.headImgUrl)
67
                    .placeholder(R.drawable.icon_face2_0)
68
                    .error(R.drawable.icon_face2_0)
69
                    .transform(new CircleTransform())
70
                    .into(videoPublishUserAvatar);
71
        }
72
73
        videoPublishUserName.setText(talkRecommendBean.nickName);
74
//        sv_show_user_time.setText("" + talkRecommendBean.addTime);
75
76
46 77
        setContentView(inflate);
47 78
48 79
@ -63,4 +94,12 @@ public class VideoPubilshDialog extends Dialog implements View.OnClickListener {
63 94
                break;
64 95
        }
65 96
    }
97
98
    @Override
99
    public void show() {
100
        if(talkRecommendBean==null){
101
            return;
102
        }
103
        super.show();
104
    }
66 105
}

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

@ -2,7 +2,7 @@
2 2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    android:layout_width="match_parent"
4 4
    android:layout_height="match_parent"
5
    android:background="#424242">
5
    android:background="#9FF33C">
6 6
7 7
8 8
    <com.electric.chargingpile.view.sview.VerticalViewPager

+ 3 - 3
app/src/main/res/layout/sv_video_publish_info.xml

@ -12,7 +12,7 @@
12 12
        android:layout_alignParentEnd="true"
13 13
        android:layout_marginTop="14dp"
14 14
        android:layout_marginEnd="14dp"
15
        android:background="#fff" />
15
        android:background="@drawable/icon_dialog_close" />
16 16
17 17
18 18
    <LinearLayout
@ -56,8 +56,7 @@
56 56
        <ImageView
57 57
            android:id="@+id/video_publish_user_avatar"
58 58
            android:layout_width="20dp"
59
            android:layout_height="20dp"
60
            android:background="#3df" />
59
            android:layout_height="20dp"  />
61 60
62 61
        <TextView
63 62
            android:id="@+id/video_publish_user_name"
@ -70,6 +69,7 @@
70 69
    </LinearLayout>
71 70
72 71
    <TextView
72
        android:id="@+id/video_publish_con"
73 73
        android:layout_width="match_parent"
74 74
        android:layout_height="wrap_content"
75 75
        android:layout_below="@+id/video_publish_user_ll"

+ 6 - 12
app/src/main/res/layout/view_show_bottom.xml

@ -49,7 +49,6 @@
49 49
                android:id="@+id/sv_show_comment_count_tv"
50 50
                android:layout_width="wrap_content"
51 51
                android:layout_height="wrap_content"
52
                android:text="1230w"
53 52
                android:textSize="12sp" />
54 53
55 54
        </LinearLayout>
@ -74,7 +73,6 @@
74 73
                android:id="@+id/sv_show_like_tv"
75 74
                android:layout_width="wrap_content"
76 75
                android:layout_height="wrap_content"
77
                android:text="12我30w"
78 76
                android:textSize="12sp" />
79 77
80 78
        </LinearLayout>
@ -121,8 +119,7 @@
121 119
        android:layout_marginBottom="23dp"
122 120
        android:ellipsize="end"
123 121
        android:maxLines="3"
124
        android:text="3-超出三行的,点击文字,上滑弹窗,显示出所有文字内容,根据内容自适应高度,最高为一半屏幕高度,字数超高,以滚动条滑动显示。3-超出三行的,点击文字,上滑弹窗,显示出所有文字内容,根据内容自适应高度,最高为一半屏幕高度,字数超高,以滚动条滑动显示。"
125
        android:textSize="14sp" />
122
         android:textSize="14sp" />
126 123
127 124
    <View
128 125
        android:id="@+id/sv_show_tvcon_more"
@ -131,7 +128,8 @@
131 128
        android:layout_above="@+id/sv_show_bottom"
132 129
        android:layout_alignParentEnd="true"
133 130
        android:layout_marginBottom="28dp"
134
        android:background="@color/__picker_black_40" />
131
        android:rotation="90"
132
        android:background="@drawable/ssdk_country_back_arrow" />
135 133
136 134
    <RelativeLayout
137 135
        android:id="@+id/sv_show_user_info"
@ -139,15 +137,13 @@
139 137
        android:layout_height="34dp"
140 138
        android:layout_above="@+id/sv_show_tvcon"
141 139
        android:layout_marginLeft="15dp"
142
        android:layout_marginBottom="5dp"
143
        android:background="#2ff">
140
        android:layout_marginBottom="5dp">
144 141
145 142
        <ImageView
146 143
            android:id="@+id/sv_show_user_avatar"
147 144
            android:layout_width="20dp"
148 145
            android:layout_height="20dp"
149
            android:layout_centerVertical="true"
150
            android:background="#fff" />
146
            android:layout_centerVertical="true" />
151 147
152 148
        <TextView
153 149
            android:id="@+id/sv_show_user_name"
@ -170,7 +166,6 @@
170 166
            android:textSize="12sp" />
171 167
    </RelativeLayout>
172 168
173
174 169
    <LinearLayout
175 170
        android:id="@+id/sv_show_topic"
176 171
        android:layout_width="wrap_content"
@ -196,8 +191,7 @@
196 191
            android:layout_marginRight="12dp"
197 192
            android:ellipsize="end"
198 193
            android:maxLines="1"
199
            android:text="显示出所有文字内容显示出所有文字内容显示出所有文字内容显示出所有文字内容显示出所有文字内容显示出所有文字内容显示出所有文字内容"
200
            android:textColor="#fff"
194
             android:textColor="#fff"
201 195
            android:textSize="11sp" />
202 196
    </LinearLayout>
203 197

+ 4 - 2
app/src/main/res/layout/view_show_comment.xml

@ -10,7 +10,7 @@
10 10
        android:layout_height="wrap_content"
11 11
        android:layout_centerHorizontal="true"
12 12
        android:layout_marginTop="10dp"
13
        android:text="12sp12sp12sp"
13
        android:text="全部评论"
14 14
        android:textColor="#c2c2c2"
15 15
        android:textSize="14sp" />
16 16
@ -22,7 +22,7 @@
22 22
        android:layout_alignParentEnd="true"
23 23
        android:layout_marginTop="9dp"
24 24
        android:layout_marginEnd="14dp"
25
        android:background="#fff" />
25
        android:background="@drawable/icon_dialog_close"  />
26 26
27 27
    <View
28 28
        android:layout_width="match_parent"
@ -55,8 +55,10 @@
55 55
            android:background="@drawable/bg_comment_report"
56 56
            android:hint="写评论"
57 57
            android:minHeight="30dp"
58
            android:maxLength="200"
58 59
            android:paddingStart="14dp"
59 60
            android:paddingEnd="14dp"
61
            android:textColor="#fff"
60 62
            android:textColorHint="#7e7e7e" />
61 63
62 64
        <TextView

cdzApp - Gogs: Go Git Service

充电桩app代码

huyuguo 7e0613ff16 气泡页分时电价显示 6 年 前
.idea ebd55df6f1 代码更新 6 年 前
XRefreshView 319397b60f 配置信息优化 6 年 前
app 7e0613ff16 气泡页分时电价显示 6 年 前
autolayout 319397b60f 配置信息优化 6 年 前
gradle b98aa2e34f 代码修改 6 年 前
keystore 06bd894653 init 7 年 前
library 319397b60f 配置信息优化 6 年 前
zxing 319397b60f 配置信息优化 6 年 前
.gitignore a90ec777b5 视频功能完成 6 年 前
README.md 9f927f0d57 列表开发 7 年 前
build.gradle 06d8b7460a 代码更新 6 年 前
gradle.properties 2ccff5dbe6 配置优化 6 年 前
gradlew 3473529e39 fix video play exception 7 年 前
gradlew.bat e1cf244fe0 remove Useless dependence 7 年 前
icon_sgreen.png e1cf244fe0 remove Useless dependence 7 年 前
settings.gradle a90ec777b5 视频功能完成 6 年 前

README.md

地图首页

MainMapActivity.java
activity_main_map.xml

智能推荐(地图首页右下角)

RecommendZhanActivity.java
activity_recommend_zhan.xml
item_recommend_zhan.xml

筛选(地图首页)

NewScreenActivity.java
activity_new_screen.xml

列表(地图首页右上角,旧功能由推荐替换)

ZhanListActivity.java
activity_zhan_list.xml

推荐

RecommendChargingStationActivity.java
activity_recommend_charging_station.xml
recommend_charging_station_item.xml

站点详情

NewZhanDetailsActivity.class
activity_new_zhan_details.xml
DetailsFragment.java
fragmen_details_new.xml

发布视频代码优化 · 277acf8a80 - Gogs: Go Git Service
Ver Código Fonte

发布视频代码优化

huyuguo 7 anos atrás
pai
commit
277acf8a80

+ 1 - 1
app/src/main/AndroidManifest.xml

@ -992,7 +992,7 @@
992 992
            android:screenOrientation="portrait"
993 993
            android:windowSoftInputMode="adjustPan" />
994 994
        <activity
995
            android:name=".activity.PublishTopicActivity"
995
            android:name=".activity.PublishVideoTopicActivity"
996 996
            android:screenOrientation="portrait"
997 997
            android:windowSoftInputMode="stateVisible|adjustResize" />
998 998
        <activity

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

@ -88,7 +88,7 @@ public class PublishItemsActivity extends AppCompatActivity implements View.OnCl
88 88
                break;
89 89
            case R.id.publish_video: // 视频
90 90
                if (checkPublishRadio()) {
91
                    intent.setClass(this, PublishTopicActivity.class);
91
                    intent.setClass(this, PublishVideoTopicActivity.class);
92 92
                    startActivity(intent);
93 93
                }
94 94
                break;

+ 35 - 5
app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java

@ -61,6 +61,7 @@ import com.electric.chargingpile.manager.ProfileManager;
61 61
import com.electric.chargingpile.util.BarColorUtil;
62 62
import com.electric.chargingpile.util.Bimp;
63 63
import com.electric.chargingpile.util.CommonParams;
64
import com.electric.chargingpile.util.DensityUtil;
64 65
import com.electric.chargingpile.util.ImageItem;
65 66
import com.electric.chargingpile.util.JsonUtils;
66 67
import com.electric.chargingpile.util.LoadingDialog;
@ -68,6 +69,7 @@ import com.electric.chargingpile.util.PublicWay;
68 69
import com.electric.chargingpile.util.Res;
69 70
import com.electric.chargingpile.util.SystemTypeUtil;
70 71
import com.electric.chargingpile.util.ToastUtil;
72
import com.luck.picture.lib.tools.ScreenUtils;
71 73
import com.umeng.analytics.MobclickAgent;
72 74
import com.upyun.library.common.ParallelUploader;
73 75
import com.upyun.library.common.UploadEngine;
@ -130,6 +132,8 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
130 132
    LoadingDialog dialog;
131 133
    private ProgressDialog insertDialog;
132 134
    private static final int RC_ALBUM_PERM = 123;
135
    private int screenWidth;
136
    private int itemWidth;
133 137
134 138
135 139
    private TextView publishtopic_choose_topic, mPublishtopicChooseTopic, publishtopic_word_num;
@ -149,6 +153,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
149 153
        super.onCreate(savedInstanceState);
150 154
        setContentView(R.layout.activity_publish_picture_content);
151 155
        BarColorUtil.initStatusBarColor(PublishPicTopicActivity.this);
156
152 157
        initView();
153 158
        Res.init(this);
154 159
        PublicWay.activityList.add(this);
@ -180,6 +185,9 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
180 185
    }
181 186
182 187
    private void initView() {
188
        screenWidth = ScreenUtils.getScreenWidth(this);
189
        itemWidth = (int) ((screenWidth - DensityUtil.dip2px(this, 15 * 2 + 10 * 2)) / 3f);
190
183 191
        uploadDialog = new ProgressDialog(this);
184 192
        uploadDialog.setMessage("正在提交...");
185 193
        uploadDialog.setCanceledOnTouchOutside(false);
@ -629,39 +637,61 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
629 637
            return selectedPosition;
630 638
        }
631 639
632
        public View getView(int position, View convertView, ViewGroup parent) {
640
        public View getView(final int position, View convertView, ViewGroup parent) {
633 641
            GridAdapter.ViewHolder holder = null;
634 642
            if (convertView == null) {
635
                convertView = inflater.inflate(R.layout.item_feedback_gridview,
643
                convertView = inflater.inflate(R.layout.item_publish_picture,
636 644
                        parent, false);
637 645
                holder = new GridAdapter.ViewHolder();
638 646
                holder.image = (ImageView) convertView
639
                        .findViewById(R.id.item_grida_image);
647
                        .findViewById(R.id.item_publish_image);
648
                holder.imageDelete = convertView.findViewById(R.id.item_publish_image_delete);
640 649
                convertView.setTag(holder);
641 650
            } else {
642 651
                holder = (GridAdapter.ViewHolder) convertView.getTag();
643 652
            }
644 653
654
655
            RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) holder.image.getLayoutParams();
656
            params.width = itemWidth;
657
            params.height = itemWidth;
658
            if (position % 3 != 0) {
659
                params.leftMargin = DensityUtil.dip2px(getApplicationContext(), 10);
660
            }
661
            holder.image.setLayoutParams(params);
662
645 663
            if (position == Bimp.tempSelectBitmap.size()) {
664
                holder.imageDelete.setVisibility(View.GONE);
646 665
                holder.image.setImageResource(R.drawable.add_picture);
647 666
                holder.image.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
648 667
                holder.image.setBackgroundColor(Color.parseColor("#f5f5f5"));
649
//                holder.image.setImageBitmap(BitmapFactory.decodeResource(
650
//                        getResources(), R.drawable.icon_feedback_upload));
651 668
                if (position == 9) {
652 669
                    holder.image.setVisibility(View.GONE);
653 670
                }
654 671
            } else {
672
                holder.imageDelete.setVisibility(View.VISIBLE);
655 673
                holder.image.setImageBitmap(Bimp.tempSelectBitmap.get(position).getBitmap());
656 674
                holder.image.setScaleType(ImageView.ScaleType.CENTER_CROP);
657 675
                holder.image.setBackgroundColor(Color.WHITE);
658 676
            }
659 677
678
            holder.imageDelete.setOnClickListener(new OnClickListener() {
679
                @Override
680
                public void onClick(View view) {
681
                    Bimp.tempSelectBitmap.remove(position);
682
                    Bimp.max--;
683
                    Message message = new Message();
684
                    message.what = 1;
685
                    handler.sendMessage(message);
686
                }
687
            });
688
660 689
            return convertView;
661 690
        }
662 691
663 692
        public class ViewHolder {
664 693
            public ImageView image;
694
            public ImageView imageDelete;
665 695
        }
666 696
667 697
        Handler handler = new Handler() {

+ 3 - 3
app/src/main/java/com/electric/chargingpile/activity/PublishTopicActivity.java

@ -56,7 +56,7 @@ import java.util.Map;
56 56
57 57
import okhttp3.Call;
58 58
59
public class PublishTopicActivity extends Activity implements OnClickListener {
59
public class PublishVideoTopicActivity extends Activity implements OnClickListener {
60 60
    Context mContext;
61 61
    private ImageView mPublishtopicBack;
62 62
    private TextView mPublishtopicPublish;
@ -86,7 +86,7 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
86 86
        mContext = this;
87 87
        loadingDialog = new LoadingDialog(this);
88 88
        loadingDialog.setCanceledOnTouchOutside(false);
89
        BarColorUtil.initStatusBarColor(PublishTopicActivity.this);
89
        BarColorUtil.initStatusBarColor(PublishVideoTopicActivity.this);
90 90
        initView();
91 91
    }
92 92
@ -418,7 +418,7 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
418 418
    }
419 419
420 420
    private void showDialogToExit() {
421
        AlertDialog.Builder builder = new AlertDialog.Builder(PublishTopicActivity.this);
421
        AlertDialog.Builder builder = new AlertDialog.Builder(PublishVideoTopicActivity.this);
422 422
        builder.setTitle("提示");
423 423
        builder.setMessage("是否离开发布页?");
424 424
        builder.setCancelable(false);

+ 3 - 5
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -172,12 +172,11 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
172 172
    private void loginSign() {
173 173
        String url = MainApplication.urlNew + "/topic/sign.do";
174 174
        final Map<String, String> map = new HashMap<>();
175
        map.put("fileNames", "xxx");
175
        map.put("fileNames", "android");
176 176
        map.put("targetType", ChatRecommendBean.TARGET_TYPE_IMAGE_TEXT + "");
177
        map.put("appToken", ProfileManager.getInstance().getKeyMessageToken(getContext()));
178 177
        CommonParams.addCommonParams(map);
179
        Log.d(TAG, "loginSign: " + map);
180 178
        loadingDialog.show();
179
181 180
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
182 181
            @Override
183 182
            public void onError(Call call, Exception e) {
@ -196,7 +195,7 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
196 195
                    startActivity(new Intent(getActivity(), PublishItemsActivity.class));
197 196
                } else if ("8010".equals(code)) {
198 197
                    startActivity(new Intent(getContext(), LoginActivity.class));
199
                    ToastUtil.showToast(getContext(), desc + map, Toast.LENGTH_LONG);
198
                    ToastUtil.showToast(getContext(), desc, Toast.LENGTH_LONG);
200 199
                } else  {
201 200
                    ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
202 201
                }
@ -219,7 +218,6 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
219 218
        Map<String, String> map = new HashMap<>();
220 219
        map.put("selected", "1");
221 220
        CommonParams.addCommonParams(map);
222
        Log.d(TAG, "requestHeaderData: " + map);
223 221
224 222
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
225 223
            @Override

+ 2 - 1
app/src/main/java/com/electric/chargingpile/util/CommonParams.java

@ -14,11 +14,12 @@ public class CommonParams {
14 14
    public static void addCommonParams(Map<String, String> map) {
15 15
        if (MainApplication.isLogin()) {
16 16
            map.put("userId", MainApplication.userId);
17
            // map.put("appToken", ProfileManager.getInstance().getKeyMessageToken(getContext()));
18
            map.put("appToken", ProfileManager.getInstance().getKeyMessageToken(MainApplication.context));
17 19
        }
18 20
19 21
        map.put("deviceOs", "android");
20 22
        map.put("appVer", BuildConfig.VERSION_NAME);
21
//        map.put("appToken", "");
22 23
        map.put("deviceOsVer", Build.VERSION.RELEASE);
23 24
        map.put("deviceId", JPushInterface.getUdid(MainApplication.context));
24 25
//            map.put("tpToken", "");

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

@ -98,7 +98,7 @@
98 98
        android:layout_marginBottom="50dp"
99 99
        android:numColumns="3"
100 100
        android:scrollbars="none"
101
        android:verticalSpacing="5dp"></GridView>
101
        android:verticalSpacing="10dp"></GridView>
102 102

103 103
    <View
104 104
        android:layout_width="match_parent"

+ 0 - 1
app/src/main/res/layout/item_feedback_gridview.xml

@ -8,7 +8,6 @@
8 8
        android:id="@+id/item_grida_image"
9 9
        android:layout_width="81dp"
10 10
        android:layout_height="81dp"
11
        android:background="#ff0000"
12 11
        android:scaleType="centerCrop">
13 12
    </ImageView>
14 13

+ 21 - 0
app/src/main/res/layout/item_publish_picture.xml

@ -0,0 +1,21 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="wrap_content"
4
    android:layout_height="wrap_content"
5
    android:background="@color/white">
6
7
    <ImageView
8
        android:id="@+id/item_publish_image"
9
        android:layout_width="81dp"
10
        android:layout_height="81dp"
11
        android:scaleType="centerCrop"></ImageView>
12
13
    <ImageView
14
        android:id="@+id/item_publish_image_delete"
15
        android:layout_width="30dp"
16
        android:layout_height="30dp"
17
        android:layout_alignEnd="@+id/item_publish_image"
18
        android:padding="5dp"
19
        android:src="@drawable/delete_picture" />
20
21
</RelativeLayout>