Commit a145cbca133a5981f3de75e3d10ec98641ce1571

Authored by xiongwei
1 parent db27de12ce
Exists in master

整理代码

PersonalCenter/.idea/modules.xml
... ... @@ -6,6 +6,7 @@
6 6 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
7 7 <module fileurl="file://$PROJECT_DIR$/circledialog/circledialog.iml" filepath="$PROJECT_DIR$/circledialog/circledialog.iml" />
8 8 <module fileurl="file://$PROJECT_DIR$/pickerview/pickerview.iml" filepath="$PROJECT_DIR$/pickerview/pickerview.iml" />
  9 + <module fileurl="file://$PROJECT_DIR$/pickerview/pickerview.iml" filepath="$PROJECT_DIR$/pickerview/pickerview.iml" />
9 10 </modules>
10 11 </component>
11 12 </project>
12 13 \ No newline at end of file
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
... ... @@ -3,7 +3,9 @@ package com.hjx.personalcenter.activity;
3 3 import android.app.Activity;
4 4 import android.graphics.Color;
5 5 import android.os.Bundle;
  6 +import android.view.Gravity;
6 7 import android.view.View;
  8 +import android.view.ViewGroup;
7 9 import android.widget.Button;
8 10 import android.widget.LinearLayout;
9 11 import android.widget.TextView;
... ... @@ -52,16 +54,16 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC
52 54 //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
53 55 Calendar selectedDate = Calendar.getInstance();
54 56 Calendar startDate = Calendar.getInstance();
55   - startDate.set(2013, 0, 23);
  57 + startDate.set(1900, 1, 1);
56 58 Calendar endDate = Calendar.getInstance();
57   - endDate.set(2019, 11, 28);
  59 + endDate.set(2100, 1, 1);
58 60 //时间选择器
59 61 pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() {
60 62 @Override
61 63 public void onTimeSelect(Date date, View v) {//选中事件回调
62 64 // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null
63 65 /*btn_Time.setText(getTime(date));*/
64   - Button btn = (Button) v;
  66 + TextView btn = (TextView) v;
65 67 btn.setText(getTime(date));
66 68 }
67 69 })
... ... @@ -73,12 +75,12 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC
73 75 .setContentSize(21)
74 76 .setDate(selectedDate)
75 77 .setRangDate(startDate, endDate)
76   - .setBackgroundId(0x00FFFFFF) //设置外部遮罩颜色
  78 + .setBackgroundId(0x80000000) //设置外部遮罩颜色
