Commit a1f628ad780aa2946606dac9943d0e3fab2ebf24

Authored by xiongwei
1 parent a145cbca13
Exists in master

完成界面

Showing 50 changed files with 1901 additions and 241 deletions   Show diff stats
PersonalCenter/.idea/modules.xml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4"> 2 <project version="4">
3 <component name="ProjectModuleManager"> 3 <component name="ProjectModuleManager">
4 <modules> 4 <modules>
5 <module fileurl="file://$PROJECT_DIR$/PersonalCenter.iml" filepath="$PROJECT_DIR$/PersonalCenter.iml" /> 5 <module fileurl="file://$PROJECT_DIR$/PersonalCenter.iml" filepath="$PROJECT_DIR$/PersonalCenter.iml" />
6 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> 6 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
7 <module fileurl="file://$PROJECT_DIR$/circledialog/circledialog.iml" filepath="$PROJECT_DIR$/circledialog/circledialog.iml" /> 7 <module fileurl="file://$PROJECT_DIR$/circledialog/circledialog.iml" filepath="$PROJECT_DIR$/circledialog/circledialog.iml" />
8 <module fileurl="file://$PROJECT_DIR$/pickerview/pickerview.iml" filepath="$PROJECT_DIR$/pickerview/pickerview.iml" /> 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" />
10 </modules> 9 </modules>
11 </component> 10 </component>
12 </project> 11 </project>
PersonalCenter/app/src/main/AndroidManifest.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.hjx.personalcenter"> 3 package="com.hjx.personalcenter">
4 4
5 <application 5 <application
6 android:allowBackup="true" 6 android:allowBackup="true"
7 android:icon="@mipmap/ic_launcher" 7 android:icon="@mipmap/ic_launcher"
8 android:label="@string/app_name" 8 android:label="@string/app_name"
9 android:supportsRtl="true" 9 android:supportsRtl="true"
10 android:theme="@style/Theme.AppCompat.Light.NoActionBar"> 10 android:theme="@style/Theme.AppCompat.Light.NoActionBar">
11 <activity 11 <activity
12 android:name=".activity.MainActivity" 12 android:name=".activity.MainActivity"
13 android:launchMode="singleTask" 13 android:launchMode="singleTask"
14 android:screenOrientation="landscape"> 14 android:screenOrientation="landscape">
15 <intent-filter> 15 <intent-filter>
16 <action android:name="android.intent.action.MAIN" /> 16 <action android:name="android.intent.action.MAIN" />
17 17
18 <category android:name="android.intent.category.LAUNCHER" /> 18 <category android:name="android.intent.category.LAUNCHER" />
19 </intent-filter> 19 </intent-filter>
20 </activity> 20 </activity>
21 <activity 21 <activity
22 android:name=".activity.LoginAndRegisterActivity" 22 android:name=".activity.LoginAndRegisterActivity"
23 android:launchMode="singleTask" 23 android:launchMode="singleTask"
24 android:screenOrientation="landscape"> 24 android:screenOrientation="landscape">
25 25
26 </activity> 26 </activity>
27 <activity 27 <activity
28 android:name=".activity.ForgotPasswordActivity" 28 android:name=".activity.ForgotPasswordActivity"
29 android:launchMode="singleTask" 29 android:launchMode="singleTask"
30 android:screenOrientation="landscape"> 30 android:screenOrientation="landscape">
31 31
32 </activity> 32 </activity>
33 <activity 33 <activity
34 android:name=".activity.ChangePasswordActivity" 34 android:name=".activity.ChangePasswordActivity"
35 android:launchMode="singleTask" 35 android:launchMode="singleTask"
36 android:screenOrientation="landscape"> 36 android:screenOrientation="landscape">
37 37
38 </activity> 38 </activity>
39 <activity 39 <activity
40 android:name=".activity.RegisterInfoActivity" 40 android:name=".activity.RegisterInfoActivity"
41 android:launchMode="singleTask" 41 android:launchMode="singleTask"
42 android:screenOrientation="landscape"> 42 android:screenOrientation="landscape">
43 43
44 </activity> 44 </activity>
45 <activity 45 <activity
46 android:name=".activity.ElectronicCardValidationActivity" 46 android:name=".activity.ElectronicCardValidationActivity"
47 android:launchMode="singleTask" 47 android:launchMode="singleTask"
48 android:screenOrientation="landscape"> 48 android:screenOrientation="landscape">
49 49
50 </activity> 50 </activity>
51 <activity 51 <activity
52 android:name=".activity.ChangeBangDingActivity" 52 android:name=".activity.ChangeBangDingActivity"
53 android:launchMode="singleTask" 53 android:launchMode="singleTask"
54 android:screenOrientation="landscape"> 54 android:screenOrientation="landscape">
55 55
56 </activity> 56 </activity>
57 <activity 57 <activity
58 android:name=".activity.ChangeElectronicCardInfoActivity" 58 android:name=".activity.ChangeElectronicCardInfoActivity"
59 android:launchMode="singleTask" 59 android:launchMode="singleTask"
60 android:screenOrientation="landscape"> 60 android:screenOrientation="landscape">
61 61
62 </activity> 62 </activity>
63 <activity 63 <activity
64 android:name=".activity.ChangeEletronicCardPhoneActivity" 64 android:name=".activity.ChangeEletronicCardPhoneActivity"
65 android:launchMode="singleTask" 65 android:launchMode="singleTask"
66 android:screenOrientation="landscape"> 66 android:screenOrientation="landscape">
67 67
68 </activity> 68 </activity>
69 <activity 69 <activity
70 android:name=".activity.ChoiseTextBookActivity" 70 android:name=".activity.ChoiseTextBookActivity"
71 android:launchMode="singleTask" 71 android:launchMode="singleTask"
72 android:screenOrientation="landscape"> 72 android:screenOrientation="landscape">
73 73
74 </activity> 74 </activity>
75 <activity 75 <activity
76 android:name=".activity.TheStartPageActivity" 76 android:name=".activity.TheStartPageActivity"
77 android:launchMode="singleTask" 77 android:launchMode="singleTask"
78 android:screenOrientation="landscape"> 78 android:screenOrientation="landscape">
79 79
80 </activity> 80 </activity>
81 <activity 81 <activity
82 android:name=".activity.ElectronicCardEditInfoActivity" 82 android:name=".activity.ElectronicCardEditInfoActivity"
83 android:launchMode="singleTask" 83 android:launchMode="singleTask"
84 android:screenOrientation="landscape"> 84 android:screenOrientation="landscape">
85 85
86 </activity> 86 </activity>
87 <activity 87 <activity
88 android:name=".activity.ElectronicCardInfoOKActivity" 88 android:name=".activity.ElectronicCardInfoOKActivity"
89 android:launchMode="singleTask" 89 android:launchMode="singleTask"
90 android:screenOrientation="landscape"> 90 android:screenOrientation="landscape">
91 91
92 </activity> 92 </activity>
93 <activity 93 <activity
94 android:name=".activity.ElectronicCardLookInfoActivity" 94 android:name=".activity.ElectronicCardLookInfoActivity"
95 android:launchMode="singleTask" 95 android:launchMode="singleTask"
96 android:screenOrientation="landscape"> 96 android:screenOrientation="landscape">
97 97
98 </activity> 98 </activity>
99 <activity 99 <activity
100 android:name=".activity.FeedBackActivity" 100 android:name=".activity.FeedBackActivity"
101 android:launchMode="singleTask" 101 android:launchMode="singleTask"
102 android:screenOrientation="landscape"> 102 android:screenOrientation="landscape">
103 103
104 </activity> 104 </activity>
105 <activity
106 android:name=".activity.AccountManagementActivity"
107 android:launchMode="singleTask"
108 android:screenOrientation="landscape">
109
110 </activity>
111 <activity
112 android:name=".activity.ChangePresonalInfoActivity"
113 android:launchMode="singleTask"
114 android:screenOrientation="landscape">
115
116 </activity>
105 </application> 117 </application>
106 118
107 </manifest> 119 </manifest>
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
File was created 1 package com.hjx.personalcenter.activity;
2
3 import android.app.Activity;
4 import android.os.Bundle;
5
6 import com.hjx.personalcenter.R;
7
8 /**账户管理 熊巍
9 * Created by h on 2017/8/12.
10 */
11
12 public class AccountManagementActivity extends Activity {
13 @Override
14 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_account_management);
17 }
18 }
19
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardInfoActivity.java
1 package com.hjx.personalcenter.activity; 1 package com.hjx.personalcenter.activity;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.os.Bundle; 4 import android.os.Bundle;
5 5
6 import com.hjx.personalcenter.R; 6 import com.hjx.personalcenter.R;
7 7
8 /** 8 /**
9 * Created by h on 2017/8/9. 9 * Created by h on 2017/8/9.
10 */ 10 */
11 11
12 public class ChangeElectronicCardInfoActivity extends Activity{ 12 public class ChangeElectronicCardInfoActivity extends Activity{
13 @Override 13 @Override
14 protected void onCreate(Bundle savedInstanceState) { 14 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState); 15 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_change_card_info); 16 setContentView(R.layout.activity_change_card_validation);
17 } 17 }
18 } 18 }
19 19
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePresonalInfoActivity.java
File was created 1 package com.hjx.personalcenter.activity;
2
3 import android.os.Bundle;
4 import android.support.v4.app.Fragment;
5 import android.support.v4.view.ViewPager;
6 import android.support.v7.app.AppCompatActivity;
7
8 import com.hjx.personalcenter.R;
9 import com.hjx.personalcenter.adapter.LoginAndRegisterAdapter;
10 import com.hjx.personalcenter.fragment.PresonInfoFragment;
11 import com.hjx.personalcenter.fragment.VersionsInfoFragment;
12 import com.hjx.personalcenter.thirdparty.SlidingTabLayout;
13
14 import java.util.ArrayList;
15 import java.util.Arrays;
16 import java.util.List;
17
18 /**
19 * Created by h on 2017/8/12.
20 */
21
22 public class ChangePresonalInfoActivity extends AppCompatActivity {
23 private ViewPager viewPager;
24 private SlidingTabLayout tableLayout;
25 private List<Fragment> presoninfo;
26 private LoginAndRegisterAdapter presoninfodapter;
27 private List<String> title = Arrays.asList("个人信息", "版本信息");
28 @Override
29 protected void onCreate(Bundle savedInstanceState) {
30 super.onCreate(savedInstanceState);
31 setContentView(R.layout.activity_change_preson_info);
32 initView();
33 initData();
34 setLister();
35
36 }
37 private void initView() {
38 viewPager = (ViewPager) findViewById(R.id.viewpager_login);
39 tableLayout = (SlidingTabLayout) findViewById(R.id.TabLayout_id);
40 }
41
42 private void initData() {
43 presoninfo = new ArrayList<>();
44 for (int i = 0; i < title.size(); i++) {
45 if (title.get(i).equals("个人信息")) {
46 presoninfo.add(PresonInfoFragment.newInstance(i + 1));
47 } else {
48 presoninfo.add(VersionsInfoFragment.newInstance(i + 1));
49 }
50 }
51
52
53 //设置Tab上的标题
54 tableLayout.setData(title);
55 //设置关联的ViewPager
56 tableLayout.setViewPager(viewPager, 0);
57 presoninfodapter = new LoginAndRegisterAdapter(presoninfo, getSupportFragmentManager());
58 //给ViewPager设置适配器
59 viewPager.setAdapter(presoninfodapter);
60 //设置滑动时数据不丢失
61 viewPager.setOffscreenPageLimit(1);
62 //将TabLayout和ViewPager关联起来。
63 }
64
65 private void setLister() {
66 }
67
68 }
69
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
1 package com.hjx.personalcenter.activity; 1 package com.hjx.personalcenter.activity;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Intent;
4 import android.graphics.Color; 5 import android.graphics.Color;
5 import android.os.Bundle; 6 import android.os.Bundle;
6 import android.view.Gravity;
7 import android.view.View; 7 import android.view.View;
8 import android.view.ViewGroup;
9 import android.widget.Button; 8 import android.widget.Button;
10 import android.widget.LinearLayout; 9 import android.widget.LinearLayout;
11 import android.widget.TextView; 10 import android.widget.TextView;
12 11
13 import com.bigkoo.pickerview.TimePickerView; 12 import com.bigkoo.pickerview.TimePickerView;
14 import com.hjx.personalcenter.R; 13 import com.hjx.personalcenter.R;
15 14
16 import java.text.SimpleDateFormat; 15 import java.text.SimpleDateFormat;
17 import java.util.Calendar; 16 import java.util.Calendar;
18 import java.util.Date; 17 import java.util.Date;
19 18
20 /**填写保卡信息 熊巍 19 /**填写保卡信息 熊巍
21 * Created by h on 2017/8/11. 20 * Created by h on 2017/8/11.
22 */ 21 */
23 22
24 public class ElectronicCardEditInfoActivity extends Activity implements View.OnClickListener { 23 public class ElectronicCardEditInfoActivity extends Activity implements View.OnClickListener {
25 private LinearLayout lineL_buy_time; 24 private LinearLayout lineL_buy_time;
26 private TextView tv_buy_time; 25 private TextView tv_buy_time;
27 private TimePickerView pvTime; 26 private TimePickerView pvTime;
27 private Button btn_change_info;
28 28
29 @Override 29 @Override
30 protected void onCreate(Bundle savedInstanceState) { 30 protected void onCreate(Bundle savedInstanceState) {
31 super.onCreate(savedInstanceState); 31 super.onCreate(savedInstanceState);
32 setContentView(R.layout.activity_electroniccard_info); 32 setContentView(R.layout.activity_electroniccard_info);
33 initView(); 33 initView();
34 initData(); 34 initData();
35 initLister(); 35 initLister();
36 initTimePicker(); 36 initTimePicker();
37 } 37 }
38 38
39 private void initView() { 39 private void initView() {
40 lineL_buy_time = (LinearLayout) findViewById(R.id.lineL_buy_time); 40 lineL_buy_time = (LinearLayout) findViewById(R.id.lineL_buy_time);
41 tv_buy_time = (TextView) findViewById(R.id.tv_buy_time); 41 tv_buy_time = (TextView) findViewById(R.id.tv_buy_time);
42 btn_change_info = (Button) findViewById(R.id.btn_change_info);
42 } 43 }
43 44
44 private void initData() { 45 private void initData() {
45 46
46 } 47 }
47 48
48 private void initLister() { 49 private void initLister() {
49 lineL_buy_time.setOnClickListener(this); 50 lineL_buy_time.setOnClickListener(this);
51 btn_change_info.setOnClickListener(this);
50 52
51 } 53 }
52 private void initTimePicker() { 54 private void initTimePicker() {
53 //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) 55 //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释)
54 //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 56 //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
55 Calendar selectedDate = Calendar.getInstance(); 57 Calendar selectedDate = Calendar.getInstance();
56 Calendar startDate = Calendar.getInstance(); 58 Calendar startDate = Calendar.getInstance();
57 startDate.set(1900, 1, 1); 59 startDate.set(1900, 1, 1);
58 Calendar endDate = Calendar.getInstance(); 60 Calendar endDate = Calendar.getInstance();
59 endDate.set(2100, 1, 1); 61 endDate.set(2100, 1, 1);
60 //时间选择器 62 //时间选择器
61 pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() { 63 pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() {
62 @Override 64 @Override
63 public void onTimeSelect(Date date, View v) {//选中事件回调 65 public void onTimeSelect(Date date, View v) {//选中事件回调
64 // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null 66 // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null
65 /*btn_Time.setText(getTime(date));*/ 67 /*btn_Time.setText(getTime(date));*/
66 TextView btn = (TextView) v; 68 TextView btn = (TextView) v;
67 btn.setText(getTime(date)); 69 btn.setText(getTime(date));
68 } 70 }
69 }) 71 })
70 //年月日时分秒 的显示与否,不设置则默认全部显示 72 //年月日时分秒 的显示与否,不设置则默认全部显示
71 .setType(new boolean[]{true, true, true, false, false, false}) 73 .setType(new boolean[]{true, true, true, false, false, false})
72 .setLabel("", "", "", "", "", "") 74 .setLabel("", "", "", "", "", "")
73 .isCenterLabel(false) 75 .isCenterLabel(false)
74 .setDividerColor(Color.DKGRAY) 76 .setDividerColor(Color.DKGRAY)
75 .setContentSize(21) 77 .setContentSize(21)
76 .setDate(selectedDate) 78 .setDate(selectedDate)
77 .setRangDate(startDate, endDate) 79 .setRangDate(startDate, endDate)
78 .setBackgroundId(0x80000000) //设置外部遮罩颜色 80 .setBackgroundId(0x80000000) //设置外部遮罩颜色
79 .setDecorView(null) 81 .setDecorView(null)
82 .setTitleText("购买日期")
83 .setTitleSize(22)
84 .setCancelColor(Color.GRAY)
85 .setSubCalSize(22)
86 .setDividerColor(Color.GRAY)
87 .setSubmitColor(Color.GRAY)
80 .build(); 88 .build();
81 } 89 }
82 private String getTime(Date date) {//可根据需要自行截取数据显示 90 private String getTime(Date date) {//可根据需要自行截取数据显示
83 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); 91 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
84 return format.format(date); 92 return format.format(date);
85 } 93 }
86 94
87 @Override 95 @Override
88 public void onClick(View v) { 96 public void onClick(View v) {
89 switch (v.getId()){ 97 switch (v.getId()){
90 case R.id.lineL_buy_time: 98 case R.id.lineL_buy_time:
91 pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view 99 pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view
92 break; 100 break;
101 case R.id.btn_change_info:
102 Intent intent = new Intent();
103 intent.setClass(ElectronicCardEditInfoActivity.this,ElectronicCardInfoOKActivity.class);
104 startActivity(intent);
105 overridePendingTransition(R.anim.rightin, R.anim.rightout);
106 break;
93 } 107 }
94 108
95 109
96 } 110 }
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java
1 package com.hjx.personalcenter.activity; 1 package com.hjx.personalcenter.activity;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Intent;
4 import android.os.Bundle; 5 import android.os.Bundle;
6 import android.view.View;
7 import android.widget.Button;
5 8
6 import com.hjx.personalcenter.R; 9 import com.hjx.personalcenter.R;
7 10
8 /** 11 /**确认保卡信息
9 * Created by h on 2017/8/11. 12 * Created by h on 2017/8/11.
10 */ 13 */
11 14
12 public class ElectronicCardInfoOKActivity extends Activity{ 15 public class ElectronicCardInfoOKActivity extends Activity implements View.OnClickListener {
16 private Button btn_finish;
13 @Override 17 @Override
14 protected void onCreate(Bundle savedInstanceState) { 18 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState); 19 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_ok_cardinfo); 20 setContentView(R.layout.activity_ok_cardinfo);
21 initView();
22 initData();
23 initLister();
24 }
25 private void initView() {
26 btn_finish = (Button) findViewById(R.id.btn_finish);
27 }
28
29 private void initData() {
30
31 }
32
33 private void initLister() {
34 btn_finish.setOnClickListener(this);
35 }
36
37 @Override
38 public void onClick(View v) {
39 switch (v.getId()){
40 case R.id.btn_finish:
41 Intent intent = new Intent();
42 intent.setClass(ElectronicCardInfoOKActivity.this,TheStartPageActivity.class);
43 startActivity(intent);
44 overridePendingTransition(R.anim.rightin, R.anim.rightout);
45 break;
46 }
17 } 47 }
18 } 48 }
19 49
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java
1 package com.hjx.personalcenter.activity; 1 package com.hjx.personalcenter.activity;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Intent;
4 import android.os.Bundle; 5 import android.os.Bundle;
6 import android.view.View;
7 import android.widget.Button;
5 8
6 import com.hjx.personalcenter.R; 9 import com.hjx.personalcenter.R;
7 10
8 /** 11 /**
9 * Created by h on 2017/8/9. 12 * Created by h on 2017/8/9.
10 */ 13 */
11 14
12 public class ElectronicCardValidationActivity extends Activity { 15 public class ElectronicCardValidationActivity extends Activity implements View.OnClickListener {
16 private Button btn_card_valiyanzhen;
13 @Override 17 @Override
14 protected void onCreate(Bundle savedInstanceState) { 18 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState); 19 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_electroniccard_validation); 20 setContentView(R.layout.activity_electroniccard_validation);
21 initView();
22 initData();
23 initLister();
24 }
25
26 private void initView() {
27 btn_card_valiyanzhen = (Button) findViewById(R.id.btn_card_valiyanzhen);
28 }
29
30 private void initData() {
31
32 }
33
34 private void initLister() {
35 btn_card_valiyanzhen.setOnClickListener(this);
36
37 }
38
39 @Override
40 public void onClick(View v) {
41 switch (v.getId()){
42 case R.id.btn_card_valiyanzhen:
43 Intent intent = new Intent();
44 intent.setClass(ElectronicCardValidationActivity.this,ElectronicCardEditInfoActivity.class);
45 startActivity(intent);
46 overridePendingTransition(R.anim.rightin, R.anim.rightout);
47 break;
48 }
17 } 49 }
18 } 50 }
19 51
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
1 package com.hjx.personalcenter.activity; 1 package com.hjx.personalcenter.activity;
2 2
3 import android.content.Intent; 3 import android.content.Intent;
4 import android.support.v7.app.AppCompatActivity;
5 import android.os.Bundle; 4 import android.os.Bundle;
5 import android.support.v7.app.AppCompatActivity;
6 import android.view.View; 6 import android.view.View;
7 import android.widget.TextView; 7 import android.widget.ImageView;
8 8
9 import com.hjx.personalcenter.R; 9 import com.hjx.personalcenter.R;
10 10
11 public class MainActivity extends AppCompatActivity { 11 public class MainActivity extends AppCompatActivity implements View.OnClickListener {
12 TextView ssss; 12 ImageView iv_imformatioan;
13 @Override 13 @Override
14 protected void onCreate(Bundle savedInstanceState) { 14 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState); 15 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_main); 16 setContentView(R.layout.activity_main);
17 ssss = (TextView) findViewById(R.id.ssss); 17 initView();
18 ssss.setOnClickListener(new View.OnClickListener() { 18 initData();
19 @Override 19 initLister();
20 public void onClick(View v) { 20 }
21 Intent intent = new Intent(MainActivity.this,ElectronicCardEditInfoActivity.class); 21
22 private void initView() {
23 iv_imformatioan = (ImageView) findViewById(R.id.iv_imformatioan);
24 }
25
26 private void initData() {
27
28 }
29
30 private void initLister() {
31 iv_imformatioan.setOnClickListener(this);
32 }
33
34 @Override
35 public void onClick(View v) {
36 switch (v.getId()){
37 case R.id.iv_imformatioan:
38 Intent intent = new Intent();
39 intent.setClass(MainActivity.this,LoginAndRegisterActivity.class);
22 startActivity(intent); 40 startActivity(intent);
23 } 41 overridePendingTransition(R.anim.rightin, R.anim.rightout);
24 }); 42 break;
43 }
44
25 } 45 }
26 } 46 }
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/TheStartPageActivity.java
1 package com.hjx.personalcenter.activity; 1 package com.hjx.personalcenter.activity;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Intent;
4 import android.os.Bundle; 5 import android.os.Bundle;
6 import android.view.View;
7 import android.widget.Button;
5 8
6 import com.hjx.personalcenter.R; 9 import com.hjx.personalcenter.R;
7 10
8 /** 11 /**
9 * Created by h on 2017/8/10. 12 * Created by h on 2017/8/10.
10 */ 13 */
11 14
12 public class TheStartPageActivity extends Activity{ 15 public class TheStartPageActivity extends Activity implements View.OnClickListener {
16 private Button btn_start;
13 @Override 17 @Override
14 protected void onCreate(Bundle savedInstanceState) { 18 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState); 19 super.onCreate(savedInstanceState);
16 setContentView(R.layout.activity_start_page); 20 setContentView(R.layout.activity_start_page);
21 initView();
22 initData();
23 initLister();
24 }
25 private void initView() {
26 btn_start = (Button) findViewById(R.id.btn_start);
27 }
28
29 private void initData() {
30
31 }
32
33 private void initLister() {
34 btn_start.setOnClickListener(this);
35 }
36
37 @Override
38 public void onClick(View v) {
39 switch (v.getId()){
40 case R.id.btn_start:
41 Intent intent = new Intent();
42 intent.setClass(TheStartPageActivity.this,MainActivity.class);
43 startActivity(intent);
44 overridePendingTransition(R.anim.rightin, R.anim.rightout);
45 break;
46 }
17 } 47 }
18 } 48 }
19 49
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java
1 package com.hjx.personalcenter.customdialog; 1 package com.hjx.personalcenter.customdialog;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.Intent; 4 import android.content.Intent;
5 import android.graphics.Color; 5 import android.graphics.Color;
6 import android.os.Bundle; 6 import android.os.Bundle;
7 import android.view.Gravity; 7 import android.view.Gravity;
8 import android.view.LayoutInflater; 8 import android.view.LayoutInflater;
9 import android.view.View; 9 import android.view.View;
10 import android.view.ViewGroup; 10 import android.view.ViewGroup;
11 11
12 import com.hjx.personalcenter.R; 12 import com.hjx.personalcenter.R;
13 import com.hjx.personalcenter.activity.TheStartPageActivity; 13 import com.hjx.personalcenter.activity.ElectronicCardValidationActivity;
14 import com.mylhyl.circledialog.BaseCircleDialog; 14 import com.mylhyl.circledialog.BaseCircleDialog;
15 import com.mylhyl.circledialog.res.values.CircleDimen; 15 import com.mylhyl.circledialog.res.values.CircleDimen;
16 16
17 /** 17 /**
18 * Created by h on 2017/8/10. 18 * Created by h on 2017/8/10.
19 */ 19 */
20 20
21 public class ElectronicCardDialog extends BaseCircleDialog { 21 public class ElectronicCardDialog extends BaseCircleDialog {
22 public static ElectronicCardDialog getInstance() { 22 public static ElectronicCardDialog getInstance() {
23 ElectronicCardDialog dialogFragment = new ElectronicCardDialog(); 23 ElectronicCardDialog dialogFragment = new ElectronicCardDialog();
24 dialogFragment.setCanceledBack(true); 24 dialogFragment.setCanceledBack(true);
25 dialogFragment.setCanceledOnTouchOutside(true); 25 dialogFragment.setCanceledOnTouchOutside(true);
26 dialogFragment.setRadius(CircleDimen.RADIUS); 26 dialogFragment.setRadius(CircleDimen.RADIUS);
27 dialogFragment.setWidth(0.8f); 27 dialogFragment.setWidth(0.8f);
28 dialogFragment.setGravity(Gravity.CENTER); 28 dialogFragment.setGravity(Gravity.CENTER);
29 dialogFragment.setBackgroundColor(Color.WHITE); 29 dialogFragment.setBackgroundColor(Color.WHITE);
30 return dialogFragment; 30 return dialogFragment;
31 } 31 }
32 @Override 32 @Override
33 public View createView(Context context, LayoutInflater inflater, ViewGroup container) { 33 public View createView(Context context, LayoutInflater inflater, ViewGroup container) {
34 return inflater.inflate(R.layout.custom_adilog_electroniccard, container, false); 34 return inflater.inflate(R.layout.custom_adilog_electroniccard, container, false);
35 } 35 }
36 @Override 36 @Override
37 public void onActivityCreated(Bundle savedInstanceState) { 37 public void onActivityCreated(Bundle savedInstanceState) {
38 super.onActivityCreated(savedInstanceState); 38 super.onActivityCreated(savedInstanceState);
39 getView().findViewById(R.id.fill_card).setOnClickListener(new View.OnClickListener() { 39 getView().findViewById(R.id.fill_card).setOnClickListener(new View.OnClickListener() {
40 @Override 40 @Override
41 public void onClick(View v) { 41 public void onClick(View v) {
42 //有保卡信息直接进入开始界面,没有则跳转保卡信息
43 // Intent intent = new Intent();
44 // intent.setClass(getActivity(),TheStartPageActivity.class);
45 // startActivity(intent);
46 // getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout);
42 Intent intent = new Intent(); 47 Intent intent = new Intent();
43 intent.setClass(getActivity(),TheStartPageActivity.class); 48 intent.setClass(getActivity(),ElectronicCardValidationActivity.class);
44 startActivity(intent); 49 startActivity(intent);
45 getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); 50 getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout);
46 51
47 } 52 }
48 }); 53 });
49 54
50 } 55 }
51 56
52 } 57 }
53 58
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/LoginFragment.java
1 package com.hjx.personalcenter.fragment; 1 package com.hjx.personalcenter.fragment;
2 2
3 import android.content.Intent; 3 import android.content.Intent;
4 import android.os.Bundle; 4 import android.os.Bundle;
5 import android.support.annotation.Nullable; 5 import android.support.annotation.Nullable;
6 import android.support.v4.app.Fragment; 6 import android.support.v4.app.Fragment;
7 import android.view.LayoutInflater; 7 import android.view.LayoutInflater;
8 import android.view.View; 8 import android.view.View;
9 import android.view.ViewGroup; 9 import android.view.ViewGroup;
10 import android.widget.Button;
10 import android.widget.TextView; 11 import android.widget.TextView;
11 12
12 import com.hjx.personalcenter.R; 13 import com.hjx.personalcenter.R;
13 import com.hjx.personalcenter.activity.ForgotPasswordActivity; 14 import com.hjx.personalcenter.activity.ForgotPasswordActivity;
15 import com.hjx.personalcenter.activity.MainActivity;
14 16
15 /** 17 /**
16 * 登录 18 * 登录
17 * Created by h on 2017/8/8. 19 * Created by h on 2017/8/8.
18 */ 20 */
19 21
20 public class LoginFragment extends Fragment implements View.OnClickListener { 22 public class LoginFragment extends Fragment implements View.OnClickListener {
21 private View mView; 23 private View mView;
22 private int type; 24 private int type;
23 private TextView tv_forget_pwd; 25 private TextView tv_forget_pwd;
26 private Button btn_login;
24 public static String TABLAYOUT_FRAGMENT = "tab_fragment"; 27 public static String TABLAYOUT_FRAGMENT = "tab_fragment";
25 28 Intent intent = new Intent();
26 public static LoginFragment newInstance(int type) { 29 public static LoginFragment newInstance(int type) {
27 LoginFragment fragment = new LoginFragment(); 30 LoginFragment fragment = new LoginFragment();
28 Bundle bundle = new Bundle(); 31 Bundle bundle = new Bundle();
29 bundle.putSerializable(TABLAYOUT_FRAGMENT, type); 32 bundle.putSerializable(TABLAYOUT_FRAGMENT, type);
30 fragment.setArguments(bundle); 33 fragment.setArguments(bundle);
31 return fragment; 34 return fragment;
32 35
33 } 36 }
34 37
35 @Override 38 @Override
36 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 39 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
37 if (mView == null) { 40 if (mView == null) {
38 mView = inflater.inflate(R.layout.fragment_loginandregister_login, container, false); 41 mView = inflater.inflate(R.layout.fragment_loginandregister_login, container, false);
39 initView(mView); 42 initView(mView);
40 initData(); 43 initData();
41 setLister(); 44 setLister();
42 45
43 46
44 } 47 }
45 return mView; 48 return mView;
46 } 49 }
47 //初始化 50 //初始化
48 private void initView(View mView) { 51 private void initView(View mView) {
49 tv_forget_pwd = (TextView) mView.findViewById(R.id.tv_forget_pwd); 52 tv_forget_pwd = (TextView) mView.findViewById(R.id.tv_forget_pwd);
53 btn_login = (Button) mView.findViewById(R.id.btn_login);
50 54
51 } 55 }
52 private void initData() { 56 private void initData() {
53 } 57 }
54 private void setLister() { 58 private void setLister() {
55 tv_forget_pwd.setOnClickListener(this); 59 tv_forget_pwd.setOnClickListener(this);
60 btn_login.setOnClickListener(this);
56 } 61 }
57 62
58 63
59 @Override 64 @Override
60 public void onClick(View v) { 65 public void onClick(View v) {
61 switch (v.getId()){ 66 switch (v.getId()){
62 case R.id.tv_forget_pwd: 67 case R.id.tv_forget_pwd:
63 Intent intent = new Intent();
64 intent.setClass(getActivity(),ForgotPasswordActivity.class); 68 intent.setClass(getActivity(),ForgotPasswordActivity.class);
65 startActivity(intent); 69 startActivity(intent);
66 getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); 70 getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout);
67 break; 71 break;
72 case R.id.btn_login:
73 intent.setClass(getActivity(),MainActivity.class);
74 startActivity(intent);
75 getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout);
76 break;
68 } 77 }
69 78
70 } 79 }
71 } 80 }
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java
File was created 1 package com.hjx.personalcenter.fragment;
2
3 import android.os.Bundle;
4 import android.support.annotation.Nullable;
5 import android.support.v4.app.Fragment;
6 import android.view.LayoutInflater;
7 import android.view.View;
8 import android.view.ViewGroup;
9
10 import com.hjx.personalcenter.R;
11
12 /**
13 * Created by h on 2017/8/12.
14 */
15
16 public class PresonInfoFragment extends Fragment {
17 private View mView;
18 private int type;
19 public static String TABLAYOUT_FRAGMENT = "tab_fragment";
20
21 public static PresonInfoFragment newInstance(int type) {
22 PresonInfoFragment fragment = new PresonInfoFragment();
23 Bundle bundle = new Bundle();
24 bundle.putSerializable(TABLAYOUT_FRAGMENT, type);
25 fragment.setArguments(bundle);
26 return fragment;
27
28 }
29 @Override
30 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
31 if (mView == null) {
32 mView = inflater.inflate(R.layout.fragment_changge_presonal_info, container, false);
33 initView(mView);
34 initData();
35 setLister();
36
37
38 }
39 return mView;
40 }
41 //初始化
42 private void initView(View mView) {
43
44 }
45 private void initData() {
46 }
47 private void setLister() {
48 }
49
50 }
51
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java
File was created 1 package com.hjx.personalcenter.fragment;
2
3 import android.os.Bundle;
4 import android.support.annotation.Nullable;
5 import android.support.v4.app.Fragment;
6 import android.view.LayoutInflater;
7 import android.view.View;
8 import android.view.ViewGroup;
9 import android.widget.GridView;
10 import android.widget.SimpleAdapter;
11
12 import com.hjx.personalcenter.R;
13
14 import java.util.ArrayList;
15 import java.util.HashMap;
16 import java.util.List;
17 import java.util.Map;
18
19 /**
20 * Created by h on 2017/8/12.
21 */
22
23 public class VersionsInfoFragment extends Fragment {
24 private GridView gridView;
25 private List<Map<String, Object>> data_list;
26 private SimpleAdapter sim_adapter;
27 private View mView;
28 private int type;
29 public static String TABLAYOUT_FRAGMENT = "tab_fragment";
30
31 public static VersionsInfoFragment newInstance(int type) {
32 VersionsInfoFragment fragment = new VersionsInfoFragment();
33 Bundle bundle = new Bundle();
34 bundle.putSerializable(TABLAYOUT_FRAGMENT, type);
35 fragment.setArguments(bundle);
36 return fragment;
37
38 }
39 // 图片封装为一个数组
40 private int[] icon = { R.mipmap.ic_launcher, R.mipmap.ic_launcher,
41 R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
42 R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher,
43 R.mipmap.ic_launcher};
44 private String[] subject = { "语文", "数学", "英语", "物理", "化学", "生物", "政治",
45 "历史", "地理" };
46 private String[] publish = { "人民教育出版社", "人民教育出版社", "人民教育出版社",
47 "人民教育出版社", "人民教育出版社", "人民教育出版社", "人民教育出版社",
48 "人民教育出版社", "人民教育出版社" };
49 @Override
50 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
51 if (mView == null) {
52 mView = inflater.inflate(R.layout.activity_choisetextbook, container, false);
53 initView(mView);
54 initData();
55 setLister();
56
57
58 }
59 return mView;
60 }
61 //初始化
62 private void initView(View mView) {
63 gridView =(GridView) mView.findViewById(R.id.grideview);
64
65 }
66 private void initData() {
67 data_list = new ArrayList<Map<String, Object>>();
68 getData();
69 String [] from ={"image","text","text1"};
70 int [] to = {R.id.image,R.id.text};
71 sim_adapter = new SimpleAdapter(getActivity(), data_list, R.layout.fragment_changge_version_info_itmes, from, to);
72 //配置适配器
73 gridView.setAdapter(sim_adapter);
74 }
75 public List<Map<String, Object>> getData(){
76 //cion和iconName的长度是相同的,这里任选其一都可以
77 for(int i=0;i<icon.length;i++){
78 Map<String, Object> map = new HashMap<String, Object>();
79 map.put("image", icon[i]);
80 map.put("text", subject[i]);
81 map.put("text1", publish[i]);
82 data_list.add(map);
83 }
84
85 return data_list;
86 }
87 private void setLister() {
88 }
89 }
90
PersonalCenter/app/src/main/res/layout/activity_account_management.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical"
4 android:layout_width="match_parent"
5 android:layout_height="match_parent">
6 <RelativeLayout
7 android:id="@+id/title"
8 android:layout_width="match_parent"
9 android:layout_height="wrap_content"
10 android:background="@color/login_text_blue"
11 android:minHeight="50dp" >
12
13 <ImageView
14 android:id="@+id/cancel"
15 android:layout_width="wrap_content"
16 android:layout_height="wrap_content"
17 android:layout_centerVertical="true"
18 android:paddingLeft="20dp"
19 android:paddingRight="20dp"
20 android:src="@mipmap/title_back" />
21
22 <TextView
23 android:id="@+id/menu_title"
24 android:layout_width="wrap_content"
25 android:layout_height="wrap_content"
26 android:layout_centerInParent="true"
27 android:text="@string/account_management"
28 android:textColor="@android:color/white"
29 android:textSize="22sp" />
30 </RelativeLayout>
31 <LinearLayout
32 android:layout_width="wrap_content"
33 android:layout_height="wrap_content"
34 android:orientation="horizontal"
35 android:layout_margin="20dp"
36 android:gravity="center_vertical">
37 <View
38 android:layout_width="5dp"
39 android:layout_height="20dp"
40 android:background="@color/login_text_blue">
41
42 </View>
43 <TextView
44 android:layout_width="wrap_content"
45 android:layout_height="wrap_content"
46 android:text="账户安全"
47 android:layout_marginLeft="5dp"
48 android:textSize="22sp"
49 />
50
51 </LinearLayout>
52 <LinearLayout
53 android:layout_width="match_parent"
54 android:layout_height="wrap_content"
55 android:layout_marginLeft="60dp"
56 android:orientation="vertical">
57 <LinearLayout
58 android:layout_width="match_parent"
59 android:layout_height="wrap_content">
60
61
62 <TextView
63 android:layout_width="0dp"
64 android:layout_height="wrap_content"
65 android:layout_weight="1.5"
66 android:textSize="22sp"
67 android:text="当前绑定手机号"/>
68 <TextView
69 android:layout_width="0dp"
70 android:layout_height="wrap_content"
71 android:layout_marginLeft="50dp"
72 android:layout_weight="6"
73 android:textSize="22sp"
74 android:text="123556677"/>
75 <TextView
76 android:layout_width="0dp"
77 android:layout_height="wrap_content"
78 android:layout_weight="1"
79 android:textSize="22sp"
80 android:text="更换绑定"/>
81 <ImageView
82 android:layout_width="wrap_content"
83 android:layout_height="wrap_content"
84 android:layout_weight="0.1"
85 android:padding="10dp"
86 android:src="@mipmap/youjiantou"/>
87 </LinearLayout>
88 <LinearLayout
89 android:layout_width="match_parent"
90 android:layout_marginTop="30dp"
91 android:layout_height="wrap_content">
92
93
94 <TextView
95 android:layout_width="0dp"
96 android:layout_height="wrap_content"
97 android:layout_weight="1.5"
98 android:textSize="22sp"
99 android:text="登录密码"/>
100 <TextView
101 android:layout_width="0dp"
102 android:layout_height="wrap_content"
103 android:layout_marginLeft="50dp"
104 android:layout_weight="6"
105 android:textSize="22sp"
106 android:text="已设置"/>
107 <TextView
108 android:layout_width="0dp"
109 android:layout_height="wrap_content"
110 android:layout_weight="1"
111 android:textSize="22sp"
112 android:text="修改密码"/>
113 <ImageView
114 android:layout_width="wrap_content"
115 android:layout_height="wrap_content"
116 android:layout_weight="0.1"
117 android:padding="10dp"
118 android:src="@mipmap/youjiantou"/>
119 </LinearLayout>
120
121 </LinearLayout>
122
123 <View
124 android:layout_width="match_parent"
125 android:layout_margin="20dp"
126 android:layout_height="0.7dp"
127 android:background="#FF909090" />
128 <LinearLayout
129 android:layout_width="wrap_content"
130 android:layout_height="wrap_content"
131 android:orientation="horizontal"
132 android:layout_margin="20dp"
133 android:gravity="center_vertical">
134 <View
135 android:layout_width="5dp"
136 android:layout_height="20dp"
137 android:background="@color/login_text_blue">
138
139 </View>
140 <TextView
141 android:layout_width="wrap_content"
142 android:layout_height="wrap_content"
143 android:text="子账户管理"
144 android:layout_marginLeft="5dp"
145 android:textSize="22sp"
146 />
147
148 </LinearLayout>
149 <GridView
150 android:id="@+id/gv_accunt"
151 android:layout_width="match_parent"
152 android:layout_height="wrap_content"
153 android:numColumns="3">
154
155 </GridView>
156
157
158
159
160 </LinearLayout>
PersonalCenter/app/src/main/res/layout/activity_change_card_info.xml
1 <?xml version="1.0" encoding="utf-8"?> File was deleted
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="#ffffffff"
6 android:orientation="vertical">
7
8 <RelativeLayout
9 android:id="@+id/title"
10 android:layout_width="match_parent"
11 android:layout_height="wrap_content"
12 android:background="@color/login_text_blue"
13 android:minHeight="50dp">
14
15 <ImageView
16 android:id="@+id/cancel"
17 android:layout_width="wrap_content"
18 android:layout_height="wrap_content"
19 android:layout_centerVertical="true"
20 android:paddingLeft="20dp"
21 android:paddingRight="20dp"
22 android:src="@mipmap/title_back" />
23
24 <TextView
25 android:id="@+id/menu_title"
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"
28 android:layout_centerInParent="true"
29 android:text="@string/string_electroniccard_info_change"
30 android:textColor="@android:color/white"
31 android:textSize="22sp" />
32 </RelativeLayout>
33
34 <RelativeLayout
35 android:layout_width="match_parent"
36 android:layout_height="match_parent"
37 android:layout_below="@id/title"
38 android:background="#ffffffff"
39 android:orientation="vertical"
40 android:paddingLeft="250dp"
41 android:paddingRight="250dp">
42
43 <EditText
44 android:id="@+id/et_phonenumber"
45 style="@style/login_register_edit_style"
46 android:layout_marginTop="150dp"
47 android:hint="手机号"
48 android:inputType="phone" />
49
50 <TextView
51 android:id="@+id/phonenumber_error_hint"
52 style="@style/registererrhint_style"
53 android:layout_below="@id/et_phonenumber" />
54
55 <LinearLayout
56 android:id="@+id/rl_authcode"
57 android:layout_width="match_parent"
58 android:layout_height="wrap_content"
59 android:layout_below="@id/et_phonenumber"
60 android:layout_marginTop="30dp"
61 android:orientation="horizontal">
62
63 <EditText
64 android:id="@+id/et_authcode"
65 style="@style/login_register_edit_rect_style"
66 android:layout_marginRight="-4px"
67 android:layout_weight="1"
68 android:hint="验证码"
69 android:numeric="integer" />
70
71 <Button
72 android:id="@+id/btn_authcode"
73 style="@style/login_register_btn_authcode_rect_style"
74 android:layout_marginLeft="0px"
75 android:layout_marginTop="0px"
76 android:layout_weight="2"
77 android:text="获取验证码"
78 android:textColor="@color/btn_text_color" />
79 </LinearLayout>
80
81 <TextView
82 android:id="@+id/authcode_error_hint"
83 style="@style/registererrhint_style"
84 android:layout_below="@id/rl_authcode" />
85
86 <RelativeLayout
87 android:id="@+id/pwd_rl"
88 android:layout_width="match_parent"
89 android:layout_height="wrap_content"
90 android:layout_below="@id/rl_authcode"
91 android:layout_marginTop="30dp">
92
93 <EditText
94 android:id="@+id/et_newpassword"
95 style="@style/login_register_edit_style"
96 android:hint="请选择地区"
97 android:inputType="textPassword" />
98
99 <ImageView
100 android:id="@+id/iv_pwd_change"
101 style="@style/iv_pwd_change_style" />
102 </RelativeLayout>
103
104 <TextView
105 android:id="@+id/newpassword_error_hint"
106 style="@style/registererrhint_style"
107 android:layout_below="@id/pwd_rl" />
108
109 <EditText
110 android:id="@+id/et_again_newpassword"
111 style="@style/login_register_edit_style"
112 android:layout_below="@id/pwd_rl"
113 android:layout_marginTop="30dp"
114 android:hint="请选择详细地址"
115 android:inputType="textPassword" />
116
117 <TextView
118 android:id="@+id/again_newpassword_error_hint"
119 style="@style/registererrhint_style"
120 android:layout_below="@id/et_again_newpassword" />
121
122 <Button
123 android:id="@+id/btn_ok"
124 style="@style/button_login_register_style"
125 android:layout_below="@id/et_again_newpassword"
126 android:layout_marginTop="30dp"
127 android:text="@string/ok" />
128 </RelativeLayout>
129
130 </RelativeLayout>
PersonalCenter/app/src/main/res/layout/activity_change_card_validation.xml
File was created 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="#ffffffff"
6 android:orientation="vertical">
7
8 <RelativeLayout
9 android:id="@+id/title"
10 android:layout_width="match_parent"
11 android:layout_height="wrap_content"
12 android:background="@color/login_text_blue"
13 android:minHeight="50dp">
14
15 <ImageView
16 android:id="@+id/cancel"
17 android:layout_width="wrap_content"
18 android:layout_height="wrap_content"
19 android:layout_centerVertical="true"
20 android:paddingLeft="20dp"
21 android:paddingRight="20dp"
22 android:src="@mipmap/title_back" />
23
24 <TextView
25 android:id="@+id/menu_title"
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"
28 android:layout_centerInParent="true"
29 android:text="@string/string_electroniccard_info_change"
30 android:textColor="@android:color/white"
31 android:textSize="22sp" />
32 </RelativeLayout>
33
34 <RelativeLayout
35 android:layout_width="match_parent"
36 android:layout_height="match_parent"
37 android:layout_below="@id/title"
38 android:background="#ffffffff"
39 android:orientation="vertical"
40 android:paddingLeft="250dp"
41 android:paddingRight="250dp">
42
43 <EditText
44 android:id="@+id/et_phonenumber"
45 style="@style/login_register_edit_style"
46 android:layout_marginTop="150dp"
47 android:hint="手机号"
48 android:inputType="phone" />
49
50 <TextView
51 android:id="@+id/phonenumber_error_hint"
52 style="@style/registererrhint_style"
53 android:layout_below="@id/et_phonenumber" />
54
55 <LinearLayout
56 android:id="@+id/rl_authcode"
57 android:layout_width="match_parent"
58 android:layout_height="wrap_content"
59 android:layout_below="@id/et_phonenumber"
60 android:layout_marginTop="30dp"
61 android:orientation="horizontal">
62
63 <EditText
64 android:id="@+id/et_authcode"
65 style="@style/login_register_edit_rect_style"
66 android:layout_marginRight="-4px"
67 android:layout_weight="1"
68 android:hint="验证码"
69 android:numeric="integer" />
70
71 <Button
72 android:id="@+id/btn_authcode"
73 style="@style/login_register_btn_authcode_rect_style"
74 android:layout_marginLeft="0px"
75 android:layout_marginTop="0px"
76 android:layout_weight="2"
77 android:text="获取验证码"
78 android:textColor="@color/btn_text_color" />
79 </LinearLayout>
80
81 <TextView
82 android:id="@+id/authcode_error_hint"
83 style="@style/registererrhint_style"
84 android:layout_below="@id/rl_authcode" />
85
86 <RelativeLayout
87 android:id="@+id/pwd_rl"
88 android:layout_width="match_parent"
89 android:layout_height="wrap_content"
90 android:layout_below="@id/rl_authcode"
91 android:layout_marginTop="30dp">
92
93 <EditText
94 android:id="@+id/et_newpassword"
95 style="@style/login_register_edit_style"
96 android:hint="请选择地区"
97 android:inputType="textPassword" />
98
99 <ImageView
100 android:id="@+id/iv_pwd_change"
101 style="@style/iv_pwd_change_style" />
102 </RelativeLayout>
103
104 <TextView
105 android:id="@+id/newpassword_error_hint"
106 style="@style/registererrhint_style"
107 android:layout_below="@id/pwd_rl" />
108
109 <EditText
110 android:id="@+id/et_again_newpassword"
111 style="@style/login_register_edit_style"
112 android:layout_below="@id/pwd_rl"
113 android:layout_marginTop="30dp"
114 android:hint="请选择详细地址"
115 android:inputType="textPassword" />
116
117 <TextView
118 android:id="@+id/again_newpassword_error_hint"
119 style="@style/registererrhint_style"
120 android:layout_below="@id/et_again_newpassword" />
121
122 <Button
123 android:id="@+id/btn_ok"
124 style="@style/button_login_register_style"
125 android:layout_below="@id/et_again_newpassword"
126 android:layout_marginTop="30dp"
127 android:text="@string/ok" />
128 </RelativeLayout>
129
130 </RelativeLayout>
PersonalCenter/app/src/main/res/layout/activity_change_preson_info.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools"
4 android:id="@android:id/tabhost"
5 android:layout_width="fill_parent"
6 android:layout_height="fill_parent"
7 android:background="@color/white"
8 tools:context="com.hjx.personalcenter.activity.LoginAndRegisterActivity">
9 <RelativeLayout
10 android:id="@+id/title"
11 android:layout_width="match_parent"
12 android:layout_height="50dp"
13 android:background="@color/login_text_blue">
14
15 <ImageView
16 android:id="@+id/cancel"
17 android:layout_width="wrap_content"
18 android:layout_height="match_parent"
19 android:paddingLeft="20dp"
20 android:paddingRight="20dp"
21 android:src="@mipmap/title_back" />
22
23 <TextView
24 android:id="@+id/menu_title"
25 android:layout_width="wrap_content"
26 android:layout_height="match_parent"
27 android:layout_centerInParent="true"
28 android:gravity="center_vertical"
29 android:text="@string/changge_preson"
30 android:textColor="@android:color/white"
31 android:textSize="22sp" />
32 <TextView
33 android:id="@+id/feedback_sub"
34 android:layout_width="wrap_content"
35 android:layout_height="match_parent"
36 android:paddingLeft="20dp"
37 android:paddingRight="20dp"
38 android:gravity="center_vertical"
39 android:layout_alignParentRight="true"
40 android:text="保存"
41 android:textColor="@android:color/white"
42 android:textSize="22sp" />
43
44
45 </RelativeLayout>
46
47 <LinearLayout
48 android:layout_width="wrap_content"
49 android:layout_height="wrap_content"
50 android:layout_marginTop="20dp"
51 android:layout_below="@+id/title"
52 android:orientation="vertical">
53
54 <com.hjx.personalcenter.thirdparty.SlidingTabLayout
55 android:id="@+id/TabLayout_id"
56 android:layout_gravity="center"
57 android:layout_width="wrap_content"
58 android:layout_height="50dp">
59 </com.hjx.personalcenter.thirdparty.SlidingTabLayout>
60
61 <android.support.v4.view.ViewPager
62 android:id="@+id/viewpager_login"
63 android:layout_width="match_parent"
64 android:layout_height="match_parent"
65 android:background="@color/white" />
66 </LinearLayout>
67
68 </RelativeLayout>
PersonalCenter/app/src/main/res/layout/activity_choisetextbook_items.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical" 3 android:orientation="vertical"
4 android:layout_width="match_parent" 4 android:layout_width="match_parent"
5 android:layout_height="match_parent" 5 android:layout_height="match_parent"
6 android:gravity="center" 6 android:gravity="center">
7 android:padding="20dp"> 7
8
8 <ImageView 9 <ImageView
9 android:src="@mipmap/ic_launcher" 10 android:src="@mipmap/ic_launcher"
10 android:id="@+id/image" 11 android:id="@+id/image"
11 android:layout_width="80dp" 12 android:layout_width="100dp"
12 android:layout_height="120dp" 13 android:background="@drawable/corcle_black_bg"
14 android:layout_height="150dp"
13 15
14 /> 16 />
15 <TextView 17 <TextView
16 android:id="@+id/text" 18 android:id="@+id/text"
17 android:layout_marginTop="5dp" 19 android:layout_marginTop="5dp"
18 android:textSize="17sp" 20 android:textSize="22sp"
19 android:layout_width="wrap_content" 21 android:layout_width="wrap_content"
20 android:layout_height="wrap_content" 22 android:layout_height="wrap_content"
21 android:textColor="@color/login_text_black" 23 android:textColor="@color/login_text_black"
22 android:text="语文" 24 android:text="语文"
23 /> 25 />
24 <TextView 26 <TextView
25 android:id="@+id/tv_publish" 27 android:id="@+id/tv_publish"
26 android:layout_marginTop="5dp" 28 android:layout_marginTop="10dp"
27 android:textSize="14sp" 29 android:textSize="18sp"
28 android:layout_width="wrap_content" 30 android:layout_width="wrap_content"
29 android:layout_height="wrap_content" 31 android:layout_height="wrap_content"
30 android:textColor="@color/login_text_black" 32 android:textColor="@color/login_text_black"
31 android:text="人民教育出版社" 33 android:text="人民教育出版社"
32 /> 34 />
33 35
34 </LinearLayout> 36 </LinearLayout>
PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 android:orientation="vertical"> 5 android:orientation="vertical">
6 6
7 <RelativeLayout 7 <RelativeLayout
8 android:id="@+id/title" 8 android:id="@+id/title"
9 android:layout_width="match_parent" 9 android:layout_width="match_parent"
10 android:layout_height="wrap_content" 10 android:layout_height="wrap_content"
11 android:background="@color/login_text_blue" 11 android:background="@color/login_text_blue"
12 android:minHeight="50dp"> 12 android:minHeight="50dp">
13 13
14 <ImageView 14 <ImageView
15 android:id="@+id/cancel" 15 android:id="@+id/cancel"
16 android:layout_width="wrap_content" 16 android:layout_width="wrap_content"
17 android:layout_height="wrap_content" 17 android:layout_height="wrap_content"
18 android:layout_centerVertical="true" 18 android:layout_centerVertical="true"
19 android:paddingLeft="20dp" 19 android:paddingLeft="20dp"
20 android:paddingRight="20dp" 20 android:paddingRight="20dp"
21 android:src="@mipmap/title_back" /> 21 android:src="@mipmap/title_back" />
22 22
23 <TextView 23 <TextView
24 android:id="@+id/menu_title" 24 android:id="@+id/menu_title"
25 android:layout_width="wrap_content" 25 android:layout_width="wrap_content"
26 android:layout_height="wrap_content" 26 android:layout_height="wrap_content"
27 android:layout_centerInParent="true" 27 android:layout_centerInParent="true"
28 android:text="@string/string_electroniccard_info_look" 28 android:text="@string/string_electroniccard_info_look"
29 android:textColor="@android:color/white" 29 android:textColor="@android:color/white"
30 android:textSize="22sp" /> 30 android:textSize="22sp" />
31 </RelativeLayout> 31 </RelativeLayout>
32 32
33 <LinearLayout 33 <LinearLayout
34 android:layout_width="match_parent" 34 android:layout_width="match_parent"
35 android:layout_height="wrap_content" 35 android:layout_height="wrap_content"
36 android:layout_margin="20dp" 36 android:layout_margin="20dp"
37 android:background="@mipmap/cardbackgrangd" 37 android:background="@mipmap/cardbackgrangd"
38 android:gravity="center" 38 android:gravity="center"
39 android:orientation="vertical"> 39 android:orientation="vertical">
40 40
41 <LinearLayout 41 <LinearLayout
42 android:layout_width="match_parent" 42 android:layout_width="match_parent"
43 android:layout_height="wrap_content" 43 android:layout_height="wrap_content"
44 android:layout_marginTop="70dp" 44 android:layout_marginTop="70dp"
45 android:gravity="center_vertical" 45 android:gravity="center_vertical"
46 android:orientation="horizontal"> 46 android:orientation="horizontal">
47 47
48 <LinearLayout 48 <LinearLayout
49 android:layout_width="wrap_content" 49 android:layout_width="0dp"
50 android:layout_height="wrap_content" 50 android:layout_height="wrap_content"
51 android:layout_marginLeft="200dp" 51 android:layout_marginLeft="200dp"
52 android:layout_weight="1"
52 android:gravity="center_vertical"> 53 android:gravity="center_vertical">
53 54
54 <ImageView 55 <ImageView
55 android:layout_width="wrap_content" 56 android:layout_width="wrap_content"
56 android:layout_height="wrap_content" 57 android:layout_height="wrap_content"
57 android:src="@mipmap/logo_info" /> 58 android:src="@mipmap/logo_info" />
58 59
59 <TextView 60 <TextView
60 android:layout_width="wrap_content" 61 android:layout_width="wrap_content"
61 android:layout_height="wrap_content" 62 android:layout_height="wrap_content"
62 android:layout_marginLeft="50dp" 63 android:layout_marginLeft="50dp"
63 android:background="@null" 64 android:background="@null"
64 android:text="电子保卡" 65 android:text="电子保卡"
65 android:textColor="@color/electronic_card" 66 android:textColor="@color/electronic_card"
66 android:textSize="22sp" /> 67 android:textSize="22sp" />
67 68
68 </LinearLayout> 69 </LinearLayout>
69 70
70 <LinearLayout 71 <LinearLayout
71 android:layout_width="wrap_content" 72 android:layout_width="0dp"
72 android:layout_height="80dp" 73 android:layout_height="80dp"
73 android:layout_marginLeft="200dp" 74 android:layout_weight="1"
75 android:layout_marginLeft="80dp"
74 android:gravity="center_vertical"> 76 android:gravity="center_vertical">
75 77
76 <TextView 78 <TextView
77 android:layout_width="wrap_content" 79 android:layout_width="wrap_content"
78 android:layout_height="wrap_content" 80 android:layout_height="wrap_content"
79 android:text="客户姓名" 81 android:text="客户姓名"
80 android:textColor="@color/btn_text_color" 82 android:textColor="@color/btn_text_color"
81 android:textSize="22sp" /> 83 android:textSize="22sp" />
82 84
83 <TextView 85 <TextView
84 android:layout_width="wrap_content" 86 android:layout_width="wrap_content"
85 android:layout_height="wrap_content" 87 android:layout_height="wrap_content"
86 android:layout_marginLeft="60dp" 88 android:layout_marginLeft="60dp"
87 android:text="王小明" 89 android:text="王小明"
88 android:textColor="@color/btn_text_color" 90 android:textColor="@color/btn_text_color"
89 android:textSize="22sp" /> 91 android:textSize="22sp" />
90 92
91 </LinearLayout> 93 </LinearLayout>
92 94
93 </LinearLayout> 95 </LinearLayout>
94 96
95 <LinearLayout 97 <LinearLayout
96 android:layout_width="match_parent" 98 android:layout_width="match_parent"
97 android:layout_height="wrap_content" 99 android:layout_height="wrap_content"
98 android:gravity="center_vertical" 100 android:gravity="center_vertical"
99 android:orientation="horizontal"> 101 android:orientation="horizontal">
100 102
101 <LinearLayout 103 <LinearLayout
102 android:layout_width="wrap_content" 104 android:layout_width="0dp"
103 android:layout_height="60dp" 105 android:layout_height="60dp"
106 android:layout_weight="1"
104 android:layout_marginLeft="200dp" 107 android:layout_marginLeft="200dp"
105 android:gravity="center_vertical"> 108 android:gravity="center_vertical">
106 109
107 <TextView 110 <TextView
108 android:layout_width="wrap_content" 111 android:layout_width="wrap_content"
109 android:layout_height="wrap_content" 112 android:layout_height="wrap_content"
110 android:text="产品型号" 113 android:text="产品型号"
111 android:textColor="@color/btn_text_color" 114 android:textColor="@color/btn_text_color"
112 android:textSize="22sp" /> 115 android:textSize="22sp" />
113 116
114 <TextView 117 <TextView
115 android:layout_width="wrap_content" 118 android:layout_width="wrap_content"
116 android:layout_height="wrap_content" 119 android:layout_height="wrap_content"
117 android:layout_marginLeft="50dp" 120 android:layout_marginLeft="50dp"
118 android:text="IPone888" 121 android:text="IPone888"
119 android:textSize="22sp" /> 122 android:textSize="22sp" />
120 123
121 124
122 </LinearLayout> 125 </LinearLayout>
123 126
124 <LinearLayout 127 <LinearLayout
125 android:layout_width="wrap_content" 128 android:layout_width="0dp"
126 android:layout_height="60dp" 129 android:layout_height="60dp"
127 android:layout_marginLeft="250dp" 130 android:layout_weight="1"
131 android:layout_marginLeft="80dp"
128 android:gravity="center_vertical"> 132 android:gravity="center_vertical">
129 133
130 <TextView 134 <TextView
131 android:layout_width="wrap_content" 135 android:layout_width="wrap_content"
132 android:layout_height="wrap_content" 136 android:layout_height="wrap_content"
133 android:text="客户地址" 137 android:text="客户地址"
134 android:textSize="22sp" /> 138 android:textSize="22sp" />
135 139
136 <TextView 140 <TextView
137 android:layout_width="wrap_content" 141 android:layout_width="wrap_content"
138 android:layout_height="wrap_content" 142 android:layout_height="wrap_content"
139 android:layout_marginLeft="98dp" 143 android:layout_marginLeft="60dp"
140 android:background="@null" 144 android:background="@null"
141 android:text="北京市昭阳区三里屯" 145 android:text="北京市昭阳区三里屯"
142 android:textSize="22sp" /> 146 android:textSize="22sp" />
143 <TextView 147 <TextView
144 android:layout_width="wrap_content" 148 android:layout_width="wrap_content"
145 android:layout_height="wrap_content" 149 android:layout_height="wrap_content"
146 android:layout_marginLeft="18dp" 150 android:layout_marginLeft="18dp"
147 android:background="@drawable/corcle_black_bg" 151 android:background="@drawable/corcle_black_bg"
148 android:text="修改" 152 android:text="修改"
149 android:paddingLeft="5dp" 153 android:paddingLeft="5dp"
150 android:paddingRight="5dp" 154 android:paddingRight="5dp"
151 android:textColor="@color/login_text_blue" 155 android:textColor="@color/login_text_blue"
152 android:textSize="18sp" /> 156 android:textSize="18sp" />
153 157
154 158
155 </LinearLayout> 159 </LinearLayout>
156 160
157 </LinearLayout> 161 </LinearLayout>
158 162
159 <LinearLayout 163 <LinearLayout
160 android:layout_width="match_parent" 164 android:layout_width="match_parent"
161 android:layout_height="wrap_content" 165 android:layout_height="wrap_content"
162 android:gravity="center_vertical" 166 android:gravity="center_vertical"
163 android:orientation="horizontal"> 167 android:orientation="horizontal">
164 168
165 <LinearLayout 169 <LinearLayout
166 android:layout_width="wrap_content" 170 android:layout_width="0dp"
167 android:layout_height="60dp" 171 android:layout_height="60dp"
172 android:layout_weight="1"
168 android:layout_marginLeft="200dp" 173 android:layout_marginLeft="200dp"
169 android:gravity="center_vertical"> 174 android:gravity="center_vertical">
170 175
171 <TextView 176 <TextView
172 android:layout_width="wrap_content" 177 android:layout_width="wrap_content"
173 android:layout_height="wrap_content" 178 android:layout_height="wrap_content"
174 android:text="MAC地址" 179 android:text="MAC地址"
175 android:textSize="22sp" /> 180 android:textSize="22sp" />
176 181
177 <TextView 182 <TextView
178 android:layout_width="wrap_content" 183 android:layout_width="wrap_content"
179 android:layout_height="wrap_content" 184 android:layout_height="wrap_content"
180 android:layout_marginLeft="50dp" 185 android:layout_marginLeft="50dp"
181 android:background="@null" 186 android:background="@null"
182 android:text="237462873463278" 187 android:text="237462873463278"
183 android:textSize="22sp" /> 188 android:textSize="22sp" />
184 189
185 </LinearLayout> 190 </LinearLayout>
186 191
187 <LinearLayout 192 <LinearLayout
188 android:layout_width="wrap_content" 193 android:layout_width="0dp"
189 android:layout_height="60dp" 194 android:layout_height="60dp"
190 android:layout_marginLeft="210dp" 195 android:layout_weight="1"
196 android:layout_marginLeft="80dp"
191 android:gravity="center_vertical"> 197 android:gravity="center_vertical">
192 198
193 <TextView 199 <TextView
194 android:layout_width="wrap_content" 200 android:layout_width="wrap_content"
195 android:layout_height="wrap_content" 201 android:layout_height="wrap_content"
196 android:text="购买时间" 202 android:text="购买时间"
197 android:textColor="@color/btn_text_color" 203 android:textColor="@color/btn_text_color"
198 android:textSize="22sp" /> 204 android:textSize="22sp" />
199 205
200 <TextView 206 <TextView
201 android:layout_width="wrap_content" 207 android:layout_width="wrap_content"
202 android:layout_height="wrap_content" 208 android:layout_height="wrap_content"
203 android:layout_marginLeft="25dp" 209 android:layout_marginLeft="60dp"
204 android:background="@null" 210 android:background="@null"
205 android:text="4433322-334--34" 211 android:text="4433322-334--34"
206 android:textColor="@color/btn_text_color" 212 android:textColor="@color/btn_text_color"
207 android:textSize="22sp" /> 213 android:textSize="22sp" />
208 </LinearLayout> 214 </LinearLayout>
209 215
210 </LinearLayout> 216 </LinearLayout>
211 217
212 <LinearLayout 218 <LinearLayout
213 android:layout_width="match_parent" 219 android:layout_width="match_parent"
214 android:layout_height="wrap_content" 220 android:layout_height="wrap_content"
215 android:gravity="center_vertical" 221 android:gravity="center_vertical"
216 android:orientation="horizontal"> 222 android:orientation="horizontal">
217 223
218 <LinearLayout 224 <LinearLayout
219 android:layout_width="wrap_content" 225 android:layout_width="0dp"
220 android:layout_height="60dp" 226 android:layout_height="60dp"
227 android:layout_weight="1"
221 android:layout_marginLeft="200dp" 228 android:layout_marginLeft="200dp"
222 android:gravity="center_vertical"> 229 android:gravity="center_vertical">
223 230
224 <TextView 231 <TextView
225 android:layout_width="wrap_content" 232 android:layout_width="wrap_content"
226 android:layout_height="wrap_content" 233 android:layout_height="wrap_content"
227 android:text="机身编码" 234 android:text="机身编码"
228 android:textColor="@color/btn_text_color" 235 android:textColor="@color/btn_text_color"
229 android:textSize="22sp" /> 236 android:textSize="22sp" />
230 237
231 <TextView 238 <TextView
232 android:layout_width="wrap_content" 239 android:layout_width="wrap_content"
233 android:layout_height="wrap_content" 240 android:layout_height="wrap_content"
234 android:layout_marginLeft="50dp" 241 android:layout_marginLeft="50dp"
235 android:hint="473463746343" 242 android:hint="473463746343"
236 android:textSize="22sp" /> 243 android:textSize="22sp" />
237 244
238 </LinearLayout> 245 </LinearLayout>
239 246
240 <LinearLayout 247 <LinearLayout
241 android:layout_width="wrap_content" 248 android:layout_width="0dp"
242 android:layout_height="60dp" 249 android:layout_height="60dp"
243 android:layout_marginLeft="210dp" 250 android:layout_weight="1"
251 android:layout_marginLeft="80dp"
244 android:gravity="center_vertical"> 252 android:gravity="center_vertical">
245 253
246 <TextView 254 <TextView
247 android:layout_width="wrap_content" 255 android:layout_width="wrap_content"
248 android:layout_height="wrap_content" 256 android:layout_height="wrap_content"
249 android:text="购买地址" 257 android:text="购买地址"
250 android:textColor="@color/btn_text_color" 258 android:textColor="@color/btn_text_color"
251 android:textSize="22sp" /> 259 android:textSize="22sp" />
252 260
253 <TextView 261 <TextView
254 android:layout_width="wrap_content" 262 android:layout_width="wrap_content"
255 android:layout_height="wrap_content" 263 android:layout_height="wrap_content"
256 android:layout_marginLeft="25dp" 264 android:layout_marginLeft="60dp"
257 android:text="啥啥啥 专卖店" 265 android:text="啥啥啥 专卖店"
258 android:textColor="@color/btn_text_color" 266 android:textColor="@color/btn_text_color"
259 android:textSize="22sp" /> 267 android:textSize="22sp" />
260 </LinearLayout> 268 </LinearLayout>
261 269
262 </LinearLayout> 270 </LinearLayout>
263 271
264 <LinearLayout 272 <LinearLayout
265 android:layout_width="match_parent" 273 android:layout_width="match_parent"
266 android:layout_height="wrap_content" 274 android:layout_height="wrap_content"
267 android:gravity="center_vertical" 275 android:gravity="center_vertical"
268 android:orientation="horizontal"> 276 android:orientation="horizontal">
269 277
270 <LinearLayout 278 <LinearLayout
271 android:layout_width="wrap_content" 279 android:layout_width="0dp"
272 android:layout_height="60dp" 280 android:layout_height="60dp"
281 android:layout_weight="1"
273 android:layout_marginLeft="200dp" 282 android:layout_marginLeft="200dp"
274 android:gravity="center_vertical"> 283 android:gravity="center_vertical">
275 284
276 <TextView 285 <TextView
277 android:layout_width="wrap_content" 286 android:layout_width="wrap_content"
278 android:layout_height="wrap_content" 287 android:layout_height="wrap_content"
279 android:text="手机号码" 288 android:text="手机号码"
280 android:textColor="@color/btn_text_color" 289 android:textColor="@color/btn_text_color"
281 android:textSize="22sp" /> 290 android:textSize="22sp" />
282 291
283 <TextView 292 <TextView
284 android:layout_width="wrap_content" 293 android:layout_width="wrap_content"
285 android:layout_height="wrap_content" 294 android:layout_height="wrap_content"
286 android:layout_marginLeft="50dp" 295 android:layout_marginLeft="50dp"
287 android:text="IPone888" 296 android:text="IPone888"
288 android:textSize="22sp" /> 297 android:textSize="22sp" />
289 <TextView 298 <TextView
290 android:layout_width="wrap_content" 299 android:layout_width="wrap_content"
291 android:layout_height="wrap_content" 300 android:layout_height="wrap_content"
292 android:layout_marginLeft="18dp" 301 android:layout_marginLeft="18dp"
293 android:background="@drawable/corcle_black_bg" 302 android:background="@drawable/corcle_black_bg"
294 android:text="修改" 303 android:text="修改"
295 android:paddingLeft="5dp" 304 android:paddingLeft="5dp"
296 android:paddingRight="5dp" 305 android:paddingRight="5dp"
297 android:textColor="@color/login_text_blue" 306 android:textColor="@color/login_text_blue"
298 android:textSize="18sp" /> 307 android:textSize="18sp" />
299 308
300 309
301 </LinearLayout> 310 </LinearLayout>
302 311
303 <LinearLayout 312 <LinearLayout
304 android:layout_width="wrap_content" 313 android:layout_width="0dp"
305 android:layout_height="60dp" 314 android:layout_height="60dp"
306 android:layout_marginLeft="250dp" 315 android:layout_weight="1"
316 android:layout_marginLeft="80dp"
307 android:gravity="center_vertical"> 317 android:gravity="center_vertical">
308 318
309 <TextView 319 <TextView
310 android:layout_width="wrap_content" 320 android:layout_width="wrap_content"
311 android:layout_height="wrap_content" 321 android:layout_height="wrap_content"
312 android:text="本地售后电话" 322 android:text="本地售后电话"
313 android:textSize="22sp" /> 323 android:textSize="22sp" />
314 324
315 <TextView 325 <TextView
316 android:layout_width="wrap_content" 326 android:layout_width="wrap_content"
317 android:layout_height="wrap_content" 327 android:layout_height="wrap_content"
318 android:layout_marginLeft="98dp" 328 android:layout_marginLeft="60dp"
319 android:background="@null" 329 android:background="@null"
320 android:text="1111111" 330 android:text="1111111"
321 android:textSize="22sp" /> 331 android:textSize="22sp" />
322 332
323 </LinearLayout> 333 </LinearLayout>
324 334
325 </LinearLayout> 335 </LinearLayout>
326 </LinearLayout> 336 </LinearLayout>
327 337
328 <LinearLayout 338 <LinearLayout
329 android:layout_width="match_parent" 339 android:layout_width="match_parent"
330 android:layout_height="wrap_content" 340 android:layout_height="wrap_content"
331 android:layout_marginTop="5dp" 341 android:layout_marginTop="5dp"
332 android:gravity="center" 342 android:gravity="center"
333 android:orientation="vertical"> 343 android:orientation="vertical">
334 344
335 <TextView 345 <TextView
336 android:layout_width="wrap_content" 346 android:layout_width="wrap_content"
337 android:layout_height="wrap_content" 347 android:layout_height="wrap_content"
338 android:layout_marginTop="5dp" 348 android:layout_marginTop="5dp"
339 android:text="@string/electronic_card" 349 android:text="@string/electronic_card"
340 android:textColor="@color/electronic_text" 350 android:textColor="@color/electronic_text"
341 android:textSize="18sp" /> 351 android:textSize="18sp" />
342 352
343 353
344 354
345 </LinearLayout> 355 </LinearLayout>
346 <LinearLayout 356 <LinearLayout
347 android:layout_width="match_parent" 357 android:layout_width="match_parent"
348 android:layout_height="wrap_content" 358 android:layout_height="wrap_content"
349 android:layout_marginTop="30dp" 359 android:layout_marginTop="30dp"
350 android:gravity="center" 360 android:gravity="center"
351 android:orientation="horizontal"> 361 android:orientation="horizontal">
352 362
353 <ImageView 363 <ImageView
354 android:layout_width="wrap_content" 364 android:layout_width="wrap_content"
355 android:layout_height="wrap_content" 365 android:layout_height="wrap_content"
356 android:src="@mipmap/phone"/> 366 android:src="@mipmap/phone"/>
357 <TextView 367 <TextView
358 android:layout_width="wrap_content" 368 android:layout_width="wrap_content"
359 android:layout_height="wrap_content" 369 android:layout_height="wrap_content"
360 android:textSize="30sp" 370 android:textSize="30sp"
361 android:layout_marginLeft="5dp" 371 android:layout_marginLeft="5dp"
362 android:textColor="@color/login_text_blue" 372 android:textColor="@color/login_text_blue"
363 android:text="400-400-000"/> 373 android:text="400-400-000"/>
364 374
365 375
366 </LinearLayout> 376 </LinearLayout>
367 377
368 378
369 379
370 </LinearLayout> 380 </LinearLayout>
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:id="@+id/card_view" 3 android:id="@+id/card_view"
4 android:layout_width="match_parent" 4 android:layout_width="match_parent"
5 android:layout_height="match_parent" 5 android:layout_height="match_parent"
6 android:orientation="vertical"> 6 android:orientation="vertical">
7 7
8 <RelativeLayout 8 <RelativeLayout
9 android:id="@+id/title" 9 android:id="@+id/title"
10 android:layout_width="match_parent" 10 android:layout_width="match_parent"
11 android:layout_height="wrap_content" 11 android:layout_height="wrap_content"
12 android:background="@color/login_text_blue" 12 android:background="@color/login_text_blue"
13 android:minHeight="50dp"> 13 android:minHeight="50dp">
14 14
15 <ImageView 15 <ImageView
16 android:id="@+id/cancel" 16 android:id="@+id/cancel"
17 android:layout_width="wrap_content" 17 android:layout_width="wrap_content"
18 android:layout_height="wrap_content" 18 android:layout_height="wrap_content"
19 android:layout_centerVertical="true" 19 android:layout_centerVertical="true"
20 android:paddingLeft="20dp" 20 android:paddingLeft="20dp"
21 android:paddingRight="20dp" 21 android:paddingRight="20dp"
22 android:src="@mipmap/title_back" /> 22 android:src="@mipmap/title_back" />
23 23
24 <TextView 24 <TextView
25 android:id="@+id/menu_title" 25 android:id="@+id/menu_title"
26 android:layout_width="wrap_content" 26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content" 27 android:layout_height="wrap_content"
28 android:layout_centerInParent="true" 28 android:layout_centerInParent="true"
29 android:text="@string/change_electroniccard_info_fill" 29 android:text="@string/change_electroniccard_info_fill"
30 android:textColor="@android:color/white" 30 android:textColor="@android:color/white"
31 android:textSize="22sp" /> 31 android:textSize="22sp" />
32 </RelativeLayout> 32 </RelativeLayout>
33 33
34 <ImageView 34 <ImageView
35 android:layout_width="wrap_content" 35 android:layout_width="wrap_content"
36 android:layout_height="wrap_content" 36 android:layout_height="wrap_content"
37 android:layout_gravity="center" 37 android:layout_gravity="center"
38 android:layout_marginTop="20dp" 38 android:layout_marginTop="20dp"
39 android:src="@mipmap/change_info_icon" /> 39 android:src="@mipmap/change_info_icon" />
40 40
41 <LinearLayout 41 <LinearLayout
42 android:layout_width="wrap_content" 42 android:layout_width="wrap_content"
43 android:layout_height="wrap_content" 43 android:layout_height="wrap_content"
44 android:layout_marginTop="20dp" 44 android:layout_marginTop="60dp"
45 android:orientation="horizontal"> 45 android:orientation="horizontal">
46 46
47 <View 47 <View
48 android:layout_width="450dp" 48 android:layout_width="450dp"
49 android:layout_height="0.7dp" 49 android:layout_height="0.7dp"
50 android:layout_marginLeft="150dp" 50 android:layout_marginLeft="150dp"
51 android:background="@color/electronic_text"> 51 android:background="@color/electronic_text">
52 52
53 </View> 53 </View>
54 54
55 <View 55 <View
56 android:layout_width="400dp" 56 android:layout_width="450dp"
57 android:layout_height="0.7dp" 57 android:layout_height="0.7dp"
58 android:layout_marginLeft="80dp" 58 android:layout_marginLeft="80dp"
59 android:background="@color/electronic_text"> 59 android:background="@color/electronic_text">
60 60
61 </View> 61 </View>
62 62
63 63
64 </LinearLayout> 64 </LinearLayout>
65 65
66 <LinearLayout 66 <LinearLayout
67 android:layout_width="match_parent" 67 android:layout_width="match_parent"
68 android:layout_height="wrap_content" 68 android:layout_height="wrap_content"
69 android:layout_marginLeft="200dp"
69 android:gravity="center_vertical" 70 android:gravity="center_vertical"
70 android:orientation="horizontal"> 71 android:orientation="horizontal">
71 72
72 <LinearLayout 73 <LinearLayout
73 android:layout_width="wrap_content" 74 android:layout_width="0dp"
74 android:layout_height="80dp" 75 android:layout_height="80dp"
75 android:layout_marginLeft="200dp" 76 android:layout_weight="1"
76 android:gravity="center_vertical"> 77 android:gravity="center_vertical">
77 78
78 <TextView 79 <TextView
79 android:layout_width="wrap_content" 80 android:layout_width="wrap_content"
80 android:layout_height="wrap_content" 81 android:layout_height="wrap_content"
81 android:text="客户姓名" 82 android:text="客户姓名"
82 android:textColor="@color/pickerview_wheelview_textcolor_center" 83 android:textColor="@color/pickerview_wheelview_textcolor_center"
83 android:textSize="22sp" /> 84 android:textSize="22sp" />
84 85
85 <EditText 86 <EditText
86 android:layout_width="wrap_content" 87 android:layout_width="wrap_content"
87 android:layout_height="wrap_content" 88 android:layout_height="wrap_content"
88 android:layout_marginLeft="50dp" 89 android:layout_marginLeft="50dp"
89 android:background="@null" 90 android:background="@null"
90 android:hint="请输入" 91 android:hint="请输入"
91 android:textColor="@color/electronic_text" 92 android:textColor="@color/electronic_text"
92 android:textSize="22sp" /> 93 android:textSize="22sp" />
93 94
94 </LinearLayout> 95 </LinearLayout>
95 96
96 <LinearLayout 97 <LinearLayout
97 android:layout_width="wrap_content" 98 android:layout_width="0dp"
98 android:layout_height="80dp" 99 android:layout_height="80dp"
99 android:layout_marginLeft="300dp" 100 android:layout_weight="1"
100 android:gravity="center_vertical"> 101 android:gravity="center_vertical">
101 102
102 <TextView 103 <TextView
103 android:layout_width="wrap_content" 104 android:layout_width="150dp"
104 android:layout_height="wrap_content" 105 android:layout_height="wrap_content"
105 android:text="购买地址" 106 android:text="购买地址"
106 android:textColor="@color/pickerview_wheelview_textcolor_center" 107 android:textColor="@color/pickerview_wheelview_textcolor_center"
107 android:textSize="22sp" /> 108 android:textSize="22sp" />
108 109
109 <TextView 110 <TextView
110 android:layout_width="wrap_content" 111 android:layout_width="wrap_content"
111 android:layout_height="wrap_content" 112 android:layout_height="wrap_content"
112 android:layout_marginLeft="60dp" 113 android:layout_marginLeft="20dp"
113 android:text="请选择地区" 114 android:text="请选择地区"
114 android:textColor="@color/btn_text_color" 115 android:textColor="@color/btn_text_color"
115 android:textSize="22sp" /> 116 android:textSize="22sp" />
116 117
117 <ImageView 118 <ImageView
118 android:layout_width="wrap_content" 119 android:layout_width="wrap_content"
119 android:layout_height="wrap_content" 120 android:layout_height="wrap_content"
120 android:layout_marginLeft="50dp" 121 android:layout_marginLeft="60dp"
121 android:src="@mipmap/xiajiantou"> 122 android:src="@mipmap/xiajiantou">
122 123
123 </ImageView> 124 </ImageView>
124 </LinearLayout> 125 </LinearLayout>
125 126
126 </LinearLayout> 127 </LinearLayout>
127 128
128 <LinearLayout 129 <LinearLayout
129 android:layout_width="wrap_content" 130 android:layout_width="wrap_content"
130 android:layout_height="wrap_content" 131 android:layout_height="wrap_content"
131 android:orientation="horizontal"> 132 android:orientation="horizontal">
132 133
133 <View 134 <View
134 android:layout_width="450dp" 135 android:layout_width="450dp"
135 android:layout_height="0.7dp" 136 android:layout_height="0.7dp"
136 android:layout_marginLeft="150dp" 137 android:layout_marginLeft="150dp"
137 android:background="@color/electronic_text"> 138 android:background="@color/electronic_text">
138 139
139 </View> 140 </View>
140 141
141 <View 142 <View
142 android:layout_width="400dp" 143 android:layout_width="450dp"
143 android:layout_height="0.7dp" 144 android:layout_height="0.7dp"
144 android:layout_marginLeft="80dp" 145 android:layout_marginLeft="80dp"
145 android:background="@color/electronic_text"> 146 android:background="@color/electronic_text">
146 147
147 </View> 148 </View>
148 149
149 150
150 </LinearLayout> 151 </LinearLayout>
151 152
152 <LinearLayout 153 <LinearLayout
153 android:layout_width="match_parent" 154 android:layout_width="match_parent"
154 android:layout_height="wrap_content" 155 android:layout_height="wrap_content"
156 android:layout_marginLeft="200dp"
155 android:gravity="center_vertical" 157 android:gravity="center_vertical"
156 android:orientation="horizontal"> 158 android:orientation="horizontal">
157 159
158 <LinearLayout 160 <LinearLayout
159 android:layout_width="wrap_content" 161 android:layout_width="0dp"
160 android:layout_height="80dp" 162 android:layout_height="80dp"
161 android:layout_marginLeft="200dp" 163 android:layout_weight="1"
162 android:gravity="center_vertical"> 164 android:gravity="center_vertical">
163 165
164 <TextView 166 <TextView
165 android:layout_width="wrap_content" 167 android:layout_width="wrap_content"
166 android:layout_height="wrap_content" 168 android:layout_height="wrap_content"
167 android:text="客户地址" 169 android:text="客户地址"
168 android:textColor="@color/pickerview_wheelview_textcolor_center" 170 android:textColor="@color/pickerview_wheelview_textcolor_center"
169 android:textSize="22sp" /> 171 android:textSize="22sp" />
170 172
171 <TextView 173 <TextView
172 android:layout_width="wrap_content" 174 android:layout_width="wrap_content"
173 android:layout_height="wrap_content" 175 android:layout_height="wrap_content"
174 android:layout_marginLeft="50dp" 176 android:layout_marginLeft="50dp"
175 android:text="请选择地区" 177 android:text="请选择地区"
176 android:textSize="22sp" /> 178 android:textSize="22sp" />
177 179
178 <ImageView 180 <ImageView
179 android:layout_width="wrap_content" 181 android:layout_width="wrap_content"
180 android:layout_height="wrap_content" 182 android:layout_height="wrap_content"
181 android:layout_marginLeft="50dp" 183 android:layout_marginLeft="60dp"
182 android:src="@mipmap/xiajiantou"> 184 android:src="@mipmap/xiajiantou">
183 185
184 </ImageView> 186 </ImageView>
185 187
186 188
187 </LinearLayout> 189 </LinearLayout>
188 190
189 <LinearLayout 191 <LinearLayout
190 android:layout_width="wrap_content" 192 android:layout_width="0dp"
191 android:layout_height="80dp" 193 android:layout_height="80dp"
192 android:layout_marginLeft="200dp" 194 android:layout_weight="1"
193 android:gravity="center_vertical"> 195 android:gravity="center_vertical">
194 196
195 <TextView 197 <TextView
196 android:layout_width="wrap_content" 198 android:layout_width="150dp"
197 android:layout_height="wrap_content" 199 android:layout_height="wrap_content"
198 android:text=" " 200 android:text=" "
199 android:textColor="@color/white" 201 android:textColor="@color/white"
200 android:textSize="22sp" /> 202 android:textSize="22sp" />
201 203
202 <EditText 204 <EditText
203 android:layout_width="wrap_content" 205 android:layout_width="wrap_content"
204 android:layout_height="wrap_content" 206 android:layout_height="wrap_content"
205 android:layout_marginLeft="98dp" 207 android:layout_marginLeft="20dp"
206 android:background="@null" 208 android:background="@null"
207 android:hint="请输入商店名称" 209 android:hint="请输入商店名称"
208 android:textSize="22sp" /> 210 android:textSize="22sp" />
209 211
210 </LinearLayout> 212 </LinearLayout>
211 213
212 </LinearLayout> 214 </LinearLayout>
213 215
214 <LinearLayout 216 <LinearLayout
215 android:layout_width="wrap_content" 217 android:layout_width="wrap_content"
216 android:layout_height="wrap_content" 218 android:layout_height="wrap_content"
217 219
218 android:orientation="horizontal"> 220 android:orientation="horizontal">
219 221
220 <View 222 <View
221 android:layout_width="450dp" 223 android:layout_width="450dp"
222 android:layout_height="0.7dp" 224 android:layout_height="0.7dp"
223 android:layout_marginLeft="150dp" 225 android:layout_marginLeft="150dp"
224 android:background="@color/electronic_text"> 226 android:background="@color/electronic_text">
225 227
226 </View> 228 </View>
227 229
228 <View 230 <View
229 android:layout_width="400dp" 231 android:layout_width="450dp"
230 android:layout_height="0.7dp" 232 android:layout_height="0.7dp"
231 android:layout_marginLeft="80dp" 233 android:layout_marginLeft="80dp"
232 android:background="@color/electronic_text"> 234 android:background="@color/electronic_text">
233 235
234 </View> 236 </View>
235 237
236 238
237 </LinearLayout> 239 </LinearLayout>
238 240
239 <LinearLayout 241 <LinearLayout
240 android:layout_width="match_parent" 242 android:layout_width="match_parent"
241 android:layout_height="wrap_content" 243 android:layout_height="wrap_content"
244 android:layout_marginLeft="200dp"
242 android:gravity="center_vertical" 245 android:gravity="center_vertical"
243 android:orientation="horizontal"> 246 android:orientation="horizontal">
244 247
245 <LinearLayout 248 <LinearLayout
246 android:layout_width="wrap_content" 249 android:layout_width="0dp"
247 android:layout_height="80dp" 250 android:layout_height="80dp"
248 android:layout_marginLeft="200dp" 251 android:layout_weight="1"
249 android:gravity="center_vertical"> 252 android:gravity="center_vertical">
250 253
251 <TextView 254 <TextView
252 android:layout_width="wrap_content" 255 android:layout_width="wrap_content"
253 android:layout_height="wrap_content" 256 android:layout_height="wrap_content"
254 android:text=" " 257 android:text=" "
255 android:textColor="@color/white" 258 android:textColor="@color/white"
256 android:textSize="22sp" /> 259 android:textSize="22sp" />
257 260
258 <EditText 261 <EditText
259 android:layout_width="wrap_content" 262 android:layout_width="wrap_content"
260 android:layout_height="wrap_content" 263 android:layout_height="wrap_content"
261 android:layout_marginLeft="100dp" 264 android:layout_marginLeft="100dp"
262 android:background="@null" 265 android:background="@null"
263 android:hint="请输入详细地址" 266 android:hint="请输入详细地址"
264 android:textSize="22sp" /> 267 android:textSize="22sp" />
265 268
266 </LinearLayout> 269 </LinearLayout>
267 270
268 <LinearLayout 271 <LinearLayout
269 android:layout_width="wrap_content" 272 android:layout_width="0dp"
270 android:layout_height="80dp" 273 android:layout_height="80dp"
271 android:layout_marginLeft="210dp" 274 android:layout_weight="1"
272 android:gravity="center_vertical"> 275 android:gravity="center_vertical">
273 276
274 <TextView 277 <TextView
275 android:layout_width="wrap_content" 278 android:layout_width="150dp"
276 android:layout_height="wrap_content" 279 android:layout_height="wrap_content"
277 android:text="本地售后电话" 280 android:text="本地售后电话"
278 android:textColor="@color/pickerview_wheelview_textcolor_center" 281 android:textColor="@color/pickerview_wheelview_textcolor_center"
279 android:textSize="22sp" /> 282 android:textSize="22sp" />
280 283
281 <EditText 284 <EditText
282 android:layout_width="wrap_content" 285 android:layout_width="wrap_content"
283 android:layout_height="wrap_content" 286 android:layout_height="wrap_content"
284 android:layout_marginLeft="25dp" 287 android:layout_marginLeft="20dp"
285 android:background="@null" 288 android:background="@null"
286 android:hint="请输入" 289 android:hint="请输入"
287 android:textColor="@color/btn_text_color" 290 android:textColor="@color/pickerview_wheelview_textcolor_center"
288 android:textSize="22sp" /> 291 android:textSize="22sp" />
289 </LinearLayout> 292 </LinearLayout>
290 293
291 </LinearLayout> 294 </LinearLayout>
292 295
293 <LinearLayout 296 <LinearLayout
294 android:layout_width="wrap_content" 297 android:layout_width="wrap_content"
295 android:layout_height="wrap_content" 298 android:layout_height="wrap_content"
296 299
297 android:orientation="horizontal"> 300 android:orientation="horizontal">
298 301
299 <View 302 <View
300 android:layout_width="450dp" 303 android:layout_width="450dp"
301 android:layout_height="0.7dp" 304 android:layout_height="0.7dp"
302 android:layout_marginLeft="150dp" 305 android:layout_marginLeft="150dp"
303 android:background="@color/electronic_text"> 306 android:background="@color/electronic_text">
304 307
305 </View> 308 </View>
306 309
307 <View 310 <View
308 android:layout_width="400dp" 311 android:layout_width="450dp"
309 android:layout_height="0.7dp" 312 android:layout_height="0.7dp"
310 android:layout_marginLeft="80dp" 313 android:layout_marginLeft="80dp"
311 android:background="@color/electronic_text"> 314 android:background="@color/electronic_text">
312 315
313 </View> 316 </View>
314 317
315 318
316 </LinearLayout> 319 </LinearLayout>
317 320
318 <LinearLayout 321 <LinearLayout
319 android:layout_width="match_parent" 322 android:layout_width="match_parent"
320 android:layout_height="wrap_content" 323 android:layout_height="wrap_content"
324 android:layout_marginLeft="200dp"
321 android:gravity="center_vertical" 325 android:gravity="center_vertical"
322 android:orientation="horizontal"> 326 android:orientation="horizontal">
323 327
324 <LinearLayout 328 <LinearLayout
325 android:id="@+id/lineL_buy_time" 329 android:id="@+id/lineL_buy_time"
326 android:layout_width="wrap_content" 330 android:layout_width="0dp"
327 android:layout_height="80dp" 331 android:layout_height="80dp"
328 android:layout_marginLeft="200dp" 332 android:layout_weight="1"
329 android:gravity="center_vertical"> 333 android:gravity="center_vertical">
330 334
331 <TextView 335 <TextView
332 android:layout_width="wrap_content" 336 android:layout_width="wrap_content"
333 android:layout_height="wrap_content" 337 android:layout_height="wrap_content"
334 android:text="购买时间" 338 android:text="购买时间"
335 android:textColor="@color/pickerview_wheelview_textcolor_center" 339 android:textColor="@color/pickerview_wheelview_textcolor_center"
336 android:textSize="22sp" /> 340 android:textSize="22sp" />
337 341
338 <TextView 342 <TextView
339 android:id="@+id/tv_buy_time" 343 android:id="@+id/tv_buy_time"
340 android:layout_width="wrap_content" 344 android:layout_width="wrap_content"
341 android:layout_height="wrap_content" 345 android:layout_height="wrap_content"
342 android:layout_marginLeft="50dp" 346 android:layout_marginLeft="50dp"
343 android:hint="请选择时间" 347 android:hint="请选择时间"
344 android:textSize="22sp" /> 348 android:textSize="22sp" />
345 349
346 <ImageView 350 <ImageView
347 android:layout_width="wrap_content" 351 android:layout_width="wrap_content"
348 android:layout_height="wrap_content" 352 android:layout_height="wrap_content"
349 android:layout_marginLeft="50dp" 353 android:layout_marginLeft="60dp"
350 android:src="@mipmap/xiajiantou"> 354 android:src="@mipmap/xiajiantou">
351 355
352 </ImageView> 356 </ImageView>
353 357
354 </LinearLayout> 358 </LinearLayout>
355 359
356 </LinearLayout> 360 </LinearLayout>
357 361
358 <LinearLayout 362 <LinearLayout
359 android:layout_width="wrap_content" 363 android:layout_width="wrap_content"
360 android:layout_height="wrap_content" 364 android:layout_height="wrap_content"
361
362 android:orientation="horizontal"> 365 android:orientation="horizontal">
363 366
364 <View 367 <View
365 android:layout_width="450dp" 368 android:layout_width="450dp"
366 android:layout_height="0.7dp" 369 android:layout_height="0.7dp"
367 android:layout_marginLeft="150dp" 370 android:layout_marginLeft="150dp"
368 android:background="@color/electronic_text"> 371 android:background="@color/electronic_text">
369 372
370 </View> 373 </View>
371 374
372 375
376
373 </LinearLayout> 377 </LinearLayout>
374 378
375 <Button 379 <Button
376 android:id="@+id/btn_ok" 380 android:id="@+id/btn_change_info"
377 style="@style/button_login_register_style" 381 style="@style/button_login_register_style"
378 android:layout_marginLeft="200dp" 382 android:layout_marginLeft="200dp"
379 android:layout_marginRight="200dp" 383 android:layout_marginRight="200dp"
380 android:layout_marginTop="80dp" 384 android:layout_marginTop="80dp"
381 android:text="@string/string_regist_next" /> 385 android:text="@string/string_regist_next" />
382 386
383 387
PersonalCenter/app/src/main/res/layout/activity_electroniccard_validation.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 android:background="#ffffffff" 5 android:background="#ffffffff"
6 android:orientation="vertical"> 6 android:orientation="vertical">
7 <RelativeLayout 7 <RelativeLayout
8 android:id="@+id/title" 8 android:id="@+id/title"
9 android:layout_width="match_parent" 9 android:layout_width="match_parent"
10 android:layout_height="wrap_content" 10 android:layout_height="wrap_content"
11 android:background="@color/login_text_blue" 11 android:background="@color/login_text_blue"
12 android:minHeight="50dp" > 12 android:minHeight="50dp" >
13 13
14 <ImageView 14 <ImageView
15 android:id="@+id/cancel" 15 android:id="@+id/cancel"
16 android:layout_width="wrap_content" 16 android:layout_width="wrap_content"
17 android:layout_height="wrap_content" 17 android:layout_height="wrap_content"
18 android:layout_centerVertical="true" 18 android:layout_centerVertical="true"
19 android:paddingLeft="20dp" 19 android:paddingLeft="20dp"
20 android:paddingRight="20dp" 20 android:paddingRight="20dp"
21 android:src="@mipmap/title_back" /> 21 android:src="@mipmap/title_back" />
22 22
23 <TextView 23 <TextView
24 android:id="@+id/menu_title" 24 android:id="@+id/menu_title"
25 android:layout_width="wrap_content" 25 android:layout_width="wrap_content"
26 android:layout_height="wrap_content" 26 android:layout_height="wrap_content"
27 android:layout_centerInParent="true" 27 android:layout_centerInParent="true"
28 android:text="@string/string_electroniccard_info_change" 28 android:text="@string/string_electroniccard_info_change"
29 android:textColor="@android:color/white" 29 android:textColor="@android:color/white"
30 android:textSize="22sp" /> 30 android:textSize="22sp" />
31 </RelativeLayout> 31 </RelativeLayout>
32 <RelativeLayout 32 <RelativeLayout
33 android:layout_width="match_parent" 33 android:layout_width="match_parent"
34 android:layout_height="match_parent" 34 android:layout_height="match_parent"
35 android:layout_below="@id/title" 35 android:layout_below="@id/title"
36 android:background="#ffffffff" 36 android:background="#ffffffff"
37 android:orientation="vertical" 37 android:orientation="vertical"
38 android:paddingLeft="250dp" 38 android:paddingLeft="250dp"
39 android:paddingRight="250dp" > 39 android:paddingRight="250dp" >
40 40
41 <EditText 41 <EditText
42 android:id="@+id/et_phonenumber" 42 android:id="@+id/et_phonenumber"
43 style="@style/login_register_edit_style" 43 style="@style/login_register_edit_style"
44 android:layout_marginTop="150dp" 44 android:layout_marginTop="150dp"
45 android:hint="手机号" 45 android:hint="手机号"
46 android:inputType="phone" /> 46 android:inputType="phone" />
47 47
48 <TextView 48 <TextView
49 android:id="@+id/phonenumber_error_hint" 49 android:id="@+id/phonenumber_error_hint"
50 style="@style/registererrhint_style" 50 style="@style/registererrhint_style"
51 android:layout_below="@id/et_phonenumber" /> 51 android:layout_below="@id/et_phonenumber" />
52 52
53 <LinearLayout 53 <LinearLayout
54 android:id="@+id/rl_authcode" 54 android:id="@+id/rl_authcode"
55 android:layout_width="match_parent" 55 android:layout_width="match_parent"
56 android:layout_height="wrap_content" 56 android:layout_height="wrap_content"
57 android:layout_below="@id/et_phonenumber" 57 android:layout_below="@id/et_phonenumber"
58 android:layout_marginTop="30dp" 58 android:layout_marginTop="30dp"
59 android:orientation="horizontal"> 59 android:orientation="horizontal">
60 60
61 <EditText 61 <EditText
62 android:id="@+id/et_authcode" 62 android:id="@+id/et_authcode"
63 style="@style/login_register_edit_rect_style" 63 style="@style/login_register_edit_rect_style"
64 android:layout_marginRight="-4px" 64 android:layout_marginRight="-4px"
65 android:layout_weight="1" 65 android:layout_weight="1"
66 android:hint="验证码" 66 android:hint="验证码"
67 android:numeric="integer" /> 67 android:numeric="integer" />
68 68
69 <Button 69 <Button
70 android:id="@+id/btn_authcode" 70 android:id="@+id/btn_authcode"
71 style="@style/login_register_btn_authcode_rect_style" 71 style="@style/login_register_btn_authcode_rect_style"
72 android:layout_marginLeft="0px" 72 android:layout_marginLeft="0px"
73 android:layout_marginTop="0px" 73 android:layout_marginTop="0px"
74 android:layout_weight="2" 74 android:layout_weight="2"
75 android:text="获取验证码" 75 android:text="获取验证码"
76 android:textColor="@color/btn_text_color" /> 76 android:textColor="@color/btn_text_color" />
77 </LinearLayout> 77 </LinearLayout>
78 78
79 <TextView 79 <TextView
80 android:id="@+id/authcode_error_hint" 80 android:id="@+id/authcode_error_hint"
81 style="@style/registererrhint_style" 81 style="@style/registererrhint_style"
82 android:layout_below="@id/rl_authcode" /> 82 android:layout_below="@id/rl_authcode" />
83 83
84 <TextView 84 <TextView
85 android:id="@+id/password_error_hint" 85 android:id="@+id/password_error_hint"
86 style="@style/registererrhint_style" 86 style="@style/registererrhint_style"
87 android:layout_below="@id/pwd_rl" /> 87 android:layout_below="@id/pwd_rl" />
88 88
89 <Button 89 <Button
90 android:id="@+id/btn_register" 90 android:id="@+id/btn_card_valiyanzhen"
91 style="@style/button_login_register_style" 91 style="@style/button_login_register_style"
92 android:layout_below="@id/rl_authcode" 92 android:layout_below="@id/rl_authcode"
93 android:layout_marginTop="30dp" 93 android:layout_marginTop="30dp"
94 android:text="@string/string_regist_next" /> 94 android:text="@string/string_regist_next" />
95 </RelativeLayout> 95 </RelativeLayout>
96 96
97 </RelativeLayout> 97 </RelativeLayout>
PersonalCenter/app/src/main/res/layout/activity_main.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="match_parent"> 4 android:layout_height="match_parent"
5 5 android:orientation="vertical">
6 <TextView 6
7 android:id="@+id/ssss" 7 <RelativeLayout
8 android:layout_width="wrap_content" 8 android:id="@+id/title"
9 android:layout_height="wrap_content" 9 android:layout_width="match_parent"
10 android:text="Hello World!" /> 10 android:layout_height="50dp"
11 </RelativeLayout> 11 android:background="@color/login_text_blue">
12
13 <ImageView
14 android:id="@+id/cancel"
15 android:layout_width="wrap_content"
16 android:layout_height="match_parent"
17 android:paddingLeft="20dp"
18 android:paddingRight="20dp"
19 android:src="@mipmap/title_back" />
20
21 <TextView
22 android:id="@+id/menu_title"
23 android:layout_width="wrap_content"
24 android:layout_height="match_parent"
25 android:layout_centerInParent="true"
26 android:gravity="center_vertical"
27 android:text="@string/titel_preson"
28 android:textColor="@android:color/white"
29 android:textSize="22sp" />
30
31 <ImageView
32 android:layout_width="wrap_content"
33 android:layout_height="match_parent"
34 android:layout_marginLeft="10dp"
35 android:layout_toLeftOf="@+id/iv_skin"
36 android:gravity="center_vertical"
37 android:padding="10dp"
38 android:src="@mipmap/shezhi"
39 android:textColor="@android:color/white"
40 android:textSize="22sp" />
41
42 <ImageView
43 android:id="@+id/iv_skin"
44 android:layout_width="wrap_content"
45 android:layout_height="match_parent"
46 android:layout_marginLeft="10dp"
47 android:layout_toLeftOf="@+id/iv_imformatioan"
48 android:gravity="center_vertical"
49 android:padding="10dp"
50 android:src="@mipmap/pifu"
51 android:textColor="@android:color/white"
52 android:textSize="22sp" />
53
54 <ImageView
55 android:id="@+id/iv_imformatioan"
56 android:layout_width="wrap_content"
57 android:layout_height="match_parent"
58 android:layout_alignParentRight="true"
59 android:layout_marginLeft="20dp"
60 android:gravity="center_vertical"
61 android:padding="10dp"
62 android:src="@mipmap/fankui"
63 android:textColor="@android:color/white"
64 android:textSize="22sp" />
65
66
67 </RelativeLayout>
68
69 <LinearLayout
70 android:layout_width="match_parent"
71 android:layout_height="match_parent">
72
73 <LinearLayout
74 android:layout_width="0dp"
75 android:layout_height="match_parent"
76 android:layout_weight="1"
77 android:orientation="vertical">
78
79 <ImageView
80 android:layout_width="wrap_content"
81 android:layout_height="wrap_content"
82 android:layout_margin="20dp"
83 android:padding="10dp"
84 android:src="@mipmap/card_icoc" />
85
86 <LinearLayout
87 android:layout_width="match_parent"
88 android:layout_height="wrap_content"
89 android:gravity="center"
90 android:orientation="horizontal">
91
92 <ImageView
93 android:layout_width="wrap_content"
94 android:layout_height="wrap_content"
95 android:layout_marginLeft="30dp"
96 android:src="@mipmap/header_default" />
97
98 <TextView
99 android:layout_width="wrap_content"
100 android:layout_height="wrap_content"
101 android:layout_marginLeft="18dp"
102 android:background="@drawable/corcle_blue_bg"
103 android:paddingLeft="5dp"
104 android:paddingRight="5dp"
105 android:text="签到"
106 android:textColor="@color/login_text_blue"
107 android:textSize="18sp" />
108
109 </LinearLayout>
110
111 <LinearLayout
112 android:layout_width="match_parent"
113 android:layout_height="wrap_content"
114 android:layout_marginLeft="20dp"
115 android:layout_marginTop="20dp"
116 android:orientation="horizontal">
117
118 <TextView
119 android:layout_width="wrap_content"
120 android:layout_height="wrap_content"
121 android:text="熊巍"
122 android:textSize="20dp" />
123
124 <ImageView
125 android:layout_width="wrap_content"
126 android:layout_height="wrap_content"
127 android:layout_marginLeft="90dp"
128 android:src="@mipmap/men" />
129
130 </LinearLayout>
131
132 <LinearLayout
133 android:layout_width="match_parent"
134 android:layout_height="wrap_content"
135 android:layout_marginLeft="20dp"
136 android:layout_marginTop="20dp"
137 android:gravity="center"
138 android:orientation="horizontal">
139
140 <TextView
141 android:layout_width="0dp"
142 android:layout_height="wrap_content"
143 android:layout_weight="5"
144 android:text="阿士大夫撒打发士大夫士大夫撒的范德萨"
145 android:textSize="18sp" />
146
147 <ImageView
148 android:layout_width="0dp"
149 android:layout_height="wrap_content"
150 android:layout_weight="1"
151 android:padding="10dp"
152 android:src="@mipmap/pencil" />
153
154
155 </LinearLayout>
156
157 <View
158 android:layout_width="match_parent"
159 android:layout_height="0.7dp"
160 android:layout_marginTop="10dp"
161 android:background="@color/cutoff_line">
162
163 </View>
164
165 <LinearLayout
166 android:layout_width="match_parent"
167 android:layout_height="wrap_content"
168 android:layout_marginTop="20dp"
169 android:orientation="vertical">
170
171 <LinearLayout
172 android:layout_width="match_parent"
173 android:layout_height="wrap_content"
174 android:gravity="center_vertical"
175 android:orientation="horizontal">
176
177 <ImageView
178 android:layout_width="0dp"
179 android:layout_height="wrap_content"
180 android:layout_weight="1"
181 android:src="@mipmap/wodecuoti" />
182
183 <TextView
184 android:layout_width="0dp"
185 android:layout_height="wrap_content"
186 android:layout_weight="5"
187 android:text="我的错题"
188 android:textSize="20sp" />
189
190 <ImageView
191 android:layout_width="0dp"
192 android:layout_height="wrap_content"
193 android:layout_weight="1"
194 android:src="@mipmap/youjiantou" />
195
196 </LinearLayout>
197
198 <LinearLayout
199 android:layout_width="match_parent"
200 android:layout_height="wrap_content"
201 android:layout_marginTop="20dp"
202 android:gravity="center_vertical"
203 android:orientation="horizontal">
204
205 <ImageView
206 android:layout_width="0dp"
207 android:layout_height="wrap_content"
208 android:layout_weight="1"
209 android:src="@mipmap/wodebiji" />
210
211 <TextView
212 android:layout_width="0dp"
213 android:layout_height="wrap_content"
214 android:layout_weight="5"
215 android:text="我的笔记"
216 android:textSize="20sp" />
217
218 <ImageView
219 android:layout_width="0dp"
220 android:layout_height="wrap_content"
221 android:layout_weight="1"
222 android:src="@mipmap/youjiantou" />
223
224 </LinearLayout>
225
226 <LinearLayout
227 android:layout_width="match_parent"
228 android:layout_height="wrap_content"
229 android:layout_marginTop="20dp"
230 android:gravity="center_vertical"
231 android:orientation="horizontal">
232
233 <ImageView
234 android:layout_width="0dp"
235 android:layout_height="wrap_content"
236 android:layout_weight="1"
237 android:src="@mipmap/wodeshoucang" />
238
239 <TextView
240 android:layout_width="0dp"
241 android:layout_height="wrap_content"
242 android:layout_weight="5"
243 android:text="我的收藏"
244 android:textSize="20sp" />
245
246 <ImageView
247 android:layout_width="0dp"
248 android:layout_height="wrap_content"
249 android:layout_weight="1"
250 android:src="@mipmap/youjiantou" />
251
252 </LinearLayout>
253
254 <LinearLayout
255 android:layout_width="match_parent"
256 android:layout_height="wrap_content"
257 android:layout_marginTop="20dp"
258 android:gravity="center_vertical"
259 android:orientation="horizontal">
260
261 <ImageView
262 android:layout_width="0dp"
263 android:layout_height="wrap_content"
264 android:layout_weight="1"
265 android:src="@mipmap/wodebanji" />
266
267 <TextView
268 android:layout_width="0dp"
269 android:layout_height="wrap_content"
270 android:layout_weight="5"
271 android:text="我的班级"
272 android:textSize="20sp" />
273
274 <ImageView
275 android:layout_width="0dp"
276 android:layout_height="wrap_content"
277 android:layout_weight="1"
278 android:src="@mipmap/youjiantou" />
279
280 </LinearLayout>
281
282
283 </LinearLayout>
284
285 <LinearLayout
286 android:layout_width="match_parent"
287 android:layout_height="wrap_content"
288 android:layout_marginTop="100dp"
289 android:background="@mipmap/xiaoguanggao">
290
291 </LinearLayout>
292
293
294 </LinearLayout>
295
296
297 <View
298 android:layout_width="0.7dp"
299 android:layout_height="match_parent"
300 android:background="@color/cutoff_line">
301
302 </View>
303
304 <LinearLayout
305 android:layout_width="0dp"
306 android:layout_height="match_parent"
307 android:layout_weight="2.5"
308 android:orientation="vertical">
309
310 <LinearLayout
311 android:layout_width="match_parent"
312 android:layout_height="wrap_content"
313 android:layout_margin="20dp"
314 android:gravity="center_vertical"
315 android:orientation="horizontal">
316
317 <View
318 android:layout_width="5dp"
319 android:layout_height="20dp"
320 android:background="@color/login_text_blue">
321
322 </View>
323
324 <TextView
325 android:layout_width="wrap_content"
326 android:layout_height="wrap_content"
327 android:layout_marginLeft="5dp"
328 android:text="最近学习"
329 android:textSize="22sp" />
330
331 </LinearLayout>
332
333 <LinearLayout
334 android:layout_width="match_parent"
335 android:layout_height="wrap_content">
336
337 <TextView
338 android:id="@+id/list_item_study"
339 android:layout_width="match_parent"
340 android:layout_height="100dp"
341 android:layout_marginLeft="20dp"
342 android:layout_marginTop="10dp"
343 android:gravity="center"
344 android:text="这里需要显示水平滑动的" />
345 </LinearLayout>
346
347 <View
348 android:layout_width="match_parent"
349 android:layout_height="0.7dp"
350 android:background="@color/cutoff_line">
351
352 </View>
353
354 <LinearLayout
355 android:layout_width="match_parent"
356 android:layout_height="wrap_content"
357 android:layout_margin="20dp"
358 android:gravity="center_vertical"
359 android:orientation="horizontal">
360
361 <View
362 android:layout_width="5dp"
363 android:layout_height="20dp"
364 android:background="@color/login_text_blue">
365
366 </View>
367
368 <TextView
369 android:layout_width="0dp"
370 android:layout_height="wrap_content"
371 android:layout_marginLeft="5dp"
372 android:layout_weight="1"
373 android:text="个人信息"
374 android:textSize="22sp" />
375
376 <TextView
377 android:layout_width="0dp"
378 android:layout_height="wrap_content"
379 android:layout_marginLeft="5dp"
380 android:layout_weight="0.1"
381 android:text="编辑"
382 android:textSize="22sp" />
383
384 <ImageView
385 android:layout_width="0dp"
386 android:layout_height="wrap_content"
387 android:layout_weight="0.1"
388
389 android:src="@mipmap/youjiantou" />
390
391
392 </LinearLayout>
393
394 <LinearLayout
395 android:layout_width="match_parent"
396 android:layout_height="wrap_content"
397 android:layout_marginLeft="50dp"
398 android:layout_marginTop="20dp"
399 android:orientation="vertical">
400
401 <LinearLayout
402 android:layout_width="match_parent"
403 android:layout_height="wrap_content"
404 android:gravity="center_vertical"
405 android:orientation="horizontal">
406
407 <TextView
408 android:layout_width="0dp"
409 android:layout_height="wrap_content"
410 android:layout_weight="1"
411 android:text="我的错题"
412 android:textSize="20sp" />
413
414 <TextView
415 android:layout_width="0dp"
416 android:layout_height="wrap_content"
417 android:layout_weight="2"
418 android:text="我的错题"
419 android:textSize="20sp" />
420
421 <TextView
422 android:layout_width="1dp"
423 android:layout_height="wrap_content"
424 android:layout_weight="1"
425 android:text="我的错题"
426 android:textSize="20sp" />
427
428 <TextView
429 android:layout_width="0dp"
430 android:layout_height="wrap_content"
431 android:layout_weight="2"
432 android:text="我的错题"
433 android:textSize="20sp" />
434 </LinearLayout>
435
436 <LinearLayout
437 android:layout_width="match_parent"
438 android:layout_height="wrap_content"
439 android:layout_marginTop="20dp"
440 android:gravity="center_vertical"
441 android:orientation="horizontal">
442
443 <TextView
444 android:layout_width="0dp"
445 android:layout_height="wrap_content"
446 android:layout_weight="1"
447 android:text="我的错题"
448 android:textSize="20sp" />
449
450 <TextView
451 android:layout_width="0dp"
452 android:layout_height="wrap_content"
453 android:layout_weight="2"
454 android:text="我的错题"
455 android:textSize="20sp" />
456
457 <TextView
458 android:layout_width="1dp"
459 android:layout_height="wrap_content"
460 android:layout_weight="1"
461 android:text="我的错题"
462 android:textSize="20sp" />
463
464 <TextView
465 android:layout_width="0dp"
466 android:layout_height="wrap_content"
467 android:layout_weight="2"
468 android:text="我的错题"
469 android:textSize="20sp" />
470 </LinearLayout>
471
472 <LinearLayout
473 android:layout_width="match_parent"
474 android:layout_height="wrap_content"
475 android:layout_marginTop="20dp"
476 android:gravity="center_vertical"
477 android:orientation="horizontal">
478
479 <TextView
480 android:layout_width="0dp"
481 android:layout_height="wrap_content"
482 android:layout_weight="1"
483 android:text="我的错题"
484 android:textSize="20sp" />
485
486 <TextView
487 android:layout_width="0dp"
488 android:layout_height="wrap_content"
489 android:layout_weight="2"
490 android:text="我的错题"
491 android:textSize="20sp" />
492
493 <TextView
494 android:layout_width="1dp"
495 android:layout_height="wrap_content"
496 android:layout_weight="1"
497 android:text="我的错题"
498 android:textSize="20sp" />
499
500 <TextView
501 android:layout_width="0dp"
502 android:layout_height="wrap_content"
503 android:layout_weight="2"
504 android:text="我的错题"
505 android:textSize="20sp" />
506 </LinearLayout>
507
508 <LinearLayout
509 android:layout_width="match_parent"
510 android:layout_height="wrap_content"
511 android:layout_marginTop="20dp"
512 android:gravity="center_vertical"
513 android:orientation="horizontal">
514
515 <TextView
516 android:layout_width="0dp"
517 android:layout_height="wrap_content"
518 android:layout_weight="1"
519 android:text="我的错题"
520 android:textSize="20sp" />
521
522 <TextView
523 android:layout_width="0dp"
524 android:layout_height="wrap_content"
525 android:layout_weight="2"
526 android:text="我的错题"
527 android:textSize="20sp" />
528
529 <TextView
530 android:layout_width="1dp"
531 android:layout_height="wrap_content"
532 android:layout_weight="1"
533 android:text="我的错题"
534 android:textSize="20sp" />
535
536 <TextView
537 android:layout_width="0dp"
538 android:layout_height="wrap_content"
539 android:layout_weight="2"
540 android:text="我的错题"
541 android:textSize="20sp" />
542 </LinearLayout>
543
544
545 </LinearLayout>
546
547 <LinearLayout
548 android:layout_width="match_parent"
549 android:layout_height="wrap_content"
550 android:layout_margin="20dp"
551 android:gravity="center_vertical"
552 android:orientation="horizontal">
553
554 <View
555 android:layout_width="5dp"
556 android:layout_height="20dp"
557 android:background="@color/login_text_blue">
558
559 </View>
560
561 <TextView
562 android:layout_width="wrap_content"
563 android:layout_height="wrap_content"
564 android:layout_marginLeft="5dp"
565 android:text="版本信息"
566 android:textSize="22sp" />
567
568 </LinearLayout>
569
570 <View
571 android:layout_width="match_parent"
572 android:layout_height="0.7dp"
573 android:background="@color/cutoff_line">
574
575 </View>
576
577 <LinearLayout
578 android:layout_width="match_parent"
579 android:layout_height="wrap_content"
580 android:layout_marginTop="20dp">
581
582 <TextView
583 android:layout_width="match_parent"
584 android:layout_height="100dp"
585 android:layout_marginLeft="20dp"
586 android:layout_marginTop="10dp"
587 android:gravity="center"
588 android:text="这里需要显示水平滑动的" />
589 </LinearLayout>
590
591
592 </LinearLayout>
593
594
595 </LinearLayout>
596
597
598 </LinearLayout>
12 599
PersonalCenter/app/src/main/res/layout/activity_ok_cardinfo.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 android:orientation="vertical"> 5 android:orientation="vertical">
6 6
7 <RelativeLayout 7 <RelativeLayout
8 android:id="@+id/title" 8 android:id="@+id/title"
9 android:layout_width="match_parent" 9 android:layout_width="match_parent"
10 android:layout_height="wrap_content" 10 android:layout_height="wrap_content"
11 android:background="@color/login_text_blue" 11 android:background="@color/login_text_blue"
12 android:minHeight="50dp"> 12 android:minHeight="50dp">
13 13
14 <ImageView 14 <ImageView
15 android:id="@+id/cancel" 15 android:id="@+id/cancel"
16 android:layout_width="wrap_content" 16 android:layout_width="wrap_content"
17 android:layout_height="wrap_content" 17 android:layout_height="wrap_content"
18 android:layout_centerVertical="true" 18 android:layout_centerVertical="true"
19 android:paddingLeft="20dp" 19 android:paddingLeft="20dp"
20 android:paddingRight="20dp" 20 android:paddingRight="20dp"
21 android:src="@mipmap/title_back" /> 21 android:src="@mipmap/title_back" />
22 22
23 <TextView 23 <TextView
24 android:id="@+id/menu_title" 24 android:id="@+id/menu_title"
25 android:layout_width="wrap_content" 25 android:layout_width="wrap_content"
26 android:layout_height="wrap_content" 26 android:layout_height="wrap_content"
27 android:layout_centerInParent="true" 27 android:layout_centerInParent="true"
28 android:text="@string/string_electroniccard_info_ok" 28 android:text="@string/string_electroniccard_info_ok"
29 android:textColor="@android:color/white" 29 android:textColor="@android:color/white"
30 android:textSize="22sp" /> 30 android:textSize="22sp" />
31 </RelativeLayout> 31 </RelativeLayout>
32 32
33 <LinearLayout 33 <LinearLayout
34 android:layout_width="match_parent" 34 android:layout_width="match_parent"
35 android:layout_height="wrap_content" 35 android:layout_height="wrap_content"
36 android:layout_margin="20dp" 36 android:layout_margin="20dp"
37 android:background="@mipmap/cardbackgrangd" 37 android:background="@mipmap/cardbackgrangd"
38 android:gravity="center" 38 android:gravity="center"
39 android:orientation="vertical"> 39 android:orientation="vertical">
40 40
41 <LinearLayout 41 <LinearLayout
42 android:layout_width="match_parent" 42 android:layout_width="match_parent"
43 android:layout_height="wrap_content" 43 android:layout_height="wrap_content"
44 android:layout_marginTop="70dp" 44 android:layout_marginTop="70dp"
45 android:gravity="center_vertical" 45 android:gravity="center_vertical"
46 android:orientation="horizontal"> 46 android:orientation="horizontal">
47 47
48 <LinearLayout 48 <LinearLayout
49 android:layout_width="wrap_content" 49 android:layout_width="wrap_content"
50 android:layout_height="wrap_content" 50 android:layout_height="wrap_content"
51 android:layout_marginLeft="200dp" 51 android:layout_marginLeft="200dp"
52 android:gravity="center_vertical"> 52 android:gravity="center_vertical">
53 53
54 <ImageView 54 <ImageView
55 android:layout_width="wrap_content" 55 android:layout_width="wrap_content"
56 android:layout_height="wrap_content" 56 android:layout_height="wrap_content"
57 android:src="@mipmap/logo_info" /> 57 android:src="@mipmap/logo_info" />
58 58
59 <TextView 59 <TextView
60 android:layout_width="wrap_content" 60 android:layout_width="wrap_content"
61 android:layout_height="wrap_content" 61 android:layout_height="wrap_content"
62 android:layout_marginLeft="50dp" 62 android:layout_marginLeft="50dp"
63 android:background="@null" 63 android:background="@null"
64 android:text="电子保卡" 64 android:text="电子保卡"
65 android:textColor="@color/login_text_blue" 65 android:textColor="@color/login_text_blue"
66 android:textSize="22sp" /> 66 android:textSize="22sp" />
67 67
68 </LinearLayout> 68 </LinearLayout>
69 69
70 <LinearLayout 70 <LinearLayout
71 android:layout_width="wrap_content" 71 android:layout_width="wrap_content"
72 android:layout_height="80dp" 72 android:layout_height="80dp"
73 android:layout_marginLeft="200dp" 73 android:layout_marginLeft="200dp"
74 android:gravity="center_vertical"> 74 android:gravity="center_vertical">
75 75
76 <TextView 76 <TextView
77 android:layout_width="wrap_content" 77 android:layout_width="wrap_content"
78 android:layout_height="wrap_content" 78 android:layout_height="wrap_content"
79 android:text="客户姓名" 79 android:text="客户姓名"
80 android:textColor="@color/btn_text_color" 80 android:textColor="@color/btn_text_color"
81 android:textSize="22sp" /> 81 android:textSize="22sp" />
82 82
83 <TextView 83 <TextView
84 android:layout_width="wrap_content" 84 android:layout_width="wrap_content"
85 android:layout_height="wrap_content" 85 android:layout_height="wrap_content"
86 android:layout_marginLeft="60dp" 86 android:layout_marginLeft="60dp"
87 android:text="王小明" 87 android:text="王小明"
88 android:textColor="@color/btn_text_color" 88 android:textColor="@color/btn_text_color"
89 android:textSize="22sp" /> 89 android:textSize="22sp" />
90 90
91 </LinearLayout> 91 </LinearLayout>
92 92
93 </LinearLayout> 93 </LinearLayout>
94 94
95 <LinearLayout 95 <LinearLayout
96 android:layout_width="match_parent" 96 android:layout_width="match_parent"
97 android:layout_height="wrap_content" 97 android:layout_height="wrap_content"
98 android:gravity="center_vertical" 98 android:gravity="center_vertical"
99 android:orientation="horizontal"> 99 android:orientation="horizontal">
100 100
101 <LinearLayout 101 <LinearLayout
102 android:layout_width="wrap_content" 102 android:layout_width="wrap_content"
103 android:layout_height="60dp" 103 android:layout_height="60dp"
104 android:layout_marginLeft="200dp" 104 android:layout_marginLeft="200dp"
105 android:gravity="center_vertical"> 105 android:gravity="center_vertical">
106 106
107 <TextView 107 <TextView
108 android:layout_width="wrap_content" 108 android:layout_width="wrap_content"
109 android:layout_height="wrap_content" 109 android:layout_height="wrap_content"
110 android:text="产品型号" 110 android:text="产品型号"
111 android:textColor="@color/btn_text_color" 111 android:textColor="@color/btn_text_color"
112 android:textSize="22sp" /> 112 android:textSize="22sp" />
113 113
114 <TextView 114 <TextView
115 android:layout_width="wrap_content" 115 android:layout_width="wrap_content"
116 android:layout_height="wrap_content" 116 android:layout_height="wrap_content"
117 android:layout_marginLeft="50dp" 117 android:layout_marginLeft="50dp"
118 android:text="IPone888" 118 android:text="IPone888"
119 android:textSize="22sp" /> 119 android:textSize="22sp" />
120 120
121 121
122 </LinearLayout> 122 </LinearLayout>
123 123
124 <LinearLayout 124 <LinearLayout
125 android:layout_width="wrap_content" 125 android:layout_width="wrap_content"
126 android:layout_height="60dp" 126 android:layout_height="60dp"
127 android:layout_marginLeft="250dp" 127 android:layout_marginLeft="250dp"
128 android:gravity="center_vertical"> 128 android:gravity="center_vertical">
129 129
130 <TextView 130 <TextView
131 android:layout_width="wrap_content" 131 android:layout_width="wrap_content"
132 android:layout_height="wrap_content" 132 android:layout_height="wrap_content"
133 android:text="客户地址" 133 android:text="客户地址"
134 android:textSize="22sp" /> 134 android:textSize="22sp" />
135 135
136 <TextView 136 <TextView
137 android:layout_width="wrap_content" 137 android:layout_width="wrap_content"
138 android:layout_height="wrap_content" 138 android:layout_height="wrap_content"
139 android:layout_marginLeft="98dp" 139 android:layout_marginLeft="98dp"
140 android:background="@null" 140 android:background="@null"
141 android:text="北京市昭阳区三里屯" 141 android:text="北京市昭阳区三里屯"
142 android:textSize="22sp" /> 142 android:textSize="22sp" />
143 143
144 </LinearLayout> 144 </LinearLayout>
145 145
146 </LinearLayout> 146 </LinearLayout>
147 147
148 <LinearLayout 148 <LinearLayout
149 android:layout_width="match_parent" 149 android:layout_width="match_parent"
150 android:layout_height="wrap_content" 150 android:layout_height="wrap_content"
151 android:gravity="center_vertical" 151 android:gravity="center_vertical"
152 android:orientation="horizontal"> 152 android:orientation="horizontal">
153 153
154 <LinearLayout 154 <LinearLayout
155 android:layout_width="wrap_content" 155 android:layout_width="wrap_content"
156 android:layout_height="60dp" 156 android:layout_height="60dp"
157 android:layout_marginLeft="200dp" 157 android:layout_marginLeft="200dp"
158 android:gravity="center_vertical"> 158 android:gravity="center_vertical">
159 159
160 <TextView 160 <TextView
161 android:layout_width="wrap_content" 161 android:layout_width="wrap_content"
162 android:layout_height="wrap_content" 162 android:layout_height="wrap_content"
163 android:text="MAC地址" 163 android:text="MAC地址"
164 android:textSize="22sp" /> 164 android:textSize="22sp" />
165 165
166 <TextView 166 <TextView
167 android:layout_width="wrap_content" 167 android:layout_width="wrap_content"
168 android:layout_height="wrap_content" 168 android:layout_height="wrap_content"
169 android:layout_marginLeft="50dp" 169 android:layout_marginLeft="50dp"
170 android:background="@null" 170 android:background="@null"
171 android:text="237462873463278" 171 android:text="237462873463278"
172 android:textSize="22sp" /> 172 android:textSize="22sp" />
173 173
174 </LinearLayout> 174 </LinearLayout>
175 175
176 <LinearLayout 176 <LinearLayout
177 android:layout_width="wrap_content" 177 android:layout_width="wrap_content"
178 android:layout_height="60dp" 178 android:layout_height="60dp"
179 android:layout_marginLeft="210dp" 179 android:layout_marginLeft="210dp"
180 android:gravity="center_vertical"> 180 android:gravity="center_vertical">
181 181
182 <TextView 182 <TextView
183 android:layout_width="wrap_content" 183 android:layout_width="wrap_content"
184 android:layout_height="wrap_content" 184 android:layout_height="wrap_content"
185 android:text="购买时间" 185 android:text="购买时间"
186 android:textColor="@color/btn_text_color" 186 android:textColor="@color/btn_text_color"
187 android:textSize="22sp" /> 187 android:textSize="22sp" />
188 188
189 <TextView 189 <TextView
190 android:layout_width="wrap_content" 190 android:layout_width="wrap_content"
191 android:layout_height="wrap_content" 191 android:layout_height="wrap_content"
192 android:layout_marginLeft="25dp" 192 android:layout_marginLeft="25dp"
193 android:background="@null" 193 android:background="@null"
194 android:text="4433322-334--34" 194 android:text="4433322-334--34"
195 android:textColor="@color/btn_text_color" 195 android:textColor="@color/btn_text_color"
196 android:textSize="22sp" /> 196 android:textSize="22sp" />
197 </LinearLayout> 197 </LinearLayout>
198 198
199 </LinearLayout> 199 </LinearLayout>
200 200
201 <LinearLayout 201 <LinearLayout
202 android:layout_width="match_parent" 202 android:layout_width="match_parent"
203 android:layout_height="wrap_content" 203 android:layout_height="wrap_content"
204 android:gravity="center_vertical" 204 android:gravity="center_vertical"
205 android:orientation="horizontal"> 205 android:orientation="horizontal">
206 206
207 <LinearLayout 207 <LinearLayout
208 android:layout_width="wrap_content" 208 android:layout_width="wrap_content"
209 android:layout_height="60dp" 209 android:layout_height="60dp"
210 android:layout_marginLeft="200dp" 210 android:layout_marginLeft="200dp"
211 android:gravity="center_vertical"> 211 android:gravity="center_vertical">
212 212
213 <TextView 213 <TextView
214 android:layout_width="wrap_content" 214 android:layout_width="wrap_content"
215 android:layout_height="wrap_content" 215 android:layout_height="wrap_content"
216 android:text="机身编码" 216 android:text="机身编码"
217 android:textColor="@color/btn_text_color" 217 android:textColor="@color/btn_text_color"
218 android:textSize="22sp" /> 218 android:textSize="22sp" />
219 219
220 <TextView 220 <TextView
221 android:layout_width="wrap_content" 221 android:layout_width="wrap_content"
222 android:layout_height="wrap_content" 222 android:layout_height="wrap_content"
223 android:layout_marginLeft="50dp" 223 android:layout_marginLeft="50dp"
224 android:hint="473463746343" 224 android:hint="473463746343"
225 android:textSize="22sp" /> 225 android:textSize="22sp" />
226 226
227 </LinearLayout> 227 </LinearLayout>
228 228
229 <LinearLayout 229 <LinearLayout
230 android:layout_width="wrap_content" 230 android:layout_width="wrap_content"
231 android:layout_height="60dp" 231 android:layout_height="60dp"
232 android:layout_marginLeft="210dp" 232 android:layout_marginLeft="210dp"
233 android:gravity="center_vertical"> 233 android:gravity="center_vertical">
234 234
235 <TextView 235 <TextView
236 android:layout_width="wrap_content" 236 android:layout_width="wrap_content"
237 android:layout_height="wrap_content" 237 android:layout_height="wrap_content"
238 android:text="购买地址" 238 android:text="购买地址"
239 android:textColor="@color/btn_text_color" 239 android:textColor="@color/btn_text_color"
240 android:textSize="22sp" /> 240 android:textSize="22sp" />
241 241
242 <TextView 242 <TextView
243 android:layout_width="wrap_content" 243 android:layout_width="wrap_content"
244 android:layout_height="wrap_content" 244 android:layout_height="wrap_content"
245 android:layout_marginLeft="25dp" 245 android:layout_marginLeft="25dp"
246 android:text="啥啥啥 专卖店" 246 android:text="啥啥啥 专卖店"
247 android:textColor="@color/btn_text_color" 247 android:textColor="@color/btn_text_color"
248 android:textSize="22sp" /> 248 android:textSize="22sp" />
249 </LinearLayout> 249 </LinearLayout>
250 250
251 </LinearLayout> 251 </LinearLayout>
252 252
253 <LinearLayout 253 <LinearLayout
254 android:layout_width="match_parent" 254 android:layout_width="match_parent"
255 android:layout_height="wrap_content" 255 android:layout_height="wrap_content"
256 android:gravity="center_vertical" 256 android:gravity="center_vertical"
257 android:orientation="horizontal"> 257 android:orientation="horizontal">
258 258
259 <LinearLayout 259 <LinearLayout
260 android:layout_width="wrap_content" 260 android:layout_width="wrap_content"
261 android:layout_height="60dp" 261 android:layout_height="60dp"
262 android:layout_marginLeft="200dp" 262 android:layout_marginLeft="200dp"
263 android:gravity="center_vertical"> 263 android:gravity="center_vertical">
264 264
265 <TextView 265 <TextView
266 android:layout_width="wrap_content" 266 android:layout_width="wrap_content"
267 android:layout_height="wrap_content" 267 android:layout_height="wrap_content"
268 android:text="手机号码" 268 android:text="手机号码"
269 android:textColor="@color/btn_text_color" 269 android:textColor="@color/btn_text_color"
270 android:textSize="22sp" /> 270 android:textSize="22sp" />
271 271
272 <TextView 272 <TextView
273 android:layout_width="wrap_content" 273 android:layout_width="wrap_content"
274 android:layout_height="wrap_content" 274 android:layout_height="wrap_content"
275 android:layout_marginLeft="50dp" 275 android:layout_marginLeft="50dp"
276 android:text="IPone888" 276 android:text="IPone888"
277 android:textSize="22sp" /> 277 android:textSize="22sp" />
278 278
279 279
280 </LinearLayout> 280 </LinearLayout>
281 281
282 <LinearLayout 282 <LinearLayout
283 android:layout_width="wrap_content" 283 android:layout_width="wrap_content"
284 android:layout_height="60dp" 284 android:layout_height="60dp"
285 android:layout_marginLeft="250dp" 285 android:layout_marginLeft="250dp"
286 android:gravity="center_vertical"> 286 android:gravity="center_vertical">
287 287
288 <TextView 288 <TextView
289 android:layout_width="wrap_content" 289 android:layout_width="wrap_content"
290 android:layout_height="wrap_content" 290 android:layout_height="wrap_content"
291 android:text="本地售后电话" 291 android:text="本地售后电话"
292 android:textSize="22sp" /> 292 android:textSize="22sp" />
293 293
294 <TextView 294 <TextView
295 android:layout_width="wrap_content" 295 android:layout_width="wrap_content"
296 android:layout_height="wrap_content" 296 android:layout_height="wrap_content"
297 android:layout_marginLeft="98dp" 297 android:layout_marginLeft="98dp"
298 android:background="@null" 298 android:background="@null"
299 android:text="1111111" 299 android:text="1111111"
300 android:textSize="22sp" /> 300 android:textSize="22sp" />
301 301
302 </LinearLayout> 302 </LinearLayout>
303 303
304 </LinearLayout> 304 </LinearLayout>
305 </LinearLayout> 305 </LinearLayout>
306 306
307 <LinearLayout 307 <LinearLayout
308 android:layout_width="match_parent" 308 android:layout_width="match_parent"
309 android:layout_height="wrap_content" 309 android:layout_height="wrap_content"
310 android:layout_marginTop="5dp" 310 android:layout_marginTop="5dp"
311 android:gravity="center" 311 android:gravity="center"
312 android:orientation="vertical"> 312 android:orientation="vertical">
313 313
314 <TextView 314 <TextView
315 android:layout_width="wrap_content" 315 android:layout_width="wrap_content"
316 android:layout_height="wrap_content" 316 android:layout_height="wrap_content"
317 android:layout_marginTop="5dp" 317 android:layout_marginTop="5dp"
318 android:text="@string/electronic_card3" 318 android:text="@string/electronic_card3"
319 android:textColor="@color/electronic_text" 319 android:textColor="@color/electronic_text"
320 android:textSize="18sp" /> 320 android:textSize="18sp" />
321 321
322 <TextView 322 <TextView
323 android:layout_width="wrap_content" 323 android:layout_width="wrap_content"
324 android:layout_height="wrap_content" 324 android:layout_height="wrap_content"
325 android:layout_marginTop="5dp" 325 android:layout_marginTop="5dp"
326 android:text="@string/electronic_card4" 326 android:text="@string/electronic_card4"
327 android:textColor="@color/electronic_text" 327 android:textColor="@color/electronic_text"
328 android:textSize="18sp" /> 328 android:textSize="18sp" />
329 329
330 330
331 </LinearLayout> 331 </LinearLayout>
332 332
333 <LinearLayout 333 <LinearLayout
334 android:layout_width="match_parent" 334 android:layout_width="match_parent"
335 android:layout_height="wrap_content" 335 android:layout_height="wrap_content"
336 android:layout_marginTop="30dp" 336 android:layout_marginTop="30dp"
337 android:gravity="center" 337 android:gravity="center"
338 android:orientation="horizontal"> 338 android:orientation="horizontal">
339 339
340 <Button 340 <Button
341 android:id="@+id/btn_bangding" 341 android:id="@+id/btn_bangding"
342 android:layout_width="300dp" 342 android:layout_width="300dp"
343 android:layout_height="wrap_content" 343 android:layout_height="wrap_content"
344 android:background="@drawable/selector_blue_btn_bg" 344 android:background="@drawable/selector_blue_btn_bg"
345 android:text="@string/bangding" 345 android:text="@string/bangding"
346 android:textColor="@color/white" 346 android:textColor="@color/white"
347 android:textSize="23sp" /> 347 android:textSize="23sp" />
348 348
349 <Button 349 <Button
350 android:id="@+id/btn_ok" 350 android:id="@+id/btn_finish"
351 android:layout_width="300dp" 351 android:layout_width="300dp"
352 android:layout_height="wrap_content" 352 android:layout_height="wrap_content"
353 android:layout_marginLeft="50dp" 353 android:layout_marginLeft="50dp"
354 android:background="@drawable/selector_blue_btn_bg" 354 android:background="@drawable/selector_blue_btn_bg"
355 android:text="@string/finish" 355 android:text="@string/finish"
356 android:textColor="@color/white" 356 android:textColor="@color/white"
357 android:textSize="23sp" /> 357 android:textSize="23sp" />
358 358
359 359
360 </LinearLayout> 360 </LinearLayout>
361 361
362 362
363 </LinearLayout> 363 </LinearLayout>
PersonalCenter/app/src/main/res/layout/activity_start_page.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical" 3 android:orientation="vertical"
4 android:layout_width="match_parent" 4 android:layout_width="match_parent"
5 android:layout_height="match_parent" 5 android:layout_height="match_parent"
6 android:background="@mipmap/startpage"> 6 android:background="@mipmap/startpage">
7 <RelativeLayout 7 <RelativeLayout
8 android:layout_width="wrap_content" 8 android:layout_width="wrap_content"
9 android:layout_height="wrap_content" 9 android:layout_height="wrap_content"
10 android:layout_alignParentBottom="true" 10 android:layout_alignParentBottom="true"
11 android:paddingLeft="250dp" 11 android:paddingLeft="250dp"
12 android:paddingRight="250dp"> 12 android:paddingRight="250dp">
13 <Button 13 <Button
14 android:id="@+id/btn_ok" 14 android:id="@+id/btn_start"
15 style="@style/button_login_register_style" 15 style="@style/button_login_register_style"
16 android:layout_marginBottom="50dp" 16 android:layout_marginBottom="50dp"
17 android:text="@string/string_start_page" /> 17 android:text="@string/string_start_page" />
18 </RelativeLayout> 18 </RelativeLayout>
19 19
20 20
21 </RelativeLayout> 21 </RelativeLayout>
PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:id="@+id/card_view"
4 android:layout_width="match_parent"
5 android:layout_height="match_parent"
6 android:orientation="vertical">
7
8
9 <LinearLayout
10 android:layout_width="wrap_content"
11 android:layout_height="wrap_content"
12 android:layout_marginTop="60dp"
13 android:orientation="horizontal">
14
15 <View
16 android:layout_width="450dp"
17 android:layout_height="0.7dp"
18 android:layout_marginLeft="150dp"
19 android:background="@color/electronic_text">
20
21 </View>
22
23 <View
24 android:layout_width="450dp"
25 android:layout_height="0.7dp"
26 android:layout_marginLeft="80dp"
27 android:background="@color/electronic_text">
28
29 </View>
30
31
32 </LinearLayout>
33
34 <LinearLayout
35 android:layout_width="match_parent"
36 android:layout_height="wrap_content"
37 android:layout_marginLeft="200dp"
38 android:gravity="center_vertical"
39 android:orientation="horizontal">
40
41 <LinearLayout
42 android:layout_width="0dp"
43 android:layout_height="80dp"
44 android:layout_weight="1"
45 android:gravity="center_vertical">
46
47 <TextView
48 android:layout_width="wrap_content"
49 android:layout_height="wrap_content"
50 android:text="昵称"
51 android:textColor="@color/pickerview_wheelview_textcolor_center"
52 android:textSize="22sp" />
53
54 <EditText
55 android:layout_width="wrap_content"
56 android:layout_height="wrap_content"
57 android:layout_marginLeft="50dp"
58 android:background="@null"
59 android:hint="请输入12个以内的中文或英文字符"
60 android:textColor="@color/electronic_text"
61 android:textSize="22sp" />
62
63 </LinearLayout>
64
65 <LinearLayout
66 android:layout_width="0dp"
67 android:layout_height="80dp"
68 android:layout_weight="1"
69 android:gravity="center_vertical">
70
71 <TextView
72 android:layout_width="wrap_content"
73 android:layout_height="wrap_content"
74 android:text="地区"
75 android:textColor="@color/pickerview_wheelview_textcolor_center"
76 android:textSize="22sp" />
77
78 <TextView
79 android:layout_width="wrap_content"
80 android:layout_height="wrap_content"
81 android:layout_marginLeft="50dp"
82 android:text="请选择"
83 android:textColor="@color/btn_text_color"
84 android:textSize="22sp" />
85
86 <ImageView
87 android:layout_width="wrap_content"
88 android:layout_height="wrap_content"
89 android:layout_marginLeft="150dp"
90 android:src="@mipmap/xiajiantou">
91
92 </ImageView>
93 </LinearLayout>
94
95 </LinearLayout>
96
97 <LinearLayout
98 android:layout_width="wrap_content"
99 android:layout_height="wrap_content"
100 android:orientation="horizontal">
101
102 <View
103 android:layout_width="450dp"
104 android:layout_height="0.7dp"
105 android:layout_marginLeft="150dp"
106 android:background="@color/electronic_text">
107
108 </View>
109
110 <View
111 android:layout_width="450dp"
112 android:layout_height="0.7dp"
113 android:layout_marginLeft="80dp"
114 android:background="@color/electronic_text">
115
116 </View>
117
118
119 </LinearLayout>
120
121 <LinearLayout
122 android:layout_width="match_parent"
123 android:layout_height="wrap_content"
124 android:layout_marginLeft="200dp"
125 android:gravity="center_vertical"
126 android:orientation="horizontal">
127
128 <LinearLayout
129 android:layout_width="0dp"
130 android:layout_height="80dp"
131 android:layout_weight="1"
132 android:gravity="center_vertical">
133
134 <TextView
135 android:layout_width="wrap_content"
136 android:layout_height="wrap_content"
137 android:text="性别"
138 android:textColor="@color/pickerview_wheelview_textcolor_center"
139 android:textSize="22sp" />
140
141 <TextView
142 android:layout_width="wrap_content"
143 android:layout_height="wrap_content"
144 android:layout_marginLeft="50dp"
145 android:text="请选择"
146 android:textSize="22sp" />
147
148 <ImageView
149 android:layout_width="wrap_content"
150 android:layout_height="wrap_content"
151 android:layout_marginLeft="150dp"
152 android:src="@mipmap/xiajiantou">
153
154 </ImageView>
155
156
157 </LinearLayout>
158
159 <LinearLayout
160 android:layout_width="0dp"
161 android:layout_height="80dp"
162 android:layout_weight="1"
163 android:gravity="center_vertical">
164
165 <TextView
166 android:layout_width="wrap_content"
167 android:layout_height="wrap_content"
168 android:text=" "
169 android:textColor="@color/white"
170 android:textSize="22sp" />
171
172 <EditText
173 android:layout_width="wrap_content"
174 android:layout_height="wrap_content"
175 android:layout_marginLeft="50dp"
176 android:background="@null"
177 android:hint="请输入详细地址"
178 android:textSize="22sp" />
179
180 </LinearLayout>
181
182 </LinearLayout>
183
184 <LinearLayout
185 android:layout_width="wrap_content"
186 android:layout_height="wrap_content"
187
188 android:orientation="horizontal">
189
190 <View
191 android:layout_width="450dp"
192 android:layout_height="0.7dp"
193 android:layout_marginLeft="150dp"
194 android:background="@color/electronic_text">
195
196 </View>
197
198 <View
199 android:layout_width="450dp"
200 android:layout_height="0.7dp"
201 android:layout_marginLeft="80dp"
202 android:background="@color/electronic_text">
203
204 </View>
205
206
207 </LinearLayout>
208
209 <LinearLayout
210 android:layout_width="match_parent"
211 android:layout_height="wrap_content"
212 android:layout_marginLeft="200dp"
213 android:gravity="center_vertical"
214 android:orientation="horizontal">
215
216
217 <LinearLayout
218 android:layout_width="0dp"
219 android:layout_height="80dp"
220 android:layout_weight="1"
221 android:gravity="center_vertical">
222
223 <TextView
224 android:layout_width="wrap_content"
225 android:layout_height="wrap_content"
226 android:text="生日"
227 android:textColor="@color/pickerview_wheelview_textcolor_center"
228 android:textSize="22sp" />
229
230 <TextView
231 android:layout_width="wrap_content"
232 android:layout_height="wrap_content"
233 android:layout_marginLeft="50dp"
234 android:hint="请选择"
235 android:textSize="22sp" />
236
237 <ImageView
238 android:layout_width="wrap_content"
239 android:layout_height="wrap_content"
240 android:layout_marginLeft="150dp"
241 android:src="@mipmap/xiajiantou"/>
242 </LinearLayout>
243 <LinearLayout
244 android:layout_width="0dp"
245 android:layout_height="80dp"
246 android:layout_weight="1"
247 android:gravity="center_vertical">
248
249 <TextView
250 android:layout_width="wrap_content"
251 android:layout_height="wrap_content"
252 android:text="年级"
253 android:textColor="@color/pickerview_wheelview_textcolor_center"
254 android:textSize="22sp" />
255
256 <TextView
257 android:layout_width="wrap_content"
258 android:layout_height="wrap_content"
259 android:layout_marginLeft="50dp"
260 android:hint="请选择"
261 android:textSize="22sp" />
262
263 <ImageView
264 android:layout_width="wrap_content"
265 android:layout_height="wrap_content"
266 android:layout_marginLeft="150dp"
267 android:src="@mipmap/xiajiantou"/>
268 </LinearLayout>
269
270 </LinearLayout>
271
272 <LinearLayout
273 android:layout_width="wrap_content"
274 android:layout_height="wrap_content"
275
276 android:orientation="horizontal">
277
278 <View
279 android:layout_width="450dp"
280 android:layout_height="0.7dp"
281 android:layout_marginLeft="150dp"
282 android:background="@color/electronic_text">
283
284 </View>
285
286 <View
287 android:layout_width="450dp"
288 android:layout_height="0.7dp"
289 android:layout_marginLeft="80dp"
290 android:background="@color/electronic_text">
291
292 </View>
293
294
295 </LinearLayout>
296
297 <LinearLayout
298 android:layout_width="match_parent"
299 android:layout_height="wrap_content"
300 android:layout_marginLeft="200dp"
301 android:gravity="center_vertical"
302 android:orientation="horizontal">
303
304 <LinearLayout
305 android:id="@+id/lineL_buy_time"
306 android:layout_width="0dp"
307 android:layout_height="80dp"
308 android:layout_weight="1"
309 android:gravity="center_vertical">
310
311 <TextView
312 android:layout_width="wrap_content"
313 android:layout_height="wrap_content"
314 android:text="Q Q"
315 android:textColor="@color/pickerview_wheelview_textcolor_center"
316 android:textSize="22sp" />
317
318 <EditText
319 android:id="@+id/tv_buy_time"
320 android:layout_width="wrap_content"
321 android:layout_height="wrap_content"
322 android:layout_marginLeft="50dp"
323 android:background="@null"
324 android:hint="请输入"
325 android:textSize="22sp" />
326
327 </LinearLayout>
328
329 <LinearLayout
330 android:layout_width="0dp"
331 android:layout_height="80dp"
332 android:layout_weight="1"
333
334 android:gravity="center_vertical">
335
336 <TextView
337 android:layout_width="wrap_content"
338 android:layout_height="wrap_content"
339 android:text="学校"
340 android:textColor="@color/pickerview_wheelview_textcolor_center"
341 android:textSize="22sp" />
342
343 <TextView
344 android:layout_width="wrap_content"
345 android:layout_height="wrap_content"
346 android:layout_marginLeft="50dp"
347 android:text="请选择"
348 android:textColor="@color/btn_text_color"
349 android:textSize="22sp" />
350
351 <ImageView
352 android:layout_width="wrap_content"
353 android:layout_height="wrap_content"
354 android:layout_marginLeft="150dp"
355 android:src="@mipmap/xiajiantou">
356
357 </ImageView>
358 </LinearLayout>
359
360 </LinearLayout>
361
362 <LinearLayout
363 android:layout_width="wrap_content"
364 android:layout_height="wrap_content"
365 android:orientation="horizontal">
366
367 <View
368 android:layout_width="450dp"
369 android:layout_height="0.7dp"
370 android:layout_marginLeft="150dp"
371 android:background="@color/electronic_text">
372
373 </View>
374
375 <View
376 android:layout_width="450dp"
377 android:layout_height="0.7dp"
378 android:layout_marginLeft="80dp"
379 android:background="@color/electronic_text">
380
381 </View>
382
383
384 </LinearLayout>
385
386 </LinearLayout>
PersonalCenter/app/src/main/res/layout/fragment_changge_version_info.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical" android:layout_width="match_parent"
4 android:layout_height="match_parent"
5 android:background="@color/white">
6 <GridView
7 android:id="@+id/grideview"
8 android:layout_marginTop="20dp"
9 android:layout_width="match_parent"
10 android:layout_height="wrap_content"
11 android:layout_below="@+id/title"
12 android:numColumns="5">
13
14 </GridView>
15
16 </RelativeLayout>
PersonalCenter/app/src/main/res/layout/fragment_changge_version_info_itmes.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical"
4 android:layout_width="match_parent"
5 android:layout_height="match_parent"
6 android:gravity="center">
7
8
9 <ImageView
10 android:src="@mipmap/ic_launcher"
11 android:id="@+id/image"
12 android:layout_width="100dp"
13 android:background="@drawable/corcle_black_bg"
14 android:layout_height="150dp"
15
16 />
17 <TextView
18 android:id="@+id/text"
19 android:layout_marginTop="5dp"
20 android:textSize="22sp"
21 android:layout_width="wrap_content"
22 android:layout_height="wrap_content"
23 android:textColor="@color/login_text_black"
24 android:text="语文"
25 />
26 <TextView
27 android:id="@+id/tv_publish"
28 android:layout_marginTop="10dp"
29 android:textSize="18sp"
30 android:layout_width="wrap_content"
31 android:layout_height="wrap_content"
32 android:textColor="@color/login_text_black"
33 android:text="人民教育出版社"
34 />
35
36 </LinearLayout>
PersonalCenter/app/src/main/res/mipmap-xhdpi/card_icoc.png

