Commit 80c9782036c498ef379315467145e626c47e2e43
1 parent
6a86a5fc01
Exists in
master
提交迭代的代码
Showing
67 changed files
with
3195 additions
and
1377 deletions
Show diff stats
.DS_Store
No preview for this file type
PersonalCenter/app/PresonalCenter.apk
No preview for this file type
PersonalCenter/app/build.gradle
... | ... | @@ -6,9 +6,9 @@ android { |
6 | 6 | defaultConfig { |
7 | 7 | applicationId "com.hjx.personalcenter" |
8 | 8 | minSdkVersion 15 |
9 | - targetSdkVersion 25 | |
10 | - versionCode 6 | |
11 | - versionName "1.1.0" | |
9 | + targetSdkVersion 23 | |
10 | + versionCode 17 | |
11 | + versionName "1.2.8" | |
12 | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
13 | 13 | } |
14 | 14 | buildTypes { | ... | ... |
PersonalCenter/app/src/main/AndroidManifest.xml
... | ... | @@ -10,6 +10,15 @@ |
10 | 10 | android:label="@string/app_name" |
11 | 11 | android:supportsRtl="true" |
12 | 12 | android:theme="@style/AppTheme"> |
13 | + <provider | |
14 | + android:name="android.support.v4.content.FileProvider" | |
15 | + android:authorities="com.hjx.personalcenter.fileprovider" | |
16 | + android:exported="false" | |
17 | + android:grantUriPermissions="true"> | |
18 | + <meta-data | |
19 | + android:name="android.support.FILE_PROVIDER_PATHS" | |
20 | + android:resource="@xml/rc_file_path" /> | |
21 | + </provider> | |
13 | 22 | <activity |
14 | 23 | android:name=".activity.MainActivity" |
15 | 24 | android:launchMode="standard" |
... | ... | @@ -47,6 +56,7 @@ |
47 | 56 | <activity |
48 | 57 | android:name=".activity.ElectronicCardValidationActivity" |
49 | 58 | android:launchMode="singleTask" |
59 | + android:windowSoftInputMode="adjustUnspecified|stateHidden" | |
50 | 60 | android:screenOrientation="sensorLandscape"> |
51 | 61 | |
52 | 62 | </activity> |
... | ... | @@ -143,6 +153,7 @@ |
143 | 153 | </intent-filter> |
144 | 154 | |
145 | 155 | </receiver>--> |
156 | + | |
146 | 157 | </application> |
147 | 158 | <!--权限--> |
148 | 159 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
... | ... | @@ -51,8 +51,8 @@ public class AccountManagementActivity extends FragmentActivity implements View. |
51 | 51 | case HttpCode.CHILDS_SUCESS: |
52 | 52 | ChildsInfo childsInfo = new ChildsInfo(); |
53 | 53 | if (childsInfo.getStatus()==1000) { |
54 | - String names =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.USERNAME); | |
55 | - String adress =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.ADRESS); | |
54 | + String names =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.NICKNAME); | |
55 | + String adress =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.REGION); | |
56 | 56 | String grades =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.GRADES); |
57 | 57 | String schools =SaveParam.getInstance().getLoginParam(AccountManagementActivity.this, SaveParam.SCHOOL); |
58 | 58 | tv_username.setText(names); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java
... | ... | @@ -128,10 +128,12 @@ public class ChangeElectronicCardAdressInfoActivity extends FragmentActivity imp |
128 | 128 | TextUtils.isEmpty(forot_pwd_pwd3) || TextUtils.isEmpty(forot_pwd_pwd4)){ |
129 | 129 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请将必填项填写完整"); |
130 | 130 | return; |
131 | - }else if (Judgment.getInstance().isPhoneNum(forot_pwd_phone1)){ | |
131 | + } | |
132 | + else if (Judgment.getInstance().isPhoneNum(forot_pwd_phone1)){ | |
132 | 133 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "手机号码输入有误"); |
133 | 134 | |
134 | - } else { | |
135 | + } | |
136 | + else { | |
135 | 137 | //修改地址接口 |
136 | 138 | String userID = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); |
137 | 139 | HttpManager.getInstance().changecardadressinfo(this,userID,forot_pwd_phone1,forot_pwd_anthcode1,forot_pwd_pwd3+forot_pwd_pwd4); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java
... | ... | @@ -2,12 +2,15 @@ package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | 3 | import android.os.Bundle; |
4 | 4 | import android.support.v4.app.FragmentActivity; |
5 | +import android.text.Editable; | |
5 | 6 | import android.text.TextUtils; |
7 | +import android.text.TextWatcher; | |
6 | 8 | import android.text.method.HideReturnsTransformationMethod; |
7 | 9 | import android.text.method.PasswordTransformationMethod; |
8 | 10 | import android.view.View; |
9 | 11 | import android.widget.Button; |
10 | 12 | import android.widget.EditText; |
13 | +import android.widget.ImageButton; | |
11 | 14 | import android.widget.ImageView; |
12 | 15 | |
13 | 16 | import com.hjx.personalcenter.R; |
... | ... | @@ -24,6 +27,7 @@ public class ChangePasswordActivity extends FragmentActivity implements View.OnC |
24 | 27 | private EditText old_pwd,newpassword,newpassword1; |
25 | 28 | private Button sub_change_pwd; |
26 | 29 | private ImageView back_change_pwd,eyes_iv_change1; |
30 | + private ImageButton oldpassword_delete_btn; | |
27 | 31 | public static Boolean showPassword = false; |
28 | 32 | @Override |
29 | 33 | protected void onCreate(Bundle savedInstanceState) { |
... | ... | @@ -31,6 +35,7 @@ public class ChangePasswordActivity extends FragmentActivity implements View.OnC |
31 | 35 | setContentView(R.layout.activity_changepsword); |
32 | 36 | initView(); |
33 | 37 | setLister(); |
38 | + initTextWatch(); | |
34 | 39 | } |
35 | 40 | |
36 | 41 | private void initView() { |
... | ... | @@ -40,6 +45,7 @@ public class ChangePasswordActivity extends FragmentActivity implements View.OnC |
40 | 45 | sub_change_pwd = (Button) findViewById(R.id.btn_ok); |
41 | 46 | back_change_pwd = (ImageView) findViewById(R.id.cancel); |
42 | 47 | eyes_iv_change1 = (ImageView) findViewById(R.id.iv_pwd_change); |
48 | + oldpassword_delete_btn = (ImageButton) findViewById(R.id.oldpassword_delete_btn); | |
43 | 49 | |
44 | 50 | |
45 | 51 | } |
... | ... | @@ -48,6 +54,45 @@ public class ChangePasswordActivity extends FragmentActivity implements View.OnC |
48 | 54 | sub_change_pwd.setOnClickListener(this); |
49 | 55 | back_change_pwd.setOnClickListener(this); |
50 | 56 | eyes_iv_change1.setOnClickListener(this); |
57 | + oldpassword_delete_btn.setOnClickListener(this); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * 输入框改变的监听 | |
62 | + */ | |
63 | + private void initTextWatch() { | |
64 | + old_pwd.addTextChangedListener(new TextWatcher() { | |
65 | + @Override | |
66 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
67 | + } | |
68 | + | |
69 | + @Override | |
70 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
71 | + if (s.toString().length() == 0) { | |
72 | + oldpassword_delete_btn.setVisibility(View.INVISIBLE); | |
73 | + } else { | |
74 | + oldpassword_delete_btn.setVisibility(View.VISIBLE); | |
75 | + } | |
76 | + } | |
77 | + | |
78 | + @Override | |
79 | + public void afterTextChanged(Editable s) { | |
80 | + | |
81 | + } | |
82 | + }); | |
83 | + old_pwd.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
84 | + @Override | |
85 | + public void onFocusChange(View v, boolean hasFocus) { | |
86 | + if (hasFocus) { | |
87 | + if (!old_pwd.getText().toString().isEmpty()) { | |
88 | + oldpassword_delete_btn.setVisibility(View.VISIBLE); | |
89 | + } | |
90 | + } else { | |
91 | + | |
92 | + oldpassword_delete_btn.setVisibility(View.INVISIBLE); | |
93 | + } | |
94 | + } | |
95 | + }); | |
51 | 96 | } |
52 | 97 | |
53 | 98 | @Override |
... | ... | @@ -101,6 +146,9 @@ public class ChangePasswordActivity extends FragmentActivity implements View.OnC |
101 | 146 | case R.id.cancel: |
102 | 147 | finish(); |
103 | 148 | break; |
149 | + case R.id.oldpassword_delete_btn: | |
150 | + old_pwd.setText(""); | |
151 | + break; | |
104 | 152 | } |
105 | 153 | |
106 | 154 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChoiseTextBookActivity.java
... | ... | @@ -196,8 +196,10 @@ public class ChoiseTextBookActivity extends FragmentActivity implements View.OnC |
196 | 196 | } |
197 | 197 | String grade = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.CHILDSGRADENS); |
198 | 198 | String schoolid = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.SCHOOOlID); |
199 | - String name = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.USERNAME); | |
200 | - String regeionname = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.ADRESS); | |
199 | + String name = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.NICKNAME); | |
200 | + String regeionname = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.REGION); | |
201 | + String realName = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.REALNAME); | |
202 | + String address = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.ADDRESS); | |
201 | 203 | |
202 | 204 | try { |
203 | 205 | if (userID == null) { |
... | ... | @@ -216,7 +218,7 @@ public class ChoiseTextBookActivity extends FragmentActivity implements View.OnC |
216 | 218 | |
217 | 219 | //提交注册信息 |
218 | 220 | HttpManager.getInstance().subregisterinfo(ChoiseTextBookActivity.this, auserID, |
219 | - name, gradeID, regionID, regeionname, schoolID, math, english, chinese, physics, chemistry, history, geography, political, biology, science, handler); | |
221 | + name, gradeID, regionID, regeionname, realName,address,schoolID, math, english, chinese, physics, chemistry, history, geography, political, biology, science, handler); | |
220 | 222 | } |
221 | 223 | |
222 | 224 | } catch (NumberFormatException e) { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | +import android.app.Dialog; | |
3 | 4 | import android.content.Intent; |
4 | 5 | import android.os.Bundle; |
6 | +import android.os.Handler; | |
7 | +import android.os.Message; | |
5 | 8 | import android.support.v4.app.FragmentActivity; |
6 | 9 | import android.text.TextUtils; |
10 | +import android.util.Log; | |
11 | +import android.view.LayoutInflater; | |
7 | 12 | import android.view.View; |
13 | +import android.view.ViewGroup; | |
8 | 14 | import android.widget.Button; |
9 | 15 | import android.widget.EditText; |
10 | 16 | import android.widget.ImageView; |
... | ... | @@ -18,28 +24,35 @@ import com.hjx.personalcenter.customdialog.CountryDialog; |
18 | 24 | import com.hjx.personalcenter.customdialog.ProvinceListDialog; |
19 | 25 | import com.hjx.personalcenter.db.Content; |
20 | 26 | import com.hjx.personalcenter.db.SaveParam; |
27 | +import com.hjx.personalcenter.http.HttpCode; | |
28 | +import com.hjx.personalcenter.http.HttpManager; | |
21 | 29 | import com.hjx.personalcenter.interfaces.DialogCallBack; |
22 | 30 | import com.hjx.personalcenter.model.CityInfo; |
23 | 31 | import com.hjx.personalcenter.model.CountyInfo; |
32 | +import com.hjx.personalcenter.model.PesonalInfo; | |
24 | 33 | import com.hjx.personalcenter.model.ProvinceInfo; |
25 | 34 | import com.hjx.personalcenter.util.AlertUtils; |
35 | +import com.hjx.personalcenter.util.BrithdayStar; | |
26 | 36 | import com.hjx.personalcenter.util.GetDate; |
37 | +import com.squareup.picasso.Picasso; | |
27 | 38 | |
28 | 39 | import java.util.ArrayList; |
29 | 40 | |
30 | -/**填写保卡信息 熊巍 | |
41 | +/** | |
42 | + * 填写保卡信息 熊巍 | |
31 | 43 | * Created by h on 2017/8/11. |
32 | 44 | */ |
33 | 45 | |
34 | 46 | public class ElectronicCardEditInfoActivity extends FragmentActivity implements View.OnClickListener |
35 | - ,DialogCallBack.ProvincesCallBack | |
36 | - ,DialogCallBack.CitysCallBack,DialogCallBack.CountryCallBack{ | |
47 | + , DialogCallBack.ProvincesCallBack | |
48 | + , DialogCallBack.CitysCallBack, DialogCallBack.CountryCallBack { | |
37 | 49 | private LinearLayout lineL_buy_time; |
38 | - private TextView tv_buy_time,adress_shop,adress_custem; | |
39 | - private EditText username,store,detalAdress,telphone; | |
50 | + private TextView adress_shop, adress_custem; | |
51 | + private EditText username, store, detalAdress, telphone,et_salesperson_phone; | |
40 | 52 | private TimePickerView pvTime; |
41 | - private Button btn_change_info; | |
42 | - private ImageView iv_card_back,shop_adress,custom_adress; | |
53 | + private Button btn_change_info,cancel_btn,go_btn; | |
54 | + private ImageView iv_card_back, shop_adress, custom_adress; | |
55 | + private Dialog salesDialog; | |
43 | 56 | |
44 | 57 | @Override |
45 | 58 | protected void onCreate(Bundle savedInstanceState) { |
... | ... | @@ -53,7 +66,7 @@ public class ElectronicCardEditInfoActivity extends FragmentActivity implements |
53 | 66 | |
54 | 67 | private void initView() { |
55 | 68 | lineL_buy_time = (LinearLayout) findViewById(R.id.lineL_buy_time); |
56 | - tv_buy_time = (TextView) findViewById(R.id.tv_buy_time); | |
69 | +// tv_buy_time = (TextView) findViewById(R.id.tv_buy_time); | |
57 | 70 | adress_shop = (TextView) findViewById(R.id.tv_edit_adress_shop); |
58 | 71 | adress_custem = (TextView) findViewById(R.id.tv_edit_adress_custem); |
59 | 72 | username = (EditText) findViewById(R.id.et_edit_username); |
... | ... | @@ -64,14 +77,46 @@ public class ElectronicCardEditInfoActivity extends FragmentActivity implements |
64 | 77 | iv_card_back = (ImageView) findViewById(R.id.iv_card_back); |
65 | 78 | shop_adress = (ImageView) findViewById(R.id.shopdizhi); |
66 | 79 | custom_adress = (ImageView) findViewById(R.id.cunstomdizhi); |
80 | + et_salesperson_phone = (EditText) findViewById(R.id.et_salesperson_phone); | |
67 | 81 | } |
68 | 82 | |
69 | 83 | private void initData() { |
70 | 84 | GetDate date = new GetDate(); |
71 | - tv_buy_time.setText(date.getYMD().toString()); | |
85 | +// tv_buy_time.setText(date.getYMD().toString()); | |
86 | + String userID = SaveParam.getInstance().getLoginParam(this, "userId"); | |
87 | + long id = Long.parseLong(userID); | |
88 | + //获取个人信息 | |
89 | + HttpManager.getInstance().getpresonalinfo(this, id, 1, handler); | |
72 | 90 | |
73 | 91 | } |
74 | 92 | |
93 | + Handler handler = new Handler() { | |
94 | + @Override | |
95 | + public void handleMessage(Message msg) { | |
96 | + super.handleMessage(msg); | |
97 | + switch (msg.what) { | |
98 | + case HttpCode.GETINFO: | |
99 | + PesonalInfo.DataBean cardinfoBean = (PesonalInfo.DataBean) msg.obj; | |
100 | + username.setText(cardinfoBean.getRealName()); | |
101 | + adress_custem.setText(cardinfoBean.getRegion().getRegionName()); | |
102 | + detalAdress.setText(cardinfoBean.getAddress()); | |
103 | + break; | |
104 | + case HttpCode.SUCHCARDINFO: | |
105 | + Intent intent = new Intent(); | |
106 | + intent.putExtra(SaveParam.CARDPHONE,getIntent().getStringExtra(SaveParam.CARDPHONE)); | |
107 | + intent.putExtra(SaveParam.SALES_ID,msg.obj.toString()); | |
108 | + intent.putExtra(SaveParam.SALES_PHONE,et_salesperson_phone.getText().toString().trim()); | |
109 | + intent.setClass(ElectronicCardEditInfoActivity.this, ElectronicCardInfoOKActivity.class); | |
110 | + startActivity(intent); | |
111 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
112 | + break; | |
113 | + case HttpCode.NO_SALES_MAN: | |
114 | + showSwitchDialog(); | |
115 | + break; | |
116 | + } | |
117 | + } | |
118 | + }; | |
119 | + | |
75 | 120 | private void initLister() { |
76 | 121 | adress_shop.setOnClickListener(this); |
77 | 122 | adress_custem.setOnClickListener(this); |
... | ... | @@ -82,27 +127,47 @@ public class ElectronicCardEditInfoActivity extends FragmentActivity implements |
82 | 127 | |
83 | 128 | } |
84 | 129 | |
130 | + private void showSwitchDialog() { | |
131 | + //自定义部分 | |
132 | + LayoutInflater mInflater = LayoutInflater.from(this); | |
133 | + View dialogView = mInflater.inflate(R.layout.sales_dialog_layout, | |
134 | + null); | |
135 | + salesDialog = new Dialog(this, R.style.CustomHintDialog); | |
136 | + cancel_btn = (Button) dialogView.findViewById(R.id.cancel_btn); | |
137 | + go_btn = (Button) dialogView.findViewById(R.id.go_btn); | |
138 | + salesDialog.addContentView(dialogView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); | |
139 | + salesDialog.setCanceledOnTouchOutside(true); | |
140 | + salesDialog.show(); | |
141 | + cancel_btn.setOnClickListener(this); | |
142 | + go_btn.setOnClickListener(this); | |
143 | + } | |
144 | + | |
85 | 145 | @Override |
86 | 146 | public void onClick(View v) { |
87 | - switch (v.getId()){ | |
147 | + switch (v.getId()) { | |
88 | 148 | case R.id.btn_change_info: |
89 | - String info1 =username.getText().toString().trim(); | |
90 | - String info2 =adress_custem.getText().toString().trim(); | |
91 | - String info3 =detalAdress.getText().toString().trim(); | |
92 | - String info4 =tv_buy_time.getText().toString().trim(); | |
93 | - String info5 =adress_shop.getText().toString().trim(); | |
94 | - String info6 =store.getText().toString().trim(); | |
95 | - String info7 =telphone.getText().toString().trim(); | |
96 | - | |
97 | - if (TextUtils.isEmpty(info1) || TextUtils.isEmpty(info2)||TextUtils.isEmpty(info3) | |
98 | - ||TextUtils.isEmpty(info4)||TextUtils.isEmpty(info5)||TextUtils.isEmpty(info6) | |
99 | - ||TextUtils.isEmpty(info7)) { | |
149 | + String info1 = username.getText().toString().trim(); | |
150 | + String info2 = adress_custem.getText().toString().trim(); | |
151 | + String info3 = detalAdress.getText().toString().trim(); | |
152 | +// String info4 =tv_buy_time.getText().toString().trim(); | |
153 | + String info5 = adress_shop.getText().toString().trim(); | |
154 | + String info6 = store.getText().toString().trim(); | |
155 | + String info7 = telphone.getText().toString().trim(); | |
156 | + String info8 = et_salesperson_phone.getText().toString().trim(); | |
157 | + | |
158 | + if (TextUtils.isEmpty(info1) || TextUtils.isEmpty(info2) || TextUtils.isEmpty(info3) | |
159 | + || TextUtils.isEmpty(info5) || TextUtils.isEmpty(info6) | |
160 | + || TextUtils.isEmpty(info7)) { | |
100 | 161 | AlertUtils.showToast(ElectronicCardEditInfoActivity.this, "所有内容不能为空。"); |
101 | 162 | return; |
102 | - }else { | |
163 | + } else if(!TextUtils.isEmpty(info8) ){ | |
164 | + HttpManager.getInstance().checkSalesmanPhone(this,info8,handler); | |
165 | + savedata(); | |
166 | + } else{ | |
103 | 167 | savedata(); |
104 | 168 | Intent intent = new Intent(); |
105 | - intent.setClass(ElectronicCardEditInfoActivity.this,ElectronicCardInfoOKActivity.class); | |
169 | + intent.putExtra(SaveParam.CARDPHONE,getIntent().getStringExtra(SaveParam.CARDPHONE)); | |
170 | + intent.setClass(ElectronicCardEditInfoActivity.this, ElectronicCardInfoOKActivity.class); | |
106 | 171 | startActivity(intent); |
107 | 172 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
108 | 173 | } |
... | ... | @@ -110,46 +175,59 @@ public class ElectronicCardEditInfoActivity extends FragmentActivity implements |
110 | 175 | break; |
111 | 176 | case R.id.tv_edit_adress_shop: |
112 | 177 | case R.id.shopdizhi: |
113 | - Content.adressflag =1; | |
178 | + Content.adressflag = 1; | |
114 | 179 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) this).show(getSupportFragmentManager(), "ProvinceListDialog"); |
115 | 180 | |
116 | 181 | break; |
117 | 182 | case R.id.tv_edit_adress_custem: |
118 | 183 | case R.id.cunstomdizhi: |
119 | - Content.adressflag =2; | |
184 | + Content.adressflag = 2; | |
120 | 185 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) this).show(getSupportFragmentManager(), "ProvinceListDialog"); |
121 | 186 | |
122 | 187 | break; |
123 | 188 | case R.id.iv_card_back: |
124 | 189 | finish(); |
125 | 190 | break; |
191 | + case R.id.cancel_btn: | |
192 | + salesDialog.cancel(); | |
193 | + break; | |
194 | + case R.id.go_btn: | |
195 | + salesDialog.cancel(); | |
196 | + Intent intent = new Intent(); | |
197 | + intent.putExtra(SaveParam.CARDPHONE,getIntent().getStringExtra(SaveParam.CARDPHONE)); | |
198 | + intent.setClass(ElectronicCardEditInfoActivity.this, ElectronicCardInfoOKActivity.class); | |
199 | + startActivity(intent); | |
200 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
201 | + break; | |
126 | 202 | |
127 | 203 | } |
128 | 204 | |
129 | 205 | |
130 | 206 | } |
207 | + | |
131 | 208 | //保存数据 |
132 | 209 | private void savedata() { |
133 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CUNSTEMNAME, username.getText().toString().trim()); | |
134 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.ADRESSCUNSTEM, adress_custem.getText().toString().trim()+detalAdress.getText().toString().trim()); | |
135 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTIME, tv_buy_time.getText().toString().trim()); | |
136 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPADRESS, adress_shop.getText().toString().trim()+store.getText().toString().trim()); | |
137 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTLEPHONE, telphone.getText().toString().trim()); | |
210 | + SaveParam.getInstance().saveCustomizeParam(this, SaveParam.CUNSTEMNAME, username.getText().toString().trim()); | |
211 | + SaveParam.getInstance().saveCustomizeParam(this, SaveParam.ADRESSCUNSTEM, adress_custem.getText().toString().trim() + detalAdress.getText().toString().trim()); | |
212 | +// SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTIME, tv_buy_time.getText().toString().trim()); | |
213 | + SaveParam.getInstance().saveCustomizeParam(this, SaveParam.SHOPADRESS, adress_shop.getText().toString().trim() + store.getText().toString().trim()); | |
214 | + SaveParam.getInstance().saveCustomizeParam(this, SaveParam.SHOPTLEPHONE, telphone.getText().toString().trim()); | |
215 | + SaveParam.getInstance().saveCustomizeParam(this, SaveParam.SALES_PHONE, et_salesperson_phone.getText().toString().trim()); | |
138 | 216 | |
139 | 217 | } |
140 | 218 | |
141 | 219 | @Override |
142 | 220 | public void province1OnItemClick(ArrayList<CityInfo.CitiesBean> data, int position, int type) { |
143 | 221 | String regionName = data.get(position).getRegionName(); |
144 | - String provice = SaveParam.getInstance().getLoginParam(this,"sheng"); | |
145 | - SaveParam.getInstance().saveLoginParam(this,"shi",regionName); | |
222 | + String provice = SaveParam.getInstance().getLoginParam(this, "sheng"); | |
223 | + SaveParam.getInstance().saveLoginParam(this, "shi", regionName); | |
146 | 224 | CountryDialog.getInstance((DialogCallBack.CountryCallBack) this).show(getSupportFragmentManager(), "CountryDialog"); |
147 | - if (Content.adressflag ==1){ | |
225 | + if (Content.adressflag == 1) { | |
148 | 226 | adress_shop.setText(""); |
149 | - adress_shop.setText(provice+regionName); | |
150 | - }else { | |
227 | + adress_shop.setText(provice + regionName); | |
228 | + } else { | |
151 | 229 | adress_custem.setText(""); |
152 | - adress_custem.setText(provice+regionName); | |
230 | + adress_custem.setText(provice + regionName); | |
153 | 231 | } |
154 | 232 | |
155 | 233 | } |
... | ... | @@ -157,27 +235,27 @@ public class ElectronicCardEditInfoActivity extends FragmentActivity implements |
157 | 235 | @Override |
158 | 236 | public void province2OnItemClick(ArrayList<CountyInfo.CountiesBean> data, int position, int type) { |
159 | 237 | String regionName = data.get(position).getRegionName(); |
160 | - String provices = SaveParam.getInstance().getLoginParam(this,"sheng"); | |
161 | - String citys = SaveParam.getInstance().getLoginParam(this,"shi"); | |
162 | - if (Content.adressflag ==1){ | |
238 | + int regionId = data.get(position).getRegionId(); | |
239 | + String provices = SaveParam.getInstance().getLoginParam(this, "sheng"); | |
240 | + String citys = SaveParam.getInstance().getLoginParam(this, "shi"); | |
241 | + if (Content.adressflag == 1) { | |
163 | 242 | adress_shop.setText(""); |
164 | - adress_shop.setText(provices+citys+regionName); | |
165 | - }else { | |
243 | + adress_shop.setText(provices + citys + regionName); | |
244 | + } else { | |
166 | 245 | adress_custem.setText(""); |
167 | - adress_custem.setText(provices+citys+regionName); | |
246 | + adress_custem.setText(provices + citys + regionName); | |
168 | 247 | } |
169 | 248 | |
170 | 249 | |
171 | - | |
172 | 250 | } |
173 | 251 | |
174 | 252 | @Override |
175 | 253 | public void provinceOnItemClick(ArrayList<ProvinceInfo.ProvincesBean> data, int position, int type) { |
176 | 254 | String regionName = data.get(position).getRegionName(); |
177 | - SaveParam.getInstance().saveLoginParam(this,"sheng",regionName); | |
255 | + SaveParam.getInstance().saveLoginParam(this, "sheng", regionName); | |
178 | 256 | CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog"); |
179 | - adress_custem.setText(""); | |
180 | - adress_custem.setText(regionName); | |
257 | +// adress_custem.setText(""); | |
258 | +// adress_custem.setText(regionName); | |
181 | 259 | |
182 | 260 | } |
183 | 261 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java
... | ... | @@ -6,7 +6,9 @@ import android.view.KeyEvent; |
6 | 6 | import android.view.View; |
7 | 7 | import android.widget.Button; |
8 | 8 | import android.widget.ImageView; |
9 | +import android.widget.LinearLayout; | |
9 | 10 | import android.widget.TextView; |
11 | +import android.widget.Toast; | |
10 | 12 | |
11 | 13 | import com.hjx.personalcenter.R; |
12 | 14 | import com.hjx.personalcenter.db.Content; |
... | ... | @@ -21,7 +23,9 @@ import com.hjx.personalcenter.util.GetDevicesUtil; |
21 | 23 | public class ElectronicCardInfoOKActivity extends FragmentActivity implements View.OnClickListener { |
22 | 24 | private Button btn_finish,btn_bangding; |
23 | 25 | private ImageView iv_last_step; |
24 | - private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,shopadress,phone,tlePhone; | |
26 | + private TextView usename,deviceModel,customer_address,mac_adress,deviceNumber,shopadress,phone,tlePhone,tv_salesperson_phone; | |
27 | + private LinearLayout salesperson_phone_layout; | |
28 | + private String salesId; | |
25 | 29 | @Override |
26 | 30 | protected void onCreate(Bundle savedInstanceState) { |
27 | 31 | super.onCreate(savedInstanceState); |
... | ... | @@ -38,15 +42,19 @@ public class ElectronicCardInfoOKActivity extends FragmentActivity implements Vi |
38 | 42 | deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel); |
39 | 43 | customer_address = (TextView) findViewById(R.id.tv_card_adress); |
40 | 44 | mac_adress = (TextView) findViewById(R.id.tv_card_mac); |
41 | - shoptime = (TextView) findViewById(R.id.tv_card_time); | |
45 | +// shoptime = (TextView) findViewById(R.id.tv_card_time); | |
42 | 46 | deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber); |
43 | 47 | shopadress = (TextView) findViewById(R.id.tv_card_shopAdress); |
44 | 48 | phone = (TextView) findViewById(R.id.tv_card_phone); |
45 | 49 | tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); |
46 | 50 | btn_bangding = (Button) findViewById(R.id.btn_bangding); |
51 | + tv_salesperson_phone = (TextView) findViewById(R.id.tv_salesperson_phone); | |
52 | + salesperson_phone_layout = (LinearLayout) findViewById(R.id.salesperson_phone_layout); | |
47 | 53 | } |
48 | 54 | |
49 | 55 | private void initData() { |
56 | + salesId=getIntent().getStringExtra(SaveParam.SALES_ID); | |
57 | + | |
50 | 58 | //获取设备信息 |
51 | 59 | deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel()); |
52 | 60 | deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber()); |
... | ... | @@ -54,11 +62,15 @@ public class ElectronicCardInfoOKActivity extends FragmentActivity implements Vi |
54 | 62 | //获取保卡信息 |
55 | 63 | usename.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CUNSTEMNAME)); |
56 | 64 | customer_address.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.ADRESSCUNSTEM)); |
57 | - shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME)); | |
65 | +// shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME)); | |
58 | 66 | shopadress.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPADRESS)); |
59 | 67 | tlePhone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTLEPHONE)); |
60 | - phone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CARDPHONE)); | |
61 | - | |
68 | + phone.setText(getIntent().getStringExtra(SaveParam.CARDPHONE)); | |
69 | + if (salesId != null && !salesId.isEmpty()) { | |
70 | + tv_salesperson_phone.setText(getIntent().getStringExtra(SaveParam.SALES_PHONE)); | |
71 | + }else{ | |
72 | + salesperson_phone_layout.setVisibility(View.INVISIBLE); | |
73 | + } | |
62 | 74 | |
63 | 75 | } |
64 | 76 | |
... | ... | @@ -80,11 +92,13 @@ public class ElectronicCardInfoOKActivity extends FragmentActivity implements Vi |
80 | 92 | } catch (NumberFormatException e) { |
81 | 93 | e.printStackTrace(); |
82 | 94 | } |
95 | + | |
83 | 96 | HttpManager.getInstance().subcardinfo(this,auserID,usename.getText().toString().trim(), |
84 | 97 | customer_address.getText().toString().trim(),shopadress.getText().toString().trim(), |
85 | - shoptime.getText().toString().trim(),tlePhone.getText().toString().trim(), | |
98 | + tlePhone.getText().toString().trim(), | |
86 | 99 | deviceModel.getText().toString().trim(),deviceNumber.getText().toString().trim(), |
87 | - mac_adress.getText().toString().trim(),phone.getText().toString().trim()); | |
100 | + mac_adress.getText().toString().trim(),phone.getText().toString().trim(), | |
101 | + SaveParam.getInstance().getsaveCityParam(this,SaveParam.COUNTRY), salesId); | |
88 | 102 | break; |
89 | 103 | case R.id.btn_bangding: |
90 | 104 | Content.cardintentflag =2; |
... | ... | @@ -95,9 +109,10 @@ public class ElectronicCardInfoOKActivity extends FragmentActivity implements Vi |
95 | 109 | } |
96 | 110 | HttpManager.getInstance().subcardinfo(this,auserID,usename.getText().toString().trim(), |
97 | 111 | customer_address.getText().toString().trim(),shopadress.getText().toString().trim(), |
98 | - shoptime.getText().toString().trim(),tlePhone.getText().toString().trim(), | |
112 | + tlePhone.getText().toString().trim(), | |
99 | 113 | deviceModel.getText().toString().trim(),deviceNumber.getText().toString().trim(), |
100 | - mac_adress.getText().toString().trim(),phone.getText().toString().trim()); | |
114 | + mac_adress.getText().toString().trim(),phone.getText().toString().trim(), | |
115 | + SaveParam.getInstance().getsaveCityParam(this,SaveParam.COUNTRY),salesId); | |
101 | 116 | |
102 | 117 | break; |
103 | 118 | case R.id.cancel: |
... | ... | @@ -105,17 +120,17 @@ public class ElectronicCardInfoOKActivity extends FragmentActivity implements Vi |
105 | 120 | break; |
106 | 121 | } |
107 | 122 | } |
108 | - @Override | |
109 | - public boolean onKeyDown(int keyCode, KeyEvent event) { | |
110 | - if (keyCode == KeyEvent.KEYCODE_BACK) { | |
111 | - SaveParam.getInstance().saveCustomizeParam(ElectronicCardInfoOKActivity.this,SaveParam.CARDPHONE,""); | |
112 | - return false;//return true;拦截事件传递,从而屏蔽back键。 | |
113 | - } | |
114 | - if (KeyEvent.KEYCODE_HOME == keyCode) { | |
115 | - SaveParam.getInstance().saveCustomizeParam(ElectronicCardInfoOKActivity.this,SaveParam.CARDPHONE,""); | |
116 | - return false;//同理 | |
117 | - } | |
118 | - return super.onKeyDown(keyCode, event); | |
119 | - } | |
123 | +// @Override | |
124 | +// public boolean onKeyDown(int keyCode, KeyEvent event) { | |
125 | +// if (keyCode == KeyEvent.KEYCODE_BACK) { | |
126 | +// SaveParam.getInstance().saveCustomizeParam(ElectronicCardInfoOKActivity.this,SaveParam.CARDPHONE,""); | |
127 | +// return false;//return true;拦截事件传递,从而屏蔽back键。 | |
128 | +// } | |
129 | +// if (KeyEvent.KEYCODE_HOME == keyCode) { | |
130 | +// SaveParam.getInstance().saveCustomizeParam(ElectronicCardInfoOKActivity.this,SaveParam.CARDPHONE,""); | |
131 | +// return false;//同理 | |
132 | +// } | |
133 | +// return super.onKeyDown(keyCode, event); | |
134 | +// } | |
120 | 135 | |
121 | 136 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | 3 | import android.content.Intent; |
4 | +import android.os.Build; | |
4 | 5 | import android.os.Bundle; |
5 | 6 | import android.os.Handler; |
6 | 7 | import android.os.Message; |
... | ... | @@ -27,7 +28,7 @@ import java.util.ArrayList; |
27 | 28 | public class ElectronicCardLookInfoActivity extends FragmentActivity implements View.OnClickListener { |
28 | 29 | private ImageView iv_last_step; |
29 | 30 | private TextView usename, deviceModel, customer_address, mac_adress, shoptime, deviceNumber, |
30 | - shopadress, phone, tlePhone, tv_card_adress_change, tv_card_phone_change; | |
31 | + shopadress, phone, tlePhone, tv_card_adress_change, tv_card_phone_change,service_phone; | |
31 | 32 | private ArrayList<CardInfo.DataBean> data = new ArrayList<>(); |
32 | 33 | |
33 | 34 | Handler handler = new Handler() { |
... | ... | @@ -97,6 +98,12 @@ public class ElectronicCardLookInfoActivity extends FragmentActivity implements |
97 | 98 | tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); |
98 | 99 | tv_card_adress_change = (TextView) findViewById(R.id.tv_card_adress_change); |
99 | 100 | tv_card_phone_change = (TextView) findViewById(R.id.tv_card_phone_change); |
101 | + service_phone = (TextView) findViewById(R.id.service_phone); | |
102 | + if(Build.MODEL.equals("T5 PLUS")) | |
103 | + service_phone.setText("400-158-8738") ; | |
104 | + else | |
105 | + service_phone.setText("400-800-3813"); | |
106 | + | |
100 | 107 | } |
101 | 108 | |
102 | 109 | private void initData() { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | 3 | import android.content.Intent; |
4 | +import android.os.Build; | |
4 | 5 | import android.os.Bundle; |
5 | 6 | import android.os.Handler; |
6 | 7 | import android.os.Message; |
7 | 8 | import android.support.v4.app.FragmentActivity; |
9 | +import android.text.Editable; | |
8 | 10 | import android.text.TextUtils; |
11 | +import android.text.TextWatcher; | |
9 | 12 | import android.view.View; |
10 | 13 | import android.widget.Button; |
11 | 14 | import android.widget.EditText; |
15 | +import android.widget.ImageButton; | |
12 | 16 | import android.widget.ImageView; |
17 | +import android.widget.LinearLayout; | |
13 | 18 | import android.widget.TextView; |
14 | 19 | |
15 | 20 | import com.hjx.personalcenter.R; |
... | ... | @@ -21,6 +26,7 @@ import com.hjx.personalcenter.util.AlertUtils; |
21 | 26 | import com.hjx.personalcenter.util.GetDevicesUtil; |
22 | 27 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; |
23 | 28 | |
29 | +import org.json.JSONException; | |
24 | 30 | import org.json.JSONObject; |
25 | 31 | |
26 | 32 | import java.util.TimerTask; |
... | ... | @@ -30,52 +36,72 @@ import java.util.TimerTask; |
30 | 36 | */ |
31 | 37 | |
32 | 38 | public class ElectronicCardValidationActivity extends FragmentActivity implements View.OnClickListener { |
33 | - private Button btn_card_valiyanzhen,get_authcode; | |
34 | - private EditText phonenumber,anth_6num;//;//密码 | |
39 | + private Button btn_card_valiyanzhen, get_authcode; | |
40 | + private EditText phonenumber, anth_6num, activation_code;//;//密码 | |
41 | + private ImageButton phone_delete_btn, code_delete_btn, activation_code_delete_btn; | |
35 | 42 | private TextView menu_title; |
36 | 43 | private ImageView cancel; |
37 | - private int delayTime=60; | |
44 | + private int delayTime = 60; | |
45 | + private LinearLayout rl_authcode, activation_code_layout; | |
38 | 46 | private java.util.Timer Delaytimer; |
39 | - private String sourceStr ="android"; | |
47 | + private String sourceStr = "android"; | |
40 | 48 | private String typeStr = "general"; |
41 | 49 | String authcode = ""; |
42 | 50 | Handler handler = new Handler() { |
43 | 51 | @Override |
44 | 52 | public void handleMessage(Message msg) { |
45 | 53 | super.handleMessage(msg); |
46 | - JSONObject jsonObject; | |
47 | - String status; | |
48 | - switch (msg.what) { | |
49 | - case HttpCode.AUTHCODE_SUCESS: | |
50 | - jsonObject = (JSONObject) msg.obj; | |
51 | - status = jsonObject.optString("status"); | |
52 | - authcode = jsonObject.optString("jsessionid"); | |
53 | - if (status.equals("100")) { | |
54 | - AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送成功"); | |
55 | - } | |
54 | + JSONObject jsonObject; | |
55 | + String status; | |
56 | + switch (msg.what) { | |
57 | + case HttpCode.AUTHCODE_SUCESS: | |
58 | + jsonObject = (JSONObject) msg.obj; | |
59 | + status = jsonObject.optString("status"); | |
60 | + authcode = jsonObject.optString("jsessionid"); | |
61 | + if (status.equals("100")) { | |
62 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送成功"); | |
63 | + } | |
56 | 64 | |
57 | - break; | |
58 | - case HttpCode.AUTHCODE_FAIL: | |
59 | - AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送失败"); | |
60 | - break; | |
61 | - case 21: | |
62 | - if(delayTime<=0){ | |
63 | - if(Delaytimer!=null){ | |
64 | - Delaytimer.cancel(); | |
65 | - } | |
66 | - get_authcode.setEnabled(true); | |
67 | - get_authcode.setClickable(true); | |
68 | - get_authcode.setText("获取验证码"); | |
69 | - delayTime=60; | |
70 | - }else{ | |
71 | - get_authcode.setEnabled(false); | |
72 | - get_authcode.setClickable(false); | |
73 | - get_authcode.setText(delayTime + " s"); | |
65 | + break; | |
66 | + case HttpCode.AUTHCODE_FAIL: | |
67 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送失败"); | |
68 | + break; | |
69 | + case 21: | |
70 | + if (delayTime <= 0) { | |
71 | + if (Delaytimer != null) { | |
72 | + Delaytimer.cancel(); | |
74 | 73 | } |
75 | - break; | |
76 | - } | |
74 | + get_authcode.setEnabled(true); | |
75 | + get_authcode.setClickable(true); | |
76 | + get_authcode.setText("获取验证码"); | |
77 | + delayTime = 60; | |
78 | + } else { | |
79 | + get_authcode.setEnabled(false); | |
80 | + get_authcode.setClickable(false); | |
81 | + get_authcode.setText(delayTime + " s"); | |
82 | + } | |
83 | + break; | |
84 | + case HttpCode.ACTIVATION_SUCCESS: | |
85 | + jsonObject = (JSONObject) msg.obj; | |
86 | + status = jsonObject.optString("status"); | |
87 | + if(status.equals("1")){ | |
88 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "激活成功"); | |
89 | + String phone = phonenumber.getText().toString().trim(); | |
90 | + Intent intent = new Intent(); | |
91 | + intent.putExtra(SaveParam.CARDPHONE, phone); | |
92 | + intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | |
93 | + startActivity(intent); | |
94 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
95 | + }else if(status.equals("5001")){ | |
96 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "激活码无效"); | |
97 | + }else if(status.equals("0")){ | |
98 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "无法链接到服务器,请检查您的网络或稍后重试"); | |
99 | + } | |
100 | + break; | |
101 | + } | |
77 | 102 | } |
78 | 103 | }; |
104 | + | |
79 | 105 | @Override |
80 | 106 | protected void onCreate(Bundle savedInstanceState) { |
81 | 107 | super.onCreate(savedInstanceState); |
... | ... | @@ -84,6 +110,7 @@ public class ElectronicCardValidationActivity extends FragmentActivity implement |
84 | 110 | initView(); |
85 | 111 | initData(); |
86 | 112 | initLister(); |
113 | + initTextWatch(); | |
87 | 114 | } |
88 | 115 | |
89 | 116 | private void initView() { |
... | ... | @@ -91,75 +118,222 @@ public class ElectronicCardValidationActivity extends FragmentActivity implement |
91 | 118 | get_authcode = (Button) findViewById(R.id.btn_authcode); |
92 | 119 | anth_6num = (EditText) findViewById(R.id.et_authcode); |
93 | 120 | phonenumber = (EditText) findViewById(R.id.et_phonenumber); |
121 | + activation_code = (EditText) findViewById(R.id.activation_code); | |
94 | 122 | menu_title = (TextView) findViewById(R.id.menu_title); |
95 | 123 | cancel = (ImageView) findViewById(R.id.cancel); |
124 | + code_delete_btn = (ImageButton) findViewById(R.id.code_delete_btn); | |
125 | + phone_delete_btn = (ImageButton) findViewById(R.id.phone_delete_btn); | |
126 | + activation_code_delete_btn = (ImageButton) findViewById(R.id.activation_code_delete_btn); | |
127 | + rl_authcode = (LinearLayout) findViewById(R.id.rl_authcode); | |
128 | + activation_code_layout = (LinearLayout) findViewById(R.id.activation_code_layout); | |
96 | 129 | } |
97 | 130 | |
98 | 131 | private void initData() { |
99 | - if (Content.authcodeflag==1){ | |
132 | + phonenumber.setText(SaveParam.getInstance().getLoginParam(this, "username")); | |
133 | + if (Content.authcodeflag == 1) { | |
100 | 134 | menu_title.setText("更换绑定"); |
101 | 135 | btn_card_valiyanzhen.setText("确定"); |
102 | - | |
103 | - }else if (Content.authcodeflag==2){ | |
136 | + phonenumber.setText(""); | |
137 | + rl_authcode.setVisibility(View.VISIBLE); | |
138 | + } else if (Content.authcodeflag == 2) { | |
104 | 139 | menu_title.setText("修改保卡信息"); |
105 | 140 | btn_card_valiyanzhen.setText("确定"); |
106 | - | |
107 | - }else { | |
108 | - menu_title.setText("填写保卡信息"); | |
141 | + rl_authcode.setVisibility(View.VISIBLE); | |
142 | + anth_6num.requestFocus(); | |
143 | + } else { | |
144 | + if (Build.MODEL.toUpperCase().equals("T5 PLUS")) {//T5 PLUS需要输入注册激活码 | |
145 | + menu_title.setText("激活机器并确认绑定保卡的手机号"); | |
146 | + activation_code_layout.setVisibility(View.VISIBLE); | |
147 | + } else { | |
148 | + menu_title.setText("确认绑定保卡的手机号"); | |
149 | + activation_code_layout.setVisibility(View.GONE); | |
150 | + } | |
109 | 151 | btn_card_valiyanzhen.setText("下一步"); |
152 | + anth_6num.requestFocus(); | |
110 | 153 | } |
111 | 154 | |
112 | 155 | |
113 | - | |
114 | 156 | } |
115 | 157 | |
116 | 158 | private void initLister() { |
117 | 159 | get_authcode.setOnClickListener(this); |
118 | 160 | btn_card_valiyanzhen.setOnClickListener(this); |
119 | 161 | cancel.setOnClickListener(this); |
162 | + phone_delete_btn.setOnClickListener(this); | |
163 | + code_delete_btn.setOnClickListener(this); | |
164 | + activation_code_delete_btn.setOnClickListener(this); | |
165 | + | |
166 | + } | |
167 | + | |
168 | + /** | |
169 | + * 输入框改变的监听 | |
170 | + */ | |
171 | + private void initTextWatch() { | |
172 | + phonenumber.addTextChangedListener(new TextWatcher() { | |
173 | + @Override | |
174 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
175 | + } | |
176 | + | |
177 | + @Override | |
178 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
179 | + if (s.toString().length() == 0) { | |
180 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
181 | + } else { | |
182 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
183 | + } | |
184 | + if (Build.MODEL.toUpperCase().equals("T5 PLUS")) { | |
185 | + if (!menu_title.getText().toString().equals("激活机器并确认绑定保卡的手机号") || s.toString().length() == 0 || !s.toString().equals(SaveParam.getInstance().getLoginParam(ElectronicCardValidationActivity.this, "username"))) { | |
186 | + rl_authcode.setVisibility(View.VISIBLE); | |
187 | + } else { | |
188 | + rl_authcode.setVisibility(View.GONE); | |
189 | + } | |
190 | + } else { | |
191 | + if (!menu_title.getText().toString().equals("确认绑定保卡的手机号") || s.toString().length() == 0 || !s.toString().equals(SaveParam.getInstance().getLoginParam(ElectronicCardValidationActivity.this, "username"))) { | |
192 | + rl_authcode.setVisibility(View.VISIBLE); | |
193 | + } else { | |
194 | + rl_authcode.setVisibility(View.GONE); | |
195 | + } | |
196 | + } | |
197 | + } | |
198 | + | |
199 | + @Override | |
200 | + public void afterTextChanged(Editable s) { | |
201 | + | |
202 | + } | |
203 | + }); | |
204 | + phonenumber.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
205 | + @Override | |
206 | + public void onFocusChange(View v, boolean hasFocus) { | |
207 | + if (hasFocus) { | |
208 | + if (!phonenumber.getText().toString().isEmpty()) { | |
209 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
210 | + } | |
211 | + } else { | |
212 | + | |
213 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
214 | + } | |
215 | + } | |
216 | + }); | |
217 | + anth_6num.addTextChangedListener(new TextWatcher() { | |
218 | + @Override | |
219 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
220 | + | |
221 | + } | |
120 | 222 | |
223 | + @Override | |
224 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
225 | + if (s.toString().length() == 0) { | |
226 | + | |
227 | + code_delete_btn.setVisibility(View.INVISIBLE); | |
228 | + } else { | |
229 | + code_delete_btn.setVisibility(View.VISIBLE); | |
230 | + } | |
231 | + } | |
232 | + | |
233 | + @Override | |
234 | + public void afterTextChanged(Editable s) { | |
235 | + | |
236 | + } | |
237 | + }); | |
238 | + anth_6num.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
239 | + @Override | |
240 | + public void onFocusChange(View v, boolean hasFocus) { | |
241 | + if (hasFocus) { | |
242 | + if (!anth_6num.getText().toString().isEmpty()) { | |
243 | + code_delete_btn.setVisibility(View.VISIBLE); | |
244 | + } | |
245 | + } else { | |
246 | + code_delete_btn.setVisibility(View.INVISIBLE); | |
247 | + } | |
248 | + } | |
249 | + }); | |
250 | + activation_code.addTextChangedListener(new TextWatcher() { | |
251 | + @Override | |
252 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
253 | + | |
254 | + } | |
255 | + | |
256 | + @Override | |
257 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
258 | + if (s.toString().length() == 0) { | |
259 | + | |
260 | + activation_code_delete_btn.setVisibility(View.INVISIBLE); | |
261 | + } else { | |
262 | + activation_code_delete_btn.setVisibility(View.VISIBLE); | |
263 | + } | |
264 | + } | |
265 | + | |
266 | + @Override | |
267 | + public void afterTextChanged(Editable s) { | |
268 | + | |
269 | + } | |
270 | + }); | |
271 | + activation_code.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
272 | + @Override | |
273 | + public void onFocusChange(View v, boolean hasFocus) { | |
274 | + if (hasFocus) { | |
275 | + if (!activation_code.getText().toString().isEmpty()) { | |
276 | + activation_code_delete_btn.setVisibility(View.VISIBLE); | |
277 | + } | |
278 | + } else { | |
279 | + activation_code_delete_btn.setVisibility(View.INVISIBLE); | |
280 | + } | |
281 | + } | |
282 | + }); | |
121 | 283 | } |
122 | 284 | |
123 | 285 | @Override |
124 | 286 | public void onClick(View v) { |
125 | - switch (v.getId()){ | |
287 | + switch (v.getId()) { | |
126 | 288 | case R.id.btn_card_valiyanzhen: |
127 | - | |
289 | + String userID22 = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); | |
128 | 290 | String usernameStr = phonenumber.getText().toString().trim(); |
129 | 291 | String authcodeStr = anth_6num.getText().toString().trim(); |
130 | - if (TextUtils.isEmpty(usernameStr) || TextUtils.isEmpty(authcodeStr)) { | |
131 | - AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号,和验证码不能为空"); | |
292 | + String activationStr = activation_code.getText().toString().trim(); | |
293 | + if (TextUtils.isEmpty(usernameStr)) { | |
294 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号不能为空"); | |
132 | 295 | return; |
133 | - } else if (!PhoneNumCheckUtils.isPhone(usernameStr)){ | |
296 | + } else if (activation_code_layout.getVisibility() == View.VISIBLE && TextUtils.isEmpty(activationStr)) { | |
297 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "注册激活码不能为空"); | |
298 | + return; | |
299 | + }else if (rl_authcode.getVisibility() == View.VISIBLE && TextUtils.isEmpty(authcodeStr)) { | |
300 | + AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码不能为空"); | |
301 | + return; | |
302 | + } else if (!PhoneNumCheckUtils.isPhone(usernameStr)) { | |
134 | 303 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号码输入错误"); |
135 | 304 | |
136 | - }else if (!authcode.equals(authcodeStr)){ | |
305 | + } else if (!authcode.equals(authcodeStr)) { | |
137 | 306 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "您输入的验证码不正确"); |
138 | - }else { | |
139 | - String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
307 | + } else { | |
308 | + String userID = SaveParam.getInstance().getLoginParam(this, "userId"); | |
140 | 309 | Long auserID = null; |
141 | 310 | try { |
142 | 311 | auserID = Long.parseLong(userID); |
143 | 312 | } catch (NumberFormatException e) { |
144 | 313 | e.printStackTrace(); |
145 | 314 | } |
146 | - if (Content.authcodeflag==1){ | |
315 | + if (Content.authcodeflag == 1) { | |
147 | 316 | //修改账户手机号 |
148 | 317 | HttpManager.getInstance().changeaccountphone(this, |
149 | - auserID,usernameStr,authcodeStr); | |
318 | + auserID, usernameStr, authcodeStr); | |
150 | 319 | |
151 | - }else if (Content.authcodeflag==2){ | |
320 | + } else if (Content.authcodeflag == 2) { | |
152 | 321 | //修改保卡手机号 |
153 | - String userID22 = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); | |
322 | + | |
154 | 323 | HttpManager.getInstance().changecardinfophone(this, |
155 | - userID22,usernameStr,authcodeStr); | |
156 | - }else { | |
157 | - String phone =phonenumber.getText().toString().trim(); | |
158 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phone ); | |
159 | - Intent intent = new Intent(); | |
160 | - intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | |
161 | - startActivity(intent); | |
162 | - overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
324 | + userID22, usernameStr, authcodeStr); | |
325 | + } else { | |
326 | + if(Build.MODEL.toUpperCase().equals("T5 PLUS")){ | |
327 | + HttpManager.getInstance().submitEcard(this,userID22,activationStr,handler); | |
328 | + } else{ | |
329 | + String phone = phonenumber.getText().toString().trim(); | |
330 | +// SaveParam.getInstance().saveCustomizeParam(this, SaveParam.CARDPHONE, phone); | |
331 | + Intent intent = new Intent(); | |
332 | + intent.putExtra(SaveParam.CARDPHONE, phone); | |
333 | + intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | |
334 | + startActivity(intent); | |
335 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
336 | + } | |
163 | 337 | } |
164 | 338 | // SaveParam.getInstance().saveLoginParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); |
165 | 339 | // Intent intent = new Intent(); |
... | ... | @@ -170,9 +344,9 @@ public class ElectronicCardValidationActivity extends FragmentActivity implement |
170 | 344 | break; |
171 | 345 | case R.id.btn_authcode: |
172 | 346 | String usernameStr1 = phonenumber.getText().toString().trim(); |
173 | - if (!PhoneNumCheckUtils.isPhone(usernameStr1)){ | |
347 | + if (!PhoneNumCheckUtils.isPhone(usernameStr1)) { | |
174 | 348 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "请输入正确的手机号"); |
175 | - }else { | |
349 | + } else { | |
176 | 350 | anth_6num.requestFocus(); |
177 | 351 | HttpManager.getInstance().authCode(typeStr, usernameStr1, handler, ElectronicCardValidationActivity.this); |
178 | 352 | valiDelay(); |
... | ... | @@ -183,8 +357,18 @@ public class ElectronicCardValidationActivity extends FragmentActivity implement |
183 | 357 | case R.id.cancel: |
184 | 358 | finish(); |
185 | 359 | break; |
360 | + case R.id.phone_delete_btn: | |
361 | + phonenumber.setText(""); | |
362 | + break; | |
363 | + case R.id.code_delete_btn: | |
364 | + anth_6num.setText(""); | |
365 | + break; | |
366 | + case R.id.activation_code_delete_btn: | |
367 | + activation_code.setText(""); | |
368 | + break; | |
186 | 369 | } |
187 | 370 | } |
371 | + | |
188 | 372 | // 线程类 定时器 |
189 | 373 | public void valiDelay() { |
190 | 374 | |
... | ... | @@ -198,6 +382,6 @@ public class ElectronicCardValidationActivity extends FragmentActivity implement |
198 | 382 | handler.sendEmptyMessage(21); |
199 | 383 | } |
200 | 384 | }; |
201 | - Delaytimer.schedule(task, 1000,1000); | |
385 | + Delaytimer.schedule(task, 1000, 1000); | |
202 | 386 | } |
203 | 387 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/FeedBackActivity.java
... | ... | @@ -77,7 +77,7 @@ public class FeedBackActivity extends FragmentActivity implements View.OnClickLi |
77 | 77 | uri = Uri.fromFile(file); |
78 | 78 | } else { |
79 | 79 | //通过FileProvider创建一个content类型的Uri(android 7.0需要这样的方法跨应用访问) |
80 | - uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter", file); | |
80 | + uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter.fileprovider", file); | |
81 | 81 | } |
82 | 82 | |
83 | 83 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ForgotPasswordActivity.java
... | ... | @@ -5,12 +5,15 @@ import android.os.Handler; |
5 | 5 | import android.os.Message; |
6 | 6 | import android.support.v4.app.FragmentActivity; |
7 | 7 | import android.support.v7.app.AppCompatActivity; |
8 | +import android.text.Editable; | |
8 | 9 | import android.text.TextUtils; |
10 | +import android.text.TextWatcher; | |
9 | 11 | import android.text.method.HideReturnsTransformationMethod; |
10 | 12 | import android.text.method.PasswordTransformationMethod; |
11 | 13 | import android.view.View; |
12 | 14 | import android.widget.Button; |
13 | 15 | import android.widget.EditText; |
16 | +import android.widget.ImageButton; | |
14 | 17 | import android.widget.ImageView; |
15 | 18 | |
16 | 19 | import com.hjx.personalcenter.R; |
... | ... | @@ -32,9 +35,10 @@ import java.util.TimerTask; |
32 | 35 | */ |
33 | 36 | |
34 | 37 | public class ForgotPasswordActivity extends FragmentActivity implements View.OnClickListener { |
35 | - private ImageView back_forgit, iv_pwd_change; | |
38 | + private ImageView back_forgit, iv_pwd_change,iv_newpwd_change; | |
36 | 39 | private EditText forot_pwd_phone, forot_pwd_anthcode, forot_pwd_pwd, forot_pwd_pwd2; |
37 | 40 | private Button forot_pwd_sub, forot_pwd_getanthcode; |
41 | + private ImageButton phone_delete_btn,code_delete_btn; | |
38 | 42 | private String forot_pwd_phone1; |
39 | 43 | private String forot_pwd_anthcode1; |
40 | 44 | private String forot_pwd_pwd3; |
... | ... | @@ -43,6 +47,7 @@ public class ForgotPasswordActivity extends FragmentActivity implements View.OnC |
43 | 47 | private int delayTime=60; |
44 | 48 | private java.util.Timer Delaytimer; |
45 | 49 | public static Boolean showPassword = false; |
50 | + public static Boolean showNewPassword = false; | |
46 | 51 | |
47 | 52 | Handler handler = new Handler() { |
48 | 53 | @Override |
... | ... | @@ -116,6 +121,7 @@ public class ForgotPasswordActivity extends FragmentActivity implements View.OnC |
116 | 121 | setContentView(R.layout.activity_forgetpsword); |
117 | 122 | initView(); |
118 | 123 | setLister(); |
124 | + initTextWatch(); | |
119 | 125 | } |
120 | 126 | |
121 | 127 | //获取验证码 |
... | ... | @@ -134,17 +140,94 @@ public class ForgotPasswordActivity extends FragmentActivity implements View.OnC |
134 | 140 | forot_pwd_sub = (Button) findViewById(R.id.btn_ok); |
135 | 141 | forot_pwd_getanthcode = (Button) findViewById(R.id.btn_authcode); |
136 | 142 | iv_pwd_change = (ImageView) findViewById(R.id.iv_pwd_change); |
143 | + iv_newpwd_change = (ImageView) findViewById(R.id.iv_newpwd_change); | |
137 | 144 | back_forgit = (ImageView) findViewById(R.id.cancel); |
145 | + phone_delete_btn = (ImageButton) findViewById(R.id.phone_delete_btn); | |
146 | + code_delete_btn = (ImageButton) findViewById(R.id.code_delete_btn); | |
138 | 147 | } |
139 | 148 | |
140 | 149 | private void setLister() { |
141 | 150 | iv_pwd_change.setOnClickListener(this); |
151 | + iv_newpwd_change.setOnClickListener(this); | |
142 | 152 | back_forgit.setOnClickListener(this); |
143 | 153 | forot_pwd_sub.setOnClickListener(this); |
144 | 154 | forot_pwd_getanthcode.setOnClickListener(this); |
155 | + phone_delete_btn.setOnClickListener(this); | |
156 | + code_delete_btn.setOnClickListener(this); | |
145 | 157 | |
146 | 158 | } |
147 | 159 | |
160 | + /** | |
161 | + * 输入框改变的监听 | |
162 | + */ | |
163 | + private void initTextWatch() { | |
164 | + forot_pwd_phone.addTextChangedListener(new TextWatcher() { | |
165 | + @Override | |
166 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
167 | + } | |
168 | + | |
169 | + @Override | |
170 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
171 | + if (s.toString().length() == 0) { | |
172 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
173 | + } else { | |
174 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
175 | + } | |
176 | + } | |
177 | + | |
178 | + @Override | |
179 | + public void afterTextChanged(Editable s) { | |
180 | + | |
181 | + } | |
182 | + }); | |
183 | + forot_pwd_phone.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
184 | + @Override | |
185 | + public void onFocusChange(View v, boolean hasFocus) { | |
186 | + if (hasFocus) { | |
187 | + if (!forot_pwd_phone.getText().toString().isEmpty()) { | |
188 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
189 | + } | |
190 | + } else { | |
191 | + | |
192 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
193 | + } | |
194 | + } | |
195 | + }); | |
196 | + forot_pwd_anthcode.addTextChangedListener(new TextWatcher() { | |
197 | + @Override | |
198 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
199 | + | |
200 | + } | |
201 | + | |
202 | + @Override | |
203 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
204 | + if (s.toString().length() == 0) { | |
205 | + | |
206 | + code_delete_btn.setVisibility(View.INVISIBLE); | |
207 | + } else { | |
208 | + code_delete_btn.setVisibility(View.VISIBLE); | |
209 | + } | |
210 | + } | |
211 | + | |
212 | + @Override | |
213 | + public void afterTextChanged(Editable s) { | |
214 | + | |
215 | + } | |
216 | + }); | |
217 | + forot_pwd_anthcode.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
218 | + @Override | |
219 | + public void onFocusChange(View v, boolean hasFocus) { | |
220 | + if (hasFocus) { | |
221 | + if (!forot_pwd_anthcode.getText().toString().isEmpty()) { | |
222 | + code_delete_btn.setVisibility(View.VISIBLE); | |
223 | + } | |
224 | + } else { | |
225 | + code_delete_btn.setVisibility(View.INVISIBLE); | |
226 | + } | |
227 | + } | |
228 | + }); | |
229 | + } | |
230 | + | |
148 | 231 | |
149 | 232 | @Override |
150 | 233 | public void onClick(View view) { |
... | ... | @@ -197,10 +280,29 @@ public class ForgotPasswordActivity extends FragmentActivity implements View.OnC |
197 | 280 | forot_pwd_pwd.setSelection(forot_pwd_pwd.getText().toString().length()); |
198 | 281 | } |
199 | 282 | break; |
283 | + case R.id.iv_newpwd_change: | |
284 | + if (showNewPassword) {//显示密码 | |
285 | + showNewPassword = !showNewPassword; | |
286 | + iv_newpwd_change.setImageResource(R.mipmap.pwd_open); | |
287 | + forot_pwd_pwd2.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); | |
288 | + forot_pwd_pwd2.setSelection(forot_pwd_pwd.getText().toString().length()); | |
289 | + } else {//隐藏密码 | |
290 | + showNewPassword = !showNewPassword; | |
291 | + iv_newpwd_change.setImageResource(R.mipmap.pwd_hide); | |
292 | + forot_pwd_pwd2.setTransformationMethod(PasswordTransformationMethod.getInstance()); | |
293 | + forot_pwd_pwd2.setSelection(forot_pwd_pwd.getText().toString().length()); | |
294 | + } | |
295 | + break; | |
200 | 296 | |
201 | 297 | case R.id.cancel: |
202 | 298 | finish(); |
203 | 299 | break; |
300 | + case R.id.phone_delete_btn: | |
301 | + forot_pwd_phone.setText(""); | |
302 | + break; | |
303 | + case R.id.code_delete_btn: | |
304 | + forot_pwd_anthcode.setText(""); | |
305 | + break; | |
204 | 306 | } |
205 | 307 | } |
206 | 308 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/LoginAndRegisterActivity.java
... | ... | @@ -16,7 +16,9 @@ import com.hjx.personalcenter.db.SaveParam; |
16 | 16 | import com.hjx.personalcenter.fragment.LoginFragment; |
17 | 17 | import com.hjx.personalcenter.fragment.RegisterFragment; |
18 | 18 | import com.hjx.personalcenter.thirdparty.SlidingTabLayout; |
19 | +import com.hjx.personalcenter.update.UpdateChecker; | |
19 | 20 | import com.hjx.personalcenter.util.NetUtils; |
21 | +import com.hjx.personalcenter.util.PermissionUtil; | |
20 | 22 | import com.mylhyl.circledialog.CircleDialog; |
21 | 23 | import com.mylhyl.circledialog.callback.ConfigText; |
22 | 24 | import com.mylhyl.circledialog.params.TextParams; |
... | ... | @@ -82,6 +84,7 @@ public class LoginAndRegisterActivity extends FragmentActivity { |
82 | 84 | setContentView(R.layout.activity_loginandregister); |
83 | 85 | initView(); |
84 | 86 | initData(); |
87 | + updateVersion(); | |
85 | 88 | setLister(); |
86 | 89 | } |
87 | 90 | |
... | ... | @@ -117,5 +120,13 @@ public class LoginAndRegisterActivity extends FragmentActivity { |
117 | 120 | |
118 | 121 | } |
119 | 122 | |
123 | + //////版本更新 | |
124 | + private void updateVersion() { | |
125 | + if (PermissionUtil.hasReadExternalStoragePermission(this)) { | |
126 | + UpdateChecker updateChecker = new UpdateChecker(this); | |
127 | + updateChecker.checkForUpdates(); | |
128 | + } | |
129 | + } | |
130 | + | |
120 | 131 | |
121 | 132 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | +import android.app.Dialog; | |
3 | 4 | import android.content.Context; |
4 | 5 | import android.content.Intent; |
5 | 6 | import android.content.pm.PackageManager; |
... | ... | @@ -16,7 +17,10 @@ import android.support.v7.widget.LinearLayoutManager; |
16 | 17 | import android.support.v7.widget.RecyclerView; |
17 | 18 | import android.util.Log; |
18 | 19 | import android.view.KeyEvent; |
20 | +import android.view.LayoutInflater; | |
19 | 21 | import android.view.View; |
22 | +import android.view.ViewGroup; | |
23 | +import android.widget.Button; | |
20 | 24 | import android.widget.GridView; |
21 | 25 | import android.widget.ImageView; |
22 | 26 | import android.widget.LinearLayout; |
... | ... | @@ -64,7 +68,7 @@ import java.util.ArrayList; |
64 | 68 | import java.util.List; |
65 | 69 | |
66 | 70 | public class MainActivity extends FragmentActivity implements View.OnClickListener, DialogCallBack.CallBackView { |
67 | - private ImageView iv_imformatioan, iv_setting, iv_sign, iv_sex, tv_edit_presoninfo; | |
71 | + private ImageView iv_imformatioan, iv_setting, iv_sign, iv_sex,iv_switch, tv_edit_presoninfo; | |
68 | 72 | private TextView tv_sign, |
69 | 73 | tv_username, tv_username1, tv_mygad, tv_sex, tv_useinfo_adress, tv_useinfo_birthday, |
70 | 74 | tv_useinfo_qq, tv_useinfo_school, tv_useinfo_gender, tv_yangji; |
... | ... | @@ -90,6 +94,9 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
90 | 94 | private File file; |
91 | 95 | private Uri uri; |
92 | 96 | String portrait; |
97 | + private Button middle_btn,primary_btn; | |
98 | + private Dialog hintDialog; | |
99 | + | |
93 | 100 | Handler handler = new Handler() { |
94 | 101 | @Override |
95 | 102 | public void handleMessage(Message msg) { |
... | ... | @@ -225,6 +232,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
225 | 232 | Intent settingintent = new Intent(); |
226 | 233 | settingintent.setClass(MainActivity.this, LoginAndRegisterActivity.class); |
227 | 234 | startActivity(settingintent); |
235 | + MainActivity.this.finish(); | |
228 | 236 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
229 | 237 | } else if (status.equals("2002")) {//样机 |
230 | 238 | //sssssssss.setVisibility(View.INVISIBLE); |
... | ... | @@ -271,14 +279,15 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
271 | 279 | initData(); |
272 | 280 | initLister(); |
273 | 281 | updateVersion(); |
282 | + GetDevicesUtil.getMacAddress(this); | |
274 | 283 | } |
275 | 284 | |
276 | 285 | //////版本更新 |
277 | 286 | private void updateVersion() { |
278 | - UpdateChecker updateChecker = new UpdateChecker(this); | |
279 | - updateChecker.checkForUpdates(); | |
280 | - | |
281 | - | |
287 | + if (PermissionUtil.hasReadExternalStoragePermission(this)) { | |
288 | + UpdateChecker updateChecker = new UpdateChecker(this); | |
289 | + updateChecker.checkForUpdates(); | |
290 | + } | |
282 | 291 | } |
283 | 292 | |
284 | 293 | private void initView() { |
... | ... | @@ -292,6 +301,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
292 | 301 | mSimpleDraweeView = (ImageView) findViewById(R.id.iv_head); |
293 | 302 | //初始化个人信息 |
294 | 303 | iv_sex = (ImageView) findViewById(R.id.iv_sex); |
304 | + iv_switch = (ImageView) findViewById(R.id.iv_switch); | |
295 | 305 | tv_username = (TextView) findViewById(R.id.tv_username); |
296 | 306 | tv_username1 = (TextView) findViewById(R.id.tv_username1); |
297 | 307 | tv_mygad = (TextView) findViewById(R.id.tv_mygad); |
... | ... | @@ -323,7 +333,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
323 | 333 | uri = Uri.fromFile(file); |
324 | 334 | } else { |
325 | 335 | //通过FileProvider创建一个content类型的Uri(android 7.0需要这样的方法跨应用访问) |
326 | - uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter", file); | |
336 | + uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter.fileprovider", file); | |
327 | 337 | } |
328 | 338 | //设置布局管理器 |
329 | 339 | LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); |
... | ... | @@ -375,6 +385,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
375 | 385 | linel_mynote.setOnClickListener(this); |
376 | 386 | linel_mycollege.setOnClickListener(this); |
377 | 387 | linel_myclass.setOnClickListener(this); |
388 | + iv_switch.setOnClickListener(this); | |
378 | 389 | |
379 | 390 | } |
380 | 391 | |
... | ... | @@ -408,8 +419,8 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
408 | 419 | menuItems.add(new MenuItem(R.mipmap.blank, " 切换账户")); |
409 | 420 | menuItems.add(new MenuItem(R.mipmap.blank, " 账户管理")); |
410 | 421 | mTopRightMenu |
411 | - .setHeight(150) //默认高度480 | |
412 | - .setWidth(180) //默认宽度wrap_content | |
422 | + .setHeight(CropUtils.dp2px(this,100)) //默认高度480 | |
423 | + .setWidth(CropUtils.dp2px(this,110)) //默认宽度wrap_content | |
413 | 424 | .showIcon(showIcon) //显示菜单图标,默认为true |
414 | 425 | .dimBackground(dimBg) //背景变暗,默认为true |
415 | 426 | .needAnimationStyle(needAnim) //显示动画,默认为true |
... | ... | @@ -515,6 +526,19 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
515 | 526 | }) |
516 | 527 | .show(); |
517 | 528 | break; |
529 | + case R.id.iv_switch: | |
530 | + showSwitchDialog(); | |
531 | + break; | |
532 | + case R.id.middle_btn: | |
533 | + SaveParam.getInstance().saveLoginParam(MainActivity.this, SaveParam.GRADENS, "9"); | |
534 | + hintDialog.cancel(); | |
535 | + SysApplication.getInstance().exit(); | |
536 | + break; | |
537 | + case R.id.primary_btn: | |
538 | + SaveParam.getInstance().saveLoginParam(MainActivity.this, SaveParam.GRADENS, "3"); | |
539 | + hintDialog.cancel(); | |
540 | + SysApplication.getInstance().exit(); | |
541 | + break; | |
518 | 542 | case R.id.linel_mycuoti: |
519 | 543 | AlertUtils.showToast(this, "未安装该应用 "); |
520 | 544 | break; |
... | ... | @@ -777,12 +801,43 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen |
777 | 801 | } |
778 | 802 | } |
779 | 803 | break; |
804 | + case PermissionUtil.WRITE_EXTERNAL_STORAGE: | |
805 | + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { | |
806 | + // Permission Granted | |
807 | + UpdateChecker updateChecker = new UpdateChecker(this); | |
808 | + updateChecker.checkForUpdates(); | |
809 | + | |
810 | + } else { | |
811 | + if (!SharedPreferenceMark.getHasShowCamera()) { | |
812 | + new DialogPermission(this, "没有存储权限将导致应用无法更新"); | |
813 | + | |
814 | + } else { | |
815 | + Toast.makeText(this, "未获取存储权限,将导致应用无法更新", Toast.LENGTH_SHORT) | |
816 | + .show(); | |
817 | + } | |
818 | + } | |
819 | + break; | |
780 | 820 | default: |
781 | 821 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); |
782 | 822 | } |
783 | 823 | } |
784 | 824 | |
785 | 825 | |
826 | + private void showSwitchDialog() { | |
827 | + //自定义部分 | |
828 | + LayoutInflater mInflater = LayoutInflater.from(this); | |
829 | + View dialogView = mInflater.inflate(R.layout.dialog_layout, | |
830 | + null); | |
831 | + hintDialog = new Dialog(this, R.style.CustomHintDialog); | |
832 | + middle_btn = (Button) dialogView.findViewById(R.id.middle_btn); | |
833 | + primary_btn = (Button) dialogView.findViewById(R.id.primary_btn); | |
834 | + hintDialog.addContentView(dialogView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); | |
835 | + hintDialog.setCanceledOnTouchOutside(true); | |
836 | + hintDialog.show(); | |
837 | + middle_btn.setOnClickListener(this); | |
838 | + primary_btn.setOnClickListener(this); | |
839 | + } | |
840 | + | |
786 | 841 | private long exitTime = 0; |
787 | 842 | |
788 | 843 | @Override | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MyApplication.java
... | ... | @@ -31,44 +31,44 @@ public class MyApplication extends Application { |
31 | 31 | mImageCache = new ImageCache(); |
32 | 32 | instance = this; |
33 | 33 | CrashReport.initCrashReport(getApplicationContext(), "0c9a6274e0", false); |
34 | - CrashHandler crashHandler = CrashHandler.getInstance(); | |
35 | - //生成错误日志,上线的时候得放开 | |
36 | - crashHandler.init(getApplicationContext()); | |
37 | - crashHandler.registerHandler(new CrashHandler.ExceptionHandler() { | |
38 | - | |
39 | - @Override | |
40 | - public boolean handleCrash(final Context context, final Throwable ex) { | |
41 | - new Thread(new Runnable() { | |
42 | - @Override | |
43 | - public void run() { | |
44 | - Looper.prepare(); | |
45 | - System.out.println("bcz = " + ex.toString()); | |
46 | - Toast toast = new Toast(context); | |
47 | - TextView tv = new TextView(context); | |
48 | - tv.setText(" 很抱歉,"+context.getString(R.string.app_name)+"崩溃了,我们会尽快修复."); | |
49 | - tv.setPadding(10, 10, 10, 10); | |
50 | - tv.setTextSize(20); | |
51 | - tv.setBackgroundResource(R.drawable.black_btn_default); | |
52 | - tv.setTextColor(context.getResources().getColor(android.R.color.white)); | |
53 | - Drawable drawable= context.getResources().getDrawable(R.drawable.sorry); | |
54 | - drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); | |
55 | - tv.setCompoundDrawables(drawable,null,null,null); | |
56 | - toast.setView(tv); | |
57 | - toast.setGravity(Gravity.CENTER, 0, 0); | |
58 | - toast.setDuration(Toast.LENGTH_LONG); | |
59 | - toast.show(); | |
60 | - Looper.loop(); | |
61 | - } | |
62 | - }).start(); | |
63 | - try { | |
64 | - Thread.sleep(1000); | |
65 | - } catch (InterruptedException e) { | |
66 | - // TODO Auto-generated catch block | |
67 | - e.printStackTrace(); | |
68 | - } | |
69 | - return false; | |
70 | - } | |
71 | - }); | |
34 | +// CrashHandler crashHandler = CrashHandler.getInstance(); | |
35 | +// //生成错误日志,上线的时候得放开 | |
36 | +// crashHandler.init(getApplicationContext()); | |
37 | +// crashHandler.registerHandler(new CrashHandler.ExceptionHandler() { | |
38 | +// | |
39 | +// @Override | |
40 | +// public boolean handleCrash(final Context context, final Throwable ex) { | |
41 | +// new Thread(new Runnable() { | |
42 | +// @Override | |
43 | +// public void run() { | |
44 | +// Looper.prepare(); | |
45 | +// System.out.println("bcz = " + ex.toString()); | |
46 | +// Toast toast = new Toast(context); | |
47 | +// TextView tv = new TextView(context); | |
48 | +// tv.setText(" 很抱歉,"+context.getString(R.string.app_name)+"崩溃了,我们会尽快修复."); | |
49 | +// tv.setPadding(10, 10, 10, 10); | |
50 | +// tv.setTextSize(20); | |
51 | +// tv.setBackgroundResource(R.drawable.black_btn_default); | |
52 | +// tv.setTextColor(context.getResources().getColor(android.R.color.white)); | |
53 | +// Drawable drawable= context.getResources().getDrawable(R.drawable.sorry); | |
54 | +// drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); | |
55 | +// tv.setCompoundDrawables(drawable,null,null,null); | |
56 | +// toast.setView(tv); | |
57 | +// toast.setGravity(Gravity.CENTER, 0, 0); | |
58 | +// toast.setDuration(Toast.LENGTH_LONG); | |
59 | +// toast.show(); | |
60 | +// Looper.loop(); | |
61 | +// } | |
62 | +// }).start(); | |
63 | +// try { | |
64 | +// Thread.sleep(1000); | |
65 | +// } catch (InterruptedException e) { | |
66 | +// // TODO Auto-generated catch block | |
67 | +// e.printStackTrace(); | |
68 | +// } | |
69 | +// return false; | |
70 | +// } | |
71 | +// }); | |
72 | 72 | super.onCreate(); |
73 | 73 | } |
74 | 74 | public ImageCache getImageCache() { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java
... | ... | @@ -3,10 +3,14 @@ package com.hjx.personalcenter.activity; |
3 | 3 | import android.content.Intent; |
4 | 4 | import android.os.Bundle; |
5 | 5 | import android.support.v4.app.FragmentActivity; |
6 | +import android.text.Editable; | |
6 | 7 | import android.text.TextUtils; |
8 | +import android.text.TextWatcher; | |
7 | 9 | import android.view.View; |
8 | 10 | import android.widget.Button; |
9 | 11 | import android.widget.EditText; |
12 | +import android.widget.ImageButton; | |
13 | +import android.widget.LinearLayout; | |
10 | 14 | import android.widget.TextView; |
11 | 15 | |
12 | 16 | import com.hjx.personalcenter.R; |
... | ... | @@ -36,8 +40,10 @@ import java.util.ArrayList; |
36 | 40 | |
37 | 41 | public class RegisterInfoActivity extends FragmentActivity implements View.OnClickListener, DialogCallBack.GradeCallBack, DialogCallBack.ProvincesCallBack |
38 | 42 | , DialogCallBack.CitysCallBack, DialogCallBack.CountryCallBack, DialogCallBack.SchoolCallBack { |
39 | - private EditText et_username; | |
43 | + private EditText et_username, et_nickname, et_address; | |
44 | + private ImageButton username_delete_btn, nickname_delete_btn, address_delete_btn; | |
40 | 45 | private TextView et_region, et_grade, et_school; |
46 | + private LinearLayout et_username_layout, et_address_layout; | |
41 | 47 | private Button btn_ok; |
42 | 48 | |
43 | 49 | @Override |
... | ... | @@ -48,14 +54,22 @@ public class RegisterInfoActivity extends FragmentActivity implements View.OnCli |
48 | 54 | initView(); |
49 | 55 | initData(); |
50 | 56 | initLister(); |
57 | + initTextWatch(); | |
51 | 58 | } |
52 | 59 | |
53 | 60 | private void initView() { |
54 | 61 | et_username = (EditText) findViewById(R.id.et_username); |
62 | + et_nickname = (EditText) findViewById(R.id.et_nickname); | |
63 | + et_address = (EditText) findViewById(R.id.et_address); | |
55 | 64 | et_region = (TextView) findViewById(R.id.et_region); |
56 | 65 | et_grade = (TextView) findViewById(R.id.et_grade); |
57 | 66 | et_school = (TextView) findViewById(R.id.et_school); |
58 | 67 | btn_ok = (Button) findViewById(R.id.btn_ok); |
68 | + username_delete_btn = (ImageButton) findViewById(R.id.username_delete_btn); | |
69 | + nickname_delete_btn = (ImageButton) findViewById(R.id.nickname_delete_btn); | |
70 | + address_delete_btn = (ImageButton) findViewById(R.id.address_delete_btn); | |
71 | + et_username_layout = (LinearLayout) findViewById(R.id.et_username_layout); | |
72 | + et_address_layout = (LinearLayout) findViewById(R.id.et_address_layout); | |
59 | 73 | |
60 | 74 | |
61 | 75 | } |
... | ... | @@ -63,6 +77,8 @@ public class RegisterInfoActivity extends FragmentActivity implements View.OnCli |
63 | 77 | private void initData() { |
64 | 78 | if (Content.accountflag == 2) { |
65 | 79 | btn_ok.setText("提交"); |
80 | + et_username_layout.setVisibility(View.GONE); | |
81 | + et_address_layout.setVisibility(View.GONE); | |
66 | 82 | |
67 | 83 | } |
68 | 84 | |
... | ... | @@ -73,16 +89,125 @@ public class RegisterInfoActivity extends FragmentActivity implements View.OnCli |
73 | 89 | et_grade.setOnClickListener(this); |
74 | 90 | et_school.setOnClickListener(this); |
75 | 91 | btn_ok.setOnClickListener(this); |
92 | + username_delete_btn.setOnClickListener(this); | |
93 | + nickname_delete_btn.setOnClickListener(this); | |
94 | + address_delete_btn.setOnClickListener(this); | |
76 | 95 | |
77 | 96 | |
78 | 97 | } |
79 | 98 | |
99 | + /** | |
100 | + * 输入框改变的监听 | |
101 | + */ | |
102 | + private void initTextWatch() { | |
103 | + et_username.addTextChangedListener(new TextWatcher() { | |
104 | + @Override | |
105 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
106 | + } | |
107 | + | |
108 | + @Override | |
109 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
110 | + if (s.toString().length() == 0) { | |
111 | + username_delete_btn.setVisibility(View.INVISIBLE); | |
112 | + } else { | |
113 | + username_delete_btn.setVisibility(View.VISIBLE); | |
114 | + } | |
115 | + } | |
116 | + | |
117 | + @Override | |
118 | + public void afterTextChanged(Editable s) { | |
119 | + | |
120 | + } | |
121 | + }); | |
122 | + et_username.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
123 | + @Override | |
124 | + public void onFocusChange(View v, boolean hasFocus) { | |
125 | + if (hasFocus) { | |
126 | + if (!et_username.getText().toString().isEmpty()) { | |
127 | + username_delete_btn.setVisibility(View.VISIBLE); | |
128 | + } | |
129 | + } else { | |
130 | + | |
131 | + username_delete_btn.setVisibility(View.INVISIBLE); | |
132 | + } | |
133 | + } | |
134 | + }); | |
135 | + et_nickname.addTextChangedListener(new TextWatcher() { | |
136 | + @Override | |
137 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
138 | + | |
139 | + } | |
140 | + | |
141 | + @Override | |
142 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
143 | + if (s.toString().length() == 0) { | |
144 | + | |
145 | + nickname_delete_btn.setVisibility(View.INVISIBLE); | |
146 | + } else { | |
147 | + nickname_delete_btn.setVisibility(View.VISIBLE); | |
148 | + } | |
149 | + } | |
150 | + | |
151 | + @Override | |
152 | + public void afterTextChanged(Editable s) { | |
153 | + | |
154 | + } | |
155 | + }); | |
156 | + et_nickname.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
157 | + @Override | |
158 | + public void onFocusChange(View v, boolean hasFocus) { | |
159 | + if (hasFocus) { | |
160 | + if (!et_nickname.getText().toString().isEmpty()) { | |
161 | + nickname_delete_btn.setVisibility(View.VISIBLE); | |
162 | + } | |
163 | + } else { | |
164 | + nickname_delete_btn.setVisibility(View.INVISIBLE); | |
165 | + } | |
166 | + } | |
167 | + }); | |
168 | + et_address.addTextChangedListener(new TextWatcher() { | |
169 | + @Override | |
170 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
171 | + | |
172 | + } | |
173 | + | |
174 | + @Override | |
175 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
176 | + if (s.toString().length() == 0) { | |
177 | + | |
178 | + address_delete_btn.setVisibility(View.INVISIBLE); | |
179 | + } else { | |
180 | + address_delete_btn.setVisibility(View.VISIBLE); | |
181 | + } | |
182 | + } | |
183 | + | |
184 | + @Override | |
185 | + public void afterTextChanged(Editable s) { | |
186 | + | |
187 | + } | |
188 | + }); | |
189 | + et_address.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
190 | + @Override | |
191 | + public void onFocusChange(View v, boolean hasFocus) { | |
192 | + if (hasFocus) { | |
193 | + if (!et_address.getText().toString().isEmpty()) { | |
194 | + address_delete_btn.setVisibility(View.VISIBLE); | |
195 | + } | |
196 | + } else { | |
197 | + address_delete_btn.setVisibility(View.INVISIBLE); | |
198 | + } | |
199 | + } | |
200 | + }); | |
201 | + } | |
202 | + | |
80 | 203 | @Override |
81 | 204 | public void onClick(View v) { |
82 | - String register1 = et_username.getText().toString().trim(); | |
205 | + String register1 = et_nickname.getText().toString().trim(); | |
83 | 206 | String register2 = et_region.getText().toString().trim(); |
84 | 207 | String register3 = et_grade.getText().toString().trim(); |
85 | 208 | String register4 = et_school.getText().toString().trim(); |
209 | + String register5 = et_username.getText().toString().trim(); | |
210 | + String register6 = et_address.getText().toString().trim(); | |
86 | 211 | switch (v.getId()) { |
87 | 212 | case R.id.et_region: |
88 | 213 | et_school.setText(""); |
... | ... | @@ -104,25 +229,30 @@ public class RegisterInfoActivity extends FragmentActivity implements View.OnCli |
104 | 229 | |
105 | 230 | break; |
106 | 231 | case R.id.btn_ok: |
107 | - if (TextUtils.isEmpty(register1) || | |
108 | - TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3)) { | |
232 | + if (Content.accountflag == 2 && (TextUtils.isEmpty(register1) || | |
233 | + TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3) || TextUtils.isEmpty(register4))) { | |
234 | + AlertUtils.showToast(RegisterInfoActivity.this, "请将必填项填写完整"); | |
235 | + return; | |
236 | + } else if (Content.accountflag == 1 && (TextUtils.isEmpty(register1) || | |
237 | + TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3) || TextUtils.isEmpty(register4) | |
238 | + || TextUtils.isEmpty(register5) || TextUtils.isEmpty(register6))) { | |
109 | 239 | AlertUtils.showToast(RegisterInfoActivity.this, "请将必填项填写完整"); |
110 | 240 | return; |
111 | 241 | } else { |
112 | - String register5 = et_username.getText().toString().trim(); | |
113 | - String register6 = et_region.getText().toString().trim(); | |
114 | - String register7 = et_grade.getText().toString().trim(); | |
115 | - String register8 = et_school.getText().toString().trim(); | |
116 | - String grade = SaveParam.getInstance().getLoginParam(this, SaveParam.CHILDSGRADENS); | |
242 | +// String register5 = et_username.getText().toString().trim(); | |
243 | +// String register6 = et_region.getText().toString().trim(); | |
244 | +// String register7 = et_grade.getText().toString().trim(); | |
245 | +// String register8 = et_school.getText().toString().trim(); | |
246 | + String grade = SaveParam.getInstance().getLoginParam(this, SaveParam.CHILDSGRADENS); | |
117 | 247 | if (Content.accountflag == 2) { |
118 | - String accounts = SaveParam.getInstance().getCustomizeParam(RegisterInfoActivity.this,SaveParam.ACCOUNT); | |
248 | + String accounts = SaveParam.getInstance().getCustomizeParam(RegisterInfoActivity.this, SaveParam.ACCOUNT); | |
119 | 249 | String userID = SaveParam.getInstance().getLoginParam(this, "userId"); |
120 | 250 | // if ("2".equals(accounts)){ |
121 | 251 | // grade = SaveParam.getInstance().getCustomizeParam(this, SaveParam.CHILDSGRADENS); |
122 | 252 | // } |
123 | 253 | //else { |
124 | 254 | |
125 | - // } | |
255 | + // } | |
126 | 256 | |
127 | 257 | String School = SaveParam.getInstance().getLoginParam(this, SaveParam.SCHOOOlID); |
128 | 258 | String regionId = SaveParam.getInstance().getsaveCityParam(this, SaveParam.COUNTRY); |
... | ... | @@ -136,14 +266,14 @@ public class RegisterInfoActivity extends FragmentActivity implements View.OnCli |
136 | 266 | Object schoolss; |
137 | 267 | long auserID = Long.parseLong(userID); |
138 | 268 | long grades = Long.parseLong(grade); |
139 | - if (TextUtils.isEmpty(register8)) { | |
269 | + if (TextUtils.isEmpty(register4)) { | |
140 | 270 | schoolss = null; |
141 | 271 | } else { |
142 | 272 | schoolss = Long.parseLong(School); |
143 | 273 | } |
144 | 274 | long regionIds = Long.parseLong(regionId); |
145 | 275 | HttpManager.getInstance().addchildAccountinfo(RegisterInfoActivity.this, auserID, "http://hjxprodbucket.oss.aliyuncs.com/static/upload/boss_api/announcement/2017-08-29/a00de899-2f6d-43fb-9e30-71883842540e.png", |
146 | - register5, grades, schoolss, regionIds, devicenumber, register6); | |
276 | + register1, grades, schoolss, regionIds, devicenumber, register2); | |
147 | 277 | |
148 | 278 | } catch (NumberFormatException e) { |
149 | 279 | e.printStackTrace(); |
... | ... | @@ -160,19 +290,27 @@ public class RegisterInfoActivity extends FragmentActivity implements View.OnCli |
160 | 290 | } |
161 | 291 | |
162 | 292 | break; |
293 | + | |
294 | + case R.id.username_delete_btn: | |
295 | + et_username.setText(""); | |
296 | + break; | |
297 | + case R.id.nickname_delete_btn: | |
298 | + et_nickname.setText(""); | |
299 | + break; | |
300 | + case R.id.address_delete_btn: | |
301 | + et_address.setText(""); | |
302 | + break; | |
163 | 303 | } |
164 | 304 | |
165 | 305 | } |
166 | 306 | |
167 | 307 | private void savedata() { |
168 | - String register9 = et_username.getText().toString().trim(); | |
169 | - String register10 = et_region.getText().toString().trim(); | |
170 | - String register11 = et_grade.getText().toString().trim(); | |
171 | - String register12 = et_school.getText().toString().trim(); | |
172 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.USERNAME,register9); | |
173 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.ADRESS,register10); | |
174 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.GRADES,register11); | |
175 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.SCHOOL,register12); | |
308 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.REALNAME, et_username.getText().toString().trim()); | |
309 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.NICKNAME, et_nickname.getText().toString().trim()); | |
310 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.REGION, et_region.getText().toString().trim()); | |
311 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.GRADES, et_grade.getText().toString().trim()); | |
312 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.SCHOOL, et_school.getText().toString().trim()); | |
313 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.ADDRESS, et_address.getText().toString().trim()); | |
176 | 314 | |
177 | 315 | |
178 | 316 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/TheStartPageActivity.java
... | ... | @@ -6,6 +6,7 @@ import android.support.v4.app.FragmentActivity; |
6 | 6 | import android.view.KeyEvent; |
7 | 7 | import android.view.View; |
8 | 8 | import android.widget.Button; |
9 | +import android.widget.ImageButton; | |
9 | 10 | |
10 | 11 | import com.hjx.personalcenter.R; |
11 | 12 | import com.hjx.personalcenter.db.SaveParam; |
... | ... | @@ -15,7 +16,7 @@ import com.hjx.personalcenter.db.SaveParam; |
15 | 16 | */ |
16 | 17 | |
17 | 18 | public class TheStartPageActivity extends FragmentActivity implements View.OnClickListener { |
18 | - private Button btn_start; | |
19 | + private ImageButton btn_start; | |
19 | 20 | @Override |
20 | 21 | protected void onCreate(Bundle savedInstanceState) { |
21 | 22 | super.onCreate(savedInstanceState); |
... | ... | @@ -26,7 +27,7 @@ public class TheStartPageActivity extends FragmentActivity implements View.OnCli |
26 | 27 | initLister(); |
27 | 28 | } |
28 | 29 | private void initView() { |
29 | - btn_start = (Button) findViewById(R.id.btn_start); | |
30 | + btn_start = (ImageButton) findViewById(R.id.btn_start); | |
30 | 31 | } |
31 | 32 | |
32 | 33 | private void initData() { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/CountryDialog.java
... | ... | @@ -13,6 +13,7 @@ import android.view.ViewGroup; |
13 | 13 | import android.widget.AdapterView; |
14 | 14 | import android.widget.ImageView; |
15 | 15 | import android.widget.ListView; |
16 | +import android.widget.Toast; | |
16 | 17 | |
17 | 18 | import com.hjx.personalcenter.R; |
18 | 19 | import com.hjx.personalcenter.adapter.CountryAdapter; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java
... | ... | @@ -25,7 +25,7 @@ public class ElectronicCardDialog extends BaseCircleDialog { |
25 | 25 | public static ElectronicCardDialog getInstance() { |
26 | 26 | ElectronicCardDialog dialogFragment = new ElectronicCardDialog(); |
27 | 27 | dialogFragment.setCanceledBack(true); |
28 | - dialogFragment.setCanceledOnTouchOutside(true); | |
28 | + dialogFragment.setCanceledOnTouchOutside(false); | |
29 | 29 | dialogFragment.setRadius(CircleDimen.RADIUS); |
30 | 30 | dialogFragment.setWidth(0.8f); |
31 | 31 | dialogFragment.setGravity(Gravity.CENTER); |
... | ... | @@ -39,6 +39,7 @@ public class ElectronicCardDialog extends BaseCircleDialog { |
39 | 39 | @Override |
40 | 40 | public void onActivityCreated(Bundle savedInstanceState) { |
41 | 41 | super.onActivityCreated(savedInstanceState); |
42 | + | |
42 | 43 | getView().findViewById(R.id.fill_card).setOnClickListener(new View.OnClickListener() { |
43 | 44 | @Override |
44 | 45 | public void onClick(View v) { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/db/SaveParam.java
... | ... | @@ -22,10 +22,12 @@ public class SaveParam { |
22 | 22 | public static String VIEGREADE = "vergrade"; |
23 | 23 | public static String ISYANGJI = "isyangji";//是否样机 |
24 | 24 | //个人信息 |
25 | - public static String USERNAME = "usernames";//昵称 | |
26 | - public static String ADRESS = "adress";//地址 | |
25 | + public static String NICKNAME = "nickname";//昵称 | |
26 | + public static String REGION = "region";//地区 | |
27 | 27 | public static String GRADES = "gadens";//年级 |
28 | 28 | public static String SCHOOL = "school";//学校 |
29 | + public static String REALNAME = "realName";//真实姓名 | |
30 | + public static String ADDRESS = "address";//家庭地址 | |
29 | 31 | public static String CONSTELLATION = "constellations";//星座 |
30 | 32 | public static String HEADURL = "headurl";//头像 |
31 | 33 | |
... | ... | @@ -48,7 +50,10 @@ public class SaveParam { |
48 | 50 | public static String ADRESSCUNSTEM = "adresscunstem";//客户地址 |
49 | 51 | public static String SHOPTIME = "shoptime";//购买时间 |
50 | 52 | public static String SHOPADRESS = "shopadress";//购买地址 |
53 | + public static String SHOPADRESS_ID = "shopadress_id";//购买地址id | |
51 | 54 | public static String SHOPTLEPHONE = "shoptlephone";//售后电话 |
55 | + public static String SALES_PHONE = "sales_phone";//导购员手机号 | |
56 | + public static String SALES_ID = "sales_id";//导购员手机号 | |
52 | 57 | |
53 | 58 | //省市区参数、 |
54 | 59 | public static String PROVINCES = "provinces";//省 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/LoginFragment.java
... | ... | @@ -6,12 +6,16 @@ import android.os.Handler; |
6 | 6 | import android.os.Message; |
7 | 7 | import android.support.annotation.Nullable; |
8 | 8 | import android.support.v4.app.Fragment; |
9 | +import android.text.Editable; | |
9 | 10 | import android.text.TextUtils; |
11 | +import android.text.TextWatcher; | |
12 | +import android.util.Log; | |
10 | 13 | import android.view.LayoutInflater; |
11 | 14 | import android.view.View; |
12 | 15 | import android.view.ViewGroup; |
13 | 16 | import android.widget.Button; |
14 | 17 | import android.widget.EditText; |
18 | +import android.widget.ImageButton; | |
15 | 19 | import android.widget.TextView; |
16 | 20 | import android.widget.Toast; |
17 | 21 | |
... | ... | @@ -41,9 +45,11 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
41 | 45 | private int type; |
42 | 46 | private TextView tv_forget_pwd; |
43 | 47 | private Button btn_login; |
48 | + private ImageButton phone_delete_btn,password_delete_btn; | |
44 | 49 | private EditText phonenumber, login_pwwd; |
45 | 50 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; |
46 | 51 | Intent intent = new Intent(); |
52 | + private String name; | |
47 | 53 | |
48 | 54 | public static LoginFragment newInstance(int type) { |
49 | 55 | LoginFragment fragment = new LoginFragment(); |
... | ... | @@ -69,7 +75,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
69 | 75 | if (status.equals("100")) { |
70 | 76 | String access_token = jsonObject.getString("access_token"); |
71 | 77 | String userId = jsonObject.getString("userId"); |
72 | - final String name = phonenumber.getText().toString().trim(); | |
78 | + name = phonenumber.getText().toString().trim(); | |
73 | 79 | final String pwd = login_pwwd.getText().toString().trim(); |
74 | 80 | // |
75 | 81 | try { |
... | ... | @@ -102,6 +108,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
102 | 108 | case HttpCode.REGISTER_SUCESS: |
103 | 109 | try { |
104 | 110 | jsonObject = new JSONObject((String) msg.obj); |
111 | + Log.e("AAAAAAA",(String) msg.obj); | |
105 | 112 | status = jsonObject.optString("status"); |
106 | 113 | JSONObject isregisterinfo = (JSONObject) jsonObject.opt("data"); |
107 | 114 | boolean isRegisterInfoComplete = isregisterinfo.optBoolean("isRegisterInfoComplete"); |
... | ... | @@ -122,6 +129,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
122 | 129 | |
123 | 130 | } else { |
124 | 131 | Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_LONG).show(); |
132 | + | |
125 | 133 | } |
126 | 134 | |
127 | 135 | } catch (JSONException e) { |
... | ... | @@ -132,24 +140,25 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
132 | 140 | case HttpCode.CHECKCARD: |
133 | 141 | try { |
134 | 142 | jsonObject = new JSONObject((String) msg.obj); |
143 | + | |
135 | 144 | status = jsonObject.optString("status"); |
136 | - if (status.equals("1")) { | |
145 | + if (name.equals(getString(R.string.static_str)) || status.equals("2002")) { | |
146 | + SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.YANGJI, "1"); | |
137 | 147 | SaveParam.getInstance().saveLoginParam(getActivity(), "login", "true"); |
138 | 148 | Intent intent = new Intent(); |
139 | 149 | intent.setClass(getActivity(), MainActivity.class); |
140 | 150 | getActivity().startActivity(intent); |
141 | 151 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
142 | - getActivity().finish(); | |
143 | - | |
144 | - } else if (status.equals("2002")) { | |
145 | - SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.YANGJI, "1"); | |
152 | + } else if (status.equals("1")) { | |
146 | 153 | SaveParam.getInstance().saveLoginParam(getActivity(), "login", "true"); |
147 | 154 | Intent intent = new Intent(); |
148 | 155 | intent.setClass(getActivity(), MainActivity.class); |
149 | 156 | getActivity().startActivity(intent); |
150 | 157 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
158 | + getActivity().finish(); | |
159 | + | |
151 | 160 | } else if (status.equals("2001")) { |
152 | - SaveParam.getInstance().saveCustomizeParam(getActivity(),SaveParam.CARDPHONE,""); | |
161 | + SaveParam.getInstance().saveCustomizeParam(getActivity(), SaveParam.CARDPHONE, ""); | |
153 | 162 | ElectronicCardDialog.getInstance().show(getChildFragmentManager(), "ElectronicCardDialog"); |
154 | 163 | } else { |
155 | 164 | Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_LONG).show(); |
... | ... | @@ -170,6 +179,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
170 | 179 | mView = inflater.inflate(R.layout.fragment_loginandregister_login, container, false); |
171 | 180 | initView(mView); |
172 | 181 | initData(); |
182 | + initTextWatch(); | |
173 | 183 | setLister(); |
174 | 184 | } |
175 | 185 | return mView; |
... | ... | @@ -181,15 +191,91 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
181 | 191 | phonenumber = (EditText) mView.findViewById(R.id.et_phonenumber); |
182 | 192 | login_pwwd = (EditText) mView.findViewById(R.id.et_password); |
183 | 193 | btn_login = (Button) mView.findViewById(R.id.btn_login); |
194 | + phone_delete_btn = (ImageButton) mView.findViewById(R.id.phone_delete_btn); | |
195 | + password_delete_btn = (ImageButton) mView.findViewById(R.id.password_delete_btn); | |
184 | 196 | |
185 | 197 | } |
186 | 198 | |
199 | + /** | |
200 | + * 输入框改变的监听 | |
201 | + */ | |
202 | + private void initTextWatch() { | |
203 | + phonenumber.addTextChangedListener(new TextWatcher() { | |
204 | + @Override | |
205 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
206 | + } | |
207 | + | |
208 | + @Override | |
209 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
210 | + if (s.toString().length() == 0) { | |
211 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
212 | + } else { | |
213 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
214 | + } | |
215 | + } | |
216 | + | |
217 | + @Override | |
218 | + public void afterTextChanged(Editable s) { | |
219 | + | |
220 | + } | |
221 | + }); | |
222 | + phonenumber.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
223 | + @Override | |
224 | + public void onFocusChange(View v, boolean hasFocus) { | |
225 | + if (hasFocus) { | |
226 | + if (!phonenumber.getText().toString().isEmpty()) { | |
227 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
228 | + } | |
229 | + } else { | |
230 | + | |
231 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
232 | + } | |
233 | + } | |
234 | + }); | |
235 | + login_pwwd.addTextChangedListener(new TextWatcher() { | |
236 | + @Override | |
237 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
238 | + | |
239 | + } | |
240 | + | |
241 | + @Override | |
242 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
243 | + if (s.toString().length() == 0) { | |
244 | + | |
245 | + password_delete_btn.setVisibility(View.INVISIBLE); | |
246 | + } else { | |
247 | + password_delete_btn.setVisibility(View.VISIBLE); | |
248 | + } | |
249 | + } | |
250 | + | |
251 | + @Override | |
252 | + public void afterTextChanged(Editable s) { | |
253 | + | |
254 | + } | |
255 | + }); | |
256 | + login_pwwd.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
257 | + @Override | |
258 | + public void onFocusChange(View v, boolean hasFocus) { | |
259 | + if (hasFocus) { | |
260 | + if (!login_pwwd.getText().toString().isEmpty()) { | |
261 | + password_delete_btn.setVisibility(View.VISIBLE); | |
262 | + } | |
263 | + } else { | |
264 | + password_delete_btn.setVisibility(View.INVISIBLE); | |
265 | + } | |
266 | + } | |
267 | + }); | |
268 | + } | |
269 | + | |
270 | + | |
187 | 271 | private void initData() { |
188 | 272 | } |
189 | 273 | |
190 | 274 | private void setLister() { |
191 | 275 | tv_forget_pwd.setOnClickListener(this); |
192 | 276 | btn_login.setOnClickListener(this); |
277 | + phone_delete_btn.setOnClickListener(this); | |
278 | + password_delete_btn.setOnClickListener(this); | |
193 | 279 | } |
194 | 280 | |
195 | 281 | |
... | ... | @@ -204,6 +290,12 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
204 | 290 | case R.id.btn_login: |
205 | 291 | login(); |
206 | 292 | break; |
293 | + case R.id.phone_delete_btn: | |
294 | + phonenumber.setText(""); | |
295 | + break; | |
296 | + case R.id.password_delete_btn: | |
297 | + login_pwwd.setText(""); | |
298 | + break; | |
207 | 299 | } |
208 | 300 | |
209 | 301 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java
... | ... | @@ -6,14 +6,18 @@ import android.os.Handler; |
6 | 6 | import android.os.Message; |
7 | 7 | import android.support.annotation.Nullable; |
8 | 8 | import android.support.v4.app.Fragment; |
9 | +import android.text.Editable; | |
9 | 10 | import android.text.TextUtils; |
11 | +import android.text.TextWatcher; | |
10 | 12 | import android.text.method.HideReturnsTransformationMethod; |
11 | 13 | import android.text.method.PasswordTransformationMethod; |
14 | +import android.util.Log; | |
12 | 15 | import android.view.LayoutInflater; |
13 | 16 | import android.view.View; |
14 | 17 | import android.view.ViewGroup; |
15 | 18 | import android.widget.Button; |
16 | 19 | import android.widget.EditText; |
20 | +import android.widget.ImageButton; | |
17 | 21 | import android.widget.ImageView; |
18 | 22 | |
19 | 23 | import com.hjx.personalcenter.R; |
... | ... | @@ -40,6 +44,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
40 | 44 | private View mView; |
41 | 45 | |
42 | 46 | private Button btn_register,get_authcode; |
47 | + private ImageButton phone_delete_btn,code_delete_btn; | |
43 | 48 | private EditText phonenumber,password,anth_6num;//;//密码 |
44 | 49 | private ImageView openeyes; |
45 | 50 | private String sourceStr ="android"; |
... | ... | @@ -70,9 +75,9 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
70 | 75 | jsonObject = (JSONObject) msg.obj; |
71 | 76 | status = jsonObject.getString("status"); |
72 | 77 | //AlertUtils.showToast(RegisterActivity.this, jsonObject.optString("message")); |
73 | - String access_token = jsonObject.getString("access_token"); | |
74 | - String userId = jsonObject.getString("userId"); | |
75 | 78 | if (status.equals("100")) { |
79 | + String access_token = jsonObject.getString("access_token"); | |
80 | + String userId = jsonObject.getString("userId"); | |
76 | 81 | String usernameStr = phonenumber.getText().toString().trim(); |
77 | 82 | String passwordStr = password.getText().toString().trim(); |
78 | 83 | HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,userId); |
... | ... | @@ -85,7 +90,10 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
85 | 90 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
86 | 91 | }else if(status.equals("209")){ |
87 | 92 | AlertUtils.showToast(getActivity(), "验证码错误!"); |
93 | + }else{ | |
94 | + AlertUtils.showToast(getActivity(), "请检查网络!"); | |
88 | 95 | } |
96 | + Log.d("AAAAA",status+""); | |
89 | 97 | break; |
90 | 98 | case HttpCode.REGISTERED_FAIL: |
91 | 99 | AlertUtils.showToast(getActivity(), "注册失败"); |
... | ... | @@ -139,6 +147,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
139 | 147 | mView = inflater.inflate(R.layout.fragment_loginandregister_register, container, false); |
140 | 148 | initView(mView); |
141 | 149 | initData(); |
150 | + initTextWatch(); | |
142 | 151 | setLister(); |
143 | 152 | |
144 | 153 | |
... | ... | @@ -153,14 +162,90 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
153 | 162 | password = (EditText) mView.findViewById(R.id.et_password); |
154 | 163 | openeyes= (ImageView) mView.findViewById(R.id.iv_pwd_change); |
155 | 164 | btn_register = (Button) mView.findViewById(R.id.btn_register); |
165 | + phone_delete_btn = (ImageButton) mView.findViewById(R.id.phone_delete_btn); | |
166 | + code_delete_btn = (ImageButton) mView.findViewById(R.id.code_delete_btn); | |
156 | 167 | |
157 | 168 | } |
169 | + | |
170 | + /** | |
171 | + * 输入框改变的监听 | |
172 | + */ | |
173 | + private void initTextWatch() { | |
174 | + phonenumber.addTextChangedListener(new TextWatcher() { | |
175 | + @Override | |
176 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
177 | + } | |
178 | + | |
179 | + @Override | |
180 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
181 | + if (s.toString().length() == 0) { | |
182 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
183 | + } else { | |
184 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
185 | + } | |
186 | + } | |
187 | + | |
188 | + @Override | |
189 | + public void afterTextChanged(Editable s) { | |
190 | + | |
191 | + } | |
192 | + }); | |
193 | + phonenumber.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
194 | + @Override | |
195 | + public void onFocusChange(View v, boolean hasFocus) { | |
196 | + if (hasFocus) { | |
197 | + if (!phonenumber.getText().toString().isEmpty()) { | |
198 | + phone_delete_btn.setVisibility(View.VISIBLE); | |
199 | + } | |
200 | + } else { | |
201 | + | |
202 | + phone_delete_btn.setVisibility(View.INVISIBLE); | |
203 | + } | |
204 | + } | |
205 | + }); | |
206 | + anth_6num.addTextChangedListener(new TextWatcher() { | |
207 | + @Override | |
208 | + public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
209 | + | |
210 | + } | |
211 | + | |
212 | + @Override | |
213 | + public void onTextChanged(CharSequence s, int start, int before, int count) { | |
214 | + if (s.toString().length() == 0) { | |
215 | + | |
216 | + code_delete_btn.setVisibility(View.INVISIBLE); | |
217 | + } else { | |
218 | + code_delete_btn.setVisibility(View.VISIBLE); | |
219 | + } | |
220 | + } | |
221 | + | |
222 | + @Override | |
223 | + public void afterTextChanged(Editable s) { | |
224 | + | |
225 | + } | |
226 | + }); | |
227 | + anth_6num.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
228 | + @Override | |
229 | + public void onFocusChange(View v, boolean hasFocus) { | |
230 | + if (hasFocus) { | |
231 | + if (!anth_6num.getText().toString().isEmpty()) { | |
232 | + code_delete_btn.setVisibility(View.VISIBLE); | |
233 | + } | |
234 | + } else { | |
235 | + code_delete_btn.setVisibility(View.INVISIBLE); | |
236 | + } | |
237 | + } | |
238 | + }); | |
239 | + } | |
240 | + | |
158 | 241 | private void initData() { |
159 | 242 | } |
160 | 243 | private void setLister() { |
161 | 244 | get_authcode.setOnClickListener(this); |
162 | 245 | openeyes.setOnClickListener(this); |
163 | 246 | btn_register.setOnClickListener(this); |
247 | + phone_delete_btn.setOnClickListener(this); | |
248 | + code_delete_btn.setOnClickListener(this); | |
164 | 249 | } |
165 | 250 | |
166 | 251 | |
... | ... | @@ -212,6 +297,12 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
212 | 297 | } |
213 | 298 | |
214 | 299 | break; |
300 | + case R.id.phone_delete_btn: | |
301 | + phonenumber.setText(""); | |
302 | + break; | |
303 | + case R.id.code_delete_btn: | |
304 | + anth_6num.setText(""); | |
305 | + break; | |
215 | 306 | } |
216 | 307 | |
217 | 308 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpCode.java
... | ... | @@ -63,6 +63,10 @@ public class HttpCode { |
63 | 63 | public static final int SCOOL = 29; |
64 | 64 | //每天POST设备号,需要重新登录 |
65 | 65 | public static final int RELOGIN = 30; |
66 | + //T5 PLUS激活成功 | |
67 | + public static final int ACTIVATION_SUCCESS = 31; | |
68 | + //T5 PLUS激活成功 | |
69 | + public static final int NO_SALES_MAN = 32; | |
66 | 70 | |
67 | 71 | |
68 | 72 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpKey.java
... | ... | @@ -29,6 +29,7 @@ public class HttpKey { |
29 | 29 | public static String DEVICENUMBER = "deviceNumber"; |
30 | 30 | public static String MACADRESS = "macAddress"; |
31 | 31 | public static String MOBILPHONE = "customerPhone"; |
32 | + public static String SALESMANID = "salesmanId"; | |
32 | 33 | //提交子账户信息 |
33 | 34 | public static String PARENTID = "parentId"; |
34 | 35 | public static String IMAGE = "image"; |
... | ... | @@ -39,6 +40,7 @@ public class HttpKey { |
39 | 40 | public static String DEVINUMBER = "deviceNumber"; |
40 | 41 | public static String REGIONNAME = "regionName"; |
41 | 42 | public static String ADDDRESS = "address"; |
43 | + public static String REALNAME = "realName"; | |
42 | 44 | //提交个人信息 |
43 | 45 | public static String ID = "id"; |
44 | 46 | public static String BIRDays = "birthday"; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
... | ... | @@ -73,7 +73,7 @@ public class HttpManager { |
73 | 73 | mProgress = DialogPermission.showProgress(mContext, null, "正在登录...", |
74 | 74 | true, true, null); |
75 | 75 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
76 | - HttpClient.getInstance().addHeader("device-number", Build.SERIAL); | |
76 | + HttpClient.getInstance().addHeader("device-number", Build.SERIAL); | |
77 | 77 | HttpClient.getInstance().get(HttpUrl.loginUrl + "?username=" + username + "&password=" + password, new AsyncHttpResponseHandler() { |
78 | 78 | @Override |
79 | 79 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
... | ... | @@ -204,7 +204,7 @@ public class HttpManager { |
204 | 204 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
205 | 205 | String status = jsonObject.optString("status"); |
206 | 206 | if (status.equals("100")) { |
207 | - // Log.e("test", "onSuccess" + new String(bytes)); | |
207 | + // Log.e("test", "onSuccess" + new String(bytes)); | |
208 | 208 | Toast.makeText(context, "密码修改成功!", Toast.LENGTH_LONG).show(); |
209 | 209 | SaveParam.getInstance().clearData((Activity) context); |
210 | 210 | Intent intent = new Intent(); |
... | ... | @@ -222,7 +222,7 @@ public class HttpManager { |
222 | 222 | @Override |
223 | 223 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
224 | 224 | closeProgress(); |
225 | - // Log.e("test", "onFailure" + new String(bytes)); | |
225 | + // Log.e("test", "onFailure" + new String(bytes)); | |
226 | 226 | AlertUtils.showToast(context, "无法链接到服务器,请检查您的网络或稍后重试!"); |
227 | 227 | } |
228 | 228 | }); |
... | ... | @@ -243,7 +243,7 @@ public class HttpManager { |
243 | 243 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
244 | 244 | String status = jsonObject.optString("status"); |
245 | 245 | if (status.equals("100")) { |
246 | - // Log.e("test", "onSuccess" + new String(bytes)); | |
246 | + // Log.e("test", "onSuccess" + new String(bytes)); | |
247 | 247 | Toast.makeText(context, "密码修改成功!", Toast.LENGTH_LONG).show(); |
248 | 248 | ((Activity) context).finish(); |
249 | 249 | } else { |
... | ... | @@ -256,7 +256,7 @@ public class HttpManager { |
256 | 256 | |
257 | 257 | @Override |
258 | 258 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
259 | - // Log.e("test", "onFailure" + new String(bytes)); | |
259 | + // Log.e("test", "onFailure" + new String(bytes)); | |
260 | 260 | AlertUtils.showToast(context, "无法链接到服务器,请检查您的网络或稍后重试!"); |
261 | 261 | } |
262 | 262 | }); |
... | ... | @@ -273,11 +273,50 @@ public class HttpManager { |
273 | 273 | |
274 | 274 | } |
275 | 275 | |
276 | + | |
277 | + //营业员是否已在数据库注册 | |
278 | + public void checkSalesmanPhone(final Context mContext, String phone, final Handler handler) { | |
279 | + mProgress = DialogPermission.showProgress(mContext, null, "正在加载...", | |
280 | + false, true, null); | |
281 | + HttpClient.getInstance().setTimeout(5 * 1000); | |
282 | + HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | |
283 | + HttpClient.getInstance().get(HttpUrl.getSalesInfo + "?salesmanPhone=" + phone, new AsyncHttpResponseHandler() { | |
284 | + @Override | |
285 | + public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | |
286 | + closeProgress(); | |
287 | + try { | |
288 | + JSONObject jsonObject = new JSONObject(new String(arg2)); | |
289 | + int status = jsonObject.optInt("status"); | |
290 | + JSONObject dataObj = jsonObject.getJSONObject("data"); | |
291 | + Message msg = Message.obtain(); | |
292 | + if (status == 1 && dataObj != null) { | |
293 | + msg.what = HttpCode.SUCHCARDINFO; | |
294 | + msg.obj = dataObj.getString("salesmanId"); | |
295 | + handler.sendMessage(msg); | |
296 | + } else { | |
297 | + msg.what = HttpCode.NO_SALES_MAN; | |
298 | + handler.sendMessage(msg); | |
299 | + | |
300 | + } | |
301 | + } catch (JSONException e) { | |
302 | + e.printStackTrace(); | |
303 | + } | |
304 | + | |
305 | + } | |
306 | + | |
307 | + @Override | |
308 | + public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | |
309 | + closeProgress(); | |
310 | + AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); | |
311 | + } | |
312 | + }); | |
313 | + } | |
314 | + | |
276 | 315 | //提交保卡信息 |
277 | 316 | public void subcardinfo(final Context context, long userId, String customerName, String customerAddress, |
278 | - String buyAddress, String buyTime, String alterSaleCall, | |
317 | + String buyAddress, String alterSaleCall, | |
279 | 318 | String productModel, String deviceNumber, String macAddress, |
280 | - String mobilePhone) { | |
319 | + final String mobilePhone, String regionId, String salesId) { | |
281 | 320 | mProgress = DialogPermission.showProgress(context, null, "正在绑定保卡...", |
282 | 321 | false, true, null); |
283 | 322 | RequestParams params = new RequestParams(); |
... | ... | @@ -286,12 +325,16 @@ public class HttpManager { |
286 | 325 | params.put(HttpKey.CUSTOMENAME, customerName); |
287 | 326 | params.put(HttpKey.CUSTOMADRESS, customerAddress); |
288 | 327 | params.put(HttpKey.BUYADREES, buyAddress); |
289 | - params.put(HttpKey.BUYTIME, buyTime); | |
328 | +// params.put(HttpKey.BUYTIME, buyTime); | |
290 | 329 | params.put(HttpKey.ALTERSALECALL, alterSaleCall); |
291 | 330 | params.put(HttpKey.PRODUCTMODEL, productModel); |
292 | 331 | params.put(HttpKey.DEVICENUMBER, deviceNumber); |
293 | 332 | params.put(HttpKey.MACADRESS, macAddress); |
294 | 333 | params.put(HttpKey.MOBILPHONE, mobilePhone); |
334 | + params.put(HttpKey.REGION, regionId); | |
335 | + if (salesId != null && !salesId.isEmpty()) { | |
336 | + params.put(HttpKey.SALESMANID, salesId); | |
337 | + } | |
295 | 338 | |
296 | 339 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
297 | 340 | |
... | ... | @@ -308,6 +351,7 @@ public class HttpManager { |
308 | 351 | if (status.equals("1")) { |
309 | 352 | Log.e("test", "onSuccess" + jsonObject); |
310 | 353 | Toast.makeText(context, "保卡绑定成功!", Toast.LENGTH_LONG).show(); |
354 | + SaveParam.getInstance().saveCustomizeParam(context, SaveParam.CARDPHONE, mobilePhone); | |
311 | 355 | if (Content.cardintentflag == 1) { |
312 | 356 | Intent intent = new Intent(); |
313 | 357 | intent.setClass((Activity) context, TheStartPageActivity.class); |
... | ... | @@ -324,11 +368,11 @@ public class HttpManager { |
324 | 368 | } |
325 | 369 | |
326 | 370 | |
327 | - } else if (status.equals("2003")){ | |
328 | - IllegalDialog.getInstance().show(((FragmentActivity) context).getSupportFragmentManager(),"feifa"); | |
371 | + } else if (status.equals("2003")) { | |
372 | + IllegalDialog.getInstance().show(((FragmentActivity) context).getSupportFragmentManager(), "feifa"); | |
329 | 373 | |
330 | - }else { | |
331 | - SaveParam.getInstance().saveCustomizeParam((FragmentActivity) context,SaveParam.CARDPHONE,""); | |
374 | + } else { | |
375 | + SaveParam.getInstance().saveCustomizeParam((FragmentActivity) context, SaveParam.CARDPHONE, ""); | |
332 | 376 | Toast.makeText(context, "保卡绑定失败!", Toast.LENGTH_LONG).show(); |
333 | 377 | } |
334 | 378 | } catch (JSONException e) { |
... | ... | @@ -359,7 +403,7 @@ public class HttpManager { |
359 | 403 | @Override |
360 | 404 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
361 | 405 | closeProgress(); |
362 | - // Log.e("test", "保卡信息" + new String(arg2)); | |
406 | + // Log.e("test", "保卡信息" + new String(arg2)); | |
363 | 407 | try { |
364 | 408 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
365 | 409 | int status = jsonObject.optInt("status"); |
... | ... | @@ -398,7 +442,7 @@ public class HttpManager { |
398 | 442 | @Override |
399 | 443 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
400 | 444 | closeProgress(); |
401 | - // Log.e("test", "保卡信息" + new String(arg2)); | |
445 | + // Log.e("test", "保卡信息" + new String(arg2)); | |
402 | 446 | Message msg = Message.obtain(); |
403 | 447 | msg.what = HttpCode.SUCHCARDINFOONE; |
404 | 448 | msg.obj = new String(arg2); |
... | ... | @@ -414,6 +458,36 @@ public class HttpManager { |
414 | 458 | }); |
415 | 459 | } |
416 | 460 | |
461 | + //验证注册激活码 | |
462 | + public void submitEcard(final Context mContext, String deviceNumber, String activationCode, final Handler handler) { | |
463 | + mProgress = DialogPermission.showProgress(mContext, null, "正在验证注册激活码...", | |
464 | + false, true, null); | |
465 | + HttpClient.getInstance().setTimeout(5 * 1000); | |
466 | + HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | |
467 | + HttpClient.getInstance().get(HttpUrl.submitEcardURL + "?deviceNumber=" + deviceNumber + "&code=" + activationCode, new AsyncHttpResponseHandler() { | |
468 | + @Override | |
469 | + public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | |
470 | + closeProgress(); | |
471 | + // Log.e("test", "保卡信息" + new String(arg2)); | |
472 | + Message msg = Message.obtain(); | |
473 | + msg.what = HttpCode.ACTIVATION_SUCCESS; | |
474 | + try { | |
475 | + msg.obj = new JSONObject(new String(arg2)); | |
476 | + } catch (JSONException e) { | |
477 | + e.printStackTrace(); | |
478 | + } | |
479 | + handler.sendMessage(msg); | |
480 | + | |
481 | + } | |
482 | + | |
483 | + @Override | |
484 | + public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | |
485 | + closeProgress(); | |
486 | + AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); | |
487 | + } | |
488 | + }); | |
489 | + } | |
490 | + | |
417 | 491 | //修改账户电话 |
418 | 492 | public void changeaccountphone(final Context mContext, long userId, final String username, String authCode) { |
419 | 493 | RequestParams params = new RequestParams(); |
... | ... | @@ -425,7 +499,7 @@ public class HttpManager { |
425 | 499 | @Override |
426 | 500 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
427 | 501 | try { |
428 | - // Log.e("test", "保卡信息" + new String(bytes)); | |
502 | + // Log.e("test", "保卡信息" + new String(bytes)); | |
429 | 503 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
430 | 504 | String status = jsonObject.optString("status"); |
431 | 505 | if (status.equals("1")) { |
... | ... | @@ -434,8 +508,7 @@ public class HttpManager { |
434 | 508 | ((Activity) mContext).finish(); |
435 | 509 | } else if (status.equals("1001")) { |
436 | 510 | Toast.makeText(mContext, "验证码输入错误", Toast.LENGTH_LONG).show(); |
437 | - } | |
438 | - else if (status.equals("1006")) { | |
511 | + } else if (status.equals("1006")) { | |
439 | 512 | AlertUtils.showToast(mContext, "该手机号已存在,请使用其他手机号重新绑定!"); |
440 | 513 | } else { |
441 | 514 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
... | ... | @@ -482,7 +555,7 @@ public class HttpManager { |
482 | 555 | |
483 | 556 | @Override |
484 | 557 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
485 | - // Log.e("test", "onFailure" + new String(bytes)); | |
558 | + // Log.e("test", "onFailure" + new String(bytes)); | |
486 | 559 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
487 | 560 | } |
488 | 561 | }); |
... | ... | @@ -518,7 +591,7 @@ public class HttpManager { |
518 | 591 | |
519 | 592 | @Override |
520 | 593 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
521 | - // Log.e("test", "onFailure" + new String(bytes)); | |
594 | + // Log.e("test", "onFailure" + new String(bytes)); | |
522 | 595 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
523 | 596 | } |
524 | 597 | }); |
... | ... | @@ -532,7 +605,7 @@ public class HttpManager { |
532 | 605 | HttpClient.getInstance().get(HttpUrl.cardcheck + "?deviceNumber=" + deviceNumber, new AsyncHttpResponseHandler() { |
533 | 606 | @Override |
534 | 607 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
535 | - // Log.e("test", "验证保卡" + new String(arg2)); | |
608 | + // Log.e("test", "验证保卡" + new String(arg2)); | |
536 | 609 | closeProgress(); |
537 | 610 | Message msg = Message.obtain(); |
538 | 611 | msg.what = HttpCode.CHECKCARD; |
... | ... | @@ -557,7 +630,7 @@ public class HttpManager { |
557 | 630 | HttpClient.getInstance().get(HttpUrl.gradesUrl, new AsyncHttpResponseHandler() { |
558 | 631 | @Override |
559 | 632 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
560 | - // Log.e("test", "年级" + new String(arg2)); | |
633 | + // Log.e("test", "年级" + new String(arg2)); | |
561 | 634 | GradeInfo gradeInfo = GsonTool.getPerson(new String(arg2), GradeInfo.class);//解析json数据 |
562 | 635 | List<GradeInfo.DataBean.ChildrenBean> gradeInfoLists = new ArrayList<GradeInfo.DataBean.ChildrenBean>(); |
563 | 636 | for (int i = 0; i < gradeInfo.getData().size() - 2; i++) { |
... | ... | @@ -603,7 +676,7 @@ public class HttpManager { |
603 | 676 | HttpClient.getInstance().get(HttpUrl.schoolUrl + "?regionId=" + regionId + "&gradeId=" + gradeId, new AsyncHttpResponseHandler() { |
604 | 677 | @Override |
605 | 678 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
606 | - // Log.e("test", "学校" + new String(arg2)); | |
679 | + // Log.e("test", "学校" + new String(arg2)); | |
607 | 680 | try { |
608 | 681 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
609 | 682 | int status = jsonObject.optInt("status"); |
... | ... | @@ -661,10 +734,10 @@ public class HttpManager { |
661 | 734 | message.what = HttpCode.GETINFO; |
662 | 735 | message.obj = pesonalInfoBeanList; |
663 | 736 | handler.sendMessage(message); |
664 | - } else if (status == 1011){ | |
737 | + } else if (status == 1011) { | |
665 | 738 | message.what = HttpCode.RELOGIN; |
666 | 739 | handler.sendMessage(message); |
667 | - }else { | |
740 | + } else { | |
668 | 741 | AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试!"); |
669 | 742 | |
670 | 743 | } |
... | ... | @@ -714,7 +787,7 @@ public class HttpManager { |
714 | 787 | String status = response.optString("status"); |
715 | 788 | if (status.equals("1")) { |
716 | 789 | Toast.makeText(mContext, "个人信息保存成功", Toast.LENGTH_LONG).show(); |
717 | - SaveParam.getInstance().saveLoginParam(mContext,SaveParam.VIEGREADE,gradeId+""); | |
790 | + SaveParam.getInstance().saveLoginParam(mContext, SaveParam.VIEGREADE, gradeId + ""); | |
718 | 791 | Message message = Message.obtain(); |
719 | 792 | message.what = HttpCode.PESERNAOL; |
720 | 793 | message.obj = 1; |
... | ... | @@ -738,7 +811,7 @@ public class HttpManager { |
738 | 811 | |
739 | 812 | //提交注册信息 |
740 | 813 | public void subregisterinfo(final Context mContext, Long userId |
741 | - , String name, int gradeId, long regionId, String regionName, Object schoolId, String chinese, | |
814 | + , String name, int gradeId, long regionId, String regionName, String realName, String address, Object schoolId, String chinese, | |
742 | 815 | String math, String english, String physics, String chemistry, |
743 | 816 | String history, String geography, String political, String biology, String science, final Handler handler) { |
744 | 817 | mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...", |
... | ... | @@ -761,6 +834,8 @@ public class HttpManager { |
761 | 834 | params.put(HttpKey.POLITICAL, political); |
762 | 835 | params.put(HttpKey.BIOLOGY, biology); |
763 | 836 | params.put(HttpKey.SCIENCE, science); |
837 | + params.put(HttpKey.ADDDRESS, address); | |
838 | + params.put(HttpKey.REALNAME, realName); | |
764 | 839 | |
765 | 840 | Log.e("test", "注册信息" + params); |
766 | 841 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
... | ... | @@ -877,7 +952,7 @@ public class HttpManager { |
877 | 952 | HttpClient.getInstance().get(HttpUrl.getsignature + "?userId=" + userId + "&type=" + type, new AsyncHttpResponseHandler() { |
878 | 953 | @Override |
879 | 954 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
880 | - // Log.e("test", "个性签名" + new String(arg2)); | |
955 | + // Log.e("test", "个性签名" + new String(arg2)); | |
881 | 956 | try { |
882 | 957 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
883 | 958 | int status = jsonObject.optInt("status"); |
... | ... | @@ -944,7 +1019,7 @@ public class HttpManager { |
944 | 1019 | @Override |
945 | 1020 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
946 | 1021 | closeProgress(); |
947 | - // Log.e("test", "onSuccess" + new String(bytes)); | |
1022 | + // Log.e("test", "onSuccess" + new String(bytes)); | |
948 | 1023 | try { |
949 | 1024 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
950 | 1025 | String status = jsonObject.optString("status"); |
... | ... | @@ -1038,7 +1113,7 @@ public class HttpManager { |
1038 | 1113 | @Override |
1039 | 1114 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1040 | 1115 | closeProgress(); |
1041 | - // Log.e("test", "子账户信息" + new String(arg2)); | |
1116 | + // Log.e("test", "子账户信息" + new String(arg2)); | |
1042 | 1117 | try { |
1043 | 1118 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1044 | 1119 | int status = jsonObject.optInt("status"); |
... | ... | @@ -1058,7 +1133,7 @@ public class HttpManager { |
1058 | 1133 | @Override |
1059 | 1134 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
1060 | 1135 | closeProgress(); |
1061 | - // Log.e("test", "错误信息" + new String(arg2)); | |
1136 | + // Log.e("test", "错误信息" + new String(arg2)); | |
1062 | 1137 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
1063 | 1138 | } |
1064 | 1139 | }); |
... | ... | @@ -1113,7 +1188,7 @@ public class HttpManager { |
1113 | 1188 | @Override |
1114 | 1189 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
1115 | 1190 | closeProgress(); |
1116 | - // Log.e("test", "错误信息" + new String(arg2)); | |
1191 | + // Log.e("test", "错误信息" + new String(arg2)); | |
1117 | 1192 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
1118 | 1193 | } |
1119 | 1194 | }); |
... | ... | @@ -1137,7 +1212,7 @@ public class HttpManager { |
1137 | 1212 | @Override |
1138 | 1213 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1139 | 1214 | closeProgress(); |
1140 | - // Log.e("test", "子账户信息" + new String(arg2)); | |
1215 | + // Log.e("test", "子账户信息" + new String(arg2)); | |
1141 | 1216 | try { |
1142 | 1217 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1143 | 1218 | int status = jsonObject.optInt("status"); |
... | ... | @@ -1182,7 +1257,7 @@ public class HttpManager { |
1182 | 1257 | @Override |
1183 | 1258 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1184 | 1259 | closeProgress(); |
1185 | - // Log.e("test", "子账户信息" + new String(arg2)); | |
1260 | + // Log.e("test", "子账户信息" + new String(arg2)); | |
1186 | 1261 | try { |
1187 | 1262 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1188 | 1263 | int status = jsonObject.optInt("status"); |
... | ... | @@ -1203,7 +1278,7 @@ public class HttpManager { |
1203 | 1278 | @Override |
1204 | 1279 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
1205 | 1280 | closeProgress(); |
1206 | - // Log.e("test", "错误信息" + new String(arg2)); | |
1281 | + // Log.e("test", "错误信息" + new String(arg2)); | |
1207 | 1282 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
1208 | 1283 | } |
1209 | 1284 | }); |
... | ... | @@ -1235,7 +1310,7 @@ public class HttpManager { |
1235 | 1310 | HttpClient.getInstance().post(HttpUrl.headerURL, params, new AsyncHttpResponseHandler() { |
1236 | 1311 | @Override |
1237 | 1312 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
1238 | - // Log.e("test", "onSuccess" + new String(bytes)); | |
1313 | + // Log.e("test", "onSuccess" + new String(bytes)); | |
1239 | 1314 | try { |
1240 | 1315 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
1241 | 1316 | String status = jsonObject.optString("status"); |
... | ... | @@ -1244,7 +1319,7 @@ public class HttpManager { |
1244 | 1319 | SaveParam.getInstance().saveLoginParam(mContext, SaveParam.HEADURL, imagUrl); |
1245 | 1320 | if (status.equals("1")) { |
1246 | 1321 | Toast.makeText(mContext, "头像上传成功。", Toast.LENGTH_LONG).show(); |
1247 | - SaveParam.getInstance().saveLoginParam(mContext,SaveParam.PORTAIT,imagUrl); | |
1322 | + SaveParam.getInstance().saveLoginParam(mContext, SaveParam.PORTAIT, imagUrl); | |
1248 | 1323 | Message msg = Message.obtain(); |
1249 | 1324 | msg.what = HttpCode.TOUXIANG; |
1250 | 1325 | msg.obj = status; |
... | ... | @@ -1260,7 +1335,7 @@ public class HttpManager { |
1260 | 1335 | @Override |
1261 | 1336 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
1262 | 1337 | closeProgress(); |
1263 | - // Log.e("test", "错误信息" + new String(bytes)); | |
1338 | + // Log.e("test", "错误信息" + new String(bytes)); | |
1264 | 1339 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
1265 | 1340 | |
1266 | 1341 | } |
... | ... | @@ -1297,7 +1372,7 @@ public class HttpManager { |
1297 | 1372 | SaveParam.getInstance().saveLoginParam(mContext, SaveParam.HEADURL, imagUrl); |
1298 | 1373 | if (status.equals("1")) { |
1299 | 1374 | Toast.makeText(mContext, "头像上传成功。", Toast.LENGTH_LONG).show(); |
1300 | - SaveParam.getInstance().saveLoginParam(mContext,SaveParam.PORTAIT,imagUrl); | |
1375 | + SaveParam.getInstance().saveLoginParam(mContext, SaveParam.PORTAIT, imagUrl); | |
1301 | 1376 | } else { |
1302 | 1377 | AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试"); |
1303 | 1378 | } |
... | ... | @@ -1377,10 +1452,10 @@ public class HttpManager { |
1377 | 1452 | msg.obj = schoolInfoBeanList; |
1378 | 1453 | handler.sendMessage(msg); |
1379 | 1454 | |
1380 | - } else if (status == 1000){ | |
1455 | + } else if (status == 1000) { | |
1381 | 1456 | //AlertUtils.showToast(mContext, "暂无最近学习视频!"); |
1382 | 1457 | |
1383 | - }else { | |
1458 | + } else { | |
1384 | 1459 | AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); |
1385 | 1460 | } |
1386 | 1461 | } catch (JSONException e) { |
... | ... | @@ -1417,16 +1492,16 @@ public class HttpManager { |
1417 | 1492 | @Override |
1418 | 1493 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1419 | 1494 | //closeProgress(); |
1420 | - // Log.e("test", "版本升级信息" + new String(arg2)); | |
1495 | + // Log.e("test", "版本升级信息" + new String(arg2)); | |
1421 | 1496 | Gson gson = new Gson(); |
1422 | 1497 | List<AppVersion> applist = gson.fromJson(new String(arg2), |
1423 | - new TypeToken<List<AppVersion>>() {}.getType()); | |
1424 | - Log.e("test", "版本升级信息" + applist); | |
1425 | - Message msg = Message.obtain(); | |
1426 | - msg.what = HttpCode.APPUPDATE_SUCESS; | |
1427 | - msg.obj = applist; | |
1428 | - handler.sendMessage(msg); | |
1429 | - | |
1498 | + new TypeToken<List<AppVersion>>() { | |
1499 | + }.getType()); | |
1500 | + Log.e("test", "版本升级信息" + applist); | |
1501 | + Message msg = Message.obtain(); | |
1502 | + msg.what = HttpCode.APPUPDATE_SUCESS; | |
1503 | + msg.obj = applist; | |
1504 | + handler.sendMessage(msg); | |
1430 | 1505 | |
1431 | 1506 | |
1432 | 1507 | } |
... | ... | @@ -1485,7 +1560,7 @@ public class HttpManager { |
1485 | 1560 | HttpClient.getInstance().get(HttpUrl.provinceUrl, new AsyncHttpResponseHandler() { |
1486 | 1561 | @Override |
1487 | 1562 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1488 | - // Log.e("test", "省" + new String(arg2)); | |
1563 | + // Log.e("test", "省" + new String(arg2)); | |
1489 | 1564 | try { |
1490 | 1565 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1491 | 1566 | int status = jsonObject.optInt("status"); |
... | ... | @@ -1523,7 +1598,7 @@ public class HttpManager { |
1523 | 1598 | HttpClient.getInstance().get(HttpUrl.getpublishURL + "?userId=" + userId + "&gradeId=" + gradeId + "&type=" + type, new AsyncHttpResponseHandler() { |
1524 | 1599 | @Override |
1525 | 1600 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1526 | - // Log.e("test", "获取版本信息接口" + new String(arg2)); | |
1601 | + // Log.e("test", "获取版本信息接口" + new String(arg2)); | |
1527 | 1602 | try { |
1528 | 1603 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1529 | 1604 | int status = jsonObject.optInt("status"); |
... | ... | @@ -1561,7 +1636,7 @@ public class HttpManager { |
1561 | 1636 | HttpClient.getInstance().get(HttpUrl.cityUrl + "?regionId=" + regionId, new AsyncHttpResponseHandler() { |
1562 | 1637 | @Override |
1563 | 1638 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1564 | - // Log.e("test", "市" + new String(arg2)); | |
1639 | + // Log.e("test", "市" + new String(arg2)); | |
1565 | 1640 | try { |
1566 | 1641 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1567 | 1642 | int status = jsonObject.optInt("status"); |
... | ... | @@ -1598,7 +1673,7 @@ public class HttpManager { |
1598 | 1673 | HttpClient.getInstance().get(HttpUrl.countyUrl + "?regionId=" + parentId, new AsyncHttpResponseHandler() { |
1599 | 1674 | @Override |
1600 | 1675 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1601 | - // Log.e("test", "区" + new String(arg2)); | |
1676 | + // Log.e("test", "区" + new String(arg2)); | |
1602 | 1677 | try { |
1603 | 1678 | JSONObject jsonObject = new JSONObject(new String(arg2)); |
1604 | 1679 | int status = jsonObject.optInt("status"); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpUrl.java
... | ... | @@ -11,6 +11,7 @@ public class HttpUrl { |
11 | 11 | //BuildConfig.BUILD_TYPE.equals("release") ? "http://boss.hjx.com" : "http://boss.test.hjx.com" ; |
12 | 12 | public static String GetDomain(){ |
13 | 13 | return BuildConfig.BUILD_TYPE.equals("release") ? "http://boss.hjx.com" : "http://boss.test.hjx.com" ; |
14 | +// return "http://boss.hjx.com" ; | |
14 | 15 | } |
15 | 16 | |
16 | 17 | public static String loginUrl = GetDomain()+"/user/access_token";//登录 |
... | ... | @@ -47,6 +48,8 @@ public class HttpUrl { |
47 | 48 | public static String submitregisterURL=GetDomain()+"/register/extrainfo/submit";//提交注册信息 |
48 | 49 | public static String chagepublishURL=GetDomain()+"/userPress/update";//修改版本信息 |
49 | 50 | public static String chageaccountphoneURL=GetDomain()+"/electronicCard/updateUserNameByUserId";//修改账户绑定 |
51 | + public static String submitEcardURL=GetDomain()+"/ecard/submit";//修改账户绑定 | |
52 | + public static String getSalesInfo=GetDomain()+"/electronicCard/check/salesman";//获取营业员信息 | |
50 | 53 | |
51 | 54 | |
52 | 55 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/PesonalInfo.java
... | ... | @@ -86,6 +86,7 @@ public class PesonalInfo implements Serializable{ |
86 | 86 | } |
87 | 87 | |
88 | 88 | private String address; |
89 | + private String realName; | |
89 | 90 | private String portrait; |
90 | 91 | private SchoolBean school; |
91 | 92 | private GradeBean grade; |
... | ... | @@ -154,6 +155,14 @@ public class PesonalInfo implements Serializable{ |
154 | 155 | this.qq = qq; |
155 | 156 | } |
156 | 157 | |
158 | + public String getRealName() { | |
159 | + return realName; | |
160 | + } | |
161 | + | |
162 | + public void setRealName(String realName) { | |
163 | + this.realName = realName; | |
164 | + } | |
165 | + | |
157 | 166 | public static class RegionBean { |
158 | 167 | /** |
159 | 168 | * regionName : 闵行区 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/thirdparty/SlidingTabLayout.java
... | ... | @@ -17,6 +17,7 @@ import android.widget.LinearLayout; |
17 | 17 | import android.widget.TextView; |
18 | 18 | |
19 | 19 | import com.hjx.personalcenter.R; |
20 | +import com.hjx.personalcenter.util.CropUtils; | |
20 | 21 | |
21 | 22 | import java.util.List; |
22 | 23 | |
... | ... | @@ -277,11 +278,11 @@ public class SlidingTabLayout extends HorizontalScrollView { |
277 | 278 | private TextView generateTextView(String text) { |
278 | 279 | TextView tv = new TextView(getContext()); |
279 | 280 | LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
280 | - lp.width = getScreenWidth() / mTabVisibleCount; | |
281 | + lp.width = CropUtils.dp2px(getContext(),550) / mTabVisibleCount; | |
281 | 282 | tv.setGravity(Gravity.CENTER); |
282 | 283 | tv.setTextColor(COLOR_TEXT_NORMAL); |
283 | 284 | tv.setText(text); |
284 | - tv.setTextSize(TypedValue.TYPE_NULL, 34); | |
285 | + tv.setTextSize(TypedValue.TYPE_NULL, CropUtils.sp2px(getContext(),23)); | |
285 | 286 | tv.setLayoutParams(lp); |
286 | 287 | return tv; |
287 | 288 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/update/DownloadService.java
... | ... | @@ -15,6 +15,7 @@ import java.io.FileOutputStream; |
15 | 15 | import java.io.IOException; |
16 | 16 | import java.io.InputStream; |
17 | 17 | import java.io.OutputStream; |
18 | +import java.net.HttpURLConnection; | |
18 | 19 | import java.net.URL; |
19 | 20 | import java.net.URLConnection; |
20 | 21 | |
... | ... | @@ -30,21 +31,21 @@ public class DownloadService extends IntentService { |
30 | 31 | ResultReceiver receiver = (ResultReceiver) intent.getParcelableExtra("receiver"); |
31 | 32 | try { |
32 | 33 | URL url = new URL(urlToDownload); |
33 | - URLConnection connection = url.openConnection(); | |
34 | + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); | |
34 | 35 | connection.connect(); |
35 | 36 | // this will be useful so that you can show a typical 0-100% progress bar |
36 | 37 | int fileLength = connection.getContentLength(); |
37 | 38 | // download the file |
38 | 39 | InputStream input = new BufferedInputStream(connection.getInputStream()); |
39 | 40 | OutputStream output = new FileOutputStream(fileDestination); |
40 | - byte data[] = new byte[100]; | |
41 | + byte data[] = new byte[1024]; | |
41 | 42 | long total = 0; |
42 | 43 | int count; |
43 | 44 | while ((count = input.read(data)) != -1) { |
44 | 45 | total += count; |
45 | 46 | // publishing the progress.... |
46 | 47 | Bundle resultData = new Bundle(); |
47 | - resultData.putInt("progress" ,(int) (total * 100 / fileLength)); | |
48 | + resultData.putInt("progress" , (int) (((float) total / fileLength) * 100));// 得到当前进度); | |
48 | 49 | receiver.send(UPDATE_PROGRESS, resultData); |
49 | 50 | output.write(data, 0, count); |
50 | 51 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/update/UpdateChecker.java
... | ... | @@ -5,6 +5,8 @@ package com.hjx.personalcenter.update; |
5 | 5 | */ |
6 | 6 | |
7 | 7 | import android.app.Activity; |
8 | +import android.app.AlertDialog; | |
9 | +import android.app.Dialog; | |
8 | 10 | import android.app.ProgressDialog; |
9 | 11 | import android.content.Context; |
10 | 12 | import android.content.DialogInterface; |
... | ... | @@ -77,7 +79,7 @@ public class UpdateChecker{ |
77 | 79 | mProgressDialog.setMessage("正在下载"); |
78 | 80 | mProgressDialog.setIndeterminate(false); |
79 | 81 | mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); |
80 | - mProgressDialog.setCancelable(true); | |
82 | + mProgressDialog.setCancelable(false); | |
81 | 83 | mProgressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { |
82 | 84 | @Override |
83 | 85 | public void onCancel(DialogInterface dialog) { |
... | ... | @@ -111,43 +113,70 @@ public class UpdateChecker{ |
111 | 113 | } |
112 | 114 | |
113 | 115 | private void showForceUpdateDialog() { |
114 | - new CircleDialog.Builder((FragmentActivity)mContext) | |
115 | - .setCanceledOnTouchOutside(false) | |
116 | - .setCancelable(false) | |
117 | - .setWidth(0.5f) | |
118 | - .setTitle("升级提示") | |
119 | - .setText(msgs) | |
120 | - .setNegative("取消", new View.OnClickListener() { | |
121 | - @Override | |
122 | - public void onClick(View v) { | |
123 | - ((Activity)mContext).finish(); | |
116 | + AlertDialog.Builder builder = new AlertDialog.Builder( | |
117 | + mContext); | |
118 | + builder.setTitle("检查到新版本,是否更新?"); | |
119 | + builder.setMessage(msgs); | |
120 | + builder.setNegativeButton("退出", | |
121 | + new android.content.DialogInterface.OnClickListener() { | |
124 | 122 | |
123 | + @Override | |
124 | + public void onClick(DialogInterface dialog, int which) { | |
125 | + System.exit(0); | |
125 | 126 | } |
126 | - }) | |
127 | - .setPositive("确定", new View.OnClickListener() { | |
127 | + }); | |
128 | + builder.setPositiveButton("立即更新", | |
129 | + new android.content.DialogInterface.OnClickListener() { | |
130 | + | |
128 | 131 | @Override |
129 | - public void onClick(View v) { | |
132 | + public void onClick(DialogInterface dialog, int which) { | |
130 | 133 | downLoadApk(); |
131 | 134 | } |
132 | - }) | |
133 | - .show(); | |
135 | + }); | |
136 | + Dialog dialog=builder.create(); | |
137 | + dialog.setCanceledOnTouchOutside(false); | |
138 | + dialog.show(); | |
139 | + | |
140 | +// new CircleDialog.Builder((FragmentActivity)mContext) | |
141 | +// .setCanceledOnTouchOutside(false) | |
142 | +// .setCancelable(false) | |
143 | +// .setWidth(0.5f) | |
144 | +// .setTitle("升级提示") | |
145 | +// .setText(msgs) | |
146 | +// .setNegative("取消", new View.OnClickListener() { | |
147 | +// @Override | |
148 | +// public void onClick(View v) { | |
149 | +// ((Activity)mContext).finish(); | |
150 | +// | |
151 | +// } | |
152 | +// }) | |
153 | +// .setPositive("确定", new View.OnClickListener() { | |
154 | +// @Override | |
155 | +// public void onClick(View v) { | |
156 | +// downLoadApk(); | |
157 | +// } | |
158 | +// }) | |
159 | +// .show(); | |
134 | 160 | } |
135 | 161 | |
136 | 162 | private void showUpdateDialog() { |
137 | - new CircleDialog.Builder((FragmentActivity)mContext) | |
138 | - .setCanceledOnTouchOutside(false) | |
139 | - .setCancelable(false) | |
140 | - .setWidth(0.5f) | |
141 | - .setTitle("升级提示") | |
142 | - .setText(msgs) | |
143 | - .setNegative("取消", null) | |
144 | - .setPositive("确定", new View.OnClickListener() { | |
163 | + | |
164 | + AlertDialog.Builder builder = new AlertDialog.Builder( | |
165 | + mContext); | |
166 | + builder.setTitle("检查到新版本,是否更新?"); | |
167 | + builder.setMessage(msgs); | |
168 | + builder.setNegativeButton("下次再说", null); | |
169 | + builder.setPositiveButton("立即更新", | |
170 | + new android.content.DialogInterface.OnClickListener() { | |
171 | + | |
145 | 172 | @Override |
146 | - public void onClick(View v) { | |
173 | + public void onClick(DialogInterface dialog, int which) { | |
147 | 174 | downLoadApk(); |
148 | 175 | } |
149 | - }) | |
150 | - .show(); | |
176 | + }); | |
177 | + Dialog dialog=builder.create(); | |
178 | + dialog.setCanceledOnTouchOutside(false); | |
179 | + dialog.show(); | |
151 | 180 | } |
152 | 181 | |
153 | 182 | private void downLoadApk() { |
... | ... | @@ -191,7 +220,7 @@ public class UpdateChecker{ |
191 | 220 | ProcessBuilder builder = new ProcessBuilder(command); |
192 | 221 | builder.start(); |
193 | 222 | Intent intent = new Intent(Intent.ACTION_VIEW); |
194 | - intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive"); | |
223 | + intent.setDataAndType(Uri.parse("file://" + apkFile.toString()), "application/vnd.android.package-archive"); | |
195 | 224 | mContext.startActivity(intent); |
196 | 225 | }catch (Exception e){ |
197 | 226 | e.printStackTrace(); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/CropUtils.java
... | ... | @@ -145,4 +145,19 @@ public class CropUtils { |
145 | 145 | return "com.android.providers.media.documents".equals(uri.getAuthority()); |
146 | 146 | } |
147 | 147 | |
148 | + | |
149 | + /** | |
150 | + * dp转换成px | |
151 | + */ | |
152 | + public static int dp2px(Context context,float dpValue){ | |
153 | + float scale=context.getResources().getDisplayMetrics().density; | |
154 | + return (int)(dpValue*scale+0.5f); | |
155 | + } | |
156 | + /** | |
157 | + * sp转换成px | |
158 | + */ | |
159 | + public static int sp2px(Context context,float spValue){ | |
160 | + float fontScale=context.getResources().getDisplayMetrics().scaledDensity; | |
161 | + return (int) (spValue*fontScale+0.5f); | |
162 | + } | |
148 | 163 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/GetDevicesUtil.java
1 | 1 | package com.hjx.personalcenter.util; |
2 | 2 | |
3 | +import android.app.Activity; | |
3 | 4 | import android.content.Context; |
4 | 5 | import android.os.Build; |
6 | +import android.os.Environment; | |
7 | +import android.os.StatFs; | |
8 | +import android.os.storage.StorageManager; | |
9 | +import android.os.storage.StorageVolume; | |
5 | 10 | import android.util.Log; |
11 | +import android.widget.Toast; | |
6 | 12 | |
7 | 13 | import com.hjx.personalcenter.model.DeviceInfo; |
8 | 14 | |
15 | +import java.io.BufferedReader; | |
16 | +import java.io.File; | |
9 | 17 | import java.io.FileReader; |
18 | +import java.io.IOException; | |
10 | 19 | import java.io.InputStreamReader; |
11 | 20 | import java.io.LineNumberReader; |
12 | 21 | import java.io.Reader; |
22 | +import java.lang.reflect.Field; | |
23 | +import java.lang.reflect.InvocationTargetException; | |
24 | +import java.lang.reflect.Method; | |
25 | +import java.net.NetworkInterface; | |
26 | +import java.net.SocketException; | |
27 | +import java.util.Collections; | |
28 | +import java.util.Enumeration; | |
29 | +import java.util.List; | |
30 | +import java.util.Locale; | |
31 | +import java.util.UUID; | |
13 | 32 | |
14 | 33 | |
15 | 34 | public class GetDevicesUtil { |
16 | - private final static String LOG_TAG = "GetDevicesUtil"; | |
35 | + private final static String LOG_TAG = "GetDevicesUtil"; | |
17 | 36 | |
18 | - public static DeviceInfo getDevicesInfo(Context context){ | |
19 | - DeviceInfo mDeviceInfo = new DeviceInfo(); | |
20 | - initDevicesInfo(mDeviceInfo,context); | |
37 | + public static DeviceInfo getDevicesInfo(Context context) { | |
38 | + DeviceInfo mDeviceInfo = new DeviceInfo(); | |
39 | + initDevicesInfo(mDeviceInfo, context); | |
21 | 40 | |
22 | - return mDeviceInfo; | |
23 | - } | |
41 | + return mDeviceInfo; | |
42 | + } | |
24 | 43 | |
25 | - public static void initDevicesInfo(DeviceInfo mDeviceInfo,Context context){ | |
26 | - //if (PermissionUtil.hasReadExternalStoragePermission((Activity) context)) | |
27 | - mDeviceInfo.setDeviceModel(android.os.Build.MODEL); | |
28 | - Log.e(LOG_TAG,"" + mDeviceInfo.getDeviceModel()); | |
29 | - mDeviceInfo.setMac(getMacAddress(context)); | |
30 | - Log.e(LOG_TAG,"" + mDeviceInfo.getMac()); | |
44 | + public static void initDevicesInfo(DeviceInfo mDeviceInfo, Context context) { | |
45 | + //if (PermissionUtil.hasReadExternalStoragePermission((Activity) context)) | |
46 | + if(android.os.Build.MODEL.equals("T8") && queryWithStorageManager(context)/(1024*1024*1024)>64){ | |
47 | + mDeviceInfo.setDeviceModel("T8 PRO"); | |
48 | + }else { | |
49 | + mDeviceInfo.setDeviceModel(android.os.Build.MODEL); | |
50 | + } | |
51 | + Log.e(LOG_TAG, "" + mDeviceInfo.getDeviceModel()); | |
52 | + mDeviceInfo.setMac(getMacAddress(context)); | |
53 | + Log.e(LOG_TAG, "" + mDeviceInfo.getMac()); | |
31 | 54 | |
32 | - mDeviceInfo.setDeviceNumber(getCPUSerial(context)); | |
33 | - Log.e(LOG_TAG,"" + mDeviceInfo.getDeviceNumber()); | |
34 | - } | |
55 | + mDeviceInfo.setDeviceNumber(getCPUSerial(context)); | |
56 | + Log.e(LOG_TAG, "" + mDeviceInfo.getDeviceNumber()); | |
57 | + } | |
35 | 58 | |
36 | - private static String getCPUSerial(Context context) { | |
37 | - //String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); | |
38 | - String cpuAddress = Build.SERIAL; | |
59 | + private static String getCPUSerial(Context context) { | |
60 | + //String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); | |
61 | + String cpuAddress = Build.SERIAL; | |
39 | 62 | // String cpuAddress = null; |
40 | 63 | // TelephonyManager mTelephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); |
41 | 64 | // //if (PermissionUtil.hasReadExternalStoragePermission((Activity) context)) |
... | ... | @@ -45,57 +68,226 @@ public class GetDevicesUtil { |
45 | 68 | // //android.provider.Settings; |
46 | 69 | // cpuAddress = Settings.Secure.getString(context.getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID); |
47 | 70 | // } |
48 | - return cpuAddress; | |
49 | - } | |
50 | - | |
51 | - private static String getMacAddress(Context mContext){ | |
52 | - | |
53 | - String str = ""; | |
54 | - String macSerial = ""; | |
55 | - try { | |
56 | - Process pp = Runtime.getRuntime().exec( | |
57 | - "cat /sys/class/net/wlan0/address "); | |
58 | - InputStreamReader ir = new InputStreamReader(pp.getInputStream()); | |
59 | - LineNumberReader input = new LineNumberReader(ir); | |
60 | - | |
61 | - for (; null != str;) { | |
62 | - str = input.readLine(); | |
63 | - if (str != null) { | |
64 | - macSerial = str.trim();// 去空格 | |
65 | - break; | |
66 | - } | |
67 | - } | |
68 | - } catch (Exception ex) { | |
69 | - ex.printStackTrace(); | |
70 | - } | |
71 | - if (macSerial == null || "".equals(macSerial)) { | |
72 | - try { | |
73 | - return loadFileAsString("/sys/class/net/eth0/address") | |
74 | - .toUpperCase().substring(0, 17); | |
75 | - } catch (Exception e) { | |
76 | - e.printStackTrace(); | |
77 | - | |
78 | - } | |
79 | - | |
80 | - } | |
81 | - return macSerial; | |
82 | - } | |
83 | - | |
84 | - public static String loadFileAsString(String fileName) throws Exception { | |
85 | - FileReader reader = new FileReader(fileName); | |
86 | - String text = loadReaderAsString(reader); | |
87 | - reader.close(); | |
88 | - return text; | |
89 | - } | |
90 | - | |
91 | - public static String loadReaderAsString(Reader reader) throws Exception { | |
92 | - StringBuilder builder = new StringBuilder(); | |
93 | - char[] buffer = new char[4096]; | |
94 | - int readLength = reader.read(buffer); | |
95 | - while (readLength >= 0) { | |
96 | - builder.append(buffer, 0, readLength); | |
97 | - readLength = reader.read(buffer); | |
98 | - } | |
99 | - return builder.toString(); | |
100 | - } | |
71 | + return cpuAddress; | |
72 | + } | |
73 | + | |
74 | + | |
75 | + public static String getMacAddress(Context context) { | |
76 | + // 如果是7.0以下, | |
77 | + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { | |
78 | + return getMacAddress6(context); | |
79 | + } else { | |
80 | + return getNewMac(); | |
81 | + } | |
82 | + } | |
83 | + | |
84 | + | |
85 | + | |
86 | + private static String[] units = {"B", "KB", "MB", "GB", "TB"}; | |
87 | + /** | |
88 | + * 单位转换 | |
89 | + */ | |
90 | + private static String getUnit(float size) { | |
91 | + int index = 0; | |
92 | + while (size > 1024 && index < 4) { | |
93 | + size = size / 1024; | |
94 | + index++; | |
95 | + } | |
96 | + return String.format(Locale.getDefault(), " %.2f %s", size, units[index]); | |
97 | + } | |
98 | + | |
99 | + /** | |
100 | + * 获取总共容量大小,包括系统大小 | |
101 | + */ | |
102 | + public static float queryWithStorageManager(Context context) { | |
103 | + //5.0 查外置存储 | |
104 | + StorageManager storageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE); | |
105 | + float unit = 1024; | |
106 | + int version = Build.VERSION.SDK_INT; | |
107 | + if (version < Build.VERSION_CODES.M) {//小于6.0 | |
108 | + try { | |
109 | + Method getVolumeList = StorageManager.class.getDeclaredMethod("getVolumeList"); | |
110 | + StorageVolume[] volumeList = (StorageVolume[]) getVolumeList.invoke(storageManager); | |
111 | + long totalSize = 0, availableSize = 0; | |
112 | + if (volumeList != null) { | |
113 | + Method getPathFile = null; | |
114 | + for (StorageVolume volume : volumeList) { | |
115 | + if (getPathFile == null) { | |
116 | + getPathFile = volume.getClass().getDeclaredMethod("getPathFile"); | |
117 | + } | |
118 | + File file = (File) getPathFile.invoke(volume); | |
119 | + totalSize += file.getTotalSpace(); | |
120 | + availableSize += file.getUsableSpace(); | |
121 | + } | |
122 | + } | |
123 | + Log.d("TAG", "totalSize = " + getUnit(totalSize) +"||"+totalSize+ " ,availableSize = " + getUnit(availableSize)); | |
124 | + return totalSize; | |
125 | + } catch (NoSuchMethodException e) { | |
126 | + e.printStackTrace(); | |
127 | + } catch (IllegalAccessException e) { | |
128 | + e.printStackTrace(); | |
129 | + } catch (InvocationTargetException e) { | |
130 | + e.printStackTrace(); | |
131 | + } | |
132 | + } else { | |
133 | + | |
134 | + try { | |
135 | + Method getVolumes = StorageManager.class.getDeclaredMethod("getVolumes");//6.0 | |
136 | + List<Object> getVolumeInfo = (List<Object>) getVolumes.invoke(storageManager); | |
137 | + long total = 0L, used = 0L; | |
138 | + for (Object obj : getVolumeInfo) { | |
139 | + | |
140 | + Field getType = obj.getClass().getField("type"); | |
141 | + int type = getType.getInt(obj); | |
142 | + | |
143 | + Log.d("TAG", "type: " + type); | |
144 | + if (type == 1) {//TYPE_PRIVATE | |
145 | + | |
146 | + long totalSize = 0L; | |
147 | + | |
148 | + //获取内置内存总大小 | |
149 | + if (version >=26) {//8.0 | |
150 | +// unit = 1000; | |
151 | +// Method getFsUuid = obj.getClass().getDeclaredMethod("getFsUuid"); | |
152 | +// String fsUuid = (String) getFsUuid.invoke(obj); | |
153 | +// totalSize = getTotalSize(context, fsUuid);//8.0 以后使用 | |
154 | + } else if (version >= Build.VERSION_CODES.N_MR1) {//7.1.1 | |
155 | + Method getPrimaryStorageSize = StorageManager.class.getMethod("getPrimaryStorageSize");//5.0 6.0 7.0没有 | |
156 | + totalSize = (long) getPrimaryStorageSize.invoke(storageManager); | |
157 | + } | |
158 | + long systemSize = 0L; | |
159 | + | |
160 | + Method isMountedReadable = obj.getClass().getDeclaredMethod("isMountedReadable"); | |
161 | + boolean readable = (boolean) isMountedReadable.invoke(obj); | |
162 | + if (readable) { | |
163 | + Method file = obj.getClass().getDeclaredMethod("getPath"); | |
164 | + File f = (File) file.invoke(obj); | |
165 | + | |
166 | + if (totalSize == 0) { | |
167 | + totalSize = f.getTotalSpace(); | |
168 | + } | |
169 | + systemSize = totalSize - f.getTotalSpace(); | |
170 | + used += totalSize - f.getFreeSpace(); | |
171 | + total += totalSize; | |
172 | + } | |
173 | + Log.d("TAG", "设备内存大小:" + getUnit(totalSize) + "\n系统大小:" + getUnit(systemSize)); | |
174 | + Log.d("TAG", "totalSize = " + getUnit(totalSize) +"||"+totalSize+ " ,used(with system) = " + getUnit(used) + " ,free = " + getUnit(totalSize - used)); | |
175 | + return totalSize; | |
176 | + | |
177 | + } else if (type == 0) {//TYPE_PUBLIC | |
178 | +// //外置存储 | |
179 | +// Method isMountedReadable = obj.getClass().getDeclaredMethod("isMountedReadable"); | |
180 | +// boolean readable = (boolean) isMountedReadable.invoke(obj); | |
181 | +// if (readable) { | |
182 | +// Method file = obj.getClass().getDeclaredMethod("getPath"); | |
183 | +// File f = (File) file.invoke(obj); | |
184 | +// used += f.getTotalSpace() - f.getFreeSpace(); | |
185 | +// total += f.getTotalSpace(); | |
186 | +// } | |
187 | + } else if (type == 2) {//TYPE_EMULATED | |
188 | + | |
189 | + } | |
190 | + } | |
191 | + Log.d("TAG", "总内存 total = " + getUnit(total) +"||"+total+ "\n已用 used(with system) = " + getUnit(used) + "\n可用 available = " + getUnit(total - used)); | |
192 | +// return total; | |
193 | + Log.e("TAG", "缺少权限:permission.PACKAGE_USAGE_STATS"); | |
194 | + } catch (Exception e) { | |
195 | + e.printStackTrace(); | |
196 | + } | |
197 | + } | |
198 | + return 0; | |
199 | + } | |
200 | + | |
201 | + | |
202 | + | |
203 | + /** | |
204 | + * 7.0以下获取 | |
205 | + * | |
206 | + * @param mContext | |
207 | + * @return | |
208 | + */ | |
209 | + private static String getMacAddress6(Context mContext) { | |
210 | + | |
211 | + String str = ""; | |
212 | + String macSerial = ""; | |
213 | + try { | |
214 | + Process pp = Runtime.getRuntime().exec( | |
215 | + "cat /sys/class/net/wlan0/address "); | |
216 | + InputStreamReader ir = new InputStreamReader(pp.getInputStream()); | |
217 | + LineNumberReader input = new LineNumberReader(ir); | |
218 | + | |
219 | + for (; null != str; ) { | |
220 | + str = input.readLine(); | |
221 | + if (str != null) { | |
222 | + macSerial = str.trim();// 去空格 | |
223 | + break; | |
224 | + } | |
225 | + } | |
226 | + } catch (Exception ex) { | |
227 | + ex.printStackTrace(); | |
228 | + } | |
229 | + if (macSerial == null || "".equals(macSerial)) { | |
230 | + try { | |
231 | + return loadFileAsString("/sys/class/net/eth0/address") | |
232 | + .toUpperCase().substring(0, 17); | |
233 | + } catch (Exception e) { | |
234 | + e.printStackTrace(); | |
235 | + | |
236 | + } | |
237 | + | |
238 | + } | |
239 | + return macSerial; | |
240 | + } | |
241 | + | |
242 | + public static String loadFileAsString(String fileName) throws Exception { | |
243 | + FileReader reader = new FileReader(fileName); | |
244 | + String text = loadReaderAsString(reader); | |
245 | + reader.close(); | |
246 | + return text; | |
247 | + } | |
248 | + | |
249 | + public static String loadReaderAsString(Reader reader) throws Exception { | |
250 | + StringBuilder builder = new StringBuilder(); | |
251 | + char[] buffer = new char[4096]; | |
252 | + int readLength = reader.read(buffer); | |
253 | + while (readLength >= 0) { | |
254 | + builder.append(buffer, 0, readLength); | |
255 | + readLength = reader.read(buffer); | |
256 | + } | |
257 | + return builder.toString(); | |
258 | + } | |
259 | + | |
260 | + | |
261 | + /** | |
262 | + * 7.0以上根据busybox获取本地Mac | |
263 | + * | |
264 | + * @return | |
265 | + */ | |
266 | + private static String getNewMac() { | |
267 | + try { | |
268 | + List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces()); | |
269 | + for (NetworkInterface nif : all) { | |
270 | + if (!nif.getName().equalsIgnoreCase("wlan0")) continue; | |
271 | + | |
272 | + byte[] macBytes = nif.getHardwareAddress(); | |
273 | + if (macBytes == null) { | |
274 | + return null; | |
275 | + } | |
276 | + | |
277 | + StringBuilder res1 = new StringBuilder(); | |
278 | + for (byte b : macBytes) { | |
279 | + res1.append(String.format("%02X:", b)); | |
280 | + } | |
281 | + | |
282 | + if (res1.length() > 0) { | |
283 | + res1.deleteCharAt(res1.length() - 1); | |
284 | + } | |
285 | + return res1.toString(); | |
286 | + } | |
287 | + } catch (Exception ex) { | |
288 | + ex.printStackTrace(); | |
289 | + } | |
290 | + return null; | |
291 | + } | |
292 | + | |
101 | 293 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/PermissionUtil.java
... | ... | @@ -14,7 +14,7 @@ import android.util.Log; |
14 | 14 | */ |
15 | 15 | public class PermissionUtil { |
16 | 16 | public static final int REQUEST_SHOWCAMERA = 0; |
17 | - public static final int READ_PHONE_STATE = 1; | |
17 | + public static final int WRITE_EXTERNAL_STORAGE = 1; | |
18 | 18 | public static final int REQUEST_RECORD_AUDIO = 2; |
19 | 19 | public static final int REQUEST_CONTACTS = 3; |
20 | 20 | public static final int REQUEST_LOCATION = 4; |
... | ... | @@ -57,15 +57,15 @@ public class PermissionUtil { |
57 | 57 | |
58 | 58 | public static boolean hasReadExternalStoragePermission(Activity activity){ |
59 | 59 | int hasPermission = ContextCompat.checkSelfPermission(activity, |
60 | - Manifest.permission.READ_PHONE_STATE); | |
61 | - if(!permissionExists(Manifest.permission.READ_PHONE_STATE)){ | |
62 | - Log.e("permission","your system does not suppport "+ Manifest.permission.READ_PHONE_STATE+" permission"); | |
60 | + Manifest.permission.WRITE_EXTERNAL_STORAGE); | |
61 | + if(!permissionExists(Manifest.permission.WRITE_EXTERNAL_STORAGE)){ | |
62 | + Log.e("permission","your system does not suppport "+ Manifest.permission.WRITE_EXTERNAL_STORAGE+" permission"); | |
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | if (hasPermission != PackageManager.PERMISSION_GRANTED) { |
66 | 66 | ActivityCompat.requestPermissions(activity, |
67 | - new String[]{Manifest.permission.READ_PHONE_STATE}, | |
68 | - PermissionUtil.READ_PHONE_STATE); | |
67 | + new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, | |
68 | + PermissionUtil.WRITE_EXTERNAL_STORAGE); | |
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | return true; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/PhoneNumCheckUtils.java
... | ... | @@ -17,22 +17,22 @@ public class PhoneNumCheckUtils { |
17 | 17 | private static final String PHONE_CALL_PATTERN = "^(\\(\\d{3,4}\\)|\\d{3,4}-)?\\d{7,8}(-\\d{1,4})?$"; |
18 | 18 | |
19 | 19 | /** |
20 | - * 中国电信号码格式验证 手机段: 133,153,180,181,189,177,1700,173 | |
20 | + * 中国电信号码格式验证 手机段: 133,153,180,181,189,177,1700,173,199 | |
21 | 21 | * **/ |
22 | - private static final String CHINA_TELECOM_PATTERN = "(^1(33|53|7[37]|8[019])\d{8}$)|(^1700\d{7}$)"; | |
22 | + private static final String CHINA_TELECOM_PATTERN = "(^1(33|53|7[37]|8[019]|9[9])\d{8}$)|(^1700\d{7}$)"; | |
23 | 23 | |
24 | 24 | /** |
25 | - * 中国联通号码格式验证 手机段:130,131,132,155,156,185,186,145,176,1707,1708,1709 | |
25 | + * 中国联通号码格式验证 手机段:130,131,132,155,156,185,186,145,176,1707,1708,1709,166 | |
26 | 26 | * **/ |
27 | - private static final String CHINA_UNICOM_PATTERN = "(^1(3[0-2]|4[5]|5[56]|7[6]|8[56])\d{8}$)|(^170[7-9]\d{7}$)"; | |
27 | + private static final String CHINA_UNICOM_PATTERN = "(^1(3[0-2]|4[5]|5[56]|6[6]|7[6]|8[56])\d{8}$)|(^170[7-9]\d{7}$)"; | |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * 中国移动号码格式验证 |
31 | 31 | * 手机段:134,135,136,137,138,139,150,151,152,157,158,159,182,183,184 |
32 | - * ,187,188,147,178,1705 | |
32 | + * ,187,188,147,178,1705,198 | |
33 | 33 | * |
34 | 34 | **/ |
35 | - private static final String CHINA_MOBILE_PATTERN = "(^1(3[4-9]|4[7]|5[0-27-9]|7[8]|8[2-478])\d{8}$)|(^1705\d{7}$)"; | |
35 | + private static final String CHINA_MOBILE_PATTERN = "(^1(3[4-9]|4[7]|5[0-27-9]|7[8]|8[2-478]|9[8])\d{8}$)|(^1705\d{7}$)"; | |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * 仅手机号格式校验 |
... | ... | @@ -73,7 +73,12 @@ public class PhoneNumCheckUtils { |
73 | 73 | * @return |
74 | 74 | */ |
75 | 75 | public static boolean isPhone(String input) { |
76 | - return match(PHONE_PATTERN, input); | |
76 | +// return match(PHONE_PATTERN, input); | |
77 | + if(input.length()==11){ | |
78 | + return true; | |
79 | + }else{ | |
80 | + return false; | |
81 | + } | |
77 | 82 | } |
78 | 83 | |
79 | 84 | /** | ... | ... |
PersonalCenter/app/src/main/res/drawable/blue_btn_bg_normal.xml
... | ... | @@ -5,10 +5,7 @@ |
5 | 5 | <solid android:color="@color/login_text_blue" /> |
6 | 6 | |
7 | 7 | <corners |
8 | - android:bottomLeftRadius="8dp" | |
9 | - android:bottomRightRadius="8dp" | |
10 | - android:topLeftRadius="8dp" | |
11 | - android:topRightRadius="8dp" /> | |
8 | + android:radius="30dp"/> | |
12 | 9 | |
13 | 10 | <stroke |
14 | 11 | android:width="1px" | ... | ... |
PersonalCenter/app/src/main/res/drawable/blue_btn_bg_pressed.xml
... | ... | @@ -5,10 +5,7 @@ |
5 | 5 | <solid android:color="@color/login_text_blue" /> |
6 | 6 | |
7 | 7 | <corners |
8 | - android:bottomLeftRadius="8dp" | |
9 | - android:bottomRightRadius="8dp" | |
10 | - android:topLeftRadius="8dp" | |
11 | - android:topRightRadius="8dp" /> | |
8 | + android:radius="30dp"/> | |
12 | 9 | |
13 | 10 | <stroke |
14 | 11 | android:width="1px" | ... | ... |
PersonalCenter/app/src/main/res/drawable/code_bg.xml
... | ... | @@ -0,0 +1,14 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:shape="rectangle" > | |
4 | + | |
5 | + <solid android:color="@color/input_bg"/> | |
6 | + | |
7 | + <corners android:radius="30dip"/> | |
8 | + <!--显示一条虚线,破折线的宽度为dashWith,破折线之间的空隙的宽度为dashGap,当dashGap=0dp时,为实线 --> | |
9 | + <stroke | |
10 | + android:dashGap="0dp" | |
11 | + android:dashWidth="2dp" | |
12 | + android:width="1.5dp" | |
13 | + android:color="@color/login_text_blue" /> | |
14 | +</shape> | |
0 | 15 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/drawable/input_bg.xml
... | ... | @@ -0,0 +1,9 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:shape="rectangle" > | |
4 | + | |
5 | + <solid android:color="@color/input_bg"/> | |
6 | + | |
7 | + <corners android:radius="30dip"/> | |
8 | + | |
9 | +</shape> | |
0 | 10 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/drawable/white_cycle_bg.xml
... | ... | @@ -0,0 +1,9 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:shape="rectangle" > | |
4 | + | |
5 | + <solid android:color="@color/white"/> | |
6 | + | |
7 | + <corners android:radius="20dip"/> | |
8 | + | |
9 | +</shape> | |
0 | 10 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_changepsword.xml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="#ffffffff" | |
5 | + android:background="@mipmap/main_bg" | |
6 | 6 | android:orientation="vertical"> |
7 | 7 | |
8 | 8 | <RelativeLayout |
... | ... | @@ -31,71 +31,108 @@ |
31 | 31 | android:textSize="22sp" /> |
32 | 32 | </RelativeLayout> |
33 | 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 | - <RelativeLayout | |
34 | + <LinearLayout | |
35 | + android:layout_width="550dp" | |
36 | + android:layout_height="600dp" | |
37 | + android:layout_centerInParent="true" | |
38 | + android:layout_marginTop="20dp" | |
39 | + android:background="@drawable/white_cycle_bg" | |
40 | + android:paddingLeft="30dp" | |
41 | + android:paddingRight="30dp" | |
42 | + android:orientation="vertical"> | |
43 | + | |
44 | + <ImageView | |
45 | + android:id="@+id/iv_logo" | |
46 | + android:layout_width="wrap_content" | |
47 | + android:layout_height="wrap_content" | |
48 | + android:layout_gravity="center_horizontal" | |
49 | + android:layout_marginTop="15dp" | |
50 | + android:src="@mipmap/logo" /> | |
51 | + | |
52 | + | |
53 | + <LinearLayout | |
44 | 54 | android:id="@+id/pwd_rl" |
45 | 55 | android:layout_width="match_parent" |
46 | 56 | android:layout_height="wrap_content" |
47 | - android:layout_marginTop="100dp"> | |
57 | + android:layout_marginTop="30dp" | |
58 | + android:background="@drawable/input_bg" | |
59 | + android:gravity="center_horizontal" | |
60 | + android:orientation="horizontal" | |
61 | + android:paddingRight="10dp"> | |
48 | 62 | |
49 | 63 | <EditText |
50 | 64 | android:id="@+id/et_oldpassword" |
51 | 65 | style="@style/login_register_edit_style" |
52 | 66 | android:hint="输入原密码" |
53 | - android:inputType="textPassword" /> | |
67 | + android:imeOptions="actionNext" | |
68 | + android:inputType="textPassword" | |
69 | + android:maxLength="11" /> | |
54 | 70 | |
55 | - </RelativeLayout> | |
71 | + <ImageButton | |
72 | + android:id="@+id/oldpassword_delete_btn" | |
73 | + android:layout_width="50dp" | |
74 | + android:layout_height="match_parent" | |
75 | + android:background="@null" | |
76 | + android:src="@mipmap/delete_btn" | |
77 | + android:visibility="invisible" /> | |
78 | + </LinearLayout> | |
56 | 79 | |
57 | 80 | |
58 | - <TextView | |
59 | - android:id="@+id/oldpassword_error_hint" | |
60 | - style="@style/registererrhint_style" | |
61 | - android:layout_below="@id/pwd_rl" /> | |
62 | - <RelativeLayout | |
63 | - android:id="@+id/et_newpassworda" | |
81 | + <LinearLayout | |
64 | 82 | android:layout_width="match_parent" |
65 | - android:layout_below="@id/pwd_rl" | |
66 | - android:layout_marginTop="30dp" | |
67 | - android:layout_height="wrap_content"> | |
83 | + android:layout_height="wrap_content" | |
84 | + android:layout_below="@id/rl_authcode" | |
85 | + android:background="@drawable/input_bg" | |
86 | + android:gravity="center_vertical" | |
87 | + android:layout_marginTop="40dp"> | |
88 | + | |
68 | 89 | <EditText |
69 | 90 | android:id="@+id/et_newpassword" |
70 | 91 | style="@style/login_register_edit_style" |
71 | 92 | android:hint="密码为英文和数字组成,最少8位" |
72 | 93 | android:inputType="textPassword" /> |
94 | + | |
73 | 95 | <ImageView |
74 | 96 | android:id="@+id/iv_pwd_change" |
75 | - android:padding="10dp" | |
76 | 97 | android:layout_width="40dp" |
77 | - android:layout_marginRight="10dp" | |
78 | 98 | android:layout_height="wrap_content" |
79 | 99 | android:layout_alignParentRight="true" |
80 | 100 | android:layout_centerVertical="true" |
101 | + android:layout_marginLeft="10dp" | |
102 | + android:layout_marginRight="15dp" | |
103 | + android:padding="10dp" | |
81 | 104 | android:src="@mipmap/pwd_hide" /> |
105 | + </LinearLayout> | |
82 | 106 | |
83 | - </RelativeLayout> | |
84 | 107 | |
85 | 108 | |
109 | + <LinearLayout | |
110 | + android:id="@+id/et_again_newpassword_layout" | |
111 | + android:layout_width="match_parent" | |
112 | + android:layout_height="wrap_content" | |
113 | + android:layout_marginTop="40dp" | |
114 | + android:background="@drawable/input_bg" | |
115 | + android:gravity="center_vertical" | |
116 | + android:orientation="horizontal"> | |
86 | 117 | |
87 | - <TextView | |
88 | - android:id="@+id/newpassword_error_hint" | |
89 | - style="@style/registererrhint_style" | |
90 | - android:layout_below="@id/et_newpassworda" /> | |
118 | + <EditText | |
119 | + android:id="@+id/et_again_newpassword" | |
120 | + style="@style/login_register_edit_style" | |
121 | + android:layout_below="@id/pwd_rl" | |
122 | + android:hint="再次输入新密码" | |
123 | + android:inputType="textPassword" /> | |
91 | 124 | |
92 | - <EditText | |
93 | - android:id="@+id/et_again_newpassword" | |
94 | - style="@style/login_register_edit_style" | |
95 | - android:layout_below="@id/et_newpassworda" | |
96 | - android:layout_marginTop="30dp" | |
97 | - android:hint="再次输入新密码" | |
98 | - android:inputType="textPassword" /> | |
125 | + <ImageView | |
126 | + android:id="@+id/iv_newpwd_change" | |
127 | + android:layout_width="40dp" | |
128 | + android:layout_height="wrap_content" | |
129 | + android:layout_alignParentRight="true" | |
130 | + android:layout_centerVertical="true" | |
131 | + android:layout_marginLeft="10dp" | |
132 | + android:layout_marginRight="15dp" | |
133 | + android:padding="10dp" | |
134 | + android:src="@mipmap/pwd_hide" /> | |
135 | + </LinearLayout> | |
99 | 136 | |
100 | 137 | <TextView |
101 | 138 | android:id="@+id/again_newpassword_error_hint" |
... | ... | @@ -106,8 +143,8 @@ |
106 | 143 | android:id="@+id/btn_ok" |
107 | 144 | style="@style/button_login_register_style" |
108 | 145 | android:layout_below="@id/et_again_newpassword" |
109 | - android:layout_marginTop="30dp" | |
146 | + android:layout_marginTop="70dp" | |
110 | 147 | android:text="确 定" /> |
111 | - </RelativeLayout> | |
148 | + </LinearLayout> | |
112 | 149 | |
113 | 150 | </RelativeLayout> |
114 | 151 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml
... | ... | @@ -152,6 +152,7 @@ |
152 | 152 | android:text="修改" |
153 | 153 | android:paddingLeft="5dp" |
154 | 154 | android:paddingRight="5dp" |
155 | + android:visibility="gone" | |
155 | 156 | android:textColor="@color/login_text_blue" |
156 | 157 | android:textSize="18sp" /> |
157 | 158 | |
... | ... | @@ -356,7 +357,7 @@ |
356 | 357 | <LinearLayout |
357 | 358 | android:layout_width="match_parent" |
358 | 359 | android:layout_height="wrap_content" |
359 | - android:layout_marginTop="30dp" | |
360 | + android:layout_marginTop="5dp" | |
360 | 361 | android:gravity="center" |
361 | 362 | android:orientation="horizontal"> |
362 | 363 | |
... | ... | @@ -365,16 +366,29 @@ |
365 | 366 | android:layout_height="wrap_content" |
366 | 367 | android:src="@mipmap/phone"/> |
367 | 368 | <TextView |
369 | + android:id="@+id/service_phone" | |
368 | 370 | android:layout_width="wrap_content" |
369 | 371 | android:layout_height="wrap_content" |
370 | 372 | android:textSize="30sp" |
371 | 373 | android:layout_marginLeft="5dp" |
372 | 374 | android:textColor="@color/login_text_blue" |
373 | - android:text="4006-123-678"/> | |
375 | + android:text="400-800-3813"/> | |
374 | 376 | |
375 | 377 | |
376 | 378 | </LinearLayout> |
377 | 379 | |
378 | - | |
379 | - | |
380 | + <ImageView | |
381 | + android:layout_width="wrap_content" | |
382 | + android:layout_height="wrap_content" | |
383 | + android:src="@mipmap/public_qa_code" | |
384 | + android:layout_gravity="center_horizontal" | |
385 | + android:layout_marginTop="5dp"/> | |
386 | + <TextView | |
387 | + android:layout_width="wrap_content" | |
388 | + android:layout_height="wrap_content" | |
389 | + android:layout_marginTop="5dp" | |
390 | + android:text="关注好记星微信公众号" | |
391 | + android:textColor="@color/electronic_text" | |
392 | + android:textSize="16sp" | |
393 | + android:layout_gravity="center_horizontal"/> | |
380 | 394 | </LinearLayout> |
381 | 395 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | 3 | android:id="@+id/card_view" |
4 | 4 | android:layout_width="match_parent" |
5 | 5 | android:layout_height="match_parent" |
6 | + android:background="@mipmap/main_bg" | |
6 | 7 | android:orientation="vertical"> |
7 | 8 | |
8 | 9 | <RelativeLayout |
... | ... | @@ -31,366 +32,393 @@ |
31 | 32 | android:textSize="22sp" /> |
32 | 33 | </RelativeLayout> |
33 | 34 | |
34 | - <ImageView | |
35 | - android:layout_width="wrap_content" | |
36 | - android:layout_height="wrap_content" | |
37 | - android:layout_gravity="center" | |
38 | - android:layout_marginTop="20dp" | |
39 | - android:src="@mipmap/change_info_icon" /> | |
35 | + <!-- <ImageView | |
36 | + android:layout_width="wrap_content" | |
37 | + android:layout_height="wrap_content" | |
38 | + android:layout_gravity="center" | |
39 | + android:layout_marginTop="20dp" | |
40 | + android:src="@mipmap/change_info_icon" />--> | |
41 | + | |
40 | 42 | |
41 | 43 | <LinearLayout |
42 | - android:layout_width="wrap_content" | |
43 | - android:layout_height="wrap_content" | |
44 | - android:layout_marginTop="60dp" | |
45 | - android:orientation="horizontal"> | |
44 | + android:layout_width="match_parent" | |
45 | + android:layout_height="580dp" | |
46 | + android:layout_centerInParent="true" | |
47 | + android:layout_marginLeft="100dp" | |
48 | + android:layout_marginRight="100dp" | |
49 | + android:background="@drawable/white_cycle_bg" | |
50 | + android:gravity="center_horizontal" | |
51 | + android:orientation="vertical" | |
52 | + android:paddingLeft="20dp" | |
53 | + android:paddingRight="20dp"> | |
54 | + | |
55 | + <ImageView | |
56 | + android:id="@+id/iv_logo" | |
57 | + android:layout_width="wrap_content" | |
58 | + android:layout_height="wrap_content" | |
59 | + android:layout_gravity="center_horizontal" | |
60 | + android:layout_marginTop="10dp" | |
61 | + android:src="@mipmap/logo" /> | |
46 | 62 | |
47 | - <View | |
48 | - android:layout_width="450dp" | |
49 | - android:layout_height="0.7dp" | |
50 | - android:layout_marginLeft="150dp" | |
51 | - android:background="@color/cutoff_line"> | |
63 | + <LinearLayout | |
64 | + android:layout_width="wrap_content" | |
65 | + android:layout_height="wrap_content" | |
66 | + android:layout_marginTop="20dp" | |
67 | + android:orientation="horizontal"> | |
52 | 68 | |
53 | - </View> | |
69 | + <View | |
70 | + android:layout_width="450dp" | |
71 | + android:layout_height="0.7dp" | |
72 | + android:background="@color/cutoff_line"> | |
54 | 73 | |
55 | - <View | |
56 | - android:layout_width="450dp" | |
57 | - android:layout_height="0.7dp" | |
58 | - android:layout_marginLeft="80dp" | |
59 | - android:background="@color/cutoff_line"> | |
74 | + </View> | |
60 | 75 | |
61 | - </View> | |
76 | + <View | |
77 | + android:layout_width="500dp" | |
78 | + android:layout_height="0.7dp" | |
79 | + android:layout_marginLeft="80dp" | |
80 | + android:background="@color/cutoff_line"> | |
62 | 81 | |
82 | + </View> | |
63 | 83 | |
64 | - </LinearLayout> | |
65 | 84 | |
66 | - <LinearLayout | |
67 | - android:layout_width="match_parent" | |
68 | - android:layout_height="wrap_content" | |
69 | - android:layout_marginLeft="200dp" | |
70 | - android:gravity="center_vertical" | |
71 | - android:orientation="horizontal"> | |
85 | + </LinearLayout> | |
72 | 86 | |
73 | 87 | <LinearLayout |
74 | - android:layout_width="0dp" | |
75 | - android:layout_height="80dp" | |
76 | - android:layout_weight="1" | |
88 | + android:layout_width="match_parent" | |
89 | + android:layout_height="wrap_content" | |
90 | + android:layout_marginLeft="20dp" | |
77 | 91 | android:gravity="center_vertical" |
78 | - android:focusable="true" | |
79 | - android:focusableInTouchMode="true"> | |
80 | - | |
81 | - <TextView | |
82 | - android:layout_width="wrap_content" | |
83 | - android:layout_height="wrap_content" | |
84 | - android:text="客户姓名" | |
85 | - android:textSize="22sp" /> | |
86 | - | |
87 | - <EditText | |
88 | - android:id="@+id/et_edit_username" | |
89 | - android:layout_width="wrap_content" | |
90 | - android:layout_height="wrap_content" | |
91 | - android:layout_marginLeft="50dp" | |
92 | - android:background="@null" | |
93 | - android:padding="20dp" | |
94 | - android:textColor="@color/login_text_black" | |
95 | - android:hint="请输入" | |
96 | - android:textSize="22sp" /> | |
92 | + android:orientation="horizontal"> | |
93 | + | |
94 | + <LinearLayout | |
95 | + android:layout_width="0dp" | |
96 | + android:layout_height="80dp" | |
97 | + android:layout_weight="1" | |
98 | + android:focusable="true" | |
99 | + android:focusableInTouchMode="true" | |
100 | + android:gravity="center_vertical"> | |
101 | + | |
102 | + <TextView | |
103 | + android:layout_width="wrap_content" | |
104 | + android:layout_height="wrap_content" | |
105 | + android:text="客户姓名" | |
106 | + android:textSize="22sp" /> | |
107 | + | |
108 | + <EditText | |
109 | + android:id="@+id/et_edit_username" | |
110 | + android:layout_width="wrap_content" | |
111 | + android:layout_height="wrap_content" | |
112 | + android:layout_marginLeft="50dp" | |
113 | + android:background="@null" | |
114 | + android:hint="请输入" | |
115 | + android:padding="20dp" | |
116 | + android:textColor="@color/login_text_black" | |
117 | + android:textSize="22sp" /> | |
118 | + | |
119 | + </LinearLayout> | |
120 | + | |
121 | + <LinearLayout | |
122 | + android:layout_width="0dp" | |
123 | + android:layout_height="80dp" | |
124 | + android:layout_weight="1" | |
125 | + android:gravity="center_vertical"> | |
126 | + | |
127 | + <TextView | |
128 | + android:layout_width="150dp" | |
129 | + android:layout_height="wrap_content" | |
130 | + android:text="购买地址" | |
131 | + android:textSize="22sp" /> | |
132 | + | |
133 | + <TextView | |
134 | + android:id="@+id/tv_edit_adress_shop" | |
135 | + android:layout_width="wrap_content" | |
136 | + android:layout_height="wrap_content" | |
137 | + android:layout_marginLeft="20dp" | |
138 | + android:hint="请选择地区" | |
139 | + android:padding="20dp" | |
140 | + android:textColor="@color/login_text_black" | |
141 | + android:textSize="22sp" /> | |
142 | + | |
143 | + <ImageView | |
144 | + android:id="@+id/shopdizhi" | |
145 | + android:layout_width="wrap_content" | |
146 | + android:layout_height="wrap_content" | |
147 | + android:layout_marginLeft="60dp" | |
148 | + android:padding="20dp" | |
149 | + android:src="@mipmap/xiajiantou"> | |
150 | + | |
151 | + </ImageView> | |
152 | + </LinearLayout> | |
97 | 153 | |
98 | 154 | </LinearLayout> |
99 | 155 | |
100 | 156 | <LinearLayout |
101 | - android:layout_width="0dp" | |
102 | - android:layout_height="80dp" | |
103 | - android:layout_weight="1" | |
104 | - android:gravity="center_vertical"> | |
105 | - | |
106 | - <TextView | |
107 | - android:layout_width="150dp" | |
108 | - android:layout_height="wrap_content" | |
109 | - android:text="购买地址" | |
110 | - android:textSize="22sp" /> | |
111 | - | |
112 | - <TextView | |
113 | - android:id="@+id/tv_edit_adress_shop" | |
114 | - android:layout_width="wrap_content" | |
115 | - android:layout_height="wrap_content" | |
116 | - android:layout_marginLeft="20dp" | |
117 | - android:padding="20dp" | |
118 | - android:textColor="@color/login_text_black" | |
119 | - android:hint="请选择地区" | |
120 | - android:textSize="22sp" /> | |
121 | - | |
122 | - <ImageView | |
123 | - android:id="@+id/shopdizhi" | |
124 | - android:layout_width="wrap_content" | |
125 | - android:layout_height="wrap_content" | |
126 | - android:padding="20dp" | |
127 | - android:layout_marginLeft="60dp" | |
128 | - android:src="@mipmap/xiajiantou"> | |
129 | - | |
130 | - </ImageView> | |
131 | - </LinearLayout> | |
132 | - | |
133 | - </LinearLayout> | |
134 | - | |
135 | - <LinearLayout | |
136 | - android:layout_width="wrap_content" | |
137 | - android:layout_height="wrap_content" | |
138 | - android:orientation="horizontal"> | |
139 | - | |
140 | - <View | |
141 | - android:layout_width="450dp" | |
142 | - android:layout_height="0.7dp" | |
143 | - android:layout_marginLeft="150dp" | |
144 | - android:background="@color/cutoff_line"> | |
145 | - | |
146 | - </View> | |
147 | - | |
148 | - <View | |
149 | - android:layout_width="450dp" | |
150 | - android:layout_height="0.7dp" | |
151 | - android:layout_marginLeft="80dp" | |
152 | - android:background="@color/cutoff_line"> | |
153 | - | |
154 | - </View> | |
157 | + android:layout_width="wrap_content" | |
158 | + android:layout_height="wrap_content" | |
159 | + android:orientation="horizontal"> | |
155 | 160 | |
161 | + <View | |
162 | + android:layout_width="450dp" | |
163 | + android:layout_height="0.7dp" | |
164 | + android:background="@color/cutoff_line"> | |
156 | 165 | |
157 | - </LinearLayout> | |
166 | + </View> | |
158 | 167 | |
159 | - <LinearLayout | |
160 | - android:layout_width="match_parent" | |
161 | - android:layout_height="wrap_content" | |
162 | - android:layout_marginLeft="200dp" | |
163 | - android:gravity="center_vertical" | |
164 | - android:orientation="horizontal"> | |
168 | + <View | |
169 | + android:layout_width="500dp" | |
170 | + android:layout_height="0.7dp" | |
171 | + android:layout_marginLeft="80dp" | |
172 | + android:background="@color/cutoff_line"> | |
165 | 173 | |
166 | - <LinearLayout | |
167 | - android:layout_width="0dp" | |
168 | - android:layout_height="80dp" | |
169 | - android:layout_weight="1" | |
170 | - android:gravity="center_vertical"> | |
171 | - | |
172 | - <TextView | |
173 | - android:layout_width="wrap_content" | |
174 | - android:layout_height="wrap_content" | |
175 | - android:text="客户地址" | |
176 | - android:textSize="22sp" /> | |
177 | - | |
178 | - <TextView | |
179 | - android:id="@+id/tv_edit_adress_custem" | |
180 | - android:layout_width="wrap_content" | |
181 | - android:layout_height="wrap_content" | |
182 | - android:layout_marginLeft="50dp" | |
183 | - android:textColor="@color/login_text_black" | |
184 | - android:hint="请选择地区" | |
185 | - android:padding="20dp" | |
186 | - android:textSize="22sp" /> | |
187 | - | |
188 | - <ImageView | |
189 | - android:id="@+id/cunstomdizhi" | |
190 | - android:layout_width="wrap_content" | |
191 | - android:layout_height="wrap_content" | |
192 | - android:layout_marginLeft="60dp" | |
193 | - android:padding="20dp" | |
194 | - android:src="@mipmap/xiajiantou"> | |
195 | - | |
196 | - </ImageView> | |
174 | + </View> | |
197 | 175 | |
198 | 176 | |
199 | 177 | </LinearLayout> |
200 | 178 | |
201 | 179 | <LinearLayout |
202 | - android:layout_width="0dp" | |
203 | - android:layout_height="80dp" | |
204 | - android:layout_weight="1" | |
205 | - android:gravity="center_vertical"> | |
206 | - | |
207 | - <TextView | |
208 | - android:layout_width="150dp" | |
209 | - android:layout_height="wrap_content" | |
210 | - android:text=" " | |
211 | - android:textColor="@color/white" | |
212 | - android:textSize="22sp" /> | |
213 | - | |
214 | - <EditText | |
215 | - android:id="@+id/et_edit_store" | |
216 | - android:layout_width="wrap_content" | |
217 | - android:layout_height="wrap_content" | |
218 | - android:layout_marginLeft="20dp" | |
219 | - android:background="@null" | |
220 | - android:padding="20dp" | |
221 | - android:textColor="@color/login_text_black" | |
222 | - android:hint="请输入商店名称" | |
223 | - android:textSize="22sp" /> | |
180 | + android:layout_width="match_parent" | |
181 | + android:layout_height="wrap_content" | |
182 | + android:layout_marginLeft="20dp" | |
183 | + android:gravity="center_vertical" | |
184 | + android:orientation="horizontal"> | |
185 | + | |
186 | + <LinearLayout | |
187 | + android:layout_width="0dp" | |
188 | + android:layout_height="80dp" | |
189 | + android:layout_weight="1" | |
190 | + android:gravity="center_vertical"> | |
191 | + | |
192 | + <TextView | |
193 | + android:layout_width="wrap_content" | |
194 | + android:layout_height="wrap_content" | |
195 | + android:text="客户地址" | |
196 | + android:textSize="22sp" /> | |
197 | + | |
198 | + <TextView | |
199 | + android:id="@+id/tv_edit_adress_custem" | |
200 | + android:layout_width="wrap_content" | |
201 | + android:layout_height="wrap_content" | |
202 | + android:layout_marginLeft="50dp" | |
203 | + android:hint="请选择地区" | |
204 | + android:padding="20dp" | |
205 | + android:textColor="@color/login_text_black" | |
206 | + android:textSize="22sp" /> | |
207 | + | |
208 | + <ImageView | |
209 | + android:id="@+id/cunstomdizhi" | |
210 | + android:layout_width="wrap_content" | |
211 | + android:layout_height="wrap_content" | |
212 | + android:layout_marginLeft="60dp" | |
213 | + android:padding="20dp" | |
214 | + android:src="@mipmap/xiajiantou"> | |
215 | + | |
216 | + </ImageView> | |
217 | + | |
218 | + | |
219 | + </LinearLayout> | |
220 | + | |
221 | + <LinearLayout | |
222 | + android:layout_width="0dp" | |
223 | + android:layout_height="80dp" | |
224 | + android:layout_weight="1" | |
225 | + android:gravity="center_vertical"> | |
226 | + | |
227 | + <TextView | |
228 | + android:layout_width="150dp" | |
229 | + android:layout_height="wrap_content" | |
230 | + android:text=" " | |
231 | + android:textColor="@color/white" | |
232 | + android:textSize="22sp" /> | |
233 | + | |
234 | + <EditText | |
235 | + android:id="@+id/et_edit_store" | |
236 | + android:layout_width="wrap_content" | |
237 | + android:layout_height="wrap_content" | |
238 | + android:layout_marginLeft="20dp" | |
239 | + android:background="@null" | |
240 | + android:hint="请输入商店名称" | |
241 | + android:padding="20dp" | |
242 | + android:textColor="@color/login_text_black" | |
243 | + android:textSize="22sp" /> | |
244 | + | |
245 | + </LinearLayout> | |
224 | 246 | |
225 | 247 | </LinearLayout> |
226 | 248 | |
227 | - </LinearLayout> | |
228 | - | |
229 | - <LinearLayout | |
230 | - android:layout_width="wrap_content" | |
231 | - android:layout_height="wrap_content" | |
232 | - | |
233 | - android:orientation="horizontal"> | |
234 | - | |
235 | - <View | |
236 | - android:layout_width="450dp" | |
237 | - android:layout_height="0.7dp" | |
238 | - android:layout_marginLeft="150dp" | |
239 | - android:background="@color/cutoff_line"> | |
240 | - | |
241 | - </View> | |
249 | + <LinearLayout | |
250 | + android:layout_width="wrap_content" | |
251 | + android:layout_height="wrap_content" | |
242 | 252 | |
243 | - <View | |
244 | - android:layout_width="450dp" | |
245 | - android:layout_height="0.7dp" | |
246 | - android:layout_marginLeft="80dp" | |
247 | - android:background="@color/cutoff_line"> | |
253 | + android:orientation="horizontal"> | |
248 | 254 | |
249 | - </View> | |
255 | + <View | |
256 | + android:layout_width="450dp" | |
257 | + android:layout_height="0.7dp" | |
258 | + android:background="@color/cutoff_line"> | |
250 | 259 | |
260 | + </View> | |
251 | 261 | |
252 | - </LinearLayout> | |
262 | + <View | |
263 | + android:layout_width="500dp" | |
264 | + android:layout_height="0.7dp" | |
265 | + android:layout_marginLeft="80dp" | |
266 | + android:background="@color/cutoff_line"> | |
253 | 267 | |
254 | - <LinearLayout | |
255 | - android:layout_width="match_parent" | |
256 | - android:layout_height="wrap_content" | |
257 | - android:layout_marginLeft="200dp" | |
258 | - android:gravity="center_vertical" | |
259 | - android:orientation="horizontal"> | |
268 | + </View> | |
260 | 269 | |
261 | - <LinearLayout | |
262 | - android:layout_width="0dp" | |
263 | - android:layout_height="80dp" | |
264 | - android:layout_weight="1" | |
265 | - android:gravity="center_vertical"> | |
266 | - | |
267 | - <TextView | |
268 | - android:layout_width="wrap_content" | |
269 | - android:layout_height="wrap_content" | |
270 | - android:text=" " | |
271 | - android:textColor="@color/white" | |
272 | - android:textSize="22sp" /> | |
273 | - | |
274 | - <EditText | |
275 | - android:id="@+id/et_edit_adress_detail" | |
276 | - android:layout_width="wrap_content" | |
277 | - android:layout_height="wrap_content" | |
278 | - android:layout_marginLeft="100dp" | |
279 | - android:background="@null" | |
280 | - android:padding="20dp" | |
281 | - android:textColor="@color/login_text_black" | |
282 | - android:hint="请输入详细地址" | |
283 | - android:textSize="22sp" /> | |
284 | 270 | |
285 | 271 | </LinearLayout> |
286 | 272 | |
287 | 273 | <LinearLayout |
288 | - android:layout_width="0dp" | |
289 | - android:layout_height="80dp" | |
290 | - android:layout_weight="1" | |
291 | - android:gravity="center_vertical"> | |
292 | - | |
293 | - <TextView | |
294 | - android:layout_width="150dp" | |
295 | - android:layout_height="wrap_content" | |
296 | - android:text="本地售后电话" | |
297 | - android:textSize="22sp" /> | |
298 | - | |
299 | - <EditText | |
300 | - android:id="@+id/et_edit_telphone" | |
301 | - android:layout_width="wrap_content" | |
302 | - android:layout_height="wrap_content" | |
303 | - android:padding="20dp" | |
304 | - android:layout_marginLeft="20dp" | |
305 | - android:background="@null" | |
306 | - android:textColor="@color/login_text_black" | |
307 | - android:hint="请输入" | |
308 | - android:textSize="22sp" /> | |
309 | - </LinearLayout> | |
310 | - | |
311 | - </LinearLayout> | |
274 | + android:layout_width="match_parent" | |
275 | + android:layout_height="wrap_content" | |
276 | + android:layout_marginLeft="20dp" | |
277 | + android:gravity="center_vertical" | |
278 | + android:orientation="horizontal"> | |
279 | + | |
280 | + <LinearLayout | |
281 | + android:layout_width="0dp" | |
282 | + android:layout_height="80dp" | |
283 | + android:layout_weight="1" | |
284 | + android:gravity="center_vertical"> | |
285 | + | |
286 | + <TextView | |
287 | + android:layout_width="wrap_content" | |
288 | + android:layout_height="wrap_content" | |
289 | + android:text=" " | |
290 | + android:textColor="@color/white" | |
291 | + android:textSize="22sp" /> | |
292 | + | |
293 | + <EditText | |
294 | + android:id="@+id/et_edit_adress_detail" | |
295 | + android:layout_width="wrap_content" | |
296 | + android:layout_height="wrap_content" | |
297 | + android:layout_marginLeft="100dp" | |
298 | + android:background="@null" | |
299 | + android:hint="请输入详细地址" | |
300 | + android:padding="20dp" | |
301 | + android:textColor="@color/login_text_black" | |
302 | + android:textSize="22sp" /> | |
303 | + | |
304 | + </LinearLayout> | |
305 | + | |
306 | + <LinearLayout | |
307 | + android:layout_width="0dp" | |
308 | + android:layout_height="80dp" | |
309 | + android:layout_weight="1" | |
310 | + android:gravity="center_vertical"> | |
311 | + | |
312 | + <TextView | |
313 | + android:layout_width="150dp" | |
314 | + android:layout_height="wrap_content" | |
315 | + android:text="本地售后电话" | |
316 | + android:textSize="22sp" /> | |
317 | + | |
318 | + <EditText | |
319 | + android:id="@+id/et_edit_telphone" | |
320 | + android:layout_width="wrap_content" | |
321 | + android:layout_height="wrap_content" | |
322 | + android:layout_marginLeft="20dp" | |
323 | + android:background="@null" | |
324 | + android:hint="请输入" | |
325 | + android:padding="20dp" | |
326 | + android:textColor="@color/login_text_black" | |
327 | + android:textSize="22sp" /> | |
328 | + </LinearLayout> | |
312 | 329 | |
313 | - <LinearLayout | |
314 | - android:layout_width="wrap_content" | |
315 | - android:layout_height="wrap_content" | |
330 | + </LinearLayout> | |
316 | 331 | |
317 | - android:orientation="horizontal"> | |
318 | 332 | |
319 | - <View | |
320 | - android:layout_width="450dp" | |
321 | - android:layout_height="0.7dp" | |
322 | - android:layout_marginLeft="150dp" | |
323 | - android:background="@color/cutoff_line"> | |
333 | + <LinearLayout | |
334 | + android:layout_width="wrap_content" | |
335 | + android:layout_height="wrap_content" | |
336 | + android:orientation="horizontal"> | |
324 | 337 | |
325 | - </View> | |
338 | + <View | |
339 | + android:layout_width="450dp" | |
340 | + android:layout_height="0.7dp" | |
341 | + android:background="@color/cutoff_line"> | |
326 | 342 | |
327 | - <View | |
328 | - android:layout_width="450dp" | |
329 | - android:layout_height="0.7dp" | |
330 | - android:layout_marginLeft="80dp" | |
331 | - android:background="@color/cutoff_line"> | |
343 | + </View> | |
332 | 344 | |
333 | - </View> | |
345 | + <View | |
346 | + android:layout_width="500dp" | |
347 | + android:layout_height="0.7dp" | |
348 | + android:layout_marginLeft="80dp" | |
349 | + android:background="@color/cutoff_line"> | |
334 | 350 | |
351 | + </View> | |
335 | 352 | |
336 | - </LinearLayout> | |
337 | 353 | |
338 | - <LinearLayout | |
339 | - android:layout_width="match_parent" | |
340 | - android:layout_height="wrap_content" | |
341 | - android:layout_marginLeft="200dp" | |
342 | - android:gravity="center_vertical" | |
343 | - android:orientation="horizontal"> | |
354 | + </LinearLayout> | |
344 | 355 | |
345 | 356 | <LinearLayout |
346 | - android:id="@+id/lineL_buy_time" | |
347 | - android:layout_width="0dp" | |
348 | - android:layout_height="80dp" | |
349 | - android:layout_weight="1" | |
350 | - android:gravity="center_vertical"> | |
351 | - | |
352 | - <TextView | |
353 | - android:layout_width="wrap_content" | |
354 | - android:layout_height="wrap_content" | |
355 | - android:text="购买时间" | |
356 | - android:textSize="22sp" /> | |
357 | - | |
358 | - <TextView | |
359 | - android:id="@+id/tv_buy_time" | |
360 | - android:layout_width="wrap_content" | |
361 | - android:layout_height="wrap_content" | |
362 | - android:textColor="@color/login_text_black" | |
363 | - android:layout_marginLeft="50dp" | |
364 | - android:hint="请选择时间" | |
365 | - android:textSize="22sp" /> | |
366 | - | |
357 | + android:layout_width="match_parent" | |
358 | + android:layout_height="wrap_content" | |
359 | + android:gravity="center_vertical" | |
360 | + android:orientation="horizontal" | |
361 | + android:layout_marginLeft="20dp"> | |
362 | + | |
363 | + <View | |
364 | + android:layout_width="0dp" | |
365 | + android:layout_height="80dp" | |
366 | + android:layout_weight="1" /> | |
367 | + | |
368 | + <LinearLayout | |
369 | + android:layout_width="0dp" | |
370 | + android:layout_height="80dp" | |
371 | + android:layout_gravity="right" | |
372 | + android:layout_weight="1" | |
373 | + android:gravity="center_vertical"> | |
374 | + | |
375 | + <TextView | |
376 | + android:layout_width="150dp" | |
377 | + android:layout_height="wrap_content" | |
378 | + android:text="导购员手机号" | |
379 | + android:textSize="22sp" /> | |
380 | + | |
381 | + <EditText | |
382 | + android:id="@+id/et_salesperson_phone" | |
383 | + android:layout_width="wrap_content" | |
384 | + android:layout_height="wrap_content" | |
385 | + android:layout_marginLeft="20dp" | |
386 | + android:background="@null" | |
387 | + android:hint="请输入(选填)" | |
388 | + android:inputType="phone" | |
389 | + android:padding="20dp" | |
390 | + android:textColor="@color/login_text_black" | |
391 | + android:textSize="22sp" /> | |
392 | + </LinearLayout> | |
367 | 393 | </LinearLayout> |
394 | + <LinearLayout | |
395 | + android:layout_width="wrap_content" | |
396 | + android:layout_height="wrap_content" | |
397 | + android:orientation="horizontal"> | |
368 | 398 | |
369 | - </LinearLayout> | |
399 | + <View | |
400 | + android:layout_width="450dp" | |
401 | + android:layout_height="0dp" | |
402 | + android:background="@color/cutoff_line"> | |
370 | 403 | |
371 | - <LinearLayout | |
372 | - android:layout_width="wrap_content" | |
373 | - android:layout_height="wrap_content" | |
374 | - android:orientation="horizontal"> | |
404 | + </View> | |
375 | 405 | |
376 | - <View | |
377 | - android:layout_width="450dp" | |
378 | - android:layout_height="0.7dp" | |
379 | - android:layout_marginLeft="150dp" | |
380 | - android:background="@color/cutoff_line"> | |
406 | + <View | |
407 | + android:layout_width="500dp" | |
408 | + android:layout_height="0.7dp" | |
409 | + android:layout_marginLeft="80dp" | |
410 | + android:background="@color/cutoff_line"> | |
381 | 411 | |
382 | - </View> | |
412 | + </View> | |
383 | 413 | |
414 | + </LinearLayout> | |
415 | + <Button | |
416 | + android:id="@+id/btn_change_info" | |
417 | + style="@style/button_login_register_style" | |
418 | + android:layout_marginLeft="200dp" | |
419 | + android:layout_marginRight="200dp" | |
420 | + android:layout_marginTop="50dp" | |
421 | + android:text="@string/string_regist_next" /> | |
384 | 422 | |
385 | 423 | </LinearLayout> |
386 | - | |
387 | - <Button | |
388 | - android:id="@+id/btn_change_info" | |
389 | - style="@style/button_login_register_style" | |
390 | - android:layout_marginLeft="200dp" | |
391 | - android:layout_marginRight="200dp" | |
392 | - android:layout_marginTop="80dp" | |
393 | - android:text="@string/string_regist_next" /> | |
394 | - | |
395 | - | |
396 | -</LinearLayout> | |
397 | 424 | \ No newline at end of file |
425 | +</RelativeLayout> | |
398 | 426 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_electroniccard_validation.xml
... | ... | @@ -2,14 +2,15 @@ |
2 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="#ffffffff" | |
5 | + android:background="@mipmap/main_bg" | |
6 | 6 | android:orientation="vertical"> |
7 | + | |
7 | 8 | <RelativeLayout |
8 | 9 | android:id="@+id/title" |
9 | 10 | android:layout_width="match_parent" |
10 | 11 | android:layout_height="wrap_content" |
11 | 12 | android:background="@color/login_text_blue" |
12 | - android:minHeight="50dp" > | |
13 | + android:minHeight="50dp"> | |
13 | 14 | |
14 | 15 | <ImageView |
15 | 16 | android:id="@+id/cancel" |
... | ... | @@ -29,69 +30,136 @@ |
29 | 30 | android:textColor="@android:color/white" |
30 | 31 | android:textSize="22sp" /> |
31 | 32 | </RelativeLayout> |
32 | - <RelativeLayout | |
33 | - android:layout_width="match_parent" | |
34 | - android:layout_height="match_parent" | |
35 | - android:layout_below="@id/title" | |
36 | - android:background="#ffffffff" | |
33 | + | |
34 | + <LinearLayout | |
35 | + android:layout_width="550dp" | |
36 | + android:layout_height="wrap_content" | |
37 | + android:layout_centerInParent="true" | |
38 | + android:background="@drawable/white_cycle_bg" | |
37 | 39 | android:orientation="vertical" |
38 | - android:paddingLeft="250dp" | |
39 | - android:paddingRight="250dp" > | |
40 | + android:paddingLeft="30dp" | |
41 | + android:paddingRight="30dp"> | |
40 | 42 | |
41 | - <EditText | |
42 | - android:id="@+id/et_phonenumber" | |
43 | - style="@style/login_register_edit_style" | |
44 | - android:layout_marginTop="150dp" | |
45 | - android:hint="手机号" | |
46 | - android:inputType="phone" /> | |
43 | + <ImageView | |
44 | + android:id="@+id/iv_logo" | |
45 | + android:layout_width="wrap_content" | |
46 | + android:layout_height="wrap_content" | |
47 | + android:layout_gravity="center_horizontal" | |
48 | + android:layout_marginTop="15dp" | |
49 | + android:src="@mipmap/logo" /> | |
47 | 50 | |
48 | - <TextView | |
49 | - android:id="@+id/phonenumber_error_hint" | |
50 | - style="@style/registererrhint_style" | |
51 | - android:layout_below="@id/et_phonenumber" /> | |
52 | 51 | |
53 | - <LinearLayout | |
54 | - android:id="@+id/rl_authcode" | |
55 | - android:layout_width="match_parent" | |
56 | - android:layout_height="wrap_content" | |
57 | - android:layout_below="@id/et_phonenumber" | |
58 | - android:layout_marginTop="30dp" | |
59 | - android:orientation="horizontal"> | |
60 | - | |
61 | - <EditText | |
62 | - android:id="@+id/et_authcode" | |
63 | - style="@style/login_register_edit_rect_style" | |
64 | - android:layout_marginRight="-4px" | |
65 | - android:layout_weight="1" | |
66 | - android:hint="验证码" | |
67 | - android:numeric="integer" /> | |
52 | + | |
53 | + <LinearLayout | |
54 | + android:id="@+id/activation_code_layout" | |
55 | + android:layout_width="match_parent" | |
56 | + android:layout_height="wrap_content" | |
57 | + android:gravity="center_horizontal" | |
58 | + android:background="@drawable/input_bg" | |
59 | + android:layout_marginTop="20dp" | |
60 | + android:paddingRight="10dp" | |
61 | + android:visibility="gone" | |
62 | + android:orientation="horizontal"> | |
63 | + | |
64 | + <EditText | |
65 | + android:id="@+id/activation_code" | |
66 | + style="@style/login_register_edit_style" | |
67 | + android:hint="请输入注册激活码" | |
68 | + android:maxLength="11" | |
69 | + android:inputType="phone" /> | |
70 | + <ImageButton | |
71 | + android:id="@+id/activation_code_delete_btn" | |
72 | + android:layout_width="50dp" | |
73 | + android:layout_height="match_parent" | |
74 | + android:src="@mipmap/delete_btn" | |
75 | + android:visibility="invisible" | |
76 | + android:background="@null"/> | |
77 | + </LinearLayout> | |
78 | + | |
79 | + <LinearLayout | |
80 | + android:id="@+id/et_phonenumber_layout" | |
81 | + android:layout_width="match_parent" | |
82 | + android:layout_height="wrap_content" | |
83 | + android:gravity="center_horizontal" | |
84 | + android:background="@drawable/input_bg" | |
85 | + android:layout_marginTop="30dp" | |
86 | + android:paddingRight="10dp" | |
87 | + android:orientation="horizontal"> | |
88 | + | |
89 | + <EditText | |
90 | + android:id="@+id/et_phonenumber" | |
91 | + style="@style/login_register_edit_style" | |
92 | + android:hint="手机号" | |
93 | + android:maxLength="11" | |
94 | + android:inputType="phone" /> | |
95 | + <ImageButton | |
96 | + android:id="@+id/phone_delete_btn" | |
97 | + android:layout_width="50dp" | |
98 | + android:layout_height="match_parent" | |
99 | + android:src="@mipmap/delete_btn" | |
100 | + android:visibility="invisible" | |
101 | + android:background="@null"/> | |
102 | + </LinearLayout> | |
103 | + | |
104 | + | |
105 | + <LinearLayout | |
106 | + android:id="@+id/rl_authcode" | |
107 | + android:layout_width="match_parent" | |
108 | + android:layout_height="wrap_content" | |
109 | + android:layout_below="@id/et_phonenumber_layout" | |
110 | + android:layout_marginTop="30dp" | |
111 | + android:paddingRight="7dp" | |
112 | + android:visibility="gone" | |
113 | + android:background="@drawable/input_bg" | |
114 | + android:orientation="horizontal"> | |
115 | + | |
116 | + <EditText | |
117 | + android:id="@+id/et_authcode" | |
118 | + style="@style/login_register_edit_rect_style" | |
119 | + android:layout_marginRight="-4px" | |
120 | + android:layout_weight="1" | |
121 | + android:hint="验证码" | |
122 | + android:maxLength="6" | |
123 | + android:numeric="integer" /> | |
124 | + | |
125 | + <ImageButton | |
126 | + android:id="@+id/code_delete_btn" | |
127 | + android:layout_width="50dp" | |
128 | + android:layout_height="match_parent" | |
129 | + android:src="@mipmap/delete_btn" | |
130 | + android:visibility="invisible" | |
131 | + android:background="@null"/> | |
132 | + <Button | |
133 | + android:id="@+id/btn_authcode" | |
134 | + android:layout_width="match_parent" | |
135 | + android:layout_height="wrap_content" | |
136 | + style="?android:attr/borderlessButtonStyle" | |
137 | + android:layout_weight="2" | |
138 | + android:text="获取验证码" | |
139 | + android:maxLines="1" | |
140 | + android:background="@drawable/code_bg" | |
141 | + android:textSize="18sp" | |
142 | + android:padding="8dp" | |
143 | + android:textColor="@color/login_text_blue" /> | |
144 | + </LinearLayout> | |
145 | + | |
146 | + <TextView | |
147 | + android:id="@+id/authcode_error_hint" | |
148 | + style="@style/registererrhint_style" | |
149 | + android:layout_below="@id/rl_authcode" /> | |
150 | + | |
151 | + <TextView | |
152 | + android:id="@+id/password_error_hint" | |
153 | + style="@style/registererrhint_style" | |
154 | + android:layout_below="@id/pwd_rl" /> | |
68 | 155 | |
69 | 156 | <Button |
70 | - android:id="@+id/btn_authcode" | |
71 | - style="@style/login_register_btn_authcode_rect_style" | |
72 | - android:layout_marginLeft="0px" | |
73 | - android:layout_marginTop="0px" | |
74 | - android:layout_weight="2" | |
75 | - android:text="获取验证码" | |
76 | - android:textColor="@color/btn_text_color" /> | |
157 | + android:id="@+id/btn_card_valiyanzhen" | |
158 | + style="@style/button_login_register_style" | |
159 | + android:layout_below="@id/rl_authcode" | |
160 | + android:layout_marginTop="30dp" | |
161 | + android:layout_marginBottom="40dp" | |
162 | + android:text="@string/string_regist_next" /> | |
77 | 163 | </LinearLayout> |
78 | 164 | |
79 | - <TextView | |
80 | - android:id="@+id/authcode_error_hint" | |
81 | - style="@style/registererrhint_style" | |
82 | - android:layout_below="@id/rl_authcode" /> | |
83 | - | |
84 | - <TextView | |
85 | - android:id="@+id/password_error_hint" | |
86 | - style="@style/registererrhint_style" | |
87 | - android:layout_below="@id/pwd_rl" /> | |
88 | - | |
89 | - <Button | |
90 | - android:id="@+id/btn_card_valiyanzhen" | |
91 | - style="@style/button_login_register_style" | |
92 | - android:layout_below="@id/rl_authcode" | |
93 | - android:layout_marginTop="30dp" | |
94 | - android:text="@string/string_regist_next" /> | |
95 | - </RelativeLayout> | |
96 | - | |
97 | 165 | </RelativeLayout> |
98 | 166 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_forgetpsword.xml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="#ffffffff" | |
5 | + android:background="@mipmap/main_bg" | |
6 | 6 | android:orientation="vertical"> |
7 | 7 | |
8 | 8 | <RelativeLayout |
... | ... | @@ -31,34 +31,71 @@ |
31 | 31 | android:textSize="22sp" /> |
32 | 32 | </RelativeLayout> |
33 | 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" /> | |
34 | + <!--<RelativeLayout--> | |
35 | + <!--android:layout_width="match_parent"--> | |
36 | + <!--android:layout_height="match_parent"--> | |
37 | + <!--android:layout_below="@id/title">--> | |
38 | + | |
39 | + | |
40 | + <LinearLayout | |
41 | + android:layout_width="550dp" | |
42 | + android:layout_height="600dp" | |
43 | + android:layout_centerInParent="true" | |
44 | + android:layout_marginTop="20dp" | |
45 | + android:background="@drawable/white_cycle_bg" | |
46 | + android:paddingLeft="30dp" | |
47 | + android:paddingRight="30dp" | |
48 | + android:orientation="vertical"> | |
49 | + | |
50 | + <ImageView | |
51 | + android:id="@+id/iv_logo" | |
52 | + android:layout_width="wrap_content" | |
53 | + android:layout_height="wrap_content" | |
54 | + android:layout_gravity="center_horizontal" | |
55 | + android:layout_marginTop="15dp" | |
56 | + android:src="@mipmap/logo" /> | |
57 | + | |
58 | + <LinearLayout | |
59 | + android:id="@+id/et_phonenumber_layout" | |
60 | + android:layout_width="match_parent" | |
61 | + android:layout_height="wrap_content" | |
62 | + android:layout_marginTop="10dp" | |
63 | + android:background="@drawable/input_bg" | |
64 | + android:gravity="center_horizontal" | |
65 | + android:orientation="horizontal" | |
66 | + android:paddingRight="10dp"> | |
67 | + | |
68 | + <EditText | |
69 | + android:id="@+id/et_phonenumber" | |
70 | + style="@style/login_register_edit_style" | |
71 | + android:hint="手机号" | |
72 | + android:imeOptions="actionNext" | |
73 | + android:inputType="phone" | |
74 | + android:maxLength="11" /> | |
75 | + | |
76 | + <ImageButton | |
77 | + android:id="@+id/phone_delete_btn" | |
78 | + android:layout_width="50dp" | |
79 | + android:layout_height="match_parent" | |
80 | + android:background="@null" | |
81 | + android:src="@mipmap/delete_btn" | |
82 | + android:visibility="invisible" /> | |
83 | + </LinearLayout> | |
49 | 84 | |
50 | 85 | <TextView |
51 | 86 | android:id="@+id/phonenumber_error_hint" |
52 | 87 | style="@style/registererrhint_style" |
53 | - android:layout_below="@id/et_phonenumber" /> | |
88 | + android:layout_below="@id/et_phonenumber_layout" /> | |
54 | 89 | |
55 | 90 | <LinearLayout |
56 | 91 | android:id="@+id/rl_authcode" |
57 | 92 | android:layout_width="match_parent" |
58 | 93 | android:layout_height="wrap_content" |
59 | - android:layout_below="@id/et_phonenumber" | |
60 | - android:layout_marginTop="30dp" | |
61 | - android:orientation="horizontal"> | |
94 | + android:layout_below="@id/et_phonenumber_layout" | |
95 | + android:layout_marginTop="10dp" | |
96 | + android:background="@drawable/input_bg" | |
97 | + android:orientation="horizontal" | |
98 | + android:paddingRight="7dp"> | |
62 | 99 | |
63 | 100 | <EditText |
64 | 101 | android:id="@+id/et_authcode" |
... | ... | @@ -66,16 +103,29 @@ |
66 | 103 | android:layout_marginRight="-4px" |
67 | 104 | android:layout_weight="1" |
68 | 105 | android:hint="验证码" |
106 | + android:maxLength="6" | |
69 | 107 | android:numeric="integer" /> |
70 | 108 | |
109 | + <ImageButton | |
110 | + android:id="@+id/code_delete_btn" | |
111 | + android:layout_width="50dp" | |
112 | + android:layout_height="match_parent" | |
113 | + android:background="@null" | |
114 | + android:src="@mipmap/delete_btn" | |
115 | + android:visibility="invisible" /> | |
116 | + | |
71 | 117 | <Button |
72 | 118 | android:id="@+id/btn_authcode" |
73 | - style="@style/login_register_btn_authcode_rect_style" | |
74 | - android:layout_marginLeft="0px" | |
75 | - android:layout_marginTop="0px" | |
119 | + style="?android:attr/borderlessButtonStyle" | |
120 | + android:layout_width="match_parent" | |
121 | + android:layout_height="wrap_content" | |
76 | 122 | android:layout_weight="2" |
123 | + android:background="@drawable/code_bg" | |
124 | + android:maxLines="1" | |
125 | + android:padding="8dp" | |
77 | 126 | android:text="获取验证码" |
78 | - android:textColor="@color/btn_text_color" /> | |
127 | + android:textColor="@color/login_text_blue" | |
128 | + android:textSize="18sp" /> | |
79 | 129 | </LinearLayout> |
80 | 130 | |
81 | 131 | <TextView |
... | ... | @@ -83,12 +133,15 @@ |
83 | 133 | style="@style/registererrhint_style" |
84 | 134 | android:layout_below="@id/rl_authcode" /> |
85 | 135 | |
86 | - <RelativeLayout | |
136 | + | |
137 | + <LinearLayout | |
87 | 138 | android:id="@+id/pwd_rl" |
88 | 139 | android:layout_width="match_parent" |
89 | 140 | android:layout_height="wrap_content" |
90 | 141 | android:layout_below="@id/rl_authcode" |
91 | - android:layout_marginTop="30dp"> | |
142 | + android:background="@drawable/input_bg" | |
143 | + android:gravity="center_vertical" | |
144 | + android:layout_marginTop="10dp"> | |
92 | 145 | |
93 | 146 | <EditText |
94 | 147 | android:id="@+id/et_newpassword" |
... | ... | @@ -98,28 +151,52 @@ |
98 | 151 | |
99 | 152 | <ImageView |
100 | 153 | android:id="@+id/iv_pwd_change" |
101 | - android:padding="10dp" | |
102 | - android:layout_marginRight="10dp" | |
103 | - android:layout_marginLeft="10dp" | |
104 | 154 | android:layout_width="40dp" |
105 | 155 | android:layout_height="wrap_content" |
106 | 156 | android:layout_alignParentRight="true" |
107 | 157 | android:layout_centerVertical="true" |
108 | - android:src="@mipmap/pwd_hide"/> | |
109 | - </RelativeLayout> | |
158 | + android:layout_marginLeft="10dp" | |
159 | + android:layout_marginRight="15dp" | |
160 | + android:padding="10dp" | |
161 | + android:src="@mipmap/pwd_hide" /> | |
162 | + </LinearLayout> | |
110 | 163 | |
111 | 164 | <TextView |
112 | 165 | android:id="@+id/newpassword_error_hint" |
113 | 166 | style="@style/registererrhint_style" |
114 | 167 | android:layout_below="@id/pwd_rl" /> |
115 | 168 | |
116 | - <EditText | |
117 | - android:id="@+id/et_again_newpassword" | |
118 | - style="@style/login_register_edit_style" | |
119 | - android:layout_below="@id/pwd_rl" | |
120 | - android:layout_marginTop="30dp" | |
121 | - android:hint="再次输入新密码" | |
122 | - android:inputType="textPassword" /> | |
169 | + | |
170 | + | |
171 | + <LinearLayout | |
172 | + android:id="@+id/et_again_newpassword_layout" | |
173 | + android:layout_width="match_parent" | |
174 | + android:layout_height="wrap_content" | |
175 | + android:layout_marginTop="10dp" | |
176 | + android:background="@drawable/input_bg" | |
177 | + android:gravity="center_vertical" | |
178 | + android:orientation="horizontal"> | |
179 | + | |
180 | + <EditText | |
181 | + android:id="@+id/et_again_newpassword" | |
182 | + style="@style/login_register_edit_style" | |
183 | + android:layout_below="@id/pwd_rl" | |
184 | + android:hint="再次输入新密码" | |
185 | + android:inputType="textPassword" /> | |
186 | + | |
187 | + <ImageView | |
188 | + android:id="@+id/iv_newpwd_change" | |
189 | + android:layout_width="40dp" | |
190 | + android:layout_height="wrap_content" | |
191 | + android:layout_alignParentRight="true" | |
192 | + android:layout_centerVertical="true" | |
193 | + android:layout_marginLeft="10dp" | |
194 | + android:layout_marginRight="15dp" | |
195 | + android:padding="10dp" | |
196 | + android:src="@mipmap/pwd_hide" /> | |
197 | + </LinearLayout> | |
198 | + | |
199 | + | |
123 | 200 | |
124 | 201 | <TextView |
125 | 202 | android:id="@+id/again_newpassword_error_hint" |
... | ... | @@ -130,8 +207,8 @@ |
130 | 207 | android:id="@+id/btn_ok" |
131 | 208 | style="@style/button_login_register_style" |
132 | 209 | android:layout_below="@id/et_again_newpassword" |
133 | - android:layout_marginTop="30dp" | |
210 | + android:layout_marginTop="20dp" | |
134 | 211 | android:text="确 定" /> |
135 | - </RelativeLayout> | |
212 | + </LinearLayout> | |
136 | 213 | |
137 | 214 | </RelativeLayout> |
138 | 215 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_loginandregister.xml
... | ... | @@ -4,24 +4,21 @@ |
4 | 4 | android:id="@android:id/tabhost" |
5 | 5 | android:layout_width="fill_parent" |
6 | 6 | android:layout_height="fill_parent" |
7 | - android:background="@color/white"> | |
8 | - | |
9 | - | |
10 | - <ImageView | |
11 | - android:id="@+id/iv_logo" | |
12 | - android:layout_width="wrap_content" | |
13 | - android:layout_height="wrap_content" | |
14 | - android:layout_centerHorizontal="true" | |
15 | - android:layout_marginTop="55dp" | |
16 | - android:layout_marginBottom="0dp" | |
17 | - android:src="@mipmap/logo" /> | |
7 | + android:background="@mipmap/main_bg"> | |
18 | 8 | |
19 | 9 | <LinearLayout |
20 | - android:layout_width="wrap_content" | |
21 | - android:layout_height="wrap_content" | |
22 | - android:layout_below="@+id/iv_logo" | |
23 | - android:orientation="vertical"> | |
24 | - | |
10 | + android:layout_width="550dp" | |
11 | + android:layout_height="600dp" | |
12 | + android:orientation="vertical" | |
13 | + android:layout_centerInParent="true" | |
14 | + android:background="@drawable/white_cycle_bg"> | |
15 | + <ImageView | |
16 | + android:id="@+id/iv_logo" | |
17 | + android:layout_width="wrap_content" | |
18 | + android:layout_height="wrap_content" | |
19 | + android:layout_marginTop="25dp" | |
20 | + android:layout_gravity="center_horizontal" | |
21 | + android:src="@mipmap/logo" /> | |
25 | 22 | <com.hjx.personalcenter.thirdparty.SlidingTabLayout |
26 | 23 | android:id="@+id/TabLayout_id" |
27 | 24 | android:layout_width="match_parent" |
... | ... | @@ -33,7 +30,7 @@ |
33 | 30 | android:layout_width="match_parent" |
34 | 31 | android:layout_height="match_parent" |
35 | 32 | android:overScrollMode="never" |
36 | - android:background="@color/white" /> | |
33 | + android:background="#00ffffff" /> | |
37 | 34 | </LinearLayout> |
38 | 35 | |
39 | 36 | </RelativeLayout> |
40 | 37 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_main.xml
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - xmlns:fresco="http://schemas.android.com/apk/res-auto" | |
6 | 5 | android:background="@color/white" |
7 | 6 | android:orientation="vertical"> |
8 | 7 | |
... | ... | @@ -36,7 +35,7 @@ |
36 | 35 | android:layout_width="wrap_content" |
37 | 36 | android:layout_height="match_parent" |
38 | 37 | android:layout_marginRight="10dp" |
39 | - android:layout_toLeftOf="@+id/iv_skin" | |
38 | + android:layout_toLeftOf="@+id/iv_switch" | |
40 | 39 | android:gravity="center_vertical" |
41 | 40 | android:padding="10dp" |
42 | 41 | android:src="@mipmap/shezhi1" |
... | ... | @@ -44,16 +43,15 @@ |
44 | 43 | android:textSize="22sp" /> |
45 | 44 | |
46 | 45 | <ImageView |
47 | - android:id="@+id/iv_skin" | |
46 | + android:id="@+id/iv_switch" | |
48 | 47 | android:layout_width="wrap_content" |
49 | 48 | android:layout_height="match_parent" |
50 | 49 | android:layout_marginRight="10dp" |
51 | 50 | android:layout_toLeftOf="@+id/iv_imformatioan" |
52 | 51 | android:gravity="center_vertical" |
53 | 52 | android:padding="10dp" |
54 | - android:src="@mipmap/pifu" | |
53 | + android:src="@mipmap/switch_btn" | |
55 | 54 | android:textColor="@android:color/white" |
56 | - android:visibility="gone" | |
57 | 55 | android:textSize="22sp" /> |
58 | 56 | |
59 | 57 | <ImageView |
... | ... | @@ -95,11 +93,10 @@ |
95 | 93 | android:orientation="horizontal"> |
96 | 94 | <com.hjx.personalcenter.View.RoundImageView60dip |
97 | 95 | android:id="@+id/iv_head" |
98 | - android:layout_width="70dp" | |
99 | - android:layout_height="70dp" | |
96 | + android:layout_width="90dp" | |
97 | + android:layout_height="90dp" | |
100 | 98 | android:scaleType="centerCrop" |
101 | - android:background="@mipmap/header_default" | |
102 | - /> | |
99 | + android:background="@mipmap/header_default" /> | |
103 | 100 | |
104 | 101 | <TextView |
105 | 102 | android:layout_width="wrap_content" |
... | ... | @@ -323,7 +320,8 @@ |
323 | 320 | <TextView |
324 | 321 | android:id="@+id/iv_look_card" |
325 | 322 | android:layout_width="wrap_content" |
326 | - android:layout_height="wrap_content" | |
323 | + android:layout_height="40dp" | |
324 | + android:gravity="center" | |
327 | 325 | android:textColor="@color/bgstudy_baoka" |
328 | 326 | android:text="好记星电子产品保修卡" /> |
329 | 327 | <ImageView |
... | ... | @@ -526,6 +524,8 @@ |
526 | 524 | android:layout_width="0dp" |
527 | 525 | android:layout_height="wrap_content" |
528 | 526 | android:layout_weight="2" |
527 | + android:maxLines="1" | |
528 | + android:ellipsize="end" | |
529 | 529 | android:hint="未填写" |
530 | 530 | android:textSize="20sp" /> |
531 | 531 | </LinearLayout> |
... | ... | @@ -659,8 +659,7 @@ |
659 | 659 | android:layout_width="match_parent" |
660 | 660 | android:layout_height="match_parent" |
661 | 661 | android:gravity="center" |
662 | - android:orientation="vertical" | |
663 | - > | |
662 | + android:orientation="vertical"> | |
664 | 663 | <LinearLayout |
665 | 664 | android:id="@+id/view_novedeo" |
666 | 665 | android:layout_width="match_parent" | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_ok_cardinfo.xml
... | ... | @@ -72,23 +72,25 @@ |
72 | 72 | </LinearLayout> |
73 | 73 | |
74 | 74 | <LinearLayout |
75 | + android:id="@+id/salesperson_phone_layout" | |
75 | 76 | android:layout_width="0dp" |
76 | 77 | android:layout_weight="1" |
77 | - android:layout_height="80dp" | |
78 | + android:layout_height="60dp" | |
78 | 79 | android:layout_marginLeft="80dp" |
79 | 80 | android:gravity="center_vertical"> |
80 | 81 | |
81 | 82 | <TextView |
82 | 83 | android:layout_width="wrap_content" |
83 | 84 | android:layout_height="wrap_content" |
84 | - android:text="客户姓名" | |
85 | + android:text="导购员手机号" | |
85 | 86 | android:textSize="22sp" /> |
86 | 87 | |
87 | 88 | <TextView |
88 | - android:id="@+id/iv_card_username" | |
89 | + android:id="@+id/tv_salesperson_phone" | |
89 | 90 | android:layout_width="wrap_content" |
90 | 91 | android:layout_height="wrap_content" |
91 | - android:layout_marginLeft="80dp" | |
92 | + android:layout_marginLeft="40dp" | |
93 | + android:background="@null" | |
92 | 94 | android:text="" |
93 | 95 | android:textSize="22sp" /> |
94 | 96 | |
... | ... | @@ -126,6 +128,7 @@ |
126 | 128 | |
127 | 129 | </LinearLayout> |
128 | 130 | |
131 | + | |
129 | 132 | <LinearLayout |
130 | 133 | android:layout_width="0dp" |
131 | 134 | android:layout_weight="1" |
... | ... | @@ -136,20 +139,20 @@ |
136 | 139 | <TextView |
137 | 140 | android:layout_width="wrap_content" |
138 | 141 | android:layout_height="wrap_content" |
139 | - android:text="客户地址" | |
142 | + android:text="客户姓名" | |
140 | 143 | android:textSize="22sp" /> |
141 | 144 | |
142 | 145 | <TextView |
143 | - android:id="@+id/tv_card_adress" | |
146 | + android:id="@+id/iv_card_username" | |
144 | 147 | android:layout_width="wrap_content" |
145 | 148 | android:layout_height="wrap_content" |
146 | - android:layout_marginLeft="80dp" | |
147 | - android:background="@null" | |
149 | + android:layout_marginLeft="83dp" | |
148 | 150 | android:text="" |
149 | 151 | android:textSize="22sp" /> |
150 | 152 | |
151 | 153 | </LinearLayout> |
152 | 154 | |
155 | + | |
153 | 156 | </LinearLayout> |
154 | 157 | |
155 | 158 | <LinearLayout |
... | ... | @@ -192,19 +195,22 @@ |
192 | 195 | <TextView |
193 | 196 | android:layout_width="wrap_content" |
194 | 197 | android:layout_height="wrap_content" |
195 | - android:text="购买时间" | |
198 | + android:text="客户地址" | |
196 | 199 | android:textSize="22sp" /> |
197 | 200 | |
198 | 201 | <TextView |
199 | - android:id="@+id/tv_card_time" | |
202 | + android:id="@+id/tv_card_adress" | |
200 | 203 | android:layout_width="wrap_content" |
201 | 204 | android:layout_height="wrap_content" |
202 | - android:layout_marginLeft="80dp" | |
205 | + android:layout_marginLeft="83dp" | |
203 | 206 | android:background="@null" |
204 | 207 | android:text="" |
205 | 208 | android:textSize="22sp" /> |
209 | + | |
206 | 210 | </LinearLayout> |
207 | 211 | |
212 | + | |
213 | + | |
208 | 214 | </LinearLayout> |
209 | 215 | |
210 | 216 | <LinearLayout |
... | ... | @@ -253,7 +259,7 @@ |
253 | 259 | android:id="@+id/tv_card_shopAdress" |
254 | 260 | android:layout_width="wrap_content" |
255 | 261 | android:layout_height="wrap_content" |
256 | - android:layout_marginLeft="80dp" | |
262 | + android:layout_marginLeft="83dp" | |
257 | 263 | android:text="" |
258 | 264 | android:textSize="22sp" /> |
259 | 265 | </LinearLayout> | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_registerinfo.xml
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="match_parent"> | |
4 | + android:layout_height="match_parent" | |
5 | + android:background="@mipmap/main_bg"> | |
6 | + | |
5 | 7 | <RelativeLayout |
6 | 8 | android:id="@+id/title" |
7 | 9 | android:layout_width="match_parent" |
8 | 10 | android:layout_height="wrap_content" |
9 | 11 | android:background="@color/login_text_blue" |
10 | - android:minHeight="50dp" > | |
12 | + android:minHeight="50dp"> | |
11 | 13 | |
12 | 14 | <ImageView |
13 | 15 | android:id="@+id/cancel" |
... | ... | @@ -16,8 +18,8 @@ |
16 | 18 | android:layout_centerVertical="true" |
17 | 19 | android:paddingLeft="20dp" |
18 | 20 | android:paddingRight="20dp" |
19 | - android:visibility="gone" | |
20 | - android:src="@mipmap/title_back" /> | |
21 | + android:src="@mipmap/title_back" | |
22 | + android:visibility="gone" /> | |
21 | 23 | |
22 | 24 | <TextView |
23 | 25 | android:id="@+id/menu_title" |
... | ... | @@ -28,51 +30,152 @@ |
28 | 30 | android:textColor="@android:color/white" |
29 | 31 | android:textSize="22sp" /> |
30 | 32 | </RelativeLayout> |
33 | + | |
31 | 34 | <LinearLayout |
32 | - android:layout_width="match_parent" | |
33 | - android:layout_height="match_parent" | |
34 | - android:layout_below="@id/title" | |
35 | - android:background="#ffffffff" | |
35 | + android:layout_width="550dp" | |
36 | + android:layout_height="wrap_content" | |
37 | + android:layout_centerInParent="true" | |
38 | + android:background="@drawable/white_cycle_bg" | |
36 | 39 | android:orientation="vertical" |
37 | - android:paddingLeft="250dp" | |
38 | - android:paddingRight="250dp"> | |
39 | - <EditText | |
40 | - android:id="@+id/et_username" | |
41 | - style="@style/login_register_edit_style" | |
42 | - android:layout_marginTop="100dp" | |
43 | - android:textColor="@color/login_text_black" | |
44 | - android:hint="@string/string_regist_username" /> | |
45 | - <TextView | |
46 | - android:id="@+id/et_region" | |
47 | - style="@style/login_register_edit_style" | |
48 | - android:layout_marginTop="30dp" | |
49 | - android:textColor="@color/login_text_black" | |
50 | - android:hint="@string/string_regist_region" /> | |
40 | + android:paddingLeft="30dp" | |
41 | + android:paddingRight="30dp" | |
42 | + android:paddingTop="30dp"> | |
43 | + | |
44 | + <LinearLayout | |
45 | + android:id="@+id/et_username_layout" | |
46 | + android:layout_width="match_parent" | |
47 | + android:layout_height="wrap_content" | |
48 | + android:background="@drawable/input_bg" | |
49 | + android:gravity="center_horizontal" | |
50 | + android:orientation="horizontal" | |
51 | + android:layout_marginBottom="20dp" | |
52 | + android:paddingRight="10dp"> | |
53 | + | |
54 | + <EditText | |
55 | + android:id="@+id/et_username" | |
56 | + style="@style/login_register_edit_style" | |
57 | + android:hint="@string/string_regist_username" | |
58 | + android:textColor="@color/login_text_black" /> | |
59 | + <ImageButton | |
60 | + android:id="@+id/username_delete_btn" | |
61 | + android:layout_width="50dp" | |
62 | + android:layout_height="match_parent" | |
63 | + android:src="@mipmap/delete_btn" | |
64 | + android:visibility="invisible" | |
65 | + android:background="@null"/> | |
66 | + </LinearLayout> | |
67 | + <LinearLayout | |
68 | + android:id="@+id/et_nickname_layout" | |
69 | + android:layout_width="match_parent" | |
70 | + android:layout_height="wrap_content" | |
71 | + android:background="@drawable/input_bg" | |
72 | + android:gravity="center_horizontal" | |
73 | + android:orientation="horizontal" | |
74 | + android:paddingRight="10dp"> | |
75 | + | |
76 | + <EditText | |
77 | + android:id="@+id/et_nickname" | |
78 | + style="@style/login_register_edit_style" | |
79 | + android:hint="@string/string_regist_nickname" | |
80 | + android:textColor="@color/login_text_black" /> | |
81 | + <ImageButton | |
82 | + android:id="@+id/nickname_delete_btn" | |
83 | + android:layout_width="50dp" | |
84 | + android:layout_height="match_parent" | |
85 | + android:src="@mipmap/delete_btn" | |
86 | + android:visibility="invisible" | |
87 | + android:background="@null"/> | |
88 | + </LinearLayout> | |
89 | + | |
90 | + | |
91 | + <LinearLayout | |
92 | + android:id="@+id/et_grade_layout" | |
93 | + android:layout_width="match_parent" | |
94 | + android:layout_height="wrap_content" | |
95 | + android:layout_marginTop="20dp" | |
96 | + android:background="@drawable/input_bg" | |
97 | + android:gravity="center_horizontal" | |
98 | + android:orientation="horizontal" | |
99 | + android:paddingRight="10dp"> | |
100 | + | |
101 | + <TextView | |
102 | + android:id="@+id/et_grade" | |
103 | + style="@style/login_register_edit_style" | |
104 | + android:hint="@string/string_regist_grade" | |
105 | + android:textColor="@color/login_text_black" /> | |
106 | + | |
107 | + </LinearLayout> | |
108 | + | |
109 | + <LinearLayout | |
110 | + android:id="@+id/et_region_layout" | |
111 | + android:layout_width="match_parent" | |
112 | + android:layout_height="wrap_content" | |
113 | + android:layout_marginTop="20dp" | |
114 | + android:background="@drawable/input_bg" | |
115 | + android:gravity="center_horizontal" | |
116 | + android:orientation="horizontal" | |
117 | + android:paddingRight="10dp"> | |
118 | + | |
119 | + <TextView | |
120 | + android:id="@+id/et_region" | |
121 | + style="@style/login_register_edit_style" | |
122 | + android:hint="@string/string_regist_region" | |
123 | + android:textColor="@color/login_text_black" /> | |
124 | + | |
125 | + </LinearLayout> | |
126 | + | |
127 | + <LinearLayout | |
128 | + android:id="@+id/et_address_layout" | |
129 | + android:layout_width="match_parent" | |
130 | + android:layout_height="wrap_content" | |
131 | + android:layout_marginTop="20dp" | |
132 | + android:background="@drawable/input_bg" | |
133 | + android:gravity="center_horizontal" | |
134 | + android:orientation="horizontal" | |
135 | + android:paddingRight="10dp"> | |
136 | + | |
137 | + <EditText | |
138 | + android:id="@+id/et_address" | |
139 | + style="@style/login_register_edit_style" | |
140 | + android:hint="@string/string_regist_address" | |
141 | + android:textColor="@color/login_text_black" /> | |
142 | + <ImageButton | |
143 | + android:id="@+id/address_delete_btn" | |
144 | + android:layout_width="50dp" | |
145 | + android:layout_height="match_parent" | |
146 | + android:src="@mipmap/delete_btn" | |
147 | + android:visibility="invisible" | |
148 | + android:background="@null"/> | |
149 | + </LinearLayout> | |
150 | + | |
151 | + <LinearLayout | |
152 | + android:id="@+id/et_school_layout" | |
153 | + android:layout_width="match_parent" | |
154 | + android:layout_height="wrap_content" | |
155 | + android:layout_marginTop="20dp" | |
156 | + android:background="@drawable/input_bg" | |
157 | + android:gravity="center_horizontal" | |
158 | + android:orientation="horizontal" | |
159 | + android:paddingRight="10dp"> | |
160 | + | |
161 | + <TextView | |
162 | + android:id="@+id/et_school" | |
163 | + style="@style/login_register_edit_style" | |
164 | + android:hint="@string/string_regist_school" | |
165 | + android:textColor="@color/login_text_black" /> | |
166 | + | |
167 | + </LinearLayout> | |
51 | 168 | |
52 | - <TextView | |
53 | - android:id="@+id/et_grade" | |
54 | - style="@style/login_register_edit_style" | |
55 | - android:layout_marginTop="30dp" | |
56 | - android:textColor="@color/login_text_black" | |
57 | - android:hint="@string/string_regist_grade" /> | |
58 | 169 | |
59 | - <TextView | |
60 | - android:id="@+id/et_school" | |
61 | - style="@style/login_register_edit_style" | |
62 | - android:layout_marginTop="30dp" | |
63 | - android:textColor="@color/login_text_black" | |
64 | - android:hint="@string/string_regist_school" /> | |
65 | 170 | <Button |
66 | 171 | android:id="@+id/btn_ok" |
67 | 172 | style="@style/button_login_register_style" |
68 | 173 | android:layout_marginTop="30dp" |
174 | + android:layout_marginBottom="30dp" | |
69 | 175 | android:text="@string/string_regist_next" /> |
70 | 176 | |
71 | 177 | |
72 | - | |
73 | 178 | </LinearLayout> |
74 | 179 | |
75 | 180 | |
76 | - | |
77 | - | |
78 | 181 | </RelativeLayout> |
79 | 182 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_start_page.xml
... | ... | @@ -4,18 +4,13 @@ |
4 | 4 | android:layout_width="match_parent" |
5 | 5 | android:layout_height="match_parent" |
6 | 6 | android:background="@mipmap/startpage"> |
7 | - <RelativeLayout | |
8 | - android:layout_width="wrap_content" | |
9 | - android:layout_height="wrap_content" | |
10 | - android:layout_alignParentBottom="true" | |
11 | - android:paddingLeft="250dp" | |
12 | - android:paddingRight="250dp"> | |
13 | - <Button | |
7 | + <ImageButton | |
14 | 8 | android:id="@+id/btn_start" |
15 | - style="@style/button_login_register_style" | |
16 | - android:layout_marginBottom="50dp" | |
17 | - android:text="@string/string_start_page" /> | |
18 | - </RelativeLayout> | |
19 | - | |
9 | + android:layout_width="wrap_content" | |
10 | + android:layout_height="wrap_content" | |
11 | + android:layout_centerHorizontal="true" | |
12 | + android:layout_alignParentBottom="true" | |
13 | + android:background="@mipmap/start_btn_bg" | |
14 | + android:layout_marginBottom="50dp" /> | |
20 | 15 | |
21 | 16 | </RelativeLayout> |
22 | 17 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/dialog_layout.xml
... | ... | @@ -0,0 +1,75 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:layout_width="match_parent" | |
4 | + android:layout_height="match_parent" | |
5 | + android:background="@null" | |
6 | + android:gravity="center" | |
7 | + android:orientation="vertical" > | |
8 | + | |
9 | + <LinearLayout | |
10 | + android:layout_width="300dp" | |
11 | + android:layout_height="wrap_content" | |
12 | + android:background="@drawable/white_cycle_bg" | |
13 | + android:orientation="vertical" > | |
14 | + <TextView | |
15 | + android:id="@+id/dialog_title" | |
16 | + android:layout_width="match_parent" | |
17 | + android:layout_height="wrap_content" | |
18 | + android:gravity="center" | |
19 | + android:paddingTop="19dip" | |
20 | + android:text="快捷切换中小学桌面" | |
21 | + android:textColor="@color/login_text_black" | |
22 | + android:textSize="20sp" /> | |
23 | + | |
24 | + <View | |
25 | + android:layout_width="match_parent" | |
26 | + android:layout_height="0.5dp" | |
27 | + android:layout_marginLeft="20dp" | |
28 | + android:layout_marginRight="20dp" | |
29 | + android:layout_marginTop="20dp" | |
30 | + android:background="@color/line_bg"/> | |
31 | + | |
32 | + <LinearLayout | |
33 | + android:layout_width="match_parent" | |
34 | + android:layout_height="wrap_content" | |
35 | + android:orientation="horizontal" > | |
36 | + | |
37 | + <Button | |
38 | + android:id="@+id/middle_btn" | |
39 | + style="?android:attr/borderlessButtonStyle" | |
40 | + android:layout_width="match_parent" | |
41 | + android:layout_height="wrap_content" | |
42 | + android:layout_weight="1" | |
43 | + android:background="@drawable/white_cycle_bg" | |
44 | + android:gravity="center" | |
45 | + android:paddingBottom="10dp" | |
46 | + android:paddingTop="10dp" | |
47 | + android:text="中学桌面" | |
48 | + android:textColor="@color/login_text_black" | |
49 | + android:textSize="18sp" /> | |
50 | + | |
51 | + <View | |
52 | + android:layout_width="0.5dp" | |
53 | + android:layout_height="match_parent" | |
54 | + android:layout_marginTop="5dp" | |
55 | + android:layout_marginBottom="5dp" | |
56 | + android:background="@color/line_bg" | |
57 | + android:orientation="horizontal" /> | |
58 | + | |
59 | + <Button | |
60 | + android:id="@+id/primary_btn" | |
61 | + style="?android:attr/borderlessButtonStyle" | |
62 | + android:layout_width="match_parent" | |
63 | + android:layout_height="wrap_content" | |
64 | + android:layout_weight="1" | |
65 | + android:background="@drawable/white_cycle_bg" | |
66 | + android:gravity="center" | |
67 | + android:paddingBottom="10dp" | |
68 | + android:paddingTop="10dp" | |
69 | + android:text="小学桌面" | |
70 | + android:textColor="@color/login_text_black" | |
71 | + android:textSize="18sp" /> | |
72 | + </LinearLayout> | |
73 | + </LinearLayout> | |
74 | + | |
75 | +</LinearLayout> | |
0 | 76 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml
... | ... | @@ -3,7 +3,9 @@ |
3 | 3 | android:id="@+id/card_view" |
4 | 4 | android:layout_width="match_parent" |
5 | 5 | android:layout_height="match_parent" |
6 | + android:background="@mipmap/main_bg" | |
6 | 7 | android:orientation="vertical"> |
8 | + | |
7 | 9 | <RelativeLayout |
8 | 10 | android:id="@+id/title" |
9 | 11 | android:layout_width="match_parent" |
... | ... | @@ -27,14 +29,15 @@ |
27 | 29 | android:text="@string/changge_preson" |
28 | 30 | android:textColor="@android:color/white" |
29 | 31 | android:textSize="22sp" /> |
32 | + | |
30 | 33 | <TextView |
31 | 34 | android:id="@+id/presonal_sub" |
32 | 35 | android:layout_width="wrap_content" |
33 | 36 | android:layout_height="match_parent" |
37 | + android:layout_alignParentRight="true" | |
38 | + android:gravity="center_vertical" | |
34 | 39 | android:paddingLeft="20dp" |
35 | 40 | android:paddingRight="20dp" |
36 | - android:gravity="center_vertical" | |
37 | - android:layout_alignParentRight="true" | |
38 | 41 | android:text="保存" |
39 | 42 | android:textColor="@android:color/white" |
40 | 43 | android:textSize="22sp" /> |
... | ... | @@ -42,454 +45,485 @@ |
42 | 45 | |
43 | 46 | </RelativeLayout> |
44 | 47 | |
45 | - | |
46 | 48 | <LinearLayout |
47 | 49 | android:layout_width="match_parent" |
48 | 50 | android:layout_height="wrap_content" |
49 | - android:layout_marginTop="50dp" | |
50 | - android:orientation="horizontal"> | |
51 | - <LinearLayout | |
52 | - android:layout_width="0dp" | |
53 | - android:layout_weight="1" | |
54 | - android:gravity="right" | |
55 | - android:layout_marginRight="50dp" | |
56 | - android:orientation="vertical" | |
57 | - android:layout_height="match_parent"> | |
58 | - <TextView | |
59 | - android:id="@+id/tv_presonal" | |
60 | - android:layout_width="wrap_content" | |
61 | - android:layout_height="wrap_content" | |
62 | - android:textSize="22sp" | |
63 | - android:textColor="@color/login_edittext_pressed" | |
64 | - android:text="个人信息"/> | |
65 | - <View | |
66 | - android:layout_width="90dp" | |
67 | - android:layout_height="3dp" | |
68 | - android:layout_marginTop="5dp" | |
69 | - android:background="@color/login_edittext_pressed" | |
70 | - /> | |
71 | - | |
51 | + android:layout_marginLeft="100dp" | |
52 | + android:layout_marginRight="100dp" | |
53 | + android:layout_marginTop="60dp" | |
54 | + android:padding="50dp" | |
55 | + android:background="@drawable/white_cycle_bg" | |
56 | + android:orientation="vertical"> | |
72 | 57 | |
73 | - </LinearLayout> | |
74 | 58 | <LinearLayout |
75 | - android:id="@+id/tv_version" | |
76 | - android:layout_width="0dp" | |
77 | - android:layout_weight="1" | |
78 | - android:gravity="left" | |
79 | - android:layout_marginLeft="50dp" | |
80 | - android:layout_height="match_parent"> | |
81 | - <TextView | |
82 | - android:textSize="22sp" | |
83 | - android:layout_width="wrap_content" | |
84 | - android:layout_height="wrap_content" | |
85 | - android:text="版本信息"/> | |
59 | + android:layout_width="match_parent" | |
60 | + android:layout_height="wrap_content" | |
61 | + android:orientation="horizontal"> | |
62 | + | |
63 | + <LinearLayout | |
64 | + android:layout_width="0dp" | |
65 | + android:layout_height="match_parent" | |
66 | + android:layout_marginRight="50dp" | |
67 | + android:layout_weight="1" | |
68 | + android:gravity="right" | |
69 | + android:orientation="vertical"> | |
70 | + | |
71 | + <TextView | |
72 | + android:id="@+id/tv_presonal" | |
73 | + android:layout_width="wrap_content" | |
74 | + android:layout_height="wrap_content" | |
75 | + android:text="个人信息" | |
76 | + android:textColor="@color/login_edittext_pressed" | |
77 | + android:textSize="22sp" /> | |
78 | + | |
79 | + <View | |
80 | + android:layout_width="90dp" | |
81 | + android:layout_height="3dp" | |
82 | + android:layout_marginTop="5dp" | |
83 | + android:background="@color/login_edittext_pressed" /> | |
84 | + | |
85 | + | |
86 | + </LinearLayout> | |
87 | + | |
88 | + <LinearLayout | |
89 | + android:id="@+id/tv_version" | |
90 | + android:layout_width="0dp" | |
91 | + android:layout_height="match_parent" | |
92 | + android:layout_marginLeft="50dp" | |
93 | + android:layout_weight="1" | |
94 | + android:gravity="left"> | |
86 | 95 | |
87 | - </LinearLayout> | |
96 | + <TextView | |
97 | + android:layout_width="wrap_content" | |
98 | + android:layout_height="wrap_content" | |
99 | + android:text="版本信息" | |
100 | + android:textSize="22sp" /> | |
88 | 101 | |
89 | - </LinearLayout> | |
102 | + </LinearLayout> | |
90 | 103 | |
104 | + </LinearLayout> | |
91 | 105 | |
92 | - <LinearLayout | |
93 | - android:layout_width="wrap_content" | |
94 | - android:layout_height="wrap_content" | |
95 | - android:layout_marginTop="80dp" | |
96 | - android:orientation="horizontal"> | |
97 | 106 | |
98 | - <View | |
99 | - android:layout_width="450dp" | |
100 | - android:layout_height="0.7dp" | |
101 | - android:layout_marginLeft="150dp" | |
102 | - android:background="@color/cutoff_line"> | |
107 | + <LinearLayout | |
108 | + android:layout_width="wrap_content" | |
109 | + android:layout_height="wrap_content" | |
110 | + android:layout_marginTop="50dp" | |
111 | + android:orientation="horizontal"> | |
103 | 112 | |
104 | - </View> | |
113 | + <View | |
114 | + android:layout_width="0dp" | |
115 | + android:layout_height="0.7dp" | |
116 | + android:layout_weight="1" | |
117 | + android:background="@color/cutoff_line"> | |
105 | 118 | |
106 | - <View | |
107 | - android:layout_width="450dp" | |
108 | - android:layout_height="0.7dp" | |
109 | - android:layout_marginLeft="80dp" | |
110 | - android:background="@color/cutoff_line"> | |
119 | + </View> | |
111 | 120 | |
112 | - </View> | |
121 | + <View | |
122 | + android:layout_width="0dp" | |
123 | + android:layout_height="0.7dp" | |
124 | + android:layout_marginLeft="50dp" | |
125 | + android:layout_weight="1" | |
126 | + android:background="@color/cutoff_line"> | |
113 | 127 | |
128 | + </View> | |
114 | 129 | |
115 | - </LinearLayout> | |
116 | 130 | |
117 | - <LinearLayout | |
118 | - android:layout_width="match_parent" | |
119 | - android:layout_height="wrap_content" | |
120 | - android:layout_marginLeft="200dp" | |
121 | - android:gravity="center_vertical" | |
122 | - android:orientation="horizontal"> | |
131 | + </LinearLayout> | |
123 | 132 | |
124 | 133 | <LinearLayout |
125 | - android:layout_width="0dp" | |
126 | - android:layout_height="80dp" | |
127 | - android:layout_weight="1" | |
134 | + android:layout_width="match_parent" | |
135 | + android:layout_height="wrap_content" | |
136 | + android:layout_marginLeft="30dp" | |
128 | 137 | android:gravity="center_vertical" |
129 | - android:focusable="true" | |
130 | - android:focusableInTouchMode="true"> | |
131 | - | |
132 | - <TextView | |
133 | - android:layout_width="wrap_content" | |
134 | - android:layout_height="wrap_content" | |
135 | - android:text="昵称" | |
136 | - android:textColor="@color/electronic_text" | |
137 | - android:textSize="22sp" /> | |
138 | - | |
139 | - <EditText | |
140 | - android:id="@+id/tv_username1" | |
141 | - android:layout_width="wrap_content" | |
142 | - android:layout_height="wrap_content" | |
143 | - android:layout_marginLeft="50dp" | |
144 | - android:textColor="@color/login_text_black" | |
145 | - android:background="@null" | |
146 | - android:hint="请输入12个以内的中文或英文字符" | |
147 | - android:textSize="22sp" /> | |
138 | + android:orientation="horizontal"> | |
139 | + | |
140 | + <LinearLayout | |
141 | + android:layout_width="0dp" | |
142 | + android:layout_height="80dp" | |
143 | + android:layout_weight="1" | |
144 | + android:focusable="true" | |
145 | + android:focusableInTouchMode="true" | |
146 | + android:gravity="center_vertical"> | |
147 | + | |
148 | + <TextView | |
149 | + android:layout_width="wrap_content" | |
150 | + android:layout_height="wrap_content" | |
151 | + android:text="昵称" | |
152 | + android:textColor="@color/electronic_text" | |
153 | + android:textSize="22sp" /> | |
154 | + | |
155 | + <EditText | |
156 | + android:id="@+id/tv_username1" | |
157 | + android:layout_width="wrap_content" | |
158 | + android:layout_height="wrap_content" | |
159 | + android:layout_marginLeft="50dp" | |
160 | + android:background="@null" | |
161 | + android:hint="请输入12个以内的中文或英文字符" | |
162 | + android:textColor="@color/login_text_black" | |
163 | + android:textSize="22sp" /> | |
164 | + | |
165 | + </LinearLayout> | |
166 | + | |
167 | + <LinearLayout | |
168 | + android:layout_width="0dp" | |
169 | + android:layout_height="80dp" | |
170 | + android:layout_weight="1" | |
171 | + android:layout_marginLeft="40dp" | |
172 | + android:gravity="center_vertical"> | |
173 | + | |
174 | + <TextView | |
175 | + android:layout_width="wrap_content" | |
176 | + android:layout_height="wrap_content" | |
177 | + android:text="地区" | |
178 | + android:textColor="@color/electronic_text" | |
179 | + android:textSize="22sp" /> | |
180 | + | |
181 | + <TextView | |
182 | + android:id="@+id/tv_useinfo_adress" | |
183 | + android:layout_width="0dp" | |
184 | + android:layout_height="wrap_content" | |
185 | + android:layout_marginLeft="50dp" | |
186 | + android:layout_weight="1" | |
187 | + android:hint="请选择" | |
188 | + android:textColor="@color/login_text_black" | |
189 | + android:textSize="22sp" /> | |
190 | + | |
191 | + <ImageView | |
192 | + android:id="@+id/my_adress" | |
193 | + android:layout_width="wrap_content" | |
194 | + android:layout_height="wrap_content" | |
195 | + android:layout_marginRight="20dp" | |
196 | + android:padding="20dp" | |
197 | + android:src="@mipmap/xiajiantou"> | |
198 | + | |
199 | + </ImageView> | |
200 | + </LinearLayout> | |
148 | 201 | |
149 | 202 | </LinearLayout> |
150 | 203 | |
151 | 204 | <LinearLayout |
152 | - android:layout_width="0dp" | |
153 | - android:layout_height="80dp" | |
154 | - android:layout_weight="1" | |
155 | - android:gravity="center_vertical"> | |
156 | - | |
157 | - <TextView | |
158 | - android:layout_width="wrap_content" | |
159 | - android:layout_height="wrap_content" | |
160 | - android:text="地区" | |
161 | - android:textColor="@color/electronic_text" | |
162 | - android:textSize="22sp" /> | |
163 | - | |
164 | - <TextView | |
165 | - android:id="@+id/tv_useinfo_adress" | |
166 | - android:layout_width="wrap_content" | |
167 | - android:layout_height="wrap_content" | |
168 | - android:layout_marginLeft="50dp" | |
169 | - android:textColor="@color/login_text_black" | |
170 | - android:hint="请选择" | |
171 | - android:textSize="22sp" /> | |
172 | - | |
173 | - <ImageView | |
174 | - android:id="@+id/my_adress" | |
175 | - android:padding="20dp" | |
176 | - android:layout_width="wrap_content" | |
177 | - android:layout_height="wrap_content" | |
178 | - android:layout_marginLeft="150dp" | |
179 | - android:src="@mipmap/xiajiantou"> | |
180 | - | |
181 | - </ImageView> | |
182 | - </LinearLayout> | |
183 | - | |
184 | - </LinearLayout> | |
185 | - | |
186 | - <LinearLayout | |
187 | - android:layout_width="wrap_content" | |
188 | - android:layout_height="wrap_content" | |
189 | - android:orientation="horizontal"> | |
190 | - | |
191 | - <View | |
192 | - android:layout_width="450dp" | |
193 | - android:layout_height="0.7dp" | |
194 | - android:layout_marginLeft="150dp" | |
195 | - android:background="@color/cutoff_line"> | |
196 | - | |
197 | - </View> | |
198 | - | |
199 | - <View | |
200 | - android:layout_width="450dp" | |
201 | - android:layout_height="0.7dp" | |
202 | - android:layout_marginLeft="80dp" | |
203 | - android:background="@color/cutoff_line"> | |
204 | - | |
205 | - </View> | |
206 | - | |
205 | + android:layout_width="wrap_content" | |
206 | + android:layout_height="wrap_content" | |
207 | + android:orientation="horizontal"> | |
207 | 208 | |
208 | - </LinearLayout> | |
209 | + <View | |
210 | + android:layout_width="0dp" | |
211 | + android:layout_height="0.7dp" | |
212 | + android:layout_weight="1" | |
213 | + android:background="@color/cutoff_line"> | |
209 | 214 | |
210 | - <LinearLayout | |
211 | - android:layout_width="match_parent" | |
212 | - android:layout_height="wrap_content" | |
213 | - android:layout_marginLeft="200dp" | |
214 | - android:gravity="center_vertical" | |
215 | - android:orientation="horizontal"> | |
215 | + </View> | |
216 | 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/electronic_text" | |
228 | - android:textSize="22sp" /> | |
229 | - | |
230 | - <TextView | |
231 | - android:id="@+id/tv_sex" | |
232 | - android:layout_width="wrap_content" | |
233 | - android:layout_height="wrap_content" | |
217 | + <View | |
218 | + android:layout_width="0dp" | |
219 | + android:layout_height="0.7dp" | |
234 | 220 | android:layout_marginLeft="50dp" |
235 | - android:textColor="@color/login_text_black" | |
236 | - android:hint="请选择" | |
237 | - android:textSize="22sp" /> | |
221 | + android:layout_weight="1" | |
222 | + android:background="@color/cutoff_line"> | |
238 | 223 | |
239 | - <ImageView | |
240 | - android:id="@+id/my_sex" | |
241 | - android:padding="20dp" | |
242 | - android:layout_width="wrap_content" | |
243 | - android:layout_height="wrap_content" | |
244 | - android:layout_marginLeft="150dp" | |
245 | - android:src="@mipmap/xiajiantou"> | |
246 | - | |
247 | - </ImageView> | |
224 | + </View> | |
248 | 225 | |
249 | 226 | |
250 | 227 | </LinearLayout> |
251 | 228 | |
252 | 229 | <LinearLayout |
253 | - android:layout_width="0dp" | |
254 | - android:layout_height="80dp" | |
255 | - android:layout_weight="1" | |
256 | - android:gravity="center_vertical"> | |
257 | - | |
258 | - <TextView | |
259 | - android:layout_width="wrap_content" | |
260 | - android:layout_height="wrap_content" | |
261 | - android:text=" " | |
262 | - android:textColor="@color/white" | |
263 | - android:textSize="22sp" /> | |
264 | - | |
265 | - <EditText | |
266 | - android:id="@+id/tv_useinfo_adress1" | |
267 | - android:layout_width="wrap_content" | |
268 | - android:layout_height="wrap_content" | |
269 | - android:layout_marginLeft="50dp" | |
270 | - android:textColor="@color/login_text_black" | |
271 | - android:background="@null" | |
272 | - android:hint="请输入详细地址" | |
273 | - android:textSize="22sp" /> | |
230 | + android:layout_width="match_parent" | |
231 | + android:layout_height="wrap_content" | |
232 | + android:layout_marginLeft="30dp" | |
233 | + android:gravity="center_vertical" | |
234 | + android:orientation="horizontal"> | |
235 | + | |
236 | + <LinearLayout | |
237 | + android:layout_width="0dp" | |
238 | + android:layout_height="80dp" | |
239 | + android:layout_weight="1" | |
240 | + android:gravity="center_vertical"> | |
241 | + | |
242 | + <TextView | |
243 | + android:layout_width="wrap_content" | |
244 | + android:layout_height="wrap_content" | |
245 | + android:text="性别" | |
246 | + android:textColor="@color/electronic_text" | |
247 | + android:textSize="22sp" /> | |
248 | + | |
249 | + <TextView | |
250 | + android:id="@+id/tv_sex" | |
251 | + android:layout_width="0dp" | |
252 | + android:layout_height="wrap_content" | |
253 | + android:layout_weight="1" | |
254 | + android:layout_marginLeft="50dp" | |
255 | + android:hint="请选择" | |
256 | + android:textColor="@color/login_text_black" | |
257 | + android:textSize="22sp" /> | |
258 | + | |
259 | + <ImageView | |
260 | + android:id="@+id/my_sex" | |
261 | + android:layout_width="wrap_content" | |
262 | + android:layout_height="wrap_content" | |
263 | + android:padding="20dp" | |
264 | + android:layout_marginRight="50dp" | |
265 | + android:src="@mipmap/xiajiantou"> | |
266 | + | |
267 | + </ImageView> | |
268 | + | |
269 | + | |
270 | + </LinearLayout> | |
271 | + | |
272 | + <LinearLayout | |
273 | + android:layout_width="0dp" | |
274 | + android:layout_height="80dp" | |
275 | + android:layout_weight="1" | |
276 | + android:gravity="center_vertical"> | |
277 | + | |
278 | + <TextView | |
279 | + android:layout_width="wrap_content" | |
280 | + android:layout_height="wrap_content" | |
281 | + android:text=" " | |
282 | + android:textColor="@color/white" | |
283 | + android:textSize="22sp" /> | |
284 | + | |
285 | + <EditText | |
286 | + android:id="@+id/tv_useinfo_adress1" | |
287 | + android:layout_width="wrap_content" | |
288 | + android:layout_height="wrap_content" | |
289 | + android:layout_marginLeft="70dp" | |
290 | + android:background="@null" | |
291 | + android:hint="请输入详细地址" | |
292 | + android:textColor="@color/login_text_black" | |
293 | + android:textSize="22sp" /> | |
294 | + | |
295 | + </LinearLayout> | |
274 | 296 | |
275 | 297 | </LinearLayout> |
276 | 298 | |
277 | - </LinearLayout> | |
278 | - | |
279 | - <LinearLayout | |
280 | - android:layout_width="wrap_content" | |
281 | - android:layout_height="wrap_content" | |
282 | - | |
283 | - android:orientation="horizontal"> | |
299 | + <LinearLayout | |
300 | + android:layout_width="wrap_content" | |
301 | + android:layout_height="wrap_content" | |
284 | 302 | |
285 | - <View | |
286 | - android:layout_width="450dp" | |
287 | - android:layout_height="0.7dp" | |
288 | - android:layout_marginLeft="150dp" | |
289 | - android:background="@color/cutoff_line"> | |
303 | + android:orientation="horizontal"> | |
290 | 304 | |
291 | - </View> | |
305 | + <View | |
306 | + android:layout_width="0dp" | |
307 | + android:layout_height="0.7dp" | |
308 | + android:layout_weight="1" | |
309 | + android:background="@color/cutoff_line"> | |
292 | 310 | |
293 | - <View | |
294 | - android:layout_width="450dp" | |
295 | - android:layout_height="0.7dp" | |
296 | - android:layout_marginLeft="80dp" | |
297 | - android:background="@color/cutoff_line"> | |
311 | + </View> | |
298 | 312 | |
299 | - </View> | |
313 | + <View | |
314 | + android:layout_width="0dp" | |
315 | + android:layout_height="0.7dp" | |
316 | + android:layout_marginLeft="50dp" | |
317 | + android:layout_weight="1" | |
318 | + android:background="@color/cutoff_line"> | |
300 | 319 | |
320 | + </View> | |
301 | 321 | |
302 | - </LinearLayout> | |
303 | 322 | |
304 | - <LinearLayout | |
305 | - android:layout_width="match_parent" | |
306 | - android:layout_height="wrap_content" | |
307 | - android:layout_marginLeft="200dp" | |
308 | - android:gravity="center_vertical" | |
309 | - android:orientation="horizontal"> | |
310 | - | |
311 | - | |
312 | - <LinearLayout | |
313 | - android:layout_width="0dp" | |
314 | - android:layout_height="80dp" | |
315 | - android:layout_weight="1" | |
316 | - android:gravity="center_vertical"> | |
317 | - | |
318 | - <TextView | |
319 | - android:layout_width="wrap_content" | |
320 | - android:layout_height="wrap_content" | |
321 | - android:text="生日" | |
322 | - android:textColor="@color/electronic_text" | |
323 | - android:textSize="22sp" /> | |
324 | - | |
325 | - <TextView | |
326 | - android:id="@+id/tv_useinfo_birthday" | |
327 | - android:layout_width="wrap_content" | |
328 | - android:layout_height="wrap_content" | |
329 | - android:layout_marginLeft="50dp" | |
330 | - android:hint="请选择" | |
331 | - android:textColor="@color/login_text_black" | |
332 | - android:textSize="22sp" /> | |
333 | - | |
334 | - <ImageView | |
335 | - android:id="@+id/my_bthday" | |
336 | - android:padding="20dp" | |
337 | - android:layout_width="wrap_content" | |
338 | - android:layout_height="wrap_content" | |
339 | - android:layout_marginLeft="150dp" | |
340 | - android:textColor="@color/login_text_black" | |
341 | - android:src="@mipmap/xiajiantou"/> | |
342 | - </LinearLayout> | |
343 | - <LinearLayout | |
344 | - android:layout_width="0dp" | |
345 | - android:layout_height="80dp" | |
346 | - android:layout_weight="1" | |
347 | - android:gravity="center_vertical"> | |
348 | - | |
349 | - <TextView | |
350 | - android:layout_width="wrap_content" | |
351 | - android:layout_height="wrap_content" | |
352 | - android:text="年级" | |
353 | - android:textColor="@color/electronic_text" | |
354 | - android:textSize="22sp" /> | |
355 | - | |
356 | - <TextView | |
357 | - android:id="@+id/tv_useinfo_gender" | |
358 | - android:layout_width="wrap_content" | |
359 | - android:layout_height="wrap_content" | |
360 | - android:layout_marginLeft="50dp" | |
361 | - android:hint="请选择" | |
362 | - android:textColor="@color/login_text_black" | |
363 | - android:textSize="22sp" /> | |
364 | - | |
365 | - <ImageView | |
366 | - android:id="@+id/my_grade" | |
367 | - android:padding="20dp" | |
368 | - android:layout_width="wrap_content" | |
369 | - android:layout_height="wrap_content" | |
370 | - android:layout_marginLeft="150dp" | |
371 | - android:src="@mipmap/xiajiantou"/> | |
372 | 323 | </LinearLayout> |
373 | 324 | |
374 | - </LinearLayout> | |
325 | + <LinearLayout | |
326 | + android:layout_width="match_parent" | |
327 | + android:layout_height="wrap_content" | |
328 | + android:layout_marginLeft="30dp" | |
329 | + android:gravity="center_vertical" | |
330 | + android:orientation="horizontal"> | |
331 | + | |
332 | + | |
333 | + <LinearLayout | |
334 | + android:layout_width="0dp" | |
335 | + android:layout_height="80dp" | |
336 | + android:layout_weight="1" | |
337 | + android:gravity="center_vertical"> | |
338 | + | |
339 | + <TextView | |
340 | + android:layout_width="wrap_content" | |
341 | + android:layout_height="wrap_content" | |
342 | + android:text="生日" | |
343 | + android:textColor="@color/electronic_text" | |
344 | + android:textSize="22sp" /> | |
345 | + | |
346 | + <TextView | |
347 | + android:id="@+id/tv_useinfo_birthday" | |
348 | + android:layout_width="0dp" | |
349 | + android:layout_height="wrap_content" | |
350 | + android:layout_marginLeft="50dp" | |
351 | + android:layout_weight="1" | |
352 | + android:hint="请选择" | |
353 | + android:textColor="@color/login_text_black" | |
354 | + android:textSize="22sp" /> | |
355 | + | |
356 | + <ImageView | |
357 | + android:id="@+id/my_bthday" | |
358 | + android:layout_width="wrap_content" | |
359 | + android:layout_height="wrap_content" | |
360 | + android:layout_marginRight="30dp" | |
361 | + android:padding="20dp" | |
362 | + android:src="@mipmap/xiajiantou" | |
363 | + android:textColor="@color/login_text_black" /> | |
364 | + </LinearLayout> | |
365 | + | |
366 | + <LinearLayout | |
367 | + android:layout_width="0dp" | |
368 | + android:layout_height="80dp" | |
369 | + android:layout_weight="1" | |
370 | + android:layout_marginLeft="40dp" | |
371 | + android:gravity="center_vertical"> | |
372 | + | |
373 | + <TextView | |
374 | + android:layout_width="wrap_content" | |
375 | + android:layout_height="wrap_content" | |
376 | + android:text="年级" | |
377 | + android:textColor="@color/electronic_text" | |
378 | + android:textSize="22sp" /> | |
379 | + | |
380 | + <TextView | |
381 | + android:id="@+id/tv_useinfo_gender" | |
382 | + android:layout_width="0dp" | |
383 | + android:layout_height="wrap_content" | |
384 | + android:layout_marginLeft="50dp" | |
385 | + android:layout_weight="1" | |
386 | + android:hint="请选择" | |
387 | + android:textColor="@color/login_text_black" | |
388 | + android:textSize="22sp" /> | |
389 | + | |
390 | + <ImageView | |
391 | + android:id="@+id/my_grade" | |
392 | + android:layout_width="wrap_content" | |
393 | + android:layout_height="wrap_content" | |
394 | + android:layout_marginRight="20dp" | |
395 | + android:padding="20dp" | |
396 | + android:src="@mipmap/xiajiantou" /> | |
397 | + </LinearLayout> | |
375 | 398 | |
376 | - <LinearLayout | |
377 | - android:layout_width="wrap_content" | |
378 | - android:layout_height="wrap_content" | |
399 | + </LinearLayout> | |
379 | 400 | |
380 | - android:orientation="horizontal"> | |
401 | + <LinearLayout | |
402 | + android:layout_width="wrap_content" | |
403 | + android:layout_height="wrap_content" | |
381 | 404 | |
382 | - <View | |
383 | - android:layout_width="450dp" | |
384 | - android:layout_height="0.7dp" | |
385 | - android:layout_marginLeft="150dp" | |
386 | - android:background="@color/cutoff_line"> | |
405 | + android:orientation="horizontal"> | |
387 | 406 | |
388 | - </View> | |
407 | + <View | |
408 | + android:layout_width="0dp" | |
409 | + android:layout_height="0.7dp" | |
410 | + android:layout_weight="1" | |
411 | + android:background="@color/cutoff_line"> | |
389 | 412 | |
390 | - <View | |
391 | - android:layout_width="450dp" | |
392 | - android:layout_height="0.7dp" | |
393 | - android:layout_marginLeft="80dp" | |
394 | - android:background="@color/cutoff_line"> | |
413 | + </View> | |
395 | 414 | |
396 | - </View> | |
415 | + <View | |
416 | + android:layout_width="0dp" | |
417 | + android:layout_height="0.7dp" | |
418 | + android:layout_weight="1" | |
419 | + android:layout_marginLeft="50dp" | |
420 | + android:background="@color/cutoff_line"> | |
397 | 421 | |
422 | + </View> | |
398 | 423 | |
399 | - </LinearLayout> | |
400 | 424 | |
401 | - <LinearLayout | |
402 | - android:layout_width="match_parent" | |
403 | - android:layout_height="wrap_content" | |
404 | - android:layout_marginLeft="200dp" | |
405 | - android:gravity="center_vertical" | |
406 | - android:orientation="horizontal"> | |
425 | + </LinearLayout> | |
407 | 426 | |
408 | 427 | <LinearLayout |
409 | - android:id="@+id/lineL_buy_time" | |
410 | - android:layout_width="0dp" | |
411 | - android:layout_height="80dp" | |
412 | - android:layout_weight="1" | |
413 | - android:gravity="center_vertical"> | |
414 | - | |
415 | - <TextView | |
416 | - android:layout_width="wrap_content" | |
417 | - android:layout_height="wrap_content" | |
418 | - android:text="Q Q" | |
419 | - android:textColor="@color/electronic_text" | |
420 | - android:textSize="22sp" /> | |
421 | - | |
422 | - <EditText | |
423 | - android:id="@+id/tv_useinfo_qq" | |
424 | - android:layout_width="wrap_content" | |
425 | - android:layout_height="wrap_content" | |
426 | - android:layout_marginLeft="50dp" | |
427 | - android:inputType="number" | |
428 | - android:background="@null" | |
429 | - android:textColor="@color/login_text_black" | |
430 | - android:hint="请输入" | |
431 | - android:textSize="22sp" /> | |
428 | + android:layout_width="match_parent" | |
429 | + android:layout_height="wrap_content" | |
430 | + android:layout_marginLeft="30dp" | |
431 | + android:gravity="center_vertical" | |
432 | + android:orientation="horizontal"> | |
433 | + | |
434 | + <LinearLayout | |
435 | + android:id="@+id/lineL_buy_time" | |
436 | + android:layout_width="0dp" | |
437 | + android:layout_height="80dp" | |
438 | + android:layout_weight="1" | |
439 | + android:gravity="center_vertical"> | |
440 | + | |
441 | + <TextView | |
442 | + android:layout_width="wrap_content" | |
443 | + android:layout_height="wrap_content" | |
444 | + android:text="Q Q" | |
445 | + android:textColor="@color/electronic_text" | |
446 | + android:textSize="22sp" /> | |
447 | + | |
448 | + <EditText | |
449 | + android:id="@+id/tv_useinfo_qq" | |
450 | + android:layout_width="0dp" | |
451 | + android:layout_height="wrap_content" | |
452 | + android:layout_marginLeft="50dp" | |
453 | + android:layout_weight="1" | |
454 | + android:background="@null" | |
455 | + android:maxLines="1" | |
456 | + android:ellipsize="end" | |
457 | + android:hint="请输入" | |
458 | + android:inputType="number" | |
459 | + android:textColor="@color/login_text_black" | |
460 | + android:textSize="22sp" /> | |
461 | + | |
462 | + </LinearLayout> | |
463 | + | |
464 | + <LinearLayout | |
465 | + android:layout_width="0dp" | |
466 | + android:layout_height="80dp" | |
467 | + android:layout_weight="1" | |
468 | + android:layout_marginLeft="40dp" | |
469 | + android:gravity="center_vertical"> | |
470 | + | |
471 | + <TextView | |
472 | + android:layout_width="wrap_content" | |
473 | + android:layout_height="wrap_content" | |
474 | + android:text="学校" | |
475 | + android:textColor="@color/electronic_text" | |
476 | + android:textSize="22sp" /> | |
477 | + | |
478 | + <TextView | |
479 | + android:id="@+id/tv_useinfo_school" | |
480 | + android:layout_width="0dp" | |
481 | + android:layout_height="wrap_content" | |
482 | + android:layout_marginLeft="50dp" | |
483 | + android:layout_weight="1" | |
484 | + android:ellipsize="end" | |
485 | + android:hint="请选择" | |
486 | + android:maxLines="1" | |
487 | + android:textColor="@color/login_text_black" | |
488 | + android:textSize="22sp" /> | |
489 | + | |
490 | + <ImageView | |
491 | + android:id="@+id/my_school" | |
492 | + android:layout_width="wrap_content" | |
493 | + android:layout_height="wrap_content" | |
494 | + android:padding="20dp" | |
495 | + android:layout_marginRight="20dp" | |
496 | + android:src="@mipmap/xiajiantou"> | |
497 | + | |
498 | + </ImageView> | |
499 | + </LinearLayout> | |
432 | 500 | |
433 | 501 | </LinearLayout> |
434 | 502 | |
435 | 503 | <LinearLayout |
436 | - android:layout_width="0dp" | |
437 | - android:layout_height="80dp" | |
438 | - android:layout_weight="1" | |
439 | - | |
440 | - android:gravity="center_vertical"> | |
441 | - | |
442 | - <TextView | |
443 | - android:layout_width="wrap_content" | |
444 | - android:layout_height="wrap_content" | |
445 | - android:text="学校" | |
446 | - android:textColor="@color/electronic_text" | |
447 | - android:textSize="22sp" /> | |
448 | - | |
449 | - <TextView | |
450 | - android:id="@+id/tv_useinfo_school" | |
451 | - android:layout_width="wrap_content" | |
452 | - android:layout_height="wrap_content" | |
453 | - android:layout_marginLeft="50dp" | |
454 | - android:hint="请选择" | |
455 | - android:textColor="@color/login_text_black" | |
456 | - android:textSize="22sp" /> | |
457 | - | |
458 | - <ImageView | |
459 | - android:id="@+id/my_school" | |
460 | - android:padding="20dp" | |
461 | - android:layout_width="wrap_content" | |
462 | - android:layout_height="wrap_content" | |
463 | - android:layout_marginLeft="150dp" | |
464 | - android:src="@mipmap/xiajiantou"> | |
465 | - | |
466 | - </ImageView> | |
467 | - </LinearLayout> | |
468 | - | |
469 | - </LinearLayout> | |
504 | + android:layout_width="wrap_content" | |
505 | + android:layout_height="wrap_content" | |
506 | + android:orientation="horizontal"> | |
470 | 507 | |
471 | - <LinearLayout | |
472 | - android:layout_width="wrap_content" | |
473 | - android:layout_height="wrap_content" | |
474 | - android:orientation="horizontal"> | |
508 | + <View | |
509 | + android:layout_width="0dp" | |
510 | + android:layout_height="0.7dp" | |
511 | + android:layout_weight="1" | |
512 | + android:background="@color/cutoff_line"> | |
475 | 513 | |
476 | - <View | |
477 | - android:layout_width="450dp" | |
478 | - android:layout_height="0.7dp" | |
479 | - android:layout_marginLeft="150dp" | |
480 | - android:background="@color/cutoff_line"> | |
514 | + </View> | |
481 | 515 | |
482 | - </View> | |
516 | + <View | |
517 | + android:layout_width="0dp" | |
518 | + android:layout_height="0.7dp" | |
519 | + android:layout_marginLeft="60dp" | |
520 | + android:layout_weight="1" | |
521 | + android:background="@color/cutoff_line"> | |
483 | 522 | |
484 | - <View | |
485 | - android:layout_width="450dp" | |
486 | - android:layout_height="0.7dp" | |
487 | - android:layout_marginLeft="80dp" | |
488 | - android:background="@color/cutoff_line"> | |
523 | + </View> | |
489 | 524 | |
490 | - </View> | |
491 | 525 | |
526 | + </LinearLayout> | |
492 | 527 | |
493 | 528 | </LinearLayout> |
494 | - | |
495 | 529 | </LinearLayout> |
496 | 530 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_loginandregister_login.xml
... | ... | @@ -2,34 +2,72 @@ |
2 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="#ffffffff" | |
5 | + android:background="#00ffffff" | |
6 | 6 | android:orientation="vertical" |
7 | - android:paddingLeft="300dp" | |
8 | - android:paddingRight="300dp" > | |
7 | + android:paddingLeft="30dp" | |
8 | + android:paddingRight="30dp"> | |
9 | 9 | |
10 | 10 | |
11 | - <EditText | |
12 | - android:id="@+id/et_phonenumber" | |
13 | - style="@style/login_register_edit_style" | |
11 | + <LinearLayout | |
12 | + android:id="@+id/et_phonenumber_layout" | |
13 | + android:layout_width="match_parent" | |
14 | + android:layout_height="wrap_content" | |
14 | 15 | android:layout_marginTop="20dp" |
15 | - android:textColor="@color/login_text_black" | |
16 | - android:inputType="phone" | |
17 | - android:hint="手机号" /> | |
18 | - | |
19 | - <EditText | |
20 | - android:id="@+id/et_password" | |
21 | - style="@style/login_register_edit_style" | |
22 | - android:layout_below="@id/et_phonenumber" | |
23 | - android:layout_marginTop="30dp" | |
24 | - android:textColor="@color/login_text_black" | |
25 | - android:hint="密码" | |
26 | - android:inputType="textPassword" /> | |
16 | + android:background="@drawable/input_bg" | |
17 | + android:gravity="center_horizontal" | |
18 | + android:orientation="horizontal" | |
19 | + android:paddingRight="10dp"> | |
20 | + | |
21 | + <EditText | |
22 | + android:id="@+id/et_phonenumber" | |
23 | + style="@style/login_register_edit_style" | |
24 | + android:hint="手机号" | |
25 | + android:maxLength="11" | |
26 | + android:imeOptions="actionNext" | |
27 | + android:inputType="phone" /> | |
28 | + | |
29 | + <ImageButton | |
30 | + android:id="@+id/phone_delete_btn" | |
31 | + android:layout_width="50dp" | |
32 | + android:layout_height="match_parent" | |
33 | + android:background="@null" | |
34 | + android:src="@mipmap/delete_btn" | |
35 | + android:visibility="invisible" /> | |
36 | + </LinearLayout> | |
37 | + | |
38 | + <LinearLayout | |
39 | + android:id="@+id/et_password_layout" | |
40 | + android:layout_width="match_parent" | |
41 | + android:layout_height="wrap_content" | |
42 | + android:layout_below="@id/et_phonenumber_layout" | |
43 | + android:layout_marginTop="50dp" | |
44 | + android:background="@drawable/input_bg" | |
45 | + android:gravity="center_horizontal" | |
46 | + android:orientation="horizontal" | |
47 | + android:paddingRight="10dp"> | |
48 | + | |
49 | + <EditText | |
50 | + android:id="@+id/et_password" | |
51 | + style="@style/login_register_edit_style" | |
52 | + android:hint="密码" | |
53 | + android:maxLength="20" | |
54 | + android:inputType="textPassword" | |
55 | + android:textColor="@color/login_text_black" /> | |
56 | + | |
57 | + <ImageButton | |
58 | + android:id="@+id/password_delete_btn" | |
59 | + android:layout_width="50dp" | |
60 | + android:layout_height="match_parent" | |
61 | + android:background="@null" | |
62 | + android:src="@mipmap/delete_btn" | |
63 | + android:visibility="invisible" /> | |
64 | + </LinearLayout> | |
27 | 65 | |
28 | 66 | <Button |
29 | 67 | android:id="@+id/btn_login" |
30 | 68 | style="@style/button_login_register_style" |
31 | - android:layout_below="@id/et_password" | |
32 | - android:layout_marginTop="30dp" | |
69 | + android:layout_below="@id/et_password_layout" | |
70 | + android:layout_marginTop="90dp" | |
33 | 71 | android:text="登 录" /> |
34 | 72 | |
35 | 73 | <TextView | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_loginandregister_register.xml
... | ... | @@ -2,29 +2,44 @@ |
2 | 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | - android:background="#ffffffff" | |
5 | + android:background="#00ffffff" | |
6 | 6 | android:orientation="vertical" |
7 | - android:paddingLeft="300dp" | |
8 | - android:paddingRight="300dp"> | |
7 | + android:paddingLeft="30dp" | |
8 | + android:paddingRight="30dp"> | |
9 | 9 | |
10 | - <EditText | |
11 | - android:id="@+id/et_phonenumber" | |
12 | - style="@style/login_register_edit_style" | |
10 | + <LinearLayout | |
11 | + android:id="@+id/et_phonenumber_layout" | |
12 | + android:layout_width="match_parent" | |
13 | + android:layout_height="wrap_content" | |
14 | + android:gravity="center_horizontal" | |
15 | + android:background="@drawable/input_bg" | |
13 | 16 | android:layout_marginTop="20dp" |
14 | - android:hint="手机号" | |
15 | - android:inputType="phone" /> | |
17 | + android:paddingRight="10dp" | |
18 | + android:orientation="horizontal"> | |
16 | 19 | |
17 | - <TextView | |
18 | - android:id="@+id/phonenumber_error_hint" | |
19 | - style="@style/registererrhint_style" | |
20 | - android:layout_below="@id/et_phonenumber" /> | |
20 | + <EditText | |
21 | + android:id="@+id/et_phonenumber" | |
22 | + style="@style/login_register_edit_style" | |
23 | + android:hint="手机号" | |
24 | + android:maxLength="11" | |
25 | + android:inputType="phone" /> | |
26 | + <ImageButton | |
27 | + android:id="@+id/phone_delete_btn" | |
28 | + android:layout_width="50dp" | |
29 | + android:layout_height="match_parent" | |
30 | + android:src="@mipmap/delete_btn" | |
31 | + android:visibility="invisible" | |
32 | + android:background="@null"/> | |
33 | + </LinearLayout> | |
21 | 34 | |
22 | 35 | <LinearLayout |
23 | 36 | android:id="@+id/rl_authcode" |
24 | 37 | android:layout_width="match_parent" |
25 | 38 | android:layout_height="wrap_content" |
26 | - android:layout_below="@id/et_phonenumber" | |
39 | + android:layout_below="@id/et_phonenumber_layout" | |
27 | 40 | android:layout_marginTop="30dp" |
41 | + android:paddingRight="7dp" | |
42 | + android:background="@drawable/input_bg" | |
28 | 43 | android:orientation="horizontal"> |
29 | 44 | |
30 | 45 | <EditText |
... | ... | @@ -33,14 +48,28 @@ |
33 | 48 | android:layout_marginRight="-4px" |
34 | 49 | android:layout_weight="1" |
35 | 50 | android:hint="验证码" |
51 | + android:maxLength="6" | |
36 | 52 | android:numeric="integer" /> |
37 | 53 | |
54 | + <ImageButton | |
55 | + android:id="@+id/code_delete_btn" | |
56 | + android:layout_width="50dp" | |
57 | + android:layout_height="match_parent" | |
58 | + android:src="@mipmap/delete_btn" | |
59 | + android:visibility="invisible" | |
60 | + android:background="@null"/> | |
38 | 61 | <Button |
39 | 62 | android:id="@+id/btn_authcode" |
40 | - style="@style/login_register_btn_authcode_rect_style" | |
63 | + android:layout_width="match_parent" | |
64 | + android:layout_height="wrap_content" | |
65 | + style="?android:attr/borderlessButtonStyle" | |
41 | 66 | android:layout_weight="2" |
42 | 67 | android:text="获取验证码" |
43 | - android:textColor="@color/btn_text_color" /> | |
68 | + android:maxLines="1" | |
69 | + android:background="@drawable/code_bg" | |
70 | + android:textSize="18sp" | |
71 | + android:padding="8dp" | |
72 | + android:textColor="@color/login_text_blue" /> | |
44 | 73 | </LinearLayout> |
45 | 74 | |
46 | 75 | <TextView |
... | ... | @@ -48,11 +77,13 @@ |
48 | 77 | style="@style/registererrhint_style" |
49 | 78 | android:layout_below="@id/rl_authcode" /> |
50 | 79 | |
51 | - <RelativeLayout | |
80 | + <LinearLayout | |
52 | 81 | android:id="@+id/pwd_rl" |
53 | 82 | android:layout_width="match_parent" |
54 | 83 | android:layout_height="wrap_content" |
55 | 84 | android:layout_below="@id/rl_authcode" |
85 | + android:background="@drawable/input_bg" | |
86 | + android:gravity="center_vertical" | |
56 | 87 | android:layout_marginTop="30dp"> |
57 | 88 | |
58 | 89 | <EditText |
... | ... | @@ -63,15 +94,15 @@ |
63 | 94 | |
64 | 95 | <ImageView |
65 | 96 | android:id="@+id/iv_pwd_change" |
66 | - android:padding="10dp" | |
67 | - android:layout_marginRight="10dp" | |
68 | - android:layout_marginLeft="10dp" | |
69 | 97 | android:layout_width="40dp" |
70 | 98 | android:layout_height="wrap_content" |
71 | 99 | android:layout_alignParentRight="true" |
72 | 100 | android:layout_centerVertical="true" |
101 | + android:layout_marginLeft="10dp" | |
102 | + android:layout_marginRight="15dp" | |
103 | + android:padding="10dp" | |
73 | 104 | android:src="@mipmap/pwd_hide" /> |
74 | - </RelativeLayout> | |
105 | + </LinearLayout> | |
75 | 106 | |
76 | 107 | <TextView |
77 | 108 | android:id="@+id/password_error_hint" | ... | ... |
PersonalCenter/app/src/main/res/layout/sales_dialog_layout.xml
... | ... | @@ -0,0 +1,86 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:layout_width="match_parent" | |
4 | + android:layout_height="match_parent" | |
5 | + android:background="@null" | |
6 | + android:gravity="center" | |
7 | + android:orientation="vertical" > | |
8 | + | |
9 | + <LinearLayout | |
10 | + android:layout_width="400dp" | |
11 | + android:layout_height="wrap_content" | |
12 | + android:background="@drawable/white_cycle_bg" | |
13 | + android:orientation="vertical" > | |
14 | + <TextView | |
15 | + android:layout_width="match_parent" | |
16 | + android:layout_height="wrap_content" | |
17 | + android:gravity="center" | |
18 | + android:paddingTop="19dip" | |
19 | + android:lineSpacingExtra="5dp" | |
20 | + android:text="温馨提示" | |
21 | + android:textColor="@color/login_text_black" | |
22 | + android:textSize="22sp" /> | |
23 | + | |
24 | + <TextView | |
25 | + android:id="@+id/dialog_title" | |
26 | + android:layout_width="match_parent" | |
27 | + android:layout_height="wrap_content" | |
28 | + android:gravity="center" | |
29 | + android:paddingTop="19dip" | |
30 | + android:lineSpacingExtra="5dp" | |
31 | + android:text="该导购员还未在系统中注册,您确定继续\n注册电子保卡?" | |
32 | + android:textColor="@color/login_text_black" | |
33 | + android:textSize="19sp" /> | |
34 | + | |
35 | + <View | |
36 | + android:layout_width="match_parent" | |
37 | + android:layout_height="0.5dp" | |
38 | + android:layout_marginLeft="20dp" | |
39 | + android:layout_marginRight="20dp" | |
40 | + android:layout_marginTop="20dp" | |
41 | + android:background="@color/line_bg"/> | |
42 | + | |
43 | + <LinearLayout | |
44 | + android:layout_width="match_parent" | |
45 | + android:layout_height="wrap_content" | |
46 | + android:orientation="horizontal" > | |
47 | + | |
48 | + <Button | |
49 | + android:id="@+id/cancel_btn" | |
50 | + style="?android:attr/borderlessButtonStyle" | |
51 | + android:layout_width="match_parent" | |
52 | + android:layout_height="wrap_content" | |
53 | + android:layout_weight="1" | |
54 | + android:background="@drawable/white_cycle_bg" | |
55 | + android:gravity="center" | |
56 | + android:paddingBottom="10dp" | |
57 | + android:paddingTop="10dp" | |
58 | + android:text="取消" | |
59 | + android:textColor="@color/login_text_black" | |
60 | + android:textSize="18sp" /> | |
61 | + | |
62 | + <View | |
63 | + android:layout_width="0.5dp" | |
64 | + android:layout_height="match_parent" | |
65 | + android:layout_marginTop="5dp" | |
66 | + android:layout_marginBottom="5dp" | |
67 | + android:background="@color/line_bg" | |
68 | + android:orientation="horizontal" /> | |
69 | + | |
70 | + <Button | |
71 | + android:id="@+id/go_btn" | |
72 | + style="?android:attr/borderlessButtonStyle" | |
73 | + android:layout_width="match_parent" | |
74 | + android:layout_height="wrap_content" | |
75 | + android:layout_weight="1" | |
76 | + android:background="@drawable/white_cycle_bg" | |
77 | + android:gravity="center" | |
78 | + android:paddingBottom="10dp" | |
79 | + android:paddingTop="10dp" | |
80 | + android:text="继续" | |
81 | + android:textColor="@color/login_text_black" | |
82 | + android:textSize="18sp" /> | |
83 | + </LinearLayout> | |
84 | + </LinearLayout> | |
85 | + | |
86 | +</LinearLayout> | |
0 | 87 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/mipmap-hdpi/delete_btn.png
1.13 KB
PersonalCenter/app/src/main/res/mipmap-hdpi/public_qa_code.png
14.1 KB
PersonalCenter/app/src/main/res/mipmap-hdpi/start_btn_bg.png
7.02 KB
PersonalCenter/app/src/main/res/mipmap-xhdpi/main_bg.png
1.7 MB
PersonalCenter/app/src/main/res/mipmap-xhdpi/startpage.jpg
137 KB
PersonalCenter/app/src/main/res/mipmap-xhdpi/startpage.png
718 KB
PersonalCenter/app/src/main/res/mipmap-xhdpi/switch_btn.png
1.7 KB
PersonalCenter/app/src/main/res/values/colors.xml
... | ... | @@ -11,12 +11,14 @@ |
11 | 11 | <color name="error_hint">#ED1c24</color> |
12 | 12 | <color name="login_edittext_pressed">#1cb8ff</color> |
13 | 13 | <color name="cutoff_line">#CCCCCC</color> |
14 | + <color name="input_bg">#f4f1ec</color> | |
14 | 15 | <color name="electronic_card">#ff480f</color> |
15 | 16 | <color name="electronic_text">#afafaf</color> |
16 | 17 | <color name="backgerangde_laout">#eeeeee</color> |
17 | 18 | <color name="bgstudy_laout">#F0F0F0</color> |
18 | 19 | <color name="bgstudy_baoka">#0088c6</color> |
19 | - | |
20 | + <color name="main_bg">#441cb8ff</color> | |
21 | + <color name="line_bg">#d5d5d5</color> | |
20 | 22 | |
21 | 23 | |
22 | 24 | </resources> | ... | ... |
PersonalCenter/app/src/main/res/values/strings.xml
... | ... | @@ -10,8 +10,10 @@ |
10 | 10 | <string name="string_menu_title">忘记密码</string> |
11 | 11 | <string name="string_regist_info">填写注册信息</string> |
12 | 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_nickname">昵称</string> | |
14 | 15 | <string name="string_regist_region">地区</string> |
16 | + <string name="string_regist_address">家庭地址</string> | |
15 | 17 | <string name="string_regist_grade">年级</string> |
16 | 18 | <string name="string_regist_school">学校</string> |
17 | 19 | <string name="string_regist_next">下一步</string> |
... | ... | @@ -20,6 +22,7 @@ |
20 | 22 | <string name="finish">完成</string> |
21 | 23 | <string name="account_management">账户管理</string> |
22 | 24 | <string name="changge_preson">修改个人信息</string> |
25 | + <string name="static_str">15811111111</string> | |
23 | 26 | |
24 | 27 | //电子保卡 |
25 | 28 | <string name="string_electroniccard_info_title">填写保卡信息</string> |
... | ... | @@ -29,7 +32,7 @@ |
29 | 32 | <string name="string_electroniccard_info_ok">确认保卡信息</string> |
30 | 33 | <string name="string_electroniccard_info_look">好记星-电子保卡</string> |
31 | 34 | <string name="string_electroniccard_change_bangding">更换绑定</string> |
32 | - <string name="electronic_card">温馨提示:若您想修改的相关信息请拨打客服电话</string> | |
35 | + <string name="electronic_card">温馨提示:若您想修改相关信息请拨打客服电话</string> | |
33 | 36 | <string name="electronic_card1">请先填写《好记星-电子保卡》信息</string> |
34 | 37 | <string name="electronic_card2">该信息是本产品的三包证明,为维护您的合法权益,请认真填写</string> |
35 | 38 | <string name="electronic_card3">您已填写完《好记星-电子保卡》信息</string> | ... | ... |
PersonalCenter/app/src/main/res/values/styles.xml
... | ... | @@ -11,30 +11,34 @@ |
11 | 11 | <style name="login_register_edit_style"> |
12 | 12 | <item name="android:textSize">19sp</item> |
13 | 13 | <item name="android:singleLine">true</item> |
14 | - <item name="android:background">@drawable/selector_edittext_bg</item> | |
15 | - <item name="android:layout_width">match_parent</item> | |
14 | + <item name="android:background">@null</item> | |
15 | + <item name="android:layout_width">0dp</item> | |
16 | + <item name="android:layout_weight">1</item> | |
16 | 17 | <item name="android:layout_height">wrap_content</item> |
17 | 18 | <item name="android:textColorHint">@color/login_edittext_hint</item> |
18 | - <item name="android:padding">10dp</item> | |
19 | + <item name="android:paddingRight">30dp</item> | |
20 | + <item name="android:paddingTop">15dp</item> | |
21 | + <item name="android:paddingLeft">30dp</item> | |
22 | + <item name="android:paddingBottom">15dp</item> | |
19 | 23 | </style> |
20 | 24 | |
21 | 25 | <style name="login_register_edit_rect_style"> |
22 | 26 | <item name="android:textSize">19sp</item> |
23 | 27 | <item name="android:singleLine">true</item> |
24 | - <item name="android:background">@drawable/selector_edittext_rect_bg</item> | |
28 | + <item name="android:background">@null</item> | |
25 | 29 | <item name="android:layout_width">match_parent</item> |
26 | 30 | <item name="android:layout_height">wrap_content</item> |
27 | 31 | <item name="android:textColorHint">@color/login_edittext_hint</item> |
28 | 32 | <item name="android:paddingRight">10dp</item> |
29 | - <item name="android:paddingTop">10dp</item> | |
30 | - <item name="android:paddingLeft">10dp</item> | |
31 | - <item name="android:paddingBottom">12dp</item> | |
33 | + <item name="android:paddingTop">15dp</item> | |
34 | + <item name="android:paddingLeft">30dp</item> | |
35 | + <item name="android:paddingBottom">15dp</item> | |
32 | 36 | </style> |
33 | 37 | |
34 | 38 | <style name="login_register_btn_authcode_rect_style"> |
35 | 39 | <item name="android:textSize">19sp</item> |
36 | 40 | <item name="android:singleLine">true</item> |
37 | - <item name="android:background">@drawable/btn_rect_normal</item> | |
41 | + <item name="android:background">@drawable/code_bg</item> | |
38 | 42 | <item name="android:layout_width">match_parent</item> |
39 | 43 | <item name="android:layout_height">wrap_content</item> |
40 | 44 | <item name="android:textColorHint">@color/login_edittext_hint</item> |
... | ... | @@ -52,9 +56,9 @@ |
52 | 56 | <item name="android:layout_width">match_parent</item> |
53 | 57 | <item name="android:layout_height">wrap_content</item> |
54 | 58 | <item name="android:background">@drawable/selector_blue_btn_bg</item> |
55 | - <item name="android:textSize">23sp</item> | |
59 | + <item name="android:textSize">25sp</item> | |
56 | 60 | <item name="android:gravity">center</item> |
57 | - <item name="android:padding">10dp</item> | |
61 | + <item name="android:padding">12dp</item> | |
58 | 62 | <item name="android:textColor">@android:color/white</item> |
59 | 63 | </style> |
60 | 64 | <style name="text_forget_pwd_style" > |
... | ... | @@ -84,6 +88,17 @@ |
84 | 88 | <item name="android:windowExitAnimation">@anim/dialog_exit_anim</item> |
85 | 89 | </style> |
86 | 90 | |
91 | + <style name="CustomDialog" parent="@android:style/Theme.Dialog"> | |
92 | + <item name="android:windowFrame">@null</item> | |
93 | + <item name="android:windowIsFloating">true</item> | |
94 | + <item name="android:windowContentOverlay">@null</item> | |
95 | + <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> | |
96 | + <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> | |
97 | + </style> | |
98 | + <style name="CustomHintDialog" parent="@style/CustomDialog"> | |
99 | + <item name="android:windowBackground">@android:color/transparent</item> | |
100 | + <item name="android:windowNoTitle">true</item> | |
101 | + </style> | |
87 | 102 | |
88 | 103 | |
89 | 104 | ... | ... |
PersonalCenter/app/src/main/res/xml/rc_file_path.xml