Commit cc35aeb72ab301340d331ee90c38d24d4e47000f
1 parent
29ad76f4f2
Exists in
master
子账户和账户管理接口调试
Showing
25 changed files
with
427 additions
and
244 deletions
Show diff stats
PersonalCenter/.idea/misc.xml
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | <ConfirmationsSetting value="0" id="Add" /> |
38 | 38 | <ConfirmationsSetting value="0" id="Remove" /> |
39 | 39 | </component> |
40 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
40 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
41 | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
42 | 42 | </component> |
43 | 43 | <component name="ProjectType"> | ... | ... |
PersonalCenter/app/src/androidTest/java/com/hjx/personalcenter/ExampleInstrumentedTest.java
1 | 1 | package com.hjx.personalcenter; |
2 | 2 | |
3 | -import android.content.Context; | |
4 | -import android.support.test.InstrumentationRegistry; | |
5 | -import android.support.test.runner.AndroidJUnit4; | |
6 | - | |
7 | -import org.junit.Test; | |
8 | -import org.junit.runner.RunWith; | |
9 | - | |
10 | -import static org.junit.Assert.*; | |
3 | +import android.os.Handler; | |
4 | +import android.os.Message; | |
11 | 5 | |
12 | 6 | /** |
13 | 7 | * Instrumentation test, which will execute on an Android device. |
14 | 8 | * |
15 | 9 | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> |
16 | 10 | */ |
17 | -@RunWith(AndroidJUnit4.class) | |
18 | 11 | public class ExampleInstrumentedTest { |
19 | - @Test | |
20 | - public void useAppContext() throws Exception { | |
21 | - // Context of the app under test. | |
22 | - Context appContext = InstrumentationRegistry.getTargetContext(); | |
23 | 12 | |
24 | - assertEquals("com.hjx.personalcenter", appContext.getPackageName()); | |
13 | + // handler类接收数据 | |
14 | + Handler handler = new Handler() { | |
15 | + public void handleMessage(Message msg) { | |
16 | + if (msg.what == 1) { | |
17 | + System.out.println("receive...."); | |
18 | + } | |
19 | + }; | |
20 | + }; | |
21 | + | |
22 | + // 线程类 | |
23 | + class ThreadShow implements Runnable { | |
24 | + | |
25 | + @Override | |
26 | + public void run() { | |
27 | + // TODO Auto-generated method stub | |
28 | + while (true) { | |
29 | + try { | |
30 | + Thread.sleep(1000); | |
31 | + Message msg = new Message(); | |
32 | + msg.what = 1; | |
33 | + handler.sendMessage(msg); | |
34 | + System.out.println("send..."); | |
35 | + } catch (Exception e) { | |
36 | + // TODO Auto-generated catch block | |
37 | + e.printStackTrace(); | |
38 | + System.out.println("thread error..."); | |
39 | + } | |
40 | + } | |
41 | + } | |
25 | 42 | } |
26 | 43 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
... | ... | @@ -12,6 +12,7 @@ import android.widget.ImageView; |
12 | 12 | import android.widget.LinearLayout; |
13 | 13 | import android.widget.TextView; |
14 | 14 | |
15 | +import com.facebook.drawee.view.SimpleDraweeView; | |
15 | 16 | import com.hjx.personalcenter.R; |
16 | 17 | import com.hjx.personalcenter.adapter.AccountChildsAdapter; |
17 | 18 | import com.hjx.personalcenter.customdialog.RecyclerViewSpaceItem; |
... | ... | @@ -20,6 +21,8 @@ import com.hjx.personalcenter.db.SaveParam; |
20 | 21 | import com.hjx.personalcenter.http.HttpCode; |
21 | 22 | import com.hjx.personalcenter.http.HttpManager; |
22 | 23 | import com.hjx.personalcenter.model.ChildsInfo; |
24 | +import com.hjx.personalcenter.util.AlertUtils; | |
25 | +import com.hjx.personalcenter.util.GetDevicesUtil; | |
23 | 26 | |
24 | 27 | import java.util.ArrayList; |
25 | 28 | import java.util.List; |
... | ... | @@ -30,10 +33,11 @@ import java.util.List; |
30 | 33 | |
31 | 34 | public class AccountManagementActivity extends AppCompatActivity implements View.OnClickListener { |
32 | 35 | private TextView changbangding,changpassword,usernames, |
33 | - tv_username,tv_grade,tv_school,tv_adress, tv_delete; | |
34 | - private ImageView iv_account_head,cancel; | |
36 | + tv_username,tv_grade,tv_school,tv_adress,tv_changzhu; | |
37 | + private ImageView iv_useing,cancel; | |
38 | + private SimpleDraweeView mSimpleDraweeView; | |
35 | 39 | private RecyclerView listview; |
36 | - private LinearLayout add_accunt; | |
40 | + private LinearLayout add_accunt,ll_zhu_backgrangd; | |
37 | 41 | private AccountChildsAdapter childsAdapter; |
38 | 42 | private ArrayList<ChildsInfo.DataBean> data = new ArrayList<>(); |
39 | 43 | Handler handler = new Handler(){ |
... | ... | @@ -53,14 +57,6 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
53 | 57 | protected void onCreate(Bundle savedInstanceState) { |
54 | 58 | super.onCreate(savedInstanceState); |
55 | 59 | setContentView(R.layout.activity_account_management); |
56 | - String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
57 | - try { | |
58 | - long auserID = Long.parseLong(userID); | |
59 | - HttpManager.getInstance().getchildAccountinfo(this,auserID,handler); | |
60 | - | |
61 | - } catch (NumberFormatException e) { | |
62 | - e.printStackTrace(); | |
63 | - } | |
64 | 60 | |
65 | 61 | initView(); |
66 | 62 | initData(); |
... | ... | @@ -75,28 +71,40 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
75 | 71 | tv_grade = (TextView) findViewById(R.id.tv_account_grade); |
76 | 72 | tv_school = (TextView) findViewById(R.id.tv_account_school); |
77 | 73 | tv_adress = (TextView) findViewById(R.id.tv_account_adress); |
78 | - tv_delete = (TextView) findViewById(R.id.tv_account_delete); | |
79 | - iv_account_head = (ImageView) findViewById(R.id.tv_account_head); | |
74 | + mSimpleDraweeView = (SimpleDraweeView) findViewById(R.id.tv_account_head); | |
75 | + iv_useing = (ImageView) findViewById(R.id.iv_shiyongzhong); | |
80 | 76 | cancel = (ImageView) findViewById(R.id.cancel); |
81 | 77 | add_accunt = (LinearLayout) findViewById(R.id.add_account); |
78 | + ll_zhu_backgrangd = (LinearLayout) findViewById(R.id.ll_zhu_backgrangd); | |
79 | + tv_changzhu = (TextView) findViewById(R.id.change_zhu_account); | |
82 | 80 | listview = (RecyclerView) findViewById(R.id.id_recyclerview_horizontal); |
83 | 81 | } |
84 | 82 | |
85 | 83 | private void initData() { |
86 | - if (Content.changgeaccountflag ==1){ | |
87 | - tv_delete.setText("使用中"); | |
88 | - tv_delete.setEnabled(true); | |
89 | - } | |
90 | 84 | String cunt_username = SaveParam.getInstance().getLoginParam(this,"username"); |
91 | 85 | String tv_usernames = SaveParam.getInstance().getLoginParam(this,SaveParam.USERNAME); |
92 | 86 | String tv_grades = SaveParam.getInstance().getLoginParam(this,SaveParam.GRADES); |
93 | 87 | String tv_schools = SaveParam.getInstance().getLoginParam(this,SaveParam.SCHOOL); |
94 | 88 | String tv_adresss = SaveParam.getInstance().getLoginParam(this,SaveParam.ADRESS); |
89 | + String account = SaveParam.getInstance().getLoginParam(this,SaveParam.ACCOUNT); | |
95 | 90 | usernames.setText(cunt_username); |
96 | 91 | tv_username.setText(tv_usernames); |
97 | 92 | tv_grade.setText(tv_grades); |
98 | 93 | tv_school.setText(tv_schools); |
99 | 94 | tv_adress.setText(tv_adresss); |
95 | + if (account.equals("1")){ | |
96 | + tv_changzhu.setText("使用中"); | |
97 | + tv_changzhu.setEnabled(false); | |
98 | + iv_useing.setVisibility(View.VISIBLE); | |
99 | + ll_zhu_backgrangd.setBackgroundResource(R.drawable.corcle_blue_bg); | |
100 | + }else { | |
101 | + | |
102 | + tv_changzhu.setText("切换主账户"); | |
103 | + tv_changzhu.setEnabled(true); | |
104 | + iv_useing.setVisibility(View.GONE); | |
105 | + ll_zhu_backgrangd.setBackgroundResource(R.drawable.corcle_black_bg); | |
106 | + } | |
107 | + | |
100 | 108 | |
101 | 109 | LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); |
102 | 110 | linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); |
... | ... | @@ -104,15 +112,24 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
104 | 112 | childsAdapter = new AccountChildsAdapter(data,this); |
105 | 113 | listview.addItemDecoration(new RecyclerViewSpaceItem(10)); |
106 | 114 | listview.setAdapter(childsAdapter); |
115 | + childsAdapter.setOnItemClickListener(new AccountChildsAdapter.OnItemClickListener() { | |
116 | + @Override | |
117 | + public void onItemClick(View view, int position) { | |
118 | + | |
119 | + AlertUtils.showToast(AccountManagementActivity.this,"你点击了"+data.get(position)); | |
120 | + } | |
121 | + }); | |
107 | 122 | |
108 | 123 | } |
109 | 124 | |
125 | + | |
110 | 126 | private void initLister() { |
111 | 127 | changbangding.setOnClickListener(this); |
112 | 128 | changpassword.setOnClickListener(this); |
113 | - tv_delete.setOnClickListener(this); | |
114 | 129 | cancel.setOnClickListener(this); |
115 | 130 | add_accunt.setOnClickListener(this); |
131 | + tv_changzhu.setOnClickListener(this); | |
132 | + | |
116 | 133 | |
117 | 134 | |
118 | 135 | } |
... | ... | @@ -141,9 +158,20 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
141 | 158 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
142 | 159 | |
143 | 160 | break; |
144 | - case R.id.tv_account_delete: | |
161 | + case R.id.change_zhu_account: | |
145 | 162 | Content.changgeaccountflag =1; |
163 | + String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
146 | 164 | SaveParam.getInstance().saveLoginParam(this,SaveParam.ACCOUNT,"1"); |
165 | + String devicenumber = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); | |
166 | + try { | |
167 | + long auserID = Long.parseLong(userID); | |
168 | + HttpManager.getInstance().Accountinfo(AccountManagementActivity.this,auserID, | |
169 | + devicenumber,1); | |
170 | + | |
171 | + } catch (NumberFormatException e) { | |
172 | + e.printStackTrace(); | |
173 | + } | |
174 | + | |
147 | 175 | |
148 | 176 | break; |
149 | 177 | case R.id.cancel: |
... | ... | @@ -153,4 +181,18 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
153 | 181 | } |
154 | 182 | |
155 | 183 | } |
184 | + | |
185 | + @Override | |
186 | + protected void onResume() { | |
187 | + super.onResume(); | |
188 | + String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
189 | + String devicenumber = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); | |
190 | + try { | |
191 | + long auserID = Long.parseLong(userID); | |
192 | + HttpManager.getInstance().getchildAccountinfo(this,auserID,devicenumber,handler); | |
193 | + | |
194 | + } catch (NumberFormatException e) { | |
195 | + e.printStackTrace(); | |
196 | + } | |
197 | + } | |
156 | 198 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/BangDingCode.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.graphics.Bitmap; |
5 | 4 | import android.os.Bundle; |
5 | +import android.support.v7.app.AppCompatActivity; | |
6 | 6 | import android.util.DisplayMetrics; |
7 | 7 | import android.widget.ImageView; |
8 | 8 | import android.widget.LinearLayout; |
... | ... | @@ -17,7 +17,7 @@ import java.io.File; |
17 | 17 | * Created by h on 2017/8/31. |
18 | 18 | */ |
19 | 19 | |
20 | -public class BangDingCode extends Activity{ | |
20 | +public class BangDingCode extends AppCompatActivity { | |
21 | 21 | private ImageView EQpicture; |
22 | 22 | File file; |
23 | 23 | @Override | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeEletronicCardPhoneActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.os.Bundle; |
4 | +import android.support.v7.app.AppCompatActivity; | |
5 | 5 | |
6 | 6 | import com.hjx.personalcenter.R; |
7 | 7 | |
... | ... | @@ -9,7 +9,7 @@ import com.hjx.personalcenter.R; |
9 | 9 | * Created by h on 2017/8/9. |
10 | 10 | */ |
11 | 11 | |
12 | -public class ChangeEletronicCardPhoneActivity extends Activity { | |
12 | +public class ChangeEletronicCardPhoneActivity extends AppCompatActivity { | |
13 | 13 | |
14 | 14 | |
15 | 15 | @Override | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.os.Bundle; |
4 | +import android.support.v7.app.AppCompatActivity; | |
5 | 5 | import android.text.TextUtils; |
6 | 6 | import android.text.method.HideReturnsTransformationMethod; |
7 | 7 | import android.text.method.PasswordTransformationMethod; |
... | ... | @@ -11,16 +11,16 @@ import android.widget.EditText; |
11 | 11 | import android.widget.ImageView; |
12 | 12 | |
13 | 13 | import com.hjx.personalcenter.R; |
14 | +import com.hjx.personalcenter.db.SaveParam; | |
14 | 15 | import com.hjx.personalcenter.http.HttpManager; |
15 | 16 | import com.hjx.personalcenter.util.AlertUtils; |
16 | 17 | import com.hjx.personalcenter.util.PasswordCheckUtils; |
17 | -import com.hjx.personalcenter.db.SaveParam; | |
18 | 18 | |
19 | 19 | /**修改密码 |
20 | 20 | * Created by h on 2017/6/27. |
21 | 21 | */ |
22 | 22 | |
23 | -public class ChangePasswordActivity extends Activity implements View.OnClickListener { | |
23 | +public class ChangePasswordActivity extends AppCompatActivity implements View.OnClickListener { | |
24 | 24 | private EditText old_pwd,newpassword,newpassword1; |
25 | 25 | private Button sub_change_pwd; |
26 | 26 | private ImageView back_change_pwd,eyes_iv_change1; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
... | ... | @@ -24,6 +24,7 @@ import com.hjx.personalcenter.model.CityInfo; |
24 | 24 | import com.hjx.personalcenter.model.CountyInfo; |
25 | 25 | import com.hjx.personalcenter.model.ProvinceInfo; |
26 | 26 | import com.hjx.personalcenter.util.AlertUtils; |
27 | +import com.hjx.personalcenter.util.GetDate; | |
27 | 28 | |
28 | 29 | import java.text.SimpleDateFormat; |
29 | 30 | import java.util.ArrayList; |
... | ... | @@ -67,6 +68,8 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements |
67 | 68 | } |
68 | 69 | |
69 | 70 | private void initData() { |
71 | + GetDate date = new GetDate(); | |
72 | + tv_buy_time.setText(date.getYMD().toString()); | |
70 | 73 | |
71 | 74 | } |
72 | 75 | |
... | ... | @@ -123,7 +126,8 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements |
123 | 126 | public void onClick(View v) { |
124 | 127 | switch (v.getId()){ |
125 | 128 | case R.id.lineL_buy_time: |
126 | - pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view | |
129 | + | |
130 | + //pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view | |
127 | 131 | break; |
128 | 132 | case R.id.btn_change_info: |
129 | 133 | String info1 =username.getText().toString().trim(); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.content.Intent; |
5 | 4 | import android.os.Bundle; |
5 | +import android.support.v7.app.AppCompatActivity; | |
6 | 6 | import android.view.View; |
7 | 7 | import android.widget.Button; |
8 | 8 | import android.widget.ImageView; |
... | ... | @@ -17,7 +17,7 @@ import com.hjx.personalcenter.util.GetDevicesUtil; |
17 | 17 | * Created by h on 2017/8/11. |
18 | 18 | */ |
19 | 19 | |
20 | -public class ElectronicCardInfoOKActivity extends Activity implements View.OnClickListener { | |
20 | +public class ElectronicCardInfoOKActivity extends AppCompatActivity implements View.OnClickListener { | |
21 | 21 | private Button btn_finish,btn_bangding; |
22 | 22 | private ImageView iv_last_step; |
23 | 23 | private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,shopadress,phone,tlePhone; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.content.Intent; |
5 | 4 | import android.os.Bundle; |
6 | 5 | import android.os.Handler; |
7 | 6 | import android.os.Message; |
7 | +import android.support.v7.app.AppCompatActivity; | |
8 | 8 | import android.text.TextUtils; |
9 | 9 | import android.view.View; |
10 | 10 | import android.widget.Button; |
... | ... | @@ -26,7 +26,7 @@ import org.json.JSONObject; |
26 | 26 | * Created by h on 2017/8/9. |
27 | 27 | */ |
28 | 28 | |
29 | -public class ElectronicCardValidationActivity extends Activity implements View.OnClickListener { | |
29 | +public class ElectronicCardValidationActivity extends AppCompatActivity implements View.OnClickListener { | |
30 | 30 | private Button btn_card_valiyanzhen,get_authcode; |
31 | 31 | private EditText phonenumber,anth_6num;//;//密码 |
32 | 32 | private TextView menu_title; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ForgotPasswordActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.os.Bundle; |
5 | 4 | import android.os.Handler; |
6 | 5 | import android.os.Message; |
6 | +import android.support.v7.app.AppCompatActivity; | |
7 | 7 | import android.text.TextUtils; |
8 | 8 | import android.text.method.HideReturnsTransformationMethod; |
9 | 9 | import android.text.method.PasswordTransformationMethod; |
... | ... | @@ -28,7 +28,7 @@ import org.json.JSONObject; |
28 | 28 | * Created by h on 2017/6/17. |
29 | 29 | */ |
30 | 30 | |
31 | -public class ForgotPasswordActivity extends Activity implements View.OnClickListener { | |
31 | +public class ForgotPasswordActivity extends AppCompatActivity implements View.OnClickListener { | |
32 | 32 | private ImageView back_forgit, iv_pwd_change; |
33 | 33 | private EditText forot_pwd_phone, forot_pwd_anthcode, forot_pwd_pwd, forot_pwd_pwd2; |
34 | 34 | private Button forot_pwd_sub, forot_pwd_getanthcode; |
... | ... | @@ -84,7 +84,7 @@ public class ForgotPasswordActivity extends Activity implements View.OnClickList |
84 | 84 | AlertUtils.showToast(ForgotPasswordActivity.this, "该手机号没有注册"); |
85 | 85 | } |
86 | 86 | break; |
87 | - case 1: | |
87 | + case 21: | |
88 | 88 | forot_pwd_getanthcode.setEnabled(false); |
89 | 89 | forot_pwd_getanthcode.setClickable(false); |
90 | 90 | forot_pwd_getanthcode.setText(Integer.toString(i--) + " s"); |
... | ... | @@ -218,7 +218,7 @@ public class ForgotPasswordActivity extends Activity implements View.OnClickList |
218 | 218 | Thread.sleep(1000); |
219 | 219 | // thread.interrupt(); |
220 | 220 | Message msg = new Message(); |
221 | - msg.what = 1; | |
221 | + msg.what = 21; | |
222 | 222 | handler.sendMessage(msg); |
223 | 223 | System.out.println("内存泄露..."); |
224 | 224 | } catch (Exception e) { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java
... | ... | @@ -30,14 +30,15 @@ import com.hjx.personalcenter.util.GetDevicesUtil; |
30 | 30 | |
31 | 31 | import java.util.ArrayList; |
32 | 32 | |
33 | -/**填写注册信息 熊巍 | |
33 | +/** | |
34 | + * 填写注册信息 熊巍 | |
34 | 35 | * Created by h on 2017/8/9. |
35 | 36 | */ |
36 | 37 | |
37 | -public class RegisterInfoActivity extends AppCompatActivity implements View.OnClickListener,DialogCallBack.GradeCallBack,DialogCallBack.ProvincesCallBack | |
38 | - ,DialogCallBack.CitysCallBack,DialogCallBack.CountryCallBack,DialogCallBack.SchoolCallBack{ | |
38 | +public class RegisterInfoActivity extends AppCompatActivity implements View.OnClickListener, DialogCallBack.GradeCallBack, DialogCallBack.ProvincesCallBack | |
39 | + , DialogCallBack.CitysCallBack, DialogCallBack.CountryCallBack, DialogCallBack.SchoolCallBack { | |
39 | 40 | private EditText et_username; |
40 | - private TextView et_region,et_grade,et_school; | |
41 | + private TextView et_region, et_grade, et_school; | |
41 | 42 | private Button btn_ok; |
42 | 43 | |
43 | 44 | @Override |
... | ... | @@ -60,7 +61,7 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
60 | 61 | } |
61 | 62 | |
62 | 63 | private void initData() { |
63 | - if (Content.accountflag ==2){ | |
64 | + if (Content.accountflag == 2) { | |
64 | 65 | btn_ok.setText("提交"); |
65 | 66 | |
66 | 67 | } |
... | ... | @@ -82,7 +83,7 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
82 | 83 | String register2 = et_region.getText().toString().trim(); |
83 | 84 | String register3 = et_grade.getText().toString().trim(); |
84 | 85 | String register4 = et_school.getText().toString().trim(); |
85 | - switch (v.getId()){ | |
86 | + switch (v.getId()) { | |
86 | 87 | case R.id.et_region: |
87 | 88 | choiseregion(); |
88 | 89 | break; |
... | ... | @@ -90,54 +91,56 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
90 | 91 | choisegrade(); |
91 | 92 | break; |
92 | 93 | case R.id.et_school: |
93 | - if (TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3)){ | |
94 | + if (TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3)) { | |
94 | 95 | AlertUtils.showToast(RegisterInfoActivity.this, "请选择年级和地址"); |
95 | 96 | return; |
96 | - }else { | |
97 | + } else { | |
97 | 98 | choiseschool(); |
98 | 99 | } |
99 | 100 | |
100 | 101 | break; |
101 | 102 | case R.id.btn_ok: |
102 | 103 | if (TextUtils.isEmpty(register1) || |
103 | - TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3)){ | |
104 | + TextUtils.isEmpty(register2) || TextUtils.isEmpty(register3)) { | |
104 | 105 | AlertUtils.showToast(RegisterInfoActivity.this, "请将必填项填写完整"); |
105 | 106 | return; |
106 | - }else{ | |
107 | + } else { | |
107 | 108 | String register5 = et_username.getText().toString().trim(); |
108 | 109 | String register6 = et_region.getText().toString().trim(); |
109 | 110 | String register7 = et_grade.getText().toString().trim(); |
110 | 111 | String register8 = et_school.getText().toString().trim(); |
111 | - if (Content.accountflag ==2){ | |
112 | - String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
113 | - String grade = SaveParam.getInstance().getLoginParam(this,SaveParam.GRADENS); | |
114 | - String School = SaveParam.getInstance().getLoginParam(this,SaveParam.SCHOOOlID); | |
115 | - if (TextUtils.isEmpty(register8)){ | |
116 | - School = "0"; | |
117 | - } | |
112 | + if (Content.accountflag == 2) { | |
113 | + String userID = SaveParam.getInstance().getLoginParam(this, "userId"); | |
114 | + String grade = SaveParam.getInstance().getLoginParam(this, SaveParam.GRADENS); | |
115 | + String School = SaveParam.getInstance().getLoginParam(this, SaveParam.SCHOOOlID); | |
118 | 116 | String regionId = SaveParam.getInstance().getLoginParam(this, SaveParam.COUNTRY); |
119 | 117 | String regionId1 = SaveParam.getInstance().getLoginParam(this, SaveParam.CITYS); |
120 | - String devicenumber =GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); | |
118 | + String devicenumber = GetDevicesUtil.getDevicesInfo(this).getDeviceNumber(); | |
121 | 119 | if (regionId == null) { |
122 | 120 | regionId = regionId1; |
123 | 121 | } |
124 | 122 | |
125 | 123 | try { |
124 | + Object schoolss; | |
126 | 125 | long auserID = Long.parseLong(userID); |
127 | 126 | long grades = Long.parseLong(grade); |
128 | - long Schools = Long.parseLong(School); | |
127 | + if (TextUtils.isEmpty(register8)) { | |
128 | + schoolss = null; | |
129 | + } else { | |
130 | + schoolss = Long.parseLong(School); | |
131 | + } | |
129 | 132 | long regionIds = Long.parseLong(regionId); |
130 | - 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", | |
131 | - register5,grades,Schools,regionIds,devicenumber,register6); | |
133 | + 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", | |
134 | + register5, grades, schoolss, regionIds, devicenumber, register6); | |
132 | 135 | |
133 | 136 | } catch (NumberFormatException e) { |
134 | 137 | e.printStackTrace(); |
135 | 138 | } |
136 | 139 | |
137 | - }else { | |
140 | + } else { | |
138 | 141 | saveinfo(); |
139 | 142 | Intent intent = new Intent(); |
140 | - intent.setClass(RegisterInfoActivity.this,ChoiseTextBookActivity.class); | |
143 | + intent.setClass(RegisterInfoActivity.this, ChoiseTextBookActivity.class); | |
141 | 144 | startActivity(intent); |
142 | 145 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
143 | 146 | } |
... | ... | @@ -148,16 +151,22 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
148 | 151 | } |
149 | 152 | |
150 | 153 | } |
154 | + | |
155 | + @Override | |
156 | + protected void onResume() { | |
157 | + super.onResume(); | |
158 | + } | |
159 | + | |
151 | 160 | //保存个人信息 |
152 | 161 | private void saveinfo() { |
153 | 162 | String register1 = et_username.getText().toString().trim(); |
154 | 163 | String register2 = et_region.getText().toString().trim(); |
155 | 164 | String register3 = et_grade.getText().toString().trim(); |
156 | 165 | String register4 = et_school.getText().toString().trim(); |
157 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.USERNAME,register1); | |
158 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.ADRESS,register2); | |
159 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.GRADES,register3); | |
160 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.SCHOOL,register4); | |
166 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.USERNAME, register1); | |
167 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.ADRESS, register2); | |
168 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.GRADES, register3); | |
169 | + SaveParam.getInstance().saveLoginParam(this, SaveParam.SCHOOL, register4); | |
161 | 170 | |
162 | 171 | } |
163 | 172 | |
... | ... | @@ -166,11 +175,13 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
166 | 175 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) RegisterInfoActivity.this).show(getSupportFragmentManager(), "ProvinceListDialog"); |
167 | 176 | |
168 | 177 | } |
178 | + | |
169 | 179 | //选择年级 |
170 | 180 | private void choisegrade() { |
171 | 181 | GradeListDialog.getInstance((DialogCallBack.GradeCallBack) this).show(getSupportFragmentManager(), "GradeListDialog"); |
172 | 182 | |
173 | 183 | } |
184 | + | |
174 | 185 | //选择学校 |
175 | 186 | private void choiseschool() { |
176 | 187 | SchoolListDialog.getInstance((DialogCallBack.SchoolCallBack) this).show(getSupportFragmentManager(), "SchoolListDialog"); |
... | ... | @@ -180,12 +191,13 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
180 | 191 | |
181 | 192 | @Override |
182 | 193 | public void provinceOnItemClick(ArrayList<ProvinceInfo.ProvincesBean> data, int position, int type) { |
183 | - String regionName = data.get(position).getRegionName(); | |
184 | - SaveParam.getInstance().saveLoginParam(this,"sheng",regionName); | |
185 | - CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog"); | |
194 | + String regionName = data.get(position).getRegionName(); | |
195 | + SaveParam.getInstance().saveLoginParam(this, "sheng", regionName); | |
196 | + CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog"); | |
186 | 197 | |
187 | 198 | |
188 | 199 | } |
200 | + | |
189 | 201 | @Override |
190 | 202 | public boolean onKeyUp(int keyCode, KeyEvent event) { |
191 | 203 | if (keyCode == KeyEvent.KEYCODE_BACK) { |
... | ... | @@ -205,21 +217,21 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
205 | 217 | @Override |
206 | 218 | public void province1OnItemClick(ArrayList<CityInfo.CitiesBean> data, int position, int type) { |
207 | 219 | String regionName = data.get(position).getRegionName(); |
208 | - String provice = SaveParam.getInstance().getLoginParam(this,"sheng"); | |
209 | - SaveParam.getInstance().saveLoginParam(this,"shi",regionName); | |
220 | + String provice = SaveParam.getInstance().getLoginParam(this, "sheng"); | |
221 | + SaveParam.getInstance().saveLoginParam(this, "shi", regionName); | |
210 | 222 | CountryDialog.getInstance((DialogCallBack.CountryCallBack) this).show(getSupportFragmentManager(), "CountryDialog"); |
211 | 223 | et_region.setText(""); |
212 | - et_region.setText(provice+regionName); | |
224 | + et_region.setText(provice + regionName); | |
213 | 225 | |
214 | 226 | } |
215 | 227 | |
216 | 228 | @Override |
217 | 229 | public void province2OnItemClick(ArrayList<CountyInfo.CountiesBean> data, int position, int type) { |
218 | 230 | String regionName = data.get(position).getRegionName(); |
219 | - String provices = SaveParam.getInstance().getLoginParam(this,"sheng"); | |
220 | - String citys = SaveParam.getInstance().getLoginParam(this,"shi"); | |
231 | + String provices = SaveParam.getInstance().getLoginParam(this, "sheng"); | |
232 | + String citys = SaveParam.getInstance().getLoginParam(this, "shi"); | |
221 | 233 | et_region.setText(""); |
222 | - et_region.setText(provices+citys+regionName); | |
234 | + et_region.setText(provices + citys + regionName); | |
223 | 235 | |
224 | 236 | } |
225 | 237 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/TheStartPageActivity.java
1 | 1 | package com.hjx.personalcenter.activity; |
2 | 2 | |
3 | -import android.app.Activity; | |
4 | 3 | import android.content.Intent; |
5 | 4 | import android.os.Bundle; |
5 | +import android.support.v7.app.AppCompatActivity; | |
6 | 6 | import android.view.View; |
7 | 7 | import android.widget.Button; |
8 | 8 | |
... | ... | @@ -12,7 +12,7 @@ import com.hjx.personalcenter.R; |
12 | 12 | * Created by h on 2017/8/10. |
13 | 13 | */ |
14 | 14 | |
15 | -public class TheStartPageActivity extends Activity implements View.OnClickListener { | |
15 | +public class TheStartPageActivity extends AppCompatActivity implements View.OnClickListener { | |
16 | 16 | private Button btn_start; |
17 | 17 | @Override |
18 | 18 | protected void onCreate(Bundle savedInstanceState) { | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/AccountChildsAdapter.java
... | ... | @@ -6,6 +6,8 @@ import android.support.v7.widget.RecyclerView; |
6 | 6 | import android.view.LayoutInflater; |
7 | 7 | import android.view.View; |
8 | 8 | import android.view.ViewGroup; |
9 | +import android.widget.ImageView; | |
10 | +import android.widget.LinearLayout; | |
9 | 11 | import android.widget.TextView; |
10 | 12 | |
11 | 13 | import com.facebook.drawee.view.SimpleDraweeView; |
... | ... | @@ -14,6 +16,7 @@ import com.hjx.personalcenter.db.Content; |
14 | 16 | import com.hjx.personalcenter.db.SaveParam; |
15 | 17 | import com.hjx.personalcenter.http.HttpManager; |
16 | 18 | import com.hjx.personalcenter.model.ChildsInfo; |
19 | +import com.hjx.personalcenter.util.GetDevicesUtil; | |
17 | 20 | import com.mylhyl.circledialog.CircleDialog; |
18 | 21 | |
19 | 22 | import java.util.ArrayList; |
... | ... | @@ -23,7 +26,7 @@ import java.util.List; |
23 | 26 | * Created by h on 2017/8/26. |
24 | 27 | */ |
25 | 28 | |
26 | -public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdapter.AccountChildsHolder> { | |
29 | +public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdapter.AccountChildsHolder> implements View.OnClickListener { | |
27 | 30 | private List<ChildsInfo.DataBean> specailList; |
28 | 31 | private LayoutInflater mInflater; |
29 | 32 | private Context mContext ; |
... | ... | @@ -36,6 +39,14 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
36 | 39 | |
37 | 40 | public OnItemClickListener mOnItemClickListener; |
38 | 41 | |
42 | + @Override | |
43 | + public void onClick(View v) { | |
44 | + if (mOnItemClickListener ==null){ | |
45 | + mOnItemClickListener.onItemClick(v, (int) v.getTag()); | |
46 | + } | |
47 | + | |
48 | + } | |
49 | + | |
39 | 50 | public interface OnItemClickListener { |
40 | 51 | void onItemClick(View view, int position); |
41 | 52 | } |
... | ... | @@ -52,6 +63,7 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
52 | 63 | @Override |
53 | 64 | public AccountChildsHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
54 | 65 | View view = mInflater.inflate(R.layout.recycler_childaccunt_item_view, parent, false); |
66 | + view.setOnClickListener(this); | |
55 | 67 | AccountChildsHolder holder = new AccountChildsHolder(view); |
56 | 68 | return holder; |
57 | 69 | } |
... | ... | @@ -65,6 +77,19 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
65 | 77 | holder.iv_child_grade.setText(bean.getGrade()); |
66 | 78 | holder.iv_child_school.setText(bean.getSchool()); |
67 | 79 | holder.iv_child_adress.setText(bean.getRegion()); |
80 | + if ("已使用".equals(bean.getStatus())){ | |
81 | + holder.chang_account.setText("使用中"); | |
82 | + holder.chang_account.setEnabled(false); | |
83 | + holder.delete_account.setEnabled(false); | |
84 | + holder.iv_using_pic.setVisibility(View.VISIBLE); | |
85 | + holder.ll_backgrangd.setBackgroundResource(R.drawable.corcle_blue_bg); | |
86 | + }else { | |
87 | + holder.chang_account.setText("切换用户"); | |
88 | + holder.chang_account.setEnabled(true); | |
89 | + holder.delete_account.setEnabled(true); | |
90 | + holder.iv_using_pic.setVisibility(View.GONE); | |
91 | + holder.ll_backgrangd.setBackgroundResource(R.drawable.corcle_black_bg); | |
92 | + } | |
68 | 93 | holder.delete_account.setOnClickListener(new View.OnClickListener() { |
69 | 94 | @Override |
70 | 95 | public void onClick(View v) { |
... | ... | @@ -100,7 +125,9 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
100 | 125 | public void onClick(View v) { |
101 | 126 | Content.changgeaccountflag =2; |
102 | 127 | SaveParam.getInstance().saveLoginParam(mContext,SaveParam.ACCOUNT,"2"); |
103 | - HttpManager.getInstance().changechildAccountinfo(mContext,bean.getSubAccountId(),bean.getParentId()); | |
128 | + String devicenumber = GetDevicesUtil.getDevicesInfo(mContext).getDeviceNumber(); | |
129 | + HttpManager.getInstance().changechildAccountinfo(mContext,bean.getSubAccountId(),bean.getParentId(), | |
130 | + devicenumber,2); | |
104 | 131 | } |
105 | 132 | }) |
106 | 133 | .show(); |
... | ... | @@ -115,10 +142,13 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
115 | 142 | |
116 | 143 | @Override |
117 | 144 | public int getItemCount() { |
145 | + | |
118 | 146 | return specailList.size(); |
119 | 147 | } |
120 | 148 | |
121 | 149 | class AccountChildsHolder extends RecyclerView.ViewHolder { |
150 | + ImageView iv_using_pic; | |
151 | + LinearLayout ll_backgrangd; | |
122 | 152 | SimpleDraweeView mSimpleDraweeView; |
123 | 153 | TextView iv_child_name, iv_child_grade, iv_child_school, iv_child_adress, |
124 | 154 | delete_account,chang_account; |
... | ... | @@ -131,10 +161,8 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
131 | 161 | iv_child_adress = (TextView) itemView.findViewById(R.id.iv_child_adress); |
132 | 162 | delete_account = (TextView) itemView.findViewById(R.id.delete_child_account); |
133 | 163 | chang_account = (TextView) itemView.findViewById(R.id.chang_account); |
134 | - if (Content.changgeaccountflag==2){ | |
135 | - chang_account.setText("使用中"); | |
136 | - chang_account.setEnabled(true); | |
137 | - } | |
164 | + iv_using_pic = (ImageView) itemView.findViewById(R.id.iv_using_pic); | |
165 | + ll_backgrangd = (LinearLayout) itemView.findViewById(R.id.ll_backgrangd); | |
138 | 166 | |
139 | 167 | } |
140 | 168 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/CitysAdapter.java
... | ... | @@ -53,7 +53,7 @@ public class CitysAdapter extends BaseAdapter { |
53 | 53 | holder = (ProvincesAdapter.ViewHolder) convertView.getTag(); |
54 | 54 | } |
55 | 55 | |
56 | - holder.nameText.setText(objects.get(position).getRegionName()+"市"); | |
56 | + holder.nameText.setText(objects.get(position).getRegionName()); | |
57 | 57 | |
58 | 58 | return convertView; |
59 | 59 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/CountryAdapter.java
... | ... | @@ -7,7 +7,6 @@ import android.widget.BaseAdapter; |
7 | 7 | import android.widget.TextView; |
8 | 8 | |
9 | 9 | import com.hjx.personalcenter.R; |
10 | -import com.hjx.personalcenter.model.CityInfo; | |
11 | 10 | import com.hjx.personalcenter.model.CountyInfo; |
12 | 11 | |
13 | 12 | import java.util.ArrayList; |
... | ... | @@ -54,7 +53,7 @@ public class CountryAdapter extends BaseAdapter{ |
54 | 53 | holder = (ProvincesAdapter.ViewHolder) convertView.getTag(); |
55 | 54 | } |
56 | 55 | |
57 | - holder.nameText.setText(objects.get(position).getRegionName()+"区"); | |
56 | + holder.nameText.setText(objects.get(position).getRegionName()); | |
58 | 57 | |
59 | 58 | return convertView; |
60 | 59 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/ProvincesAdapter.java
... | ... | @@ -53,7 +53,7 @@ public class ProvincesAdapter extends BaseAdapter { |
53 | 53 | holder = (ProvincesAdapter.ViewHolder) convertView.getTag(); |
54 | 54 | } |
55 | 55 | |
56 | - holder.nameText.setText(objects.get(position).getRegionName()+"省"); | |
56 | + holder.nameText.setText(objects.get(position).getRegionName()); | |
57 | 57 | |
58 | 58 | return convertView; |
59 | 59 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java
... | ... | @@ -23,7 +23,6 @@ import com.hjx.personalcenter.customdialog.SchoolListDialog; |
23 | 23 | import com.hjx.personalcenter.db.SaveParam; |
24 | 24 | import com.hjx.personalcenter.http.HttpManager; |
25 | 25 | import com.hjx.personalcenter.interfaces.DialogCallBack; |
26 | -import com.hjx.personalcenter.model.ChangeInfo; | |
27 | 26 | import com.hjx.personalcenter.model.CityInfo; |
28 | 27 | import com.hjx.personalcenter.model.CountyInfo; |
29 | 28 | import com.hjx.personalcenter.model.GradeInfo; |
... | ... | @@ -31,13 +30,13 @@ import com.hjx.personalcenter.model.ProvinceInfo; |
31 | 30 | import com.hjx.personalcenter.model.SchoolInfo; |
32 | 31 | import com.hjx.personalcenter.util.AlertUtils; |
33 | 32 | import com.hjx.personalcenter.util.BrithdayStar; |
33 | +import com.hjx.personalcenter.util.GetDevicesUtil; | |
34 | 34 | import com.mylhyl.circledialog.CircleDialog; |
35 | 35 | import com.mylhyl.circledialog.callback.ConfigDialog; |
36 | 36 | import com.mylhyl.circledialog.params.DialogParams; |
37 | 37 | |
38 | 38 | import org.apache.http.util.TextUtils; |
39 | 39 | |
40 | -import java.io.UnsupportedEncodingException; | |
41 | 40 | import java.text.SimpleDateFormat; |
42 | 41 | import java.util.ArrayList; |
43 | 42 | import java.util.Date; |
... | ... | @@ -173,13 +172,13 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
173 | 172 | } else { |
174 | 173 | |
175 | 174 | int a = 0, b = 0; |
176 | - long c = 0; | |
175 | + int d =1; | |
176 | + Long f = null; | |
177 | 177 | //保存星座 |
178 | 178 | BrithdayStar brithdayStar = new BrithdayStar(); |
179 | 179 | String s = brithdayStar.getConstellations(tv_useinfo_birthday.getText().toString()); |
180 | 180 | SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.CONSTELLATION, s); |
181 | 181 | |
182 | - ChangeInfo changeinfo = new ChangeInfo(); | |
183 | 182 | String regionId = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.COUNTRY); |
184 | 183 | String regionId1 = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.CITYS); |
185 | 184 | if (regionId == null) { |
... | ... | @@ -187,44 +186,35 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
187 | 186 | } |
188 | 187 | String grade = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); |
189 | 188 | String schoolid = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.SCHOOOlID); |
190 | - if (TextUtils.isEmpty(presonal6)){ | |
191 | - schoolid = "0"; | |
192 | - } | |
193 | - ChangeInfo.SchoolBean changeinfo2 = new ChangeInfo.SchoolBean(); | |
194 | - try { | |
195 | - a = Integer.parseInt(regionId); | |
196 | - b = Integer.parseInt(grade); | |
197 | - c = Long.parseLong(schoolid); | |
198 | - } catch (NumberFormatException e) { | |
199 | - e.printStackTrace(); | |
200 | - } | |
189 | + String type = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.ACCOUNT); | |
201 | 190 | String userID = SaveParam.getInstance().getLoginParam(getActivity(), "userId"); |
202 | - | |
203 | - changeinfo.setId(userID); | |
204 | - changeinfo.setNickname(presonal1); | |
205 | - changeinfo.setRegionId(a); | |
206 | - changeinfo.setGradeId(b); | |
207 | - changeinfo2.setSchoolId(c); | |
191 | + String devicenumber = GetDevicesUtil.getDevicesInfo(getActivity()).getDeviceNumber(); | |
192 | + String changeinfo = null; | |
208 | 193 | if ("男".equals(presonal3)) { |
209 | - changeinfo.setGender("0"); | |
194 | + changeinfo="male"; | |
210 | 195 | } else { |
211 | - changeinfo.setGender("1"); | |
196 | + changeinfo=("female"); | |
212 | 197 | } |
213 | - changeinfo.setBirthday(presonal5); | |
214 | - ChangeInfo.ContactBean changeinfo1 = new ChangeInfo.ContactBean(); | |
215 | - changeinfo1.setQq(presonal8); | |
216 | - changeinfo.setRegionName(presonal4 + presonal2); | |
217 | - changeinfo.setSchool(changeinfo2); | |
218 | - changeinfo.setContact(changeinfo1); | |
219 | - | |
220 | 198 | try { |
199 | + Object c ; | |
200 | + a = Integer.parseInt(regionId); | |
201 | + b = Integer.parseInt(grade); | |
202 | + | |
203 | + if (TextUtils.isEmpty(presonal6)){ | |
204 | + c = null; | |
205 | + }else { | |
206 | + c = Long.parseLong(schoolid); | |
207 | + } | |
208 | + d = Integer.parseInt(type); | |
209 | + f = Long.parseLong(userID); | |
221 | 210 | //提交个人信息 |
222 | - HttpManager.getInstance().changepresonalinfo(getActivity(), changeinfo); | |
223 | - } catch (UnsupportedEncodingException e) { | |
211 | + HttpManager.getInstance().changepresonalinfo(getActivity(), | |
212 | + f,d,presonal1,presonal5,b, a,c,presonal8,changeinfo,presonal4 + presonal2,devicenumber); | |
213 | + | |
214 | + } catch (Exception e) { | |
224 | 215 | e.printStackTrace(); |
225 | 216 | } |
226 | 217 | |
227 | - | |
228 | 218 | break; |
229 | 219 | } |
230 | 220 | } |
... | ... | @@ -259,7 +249,7 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
259 | 249 | // .setRangDate(startDate, endDate) |
260 | 250 | .setBackgroundId(0x80000000) //设置外部遮罩颜色 |
261 | 251 | .setDecorView(null) |
262 | - .setTitleText("购买日期") | |
252 | + .setTitleText("出生日期") | |
263 | 253 | .setTitleSize(22) |
264 | 254 | .setCancelColor(Color.GRAY) |
265 | 255 | .setSubCalSize(22) | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpKey.java
... | ... | @@ -38,6 +38,12 @@ public class HttpKey { |
38 | 38 | public static String REGION = "regionId"; |
39 | 39 | public static String DEVINUMBER = "deviceNumber"; |
40 | 40 | public static String REGIONNAME = "regionName"; |
41 | + //提交个人信息 | |
42 | + public static String ID = "id"; | |
43 | + public static String BIRDays = "birthday"; | |
44 | + public static String QQ = "qq"; | |
45 | + public static String GENDER = "gender"; | |
46 | + | |
41 | 47 | |
42 | 48 | |
43 | 49 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
... | ... | @@ -873,18 +873,28 @@ public class HttpManager { |
873 | 873 | } |
874 | 874 | |
875 | 875 | //修改个人信息 |
876 | - public void changepresonalinfo(final Context mContext, Object object) throws UnsupportedEncodingException { | |
877 | - Gson gson = new Gson(); | |
878 | - String jsonObject = gson.toJson(object); | |
879 | - Log.e("test", "onSuccess" + jsonObject); | |
876 | + public void changepresonalinfo(final Context mContext, Long id, int type | |
877 | + ,String name,String birthday,int gradeId,long regionId, | |
878 | + Object schoolId,String qq,String gender | |
879 | + ,String regionName,String devicenumber) throws UnsupportedEncodingException { | |
880 | 880 | mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...", |
881 | 881 | false, true, null); |
882 | - ByteArrayEntity entity = null; | |
883 | - entity = new ByteArrayEntity(jsonObject.getBytes("UTF-8")); | |
884 | - entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); | |
882 | + RequestParams params = new RequestParams(); | |
885 | 883 | |
884 | + params.put(HttpKey.USEID, id); | |
885 | + params.put(HttpKey.TYPE, type); | |
886 | + params.put(HttpKey.NAME, name); | |
887 | + params.put(HttpKey.BIRDays, birthday); | |
888 | + params.put(HttpKey.GRADE, gradeId); | |
889 | + params.put(HttpKey.REGION, regionId); | |
890 | + params.put(HttpKey.SCHOOL, schoolId); | |
891 | + params.put(HttpKey.QQ, qq); | |
892 | + params.put(HttpKey.GENDER, gender); | |
893 | + params.put(HttpKey.REGIONNAME, regionName); | |
894 | + params.put(HttpKey.DEVINUMBER, devicenumber); | |
895 | + Log.e("test", "个人信息" + params); | |
886 | 896 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
887 | - HttpClient.getInstance().put(mContext, HttpUrl.changepresonalinfo, entity, "application/json", new JsonHttpResponseHandler() { | |
897 | + HttpClient.getInstance().post(mContext, HttpUrl.changepresonalinfo, params, new JsonHttpResponseHandler() { | |
888 | 898 | @Override |
889 | 899 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { |
890 | 900 | super.onSuccess(statusCode, headers, response); |
... | ... | @@ -896,7 +906,6 @@ public class HttpManager { |
896 | 906 | } else { |
897 | 907 | AlertUtils.showToast(mContext, "您好,服务器异常,请稍后重试"); |
898 | 908 | } |
899 | - Log.e("test", "onSuccess" + response); | |
900 | 909 | |
901 | 910 | } |
902 | 911 | |
... | ... | @@ -1098,12 +1107,14 @@ public class HttpManager { |
1098 | 1107 | * @param userId |
1099 | 1108 | * @param handler |
1100 | 1109 | */ |
1101 | - public void getchildAccountinfo(final Context mContext, long userId, final Handler handler) { | |
1110 | + public void getchildAccountinfo(final Context mContext, long userId,String deviceNumber ,final Handler handler) { | |
1102 | 1111 | mProgress = DialogPermission.showProgress(mContext, null, "正在获取信息...", |
1103 | 1112 | false, true, null); |
1113 | + | |
1114 | + Log.e("test", "ID" + userId); | |
1104 | 1115 | HttpClient.getInstance().setTimeout(5 * 1000); |
1105 | 1116 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
1106 | - HttpClient.getInstance().get(HttpUrl.childUserURL + "?userId=" + userId, new AsyncHttpResponseHandler() { | |
1117 | + HttpClient.getInstance().get(HttpUrl.childUserURL + "?userId=" + userId+"&deviceNumber="+deviceNumber, new AsyncHttpResponseHandler() { | |
1107 | 1118 | @Override |
1108 | 1119 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1109 | 1120 | closeProgress(); |
... | ... | @@ -1117,7 +1128,9 @@ public class HttpManager { |
1117 | 1128 | AlertUtils.showToast(mContext, "你好,你还未添加子账号,子账号为空!"); |
1118 | 1129 | } else { |
1119 | 1130 | ChildsInfo childsInfo = GsonTool.getPerson(new String(arg2), ChildsInfo.class);//解析json数据 |
1131 | + Log.e("test", "子账户信息" + childsInfo); | |
1120 | 1132 | List<ChildsInfo.DataBean> schoolInfoBeanList = childsInfo.getData(); |
1133 | + Log.e("test", "子账户信息" + schoolInfoBeanList); | |
1121 | 1134 | Message msg = Message.obtain(); |
1122 | 1135 | msg.what = HttpCode.CHILDS_SUCESS; |
1123 | 1136 | msg.obj = schoolInfoBeanList; |
... | ... | @@ -1166,7 +1179,7 @@ public class HttpManager { |
1166 | 1179 | * @param mContext |
1167 | 1180 | * @param subAccountId |
1168 | 1181 | */ |
1169 | - public void deletechildAccountinfo(final Context mContext, long subAccountId) { | |
1182 | + public void deletechildAccountinfo(final Context mContext, String subAccountId) { | |
1170 | 1183 | mProgress = DialogPermission.showProgress(mContext, null, "正在删除子账户...", |
1171 | 1184 | false, true, null); |
1172 | 1185 | HttpClient.getInstance().setTimeout(5 * 1000); |
... | ... | @@ -1181,6 +1194,7 @@ public class HttpManager { |
1181 | 1194 | int status = jsonObject.optInt("status"); |
1182 | 1195 | if (status == 1) { |
1183 | 1196 | AlertUtils.showToast(mContext, "子账号删除成功!"); |
1197 | + ((Activity) mContext).finish(); | |
1184 | 1198 | } else { |
1185 | 1199 | AlertUtils.showToast(mContext, "你好,子账号删除失败!"); |
1186 | 1200 | |
... | ... | @@ -1225,7 +1239,7 @@ public class HttpManager { |
1225 | 1239 | * 添加子账户信息 |
1226 | 1240 | */ |
1227 | 1241 | public void addchildAccountinfo(final Context mContext, long parentId, String image, |
1228 | - String name, Long grade, Long school, Long region | |
1242 | + String name, Long grade, Object school, Long region | |
1229 | 1243 | , String deviceNumber, String regionName) { |
1230 | 1244 | mProgress = DialogPermission.showProgress(mContext, null, "正在添加子账户...", |
1231 | 1245 | false, true, null); |
... | ... | @@ -1302,12 +1316,14 @@ public class HttpManager { |
1302 | 1316 | * @param mContext |
1303 | 1317 | * @param subAccountId |
1304 | 1318 | */ |
1305 | - public void changechildAccountinfo(final Context mContext, long subAccountId, long userId) { | |
1319 | + public void changechildAccountinfo(final Context mContext, String subAccountId, long userId | |
1320 | + ,String deviceNumber,int type) { | |
1306 | 1321 | mProgress = DialogPermission.showProgress(mContext, null, "正在切换子账户...", |
1307 | 1322 | false, true, null); |
1308 | 1323 | HttpClient.getInstance().setTimeout(5 * 1000); |
1309 | 1324 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
1310 | - HttpClient.getInstance().get(HttpUrl.changechildUserURL + "?subAccountId=" + subAccountId + "&userId=" + userId, new AsyncHttpResponseHandler() { | |
1325 | + HttpClient.getInstance().get(HttpUrl.changechildUserURL + "?subAccountId=" + subAccountId + "&userId=" + userId | |
1326 | + + "&deviceNumber=" + deviceNumber+ "&type=" + type, new AsyncHttpResponseHandler() { | |
1311 | 1327 | @Override |
1312 | 1328 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
1313 | 1329 | closeProgress(); |
... | ... | @@ -1317,6 +1333,7 @@ public class HttpManager { |
1317 | 1333 | int status = jsonObject.optInt("status"); |
1318 | 1334 | if (status == 1) { |
1319 | 1335 | AlertUtils.showToast(mContext, "子账号切换成功!"); |
1336 | + ((Activity) mContext).finish(); | |
1320 | 1337 | |
1321 | 1338 | } else { |
1322 | 1339 | AlertUtils.showToast(mContext, "你好,子账号切换失败!"); |
... | ... | @@ -1357,6 +1374,70 @@ public class HttpManager { |
1357 | 1374 | }); |
1358 | 1375 | |
1359 | 1376 | } |
1377 | + /** | |
1378 | + * 切换主账户信息 | |
1379 | + * | |
1380 | + * @param mContext | |
1381 | + * @param type | |
1382 | + */ | |
1383 | + public void Accountinfo(final Context mContext, long userId | |
1384 | + ,String deviceNumber,int type) { | |
1385 | + mProgress = DialogPermission.showProgress(mContext, null, "正在切换主账户...", | |
1386 | + false, true, null); | |
1387 | + HttpClient.getInstance().setTimeout(5 * 1000); | |
1388 | + HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | |
1389 | + HttpClient.getInstance().get(HttpUrl.changechildUserURL + "?userId=" + userId + "&deviceNumber=" + deviceNumber | |
1390 | + + "&type=" + type, new AsyncHttpResponseHandler() { | |
1391 | + @Override | |
1392 | + public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | |
1393 | + closeProgress(); | |
1394 | + Log.e("test", "子账户信息" + new String(arg2)); | |
1395 | + try { | |
1396 | + JSONObject jsonObject = new JSONObject(new String(arg2)); | |
1397 | + int status = jsonObject.optInt("status"); | |
1398 | + if (status == 1) { | |
1399 | + AlertUtils.showToast(mContext, "主账号切换成功!"); | |
1400 | + ((Activity) mContext).finish(); | |
1401 | + | |
1402 | + } else { | |
1403 | + AlertUtils.showToast(mContext, "你好,主账号切换失败!"); | |
1404 | + | |
1405 | + } | |
1406 | + } catch (JSONException e) { | |
1407 | + e.printStackTrace(); | |
1408 | + } | |
1409 | + | |
1410 | + } | |
1411 | + | |
1412 | + @Override | |
1413 | + public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | |
1414 | + closeProgress(); | |
1415 | + Log.e("test", "错误信息" + new String(arg2)); | |
1416 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
1417 | + .setCanceledOnTouchOutside(false) | |
1418 | + .setCancelable(false) | |
1419 | + .setWidth(0.5f) | |
1420 | + .configText(new ConfigText() { | |
1421 | + @Override | |
1422 | + public void onConfig(TextParams params) { | |
1423 | + params.gravity = Gravity.CENTER; | |
1424 | + params.padding = new int[]{50, 50, 50, 50}; | |
1425 | + } | |
1426 | + }) | |
1427 | + .setText("当前无网络,请检查网络设置") | |
1428 | + .setNegative("继续使用", null) | |
1429 | + .setPositive("设置网络", new View.OnClickListener() { | |
1430 | + @Override | |
1431 | + public void onClick(View v) { | |
1432 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
1433 | + mContext.startActivity(intent); | |
1434 | + } | |
1435 | + }) | |
1436 | + .show(); | |
1437 | + } | |
1438 | + }); | |
1439 | + | |
1440 | + } | |
1360 | 1441 | |
1361 | 1442 | /** |
1362 | 1443 | * 系统升级 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/ChangeInfo.java
... | ... | @@ -21,31 +21,49 @@ public class ChangeInfo implements Serializable{ |
21 | 21 | */ |
22 | 22 | |
23 | 23 | private String id; |
24 | - private String nickname; | |
24 | + private int type; | |
25 | + | |
26 | + public String getName() { | |
27 | + return name; | |
28 | + } | |
29 | + | |
30 | + public void setName(String name) { | |
31 | + this.name = name; | |
32 | + } | |
33 | + | |
34 | + private String name; | |
25 | 35 | private String gender; |
36 | + | |
37 | + private String qq; | |
26 | 38 | private String birthday; |
27 | - private ContactBean contact; | |
28 | 39 | private String regionName; |
29 | 40 | private int regionId; |
30 | 41 | private int gradeId; |
31 | - private SchoolBean school; | |
32 | 42 | |
33 | - public String getId() { | |
34 | - return id; | |
43 | + | |
44 | + public String getQq() { | |
45 | + return qq; | |
35 | 46 | } |
36 | 47 | |
37 | - public void setId(String id) { | |
38 | - this.id = id; | |
48 | + public void setQq(String qq) { | |
49 | + this.qq = qq; | |
50 | + } | |
51 | + public int getType() { | |
52 | + return type; | |
39 | 53 | } |
40 | 54 | |
41 | - public String getNickname() { | |
42 | - return nickname; | |
55 | + public void setType(int type) { | |
56 | + this.type = type; | |
43 | 57 | } |
44 | 58 | |
45 | - public void setNickname(String nickname) { | |
46 | - this.nickname = nickname; | |
59 | + | |
60 | + public String getId() { | |
61 | + return id; | |
47 | 62 | } |
48 | 63 | |
64 | + public void setId(String id) { | |
65 | + this.id = id; | |
66 | + } | |
49 | 67 | public String getGender() { |
50 | 68 | return gender; |
51 | 69 | } |
... | ... | @@ -62,14 +80,6 @@ public class ChangeInfo implements Serializable{ |
62 | 80 | this.birthday = birthday; |
63 | 81 | } |
64 | 82 | |
65 | - public ContactBean getContact() { | |
66 | - return contact; | |
67 | - } | |
68 | - | |
69 | - public void setContact(ContactBean contact) { | |
70 | - this.contact = contact; | |
71 | - } | |
72 | - | |
73 | 83 | public String getRegionName() { |
74 | 84 | return regionName; |
75 | 85 | } |
... | ... | @@ -94,34 +104,6 @@ public class ChangeInfo implements Serializable{ |
94 | 104 | this.gradeId = gradeId; |
95 | 105 | } |
96 | 106 | |
97 | - public SchoolBean getSchool() { | |
98 | - return school; | |
99 | - } | |
100 | - | |
101 | - public void setSchool(SchoolBean school) { | |
102 | - this.school = school; | |
103 | - } | |
104 | - | |
105 | - public static class ContactBean { | |
106 | - /** | |
107 | - * qq : 1666600 | |
108 | - */ | |
109 | - | |
110 | - private String qq; | |
111 | - | |
112 | - public String getQq() { | |
113 | - return qq; | |
114 | - } | |
115 | - | |
116 | - public void setQq(String qq) { | |
117 | - this.qq = qq; | |
118 | - } | |
119 | - } | |
120 | - | |
121 | - public static class SchoolBean { | |
122 | - /** | |
123 | - * schoolId : 499705 | |
124 | - */ | |
125 | 107 | |
126 | 108 | private long schoolId; |
127 | 109 | |
... | ... | @@ -132,5 +114,4 @@ public class ChangeInfo implements Serializable{ |
132 | 114 | public void setSchoolId(long schoolId) { |
133 | 115 | this.schoolId = schoolId; |
134 | 116 | } |
135 | - } | |
136 | 117 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/ChildsInfo.java
... | ... | @@ -12,9 +12,9 @@ public class ChildsInfo implements Serializable { |
12 | 12 | /** |
13 | 13 | * status : 1 |
14 | 14 | * pageSize : 1 |
15 | - * data : [{"region":"郑州","parentId":600,"school":"郑州小学","status":"未使用","name":"李四","grade":"初一","image":"http://hjxprodbucket.oss.aliyuncs.com/aaaaa.jpg","subAccountId":2}] | |
15 | + * data : [{"region":"河北秦皇岛青龙bgggg","parentId":0,"school":"静海四小","status":"已使用","name":"xfffff","grade":"四年级","image":"http://hjxprodbucket.oss.aliyuncs.com//static/upload/online_api/mobile_portrait/2017-07-24/bd2a3d6a-a131-4cc4-b166-3da14555a96f.jpg","type":1,"deviceNumber":"012345678912345","subAccountId":0},{"region":"天津河东","parentId":7000000054678906,"school":"天津河东区九号路小学","status":"未使用","name":"xiongwei","grade":"二年级","image":"http://hjxprodbucket.oss.aliyuncs.com/http://hjxprodbucket.oss.aliyuncs.com/static/upload/boss_api/announcement/2017-08-29/a00de899-2f6d-43fb-9e30-71883842540e.png","type":2,"deviceNumber":"012345678912345","subAccountId":"f38cf157d0944cf9b279a3abc31cf21f"}] | |
16 | 16 | * msg : success |
17 | - * pageNum : 1 | |
17 | + * pageNum : 2 | |
18 | 18 | */ |
19 | 19 | |
20 | 20 | private int status; |
... | ... | @@ -65,24 +65,28 @@ public class ChildsInfo implements Serializable { |
65 | 65 | |
66 | 66 | public static class DataBean { |
67 | 67 | /** |
68 | - * region : 郑州 | |
69 | - * parentId : 600 | |
70 | - * school : 郑州小学 | |
71 | - * status : 未使用 | |
72 | - * name : 李四 | |
73 | - * grade : 初一 | |
74 | - * image : http://hjxprodbucket.oss.aliyuncs.com/aaaaa.jpg | |
75 | - * subAccountId : 2 | |
68 | + * region : 河北秦皇岛青龙bgggg | |
69 | + * parentId : 0 | |
70 | + * school : 静海四小 | |
71 | + * status : 已使用 | |
72 | + * name : xfffff | |
73 | + * grade : 四年级 | |
74 | + * image : http://hjxprodbucket.oss.aliyuncs.com//static/upload/online_api/mobile_portrait/2017-07-24/bd2a3d6a-a131-4cc4-b166-3da14555a96f.jpg | |
75 | + * type : 1 | |
76 | + * deviceNumber : 012345678912345 | |
77 | + * subAccountId : 0 | |
76 | 78 | */ |
77 | 79 | |
78 | 80 | private String region; |
79 | - private long parentId; | |
81 | + private Long parentId; | |
80 | 82 | private String school; |
81 | 83 | private String status; |
82 | 84 | private String name; |
83 | 85 | private String grade; |
84 | 86 | private String image; |
85 | - private int subAccountId; | |
87 | + private int type; | |
88 | + private String deviceNumber; | |
89 | + private String subAccountId; | |
86 | 90 | |
87 | 91 | public String getRegion() { |
88 | 92 | return region; |
... | ... | @@ -92,11 +96,11 @@ public class ChildsInfo implements Serializable { |
92 | 96 | this.region = region; |
93 | 97 | } |
94 | 98 | |
95 | - public long getParentId() { | |
99 | + public Long getParentId() { | |
96 | 100 | return parentId; |
97 | 101 | } |
98 | 102 | |
99 | - public void setParentId(int parentId) { | |
103 | + public void setParentId(Long parentId) { | |
100 | 104 | this.parentId = parentId; |
101 | 105 | } |
102 | 106 | |
... | ... | @@ -140,11 +144,27 @@ public class ChildsInfo implements Serializable { |
140 | 144 | this.image = image; |
141 | 145 | } |
142 | 146 | |
143 | - public int getSubAccountId() { | |
147 | + public int getType() { | |
148 | + return type; | |
149 | + } | |
150 | + | |
151 | + public void setType(int type) { | |
152 | + this.type = type; | |
153 | + } | |
154 | + | |
155 | + public String getDeviceNumber() { | |
156 | + return deviceNumber; | |
157 | + } | |
158 | + | |
159 | + public void setDeviceNumber(String deviceNumber) { | |
160 | + this.deviceNumber = deviceNumber; | |
161 | + } | |
162 | + | |
163 | + public String getSubAccountId() { | |
144 | 164 | return subAccountId; |
145 | 165 | } |
146 | 166 | |
147 | - public void setSubAccountId(int subAccountId) { | |
167 | + public void setSubAccountId(String subAccountId) { | |
148 | 168 | this.subAccountId = subAccountId; |
149 | 169 | } |
150 | 170 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/GetDate.java
... | ... | @@ -71,19 +71,19 @@ public class GetDate { |
71 | 71 | strDate.append(String.valueOf(year)); |
72 | 72 | if(month<10) |
73 | 73 | { |
74 | - strDate.append("0"+String.valueOf(month)); | |
74 | + strDate.append("-0"+String.valueOf(month)); | |
75 | 75 | } |
76 | 76 | else |
77 | 77 | { |
78 | - strDate.append(""+String.valueOf(month)); | |
78 | + strDate.append("-"+String.valueOf(month)); | |
79 | 79 | } |
80 | 80 | if(day<10) |
81 | 81 | { |
82 | - strDate.append("0"+String.valueOf(day)); | |
82 | + strDate.append("-0"+String.valueOf(day)); | |
83 | 83 | } |
84 | 84 | else |
85 | 85 | { |
86 | - strDate.append(""+String.valueOf(day)); | |
86 | + strDate.append("-"+String.valueOf(day)); | |
87 | 87 | } |
88 | 88 | return strDate; |
89 | 89 | } | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_account_management.xml
... | ... | @@ -2,6 +2,7 @@ |
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" | |
5 | 6 | android:orientation="vertical"> |
6 | 7 | |
7 | 8 | <RelativeLayout |
... | ... | @@ -180,6 +181,7 @@ |
180 | 181 | android:layout_weight="1"> |
181 | 182 | |
182 | 183 | <LinearLayout |
184 | + android:id="@+id/ll_zhu_backgrangd" | |
183 | 185 | android:layout_width="wrap_content" |
184 | 186 | android:layout_height="wrap_content" |
185 | 187 | android:background="@drawable/corcle_blue_bg" |
... | ... | @@ -189,13 +191,14 @@ |
189 | 191 | android:layout_width="match_parent" |
190 | 192 | android:layout_height="wrap_content" |
191 | 193 | android:orientation="horizontal"> |
192 | - | |
193 | - <ImageView | |
194 | + <com.facebook.drawee.view.SimpleDraweeView | |
194 | 195 | android:id="@+id/tv_account_head" |
195 | - android:layout_width="wrap_content" | |
196 | - android:layout_height="wrap_content" | |
196 | + android:layout_width="60dp" | |
197 | + android:layout_height="60dp" | |
197 | 198 | android:layout_margin="10dp" |
198 | - android:src="@mipmap/header_default" /> | |
199 | + fresco:placeholderImage="@mipmap/header_default" | |
200 | + fresco:roundAsCircle="true" | |
201 | + fresco:placeholderImageScaleType="fitCenter" /> | |
199 | 202 | |
200 | 203 | <LinearLayout |
201 | 204 | android:layout_width="0dp" |
... | ... | @@ -237,10 +240,12 @@ |
237 | 240 | </LinearLayout> |
238 | 241 | |
239 | 242 | <ImageView |
243 | + android:id="@+id/iv_shiyongzhong" | |
240 | 244 | android:layout_width="wrap_content" |
241 | 245 | android:layout_height="wrap_content" |
242 | 246 | android:layout_gravity="right" |
243 | 247 | android:layout_marginLeft="60dp" |
248 | + android:visibility="gone" | |
244 | 249 | android:src="@mipmap/shiyongzhong" /> |
245 | 250 | |
246 | 251 | </LinearLayout> |
... | ... | @@ -260,19 +265,12 @@ |
260 | 265 | android:orientation="horizontal"> |
261 | 266 | |
262 | 267 | <TextView |
268 | + android:id="@+id/change_zhu_account" | |
263 | 269 | android:layout_width="0dp" |
264 | 270 | android:layout_height="wrap_content" |
265 | 271 | android:layout_weight="1" |
266 | 272 | android:gravity="center" |
267 | - android:textSize="18sp" /> | |
268 | - | |
269 | - <TextView | |
270 | - android:id="@+id/tv_account_delete" | |
271 | - android:layout_width="0dp" | |
272 | - android:layout_height="wrap_content" | |
273 | - android:layout_weight="1" | |
274 | - android:gravity="center" | |
275 | - android:text="使用中" | |
273 | + android:text="切换主账户" | |
276 | 274 | android:textSize="18sp" /> |
277 | 275 | |
278 | 276 | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | android:layout_width="450dp" |
49 | 49 | android:layout_height="0.7dp" |
50 | 50 | android:layout_marginLeft="150dp" |
51 | - android:background="@color/electronic_text"> | |
51 | + android:background="@color/cutoff_line"> | |
52 | 52 | |
53 | 53 | </View> |
54 | 54 | |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | android:layout_width="450dp" |
57 | 57 | android:layout_height="0.7dp" |
58 | 58 | android:layout_marginLeft="80dp" |
59 | - android:background="@color/electronic_text"> | |
59 | + android:background="@color/cutoff_line"> | |
60 | 60 | |
61 | 61 | </View> |
62 | 62 | |
... | ... | @@ -89,7 +89,6 @@ |
89 | 89 | android:layout_marginLeft="50dp" |
90 | 90 | android:background="@null" |
91 | 91 | android:hint="请输入" |
92 | - android:textColor="@color/electronic_text" | |
93 | 92 | android:textSize="22sp" /> |
94 | 93 | |
95 | 94 | </LinearLayout> |
... | ... | @@ -112,7 +111,6 @@ |
112 | 111 | android:layout_height="wrap_content" |
113 | 112 | android:layout_marginLeft="20dp" |
114 | 113 | android:hint="请选择地区" |
115 | - android:textColor="@color/btn_text_color" | |
116 | 114 | android:textSize="22sp" /> |
117 | 115 | |
118 | 116 | <ImageView |
... | ... | @@ -135,7 +133,7 @@ |
135 | 133 | android:layout_width="450dp" |
136 | 134 | android:layout_height="0.7dp" |
137 | 135 | android:layout_marginLeft="150dp" |
138 | - android:background="@color/electronic_text"> | |
136 | + android:background="@color/cutoff_line"> | |
139 | 137 | |
140 | 138 | </View> |
141 | 139 | |
... | ... | @@ -143,7 +141,7 @@ |
143 | 141 | android:layout_width="450dp" |
144 | 142 | android:layout_height="0.7dp" |
145 | 143 | android:layout_marginLeft="80dp" |
146 | - android:background="@color/electronic_text"> | |
144 | + android:background="@color/cutoff_line"> | |
147 | 145 | |
148 | 146 | </View> |
149 | 147 | |
... | ... | @@ -224,7 +222,7 @@ |
224 | 222 | android:layout_width="450dp" |
225 | 223 | android:layout_height="0.7dp" |
226 | 224 | android:layout_marginLeft="150dp" |
227 | - android:background="@color/electronic_text"> | |
225 | + android:background="@color/cutoff_line"> | |
228 | 226 | |
229 | 227 | </View> |
230 | 228 | |
... | ... | @@ -232,7 +230,7 @@ |
232 | 230 | android:layout_width="450dp" |
233 | 231 | android:layout_height="0.7dp" |
234 | 232 | android:layout_marginLeft="80dp" |
235 | - android:background="@color/electronic_text"> | |
233 | + android:background="@color/cutoff_line"> | |
236 | 234 | |
237 | 235 | </View> |
238 | 236 | |
... | ... | @@ -289,7 +287,6 @@ |
289 | 287 | android:layout_marginLeft="20dp" |
290 | 288 | android:background="@null" |
291 | 289 | android:hint="请输入" |
292 | - android:textColor="@color/electronic_text" | |
293 | 290 | android:textSize="22sp" /> |
294 | 291 | </LinearLayout> |
295 | 292 | |
... | ... | @@ -305,7 +302,7 @@ |
305 | 302 | android:layout_width="450dp" |
306 | 303 | android:layout_height="0.7dp" |
307 | 304 | android:layout_marginLeft="150dp" |
308 | - android:background="@color/electronic_text"> | |
305 | + android:background="@color/cutoff_line"> | |
309 | 306 | |
310 | 307 | </View> |
311 | 308 | |
... | ... | @@ -313,7 +310,7 @@ |
313 | 310 | android:layout_width="450dp" |
314 | 311 | android:layout_height="0.7dp" |
315 | 312 | android:layout_marginLeft="80dp" |
316 | - android:background="@color/electronic_text"> | |
313 | + android:background="@color/cutoff_line"> | |
317 | 314 | |
318 | 315 | </View> |
319 | 316 | |
... | ... | @@ -369,7 +366,7 @@ |
369 | 366 | android:layout_width="450dp" |
370 | 367 | android:layout_height="0.7dp" |
371 | 368 | android:layout_marginLeft="150dp" |
372 | - android:background="@color/electronic_text"> | |
369 | + android:background="@color/cutoff_line"> | |
373 | 370 | |
374 | 371 | </View> |
375 | 372 | ... | ... |
PersonalCenter/app/src/main/res/layout/recycler_childaccunt_item_view.xml
... | ... | @@ -5,13 +5,14 @@ |
5 | 5 | android:layout_width="415dp" |
6 | 6 | android:layout_height="match_parent"> |
7 | 7 | <LinearLayout |
8 | + android:id="@+id/ll_backgrangd" | |
8 | 9 | android:layout_width="wrap_content" |
9 | 10 | android:layout_height="wrap_content" |
10 | 11 | android:background="@drawable/corcle_black_bg" |
11 | 12 | android:orientation="vertical"> |
12 | 13 | |
13 | 14 | <LinearLayout |
14 | - android:layout_width="wrap_content" | |
15 | + android:layout_width="match_parent" | |
15 | 16 | android:layout_height="wrap_content" |
16 | 17 | android:orientation="horizontal"> |
17 | 18 | <com.facebook.drawee.view.SimpleDraweeView |
... | ... | @@ -60,9 +61,16 @@ |
60 | 61 | android:text="" |
61 | 62 | android:textSize="18sp" /> |
62 | 63 | |
63 | - | |
64 | - | |
65 | 64 | </LinearLayout> |
65 | + <ImageView | |
66 | + android:id="@+id/iv_using_pic" | |
67 | + android:layout_width="wrap_content" | |
68 | + android:layout_height="wrap_content" | |
69 | + android:layout_gravity="right" | |
70 | + android:layout_marginLeft="60dp" | |
71 | + android:visibility="gone" | |
72 | + android:src="@mipmap/shiyongzhong" /> | |
73 | + | |
66 | 74 | |
67 | 75 | |
68 | 76 | </LinearLayout> | ... | ... |