Commit dcad913bbd96964a89d7662af53d198b97f0c575
1 parent
d9f4ba632f
Exists in
master
主界面的整理和完善
Showing
27 changed files
with
1033 additions
and
92 deletions
Show diff stats
PersonalCenter/app/build.gradle
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | 3 | import android.app.Activity; |
4 | +import android.content.Intent; | |
4 | 5 | import android.os.Bundle; |
6 | +import android.view.View; | |
7 | +import android.widget.TextView; | |
5 | 8 | |
6 | 9 | import com.hjx.personalcenter.R; |
10 | +import com.hjx.personalcenter.db.Content; | |
7 | 11 | |
8 | 12 | /**账户管理 熊巍 |
9 | 13 | * Created by h on 2017/8/12. |
10 | 14 | */ |
11 | 15 | |
12 | -public class AccountManagementActivity extends Activity { | |
16 | +public class AccountManagementActivity extends Activity implements View.OnClickListener { | |
17 | + private TextView changbangding,changpassword; | |
13 | 18 | @Override |
14 | 19 | protected void onCreate(Bundle savedInstanceState) { |
15 | 20 | super.onCreate(savedInstanceState); |
16 | 21 | setContentView(R.layout.activity_account_management); |
22 | + initView(); | |
23 | + initData(); | |
24 | + initLister(); | |
25 | + } | |
26 | + | |
27 | + private void initView() { | |
28 | + changbangding = (TextView) findViewById(R.id.changBangding); | |
29 | + changpassword = (TextView) findViewById(R.id.changpassword); | |
30 | + } | |
31 | + | |
32 | + private void initData() { | |
33 | + | |
34 | + } | |
35 | + | |
36 | + private void initLister() { | |
37 | + changbangding.setOnClickListener(this); | |
38 | + changpassword.setOnClickListener(this); | |
39 | + | |
40 | + | |
41 | + } | |
42 | + | |
43 | + @Override | |
44 | + public void onClick(View v) { | |
45 | + switch (v.getId()){ | |
46 | + case R.id.changBangding: | |
47 | + Intent changebangding = new Intent(); | |
48 | + changebangding.setClass(AccountManagementActivity.this,ChangeBangDingActivity.class); | |
49 | + startActivity(changebangding); | |
50 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
51 | + break; | |
52 | + case R.id.changpassword: | |
53 | + Content.authcodeflag = 1; | |
54 | + Intent changpwd = new Intent(); | |
55 | + changpwd.setClass(AccountManagementActivity.this,ChangePasswordActivity.class); | |
56 | + startActivity(changpwd); | |
57 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
58 | + break; | |
59 | + } | |
60 | + | |
17 | 61 | } |
18 | 62 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java
... | ... | @@ -2,17 +2,159 @@ package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | 3 | import android.app.Activity; |
4 | 4 | import android.os.Bundle; |
5 | +import android.os.Handler; | |
6 | +import android.os.Message; | |
7 | +import android.text.TextUtils; | |
8 | +import android.view.View; | |
9 | +import android.widget.Button; | |
10 | +import android.widget.EditText; | |
11 | +import android.widget.ImageView; | |
5 | 12 | |
6 | 13 | import com.hjx.personalcenter.R; |
14 | +import com.hjx.personalcenter.http.HttpCode; | |
15 | +import com.hjx.personalcenter.http.HttpManager; | |
16 | +import com.hjx.personalcenter.util.AlertUtils; | |
17 | +import com.hjx.personalcenter.util.Judgment; | |
18 | +import com.hjx.personalcenter.util.PhoneNumCheckUtils; | |
19 | + | |
20 | +import org.json.JSONObject; | |
7 | 21 | |
8 | 22 | /** |
9 | 23 | * Created by h on 2017/8/9. |
10 | 24 | */ |
11 | 25 | |
12 | -public class ChangeElectronicCardAdressInfoActivity extends Activity{ | |
26 | +public class ChangeElectronicCardAdressInfoActivity extends Activity implements View.OnClickListener{ | |
27 | + private ImageView back_forgit; | |
28 | + private EditText forot_pwd_phone,forot_pwd_anthcode,adress,newadress; | |
29 | + private Button forot_pwd_sub,forot_pwd_getanthcode; | |
30 | + private String typeStr = "register"; | |
31 | + private int i = 0; | |
32 | + private Thread thread; | |
33 | + Handler handler = new Handler() { | |
34 | + @Override | |
35 | + public void handleMessage(Message msg) { | |
36 | + super.handleMessage(msg); | |
37 | + JSONObject jsonObject; | |
38 | + String status; | |
39 | + switch (msg.what) { | |
40 | + case HttpCode.AUTHCODE_SUCESS1: | |
41 | + jsonObject = (JSONObject) msg.obj; | |
42 | + status = jsonObject.optString("status"); | |
43 | + if (status.equals("100")) { | |
44 | + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "验证码发送成功"); | |
45 | + } | |
46 | + //AlertUtils.showToast(ForgotPassword.this, jsonObject.optString("message")); | |
47 | + break; | |
48 | + case HttpCode.AUTHCODE_FAIL1: | |
49 | + jsonObject = (JSONObject) msg.obj; | |
50 | + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, jsonObject.optString("验证码发送失败,请检查网络")); | |
51 | + break; | |
52 | + case 1: | |
53 | + forot_pwd_getanthcode.setEnabled(false); | |
54 | + forot_pwd_getanthcode.setClickable(false); | |
55 | + forot_pwd_getanthcode.setText(Integer.toString(i--)+" s"); | |
56 | + if (i<=0){ | |
57 | + forot_pwd_getanthcode.setEnabled(true); | |
58 | + forot_pwd_getanthcode.setClickable(true); | |
59 | + forot_pwd_getanthcode.setText("获取验证码"); | |
60 | + | |
61 | + } | |
62 | + break; | |
63 | + } | |
64 | + } | |
65 | + }; | |
13 | 66 | @Override |
14 | 67 | protected void onCreate(Bundle savedInstanceState) { |
15 | 68 | super.onCreate(savedInstanceState); |
16 | 69 | setContentView(R.layout.activity_change_card_validation); |
70 | + initView(); | |
71 | + setLister(); | |
72 | + } | |
73 | + //获取验证码 | |
74 | + private void getauthcode() { | |
75 | + forot_pwd_anthcode.requestFocus(); | |
76 | + String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); | |
77 | + HttpManager.getInstance().authCode(typeStr, forot_pwd_phone1, handler, this); | |
78 | + i = 60; | |
79 | + if(thread == null){ | |
80 | + thread = new Thread( new ThreadShow()); | |
81 | + thread.start(); | |
82 | + } | |
83 | + | |
84 | + } | |
85 | + private void initView() { | |
86 | + forot_pwd_phone = (EditText) findViewById(R.id.et_phonenumber); | |
87 | + forot_pwd_anthcode = (EditText) findViewById(R.id.et_authcode); | |
88 | + adress = (EditText) findViewById(R.id.et_newpassword); | |
89 | + newadress = (EditText) findViewById(R.id.et_again_newpassword); | |
90 | + forot_pwd_sub = (Button) findViewById(R.id.btn_ok); | |
91 | + forot_pwd_getanthcode = (Button) findViewById(R.id.btn_authcode); | |
92 | + back_forgit= (ImageView) findViewById(R.id.cancel); | |
17 | 93 | } |
94 | + private void setLister() { | |
95 | + back_forgit.setOnClickListener(this); | |
96 | + forot_pwd_sub.setOnClickListener(this); | |
97 | + forot_pwd_getanthcode.setOnClickListener(this); | |
98 | + | |
99 | + } | |
100 | + | |
101 | + @Override | |
102 | + public void onClick(View view) { | |
103 | + switch (view.getId()){ | |
104 | + case R.id.btn_ok: | |
105 | + String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); | |
106 | + String forot_pwd_anthcode1 = forot_pwd_anthcode.getText().toString().trim(); | |
107 | + String forot_pwd_pwd3 = adress.getText().toString().trim(); | |
108 | + String forot_pwd_pwd4 = newadress.getText().toString().trim(); | |
109 | + if (TextUtils.isEmpty(forot_pwd_phone1)|| | |
110 | + TextUtils.isEmpty(forot_pwd_pwd3) || TextUtils.isEmpty(forot_pwd_pwd4)){ | |
111 | + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请将必填项填写完整"); | |
112 | + return; | |
113 | + }else if (Judgment.getInstance().isPhoneNum(forot_pwd_phone1)){ | |
114 | + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "手机号码输入有误"); | |
115 | + | |
116 | + } else { | |
117 | + //修改地址接口 | |
118 | + HttpManager.getInstance().changecardadressinfo(this,111,forot_pwd_phone1,forot_pwd_anthcode1,forot_pwd_pwd3+forot_pwd_pwd4); | |
119 | + } | |
120 | + break; | |
121 | + case R.id.btn_authcode: | |
122 | + forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); | |
123 | + if (!PhoneNumCheckUtils.isPhone(forot_pwd_phone1)){ | |
124 | + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请输入正确的手机号"); | |
125 | + }else { | |
126 | + forot_pwd_anthcode.requestFocus(); | |
127 | + getauthcode(); | |
128 | + | |
129 | + } | |
130 | + | |
131 | + break; | |
132 | + | |
133 | + case R.id.cancel: | |
134 | + finish(); | |
135 | + break; | |
136 | + } | |
137 | + } | |
138 | + // 线程类 定时器 | |
139 | + class ThreadShow implements Runnable { | |
140 | + | |
141 | + @Override | |
142 | + public void run() { | |
143 | + // TODO Auto-generated method stub | |
144 | + while (true) { | |
145 | + try { | |
146 | + Thread.sleep(1000); | |
147 | + Message msg = new Message(); | |
148 | + msg.what = 1; | |
149 | + handler.sendMessage(msg); | |
150 | + System.out.println("send..."); | |
151 | + } catch (Exception e) { | |
152 | + // TODO Auto-generated catch block | |
153 | + e.printStackTrace(); | |
154 | + System.out.println("thread error..."); | |
155 | + } | |
156 | + } | |
157 | + } | |
158 | + } | |
159 | + | |
18 | 160 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java
... | ... | @@ -23,7 +23,7 @@ import com.hjx.personalcenter.db.SaveParam; |
23 | 23 | public class ChangePasswordActivity extends Activity implements View.OnClickListener { |
24 | 24 | private EditText old_pwd,newpassword,newpassword1; |
25 | 25 | private Button sub_change_pwd; |
26 | - private ImageView back_change_pwd,eyes_iv_change1,eyes_iv_change2; | |
26 | + private ImageView back_change_pwd,eyes_iv_change1; | |
27 | 27 | public static Boolean showPassword = false; |
28 | 28 | @Override |
29 | 29 | protected void onCreate(Bundle savedInstanceState) { |
... | ... | @@ -48,7 +48,6 @@ public class ChangePasswordActivity extends Activity implements View.OnClickList |
48 | 48 | sub_change_pwd.setOnClickListener(this); |
49 | 49 | back_change_pwd.setOnClickListener(this); |
50 | 50 | eyes_iv_change1.setOnClickListener(this); |
51 | - eyes_iv_change2.setOnClickListener(this); | |
52 | 51 | } |
53 | 52 | |
54 | 53 | @Override | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java
... | ... | @@ -14,6 +14,7 @@ import com.hjx.personalcenter.db.Content; |
14 | 14 | import com.hjx.personalcenter.db.SaveParam; |
15 | 15 | import com.hjx.personalcenter.http.HttpCode; |
16 | 16 | import com.hjx.personalcenter.http.HttpManager; |
17 | +import com.hjx.personalcenter.model.CardInfo; | |
17 | 18 | import com.hjx.personalcenter.util.AlertUtils; |
18 | 19 | import com.hjx.personalcenter.util.GetDevicesUtil; |
19 | 20 | |
... | ... | @@ -36,12 +37,16 @@ public class ElectronicCardLookInfoActivity extends AppCompatActivity implements |
36 | 37 | JSONObject jsonObject; |
37 | 38 | String status; |
38 | 39 | switch (msg.what){ |
40 | + | |
39 | 41 | case HttpCode.SUCHCARDINFO: |
42 | + CardInfo cardInfo = new CardInfo(); | |
40 | 43 | try { |
41 | 44 | jsonObject = new JSONObject( (String) msg.obj); |
42 | 45 | status = jsonObject.optString("status"); |
43 | 46 | if (status.equals("1")){ |
44 | 47 | AlertUtils.showToast(ElectronicCardLookInfoActivity.this,"显示电子保卡信息"); |
48 | + cardInfo.setCustomerName(jsonObject.optString("customerName")); | |
49 | + | |
45 | 50 | }else { |
46 | 51 | AlertUtils.showToast(ElectronicCardLookInfoActivity.this,"保卡信息查询失败"); |
47 | 52 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java
... | ... | @@ -85,16 +85,16 @@ public class ElectronicCardValidationActivity extends Activity implements View.O |
85 | 85 | |
86 | 86 | private void initData() { |
87 | 87 | if (Content.authcodeflag==1){ |
88 | - menu_title.setText("填写保卡信息"); | |
89 | - btn_card_valiyanzhen.setText("下一步"); | |
88 | + menu_title.setText("更换绑定"); | |
89 | + btn_card_valiyanzhen.setText("确定"); | |
90 | 90 | |
91 | 91 | }else if (Content.authcodeflag==2){ |
92 | 92 | menu_title.setText("修改保卡信息"); |
93 | 93 | btn_card_valiyanzhen.setText("确定"); |
94 | 94 | |
95 | 95 | }else { |
96 | - menu_title.setText("更换绑定"); | |
97 | - btn_card_valiyanzhen.setText("确定"); | |
96 | + menu_title.setText("填写保卡信息"); | |
97 | + btn_card_valiyanzhen.setText("下一步"); | |
98 | 98 | } |
99 | 99 | |
100 | 100 | |
... | ... | @@ -124,19 +124,21 @@ public class ElectronicCardValidationActivity extends Activity implements View.O |
124 | 124 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "您输入的验证码不正确"); |
125 | 125 | }else { |
126 | 126 | if (Content.authcodeflag==1){ |
127 | - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); | |
128 | - Intent intent = new Intent(); | |
129 | - intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | |
130 | - startActivity(intent); | |
131 | - overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
127 | + //修改账户手机号 | |
128 | + HttpManager.getInstance().changecardinfophone(this, | |
129 | + 736,usernameStr,authcodeStr); | |
130 | + | |
132 | 131 | |
133 | 132 | }else if (Content.authcodeflag==2){ |
134 | 133 | //修改保卡手机号 |
135 | 134 | HttpManager.getInstance().changecardinfophone(this, |
136 | 135 | 736,usernameStr,authcodeStr); |
137 | 136 | }else { |
138 | - //修改手机号 | |
139 | - menu_title.setText("更换绑定"); | |
137 | + SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); | |
138 | + Intent intent = new Intent(); | |
139 | + intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | |
140 | + startActivity(intent); | |
141 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
140 | 142 | } |
141 | 143 | // SaveParam.getInstance().saveLoginParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); |
142 | 144 | // Intent intent = new Intent(); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | +import android.content.Context; | |
3 | 4 | import android.content.Intent; |
4 | 5 | import android.os.Bundle; |
5 | 6 | import android.support.v7.app.AppCompatActivity; |
7 | +import android.view.LayoutInflater; | |
6 | 8 | import android.view.View; |
9 | +import android.view.ViewGroup; | |
7 | 10 | import android.widget.ImageView; |
11 | +import android.widget.LinearLayout; | |
8 | 12 | import android.widget.TextView; |
9 | 13 | |
10 | 14 | import com.hjx.personalcenter.R; |
15 | +import com.hjx.personalcenter.customdialog.HeadDialog; | |
16 | +import com.hjx.personalcenter.interfaces.DialogCallBack; | |
17 | +import com.hjx.personalcenter.util.AlertUtils; | |
11 | 18 | import com.mylhyl.circledialog.CircleDialog; |
12 | 19 | import com.mylhyl.circledialog.callback.ConfigInput; |
13 | 20 | import com.mylhyl.circledialog.params.InputParams; |
14 | 21 | import com.mylhyl.circledialog.view.listener.OnInputClickListener; |
22 | +import com.zaaach.toprightmenu.MenuItem; | |
23 | +import com.zaaach.toprightmenu.TopRightMenu; | |
24 | + | |
25 | +import java.util.ArrayList; | |
26 | +import java.util.List; | |
27 | + | |
28 | +public class MainActivity extends AppCompatActivity implements View.OnClickListener, DialogCallBack.CallBackView { | |
29 | + private ImageView iv_imformatioan, iv_look_card, iv_setting, iv_sign, iv_head, iv_sex; | |
30 | + private TextView tv_edit_presoninfo, tv_sign, oktakephone, cancetakephone, | |
31 | + tv_username, tv_username1, tv_mygad, tv_sex, tv_useinfo_adress, tv_useinfo_birthday, | |
32 | + tv_useinfo_qq, tv_useinfo_school, tv_useinfo_gender; | |
33 | + private LinearLayout linel_mycuoti, linel_mynote, linel_mycollege, linel_myclass; | |
34 | + private TopRightMenu mTopRightMenu; | |
35 | + private boolean showIcon = true; | |
36 | + private boolean dimBg = true; | |
37 | + private boolean needAnim = true; | |
15 | 38 | |
16 | -public class MainActivity extends AppCompatActivity implements View.OnClickListener { | |
17 | - private ImageView iv_imformatioan,iv_look_card,iv_setting,iv_sign; | |
18 | - private TextView tv_edit_presoninfo,tv_sign; | |
19 | 39 | @Override |
20 | 40 | protected void onCreate(Bundle savedInstanceState) { |
21 | 41 | super.onCreate(savedInstanceState); |
... | ... | @@ -32,9 +52,29 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
32 | 52 | iv_setting = (ImageView) findViewById(R.id.iv_setting); |
33 | 53 | iv_sign = (ImageView) findViewById(R.id.iv_sign); |
34 | 54 | tv_sign = (TextView) findViewById(R.id.tv_sign); |
55 | + //头像 | |
56 | + iv_head = (ImageView) findViewById(R.id.iv_head); | |
57 | + //初始化个人信息 | |
58 | + iv_sex = (ImageView) findViewById(R.id.iv_sex); | |
59 | + tv_username = (TextView) findViewById(R.id.tv_username); | |
60 | + tv_username1 = (TextView) findViewById(R.id.tv_username1); | |
61 | + tv_mygad = (TextView) findViewById(R.id.tv_mygad); | |
62 | + tv_sex = (TextView) findViewById(R.id.tv_sex); | |
63 | + tv_useinfo_adress = (TextView) findViewById(R.id.tv_useinfo_adress); | |
64 | + tv_useinfo_birthday = (TextView) findViewById(R.id.tv_useinfo_birthday); | |
65 | + tv_useinfo_qq = (TextView) findViewById(R.id.tv_useinfo_qq); | |
66 | + tv_useinfo_school = (TextView) findViewById(R.id.tv_useinfo_school); | |
67 | + tv_useinfo_gender = (TextView) findViewById(R.id.tv_useinfo_gender); | |
68 | + //跳转其他应用 | |
69 | + linel_mycuoti = (LinearLayout) findViewById(R.id.linel_mycuoti); | |
70 | + linel_mynote = (LinearLayout) findViewById(R.id.linel_mynote); | |
71 | + linel_mycollege = (LinearLayout) findViewById(R.id.linel_mycollege); | |
72 | + linel_myclass = (LinearLayout) findViewById(R.id.linel_myclass); | |
73 | + | |
35 | 74 | } |
36 | 75 | |
37 | 76 | private void initData() { |
77 | + //加载个人信息 | |
38 | 78 | |
39 | 79 | } |
40 | 80 | |
... | ... | @@ -44,35 +84,72 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
44 | 84 | tv_edit_presoninfo.setOnClickListener(this); |
45 | 85 | iv_setting.setOnClickListener(this); |
46 | 86 | iv_sign.setOnClickListener(this); |
87 | + iv_head.setOnClickListener(this); | |
88 | + linel_mycuoti.setOnClickListener(this); | |
89 | + linel_mynote.setOnClickListener(this); | |
90 | + linel_mycollege.setOnClickListener(this); | |
91 | + linel_myclass.setOnClickListener(this); | |
47 | 92 | |
48 | 93 | } |
49 | 94 | |
50 | 95 | @Override |
51 | 96 | public void onClick(View v) { |
52 | - switch (v.getId()){ | |
97 | + switch (v.getId()) { | |
53 | 98 | case R.id.iv_imformatioan: |
54 | 99 | Intent intent = new Intent(); |
55 | - intent.setClass(MainActivity.this,FeedBackActivity.class); | |
100 | + intent.setClass(MainActivity.this, FeedBackActivity.class); | |
56 | 101 | startActivity(intent); |
57 | 102 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
58 | 103 | break; |
59 | 104 | case R.id.iv_look_card: |
60 | 105 | Intent lookintent = new Intent(); |
61 | - lookintent.setClass(MainActivity.this,ElectronicCardLookInfoActivity.class); | |
106 | + lookintent.setClass(MainActivity.this, ElectronicCardLookInfoActivity.class); | |
62 | 107 | startActivity(lookintent); |
63 | 108 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
64 | 109 | break; |
65 | 110 | case R.id.tv_edit_presoninfo: |
66 | 111 | Intent editintent = new Intent(); |
67 | - editintent.setClass(MainActivity.this,ChangePresonalInfoActivity.class); | |
112 | + editintent.setClass(MainActivity.this, ChangePresonalInfoActivity.class); | |
68 | 113 | startActivity(editintent); |
69 | 114 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
70 | 115 | break; |
116 | + case R.id.iv_head: | |
117 | + HeadDialog.getInstance(this).show(getSupportFragmentManager(), "HeadDialog"); | |
118 | + break; | |
71 | 119 | case R.id.iv_setting: |
72 | - Intent settingintent = new Intent(); | |
73 | - settingintent.setClass(MainActivity.this,LoginAndRegisterActivity.class); | |
74 | - startActivity(settingintent); | |
75 | - overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
120 | + mTopRightMenu = new TopRightMenu(MainActivity.this); | |
121 | + List<MenuItem> menuItems = new ArrayList<>(); | |
122 | + menuItems.add(new MenuItem(R.mipmap.blank, "切换账户")); | |
123 | + menuItems.add(new MenuItem(R.mipmap.blank, "账户管理")); | |
124 | + mTopRightMenu | |
125 | + .setHeight(150) //默认高度480 | |
126 | + .setWidth(320) //默认宽度wrap_content | |
127 | + .showIcon(showIcon) //显示菜单图标,默认为true | |
128 | + .dimBackground(dimBg) //背景变暗,默认为true | |
129 | + .needAnimationStyle(needAnim) //显示动画,默认为true | |
130 | + .setAnimationStyle(R.style.TRM_ANIM_STYLE) //默认为R.style.TRM_ANIM_STYLE | |
131 | + .setOnMenuItemClickListener(new TopRightMenu.OnMenuItemClickListener() { | |
132 | + @Override | |
133 | + public void onMenuItemClick(int position) { | |
134 | + switch (position) { | |
135 | + case 0: | |
136 | + //清除数据 | |
137 | + Intent settingintent = new Intent(); | |
138 | + settingintent.setClass(MainActivity.this, LoginAndRegisterActivity.class); | |
139 | + startActivity(settingintent); | |
140 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
141 | + break; | |
142 | + case 1: | |
143 | + Intent accontMintent = new Intent(); | |
144 | + accontMintent.setClass(MainActivity.this, AccountManagementActivity.class); | |
145 | + startActivity(accontMintent); | |
146 | + overridePendingTransition(R.anim.rightin, R.anim.rightout); | |
147 | + break; | |
148 | + } | |
149 | + } | |
150 | + }) | |
151 | + .addMenuList(menuItems) | |
152 | + .showAsDropDown(iv_setting, -250, 0); | |
76 | 153 | break; |
77 | 154 | case R.id.iv_sign: |
78 | 155 | new CircleDialog.Builder(this) |
... | ... | @@ -91,13 +168,46 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
91 | 168 | .setPositiveInput("确定", new OnInputClickListener() { |
92 | 169 | @Override |
93 | 170 | public void onClick(String text, View v) { |
94 | - tv_sign.setText(text); | |
171 | + if (text.equals("")) { | |
172 | + AlertUtils.showToast(MainActivity.this, "请输入个性签名"); | |
173 | + } else { | |
174 | + tv_sign.setText(text); | |
175 | + } | |
176 | + | |
95 | 177 | } |
96 | 178 | }) |
97 | 179 | .show(); |
98 | 180 | break; |
181 | + case R.id.linel_mycuoti: | |
182 | + AlertUtils.showToast(this, "hhahahah "); | |
183 | + break; | |
184 | + case R.id.linel_mynote: | |
185 | + AlertUtils.showToast(this, "hhahahah "); | |
186 | + break; | |
187 | + case R.id.linel_mycollege: | |
188 | + AlertUtils.showToast(this, "hhahahah "); | |
189 | + break; | |
190 | + case R.id.linel_myclass: | |
191 | + AlertUtils.showToast(this, "hhahahah "); | |
192 | + break; | |
193 | + case R.id.oktakephone: | |
194 | + AlertUtils.showToast(this, "hhahahah "); | |
195 | + break; | |
196 | + case R.id.canceltakephone: | |
197 | + AlertUtils.showToast(this, "hhahahah "); | |
198 | + break; | |
99 | 199 | |
100 | 200 | } |
101 | 201 | |
102 | 202 | } |
203 | + | |
204 | + @Override | |
205 | + public void provinceOnItemClick(Context context, LayoutInflater inflater, ViewGroup container) { | |
206 | + View mView = inflater.inflate(R.layout.custom_adilog_lhead, container, false); | |
207 | + oktakephone = (TextView) mView.findViewById(R.id.oktakephone); | |
208 | + cancetakephone = (TextView) mView.findViewById(R.id.canceltakephone); | |
209 | + oktakephone.setOnClickListener(this); | |
210 | + cancetakephone.setOnClickListener(this); | |
211 | + | |
212 | + } | |
103 | 213 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java
... | ... | @@ -82,6 +82,8 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
82 | 82 | private void choiseregion() { |
83 | 83 | HttpManager.getInstance().provices(RegisterInfoActivity.this); |
84 | 84 | ProvinceListDialog.getInstance(this).show(getSupportFragmentManager(), "ProvinceListDialog"); |
85 | +// HttpManager.getInstance().cityinfo(RegisterInfoActivity.this,111); | |
86 | +// CitysListDialog.getInstance(this).show(getSupportFragmentManager(), "CitysListDialog"); | |
85 | 87 | |
86 | 88 | } |
87 | 89 | //选择年级 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/CitysListDialog.java
... | ... | @@ -30,8 +30,11 @@ public class CitysListDialog extends BaseCircleDialog implements AdapterView.OnI |
30 | 30 | private ListView listView; |
31 | 31 | private DialogCallBack.CallBack mCallBack; |
32 | 32 | private ArrayList<CityInfo.CitiesBean> data = new ArrayList<>(); |
33 | - public static CitysListDialog getInstance() { | |
34 | - CitysListDialog dialogFragment = new CitysListDialog(); | |
33 | + public CitysListDialog(DialogCallBack.CallBack callBack) { | |
34 | + this.mCallBack = callBack; | |
35 | + } | |
36 | + public static CitysListDialog getInstance(DialogCallBack.CallBack callBack) { | |
37 | + CitysListDialog dialogFragment = new CitysListDialog(callBack); | |
35 | 38 | dialogFragment.setCanceledBack(true); |
36 | 39 | dialogFragment.setCanceledOnTouchOutside(true); |
37 | 40 | dialogFragment.setRadius(CircleDimen.RADIUS); |
... | ... | @@ -71,12 +74,7 @@ public class CitysListDialog extends BaseCircleDialog implements AdapterView.OnI |
71 | 74 | |
72 | 75 | @Override |
73 | 76 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { |
74 | - //Toast.makeText(getActivity(), "你点击了第" + position + "个", Toast.LENGTH_LONG).show(); | |
75 | - switch (position){ | |
76 | - | |
77 | - | |
78 | - | |
79 | - } | |
77 | + mCallBack.provinceOnItemClick(parent,view,position,id); | |
80 | 78 | |
81 | 79 | |
82 | 80 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java
... | ... | @@ -11,7 +11,6 @@ import android.view.ViewGroup; |
11 | 11 | |
12 | 12 | import com.hjx.personalcenter.R; |
13 | 13 | import com.hjx.personalcenter.activity.ElectronicCardValidationActivity; |
14 | -import com.hjx.personalcenter.db.Content; | |
15 | 14 | import com.mylhyl.circledialog.BaseCircleDialog; |
16 | 15 | import com.mylhyl.circledialog.res.values.CircleDimen; |
17 | 16 | |
... | ... | @@ -45,11 +44,11 @@ public class ElectronicCardDialog extends BaseCircleDialog { |
45 | 44 | // intent.setClass(getActivity(),TheStartPageActivity.class); |
46 | 45 | // startActivity(intent); |
47 | 46 | // getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
48 | - Content.authcodeflag =1; | |
49 | 47 | Intent intent = new Intent(); |
50 | 48 | intent.setClass(getActivity(),ElectronicCardValidationActivity.class); |
51 | 49 | startActivity(intent); |
52 | 50 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
51 | + getActivity().finish(); | |
53 | 52 | |
54 | 53 | } |
55 | 54 | }); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/HeadDialog.java
... | ... | @@ -0,0 +1,46 @@ |
1 | +package com.hjx.personalcenter.customdialog; | |
2 | + | |
3 | +import android.content.Context; | |
4 | +import android.graphics.Color; | |
5 | +import android.view.Gravity; | |
6 | +import android.view.LayoutInflater; | |
7 | +import android.view.View; | |
8 | +import android.view.ViewGroup; | |
9 | + | |
10 | +import com.hjx.personalcenter.R; | |
11 | +import com.hjx.personalcenter.interfaces.DialogCallBack; | |
12 | +import com.mylhyl.circledialog.BaseCircleDialog; | |
13 | +import com.mylhyl.circledialog.res.values.CircleDimen; | |
14 | + | |
15 | +/** | |
16 | + * Created by h on 2017/8/20. | |
17 | + */ | |
18 | + | |
19 | +public class HeadDialog extends BaseCircleDialog { | |
20 | + private View mView; | |
21 | + private DialogCallBack.CallBackView mCallBack; | |
22 | + | |
23 | + public HeadDialog(DialogCallBack.CallBackView callBack) { | |
24 | + this.mCallBack = callBack; | |
25 | + } | |
26 | + public static HeadDialog getInstance(DialogCallBack.CallBackView callBackview) { | |
27 | + HeadDialog dialogFragment = new HeadDialog(callBackview); | |
28 | + dialogFragment.setCanceledBack(true); | |
29 | + dialogFragment.setCanceledOnTouchOutside(true); | |
30 | + dialogFragment.setRadius(CircleDimen.RADIUS); | |
31 | + dialogFragment.setWidth(0.4f); | |
32 | + dialogFragment.setGravity(Gravity.CENTER); | |
33 | + dialogFragment.setBackgroundColor(Color.WHITE); | |
34 | + return dialogFragment; | |
35 | + } | |
36 | + | |
37 | + @Override | |
38 | + public View createView(Context context, LayoutInflater inflater, ViewGroup container) { | |
39 | + | |
40 | + if (mView == null) { | |
41 | + mView = inflater.inflate(R.layout.custom_adilog_lhead, container, false); | |
42 | + mCallBack.provinceOnItemClick(context,inflater,container); | |
43 | + } | |
44 | + return mView; | |
45 | + } | |
46 | +} | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java
1 | 1 | package com.hjx.personalcenter.fragment; |
2 | 2 | |
3 | +import android.graphics.Color; | |
3 | 4 | import android.os.Bundle; |
4 | 5 | import android.support.annotation.Nullable; |
5 | 6 | import android.support.v4.app.Fragment; |
6 | 7 | import android.view.LayoutInflater; |
7 | 8 | import android.view.View; |
8 | 9 | import android.view.ViewGroup; |
10 | +import android.widget.EditText; | |
11 | +import android.widget.TextView; | |
9 | 12 | |
13 | +import com.bigkoo.pickerview.TimePickerView; | |
10 | 14 | import com.hjx.personalcenter.R; |
15 | +import com.hjx.personalcenter.util.AlertUtils; | |
16 | + | |
17 | +import java.text.SimpleDateFormat; | |
18 | +import java.util.Date; | |
11 | 19 | |
12 | 20 | /** |
13 | 21 | * Created by h on 2017/8/12. |
14 | 22 | */ |
15 | 23 | |
16 | -public class PresonInfoFragment extends Fragment { | |
24 | +public class PresonInfoFragment extends Fragment implements View.OnClickListener { | |
17 | 25 | private View mView; |
18 | 26 | private int type; |
27 | + private TimePickerView pvTime; | |
28 | + private EditText tv_username1,tv_useinfo_adress1,tv_useinfo_qq; | |
29 | + private TextView tv_sex, tv_useinfo_adress, tv_useinfo_birthday, tv_useinfo_school, tv_useinfo_gender; | |
19 | 30 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; |
20 | 31 | |
21 | 32 | public static PresonInfoFragment newInstance(int type) { |
... | ... | @@ -33,6 +44,7 @@ public class PresonInfoFragment extends Fragment { |
33 | 44 | initView(mView); |
34 | 45 | initData(); |
35 | 46 | setLister(); |
47 | + initTimePicker(); | |
36 | 48 | |
37 | 49 | |
38 | 50 | } |
... | ... | @@ -40,11 +52,87 @@ public class PresonInfoFragment extends Fragment { |
40 | 52 | } |
41 | 53 | //初始化 |
42 | 54 | private void initView(View mView) { |
55 | + tv_username1 = (EditText) mView.findViewById(R.id.tv_username1); | |
56 | + tv_useinfo_adress1 = (EditText) mView.findViewById(R.id.tv_useinfo_adress1); | |
57 | + tv_useinfo_qq = (EditText) mView.findViewById(R.id.tv_useinfo_qq); | |
58 | + tv_sex = (TextView) mView.findViewById(R.id.tv_sex); | |
59 | + tv_useinfo_adress = (TextView) mView.findViewById(R.id.tv_useinfo_adress); | |
60 | + tv_useinfo_birthday = (TextView) mView.findViewById(R.id.tv_useinfo_birthday); | |
61 | + tv_useinfo_school = (TextView) mView.findViewById(R.id.tv_useinfo_school); | |
62 | + tv_useinfo_gender = (TextView) mView.findViewById(R.id.tv_useinfo_gender); | |
63 | + | |
64 | + | |
43 | 65 | |
44 | 66 | } |
45 | 67 | private void initData() { |
46 | 68 | } |
47 | 69 | private void setLister() { |
70 | + tv_sex.setOnClickListener(this); | |
71 | + tv_useinfo_adress.setOnClickListener(this); | |
72 | + tv_useinfo_birthday.setOnClickListener(this); | |
73 | + tv_useinfo_school.setOnClickListener(this); | |
74 | + tv_useinfo_gender.setOnClickListener(this); | |
48 | 75 | } |
49 | 76 | |
77 | + @Override | |
78 | + public void onClick(View v) { | |
79 | + switch (v.getId()){ | |
80 | + case R.id.tv_sex: | |
81 | + AlertUtils.showToast(getActivity(),"正在开发"); | |
82 | + break; | |
83 | + case R.id.tv_useinfo_adress: | |
84 | + AlertUtils.showToast(getActivity(),"正在开发"); | |
85 | + break; | |
86 | + case R.id.tv_useinfo_birthday: | |
87 | + pvTime.show(tv_useinfo_birthday);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view | |
88 | + break; | |
89 | + case R.id.tv_useinfo_school: | |
90 | + AlertUtils.showToast(getActivity(),"正在开发"); | |
91 | + break; | |
92 | + case R.id.tv_useinfo_gender: | |
93 | + AlertUtils.showToast(getActivity(),"正在开发"); | |
94 | + break; | |
95 | + } | |
96 | + } | |
97 | + //自定义时间选择器 | |
98 | + private void initTimePicker() { | |
99 | + //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) | |
100 | + //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 | |
101 | +// Calendar selectedDate = Calendar.getInstance(); | |
102 | +// Calendar startDate = Calendar.getInstance(); | |
103 | +// startDate.set(1900, 1, 1); | |
104 | +// Calendar endDate = Calendar.getInstance(); | |
105 | +// endDate.set(2100, 1, 1); | |
106 | + //时间选择器 | |
107 | + pvTime = new TimePickerView.Builder(getActivity(), new TimePickerView.OnTimeSelectListener() { | |
108 | + @Override | |
109 | + public void onTimeSelect(Date date, View v) {//选中事件回调 | |
110 | + // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null | |
111 | + /*btn_Time.setText(getTime(date));*/ | |
112 | + TextView btn = (TextView) v; | |
113 | + btn.setText(getTime(date)); | |
114 | + } | |
115 | + }) | |
116 | + //年月日时分秒 的显示与否,不设置则默认全部显示 | |
117 | + .setType(new boolean[]{true, true, true, false, false, false}) | |
118 | + .setLabel("", "", "", "", "", "") | |
119 | + .isCenterLabel(false) | |
120 | + .setDividerColor(Color.DKGRAY) | |
121 | + .setContentSize(21) | |
122 | +// .setDate(selectedDate) | |
123 | +// .setRangDate(startDate, endDate) | |
124 | + .setBackgroundId(0x80000000) //设置外部遮罩颜色 | |
125 | + .setDecorView(null) | |
126 | + .setTitleText("购买日期") | |
127 | + .setTitleSize(22) | |
128 | + .setCancelColor(Color.GRAY) | |
129 | + .setSubCalSize(22) | |
130 | + .setDividerColor(Color.GRAY) | |
131 | + .setSubmitColor(Color.GRAY) | |
132 | + .build(); | |
133 | + } | |
134 | + private String getTime(Date date) {//可根据需要自行截取数据显示 | |
135 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | |
136 | + return format.format(date); | |
137 | + } | |
50 | 138 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java
... | ... | @@ -71,7 +71,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
71 | 71 | if (status.equals("100")) { |
72 | 72 | String usernameStr = phonenumber.getText().toString().trim(); |
73 | 73 | String passwordStr = password.getText().toString().trim(); |
74 | - //HttpManager.getInstance().saveLoginInfo(usernameStr,passwordStr,access_token,"true",userId); | |
74 | + HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,"true",userId); | |
75 | 75 | AlertUtils.showToast(getActivity(), "注册成功!"); |
76 | 76 | Intent intent = new Intent(); |
77 | 77 | intent.setClass(getActivity(),RegisterInfoActivity.class); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
... | ... | @@ -2,11 +2,16 @@ package com.hjx.personalcenter.http; |
2 | 2 | |
3 | 3 | import android.app.Activity; |
4 | 4 | import android.app.ProgressDialog; |
5 | +import android.content.ComponentName; | |
5 | 6 | import android.content.Context; |
6 | 7 | import android.content.Intent; |
7 | 8 | import android.os.Handler; |
8 | 9 | import android.os.Message; |
10 | +import android.provider.Settings; | |
11 | +import android.support.v4.app.FragmentActivity; | |
9 | 12 | import android.util.Log; |
13 | +import android.view.Gravity; | |
14 | +import android.view.View; | |
10 | 15 | import android.widget.Toast; |
11 | 16 | |
12 | 17 | import com.google.gson.Gson; |
... | ... | @@ -22,6 +27,9 @@ import com.hjx.personalcenter.util.DialogPermission; |
22 | 27 | import com.loopj.android.http.AsyncHttpResponseHandler; |
23 | 28 | import com.loopj.android.http.JsonHttpResponseHandler; |
24 | 29 | import com.loopj.android.http.RequestParams; |
30 | +import com.mylhyl.circledialog.CircleDialog; | |
31 | +import com.mylhyl.circledialog.callback.ConfigText; | |
32 | +import com.mylhyl.circledialog.params.TextParams; | |
25 | 33 | |
26 | 34 | import org.apache.http.Header; |
27 | 35 | import org.apache.http.entity.ByteArrayEntity; |
... | ... | @@ -89,7 +97,27 @@ public class HttpManager { |
89 | 97 | @Override |
90 | 98 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
91 | 99 | closeProgress(); |
92 | - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | |
100 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
101 | + .setCanceledOnTouchOutside(false) | |
102 | + .setCancelable(false) | |
103 | + .setWidth(0.5f) | |
104 | + .configText(new ConfigText() { | |
105 | + @Override | |
106 | + public void onConfig(TextParams params) { | |
107 | + params.gravity = Gravity.CENTER; | |
108 | + params.padding = new int[]{50, 50, 50, 50}; | |
109 | + } | |
110 | + }) | |
111 | + .setText("当前无网络,请检查网络设置") | |
112 | + .setNegative("继续使用", null) | |
113 | + .setPositive("设置网络", new View.OnClickListener() { | |
114 | + @Override | |
115 | + public void onClick(View v) { | |
116 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
117 | + mContext.startActivity(intent); | |
118 | + } | |
119 | + }) | |
120 | + .show(); | |
93 | 121 | } |
94 | 122 | }); |
95 | 123 | } |
... | ... | @@ -132,7 +160,27 @@ public class HttpManager { |
132 | 160 | super.onFailure(statusCode, headers, throwable, errorResponse); |
133 | 161 | closeProgress(); |
134 | 162 | Log.e("test", "onFailure" + errorResponse); |
135 | - Toast.makeText(context, "请检查网络。。", Toast.LENGTH_LONG).show(); | |
163 | + new CircleDialog.Builder((FragmentActivity) context) | |
164 | + .setCanceledOnTouchOutside(false) | |
165 | + .setCancelable(false) | |
166 | + .setWidth(0.5f) | |
167 | + .configText(new ConfigText() { | |
168 | + @Override | |
169 | + public void onConfig(TextParams params) { | |
170 | + params.gravity = Gravity.CENTER; | |
171 | + params.padding = new int[]{50, 50, 50, 50}; | |
172 | + } | |
173 | + }) | |
174 | + .setText("当前无网络,请检查网络设置") | |
175 | + .setNegative("继续使用", null) | |
176 | + .setPositive("设置网络", new View.OnClickListener() { | |
177 | + @Override | |
178 | + public void onClick(View v) { | |
179 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
180 | + context.startActivity(intent); | |
181 | + } | |
182 | + }) | |
183 | + .show(); | |
136 | 184 | } |
137 | 185 | |
138 | 186 | }); |
... | ... | @@ -157,7 +205,27 @@ public class HttpManager { |
157 | 205 | |
158 | 206 | @Override |
159 | 207 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { |
160 | - Toast.makeText(mContext, "请检查网络。。" + errorResponse, Toast.LENGTH_LONG).show(); | |
208 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
209 | + .setCanceledOnTouchOutside(false) | |
210 | + .setCancelable(false) | |
211 | + .setWidth(0.5f) | |
212 | + .configText(new ConfigText() { | |
213 | + @Override | |
214 | + public void onConfig(TextParams params) { | |
215 | + params.gravity = Gravity.CENTER; | |
216 | + params.padding = new int[]{50, 50, 50, 50}; | |
217 | + } | |
218 | + }) | |
219 | + .setText("当前无网络,请检查网络设置") | |
220 | + .setNegative("继续使用", null) | |
221 | + .setPositive("设置网络", new View.OnClickListener() { | |
222 | + @Override | |
223 | + public void onClick(View v) { | |
224 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
225 | + mContext.startActivity(intent); | |
226 | + } | |
227 | + }) | |
228 | + .show(); | |
161 | 229 | } |
162 | 230 | }); |
163 | 231 | } |
... | ... | @@ -180,7 +248,27 @@ public class HttpManager { |
180 | 248 | |
181 | 249 | @Override |
182 | 250 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { |
183 | - Toast.makeText(mContext, "失敗" + errorResponse, Toast.LENGTH_LONG).show(); | |
251 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
252 | + .setCanceledOnTouchOutside(false) | |
253 | + .setCancelable(false) | |
254 | + .setWidth(0.5f) | |
255 | + .configText(new ConfigText() { | |
256 | + @Override | |
257 | + public void onConfig(TextParams params) { | |
258 | + params.gravity = Gravity.CENTER; | |
259 | + params.padding = new int[]{50, 50, 50, 50}; | |
260 | + } | |
261 | + }) | |
262 | + .setText("当前无网络,请检查网络设置") | |
263 | + .setNegative("继续使用", null) | |
264 | + .setPositive("设置网络", new View.OnClickListener() { | |
265 | + @Override | |
266 | + public void onClick(View v) { | |
267 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
268 | + mContext.startActivity(intent); | |
269 | + } | |
270 | + }) | |
271 | + .show(); | |
184 | 272 | |
185 | 273 | } |
186 | 274 | }); |
... | ... | @@ -217,8 +305,27 @@ public class HttpManager { |
217 | 305 | @Override |
218 | 306 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
219 | 307 | Log.e("test", "onFailure" + new String(bytes)); |
220 | - Toast.makeText(context, "密码修改失败,请检查网络!", Toast.LENGTH_LONG).show(); | |
221 | - onFinish(); | |
308 | + new CircleDialog.Builder((FragmentActivity) context) | |
309 | + .setCanceledOnTouchOutside(false) | |
310 | + .setCancelable(false) | |
311 | + .setWidth(0.5f) | |
312 | + .configText(new ConfigText() { | |
313 | + @Override | |
314 | + public void onConfig(TextParams params) { | |
315 | + params.gravity = Gravity.CENTER; | |
316 | + params.padding = new int[]{50, 50, 50, 50}; | |
317 | + } | |
318 | + }) | |
319 | + .setText("当前无网络,请检查网络设置") | |
320 | + .setNegative("继续使用", null) | |
321 | + .setPositive("设置网络", new View.OnClickListener() { | |
322 | + @Override | |
323 | + public void onClick(View v) { | |
324 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
325 | + context.startActivity(intent); | |
326 | + } | |
327 | + }) | |
328 | + .show(); | |
222 | 329 | } |
223 | 330 | }); |
224 | 331 | |
... | ... | @@ -250,7 +357,27 @@ public class HttpManager { |
250 | 357 | @Override |
251 | 358 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
252 | 359 | Log.e("test", "onFailure" + new String(bytes)); |
253 | - Toast.makeText(context, "忘记密码修改失败,请检查网络!", Toast.LENGTH_LONG).show(); | |
360 | + new CircleDialog.Builder((FragmentActivity) context) | |
361 | + .setCanceledOnTouchOutside(false) | |
362 | + .setCancelable(false) | |
363 | + .setWidth(0.5f) | |
364 | + .configText(new ConfigText() { | |
365 | + @Override | |
366 | + public void onConfig(TextParams params) { | |
367 | + params.gravity = Gravity.CENTER; | |
368 | + params.padding = new int[]{50, 50, 50, 50}; | |
369 | + } | |
370 | + }) | |
371 | + .setText("当前无网络,请检查网络设置") | |
372 | + .setNegative("继续使用", null) | |
373 | + .setPositive("设置网络", new View.OnClickListener() { | |
374 | + @Override | |
375 | + public void onClick(View v) { | |
376 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
377 | + context.startActivity(intent); | |
378 | + } | |
379 | + }) | |
380 | + .show(); | |
254 | 381 | } |
255 | 382 | }); |
256 | 383 | |
... | ... | @@ -326,7 +453,27 @@ public class HttpManager { |
326 | 453 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
327 | 454 | Log.e("test", "onFailure" + (throwable)); |
328 | 455 | closeProgress(); |
329 | - Toast.makeText(context, "保卡绑定失败!,请检查网络", Toast.LENGTH_LONG).show(); | |
456 | + new CircleDialog.Builder((FragmentActivity) context) | |
457 | + .setCanceledOnTouchOutside(false) | |
458 | + .setCancelable(false) | |
459 | + .setWidth(0.5f) | |
460 | + .configText(new ConfigText() { | |
461 | + @Override | |
462 | + public void onConfig(TextParams params) { | |
463 | + params.gravity = Gravity.CENTER; | |
464 | + params.padding = new int[]{50, 50, 50, 50}; | |
465 | + } | |
466 | + }) | |
467 | + .setText("当前无网络,请检查网络设置") | |
468 | + .setNegative("继续使用", null) | |
469 | + .setPositive("设置网络", new View.OnClickListener() { | |
470 | + @Override | |
471 | + public void onClick(View v) { | |
472 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
473 | + context.startActivity(intent); | |
474 | + } | |
475 | + }) | |
476 | + .show(); | |
330 | 477 | |
331 | 478 | } |
332 | 479 | }); |
... | ... | @@ -352,7 +499,27 @@ public class HttpManager { |
352 | 499 | @Override |
353 | 500 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
354 | 501 | closeProgress(); |
355 | - Toast.makeText(mContext, "请检查网络。。" , Toast.LENGTH_LONG).show(); | |
502 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
503 | + .setCanceledOnTouchOutside(false) | |
504 | + .setCancelable(false) | |
505 | + .setWidth(0.5f) | |
506 | + .configText(new ConfigText() { | |
507 | + @Override | |
508 | + public void onConfig(TextParams params) { | |
509 | + params.gravity = Gravity.CENTER; | |
510 | + params.padding = new int[]{50, 50, 50, 50}; | |
511 | + } | |
512 | + }) | |
513 | + .setText("当前无网络,请检查网络设置") | |
514 | + .setNegative("继续使用", null) | |
515 | + .setPositive("设置网络", new View.OnClickListener() { | |
516 | + @Override | |
517 | + public void onClick(View v) { | |
518 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
519 | + mContext.startActivity(intent); | |
520 | + } | |
521 | + }) | |
522 | + .show(); | |
356 | 523 | } |
357 | 524 | }); |
358 | 525 | } |
... | ... | @@ -384,12 +551,32 @@ public class HttpManager { |
384 | 551 | @Override |
385 | 552 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
386 | 553 | Log.e("test", "onFailure" + new String(bytes)); |
387 | - Toast.makeText(mContext, "请检查网络。。" + new String(bytes), Toast.LENGTH_LONG).show(); | |
554 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
555 | + .setCanceledOnTouchOutside(false) | |
556 | + .setCancelable(false) | |
557 | + .setWidth(0.5f) | |
558 | + .configText(new ConfigText() { | |
559 | + @Override | |
560 | + public void onConfig(TextParams params) { | |
561 | + params.gravity = Gravity.CENTER; | |
562 | + params.padding = new int[]{50, 50, 50, 50}; | |
563 | + } | |
564 | + }) | |
565 | + .setText("当前无网络,请检查网络设置") | |
566 | + .setNegative("继续使用", null) | |
567 | + .setPositive("设置网络", new View.OnClickListener() { | |
568 | + @Override | |
569 | + public void onClick(View v) { | |
570 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
571 | + mContext.startActivity(intent); | |
572 | + } | |
573 | + }) | |
574 | + .show(); | |
388 | 575 | } |
389 | 576 | }); |
390 | 577 | } |
391 | 578 | //修改保卡信息地址 |
392 | - public void changecardinfo(final Context mContext,int userId,String customerPhone,String authCode,String customerAddress) { | |
579 | + public void changecardadressinfo(final Context mContext, int userId, final String customerPhone, String authCode, final String customerAddress) { | |
393 | 580 | RequestParams params = new RequestParams(); |
394 | 581 | params.put("userId", userId); |
395 | 582 | params.put("customerPhone", customerPhone); |
... | ... | @@ -403,8 +590,9 @@ public class HttpManager { |
403 | 590 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
404 | 591 | String status = jsonObject.optString("status"); |
405 | 592 | if (status.equals("1")) { |
406 | - Log.e("test", "省" + jsonObject); | |
407 | - Toast.makeText(mContext, "成功。。" + jsonObject, Toast.LENGTH_LONG).show(); | |
593 | + Toast.makeText(mContext, "手机号修改成功", Toast.LENGTH_LONG).show(); | |
594 | + SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.ADRESSCUNSTEM, customerAddress); | |
595 | + ((Activity) mContext).finish(); | |
408 | 596 | } |
409 | 597 | } catch (JSONException e) { |
410 | 598 | e.printStackTrace(); |
... | ... | @@ -414,7 +602,27 @@ public class HttpManager { |
414 | 602 | @Override |
415 | 603 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
416 | 604 | Log.e("test", "onFailure" + new String(bytes)); |
417 | - Toast.makeText(mContext, "请检查网络。。" + new String(bytes), Toast.LENGTH_LONG).show(); | |
605 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
606 | + .setCanceledOnTouchOutside(false) | |
607 | + .setCancelable(false) | |
608 | + .setWidth(0.5f) | |
609 | + .configText(new ConfigText() { | |
610 | + @Override | |
611 | + public void onConfig(TextParams params) { | |
612 | + params.gravity = Gravity.CENTER; | |
613 | + params.padding = new int[]{50, 50, 50, 50}; | |
614 | + } | |
615 | + }) | |
616 | + .setText("当前无网络,请检查网络设置") | |
617 | + .setNegative("继续使用", null) | |
618 | + .setPositive("设置网络", new View.OnClickListener() { | |
619 | + @Override | |
620 | + public void onClick(View v) { | |
621 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
622 | + mContext.startActivity(intent); | |
623 | + } | |
624 | + }) | |
625 | + .show(); | |
418 | 626 | } |
419 | 627 | }); |
420 | 628 | } |
... | ... | @@ -433,7 +641,30 @@ public class HttpManager { |
433 | 641 | |
434 | 642 | @Override |
435 | 643 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
436 | - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | |
644 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
645 | + .setCanceledOnTouchOutside(false) | |
646 | + .setCancelable(false) | |
647 | + .configText(new ConfigText() { | |
648 | + @Override | |
649 | + public void onConfig(TextParams params) { | |
650 | + params.gravity = Gravity.CENTER; | |
651 | + params.padding = new int[]{250, 50, 250, 50}; | |
652 | + } | |
653 | + }) | |
654 | + .setText("当前无网络,请检查网络设置") | |
655 | + .setNegative("取消", null) | |
656 | + .setPositive("确定", new View.OnClickListener() { | |
657 | + @Override | |
658 | + public void onClick(View v) { | |
659 | + Intent intent = new Intent("/"); | |
660 | + ComponentName cm = new ComponentName("com.android.settings","com.android.settings.WirelessSettings"); | |
661 | + intent.setComponent(cm); | |
662 | + intent.setAction("android.intent.action.VIEW"); | |
663 | + ((Activity) mContext).startActivityForResult( intent , 0); | |
664 | + } | |
665 | + }) | |
666 | + .show(); | |
667 | + //Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | |
437 | 668 | } |
438 | 669 | }); |
439 | 670 | } |
... | ... | @@ -463,7 +694,27 @@ public class HttpManager { |
463 | 694 | |
464 | 695 | @Override |
465 | 696 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
466 | - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | |
697 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
698 | + .setCanceledOnTouchOutside(false) | |
699 | + .setCancelable(false) | |
700 | + .setWidth(0.5f) | |
701 | + .configText(new ConfigText() { | |
702 | + @Override | |
703 | + public void onConfig(TextParams params) { | |
704 | + params.gravity = Gravity.CENTER; | |
705 | + params.padding = new int[]{50, 50, 50, 50}; | |
706 | + } | |
707 | + }) | |
708 | + .setText("当前无网络,请检查网络设置") | |
709 | + .setNegative("继续使用", null) | |
710 | + .setPositive("设置网络", new View.OnClickListener() { | |
711 | + @Override | |
712 | + public void onClick(View v) { | |
713 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
714 | + mContext.startActivity(intent); | |
715 | + } | |
716 | + }) | |
717 | + .show(); | |
467 | 718 | } |
468 | 719 | }); |
469 | 720 | } |
... | ... | @@ -491,7 +742,27 @@ public class HttpManager { |
491 | 742 | |
492 | 743 | @Override |
493 | 744 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
494 | - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | |
745 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
746 | + .setCanceledOnTouchOutside(false) | |
747 | + .setCancelable(false) | |
748 | + .setWidth(0.5f) | |
749 | + .configText(new ConfigText() { | |
750 | + @Override | |
751 | + public void onConfig(TextParams params) { | |
752 | + params.gravity = Gravity.CENTER; | |
753 | + params.padding = new int[]{50, 50, 50, 50}; | |
754 | + } | |
755 | + }) | |
756 | + .setText("当前无网络,请检查网络设置") | |
757 | + .setNegative("继续使用", null) | |
758 | + .setPositive("设置网络", new View.OnClickListener() { | |
759 | + @Override | |
760 | + public void onClick(View v) { | |
761 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
762 | + mContext.startActivity(intent); | |
763 | + } | |
764 | + }) | |
765 | + .show(); | |
495 | 766 | } |
496 | 767 | }); |
497 | 768 | } |
... | ... | @@ -519,7 +790,27 @@ public class HttpManager { |
519 | 790 | |
520 | 791 | @Override |
521 | 792 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
522 | - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | |
793 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
794 | + .setCanceledOnTouchOutside(false) | |
795 | + .setCancelable(false) | |
796 | + .setWidth(0.5f) | |
797 | + .configText(new ConfigText() { | |
798 | + @Override | |
799 | + public void onConfig(TextParams params) { | |
800 | + params.gravity = Gravity.CENTER; | |
801 | + params.padding = new int[]{50, 50, 50, 50}; | |
802 | + } | |
803 | + }) | |
804 | + .setText("当前无网络,请检查网络设置") | |
805 | + .setNegative("继续使用", null) | |
806 | + .setPositive("设置网络", new View.OnClickListener() { | |
807 | + @Override | |
808 | + public void onClick(View v) { | |
809 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
810 | + mContext.startActivity(intent); | |
811 | + } | |
812 | + }) | |
813 | + .show(); | |
523 | 814 | } |
524 | 815 | }); |
525 | 816 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/interfaces/DialogCallBack.java
1 | 1 | package com.hjx.personalcenter.interfaces; |
2 | 2 | |
3 | +import android.content.Context; | |
4 | +import android.view.LayoutInflater; | |
3 | 5 | import android.view.View; |
6 | +import android.view.ViewGroup; | |
4 | 7 | import android.widget.AdapterView; |
5 | 8 | |
6 | 9 | /** |
... | ... | @@ -11,4 +14,7 @@ public class DialogCallBack { |
11 | 14 | public interface CallBack{ |
12 | 15 | void provinceOnItemClick(AdapterView<?> parent, View view, int position, long id); |
13 | 16 | } |
17 | + public interface CallBackView{ | |
18 | + void provinceOnItemClick(Context context, LayoutInflater inflater, ViewGroup container); | |
19 | + } | |
14 | 20 | } | ... | ... |
PersonalCenter/app/src/main/res/anim/dialog_enter_anim.xml
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
3 | + <scale | |
4 | + android:interpolator="@android:anim/accelerate_interpolator" | |
5 | + android:fromXScale="1.0" | |
6 | + android:toXScale="1.0" | |
7 | + android:fromYScale="0.0" | |
8 | + android:toYScale="1.0" | |
9 | + android:pivotX="0%" | |
10 | + android:pivotY="100%" | |
11 | + android:fillAfter="false" | |
12 | + android:duration="400"/> | |
13 | +</set> | |
0 | 14 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/anim/dialog_exit_anim.xml
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<set xmlns:android="http://schemas.android.com/apk/res/android"> | |
3 | + <scale | |
4 | + android:interpolator="@android:anim/accelerate_interpolator" | |
5 | + android:fromXScale="1.0" | |
6 | + android:toXScale="1.0" | |
7 | + android:fromYScale="1.0" | |
8 | + android:toYScale="0.0" | |
9 | + android:pivotX="0%" | |
10 | + android:pivotY="100%" | |
11 | + android:fillAfter="false" | |
12 | + android:duration="400"/> | |
13 | +</set> | |
0 | 14 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_account_management.xml
... | ... | @@ -73,6 +73,7 @@ |
73 | 73 | android:textSize="22sp" |
74 | 74 | android:text="123556677"/> |
75 | 75 | <TextView |
76 | + android:id="@+id/changBangding" | |
76 | 77 | android:layout_width="0dp" |
77 | 78 | android:layout_height="wrap_content" |
78 | 79 | android:layout_weight="1" |
... | ... | @@ -105,6 +106,7 @@ |
105 | 106 | android:textSize="22sp" |
106 | 107 | android:text="已设置"/> |
107 | 108 | <TextView |
109 | + android:id="@+id/changpassword" | |
108 | 110 | android:layout_width="0dp" |
109 | 111 | android:layout_height="wrap_content" |
110 | 112 | android:layout_weight="1" | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_change_card_validation.xml
... | ... | @@ -90,15 +90,11 @@ |
90 | 90 | android:layout_below="@id/rl_authcode" |
91 | 91 | android:layout_marginTop="30dp"> |
92 | 92 | |
93 | - <EditText | |
93 | + <TextView | |
94 | 94 | android:id="@+id/et_newpassword" |
95 | 95 | style="@style/login_register_edit_style" |
96 | - android:hint="请选择地区" | |
97 | - android:inputType="textPassword" /> | |
96 | + android:hint="请选择地区" /> | |
98 | 97 | |
99 | - <ImageView | |
100 | - android:id="@+id/iv_pwd_change" | |
101 | - style="@style/iv_pwd_change_style" /> | |
102 | 98 | </RelativeLayout> |
103 | 99 | |
104 | 100 | <TextView |
... | ... | @@ -111,8 +107,7 @@ |
111 | 107 | style="@style/login_register_edit_style" |
112 | 108 | android:layout_below="@id/pwd_rl" |
113 | 109 | android:layout_marginTop="30dp" |
114 | - android:hint="请选择详细地址" | |
115 | - android:inputType="textPassword" /> | |
110 | + android:hint="请填写详细地址" /> | |
116 | 111 | |
117 | 112 | <TextView |
118 | 113 | android:id="@+id/again_newpassword_error_hint" | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_changepsword.xml
... | ... | @@ -3,14 +3,14 @@ |
3 | 3 | android:layout_width="match_parent" |
4 | 4 | android:layout_height="match_parent" |
5 | 5 | android:background="#ffffffff" |
6 | - android:orientation="vertical" > | |
6 | + android:orientation="vertical"> | |
7 | 7 | |
8 | 8 | <RelativeLayout |
9 | 9 | android:id="@+id/title" |
10 | 10 | android:layout_width="match_parent" |
11 | 11 | android:layout_height="wrap_content" |
12 | 12 | android:background="@color/login_text_blue" |
13 | - android:minHeight="50dp" > | |
13 | + android:minHeight="50dp"> | |
14 | 14 | |
15 | 15 | <ImageView |
16 | 16 | android:id="@+id/cancel" |
... | ... | @@ -38,23 +38,29 @@ |
38 | 38 | android:background="#ffffffff" |
39 | 39 | android:orientation="vertical" |
40 | 40 | android:paddingLeft="250dp" |
41 | - android:paddingRight="250dp" > | |
41 | + android:paddingRight="250dp"> | |
42 | 42 | |
43 | 43 | <RelativeLayout |
44 | - android:id="@+id/pwd_rl" | |
45 | - android:layout_width="match_parent" | |
46 | - android:layout_height="wrap_content" | |
47 | - android:layout_marginTop="100dp" | |
48 | - > | |
49 | - <EditText | |
50 | - android:id="@+id/et_oldpassword" | |
51 | - style="@style/login_register_edit_style" | |
52 | - android:hint="输入原密码" | |
53 | - android:inputType="textPassword" /> | |
54 | - <ImageView | |
55 | - android:id="@+id/iv_pwd_change" | |
56 | - style="@style/iv_pwd_change_style" | |
57 | - /> | |
44 | + android:id="@+id/pwd_rl" | |
45 | + android:layout_width="match_parent" | |
46 | + android:layout_height="wrap_content" | |
47 | + android:layout_marginTop="100dp"> | |
48 | + | |
49 | + <EditText | |
50 | + android:id="@+id/et_oldpassword" | |
51 | + style="@style/login_register_edit_style" | |
52 | + android:hint="输入原密码" | |
53 | + android:inputType="textPassword" /> | |
54 | + <ImageView | |
55 | + android:id="@+id/iv_pwd_change" | |
56 | + android:padding="10dp" | |
57 | + android:layout_marginRight="10dp" | |
58 | + android:layout_marginLeft="10dp" | |
59 | + android:layout_width="40dp" | |
60 | + android:layout_height="wrap_content" | |
61 | + android:layout_alignParentRight="true" | |
62 | + android:layout_centerVertical="true" | |
63 | + android:src="@mipmap/pwd_hide" /> | |
58 | 64 | </RelativeLayout> |
59 | 65 | |
60 | 66 | <TextView | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_main.xml
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | android:layout_height="match_parent" |
17 | 17 | android:paddingLeft="20dp" |
18 | 18 | android:paddingRight="20dp" |
19 | + android:visibility="gone" | |
19 | 20 | android:src="@mipmap/title_back" /> |
20 | 21 | |
21 | 22 | <TextView |
... | ... | @@ -91,6 +92,7 @@ |
91 | 92 | android:src="@mipmap/card_icoc" /> |
92 | 93 | |
93 | 94 | <ImageView |
95 | + android:id="@+id/iv_head" | |
94 | 96 | android:layout_width="wrap_content" |
95 | 97 | android:layout_height="wrap_content" |
96 | 98 | android:layout_marginLeft="60dp" |
... | ... | @@ -119,12 +121,14 @@ |
119 | 121 | android:orientation="horizontal"> |
120 | 122 | |
121 | 123 | <TextView |
124 | + android:id="@+id/tv_username" | |
122 | 125 | android:layout_width="wrap_content" |
123 | 126 | android:layout_height="wrap_content" |
124 | 127 | android:text="熊巍" |
125 | 128 | android:textSize="20dp" /> |
126 | 129 | |
127 | 130 | <ImageView |
131 | + android:id="@+id/iv_sex" | |
128 | 132 | android:layout_width="wrap_content" |
129 | 133 | android:layout_height="wrap_content" |
130 | 134 | android:layout_marginLeft="50dp" |
... | ... | @@ -168,6 +172,7 @@ |
168 | 172 | </View> |
169 | 173 | |
170 | 174 | <LinearLayout |
175 | + android:id="@+id/linel_mycuoti" | |
171 | 176 | android:layout_width="match_parent" |
172 | 177 | android:layout_height="wrap_content" |
173 | 178 | android:layout_marginTop="30dp" |
... | ... | @@ -201,6 +206,7 @@ |
201 | 206 | </LinearLayout> |
202 | 207 | |
203 | 208 | <LinearLayout |
209 | + android:id="@+id/linel_mynote" | |
204 | 210 | android:layout_width="match_parent" |
205 | 211 | android:layout_height="wrap_content" |
206 | 212 | android:layout_marginTop="35dp" |
... | ... | @@ -229,6 +235,7 @@ |
229 | 235 | </LinearLayout> |
230 | 236 | |
231 | 237 | <LinearLayout |
238 | + android:id="@+id/linel_mycollege" | |
232 | 239 | android:layout_width="match_parent" |
233 | 240 | android:layout_height="wrap_content" |
234 | 241 | android:layout_marginTop="35dp" |
... | ... | @@ -257,6 +264,7 @@ |
257 | 264 | </LinearLayout> |
258 | 265 | |
259 | 266 | <LinearLayout |
267 | + android:id="@+id/linel_myclass" | |
260 | 268 | android:layout_width="match_parent" |
261 | 269 | android:layout_height="wrap_content" |
262 | 270 | android:layout_marginTop="35dp" |
... | ... | @@ -415,10 +423,11 @@ |
415 | 423 | android:layout_width="0dp" |
416 | 424 | android:layout_height="wrap_content" |
417 | 425 | android:layout_weight="1" |
418 | - android:text="我的错题" | |
426 | + android:text="昵称" | |
419 | 427 | android:textSize="20sp" /> |
420 | 428 | |
421 | 429 | <TextView |
430 | + android:id="@+id/tv_username1" | |
422 | 431 | android:layout_width="0dp" |
423 | 432 | android:layout_height="wrap_content" |
424 | 433 | android:layout_weight="2" |
... | ... | @@ -429,10 +438,11 @@ |
429 | 438 | android:layout_width="1dp" |
430 | 439 | android:layout_height="wrap_content" |
431 | 440 | android:layout_weight="1" |
432 | - android:text="我的错题" | |
441 | + android:text="星座" | |
433 | 442 | android:textSize="20sp" /> |
434 | 443 | |
435 | 444 | <TextView |
445 | + android:id="@+id/tv_mygad" | |
436 | 446 | android:layout_width="0dp" |
437 | 447 | android:layout_height="wrap_content" |
438 | 448 | android:layout_weight="2" |
... | ... | @@ -451,24 +461,26 @@ |
451 | 461 | android:layout_width="0dp" |
452 | 462 | android:layout_height="wrap_content" |
453 | 463 | android:layout_weight="1" |
454 | - android:text="我的错题" | |
464 | + android:text="性别" | |
455 | 465 | android:textSize="20sp" /> |
456 | 466 | |
457 | 467 | <TextView |
468 | + android:id="@+id/tv_sex" | |
458 | 469 | android:layout_width="0dp" |
459 | 470 | android:layout_height="wrap_content" |
460 | 471 | android:layout_weight="2" |
461 | - android:text="我的错题" | |
472 | + android:text="男" | |
462 | 473 | android:textSize="20sp" /> |
463 | 474 | |
464 | 475 | <TextView |
465 | 476 | android:layout_width="1dp" |
466 | 477 | android:layout_height="wrap_content" |
467 | 478 | android:layout_weight="1" |
468 | - android:text="我的错题" | |
479 | + android:text="地区" | |
469 | 480 | android:textSize="20sp" /> |
470 | 481 | |
471 | 482 | <TextView |
483 | + android:id="@+id/tv_useinfo_adress" | |
472 | 484 | android:layout_width="0dp" |
473 | 485 | android:layout_height="wrap_content" |
474 | 486 | android:layout_weight="2" |
... | ... | @@ -487,10 +499,11 @@ |
487 | 499 | android:layout_width="0dp" |
488 | 500 | android:layout_height="wrap_content" |
489 | 501 | android:layout_weight="1" |
490 | - android:text="我的错题" | |
502 | + android:text="生日" | |
491 | 503 | android:textSize="20sp" /> |
492 | 504 | |
493 | 505 | <TextView |
506 | + android:id="@+id/tv_useinfo_birthday" | |
494 | 507 | android:layout_width="0dp" |
495 | 508 | android:layout_height="wrap_content" |
496 | 509 | android:layout_weight="2" |
... | ... | @@ -501,10 +514,11 @@ |
501 | 514 | android:layout_width="1dp" |
502 | 515 | android:layout_height="wrap_content" |
503 | 516 | android:layout_weight="1" |
504 | - android:text="我的错题" | |
517 | + android:text="学校" | |
505 | 518 | android:textSize="20sp" /> |
506 | 519 | |
507 | 520 | <TextView |
521 | + android:id="@+id/tv_useinfo_school" | |
508 | 522 | android:layout_width="0dp" |
509 | 523 | android:layout_height="wrap_content" |
510 | 524 | android:layout_weight="2" |
... | ... | @@ -523,10 +537,11 @@ |
523 | 537 | android:layout_width="0dp" |
524 | 538 | android:layout_height="wrap_content" |
525 | 539 | android:layout_weight="1" |
526 | - android:text="我的错题" | |
540 | + android:text="Q Q" | |
527 | 541 | android:textSize="20sp" /> |
528 | 542 | |
529 | 543 | <TextView |
544 | + android:id="@+id/tv_useinfo_qq" | |
530 | 545 | android:layout_width="0dp" |
531 | 546 | android:layout_height="wrap_content" |
532 | 547 | android:layout_weight="2" |
... | ... | @@ -537,10 +552,11 @@ |
537 | 552 | android:layout_width="1dp" |
538 | 553 | android:layout_height="wrap_content" |
539 | 554 | android:layout_weight="1" |
540 | - android:text="我的错题" | |
555 | + android:text="年级" | |
541 | 556 | android:textSize="20sp" /> |
542 | 557 | |
543 | 558 | <TextView |
559 | + android:id="@+id/tv_useinfo_gender" | |
544 | 560 | android:layout_width="0dp" |
545 | 561 | android:layout_height="wrap_content" |
546 | 562 | android:layout_weight="2" | ... | ... |
PersonalCenter/app/src/main/res/layout/custom_adilog_lhead.xml
... | ... | @@ -0,0 +1,150 @@ |
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:orientation="vertical"> | |
6 | + | |
7 | + <RelativeLayout | |
8 | + android:id="@+id/title" | |
9 | + android:layout_width="match_parent" | |
10 | + android:layout_height="wrap_content" | |
11 | + android:minHeight="70dp" > | |
12 | + | |
13 | + <TextView | |
14 | + android:id="@+id/menu_title" | |
15 | + android:layout_width="wrap_content" | |
16 | + android:layout_height="wrap_content" | |
17 | + android:layout_centerInParent="true" | |
18 | + android:padding="20dp" | |
19 | + android:text="个人头像" | |
20 | + android:textColor="@android:color/black" | |
21 | + android:textSize="22sp" /> | |
22 | + </RelativeLayout> | |
23 | + <LinearLayout | |
24 | + android:layout_width="match_parent" | |
25 | + android:layout_height="225dp" | |
26 | + android:layout_margin="20dp" | |
27 | + android:orientation="vertical"> | |
28 | + <TextView | |
29 | + android:layout_width="wrap_content" | |
30 | + android:layout_height="wrap_content" | |
31 | + android:layout_marginLeft="50dp" | |
32 | + android:textSize="18sp" | |
33 | + android:text="默认头像"/> | |
34 | + <LinearLayout | |
35 | + android:layout_width="match_parent" | |
36 | + android:layout_height="wrap_content" | |
37 | + android:gravity="center" | |
38 | + android:layout_marginTop="10dp" | |
39 | + android:orientation="horizontal"> | |
40 | + <ImageView | |
41 | + android:layout_width="wrap_content" | |
42 | + android:layout_height="wrap_content" | |
43 | + android:layout_margin="10dp" | |
44 | + android:src="@mipmap/ic_launcher"/> | |
45 | + <ImageView | |
46 | + android:layout_width="wrap_content" | |
47 | + android:layout_height="wrap_content" | |
48 | + android:layout_margin="10dp" | |
49 | + android:src="@mipmap/ic_launcher"/> | |
50 | + <ImageView | |
51 | + android:layout_width="wrap_content" | |
52 | + android:layout_height="wrap_content" | |
53 | + android:layout_margin="10dp" | |
54 | + android:src="@mipmap/ic_launcher"/> | |
55 | + <ImageView | |
56 | + android:layout_width="wrap_content" | |
57 | + android:layout_height="wrap_content" | |
58 | + android:layout_margin="10dp" | |
59 | + android:src="@mipmap/ic_launcher"/> | |
60 | + | |
61 | + </LinearLayout> | |
62 | + <LinearLayout | |
63 | + android:layout_width="match_parent" | |
64 | + android:layout_height="wrap_content" | |
65 | + android:gravity="center" | |
66 | + android:layout_marginTop="10dp" | |
67 | + android:orientation="horizontal"> | |
68 | + <LinearLayout | |
69 | + android:layout_width="0dp" | |
70 | + android:layout_weight="1" | |
71 | + android:gravity="center" | |
72 | + android:layout_height="wrap_content"> | |
73 | + <ImageView | |
74 | + android:layout_width="wrap_content" | |
75 | + android:layout_height="wrap_content" | |
76 | + android:layout_margin="10dp" | |
77 | + android:src="@mipmap/paizhao"/> | |
78 | + <TextView | |
79 | + android:layout_width="wrap_content" | |
80 | + android:layout_height="wrap_content" | |
81 | + android:layout_gravity="center_vertical" | |
82 | + android:textSize="18sp" | |
83 | + android:text="拍一张"/> | |
84 | + | |
85 | + </LinearLayout> | |
86 | + <LinearLayout | |
87 | + android:layout_width="0dp" | |
88 | + android:layout_weight="1" | |
89 | + android:gravity="center" | |
90 | + android:layout_height="wrap_content"> | |
91 | + <ImageView | |
92 | + android:layout_width="wrap_content" | |
93 | + android:layout_height="wrap_content" | |
94 | + android:layout_margin="10dp" | |
95 | + android:src="@mipmap/xiangce"/> | |
96 | + <TextView | |
97 | + android:layout_width="wrap_content" | |
98 | + android:layout_height="wrap_content" | |
99 | + android:layout_gravity="center_vertical" | |
100 | + android:textSize="18sp" | |
101 | + android:text="相册"/> | |
102 | + | |
103 | + | |
104 | + </LinearLayout> | |
105 | + | |
106 | + | |
107 | + </LinearLayout> | |
108 | + <View | |
109 | + android:layout_marginTop="10dp" | |
110 | + android:layout_width="match_parent" | |
111 | + android:background="@color/cutoff_line" | |
112 | + android:layout_height="0.7dp"> | |
113 | + | |
114 | + </View> | |
115 | + <LinearLayout | |
116 | + android:layout_width="match_parent" | |
117 | + android:layout_height="wrap_content" | |
118 | + android:gravity="center" | |
119 | + android:orientation="horizontal"> | |
120 | + | |
121 | + <TextView | |
122 | + android:id="@+id/canceltakephone" | |
123 | + android:layout_width="0dp" | |
124 | + android:layout_weight="1" | |
125 | + android:layout_marginTop="10dp" | |
126 | + android:layout_height="wrap_content" | |
127 | + android:gravity="center" | |
128 | + android:textSize="18sp" | |
129 | + android:text="取消"/> | |
130 | + <View | |
131 | + android:layout_width="0.7dp" | |
132 | + android:layout_height="match_parent" | |
133 | + android:background="@color/cutoff_line"> | |
134 | + | |
135 | + </View> | |
136 | + | |
137 | + <TextView | |
138 | + android:id="@+id/oktakephone" | |
139 | + android:layout_width="0dp" | |
140 | + android:layout_weight="1" | |
141 | + android:layout_height="wrap_content" | |
142 | + android:layout_marginTop="10dp" | |
143 | + android:gravity="center" | |
144 | + android:textSize="18sp" | |
145 | + android:text="确定"/> | |
146 | + | |
147 | + </LinearLayout> | |
148 | + | |
149 | + </LinearLayout> | |
150 | +</LinearLayout> | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml
... | ... | @@ -52,6 +52,7 @@ |
52 | 52 | android:textSize="22sp" /> |
53 | 53 | |
54 | 54 | <EditText |
55 | + android:id="@+id/tv_username1" | |
55 | 56 | android:layout_width="wrap_content" |
56 | 57 | android:layout_height="wrap_content" |
57 | 58 | android:layout_marginLeft="50dp" |
... | ... | @@ -76,6 +77,7 @@ |
76 | 77 | android:textSize="22sp" /> |
77 | 78 | |
78 | 79 | <TextView |
80 | + android:id="@+id/tv_useinfo_adress" | |
79 | 81 | android:layout_width="wrap_content" |
80 | 82 | android:layout_height="wrap_content" |
81 | 83 | android:layout_marginLeft="50dp" |
... | ... | @@ -139,6 +141,7 @@ |
139 | 141 | android:textSize="22sp" /> |
140 | 142 | |
141 | 143 | <TextView |
144 | + android:id="@+id/tv_sex" | |
142 | 145 | android:layout_width="wrap_content" |
143 | 146 | android:layout_height="wrap_content" |
144 | 147 | android:layout_marginLeft="50dp" |
... | ... | @@ -170,6 +173,7 @@ |
170 | 173 | android:textSize="22sp" /> |
171 | 174 | |
172 | 175 | <EditText |
176 | + android:id="@+id/tv_useinfo_adress1" | |
173 | 177 | android:layout_width="wrap_content" |
174 | 178 | android:layout_height="wrap_content" |
175 | 179 | android:layout_marginLeft="50dp" |
... | ... | @@ -228,6 +232,7 @@ |
228 | 232 | android:textSize="22sp" /> |
229 | 233 | |
230 | 234 | <TextView |
235 | + android:id="@+id/tv_useinfo_birthday" | |
231 | 236 | android:layout_width="wrap_content" |
232 | 237 | android:layout_height="wrap_content" |
233 | 238 | android:layout_marginLeft="50dp" |
... | ... | @@ -254,6 +259,7 @@ |
254 | 259 | android:textSize="22sp" /> |
255 | 260 | |
256 | 261 | <TextView |
262 | + android:id="@+id/tv_useinfo_gender" | |
257 | 263 | android:layout_width="wrap_content" |
258 | 264 | android:layout_height="wrap_content" |
259 | 265 | android:layout_marginLeft="50dp" |
... | ... | @@ -316,7 +322,7 @@ |
316 | 322 | android:textSize="22sp" /> |
317 | 323 | |
318 | 324 | <EditText |
319 | - android:id="@+id/tv_buy_time" | |
325 | + android:id="@+id/tv_useinfo_qq" | |
320 | 326 | android:layout_width="wrap_content" |
321 | 327 | android:layout_height="wrap_content" |
322 | 328 | android:layout_marginLeft="50dp" |
... | ... | @@ -341,6 +347,7 @@ |
341 | 347 | android:textSize="22sp" /> |
342 | 348 | |
343 | 349 | <TextView |
350 | + android:id="@+id/tv_useinfo_school" | |
344 | 351 | android:layout_width="wrap_content" |
345 | 352 | android:layout_height="wrap_content" |
346 | 353 | android:layout_marginLeft="50dp" | ... | ... |
PersonalCenter/app/src/main/res/mipmap-xhdpi/paizhao.png
1.66 KB
PersonalCenter/app/src/main/res/mipmap-xhdpi/xiangce.png
1.71 KB
PersonalCenter/app/src/main/res/values/styles.xml
... | ... | @@ -75,6 +75,10 @@ |
75 | 75 | <item name="android:layout_centerVertical">true</item> |
76 | 76 | <item name="android:layout_marginRight">15dp</item> |
77 | 77 | </style> |
78 | + <style name="dialogWindowAnim" parent="android:Animation" mce_bogus="1"> | |
79 | + <item name="android:windowEnterAnimation">@anim/dialog_enter_anim</item> | |
80 | + <item name="android:windowExitAnimation">@anim/dialog_exit_anim</item> | |
81 | + </style> | |
78 | 82 | |
79 | 83 | |
80 | 84 | ... | ... |
PersonalCenter/build.gradle
... | ... | @@ -10,6 +10,7 @@ buildscript { |
10 | 10 | // NOTE: Do not place your application dependencies here; they belong |
11 | 11 | // in the individual module build.gradle files |
12 | 12 | classpath 'com.novoda:bintray-release:0.3.4' |
13 | + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | |
13 | 14 | } |
14 | 15 | } |
15 | 16 | ... | ... |