77 79 .setDecorView(null)
78 80 .build();
79 81 }
80 82 private String getTime(Date date) {//可根据需要自行截取数据显示
81   - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  83 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
82 84 return format.format(date);
83 85 }
84 86  
... ... @@ -86,7 +88,7 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC
86 88 public void onClick(View v) {
87 89 switch (v.getId()){
88 90 case R.id.lineL_buy_time:
89   - pvTime.show(v);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view
  91 + pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view
90 92 break;
91 93 }
92 94  
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
... ... @@ -18,7 +18,7 @@ public class MainActivity extends AppCompatActivity {
18 18 ssss.setOnClickListener(new View.OnClickListener() {
19 19 @Override
20 20 public void onClick(View v) {
21   - Intent intent = new Intent(MainActivity.this,RegisterInfoActivity.class);
  21 + Intent intent = new Intent(MainActivity.this,ElectronicCardEditInfoActivity.class);
22 22 startActivity(intent);
23 23 }
24 24 });
... ...
PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml
... ... @@ -144,7 +144,7 @@
144 144 android:layout_width="wrap_content"
145 145 android:layout_height="wrap_content"
146 146 android:layout_marginLeft="18dp"
147   - android:background="@drawable/corcle_blue_bg"
  147 + android:background="@drawable/corcle_black_bg"
148 148 android:text="修改"
149 149 android:paddingLeft="5dp"
150 150 android:paddingRight="5dp"
... ... @@ -290,7 +290,7 @@
290 290 android:layout_width="wrap_content"
291 291 android:layout_height="wrap_content"
292 292 android:layout_marginLeft="18dp"
293   - android:background="@drawable/corcle_blue_bg"
  293 + android:background="@drawable/corcle_black_bg"
294 294 android:text="修改"
295 295 android:paddingLeft="5dp"
296 296 android:paddingRight="5dp"
... ...
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/card_view"
3 4 android:layout_width="match_parent"
4 5 android:layout_height="match_parent"
5 6 android:orientation="vertical">
... ... @@ -36,11 +37,13 @@
36 37 android:layout_gravity="center"
37 38 android:layout_marginTop="20dp"
38 39 android:src="@mipmap/change_info_icon" />
  40 +
39 41 <LinearLayout
40 42 android:layout_width="wrap_content"
41 43 android:layout_height="wrap_content"
42 44 android:layout_marginTop="20dp"
43 45 android:orientation="horizontal">
  46 +
44 47 <View
45 48 android:layout_width="450dp"
46 49 android:layout_height="0.7dp"
... ... @@ -48,13 +51,14 @@
48 51 android:background="@color/electronic_text">
49 52  
50 53 </View>
  54 +
51 55 <View
52   - android:layout_width="400dp"
53   - android:layout_height="0.7dp"
54   - android:layout_marginLeft="80dp"
55   - android:background="@color/electronic_text">
  56 + android:layout_width="400dp"
  57 + android:layout_height="0.7dp"
  58 + android:layout_marginLeft="80dp"
  59 + android:background="@color/electronic_text">
56 60  
57   - </View>
  61 + </View>
58 62  
59 63  
60 64 </LinearLayout>
... ... @@ -75,16 +79,16 @@
75 79 android:layout_width="wrap_content"
76 80 android:layout_height="wrap_content"
77 81 android:text="客户姓名"
78   - android:textColor="@color/btn_text_color"
  82 + android:textColor="@color/pickerview_wheelview_textcolor_center"
79 83 android:textSize="22sp" />
80 84  
81 85 <EditText
82 86 android:layout_width="wrap_content"
83 87 android:layout_height="wrap_content"
84   - android:background="@null"
85 88 android:layout_marginLeft="50dp"
86   - android:textColor="@color/electronic_text"
  89 + android:background="@null"
87 90 android:hint="请输入"
  91 + android:textColor="@color/electronic_text"
88 92 android:textSize="22sp" />
89 93  
90 94 </LinearLayout>
... ... @@ -99,14 +103,14 @@
99 103 android:layout_width="wrap_content"
100 104 android:layout_height="wrap_content"
101 105 android:text="购买地址"
102   - android:textColor="@color/btn_text_color"
  106 + android:textColor="@color/pickerview_wheelview_textcolor_center"
103 107 android:textSize="22sp" />
104 108  
105 109 <TextView
106 110 android:layout_width="wrap_content"
107 111 android:layout_height="wrap_content"
108   - android:text="请选择地区"
109 112 android:layout_marginLeft="60dp"
  113 + android:text="请选择地区"
110 114 android:textColor="@color/btn_text_color"
111 115 android:textSize="22sp" />
112 116  
... ... @@ -120,10 +124,12 @@
120 124 </LinearLayout>
121 125  
122 126 </LinearLayout>
  127 +
123 128 <LinearLayout
124 129 android:layout_width="wrap_content"
125 130 android:layout_height="wrap_content"
126 131 android:orientation="horizontal">
  132 +
127 133 <View
128 134 android:layout_width="450dp"
129 135 android:layout_height="0.7dp"
... ... @@ -131,6 +137,7 @@
131 137 android:background="@color/electronic_text">
132 138  
133 139 </View>
  140 +
134 141 <View
135 142 android:layout_width="400dp"
136 143 android:layout_height="0.7dp"
... ... @@ -158,14 +165,14 @@
158 165 android:layout_width="wrap_content"
159 166 android:layout_height="wrap_content"
160 167 android:text="客户地址"
161   - android:textColor="@color/btn_text_color"
  168 + android:textColor="@color/pickerview_wheelview_textcolor_center"
162 169 android:textSize="22sp" />
163 170  
164 171 <TextView
165 172 android:layout_width="wrap_content"
166 173 android:layout_height="wrap_content"
167   - android:text="请选择地区"
168 174 android:layout_marginLeft="50dp"
  175 + android:text="请选择地区"
169 176 android:textSize="22sp" />
170 177  
171 178 <ImageView
... ... @@ -184,12 +191,14 @@
184 191 android:layout_height="80dp"
185 192 android:layout_marginLeft="200dp"
186 193 android:gravity="center_vertical">
  194 +
187 195 <TextView
188 196 android:layout_width="wrap_content"
189 197 android:layout_height="wrap_content"
190 198 android:text=" "
191 199 android:textColor="@color/white"
192 200 android:textSize="22sp" />
  201 +
193 202 <EditText
194 203 android:layout_width="wrap_content"
195 204 android:layout_height="wrap_content"
... ... @@ -201,11 +210,13 @@
201 210 </LinearLayout>
202 211  
203 212 </LinearLayout>
  213 +
204 214 <LinearLayout
205 215 android:layout_width="wrap_content"
206 216 android:layout_height="wrap_content"
207 217  
208 218 android:orientation="horizontal">
  219 +
209 220 <View
210 221 android:layout_width="450dp"
211 222 android:layout_height="0.7dp"
... ... @@ -213,6 +224,7 @@
213 224 android:background="@color/electronic_text">
214 225  
215 226 </View>
  227 +
216 228 <View
217 229 android:layout_width="400dp"
218 230 android:layout_height="0.7dp"
... ... @@ -233,8 +245,9 @@
233 245 <LinearLayout
234 246 android:layout_width="wrap_content"
235 247 android:layout_height="80dp"
236   - android:gravity="center_vertical"
237   - android:layout_marginLeft="200dp">
  248 + android:layout_marginLeft="200dp"
  249 + android:gravity="center_vertical">
  250 +
238 251 <TextView
239 252 android:layout_width="wrap_content"
240 253 android:layout_height="wrap_content"
... ... @@ -262,25 +275,27 @@
262 275 android:layout_width="wrap_content"
263 276 android:layout_height="wrap_content"
264 277 android:text="本地售后电话"
265   - android:textColor="@color/btn_text_color"
  278 + android:textColor="@color/pickerview_wheelview_textcolor_center"
266 279 android:textSize="22sp" />
267 280  
268 281 <EditText
269 282 android:layout_width="wrap_content"
270 283 android:layout_height="wrap_content"
271   - android:hint="请输入"
272   - android:background="@null"
273 284 android:layout_marginLeft="25dp"
  285 + android:background="@null"
  286 + android:hint="请输入"
274 287 android:textColor="@color/btn_text_color"
275 288 android:textSize="22sp" />
276 289 </LinearLayout>
277 290  
278 291 </LinearLayout>
  292 +
279 293 <LinearLayout
280 294 android:layout_width="wrap_content"
281 295 android:layout_height="wrap_content"
282 296  
283 297 android:orientation="horizontal">
  298 +
284 299 <View
285 300 android:layout_width="450dp"
286 301 android:layout_height="0.7dp"
... ... @@ -288,6 +303,7 @@
288 303 android:background="@color/electronic_text">
289 304  
290 305 </View>
  306 +
291 307 <View
292 308 android:layout_width="400dp"
293 309 android:layout_height="0.7dp"
... ... @@ -316,16 +332,17 @@
316 332 android:layout_width="wrap_content"
317 333 android:layout_height="wrap_content"
318 334 android:text="购买时间"
319   - android:textColor="@color/btn_text_color"
  335 + android:textColor="@color/pickerview_wheelview_textcolor_center"
320 336 android:textSize="22sp" />
321 337  
322 338 <TextView
323 339 android:id="@+id/tv_buy_time"
324 340 android:layout_width="wrap_content"
325 341 android:layout_height="wrap_content"
326   - android:hint="请选择时间"
327 342 android:layout_marginLeft="50dp"
  343 + android:hint="请选择时间"
328 344 android:textSize="22sp" />
  345 +
329 346 <ImageView
330 347 android:layout_width="wrap_content"
331 348 android:layout_height="wrap_content"
... ... @@ -337,11 +354,13 @@
337 354 </LinearLayout>
338 355  
339 356 </LinearLayout>
  357 +
340 358 <LinearLayout
341 359 android:layout_width="wrap_content"
342 360 android:layout_height="wrap_content"
343 361  
344 362 android:orientation="horizontal">
  363 +
345 364 <View
346 365 android:layout_width="450dp"
347 366 android:layout_height="0.7dp"
... ... @@ -352,12 +371,13 @@
352 371  
353 372  
354 373 </LinearLayout>
  374 +
355 375 <Button
  376 + android:id="@+id/btn_ok"
  377 + style="@style/button_login_register_style"
356 378 android:layout_marginLeft="200dp"
357 379 android:layout_marginRight="200dp"
358 380 android:layout_marginTop="80dp"
359   - android:id="@+id/btn_ok"
360   - style="@style/button_login_register_style"
361 381 android:text="@string/string_regist_next" />
362 382  
363 383  
... ...
PersonalCenter/pickerview/src/main/java/com/bigkoo/pickerview/view/BasePickerView.java
... ... @@ -25,9 +25,8 @@ import com.bigkoo.pickerview.utils.PickerViewAnimateUtil;
25 25 */
26 26 public class BasePickerView {
27 27 private final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
28   - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM
  28 + ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER
29 29 );
30   -
31 30 private Context context;
32 31 protected ViewGroup contentContainer;
33 32 public ViewGroup decorView;//显示pickerview的根View,默认是activity的根view
... ... @@ -93,15 +92,18 @@ public class BasePickerView {
93 92 }
94 93 //将控件添加到decorView中
95 94 rootView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, decorView, false);
96   - rootView.setLayoutParams(new FrameLayout.LayoutParams(
97   - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
98   - ));
  95 + FrameLayout.LayoutParams rootparams = new FrameLayout.LayoutParams(
  96 + ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER
  97 + );
  98 + rootView.setLayoutParams(rootparams);
99 99 if (backgroudId != 0) {
100 100 rootView.setBackgroundColor(backgroudId);
101 101 }
102 102 // rootView.setBackgroundColor(ContextCompat.getColor(context,backgroudId));
103 103 //这个是真正要加载时间选取器的父布局
104 104 contentContainer = (ViewGroup) rootView.findViewById(R.id.content_container);
  105 + params.leftMargin = 500;
  106 + params.rightMargin= 500;
105 107 contentContainer.setLayoutParams(params);
106 108 }
107 109 setKeyBackCancelable(true);
... ...
PersonalCenter/pickerview/src/main/res/drawable/corcle_black_bg.xml
... ... @@ -0,0 +1,13 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 + <solid
  5 + android:color="@color/white"/>
  6 + <corners
  7 + android:bottomLeftRadius="20dp"
  8 + android:topLeftRadius="20dp"
  9 + android:bottomRightRadius="20dp"
  10 + android:topRightRadius="20dp"/>
  11 + <stroke android:width="1dp"
  12 + android:color="@color/login_edittext_hint"/>
  13 +</shape>