234 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/fankui.png

836 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/header_default.png

4.79 KB

PersonalCenter/app/src/main/res/mipmap-xhdpi/men.png

680 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/pencil.png

423 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/pifu.png

1.08 KB

PersonalCenter/app/src/main/res/mipmap-xhdpi/shezhi.png

909 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/wodebanji.png

480 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/wodebiji.png

588 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/wodecuoti.png

371 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/wodeshoucang.png

730 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/women.png

618 Bytes

PersonalCenter/app/src/main/res/mipmap-xhdpi/xiaoguanggao.png

19.1 KB

PersonalCenter/app/src/main/res/mipmap-xhdpi/youjiantou.png

457 Bytes

PersonalCenter/app/src/main/res/values/strings.xml
1 <resources> 1 <resources>
2 <string name="app_name">PersonalCenter</string> 2 <string name="app_name">PersonalCenter</string>
3 3
4 4
5 5
6 //登录注册 6 //登录注册
7 <string name="cancel">取 消</string> 7 <string name="cancel">取 消</string>
8 <string name="ok">确 定</string> 8 <string name="ok">确 定</string>
9 <string name="forget_pwd">忘记密码</string> 9 <string name="forget_pwd">忘记密码</string>
10 <string name="string_menu_title">修改密码</string> 10 <string name="string_menu_title">修改密码</string>
11 <string name="string_regist_info">填写注册信息</string> 11 <string name="string_regist_info">填写注册信息</string>
12 <string name="string_textbook_info">选择教材版本</string> 12 <string name="string_textbook_info">选择教材版本</string>
13 <string name="string_regist_username">用户名</string> 13 <string name="string_regist_username">用户名</string>
14 <string name="string_regist_region">地区</string> 14 <string name="string_regist_region">地区</string>
15 <string name="string_regist_grade">年级</string> 15 <string name="string_regist_grade">年级</string>
16 <string name="string_regist_school">学校</string> 16 <string name="string_regist_school">学校</string>
17 <string name="string_regist_next">下一步</string> 17 <string name="string_regist_next">下一步</string>
18 <string name="string_start_page">开始学习体验</string> 18 <string name="string_start_page">开始学习体验</string>
19 <string name="bangding">绑定家长控制</string> 19 <string name="bangding">绑定家长控制</string>
20 <string name="finish">完成</string> 20 <string name="finish">完成</string>
21 <string name="account_management">账户管理</string>
22 <string name="changge_preson">修改个人信息</string>
21 23
22 //电子保卡 24 //电子保卡
23 <string name="string_electroniccard_info_title">填写保卡信息</string> 25 <string name="string_electroniccard_info_title">填写保卡信息</string>
24 <string name="string_electroniccard_info_fill">填写电子保卡</string> 26 <string name="string_electroniccard_info_fill">填写电子保卡</string>
25 <string name="change_electroniccard_info_fill">修改保卡信息</string> 27 <string name="change_electroniccard_info_fill">修改保卡信息</string>
26 <string name="string_electroniccard_info_change">修改保卡信息</string> 28 <string name="string_electroniccard_info_change">修改保卡信息</string>
27 <string name="string_electroniccard_info_ok">确认保卡信息</string> 29 <string name="string_electroniccard_info_ok">确认保卡信息</string>
28 <string name="string_electroniccard_info_look">好记星-电子报卡</string> 30 <string name="string_electroniccard_info_look">好记星-电子报卡</string>
29 <string name="string_electroniccard_change_bangding">更换绑定</string> 31 <string name="string_electroniccard_change_bangding">更换绑定</string>
30 <string name="electronic_card">温馨提示:若您想修改的相关信息请拨打客服电话</string> 32 <string name="electronic_card">温馨提示:若您想修改的相关信息请拨打客服电话</string>
31 <string name="electronic_card1">请先填写《好记星-电子保卡》信息</string> 33 <string name="electronic_card1">请先填写《好记星-电子保卡》信息</string>
32 <string name="electronic_card2">该信息是本产品的三包证明,为维护您的合法权益,请认真填写</string> 34 <string name="electronic_card2">该信息是本产品的三包证明,为维护您的合法权益,请认真填写</string>
33 <string name="electronic_card3">您已填写完《好记星-电子保卡》信息</string> 35 <string name="electronic_card3">您已填写完《好记星-电子保卡》信息</string>
34 <string name="electronic_card4">您也可以设置家长管理,用手机及时了解和管理孩子的学习情况</string> 36 <string name="electronic_card4">您也可以设置家长管理,用手机及时了解和管理孩子的学习情况</string>
35 37
36 //意见反馈 38 //意见反馈
37 <string name="feedback">写下您对我们产品的意见吧,我们将努力完善,最多输入500字。</string> 39 <string name="feedback">写下您对我们产品的意见吧,我们将努力完善,最多输入500字。</string>
38 <string name="qq">QQ或手机号码</string> 40 <string name="qq">QQ或手机号码</string>
39 <string name="hint">留下您的联系方式,方便与您沟通。</string> 41 <string name="hint">留下您的联系方式,方便与您沟通。</string>
40 42
41 43
44 //个人中心
45 <string name="titel_preson">个人中心</string>
46
47
42 48
43 </resources> 49 </resources>
44 50
PersonalCenter/pickerview/src/main/java/com/bigkoo/pickerview/OptionsPickerView.java
1 package com.bigkoo.pickerview; 1 package com.bigkoo.pickerview;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.graphics.Typeface; 4 import android.graphics.Typeface;
5 import android.text.TextUtils; 5 import android.text.TextUtils;
6 import android.view.LayoutInflater; 6 import android.view.LayoutInflater;
7 import android.view.View; 7 import android.view.View;
8 import android.view.ViewGroup; 8 import android.view.ViewGroup;
9 import android.widget.Button; 9 import android.widget.Button;
10 import android.widget.LinearLayout; 10 import android.widget.LinearLayout;
11 import android.widget.RelativeLayout; 11 import android.widget.RelativeLayout;
12 import android.widget.TextView; 12 import android.widget.TextView;
13 13
14 import com.bigkoo.pickerview.lib.WheelView; 14 import com.bigkoo.pickerview.lib.WheelView;
15 import com.bigkoo.pickerview.listener.CustomListener; 15 import com.bigkoo.pickerview.listener.CustomListener;
16 import com.bigkoo.pickerview.view.BasePickerView; 16 import com.bigkoo.pickerview.view.BasePickerView;
17 import com.bigkoo.pickerview.view.WheelOptions; 17 import com.bigkoo.pickerview.view.WheelOptions;
18 18
19 import java.util.List; 19 import java.util.List;
20 20
21 /** 21 /**
22 * 条件选择器 22 * 条件选择器
23 * Created by Sai on 15/11/22. 23 * Created by Sai on 15/11/22.
24 */ 24 */
25 public class OptionsPickerView<T> extends BasePickerView implements View.OnClickListener { 25 public class OptionsPickerView<T> extends BasePickerView implements View.OnClickListener {
26 26
27 WheelOptions<T> wheelOptions; 27 WheelOptions<T> wheelOptions;
28 private int layoutRes; 28 private int layoutRes;
29 private CustomListener customListener; 29 private CustomListener customListener;
30 private Button btnSubmit, btnCancel; //确定、取消按钮 30 private Button btnSubmit, btnCancel; //确定、取消按钮
31 private TextView tvTitle; 31 private TextView tvTitle;
32 private RelativeLayout rv_top_bar; 32 private RelativeLayout rv_top_bar;
33 33
34 private static final String TAG_SUBMIT = "submit"; 34 private static final String TAG_SUBMIT = "submit";
35 private static final String TAG_CANCEL = "cancel"; 35 private static final String TAG_CANCEL = "cancel";
36 36
37 private OnOptionsSelectListener optionsSelectListener; 37 private OnOptionsSelectListener optionsSelectListener;
38 38
39 private String Str_Submit;//确定按钮文字 39 private String Str_Submit;//确定按钮文字
40 private String Str_Cancel;//取消按钮文字 40 private String Str_Cancel;//取消按钮文字
41 private String Str_Title;//标题文字 41 private String Str_Title;//标题文字
42 42
43 private int Color_Submit;//确定按钮颜色 43 private int Color_Submit;//确定按钮颜色
44 private int Color_Cancel;//取消按钮颜色 44 private int Color_Cancel;//取消按钮颜色
45 private int Color_Title;//标题颜色 45 private int Color_Title;//标题颜色
46 46
47 private int Color_Background_Wheel;//滚轮背景颜色 47 private int Color_Background_Wheel;//滚轮背景颜色
48 private int Color_Background_Title;//标题背景颜色 48 private int Color_Background_Title;//标题背景颜色
49 49
50 private int Size_Submit_Cancel;//确定取消按钮大小 50 private int Size_Submit_Cancel;//确定取消按钮大小
51 private int Size_Title;//标题文字大小 51 private int Size_Title;//标题文字大小
52 private int Size_Content;//内容文字大小 52 private int Size_Content;//内容文字大小
53 53
54 private int textColorOut; //分割线以外的文字颜色 54 private int textColorOut; //分割线以外的文字颜色
55 private int textColorCenter; //分割线之间的文字颜色 55 private int textColorCenter; //分割线之间的文字颜色
56 private int dividerColor; //分割线的颜色 56 private int dividerColor; //分割线的颜色
57 private int backgroundId; //显示时的外部背景色颜色,默认是灰色 57 private int backgroundId; //显示时的外部背景色颜色,默认是灰色
58 // 条目间距倍数 默认1.6 58 // 条目间距倍数 默认1.6
59 private float lineSpacingMultiplier = 1.6F; 59 private float lineSpacingMultiplier = 1.6F;
60 private boolean isDialog;//是否是对话框模式 60 private boolean isDialog;//是否是对话框模式
61 61
62 private boolean cancelable;//是否能取消 62 private boolean cancelable;//是否能取消
63 private boolean linkage;//是否联动 63 private boolean linkage;//是否联动
64 64
65 private boolean isCenterLabel ;//是否只显示中间的label 65 private boolean isCenterLabel ;//是否只显示中间的label
66 66
67 private String label1;//单位 67 private String label1;//单位
68 private String label2; 68 private String label2;
69 private String label3; 69 private String label3;
70 70
71 private boolean cyclic1;//是否循环 71 private boolean cyclic1;//是否循环
72 private boolean cyclic2; 72 private boolean cyclic2;
73 private boolean cyclic3; 73 private boolean cyclic3;
74 74
75 private Typeface font;//字体样式 75 private Typeface font;//字体样式
76 76
77 private int option1;//默认选中项 77 private int option1;//默认选中项
78 private int option2; 78 private int option2;
79 private int option3; 79 private int option3;
80 private WheelView.DividerType dividerType;//分隔线类型 80 private WheelView.DividerType dividerType;//分隔线类型
81 81
82 //构造方法 82 //构造方法
83 public OptionsPickerView(Builder builder) { 83 public OptionsPickerView(Builder builder) {
84 super(builder.context); 84 super(builder.context);
85 this.optionsSelectListener = builder.optionsSelectListener; 85 this.optionsSelectListener = builder.optionsSelectListener;
86 this.Str_Submit = builder.Str_Submit; 86 this.Str_Submit = builder.Str_Submit;
87 this.Str_Cancel = builder.Str_Cancel; 87 this.Str_Cancel = builder.Str_Cancel;
88 this.Str_Title = builder.Str_Title; 88 this.Str_Title = builder.Str_Title;
89 89
90 this.Color_Submit = builder.Color_Submit; 90 this.Color_Submit = builder.Color_Submit;
91 this.Color_Cancel = builder.Color_Cancel; 91 this.Color_Cancel = builder.Color_Cancel;
92 this.Color_Title = builder.Color_Title; 92 this.Color_Title = builder.Color_Title;
93 this.Color_Background_Wheel = builder.Color_Background_Wheel; 93 this.Color_Background_Wheel = builder.Color_Background_Wheel;
94 this.Color_Background_Title = builder.Color_Background_Title; 94 this.Color_Background_Title = builder.Color_Background_Title;
95 95
96 this.Size_Submit_Cancel = builder.Size_Submit_Cancel; 96 this.Size_Submit_Cancel = builder.Size_Submit_Cancel;
97 this.Size_Title = builder.Size_Title; 97 this.Size_Title = builder.Size_Title;
98 this.Size_Content = builder.Size_Content; 98 this.Size_Content = builder.Size_Content;
99 99
100 this.cyclic1 = builder.cyclic1; 100 this.cyclic1 = builder.cyclic1;
101 this.cyclic2 = builder.cyclic2; 101 this.cyclic2 = builder.cyclic2;
102 this.cyclic3 = builder.cyclic3; 102 this.cyclic3 = builder.cyclic3;
103 103
104 this.cancelable = builder.cancelable; 104 this.cancelable = builder.cancelable;
105 this.linkage = builder.linkage; 105 this.linkage = builder.linkage;
106 this.isCenterLabel = builder.isCenterLabel; 106 this.isCenterLabel = builder.isCenterLabel;
107 107
108 this.label1 = builder.label1; 108 this.label1 = builder.label1;
109 this.label2 = builder.label2; 109 this.label2 = builder.label2;
110 this.label3 = builder.label3; 110 this.label3 = builder.label3;
111 111
112 this.font = builder.font; 112 this.font = builder.font;
113 113
114 114
115 this.option1 = builder.option1; 115 this.option1 = builder.option1;
116 this.option2 = builder.option2; 116 this.option2 = builder.option2;
117 this.option3 = builder.option3; 117 this.option3 = builder.option3;
118 this.textColorCenter = builder.textColorCenter; 118 this.textColorCenter = builder.textColorCenter;
119 this.textColorOut = builder.textColorOut; 119 this.textColorOut = builder.textColorOut;
120 this.dividerColor = builder.dividerColor; 120 this.dividerColor = builder.dividerColor;
121 this.lineSpacingMultiplier = builder.lineSpacingMultiplier; 121 this.lineSpacingMultiplier = builder.lineSpacingMultiplier;
122 this.customListener = builder.customListener; 122 this.customListener = builder.customListener;
123 this.layoutRes = builder.layoutRes; 123 this.layoutRes = builder.layoutRes;
124 this.isDialog = builder.isDialog; 124 this.isDialog = builder.isDialog;
125 this.dividerType = builder.dividerType; 125 this.dividerType = builder.dividerType;
126 this.backgroundId = builder.backgroundId; 126 this.backgroundId = builder.backgroundId;
127 this.decorView = builder.decorView; 127 this.decorView = builder.decorView;
128 initView(builder.context); 128 initView(builder.context);
129 } 129 }
130 130
131 131
132 //建造器 132 //建造器
133 public static class Builder { 133 public static class Builder {
134 private int layoutRes = R.layout.pickerview_options; 134 private int layoutRes = R.layout.pickerview_options;
135 private CustomListener customListener; 135 private CustomListener customListener;
136 private Context context; 136 private Context context;
137 private OnOptionsSelectListener optionsSelectListener; 137 private OnOptionsSelectListener optionsSelectListener;
138 138
139 private String Str_Submit;//确定按钮文字 139 private String Str_Submit;//确定按钮文字
140 private String Str_Cancel;//取消按钮文字 140 private String Str_Cancel;//取消按钮文字
141 private String Str_Title;//标题文字 141 private String Str_Title;//标题文字
142 142
143 private int Color_Submit;//确定按钮颜色 143 private int Color_Submit;//确定按钮颜色
144 private int Color_Cancel;//取消按钮颜色 144 private int Color_Cancel;//取消按钮颜色
145 private int Color_Title;//标题颜色 145 private int Color_Title;//标题颜色
146 146
147 private int Color_Background_Wheel;//滚轮背景颜色 147 private int Color_Background_Wheel;//滚轮背景颜色
148 private int Color_Background_Title;//标题背景颜色 148 private int Color_Background_Title;//标题背景颜色
149 149
150 private int Size_Submit_Cancel = 17;//确定取消按钮大小 150 private int Size_Submit_Cancel = 17;//确定取消按钮大小
151 private int Size_Title = 18;//标题文字大小 151 private int Size_Title = 18;//标题文字大小
152 private int Size_Content = 18;//内容文字大小 152 private int Size_Content = 18;//内容文字大小
153 153
154 private boolean cancelable = true;//是否能取消 154 private boolean cancelable = true;//是否能取消
155 private boolean linkage = true;//是否联动 155 private boolean linkage = true;//是否联动
156 private boolean isCenterLabel = true;//是否只显示中间的label 156 private boolean isCenterLabel = true;//是否只显示中间的label
157 157
158 private int textColorOut; //分割线以外的文字颜色 158 private int textColorOut; //分割线以外的文字颜色
159 private int textColorCenter; //分割线之间的文字颜色 159 private int textColorCenter; //分割线之间的文字颜色
160 private int dividerColor; //分割线的颜色 160 private int dividerColor; //分割线的颜色
161 private int backgroundId; //显示时的外部背景色颜色,默认是灰色 161 private int backgroundId; //显示时的外部背景色颜色,默认是灰色
162 public ViewGroup decorView ;//显示pickerview的根View,默认是activity的根view 162 public ViewGroup decorView ;//显示pickerview的根View,默认是activity的根view
163 // 条目间距倍数 默认1.6 163 // 条目间距倍数 默认1.6
164 private float lineSpacingMultiplier = 1.6F; 164 private float lineSpacingMultiplier = 1.6F;
165 private boolean isDialog;//是否是对话框模式 165 private boolean isDialog;//是否是对话框模式
166 166
167 private String label1; 167 private String label1;
168 private String label2; 168 private String label2;
169 private String label3; 169 private String label3;
170 170
171 private boolean cyclic1 = false;//是否循环,默认否 171 private boolean cyclic1 = false;//是否循环,默认否
172 private boolean cyclic2 = false; 172 private boolean cyclic2 = false;
173 private boolean cyclic3 = false; 173 private boolean cyclic3 = false;
174 174
175 private Typeface font; 175 private Typeface font;
176 176
177 private int option1;//默认选中项 177 private int option1;//默认选中项
178 private int option2; 178 private int option2;
179 private int option3; 179 private int option3;
180 180
181 private WheelView.DividerType dividerType;//分隔线类型 181 private WheelView.DividerType dividerType;//分隔线类型
182 182
183 //Required 183 //Required
184 public Builder(Context context, OnOptionsSelectListener listener) { 184 public Builder(Context context, OnOptionsSelectListener listener) {
185 this.context = context; 185 this.context = context;
186 this.optionsSelectListener = listener; 186 this.optionsSelectListener = listener;
187 } 187 }
188 188
189 //Option 189 //Option
190 190
191 public Builder setSubmitText(String Str_Cancel) { 191 public Builder setSubmitText(String Str_Cancel) {
192 this.Str_Submit = Str_Cancel; 192 this.Str_Submit = Str_Cancel;
193 return this; 193 return this;
194 } 194 }
195 195
196 public Builder setCancelText(String Str_Cancel) { 196 public Builder setCancelText(String Str_Cancel) {
197 this.Str_Cancel = Str_Cancel; 197 this.Str_Cancel = Str_Cancel;
198 return this; 198 return this;
199 } 199 }
200 200
201 public Builder setTitleText(String Str_Title) { 201 public Builder setTitleText(String Str_Title) {
202 this.Str_Title = Str_Title; 202 this.Str_Title = Str_Title;
203 return this; 203 return this;
204 } 204 }
205 205
206 public Builder isDialog(boolean isDialog) { 206 public Builder isDialog(boolean isDialog) {
207 this.isDialog = isDialog; 207 this.isDialog = isDialog;
208 return this; 208 return this;
209 } 209 }
210 210
211 public Builder setSubmitColor(int Color_Submit) { 211 public Builder setSubmitColor(int Color_Submit) {
212 this.Color_Submit = Color_Submit; 212 this.Color_Submit = Color_Submit;
213 return this; 213 return this;
214 } 214 }
215 215
216 public Builder setCancelColor(int Color_Cancel) { 216 public Builder setCancelColor(int Color_Cancel) {
217 this.Color_Cancel = Color_Cancel; 217 this.Color_Cancel = Color_Cancel;
218 return this; 218 return this;
219 } 219 }
220 220
221 /** 221 /**
222 * 显示时的外部背景色颜色,默认是灰色 222 * 显示时的外部背景色颜色,默认是灰色
223 * @param backgroundId 223 * @param backgroundId
224 * @return 224 * @return
225 */ 225 */
226 public Builder setBackgroundId(int backgroundId) { 226 public Builder setBackgroundId(int backgroundId) {
227 this.backgroundId = backgroundId; 227 this.backgroundId = backgroundId;
228 return this; 228 return this;
229 } 229 }
230 /** 230 /**
231 * 必须是viewgroup 231 * 必须是viewgroup
232 * 设置要将pickerview显示到的容器 232 * 设置要将pickerview显示到的容器
233 * @param decorView 233 * @param decorView
234 * @return 234 * @return
235 */ 235 */
236 public Builder setDecorView(ViewGroup decorView) { 236 public Builder setDecorView(ViewGroup decorView) {
237 this.decorView = decorView; 237 this.decorView = decorView;
238 return this; 238 return this;
239 } 239 }
240 240
241 241
242 242
243 243
244 public Builder setLayoutRes(int res, CustomListener listener) { 244 public Builder setLayoutRes(int res, CustomListener listener) {
245 this.layoutRes = res; 245 this.layoutRes = res;
246 this.customListener = listener; 246 this.customListener = listener;
247 return this; 247 return this;
248 } 248 }
249 249
250 public Builder setBgColor(int Color_Background_Wheel) { 250 public Builder setBgColor(int Color_Background_Wheel) {
251 this.Color_Background_Wheel = Color_Background_Wheel; 251 this.Color_Background_Wheel = Color_Background_Wheel;
252 return this; 252 return this;
253 } 253 }
254 254
255 public Builder setTitleBgColor(int Color_Background_Title) { 255 public Builder setTitleBgColor(int Color_Background_Title) {
256 this.Color_Background_Title = Color_Background_Title; 256 this.Color_Background_Title = Color_Background_Title;
257 return this; 257 return this;
258 } 258 }
259 259
260 public Builder setTitleColor(int Color_Title) { 260 public Builder setTitleColor(int Color_Title) {
261 this.Color_Title = Color_Title; 261 this.Color_Title = Color_Title;
262 return this; 262 return this;
263 } 263 }
264 264
265 public Builder setSubCalSize(int Size_Submit_Cancel) { 265 public Builder setSubCalSize(int Size_Submit_Cancel) {
266 this.Size_Submit_Cancel = Size_Submit_Cancel; 266 this.Size_Submit_Cancel = Size_Submit_Cancel;
267 return this; 267 return this;
268 } 268 }
269 269
270 public Builder setTitleSize(int Size_Title) { 270 public Builder setTitleSize(int Size_Title) {
271 this.Size_Title = Size_Title; 271 this.Size_Title = Size_Title;
272 return this; 272 return this;
273 } 273 }
274 274
275 public Builder setContentTextSize(int Size_Content) { 275 public Builder setContentTextSize(int Size_Content) {
276 this.Size_Content = Size_Content; 276 this.Size_Content = Size_Content;
277 return this; 277 return this;
278 } 278 }
279 279
280 280
281 public Builder setOutSideCancelable(boolean cancelable) { 281 public Builder setOutSideCancelable(boolean cancelable) {
282 this.cancelable = cancelable; 282 this.cancelable = cancelable;
283 return this; 283 return this;
284 } 284 }
285 285
286 /** 286 /**
287 * 此方法已废弃 287 * 此方法已废弃
288 * 不联动的情况下,请调用 setNPicker 方法。 288 * 不联动的情况下,请调用 setNPicker 方法。
289 * */ 289 * */
290 @Deprecated 290 @Deprecated
291 public Builder setLinkage(boolean linkage) { 291 public Builder setLinkage(boolean linkage) {
292 this.linkage = linkage; 292 this.linkage = linkage;
293 return this; 293 return this;
294 } 294 }
295 295
296 public Builder setLabels(String label1, String label2, String label3) { 296 public Builder setLabels(String label1, String label2, String label3) {
297 this.label1 = label1; 297 this.label1 = label1;
298 this.label2 = label2; 298 this.label2 = label2;
299 this.label3 = label3; 299 this.label3 = label3;
300 return this; 300 return this;
301 } 301 }
302 302
303 /** 303 /**
304 * 设置间距倍数,但是只能在1.2-2.0f之间 304 * 设置间距倍数,但是只能在1.2-2.0f之间
305 * 305 *
306 * @param lineSpacingMultiplier 306 * @param lineSpacingMultiplier
307 */ 307 */
308 public Builder setLineSpacingMultiplier(float lineSpacingMultiplier) { 308 public Builder setLineSpacingMultiplier(float lineSpacingMultiplier) {
309 this.lineSpacingMultiplier = lineSpacingMultiplier; 309 this.lineSpacingMultiplier = lineSpacingMultiplier;
310 return this; 310 return this;
311 } 311 }
312 312
313 /** 313 /**
314 * 设置分割线的颜色 314 * 设置分割线的颜色
315 * 315 *
316 * @param dividerColor 316 * @param dividerColor
317 */ 317 */
318 public Builder setDividerColor(int dividerColor) { 318 public Builder setDividerColor(int dividerColor) {
319 this.dividerColor = dividerColor; 319 this.dividerColor = dividerColor;
320 return this; 320 return this;
321 } 321 }
322 322
323 /** 323 /**
324 * 设置分割线的类型 324 * 设置分割线的类型
325 * 325 *
326 * @param dividerType 326 * @param dividerType
327 */ 327 */
328 public Builder setDividerType(WheelView.DividerType dividerType) { 328 public Builder setDividerType(WheelView.DividerType dividerType) {
329 this.dividerType = dividerType; 329 this.dividerType = dividerType;
330 return this; 330 return this;
331 } 331 }
332 332
333 /** 333 /**
334 * 设置分割线之间的文字的颜色 334 * 设置分割线之间的文字的颜色
335 * 335 *
336 * @param textColorCenter 336 * @param textColorCenter
337 */ 337 */
338 public Builder setTextColorCenter(int textColorCenter) { 338 public Builder setTextColorCenter(int textColorCenter) {
339 this.textColorCenter = textColorCenter; 339 this.textColorCenter = textColorCenter;
340 return this; 340 return this;
341 } 341 }
342 342
343 /** 343 /**
344 * 设置分割线以外文字的颜色 344 * 设置分割线以外文字的颜色
345 * 345 *
346 * @param textColorOut 346 * @param textColorOut
347 */ 347 */
348 public Builder setTextColorOut(int textColorOut) { 348 public Builder setTextColorOut(int textColorOut) {
349 this.textColorOut = textColorOut; 349 this.textColorOut = textColorOut;
350 return this; 350 return this;
351 } 351 }
352 352
353 public Builder setTypeface(Typeface font) { 353 public Builder setTypeface(Typeface font) {
354 this.font = font; 354 this.font = font;
355 return this; 355 return this;
356 } 356 }
357 357
358 public Builder setCyclic(boolean cyclic1, boolean cyclic2, boolean cyclic3) { 358 public Builder setCyclic(boolean cyclic1, boolean cyclic2, boolean cyclic3) {
359 this.cyclic1 = cyclic1; 359 this.cyclic1 = cyclic1;
360 this.cyclic2 = cyclic2; 360 this.cyclic2 = cyclic2;
361 this.cyclic3 = cyclic3; 361 this.cyclic3 = cyclic3;
362 return this; 362 return this;
363 } 363 }
364 364
365 public Builder setSelectOptions(int option1) { 365 public Builder setSelectOptions(int option1) {
366 this.option1 = option1; 366 this.option1 = option1;
367 return this; 367 return this;
368 } 368 }
369 369
370 public Builder setSelectOptions(int option1, int option2) { 370 public Builder setSelectOptions(int option1, int option2) {
371 this.option1 = option1; 371 this.option1 = option1;
372 this.option2 = option2; 372 this.option2 = option2;
373 return this; 373 return this;
374 } 374 }
375 375
376 public Builder setSelectOptions(int option1, int option2, int option3) { 376 public Builder setSelectOptions(int option1, int option2, int option3) {
377 this.option1 = option1; 377 this.option1 = option1;
378 this.option2 = option2; 378 this.option2 = option2;
379 this.option3 = option3; 379 this.option3 = option3;
380 return this; 380 return this;
381 } 381 }
382 382
383 public Builder isCenterLabel(boolean isCenterLabel) { 383 public Builder isCenterLabel(boolean isCenterLabel) {
384 this.isCenterLabel = isCenterLabel; 384 this.isCenterLabel = isCenterLabel;
385 return this; 385 return this;
386 } 386 }
387 387
388 public OptionsPickerView build() { 388 public OptionsPickerView build() {
389 return new OptionsPickerView(this); 389 return new OptionsPickerView(this);
390 } 390 }
391 } 391 }
392 392
393 393
394 private void initView(Context context) { 394 private void initView(Context context) {
395 setDialogOutSideCancelable(cancelable); 395 setDialogOutSideCancelable(cancelable);
396 initViews(backgroundId); 396 initViews(backgroundId);
397 init(); 397 init();
398 initEvents(); 398 initEvents();
399 if (customListener == null) { 399 if (customListener == null) {
400 LayoutInflater.from(context).inflate(layoutRes, contentContainer); 400 LayoutInflater.from(context).inflate(layoutRes, contentContainer);
401 401
402 //顶部标题 402 //顶部标题
403 tvTitle = (TextView) findViewById(R.id.tvTitle); 403 tvTitle = (TextView) findViewById(R.id.tvTitle);
404 rv_top_bar = (RelativeLayout)findViewById(R.id.rv_topbar); 404 rv_top_bar = (RelativeLayout)findViewById(R.id.rv_topbar);
405 405
406 //确定和取消按钮 406 //确定和取消按钮
407 btnSubmit = (Button) findViewById(R.id.btnSubmit); 407 btnSubmit = (Button) findViewById(R.id.btnSubmit);
408 btnCancel = (Button) findViewById(R.id.btnCancel); 408 btnCancel = (Button) findViewById(R.id.btnCancel);
409 409
410 btnSubmit.setTag(TAG_SUBMIT); 410 btnSubmit.setTag(TAG_SUBMIT);
411 btnCancel.setTag(TAG_CANCEL); 411 btnCancel.setTag(TAG_CANCEL);
412 btnSubmit.setOnClickListener(this); 412 btnSubmit.setOnClickListener(this);
413 btnCancel.setOnClickListener(this); 413 btnCancel.setOnClickListener(this);
414 414
415 //设置文字 415 //设置文字
416 btnSubmit.setText(TextUtils.isEmpty(Str_Submit) ? context.getResources().getString(R.string.pickerview_submit) : Str_Submit); 416 btnSubmit.setText(TextUtils.isEmpty(Str_Submit) ? context.getResources().getString(R.string.pickerview_submit) : Str_Submit);
417 btnCancel.setText(TextUtils.isEmpty(Str_Cancel) ? context.getResources().getString(R.string.pickerview_cancel) : Str_Cancel); 417 btnCancel.setText(TextUtils.isEmpty(Str_Cancel) ? context.getResources().getString(R.string.pickerview_cancel) : Str_Cancel);
418 tvTitle.setText(TextUtils.isEmpty(Str_Title) ? "" : Str_Title);//默认为空 418 tvTitle.setText(TextUtils.isEmpty(Str_Title) ? "" : Str_Title);//默认为空
419 419
420 //设置color 420 //设置color
421 btnSubmit.setTextColor(Color_Submit == 0 ? pickerview_timebtn_nor : Color_Submit); 421 // btnSubmit.setTextColor(Color_Submit == 0 ? pickerview_timebtn_nor : Color_Submit);
422 btnCancel.setTextColor(Color_Cancel == 0 ? pickerview_timebtn_nor : Color_Cancel); 422 // btnCancel.setTextColor(Color_Cancel == 0 ? pickerview_timebtn_nor : Color_Cancel);
423 tvTitle.setTextColor(Color_Title == 0 ? pickerview_topbar_title : Color_Title); 423 tvTitle.setTextColor(Color_Title == 0 ? pickerview_topbar_title : Color_Title);
424 rv_top_bar.setBackgroundColor(Color_Background_Title == 0 ? pickerview_bg_topbar : Color_Background_Title); 424 rv_top_bar.setBackgroundColor(Color_Background_Title == 0 ? pickerview_bg_topbar : Color_Background_Title);
425 425
426 //设置文字大小 426 //设置文字大小
427 btnSubmit.setTextSize(Size_Submit_Cancel); 427 btnSubmit.setTextSize(Size_Submit_Cancel);
428 btnCancel.setTextSize(Size_Submit_Cancel); 428 btnCancel.setTextSize(Size_Submit_Cancel);
429 tvTitle.setTextSize(Size_Title); 429 tvTitle.setTextSize(Size_Title);
430 tvTitle.setText(Str_Title); 430 tvTitle.setText(Str_Title);
431 } else { 431 } else {
432 customListener.customLayout(LayoutInflater.from(context).inflate(layoutRes, contentContainer)); 432 customListener.customLayout(LayoutInflater.from(context).inflate(layoutRes, contentContainer));
433 } 433 }
434 434
435 // ----滚轮布局 435 // ----滚轮布局
436 final LinearLayout optionsPicker = (LinearLayout) findViewById(R.id.optionspicker); 436 final LinearLayout optionsPicker = (LinearLayout) findViewById(R.id.optionspicker);
437 optionsPicker.setBackgroundColor(Color_Background_Wheel == 0 ? bgColor_default : Color_Background_Wheel); 437 optionsPicker.setBackgroundColor(Color_Background_Wheel == 0 ? bgColor_default : Color_Background_Wheel);
438 438
439 wheelOptions = new WheelOptions(optionsPicker, linkage); 439 wheelOptions = new WheelOptions(optionsPicker, linkage);
440 wheelOptions.setTextContentSize(Size_Content); 440 wheelOptions.setTextContentSize(Size_Content);
441 wheelOptions.setLabels(label1, label2, label3); 441 wheelOptions.setLabels(label1, label2, label3);
442 wheelOptions.setCyclic(cyclic1, cyclic2, cyclic3); 442 wheelOptions.setCyclic(cyclic1, cyclic2, cyclic3);
443 wheelOptions.setTypeface(font); 443 wheelOptions.setTypeface(font);
444 444
445 setOutSideCancelable(cancelable); 445 setOutSideCancelable(cancelable);
446 446
447 if (tvTitle!= null){ 447 if (tvTitle!= null){
448 tvTitle.setText(Str_Title); 448 tvTitle.setText(Str_Title);
449 } 449 }
450 450
451 wheelOptions.setDividerColor(dividerColor); 451 wheelOptions.setDividerColor(dividerColor);
452 wheelOptions.setDividerType(dividerType); 452 wheelOptions.setDividerType(dividerType);
453 wheelOptions.setLineSpacingMultiplier(lineSpacingMultiplier); 453 wheelOptions.setLineSpacingMultiplier(lineSpacingMultiplier);
454 wheelOptions.setTextColorOut(textColorOut); 454 wheelOptions.setTextColorOut(textColorOut);
455 wheelOptions.setTextColorCenter(textColorCenter); 455 wheelOptions.setTextColorCenter(textColorCenter);
456 wheelOptions.isCenterLabel(isCenterLabel); 456 wheelOptions.isCenterLabel(isCenterLabel);
457 457
458 } 458 }
459 459
460 460
461 /** 461 /**
462 * 设置默认选中项 462 * 设置默认选中项
463 * 463 *
464 * @param option1 464 * @param option1
465 */ 465 */
466 public void setSelectOptions(int option1) { 466 public void setSelectOptions(int option1) {
467 this.option1 = option1; 467 this.option1 = option1;
468 SetCurrentItems(); 468 SetCurrentItems();
469 } 469 }
470 470
471 471
472 public void setSelectOptions(int option1, int option2) { 472 public void setSelectOptions(int option1, int option2) {
473 this.option1 = option1; 473 this.option1 = option1;
474 this.option2 = option2; 474 this.option2 = option2;
475 SetCurrentItems(); 475 SetCurrentItems();
476 } 476 }
477 477
478 public void setSelectOptions(int option1, int option2, int option3) { 478 public void setSelectOptions(int option1, int option2, int option3) {
479 this.option1 = option1; 479 this.option1 = option1;
480 this.option2 = option2; 480 this.option2 = option2;
481 this.option3 = option3; 481 this.option3 = option3;
482 SetCurrentItems(); 482 SetCurrentItems();
483 } 483 }
484 484
485 private void SetCurrentItems() { 485 private void SetCurrentItems() {
486 if(wheelOptions!=null){ 486 if(wheelOptions!=null){
487 wheelOptions.setCurrentItems(option1, option2, option3); 487 wheelOptions.setCurrentItems(option1, option2, option3);
488 } 488 }
489 } 489 }
490 490
491 public void setPicker(List<T> optionsItems) { 491 public void setPicker(List<T> optionsItems) {
492 this.setPicker(optionsItems, null, null); 492 this.setPicker(optionsItems, null, null);
493 } 493 }
494 494
495 public void setPicker(List<T> options1Items, List<List<T>> options2Items) { 495 public void setPicker(List<T> options1Items, List<List<T>> options2Items) {
496 this.setPicker(options1Items, options2Items, null); 496 this.setPicker(options1Items, options2Items, null);
497 } 497 }
498 498
499 public void setPicker(List<T> options1Items, 499 public void setPicker(List<T> options1Items,
500 List<List<T>> options2Items, 500 List<List<T>> options2Items,
501 List<List<List<T>>> options3Items) { 501 List<List<List<T>>> options3Items) {
502 502
503 wheelOptions.setPicker(options1Items, options2Items, options3Items); 503 wheelOptions.setPicker(options1Items, options2Items, options3Items);
504 SetCurrentItems(); 504 SetCurrentItems();
505 } 505 }
506 506
507 507
508 //不联动情况下调用 508 //不联动情况下调用
509 public void setNPicker(List<T> options1Items, 509 public void setNPicker(List<T> options1Items,
510 List<T> options2Items, 510 List<T> options2Items,
511 List<T> options3Items) { 511 List<T> options3Items) {
512 512
513 wheelOptions.setNPicker(options1Items, options2Items, options3Items); 513 wheelOptions.setNPicker(options1Items, options2Items, options3Items);
514 SetCurrentItems(); 514 SetCurrentItems();
515 } 515 }
516 516
517 @Override 517 @Override
518 public void onClick(View v) { 518 public void onClick(View v) {
519 String tag = (String) v.getTag(); 519 String tag = (String) v.getTag();
520 if (tag.equals(TAG_SUBMIT)) { 520 if (tag.equals(TAG_SUBMIT)) {
521 returnData(); 521 returnData();
522 } 522 }
523 dismiss(); 523 dismiss();
524 } 524 }
525 525
526 //抽离接口回调的方法 526 //抽离接口回调的方法
527 public void returnData() { 527 public void returnData() {
528 if (optionsSelectListener != null) { 528 if (optionsSelectListener != null) {
529 int[] optionsCurrentItems = wheelOptions.getCurrentItems(); 529 int[] optionsCurrentItems = wheelOptions.getCurrentItems();
530 optionsSelectListener.onOptionsSelect(optionsCurrentItems[0], optionsCurrentItems[1], optionsCurrentItems[2], clickView); 530 optionsSelectListener.onOptionsSelect(optionsCurrentItems[0], optionsCurrentItems[1], optionsCurrentItems[2], clickView);
531 } 531 }
532 } 532 }
533 533
534 public interface OnOptionsSelectListener { 534 public interface OnOptionsSelectListener {
535 void onOptionsSelect(int options1, int options2, int options3, View v); 535 void onOptionsSelect(int options1, int options2, int options3, View v);
536 } 536 }
537 537
538 @Override 538 @Override
539 public boolean isDialog() { 539 public boolean isDialog() {
540 return isDialog; 540 return isDialog;
541 } 541 }
542 } 542 }
543 543
PersonalCenter/pickerview/src/main/java/com/bigkoo/pickerview/TimePickerView.java
1 package com.bigkoo.pickerview; 1 package com.bigkoo.pickerview;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.text.TextUtils; 4 import android.text.TextUtils;
5 import android.view.Gravity; 5 import android.view.Gravity;
6 import android.view.LayoutInflater; 6 import android.view.LayoutInflater;
7 import android.view.View; 7 import android.view.View;
8 import android.view.ViewGroup; 8 import android.view.ViewGroup;
9 import android.widget.Button; 9 import android.widget.Button;
10 import android.widget.LinearLayout; 10 import android.widget.LinearLayout;
11 import android.widget.RelativeLayout; 11 import android.widget.RelativeLayout;
12 import android.widget.TextView; 12 import android.widget.TextView;
13 13
14 import com.bigkoo.pickerview.lib.WheelView; 14 import com.bigkoo.pickerview.lib.WheelView;
15 import com.bigkoo.pickerview.listener.CustomListener; 15 import com.bigkoo.pickerview.listener.CustomListener;
16 import com.bigkoo.pickerview.view.BasePickerView; 16 import com.bigkoo.pickerview.view.BasePickerView;
17 import com.bigkoo.pickerview.view.WheelTime; 17 import com.bigkoo.pickerview.view.WheelTime;
18 18
19 import java.text.ParseException; 19 import java.text.ParseException;
20 import java.util.Calendar; 20 import java.util.Calendar;
21 import java.util.Date; 21 import java.util.Date;
22 22
23 /** 23 /**
24 * 时间选择器 24 * 时间选择器
25 * Created by Sai on 15/11/22. 25 * Created by Sai on 15/11/22.
26 * Updated by XiaoSong on 2017-2-22. 26 * Updated by XiaoSong on 2017-2-22.
27 */ 27 */
28 public class TimePickerView extends BasePickerView implements View.OnClickListener { 28 public class TimePickerView extends BasePickerView implements View.OnClickListener {
29 private int layoutRes; 29 private int layoutRes;
30 private CustomListener customListener; 30 private CustomListener customListener;
31 31
32 WheelTime wheelTime; //自定义控件 32 WheelTime wheelTime; //自定义控件
33 private Button btnSubmit, btnCancel; //确定、取消按钮 33 private Button btnSubmit, btnCancel; //确定、取消按钮
34 private TextView tvTitle;//标题 34 private TextView tvTitle;//标题
35 private OnTimeSelectListener timeSelectListener;//回调接口 35 private OnTimeSelectListener timeSelectListener;//回调接口
36 private int gravity = Gravity.CENTER;//内容显示位置 默认居中 36 private int gravity = Gravity.CENTER;//内容显示位置 默认居中
37 private boolean[] type;// 显示类型 37 private boolean[] type;// 显示类型
38 38
39 private String Str_Submit;//确定按钮字符串 39 private String Str_Submit;//确定按钮字符串
40 private String Str_Cancel;//取消按钮字符串 40 private String Str_Cancel;//取消按钮字符串
41 private String Str_Title;//标题字符串 41 private String Str_Title;//标题字符串
42 42
43 private int Color_Submit;//确定按钮颜色 43 private int Color_Submit;//确定按钮颜色
44 private int Color_Cancel;//取消按钮颜色 44 private int Color_Cancel;//取消按钮颜色
45 private int Color_Title;//标题颜色 45 private int Color_Title;//标题颜色
46 46
47 private int Color_Background_Wheel;//滚轮背景颜色 47 private int Color_Background_Wheel;//滚轮背景颜色
48 private int Color_Background_Title;//标题背景颜色 48 private int Color_Background_Title;//标题背景颜色
49 49
50 private int Size_Submit_Cancel;//确定取消按钮大小 50 private int Size_Submit_Cancel;//确定取消按钮大小
51 private int Size_Title;//标题字体大小 51 private int Size_Title;//标题字体大小
52 private int Size_Content;//内容字体大小 52 private int Size_Content;//内容字体大小
53 53
54 private Calendar date;//当前选中时间 54 private Calendar date;//当前选中时间
55 private Calendar startDate;//开始时间 55 private Calendar startDate;//开始时间
56 private Calendar endDate;//终止时间 56 private Calendar endDate;//终止时间
57 private int startYear;//开始年份 57 private int startYear;//开始年份
58 private int endYear;//结尾年份 58 private int endYear;//结尾年份
59 59
60 private boolean cyclic;//是否循环 60 private boolean cyclic;//是否循环
61 private boolean cancelable;//是否能取消 61 private boolean cancelable;//是否能取消
62 private boolean isCenterLabel;//是否只显示中间的label 62 private boolean isCenterLabel;//是否只显示中间的label
63 63
64 private int textColorOut; //分割线以外的文字颜色 64 private int textColorOut; //分割线以外的文字颜色
65 private int textColorCenter; //分割线之间的文字颜色 65 private int textColorCenter; //分割线之间的文字颜色
66 private int dividerColor; //分割线的颜色 66 private int dividerColor; //分割线的颜色
67 private int backgroundId; //显示时的外部背景色颜色,默认是灰色 67 private int backgroundId; //显示时的外部背景色颜色,默认是灰色
68 68
69 // 条目间距倍数 默认1.6 69 // 条目间距倍数 默认1.6
70 private float lineSpacingMultiplier = 1.6F; 70 private float lineSpacingMultiplier = 1.6F;
71 private boolean isDialog;//是否是对话框模式 71 private boolean isDialog;//是否是对话框模式
72 private String label_year, label_month, label_day, label_hours, label_mins, label_seconds; 72 private String label_year, label_month, label_day, label_hours, label_mins, label_seconds;
73 private WheelView.DividerType dividerType;//分隔线类型 73 private WheelView.DividerType dividerType;//分隔线类型
74 74
75 private static final String TAG_SUBMIT = "submit"; 75 private static final String TAG_SUBMIT = "submit";
76 private static final String TAG_CANCEL = "cancel"; 76 private static final String TAG_CANCEL = "cancel";
77 77
78 //构造方法 78 //构造方法
79 public TimePickerView(Builder builder) { 79 public TimePickerView(Builder builder) {
80 super(builder.context); 80 super(builder.context);
81 this.timeSelectListener = builder.timeSelectListener; 81 this.timeSelectListener = builder.timeSelectListener;
82 this.gravity = builder.gravity; 82 this.gravity = builder.gravity;
83 this.type = builder.type; 83 this.type = builder.type;
84 this.Str_Submit = builder.Str_Submit; 84 this.Str_Submit = builder.Str_Submit;
85 this.Str_Cancel = builder.Str_Cancel; 85 this.Str_Cancel = builder.Str_Cancel;
86 this.Str_Title = builder.Str_Title; 86 this.Str_Title = builder.Str_Title;
87 this.Color_Submit = builder.Color_Submit; 87 this.Color_Submit = builder.Color_Submit;
88 this.Color_Cancel = builder.Color_Cancel; 88 this.Color_Cancel = builder.Color_Cancel;
89 this.Color_Title = builder.Color_Title; 89 this.Color_Title = builder.Color_Title;
90 this.Color_Background_Wheel = builder.Color_Background_Wheel; 90 this.Color_Background_Wheel = builder.Color_Background_Wheel;
91 this.Color_Background_Title = builder.Color_Background_Title; 91 this.Color_Background_Title = builder.Color_Background_Title;
92 this.Size_Submit_Cancel = builder.Size_Submit_Cancel; 92 this.Size_Submit_Cancel = builder.Size_Submit_Cancel;
93 this.Size_Title = builder.Size_Title; 93 this.Size_Title = builder.Size_Title;
94 this.Size_Content = builder.Size_Content; 94 this.Size_Content = builder.Size_Content;
95 this.startYear = builder.startYear; 95 this.startYear = builder.startYear;
96 this.endYear = builder.endYear; 96 this.endYear = builder.endYear;
97 this.startDate = builder.startDate; 97 this.startDate = builder.startDate;
98 this.endDate = builder.endDate; 98 this.endDate = builder.endDate;
99 this.date = builder.date; 99 this.date = builder.date;
100 this.cyclic = builder.cyclic; 100 this.cyclic = builder.cyclic;
101 this.isCenterLabel = builder.isCenterLabel; 101 this.isCenterLabel = builder.isCenterLabel;
102 this.cancelable = builder.cancelable; 102 this.cancelable = builder.cancelable;
103 this.label_year = builder.label_year; 103 this.label_year = builder.label_year;
104 this.label_month = builder.label_month; 104 this.label_month = builder.label_month;
105 this.label_day = builder.label_day; 105 this.label_day = builder.label_day;
106 this.label_hours = builder.label_hours; 106 this.label_hours = builder.label_hours;
107 this.label_mins = builder.label_mins; 107 this.label_mins = builder.label_mins;
108 this.label_seconds = builder.label_seconds; 108 this.label_seconds = builder.label_seconds;
109 this.textColorCenter = builder.textColorCenter; 109 this.textColorCenter = builder.textColorCenter;
110 this.textColorOut = builder.textColorOut; 110 this.textColorOut = builder.textColorOut;
111 this.dividerColor = builder.dividerColor; 111 this.dividerColor = builder.dividerColor;
112 this.customListener = builder.customListener; 112 this.customListener = builder.customListener;
113 this.layoutRes = builder.layoutRes; 113 this.layoutRes = builder.layoutRes;
114 this.lineSpacingMultiplier = builder.lineSpacingMultiplier; 114 this.lineSpacingMultiplier = builder.lineSpacingMultiplier;
115 this.isDialog = builder.isDialog; 115 this.isDialog = builder.isDialog;
116 this.dividerType = builder.dividerType; 116 this.dividerType = builder.dividerType;
117 this.backgroundId = builder.backgroundId; 117 this.backgroundId = builder.backgroundId;
118 this.decorView = builder.decorView; 118 this.decorView = builder.decorView;
119 initView(builder.context); 119 initView(builder.context);
120 } 120 }
121 121
122 122
123 //建造器 123 //建造器
124 public static class Builder { 124 public static class Builder {
125 private int layoutRes = R.layout.pickerview_time; 125 private int layoutRes = R.layout.pickerview_time;
126 private CustomListener customListener; 126 private CustomListener customListener;
127 private Context context; 127 private Context context;
128 private OnTimeSelectListener timeSelectListener; 128 private OnTimeSelectListener timeSelectListener;
129 private boolean[] type = new boolean[]{true, true, true, true, true, true};//显示类型 默认全部显示 129 private boolean[] type = new boolean[]{true, true, true, true, true, true};//显示类型 默认全部显示
130 private int gravity = Gravity.CENTER;//内容显示位置 默认居中 130 private int gravity = Gravity.CENTER;//内容显示位置 默认居中
131 131
132 private String Str_Submit;//确定按钮文字 132 private String Str_Submit;//确定按钮文字
133 private String Str_Cancel;//取消按钮文字 133 private String Str_Cancel;//取消按钮文字
134 private String Str_Title;//标题文字 134 private String Str_Title;//标题文字
135 135
136 private int Color_Submit;//确定按钮颜色 136 private int Color_Submit;//确定按钮颜色
137 private int Color_Cancel;//取消按钮颜色 137 private int Color_Cancel;//取消按钮颜色
138 private int Color_Title;//标题颜色 138 private int Color_Title;//标题颜色
139 139
140 private int Color_Background_Wheel;//滚轮背景颜色 140 private int Color_Background_Wheel;//滚轮背景颜色
141 private int Color_Background_Title;//标题背景颜色 141 private int Color_Background_Title;//标题背景颜色
142 142
143 private int Size_Submit_Cancel = 17;//确定取消按钮大小 143 private int Size_Submit_Cancel = 17;//确定取消按钮大小
144 private int Size_Title = 18;//标题字体大小 144 private int Size_Title = 18;//标题字体大小
145 private int Size_Content = 18;//内容字体大小 145 private int Size_Content = 18;//内容字体大小
146 private Calendar date;//当前选中时间 146 private Calendar date;//当前选中时间
147 private Calendar startDate;//开始时间 147 private Calendar startDate;//开始时间
148 private Calendar endDate;//终止时间 148 private Calendar endDate;//终止时间
149 private int startYear;//开始年份 149 private int startYear;//开始年份
150 private int endYear;//结尾年份 150 private int endYear;//结尾年份
151 151
152 private boolean cyclic = false;//是否循环 152 private boolean cyclic = false;//是否循环
153 private boolean cancelable = true;//是否能取消 153 private boolean cancelable = true;//是否能取消
154 154
155 private boolean isCenterLabel = true ;//是否只显示中间的label 155 private boolean isCenterLabel = true ;//是否只显示中间的label
156 public ViewGroup decorView ;//显示pickerview的根View,默认是activity的根view 156 public ViewGroup decorView ;//显示pickerview的根View,默认是activity的根view
157 157
158 private int textColorOut; //分割线以外的文字颜色 158 private int textColorOut; //分割线以外的文字颜色
159 private int textColorCenter; //分割线之间的文字颜色 159 private int textColorCenter; //分割线之间的文字颜色
160 private int dividerColor; //分割线的颜色 160 private int dividerColor; //分割线的颜色
161 private int backgroundId; //显示时的外部背景色颜色,默认是灰色 161 private int backgroundId; //显示时的外部背景色颜色,默认是灰色
162 private WheelView.DividerType dividerType;//分隔线类型 162 private WheelView.DividerType dividerType;//分隔线类型
163 // 条目间距倍数 默认1.6 163 // 条目间距倍数 默认1.6
164 private float lineSpacingMultiplier = 1.6F; 164 private float lineSpacingMultiplier = 1.8F;
165 165
166 private boolean isDialog;//是否是对话框模式 166 private boolean isDialog;//是否是对话框模式
167 167
168 private String label_year, label_month, label_day, label_hours, label_mins, label_seconds;//单位 168 private String label_year, label_month, label_day, label_hours, label_mins, label_seconds;//单位
169 169
170 //Required 170 //Required
171 public Builder(Context context, OnTimeSelectListener listener) { 171 public Builder(Context context, OnTimeSelectListener listener) {
172 this.context = context; 172 this.context = context;
173 this.timeSelectListener = listener; 173 this.timeSelectListener = listener;
174 } 174 }
175 175
176 //Option 176 //Option
177 public Builder setType(boolean[] type) { 177 public Builder setType(boolean[] type) {
178 this.type = type; 178 this.type = type;
179 return this; 179 return this;
180 } 180 }
181 181
182 public Builder gravity(int gravity) { 182 public Builder gravity(int gravity) {
183 this.gravity = gravity; 183 this.gravity = gravity;
184 return this; 184 return this;
185 } 185 }
186 186
187 public Builder setSubmitText(String Str_Submit) { 187 public Builder setSubmitText(String Str_Submit) {
188 this.Str_Submit = Str_Submit; 188 this.Str_Submit = Str_Submit;
189 return this; 189 return this;
190 } 190 }
191 191
192 public Builder isDialog(boolean isDialog) { 192 public Builder isDialog(boolean isDialog) {
193 this.isDialog = isDialog; 193 this.isDialog = isDialog;
194 return this; 194 return this;
195 } 195 }
196 196
197 public Builder setCancelText(String Str_Cancel) { 197 public Builder setCancelText(String Str_Cancel) {
198 this.Str_Cancel = Str_Cancel; 198 this.Str_Cancel = Str_Cancel;
199 return this; 199 return this;
200 } 200 }
201 201
202 public Builder setTitleText(String Str_Title) { 202 public Builder setTitleText(String Str_Title) {
203 this.Str_Title = Str_Title; 203 this.Str_Title = Str_Title;
204 return this; 204 return this;
205 } 205 }
206 206
207 public Builder setSubmitColor(int Color_Submit) { 207 public Builder setSubmitColor(int Color_Submit) {
208 this.Color_Submit = Color_Submit; 208 this.Color_Submit = Color_Submit;
209 return this; 209 return this;
210 } 210 }
211 211
212 public Builder setCancelColor(int Color_Cancel) { 212 public Builder setCancelColor(int Color_Cancel) {
213 this.Color_Cancel = Color_Cancel; 213 this.Color_Cancel = Color_Cancel;
214 return this; 214 return this;
215 } 215 }
216 /** 216 /**
217 * 必须是viewgroup 217 * 必须是viewgroup
218 * 设置要将pickerview显示到的容器id 218 * 设置要将pickerview显示到的容器id
219 * @param decorView 219 * @param decorView
220 * @return 220 * @return
221 */ 221 */
222 public Builder setDecorView(ViewGroup decorView) { 222 public Builder setDecorView(ViewGroup decorView) {
223 this.decorView = decorView; 223 this.decorView = decorView;
224 return this; 224 return this;
225 } 225 }
226 226
227 public Builder setBgColor(int Color_Background_Wheel) { 227 public Builder setBgColor(int Color_Background_Wheel) {
228 this.Color_Background_Wheel = Color_Background_Wheel; 228 this.Color_Background_Wheel = Color_Background_Wheel;
229 return this; 229 return this;
230 } 230 }
231 231
232 public Builder setTitleBgColor(int Color_Background_Title) { 232 public Builder setTitleBgColor(int Color_Background_Title) {
233 this.Color_Background_Title = Color_Background_Title; 233 this.Color_Background_Title = Color_Background_Title;
234 return this; 234 return this;
235 } 235 }
236 236
237 public Builder setTitleColor(int Color_Title) { 237 public Builder setTitleColor(int Color_Title) {
238 this.Color_Title = Color_Title; 238 this.Color_Title = Color_Title;
239 return this; 239 return this;
240 } 240 }
241 241
242 public Builder setSubCalSize(int Size_Submit_Cancel) { 242 public Builder setSubCalSize(int Size_Submit_Cancel) {
243 this.Size_Submit_Cancel = Size_Submit_Cancel; 243 this.Size_Submit_Cancel = Size_Submit_Cancel;
244 return this; 244 return this;
245 } 245 }
246 246
247 public Builder setTitleSize(int Size_Title) { 247 public Builder setTitleSize(int Size_Title) {
248 this.Size_Title = Size_Title; 248 this.Size_Title = Size_Title;
249 return this; 249 return this;
250 } 250 }
251 251
252 public Builder setContentSize(int Size_Content) { 252 public Builder setContentSize(int Size_Content) {
253 this.Size_Content = Size_Content; 253 this.Size_Content = Size_Content;
254 return this; 254 return this;
255 } 255 }
256 256
257 /** 257 /**
258 * 因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 258 * 因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
259 * 259 *
260 * @param date 260 * @param date
261 * @return 261 * @return
262 */ 262 */
263 public Builder setDate(Calendar date) { 263 public Builder setDate(Calendar date) {
264 this.date = date; 264 this.date = date;
265 return this; 265 return this;
266 } 266 }
267 267
268 public Builder setLayoutRes(int res, CustomListener customListener) { 268 public Builder setLayoutRes(int res, CustomListener customListener) {
269 this.layoutRes = res; 269 this.layoutRes = res;
270 this.customListener = customListener; 270 this.customListener = customListener;
271 return this; 271 return this;
272 } 272 }
273 273
274 public Builder setRange(int startYear, int endYear) { 274 public Builder setRange(int startYear, int endYear) {
275 this.startYear = startYear; 275 this.startYear = startYear;
276 this.endYear = endYear; 276 this.endYear = endYear;
277 return this; 277 return this;
278 } 278 }
279 279
280 /** 280 /**
281 * 设置起始时间 281 * 设置起始时间
282 * 因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 282 * 因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11
283 * 283 *
284 * @return 284 * @return
285 */ 285 */
286 286
287 public Builder setRangDate(Calendar startDate, Calendar endDate) { 287 public Builder setRangDate(Calendar startDate, Calendar endDate) {
288 this.startDate = startDate; 288 this.startDate = startDate;
289 this.endDate = endDate; 289 this.endDate = endDate;
290 return this; 290 return this;
291 } 291 }
292 292
293 293
294 /** 294 /**
295 * 设置间距倍数,但是只能在1.2-2.0f之间 295 * 设置间距倍数,但是只能在1.2-2.0f之间
296 * 296 *
297 * @param lineSpacingMultiplier 297 * @param lineSpacingMultiplier
298 */ 298 */
299 public Builder setLineSpacingMultiplier(float lineSpacingMultiplier) { 299 public Builder setLineSpacingMultiplier(float lineSpacingMultiplier) {
300 this.lineSpacingMultiplier = lineSpacingMultiplier; 300 this.lineSpacingMultiplier = lineSpacingMultiplier;
301 return this; 301 return this;
302 } 302 }
303 303
304 /** 304 /**
305 * 设置分割线的颜色 305 * 设置分割线的颜色
306 * 306 *
307 * @param dividerColor 307 * @param dividerColor
308 */ 308 */
309 public Builder setDividerColor(int dividerColor) { 309 public Builder setDividerColor(int dividerColor) {
310 this.dividerColor = dividerColor; 310 this.dividerColor = dividerColor;
311 return this; 311 return this;
312 } 312 }
313 313
314 /** 314 /**
315 * 设置分割线的类型 315 * 设置分割线的类型
316 * 316 *
317 * @param dividerType 317 * @param dividerType
318 */ 318 */
319 public Builder setDividerType(WheelView.DividerType dividerType) { 319 public Builder setDividerType(WheelView.DividerType dividerType) {
320 this.dividerType = dividerType; 320 this.dividerType = dividerType;
321 return this; 321 return this;
322 } 322 }
323 323
324 /** 324 /**
325 * //显示时的外部背景色颜色,默认是灰色 325 * //显示时的外部背景色颜色,默认是灰色
326 * @param backgroundId 326 * @param backgroundId
327 */ 327 */
328 328
329 public Builder setBackgroundId(int backgroundId) { 329 public Builder setBackgroundId(int backgroundId) {
330 this.backgroundId = backgroundId; 330 this.backgroundId = backgroundId;
331 return this; 331 return this;
332 } 332 }
333 333
334 /** 334 /**
335 * 设置分割线之间的文字的颜色 335 * 设置分割线之间的文字的颜色
336 * 336 *
337 * @param textColorCenter 337 * @param textColorCenter
338 */ 338 */
339 public Builder setTextColorCenter(int textColorCenter) { 339 public Builder setTextColorCenter(int textColorCenter) {
340 this.textColorCenter = textColorCenter; 340 this.textColorCenter = textColorCenter;
341 return this; 341 return this;
342 } 342 }
343 343
344 /** 344 /**
345 * 设置分割线以外文字的颜色 345 * 设置分割线以外文字的颜色
346 * 346 *
347 * @param textColorOut 347 * @param textColorOut
348 */ 348 */
349 public Builder setTextColorOut(int textColorOut) { 349 public Builder setTextColorOut(int textColorOut) {
350 this.textColorOut = textColorOut; 350 this.textColorOut = textColorOut;
351 return this; 351 return this;
352 } 352 }
353 353
354 public Builder isCyclic(boolean cyclic) { 354 public Builder isCyclic(boolean cyclic) {
355 this.cyclic = cyclic; 355 this.cyclic = cyclic;
356 return this; 356 return this;
357 } 357 }
358 358
359 public Builder setOutSideCancelable(boolean cancelable) { 359 public Builder setOutSideCancelable(boolean cancelable) {
360 this.cancelable = cancelable; 360 this.cancelable = cancelable;
361 return this; 361 return this;
362 } 362 }
363 363
364 public Builder setLabel(String label_year, String label_month, String label_day, String label_hours, String label_mins, String label_seconds) { 364 public Builder setLabel(String label_year, String label_month, String label_day, String label_hours, String label_mins, String label_seconds) {
365 this.label_year = label_year; 365 this.label_year = label_year;
366 this.label_month = label_month; 366 this.label_month = label_month;
367 this.label_day = label_day; 367 this.label_day = label_day;
368 this.label_hours = label_hours; 368 this.label_hours = label_hours;
369 this.label_mins = label_mins; 369 this.label_mins = label_mins;
370 this.label_seconds = label_seconds; 370 this.label_seconds = label_seconds;
371 return this; 371 return this;
372 } 372 }
373 373
374 public Builder isCenterLabel(boolean isCenterLabel) { 374 public Builder isCenterLabel(boolean isCenterLabel) {
375 this.isCenterLabel = isCenterLabel; 375 this.isCenterLabel = isCenterLabel;
376 return this; 376 return this;
377 } 377 }
378 378
379 379
380 public TimePickerView build() { 380 public TimePickerView build() {
381 return new TimePickerView(this); 381 return new TimePickerView(this);
382 } 382 }
383 } 383 }
384 384
385 385
386 private void initView(Context context) { 386 private void initView(Context context) {
387 setDialogOutSideCancelable(cancelable); 387 setDialogOutSideCancelable(cancelable);
388 initViews(backgroundId); 388 initViews(backgroundId);
389 init(); 389 init();
390 initEvents(); 390 initEvents();
391 if (customListener == null) { 391 if (customListener == null) {
392 LayoutInflater.from(context).inflate(R.layout.pickerview_time, contentContainer); 392 LayoutInflater.from(context).inflate(R.layout.pickerview_time, contentContainer);
393 393
394 //顶部标题 394 //顶部标题
395 tvTitle = (TextView) findViewById(R.id.tvTitle); 395 tvTitle = (TextView) findViewById(R.id.tvTitle);
396 396
397 //确定和取消按钮 397 //确定和取消按钮
398 btnSubmit = (Button) findViewById(R.id.btnSubmit); 398 btnSubmit = (Button) findViewById(R.id.btnSubmit);
399 btnCancel = (Button) findViewById(R.id.btnCancel); 399 btnCancel = (Button) findViewById(R.id.btnCancel);
400 400
401 btnSubmit.setTag(TAG_SUBMIT); 401 btnSubmit.setTag(TAG_SUBMIT);
402 btnCancel.setTag(TAG_CANCEL); 402 btnCancel.setTag(TAG_CANCEL);
403 403
404 btnSubmit.setOnClickListener(this); 404 btnSubmit.setOnClickListener(this);
405 btnCancel.setOnClickListener(this); 405 btnCancel.setOnClickListener(this);
406 406
407 //设置文字 407 //设置文字
408 btnSubmit.setText(TextUtils.isEmpty(Str_Submit) ? context.getResources().getString(R.string.pickerview_submit) : Str_Submit); 408 btnSubmit.setText(TextUtils.isEmpty(Str_Submit) ? context.getResources().getString(R.string.pickerview_submit) : Str_Submit);
409 btnCancel.setText(TextUtils.isEmpty(Str_Cancel) ? context.getResources().getString(R.string.pickerview_cancel) : Str_Cancel); 409 btnCancel.setText(TextUtils.isEmpty(Str_Cancel) ? context.getResources().getString(R.string.pickerview_cancel) : Str_Cancel);
410 tvTitle.setText(TextUtils.isEmpty(Str_Title) ? "" : Str_Title);//默认为空 410 tvTitle.setText(TextUtils.isEmpty(Str_Title) ? "" : Str_Title);//默认为空
411 411
412 //设置文字颜色 412 //设置文字颜色
413 btnSubmit.setTextColor(Color_Submit == 0 ? pickerview_timebtn_nor : Color_Submit); 413 btnSubmit.setTextColor(Color_Submit == 0 ? pickerview_timebtn_nor : Color_Submit);
414 btnCancel.setTextColor(Color_Cancel == 0 ? pickerview_timebtn_nor : Color_Cancel); 414 btnCancel.setTextColor(Color_Cancel == 0 ? pickerview_timebtn_nor : Color_Cancel);
415 tvTitle.setTextColor(Color_Title == 0 ? pickerview_topbar_title : Color_Title); 415 tvTitle.setTextColor(Color_Title == 0 ? pickerview_topbar_title : Color_Title);
416 416
417 //设置文字大小 417 //设置文字大小
418 btnSubmit.setTextSize(Size_Submit_Cancel); 418 btnSubmit.setTextSize(Size_Submit_Cancel);
419 btnCancel.setTextSize(Size_Submit_Cancel); 419 btnCancel.setTextSize(Size_Submit_Cancel);
420 tvTitle.setTextSize(Size_Title); 420 tvTitle.setTextSize(Size_Title);
421 RelativeLayout rv_top_bar = (RelativeLayout) findViewById(R.id.rv_topbar); 421 RelativeLayout rv_top_bar = (RelativeLayout) findViewById(R.id.rv_topbar);
422 rv_top_bar.setBackgroundColor(Color_Background_Title == 0 ? pickerview_bg_topbar : Color_Background_Title); 422 rv_top_bar.setBackgroundColor(Color_Background_Title == 0 ? pickerview_bg_topbar : Color_Background_Title);
423 } else { 423 } else {
424 customListener.customLayout(LayoutInflater.from(context).inflate(layoutRes, contentContainer)); 424 customListener.customLayout(LayoutInflater.from(context).inflate(layoutRes, contentContainer));
425 } 425 }
426 // 时间转轮 自定义控件 426 // 时间转轮 自定义控件
427 LinearLayout timePickerView = (LinearLayout) findViewById(R.id.timepicker); 427 LinearLayout timePickerView = (LinearLayout) findViewById(R.id.timepicker);
428 428
429 timePickerView.setBackgroundColor(Color_Background_Wheel == 0 ? bgColor_default : Color_Background_Wheel); 429 timePickerView.setBackgroundColor(Color_Background_Wheel == 0 ? bgColor_default : Color_Background_Wheel);
430 430
431 wheelTime = new WheelTime(timePickerView, type, gravity, Size_Content); 431 wheelTime = new WheelTime(timePickerView, type, gravity, Size_Content);
432 432
433 if (startYear != 0 && endYear != 0 && startYear <= endYear) { 433 if (startYear != 0 && endYear != 0 && startYear <= endYear) {
434 setRange(); 434 setRange();
435 } 435 }
436 436
437 if (startDate != null && endDate != null) { 437 if (startDate != null && endDate != null) {
438 if (startDate.getTimeInMillis() <= endDate.getTimeInMillis()) { 438 if (startDate.getTimeInMillis() <= endDate.getTimeInMillis()) {
439 setRangDate(); 439 setRangDate();
440 } 440 }
441 } else if (startDate != null && endDate == null) { 441 } else if (startDate != null && endDate == null) {
442 setRangDate(); 442 setRangDate();
443 } else if (startDate == null && endDate != null) { 443 } else if (startDate == null && endDate != null) {
444 setRangDate(); 444 setRangDate();
445 } 445 }
446 446
447 setTime(); 447 setTime();
448 wheelTime.setLabels(label_year, label_month, label_day, label_hours, label_mins, label_seconds); 448 wheelTime.setLabels(label_year, label_month, label_day, label_hours, label_mins, label_seconds);
449 449
450 setOutSideCancelable(cancelable); 450 setOutSideCancelable(cancelable);
451 wheelTime.setCyclic(cyclic); 451 wheelTime.setCyclic(cyclic);
452 wheelTime.setDividerColor(dividerColor); 452 wheelTime.setDividerColor(dividerColor);
453 wheelTime.setDividerType(dividerType); 453 wheelTime.setDividerType(dividerType);
454 wheelTime.setLineSpacingMultiplier(lineSpacingMultiplier); 454 wheelTime.setLineSpacingMultiplier(lineSpacingMultiplier);
455 wheelTime.setTextColorOut(textColorOut); 455 wheelTime.setTextColorOut(textColorOut);
456 wheelTime.setTextColorCenter(textColorCenter); 456 wheelTime.setTextColorCenter(textColorCenter);
457 wheelTime.isCenterLabel(isCenterLabel); 457 wheelTime.isCenterLabel(isCenterLabel);
458 } 458 }
459 459
460 460
461 /** 461 /**
462 * 设置默认时间 462 * 设置默认时间
463 */ 463 */
464 public void setDate(Calendar date) { 464 public void setDate(Calendar date) {
465 this.date = date; 465 this.date = date;
466 setTime(); 466 setTime();
467 } 467 }
468 468
469 /** 469 /**
470 * 设置可以选择的时间范围, 要在setTime之前调用才有效果 470 * 设置可以选择的时间范围, 要在setTime之前调用才有效果
471 */ 471 */
472 private void setRange() { 472 private void setRange() {
473 wheelTime.setStartYear(startYear); 473 wheelTime.setStartYear(startYear);
474 wheelTime.setEndYear(endYear); 474 wheelTime.setEndYear(endYear);
475 475
476 } 476 }
477 477
478 /** 478 /**
479 * 设置可以选择的时间范围, 要在setTime之前调用才有效果 479 * 设置可以选择的时间范围, 要在setTime之前调用才有效果
480 */ 480 */
481 private void setRangDate() { 481 private void setRangDate() {
482 wheelTime.setRangDate(startDate, endDate); 482 wheelTime.setRangDate(startDate, endDate);
483 //如果设置了时间范围 483 //如果设置了时间范围
484 if (startDate != null && endDate != null) { 484 if (startDate != null && endDate != null) {
485 //判断一下默认时间是否设置了,或者是否在起始终止时间范围内 485 //判断一下默认时间是否设置了,或者是否在起始终止时间范围内
486 if (date == null || date.getTimeInMillis() < startDate.getTimeInMillis() 486 if (date == null || date.getTimeInMillis() < startDate.getTimeInMillis()
487 || date.getTimeInMillis() > endDate.getTimeInMillis()) { 487 || date.getTimeInMillis() > endDate.getTimeInMillis()) {
488 date = startDate; 488 date = startDate;
489 } 489 }
490 } else if (startDate != null) { 490 } else if (startDate != null) {
491 //没有设置默认选中时间,那就拿开始时间当默认时间 491 //没有设置默认选中时间,那就拿开始时间当默认时间
492 date = startDate; 492 date = startDate;
493 } else if (endDate != null) { 493 } else if (endDate != null) {
494 date = endDate; 494 date = endDate;
495 } 495 }
496 } 496 }
497 497
498 /** 498 /**
499 * 设置选中时间,默认选中当前时间 499 * 设置选中时间,默认选中当前时间
500 */ 500 */
501 private void setTime() { 501 private void setTime() {
502 int year, month, day, hours, minute, seconds; 502 int year, month, day, hours, minute, seconds;
503 503
504 Calendar calendar = Calendar.getInstance(); 504 Calendar calendar = Calendar.getInstance();
505 if (date == null) { 505 if (date == null) {
506 calendar.setTimeInMillis(System.currentTimeMillis()); 506 calendar.setTimeInMillis(System.currentTimeMillis());
507 year = calendar.get(Calendar.YEAR); 507 year = calendar.get(Calendar.YEAR);
508 month = calendar.get(Calendar.MONTH); 508 month = calendar.get(Calendar.MONTH);
509 day = calendar.get(Calendar.DAY_OF_MONTH); 509 day = calendar.get(Calendar.DAY_OF_MONTH);
510 hours = calendar.get(Calendar.HOUR_OF_DAY); 510 hours = calendar.get(Calendar.HOUR_OF_DAY);
511 minute = calendar.get(Calendar.MINUTE); 511 minute = calendar.get(Calendar.MINUTE);
512 seconds = calendar.get(Calendar.SECOND); 512 seconds = calendar.get(Calendar.SECOND);
513 } else { 513 } else {
514 year = date.get(Calendar.YEAR); 514 year = date.get(Calendar.YEAR);
515 month = date.get(Calendar.MONTH); 515 month = date.get(Calendar.MONTH);
516 day = date.get(Calendar.DAY_OF_MONTH); 516 day = date.get(Calendar.DAY_OF_MONTH);
517 hours = date.get(Calendar.HOUR_OF_DAY); 517 hours = date.get(Calendar.HOUR_OF_DAY);
518 minute = date.get(Calendar.MINUTE); 518 minute = date.get(Calendar.MINUTE);
519 seconds = date.get(Calendar.SECOND); 519 seconds = date.get(Calendar.SECOND);
520 } 520 }
521 521
522 522
523 wheelTime.setPicker(year, month, day, hours, minute, seconds); 523 wheelTime.setPicker(year, month, day, hours, minute, seconds);
524 } 524 }
525 525
526 526
527 @Override 527 @Override
528 public void onClick(View v) { 528 public void onClick(View v) {
529 String tag = (String) v.getTag(); 529 String tag = (String) v.getTag();
530 if (tag.equals(TAG_SUBMIT)) { 530 if (tag.equals(TAG_SUBMIT)) {
531 returnData(); 531 returnData();
532 } 532 }
533 dismiss(); 533 dismiss();
534 } 534 }
535 535
536 public void returnData() { 536 public void returnData() {
537 if (timeSelectListener != null) { 537 if (timeSelectListener != null) {
538 try { 538 try {
539 Date date = WheelTime.dateFormat.parse(wheelTime.getTime()); 539 Date date = WheelTime.dateFormat.parse(wheelTime.getTime());
540 timeSelectListener.onTimeSelect(date, clickView); 540 timeSelectListener.onTimeSelect(date, clickView);
541 } catch (ParseException e) { 541 } catch (ParseException e) {
542 e.printStackTrace(); 542 e.printStackTrace();
543 } 543 }
544 } 544 }
545 } 545 }
546 546
547 public interface OnTimeSelectListener { 547 public interface OnTimeSelectListener {
548 void onTimeSelect(Date date, View v); 548 void onTimeSelect(Date date, View v);
549 } 549 }
550 550
551 @Override 551 @Override
552 public boolean isDialog() { 552 public boolean isDialog() {
553 return isDialog; 553 return isDialog;
554 } 554 }
555 } 555 }
556 556
PersonalCenter/pickerview/src/main/java/com/bigkoo/pickerview/view/BasePickerView.java
1 package com.bigkoo.pickerview.view; 1 package com.bigkoo.pickerview.view;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.app.Dialog; 4 import android.app.Dialog;
5 import android.content.Context; 5 import android.content.Context;
6 import android.content.DialogInterface; 6 import android.content.DialogInterface;
7 import android.graphics.Color; 7 import android.graphics.Color;
8 import android.view.Gravity; 8 import android.view.Gravity;
9 import android.view.KeyEvent; 9 import android.view.KeyEvent;
10 import android.view.LayoutInflater; 10 import android.view.LayoutInflater;
11 import android.view.MotionEvent; 11 import android.view.MotionEvent;
12 import android.view.View; 12 import android.view.View;
13 import android.view.ViewGroup; 13 import android.view.ViewGroup;
14 import android.view.animation.Animation; 14 import android.view.animation.Animation;
15 import android.view.animation.AnimationUtils; 15 import android.view.animation.AnimationUtils;
16 import android.widget.FrameLayout; 16 import android.widget.FrameLayout;
17 17
18 import com.bigkoo.pickerview.R; 18 import com.bigkoo.pickerview.R;
19 import com.bigkoo.pickerview.listener.OnDismissListener; 19 import com.bigkoo.pickerview.listener.OnDismissListener;
20 import com.bigkoo.pickerview.utils.PickerViewAnimateUtil; 20 import com.bigkoo.pickerview.utils.PickerViewAnimateUtil;
21 21
22 /** 22 /**
23 * Created by Sai on 15/11/22. 23 * Created by Sai on 15/11/22.
24 * 精仿iOSPickerViewController控件 24 * 精仿iOSPickerViewController控件
25 */ 25 */
26 public class BasePickerView { 26 public class BasePickerView {
27 private final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( 27 private final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
28 ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER 28 ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.CENTER
29 ); 29 );
30 private Context context; 30 private Context context;
31 protected ViewGroup contentContainer; 31 protected ViewGroup contentContainer;
32 public ViewGroup decorView;//显示pickerview的根View,默认是activity的根view 32 public ViewGroup decorView;//显示pickerview的根View,默认是activity的根view
33 private ViewGroup rootView;//附加View 的 根View 33 private ViewGroup rootView;//附加View 的 根View
34 private ViewGroup dialogView;//附加Dialog 的 根View 34 private ViewGroup dialogView;//附加Dialog 的 根View
35 35
36 protected int pickerview_timebtn_nor = 0xFF057dff; 36 protected int pickerview_timebtn_nor = 0xFF057dff;
37 protected int pickerview_timebtn_pre = 0xFFc2daf5; 37 protected int pickerview_timebtn_pre = 0xFFc2daf5;
38 protected int pickerview_bg_topbar = 0xFFf5f5f5; 38 protected int pickerview_bg_topbar = 0xFFf5f5f5;
39 protected int pickerview_topbar_title = 0xFF000000; 39 protected int pickerview_topbar_title = 0xFF000000;
40 protected int bgColor_default = 0xFFFFFFFF; 40 protected int bgColor_default = 0xFFFFFFFF;
41 41
42 private OnDismissListener onDismissListener; 42 private OnDismissListener onDismissListener;
43 private boolean dismissing; 43 private boolean dismissing;
44 44
45 private Animation outAnim; 45 private Animation outAnim;
46 private Animation inAnim; 46 private Animation inAnim;
47 private boolean isShowing; 47 private boolean isShowing;
48 private int gravity = Gravity.BOTTOM; 48 private int gravity = Gravity.BOTTOM;
49 49
50 50
51 private Dialog mDialog; 51 private Dialog mDialog;
52 private boolean cancelable;//是否能取消 52 private boolean cancelable;//是否能取消
53 53
54 protected View clickView;//是通过哪个View弹出的 54 protected View clickView;//是通过哪个View弹出的
55 55
56 private boolean isAnim = true; 56 private boolean isAnim = true;
57 public BasePickerView(Context context) { 57 public BasePickerView(Context context) {
58 this.context = context; 58 this.context = context;
59 59
60 /*initViews(); 60 /*initViews();
61 init(); 61 init();
62 initEvents();*/ 62 initEvents();*/
63 } 63 }
64 64
65 protected void initViews(int backgroudId) { 65 protected void initViews(int backgroudId) {
66 LayoutInflater layoutInflater = LayoutInflater.from(context); 66 LayoutInflater layoutInflater = LayoutInflater.from(context);
67 if (isDialog()) { 67 if (isDialog()) {
68 //如果是对话框模式 68 //如果是对话框模式
69 dialogView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, null, false); 69 dialogView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, null, false);
70 //设置界面的背景为透明 70 //设置界面的背景为透明
71 dialogView.setBackgroundColor(Color.TRANSPARENT); 71 dialogView.setBackgroundColor(Color.TRANSPARENT);
72 //这个是真正要加载时间选取器的父布局 72 //这个是真正要加载时间选取器的父布局
73 contentContainer = (ViewGroup) dialogView.findViewById(R.id.content_container); 73 contentContainer = (ViewGroup) dialogView.findViewById(R.id.content_container);
74 //设置对话框 左右间距屏幕30 74 //设置对话框 左右间距屏幕30
75 this.params.leftMargin = 30; 75 this.params.leftMargin = 30;
76 this.params.rightMargin = 30; 76 this.params.rightMargin = 30;
77 contentContainer.setLayoutParams(this.params); 77 contentContainer.setLayoutParams(this.params);
78 //创建对话框 78 //创建对话框
79 createDialog(); 79 createDialog();
80 //给背景设置点击事件,这样当点击内容以外的地方会关闭界面 80 //给背景设置点击事件,这样当点击内容以外的地方会关闭界面
81 dialogView.setOnClickListener(new View.OnClickListener() { 81 dialogView.setOnClickListener(new View.OnClickListener() {
82 @Override 82 @Override
83 public void onClick(View view) { 83 public void onClick(View view) {
84 dismiss(); 84 dismiss();
85 } 85 }
86 }); 86 });
87 } else { 87 } else {
88 //如果只是要显示在屏幕的下方 88 //如果只是要显示在屏幕的下方
89 //decorView是activity的根View 89 //decorView是activity的根View
90 if (decorView == null) { 90 if (decorView == null) {
91 decorView = (ViewGroup) ((Activity) context).getWindow().getDecorView().findViewById(android.R.id.content); 91 decorView = (ViewGroup) ((Activity) context).getWindow().getDecorView().findViewById(android.R.id.content);
92 } 92 }
93 //将控件添加到decorView中 93 //将控件添加到decorView中
94 rootView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, decorView, false); 94 rootView = (ViewGroup) layoutInflater.inflate(R.layout.layout_basepickerview, decorView, false);
95 FrameLayout.LayoutParams rootparams = new FrameLayout.LayoutParams( 95 FrameLayout.LayoutParams rootparams = new FrameLayout.LayoutParams(
96 ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER 96 ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER
97 ); 97 );
98 rootView.setLayoutParams(rootparams); 98 rootView.setLayoutParams(rootparams);
99 if (backgroudId != 0) { 99 if (backgroudId != 0) {
100 rootView.setBackgroundColor(backgroudId); 100 rootView.setBackgroundColor(backgroudId);
101 } 101 }
102 // rootView.setBackgroundColor(ContextCompat.getColor(context,backgroudId)); 102 // rootView.setBackgroundColor(ContextCompat.getColor(context,backgroudId));
103 //这个是真正要加载时间选取器的父布局 103 //这个是真正要加载时间选取器的父布局
104 contentContainer = (ViewGroup) rootView.findViewById(R.id.content_container); 104 contentContainer = (ViewGroup) rootView.findViewById(R.id.content_container);
105 params.leftMargin = 500; 105 params.leftMargin = 500;
106 params.rightMargin= 500; 106 params.rightMargin= 500;
107 params.height=600;
107 contentContainer.setLayoutParams(params); 108 contentContainer.setLayoutParams(params);
108 } 109 }
109 setKeyBackCancelable(true); 110 setKeyBackCancelable(true);
110 } 111 }
111 112
112 protected void init() { 113 protected void init() {
113 inAnim = getInAnimation(); 114 inAnim = getInAnimation();
114 outAnim = getOutAnimation(); 115 outAnim = getOutAnimation();
115 } 116 }
116 117
117 protected void initEvents() { 118 protected void initEvents() {
118 } 119 }
119 120
120 121
121 /** 122 /**
122 * @param v (是通过哪个View弹出的) 123 * @param v (是通过哪个View弹出的)
123 * @param isAnim 是否显示动画效果 124 * @param isAnim 是否显示动画效果
124 */ 125 */
125 public void show(View v, boolean isAnim) { 126 public void show(View v, boolean isAnim) {
126 this.clickView = v; 127 this.clickView = v;
127 this.isAnim = isAnim; 128 this.isAnim = isAnim;
128 show(); 129 show();
129 } 130 }
130 131
131 public void show(boolean isAnim) { 132 public void show(boolean isAnim) {
132 this.isAnim = isAnim; 133 this.isAnim = isAnim;
133 show(); 134 show();
134 } 135 }
135 136
136 public void show(View v) { 137 public void show(View v) {
137 this.clickView = v; 138 this.clickView = v;
138 show(); 139 show();
139 } 140 }
140 141
141 142
142 /** 143 /**
143 * 添加View到根视图 144 * 添加View到根视图
144 */ 145 */
145 public void show() { 146 public void show() {
146 if (isDialog()) { 147 if (isDialog()) {
147 showDialog(); 148 showDialog();
148 } else { 149 } else {
149 if (isShowing()) { 150 if (isShowing()) {
150 return; 151 return;
151 } 152 }
152 isShowing = true; 153 isShowing = true;
153 onAttached(rootView); 154 onAttached(rootView);
154 rootView.requestFocus(); 155 rootView.requestFocus();
155 } 156 }
156 } 157 }
157 158
158 159
159 /** 160 /**
160 * show的时候调用 161 * show的时候调用
161 * 162 *
162 * @param view 这个View 163 * @param view 这个View
163 */ 164 */
164 private void onAttached(View view) { 165 private void onAttached(View view) {
165 decorView.addView(view); 166 decorView.addView(view);
166 if(isAnim){ 167 if(isAnim){
167 contentContainer.startAnimation(inAnim); 168 contentContainer.startAnimation(inAnim);
168 } 169 }
169 } 170 }
170 171
171 172
172 /** 173 /**
173 * 检测该View是不是已经添加到根视图 174 * 检测该View是不是已经添加到根视图
174 * 175 *
175 * @return 如果视图已经存在该View返回true 176 * @return 如果视图已经存在该View返回true
176 */ 177 */
177 public boolean isShowing() { 178 public boolean isShowing() {
178 if (isDialog()) { 179 if (isDialog()) {
179 return false; 180 return false;
180 } else { 181 } else {
181 return rootView.getParent() != null || isShowing; 182 return rootView.getParent() != null || isShowing;
182 } 183 }
183 184
184 } 185 }
185 186
186 public void dismiss() { 187 public void dismiss() {
187 if (isDialog()) { 188 if (isDialog()) {
188 dismissDialog(); 189 dismissDialog();
189 } else { 190 } else {
190 if (dismissing) { 191 if (dismissing) {
191 return; 192 return;
192 } 193 }
193 194
194 if (isAnim){ 195 if (isAnim){
195 //消失动画 196 //消失动画
196 outAnim.setAnimationListener(new Animation.AnimationListener() { 197 outAnim.setAnimationListener(new Animation.AnimationListener() {
197 @Override 198 @Override
198 public void onAnimationStart(Animation animation) { 199 public void onAnimationStart(Animation animation) {
199 200
200 } 201 }
201 202
202 @Override 203 @Override
203 public void onAnimationEnd(Animation animation) { 204 public void onAnimationEnd(Animation animation) {
204 dismissImmediately(); 205 dismissImmediately();
205 } 206 }
206 207
207 @Override 208 @Override
208 public void onAnimationRepeat(Animation animation) { 209 public void onAnimationRepeat(Animation animation) {
209 210
210 } 211 }
211 }); 212 });
212 contentContainer.startAnimation(outAnim); 213 contentContainer.startAnimation(outAnim);
213 } else { 214 } else {
214 dismissImmediately(); 215 dismissImmediately();
215 } 216 }
216 dismissing = true; 217 dismissing = true;
217 } 218 }
218 219
219 220
220 } 221 }
221 222
222 public void dismissImmediately() { 223 public void dismissImmediately() {
223 224
224 decorView.post(new Runnable() { 225 decorView.post(new Runnable() {
225 @Override 226 @Override
226 public void run() { 227 public void run() {
227 //从根视图移除 228 //从根视图移除
228 decorView.removeView(rootView); 229 decorView.removeView(rootView);
229 isShowing = false; 230 isShowing = false;
230 dismissing = false; 231 dismissing = false;
231 if (onDismissListener != null) { 232 if (onDismissListener != null) {
232 onDismissListener.onDismiss(BasePickerView.this); 233 onDismissListener.onDismiss(BasePickerView.this);
233 } 234 }
234 } 235 }
235 }); 236 });
236 237
237 238
238 } 239 }
239 240
240 public Animation getInAnimation() { 241 public Animation getInAnimation() {
241 int res = PickerViewAnimateUtil.getAnimationResource(this.gravity, true); 242 int res = PickerViewAnimateUtil.getAnimationResource(this.gravity, true);
242 return AnimationUtils.loadAnimation(context, res); 243 return AnimationUtils.loadAnimation(context, res);
243 } 244 }
244 245
245 public Animation getOutAnimation() { 246 public Animation getOutAnimation() {
246 int res = PickerViewAnimateUtil.getAnimationResource(this.gravity, false); 247 int res = PickerViewAnimateUtil.getAnimationResource(this.gravity, false);
247 return AnimationUtils.loadAnimation(context, res); 248 return AnimationUtils.loadAnimation(context, res);
248 } 249 }
249 250
250 public BasePickerView setOnDismissListener(OnDismissListener onDismissListener) { 251 public BasePickerView setOnDismissListener(OnDismissListener onDismissListener) {
251 this.onDismissListener = onDismissListener; 252 this.onDismissListener = onDismissListener;
252 return this; 253 return this;
253 } 254 }
254 255
255 public void setKeyBackCancelable(boolean isCancelable) { 256 public void setKeyBackCancelable(boolean isCancelable) {
256 257
257 ViewGroup View; 258 ViewGroup View;
258 if (isDialog()) { 259 if (isDialog()) {
259 View = dialogView; 260 View = dialogView;
260 } else { 261 } else {
261 View = rootView; 262 View = rootView;
262 } 263 }
263 264
264 View.setFocusable(isCancelable); 265 View.setFocusable(isCancelable);
265 View.setFocusableInTouchMode(isCancelable); 266 View.setFocusableInTouchMode(isCancelable);
266 if (isCancelable) { 267 if (isCancelable) {
267 View.setOnKeyListener(onKeyBackListener); 268 View.setOnKeyListener(onKeyBackListener);
268 } else { 269 } else {
269 View.setOnKeyListener(null); 270 View.setOnKeyListener(null);
270 } 271 }
271 } 272 }
272 273
273 private View.OnKeyListener onKeyBackListener = new View.OnKeyListener() { 274 private View.OnKeyListener onKeyBackListener = new View.OnKeyListener() {
274 @Override 275 @Override
275 public boolean onKey(View v, int keyCode, KeyEvent event) { 276 public boolean onKey(View v, int keyCode, KeyEvent event) {
276 if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == MotionEvent.ACTION_DOWN 277 if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == MotionEvent.ACTION_DOWN
277 && isShowing()) { 278 && isShowing()) {
278 dismiss(); 279 dismiss();
279 return true; 280 return true;
280 } 281 }
281 return false; 282 return false;
282 } 283 }
283 }; 284 };
284 285
285 protected BasePickerView setOutSideCancelable(boolean isCancelable) { 286 protected BasePickerView setOutSideCancelable(boolean isCancelable) {
286 if (rootView != null) { 287 if (rootView != null) {
287 View view = rootView.findViewById(R.id.outmost_container); 288 View view = rootView.findViewById(R.id.outmost_container);
288 289
289 if (isCancelable) { 290 if (isCancelable) {
290 view.setOnTouchListener(onCancelableTouchListener); 291 view.setOnTouchListener(onCancelableTouchListener);
291 } else { 292 } else {
292 view.setOnTouchListener(null); 293 view.setOnTouchListener(null);
293 } 294 }
294 } 295 }
295 296
296 return this; 297 return this;
297 } 298 }
298 299
299 /** 300 /**
300 * 设置对话框模式是否可以点击外部取消 301 * 设置对话框模式是否可以点击外部取消
301 * 302 *
302 * @param cancelable 303 * @param cancelable
303 */ 304 */
304 public void setDialogOutSideCancelable(boolean cancelable) { 305 public void setDialogOutSideCancelable(boolean cancelable) {
305 this.cancelable = cancelable; 306 this.cancelable = cancelable;
306 } 307 }
307 308
308 309
309 /** 310 /**
310 * Called when the user touch on black overlay in order to dismiss the dialog 311 * Called when the user touch on black overlay in order to dismiss the dialog
311 */ 312 */
312 private final View.OnTouchListener onCancelableTouchListener = new View.OnTouchListener() { 313 private final View.OnTouchListener onCancelableTouchListener = new View.OnTouchListener() {
313 @Override 314 @Override
314 public boolean onTouch(View v, MotionEvent event) { 315 public boolean onTouch(View v, MotionEvent event) {
315 if (event.getAction() == MotionEvent.ACTION_DOWN) { 316 if (event.getAction() == MotionEvent.ACTION_DOWN) {
316 dismiss(); 317 dismiss();
317 } 318 }
318 return false; 319 return false;
319 } 320 }
320 }; 321 };
321 322
322 public View findViewById(int id) { 323 public View findViewById(int id) {
323 return contentContainer.findViewById(id); 324 return contentContainer.findViewById(id);
324 } 325 }
325 326
326 public void createDialog() { 327 public void createDialog() {
327 if (dialogView != null) { 328 if (dialogView != null) {
328 mDialog = new Dialog(context, R.style.custom_dialog2); 329 mDialog = new Dialog(context, R.style.custom_dialog2);
329 mDialog.setCancelable(cancelable);//不能点外面取消,也不 能点back取消 330 mDialog.setCancelable(cancelable);//不能点外面取消,也不 能点back取消
330 mDialog.setContentView(dialogView); 331 mDialog.setContentView(dialogView);
331 332
332 mDialog.getWindow().setWindowAnimations(R.style.pickerview_dialogAnim); 333 mDialog.getWindow().setWindowAnimations(R.style.pickerview_dialogAnim);
333 mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { 334 mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
334 @Override 335 @Override
335 public void onDismiss(DialogInterface dialog) { 336 public void onDismiss(DialogInterface dialog) {
336 if (onDismissListener != null) { 337 if (onDismissListener != null) {
337 onDismissListener.onDismiss(BasePickerView.this); 338 onDismissListener.onDismiss(BasePickerView.this);
338 } 339 }
339 } 340 }
340 }); 341 });
341 } 342 }
342 343
343 } 344 }
344 345
345 public void showDialog() { 346 public void showDialog() {
346 if (mDialog != null) { 347 if (mDialog != null) {
347 mDialog.show(); 348 mDialog.show();
348 } 349 }
349 } 350 }
350 351
351 public void dismissDialog() { 352 public void dismissDialog() {
352 if (mDialog != null) { 353 if (mDialog != null) {
353 mDialog.dismiss(); 354 mDialog.dismiss();
354 } 355 }
355 } 356 }
356 357
357 public boolean isDialog() { 358 public boolean isDialog() {
358 return false; 359 return false;
359 } 360 }
360 } 361 }
361 362
PersonalCenter/pickerview/src/main/res/layout/include_pickerview_topbar.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:id="@+id/rv_topbar" 3 android:id="@+id/rv_topbar"
4 android:layout_width="match_parent" 4 android:layout_width="match_parent"
5 android:layout_height="match_parent"> 5 android:layout_height="match_parent">
6 6
7 <Button 7 <Button
8 android:id="@+id/btnCancel" 8 android:id="@+id/btnCancel"
9 android:layout_width="wrap_content" 9 android:layout_width="wrap_content"
10 android:layout_height="match_parent" 10 android:layout_height="match_parent"
11 android:background="@android:color/transparent" 11 android:background="@android:color/transparent"
12 android:gravity="left|center_vertical" 12 android:gravity="left|center_vertical"
13 android:paddingLeft="@dimen/pickerview_topbar_padding" 13 android:paddingLeft="@dimen/pickerview_topbar_padding"
14 android:text="@string/pickerview_cancel" 14 android:text="@string/pickerview_cancel"
15 android:layout_marginLeft="20dp" 15 android:layout_marginLeft="20dp"
16 android:textColor="@drawable/selector_pickerview_btn" 16 android:textColor="@color/pickerview_wheelview_textcolor_out"
17 android:textSize="@dimen/pickerview_topbar_btn_textsize" /> 17 android:textSize="@dimen/pickerview_topbar_btn_textsize" />
18 18
19 <TextView
20 android:id="@+id/tvTitle"
21 android:layout_width="match_parent"
22 android:gravity="center"
23 android:layout_height="wrap_content"
24 android:layout_centerVertical="true"
25 android:layout_toLeftOf="@+id/btnSubmit"
26 android:layout_toRightOf="@+id/btnCancel"
27 android:textColor="@color/pickerview_topbar_title"
28 android:textSize="@dimen/pickerview_topbar_title_textsize" />
29
30 <Button 19 <Button
31 android:id="@id/btnSubmit" 20 android:id="@+id/btnSubmit"
32 android:layout_width="wrap_content" 21 android:layout_width="wrap_content"
33 android:layout_height="match_parent" 22 android:layout_height="match_parent"
34 android:layout_alignParentRight="true" 23 android:layout_alignParentRight="true"
35 android:background="@android:color/transparent" 24 android:background="@android:color/transparent"
36 android:gravity="right|center_vertical" 25 android:gravity="right|center_vertical"
37 android:paddingRight="@dimen/pickerview_topbar_padding" 26 android:paddingRight="@dimen/pickerview_topbar_padding"
38 android:text="@string/pickerview_submit" 27 android:text="@string/pickerview_submit"
39 android:layout_marginRight="20dp" 28 android:layout_marginRight="20dp"
40 android:textColor="@drawable/selector_pickerview_btn" 29 android:textColor="@color/pickerview_wheelview_textcolor_out"
41 android:textSize="@dimen/pickerview_topbar_btn_textsize" /> 30 android:textSize="@dimen/pickerview_topbar_btn_textsize" />
42 </RelativeLayout> 31 </RelativeLayout>
43 32
PersonalCenter/pickerview/src/main/res/layout/pickerview_time.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="wrap_content" 3 android:layout_width="wrap_content"
4 android:layout_height="wrap_content" 4 android:layout_height="wrap_content"
5 android:orientation="vertical"> 5 android:orientation="vertical">
6 6
7 7 <include
8 layout="@layout/pickerviw_title"
9 android:layout_width="match_parent"
10 android:layout_height="@dimen/pickerview_topbar_height" />
8 <LinearLayout 11 <LinearLayout
9 android:id="@+id/timepicker" 12 android:id="@+id/timepicker"
10 android:layout_width="wrap_content" 13 android:layout_width="wrap_content"
11 android:layout_height="wrap_content" 14 android:layout_height="wrap_content"
15 android:layout_marginTop="20dp"
12 android:orientation="horizontal"> 16 android:orientation="horizontal">
13 17
18
14 <com.bigkoo.pickerview.lib.WheelView 19 <com.bigkoo.pickerview.lib.WheelView
15 android:id="@+id/year" 20 android:id="@+id/year"
16 android:layout_width="match_parent" 21 android:layout_width="match_parent"
17 android:layout_height="wrap_content" 22 android:layout_height="wrap_content"
18 android:layout_weight="0.96" /> 23 android:layout_weight="0.96" />
19 24
20 <com.bigkoo.pickerview.lib.WheelView 25 <com.bigkoo.pickerview.lib.WheelView
21 26
22 android:id="@+id/month" 27 android:id="@+id/month"
23 android:layout_width="match_parent" 28 android:layout_width="match_parent"
24 android:layout_height="wrap_content" 29 android:layout_height="wrap_content"
25 android:layout_weight="1" /> 30 android:layout_weight="1" />
26 31
27 <com.bigkoo.pickerview.lib.WheelView 32 <com.bigkoo.pickerview.lib.WheelView
28 android:id="@+id/day" 33 android:id="@+id/day"
29 android:layout_width="match_parent" 34 android:layout_width="match_parent"
30 android:layout_height="wrap_content" 35 android:layout_height="wrap_content"
31 android:layout_weight="1" /> 36 android:layout_weight="1" />
32 37
33 <com.bigkoo.pickerview.lib.WheelView 38 <com.bigkoo.pickerview.lib.WheelView
34 android:id="@+id/hour" 39 android:id="@+id/hour"
35 android:layout_width="match_parent" 40 android:layout_width="match_parent"
36 android:layout_height="wrap_content" 41 android:layout_height="wrap_content"
37 android:layout_weight="1" /> 42 android:layout_weight="1" />
38 43
39 <com.bigkoo.pickerview.lib.WheelView 44 <com.bigkoo.pickerview.lib.WheelView
40 android:id="@+id/min" 45 android:id="@+id/min"
41 android:layout_width="match_parent" 46 android:layout_width="match_parent"
42 android:layout_height="wrap_content" 47 android:layout_height="wrap_content"
43 android:layout_weight="1" /> 48 android:layout_weight="1" />
44 49
45 <com.bigkoo.pickerview.lib.WheelView 50 <com.bigkoo.pickerview.lib.WheelView
46 android:id="@+id/second" 51 android:id="@+id/second"
47 android:layout_width="match_parent" 52 android:layout_width="match_parent"
48 android:layout_height="wrap_content" 53 android:layout_height="wrap_content"
49 android:layout_weight="1" /> 54 android:layout_weight="1" />
50 </LinearLayout> 55 </LinearLayout>
51 <include 56 <include
52 layout="@layout/include_pickerview_topbar" 57 layout="@layout/include_pickerview_topbar"
53 android:layout_width="match_parent" 58 android:layout_width="match_parent"
54 android:layout_height="@dimen/pickerview_topbar_height" /> 59 android:layout_height="@dimen/pickerview_topbar_height" />
55 60
56 61
57 </LinearLayout> 62 </LinearLayout>
PersonalCenter/pickerview/src/main/res/layout/pickerviw_title.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical"
4 android:layout_width="match_parent"
5 android:layout_height="match_parent">
6 <TextView
7 android:id="@+id/tvTitle"
8 android:layout_width="match_parent"
9 android:gravity="center"
10 android:layout_height="wrap_content"
11 android:textColor="@color/pickerview_topbar_title"
12 android:textSize="22sp" />
13
14 </LinearLayout>
PersonalCenter/pickerview/src/main/res/values/colors.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <resources> 2 <resources>
3 <color name="pickerview_timebtn_nor">#057dff</color> 3 <color name="pickerview_timebtn_nor">#afafaf</color>
4 <color name="pickerview_timebtn_pre">#c2daf5</color> 4 <color name="pickerview_timebtn_pre">#c2daf5</color>
5 <color name="pickerview_bg_topbar">#f5f5f5</color> 5 <color name="pickerview_bg_topbar">#f5f5f5</color>
6 <color name="white">#ffffffff</color> 6 <color name="white">#ffffffff</color>
7 <color name="login_edittext_hint">#afafaf</color> 7 <color name="login_edittext_hint">#afafaf</color>
8 <color name="pickerview_topbar_title">#000000</color> 8 <color name="pickerview_topbar_title">#000000</color>
9 <color name="pickerview_wheelview_textcolor_out">#a8a8a8</color> 9 <color name="pickerview_wheelview_textcolor_out">#a8a8a8</color>
10 <color name="pickerview_wheelview_textcolor_center">#2a2a2a</color> 10 <color name="pickerview_wheelview_textcolor_center">#2a2a2a</color>
11 <color name="pickerview_wheelview_textcolor_divider">#d5d5d5</color> 11 <color name="pickerview_wheelview_textcolor_divider">#d5d5d5</color>
12 <color name="pickerview_bgColor_overlay">#60000000</color> 12 <color name="pickerview_bgColor_overlay">#60000000</color>
13 <color name="pickerview_bgColor_default">#FFFFFFFF</color> 13 <color name="pickerview_bgColor_default">#FFFFFFFF</color>
14 14
15 </resources> 15 </resources>
16 16