0 14 \ No newline at end of file
... ...
PersonalCenter/pickerview/src/main/res/layout/layout_basepickerview.xml
... ... @@ -2,13 +2,16 @@
2 2 <FrameLayout
3 3 android:id="@+id/outmost_container"
4 4 xmlns:android="http://schemas.android.com/apk/res/android"
5   - android:layout_width="match_parent"
6   - android:layout_height="match_parent"
7   - android:clickable="true"
8   - android:background="@color/pickerview_bgColor_overlay">
  5 + android:layout_width="wrap_content"
  6 + android:layout_height="wrap_content"
  7 + android:background="@drawable/corcle_black_bg"
  8 + android:padding="20dp"
  9 + android:clickable="true">
9 10  
10 11 <FrameLayout
11 12 android:id="@+id/content_container"
  13 + android:padding="20dp"
  14 + android:background="@drawable/corcle_black_bg"
12 15 android:layout_width="wrap_content"
13 16 android:layout_height="wrap_content">
14 17 </FrameLayout>
... ...
PersonalCenter/pickerview/src/main/res/layout/pickerview_time.xml
... ... @@ -2,15 +2,13 @@
2 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3 android:layout_width="wrap_content"
4 4 android:layout_height="wrap_content"
5   - android:background="@color/pickerview_bgColor_default"
6 5 android:orientation="vertical">
7 6  
8 7  
9 8 <LinearLayout
10 9 android:id="@+id/timepicker"
11   - android:layout_width="match_parent"
  10 + android:layout_width="wrap_content"
12 11 android:layout_height="wrap_content"
13   - android:background="@android:color/white"
14 12 android:orientation="horizontal">
15 13  
16 14 <com.bigkoo.pickerview.lib.WheelView
... ...
PersonalCenter/pickerview/src/main/res/values/colors.xml
... ... @@ -3,7 +3,8 @@
3 3 <color name="pickerview_timebtn_nor">#057dff</color>
4 4 <color name="pickerview_timebtn_pre">#c2daf5</color>
5 5 <color name="pickerview_bg_topbar">#f5f5f5</color>
6   -
  6 + <color name="white">#ffffffff</color>
  7 + <color name="login_edittext_hint">#afafaf</color>
7 8 <color name="pickerview_topbar_title">#000000</color>
8 9 <color name="pickerview_wheelview_textcolor_out">#a8a8a8</color>
9 10 <color name="pickerview_wheelview_textcolor_center">#2a2a2a</color>
... ...