Commit ff014aa0bab93425e3ba5903570dc11509bd00c2
1 parent
70733fe33c
Exists in
master
接口调试
Showing
29 changed files
with
575 additions
and
186 deletions
Show diff stats
PersonalCenter/app/build.gradle
| 1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
| 2 | 2 | ||
| 3 | android { | 3 | android { |
| 4 | compileSdkVersion 25 | 4 | compileSdkVersion 25 |
| 5 | buildToolsVersion "25.0.3" | 5 | buildToolsVersion "25.0.3" |
| 6 | defaultConfig { | 6 | defaultConfig { |
| 7 | applicationId "com.hjx.personalcenter" | 7 | applicationId "com.hjx.personalcenter" |
| 8 | minSdkVersion 15 | 8 | minSdkVersion 15 |
| 9 | targetSdkVersion 25 | 9 | targetSdkVersion 25 |
| 10 | versionCode 1 | 10 | versionCode 1 |
| 11 | versionName "1.0" | 11 | versionName "1.0" |
| 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 13 | } | 13 | } |
| 14 | buildTypes { | 14 | buildTypes { |
| 15 | release { | 15 | release { |
| 16 | minifyEnabled false | 16 | minifyEnabled false |
| 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 18 | } | 18 | } |
| 19 | } | 19 | } |
| 20 | useLibrary 'org.apache.http.legacy' | 20 | useLibrary 'org.apache.http.legacy' |
| 21 | sourceSets { | 21 | sourceSets { |
| 22 | main { | 22 | main { |
| 23 | jniLibs.srcDirs = ['libs'] | 23 | jniLibs.srcDirs = ['libs'] |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | dependencies { | 28 | dependencies { |
| 29 | compile fileTree(include: ['*.jar'], dir: 'libs') | 29 | compile fileTree(include: ['*.jar'], dir: 'libs') |
| 30 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | 30 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { |
| 31 | exclude group: 'com.android.support', module: 'support-annotations' | 31 | exclude group: 'com.android.support', module: 'support-annotations' |
| 32 | }) | 32 | }) |
| 33 | compile 'com.tencent.bugly:crashreport:latest.release' | 33 | compile 'com.tencent.bugly:crashreport:latest.release' |
| 34 | compile 'org.apache.httpcomponents:httpcore:4.4.1' | 34 | compile 'org.apache.httpcomponents:httpcore:4.4.1' |
| 35 | compile 'org.apache.httpcomponents:httpclient:4.5' | 35 | compile 'org.apache.httpcomponents:httpclient:4.5' |
| 36 | compile 'com.android.support:appcompat-v7:25.3.1' | 36 | compile 'com.android.support:appcompat-v7:25.3.1' |
| 37 | testCompile 'junit:junit:4.12' | 37 | testCompile 'junit:junit:4.12' |
| 38 | compile project(':circledialog') | 38 | compile project(':circledialog') |
| 39 | compile project(':pickerview') | 39 | compile project(':pickerview') |
| 40 | compile files('libs/android-async-http-1.4.8.jar') | 40 | compile files('libs/android-async-http-1.4.8.jar') |
| 41 | compile 'com.google.code.gson:gson:2.7' | 41 | compile 'com.google.code.gson:gson:2.7' |
| 42 | compile 'com.zaaach:toprightmenu:1.0' | 42 | compile 'com.zaaach:toprightmenu:1.0' |
| 43 | compile 'com.facebook.fresco:fresco:1.1.0' | 43 | compile 'com.facebook.fresco:fresco:1.1.0' |
| 44 | compile'com.android.support:recyclerview-v7:25.+' | ||
| 44 | 45 | ||
| 45 | } | 46 | } |
| 46 | 47 |
PersonalCenter/app/src/main/AndroidManifest.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | package="com.hjx.personalcenter"> | 3 | package="com.hjx.personalcenter"> |
| 4 | 4 | ||
| 5 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | 5 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| 6 | <application | 6 | <application |
| 7 | android:allowBackup="true" | 7 | android:allowBackup="true" |
| 8 | android:icon="@mipmap/ic_launcher" | 8 | android:icon="@mipmap/ic_launcher" |
| 9 | android:label="@string/app_name" | 9 | android:label="@string/app_name" |
| 10 | android:supportsRtl="true" | 10 | android:supportsRtl="true" |
| 11 | android:theme="@style/Theme.AppCompat.Light.NoActionBar"> | 11 | android:theme="@style/Theme.AppCompat.Light.NoActionBar"> |
| 12 | <activity | 12 | <activity |
| 13 | android:name=".activity.MainActivity" | 13 | android:name=".activity.MainActivity" |
| 14 | android:launchMode="singleTask" | 14 | android:launchMode="singleTask" |
| 15 | android:screenOrientation="landscape"> | 15 | android:screenOrientation="landscape"> |
| 16 | <intent-filter> | ||
| 17 | <action android:name="android.intent.action.MAIN" /> | ||
| 18 | |||
| 19 | <category android:name="android.intent.category.LAUNCHER" /> | ||
| 20 | </intent-filter> | ||
| 21 | </activity> | 16 | </activity> |
| 22 | <activity | 17 | <activity |
| 23 | android:name=".activity.LoginAndRegisterActivity" | 18 | android:name=".activity.LoginAndRegisterActivity" |
| 24 | android:launchMode="singleTask" | 19 | android:launchMode="singleTask" |
| 20 | |||
| 25 | android:screenOrientation="landscape"> | 21 | android:screenOrientation="landscape"> |
| 22 | <intent-filter> | ||
| 23 | <action android:name="android.intent.action.MAIN" /> | ||
| 24 | |||
| 25 | <category android:name="android.intent.category.LAUNCHER" /> | ||
| 26 | </intent-filter> | ||
| 26 | 27 | ||
| 27 | </activity> | 28 | </activity> |
| 28 | <activity | 29 | <activity |
| 29 | android:name=".activity.ForgotPasswordActivity" | 30 | android:name=".activity.ForgotPasswordActivity" |
| 30 | android:launchMode="singleTask" | 31 | android:launchMode="singleTask" |
| 31 | android:screenOrientation="landscape"> | 32 | android:screenOrientation="landscape"> |
| 32 | 33 | ||
| 33 | </activity> | 34 | </activity> |
| 34 | <activity | 35 | <activity |
| 35 | android:name=".activity.ChangePasswordActivity" | 36 | android:name=".activity.ChangePasswordActivity" |
| 36 | android:launchMode="singleTask" | 37 | android:launchMode="singleTask" |
| 37 | android:screenOrientation="landscape"> | 38 | android:screenOrientation="landscape"> |
| 38 | 39 | ||
| 39 | </activity> | 40 | </activity> |
| 40 | <activity | 41 | <activity |
| 41 | android:name=".activity.RegisterInfoActivity" | 42 | android:name=".activity.RegisterInfoActivity" |
| 42 | android:launchMode="singleTask" | 43 | android:launchMode="singleTask" |
| 43 | android:screenOrientation="landscape"> | 44 | android:screenOrientation="landscape"> |
| 44 | 45 | ||
| 45 | </activity> | 46 | </activity> |
| 46 | <activity | 47 | <activity |
| 47 | android:name=".activity.ElectronicCardValidationActivity" | 48 | android:name=".activity.ElectronicCardValidationActivity" |
| 48 | android:launchMode="singleTask" | 49 | android:launchMode="singleTask" |
| 49 | android:screenOrientation="landscape"> | 50 | android:screenOrientation="landscape"> |
| 50 | 51 | ||
| 51 | </activity> | 52 | </activity> |
| 52 | <activity | 53 | <activity |
| 53 | android:name=".activity.ChangeBangDingActivity" | 54 | android:name=".activity.ChangeBangDingActivity" |
| 54 | android:launchMode="singleTask" | 55 | android:launchMode="singleTask" |
| 55 | android:screenOrientation="landscape"> | 56 | android:screenOrientation="landscape"> |
| 56 | 57 | ||
| 57 | </activity> | 58 | </activity> |
| 58 | <activity | 59 | <activity |
| 59 | android:name=".activity.ChangeElectronicCardAdressInfoActivity" | 60 | android:name=".activity.ChangeElectronicCardAdressInfoActivity" |
| 60 | android:launchMode="singleTask" | 61 | android:launchMode="singleTask" |
| 61 | android:screenOrientation="landscape"> | 62 | android:screenOrientation="landscape"> |
| 62 | 63 | ||
| 63 | </activity> | 64 | </activity> |
| 64 | <activity | 65 | <activity |
| 65 | android:name=".activity.ChangeEletronicCardPhoneActivity" | 66 | android:name=".activity.ChangeEletronicCardPhoneActivity" |
| 66 | android:launchMode="singleTask" | 67 | android:launchMode="singleTask" |
| 67 | android:screenOrientation="landscape"> | 68 | android:screenOrientation="landscape"> |
| 68 | 69 | ||
| 69 | </activity> | 70 | </activity> |
| 70 | <activity | 71 | <activity |
| 71 | android:name=".activity.ChoiseTextBookActivity" | 72 | android:name=".activity.ChoiseTextBookActivity" |
| 72 | android:launchMode="singleTask" | 73 | android:launchMode="singleTask" |
| 73 | android:screenOrientation="landscape"> | 74 | android:screenOrientation="landscape"> |
| 74 | 75 | ||
| 75 | </activity> | 76 | </activity> |
| 76 | <activity | 77 | <activity |
| 77 | android:name=".activity.TheStartPageActivity" | 78 | android:name=".activity.TheStartPageActivity" |
| 78 | android:launchMode="singleTask" | 79 | android:launchMode="singleTask" |
| 79 | android:screenOrientation="landscape"> | 80 | android:screenOrientation="landscape"> |
| 80 | 81 | ||
| 81 | </activity> | 82 | </activity> |
| 82 | <activity | 83 | <activity |
| 83 | android:name=".activity.ElectronicCardEditInfoActivity" | 84 | android:name=".activity.ElectronicCardEditInfoActivity" |
| 84 | android:launchMode="singleTask" | 85 | android:launchMode="singleTask" |
| 85 | android:screenOrientation="landscape"> | 86 | android:screenOrientation="landscape"> |
| 86 | 87 | ||
| 87 | </activity> | 88 | </activity> |
| 88 | <activity | 89 | <activity |
| 89 | android:name=".activity.ElectronicCardInfoOKActivity" | 90 | android:name=".activity.ElectronicCardInfoOKActivity" |
| 90 | android:launchMode="singleTask" | 91 | android:launchMode="singleTask" |
| 91 | android:screenOrientation="landscape"> | 92 | android:screenOrientation="landscape"> |
| 92 | 93 | ||
| 93 | </activity> | 94 | </activity> |
| 94 | <activity | 95 | <activity |
| 95 | android:name=".activity.ElectronicCardLookInfoActivity" | 96 | android:name=".activity.ElectronicCardLookInfoActivity" |
| 96 | android:launchMode="singleTask" | 97 | android:launchMode="singleTask" |
| 97 | android:screenOrientation="landscape"> | 98 | android:screenOrientation="landscape"> |
| 98 | 99 | ||
| 99 | </activity> | 100 | </activity> |
| 100 | <activity | 101 | <activity |
| 101 | android:name=".activity.FeedBackActivity" | 102 | android:name=".activity.FeedBackActivity" |
| 102 | android:launchMode="singleTask" | 103 | android:launchMode="singleTask" |
| 103 | android:screenOrientation="landscape"> | 104 | android:screenOrientation="landscape"> |
| 104 | 105 | ||
| 105 | </activity> | 106 | </activity> |
| 106 | <activity | 107 | <activity |
| 107 | android:name=".activity.AccountManagementActivity" | 108 | android:name=".activity.AccountManagementActivity" |
| 108 | android:launchMode="singleTask" | 109 | android:launchMode="singleTask" |
| 109 | android:screenOrientation="landscape"> | 110 | android:screenOrientation="landscape"> |
| 110 | 111 | ||
| 111 | </activity> | 112 | </activity> |
| 112 | <activity | 113 | <activity |
| 113 | android:name=".activity.ChangePresonalInfoActivity" | 114 | android:name=".activity.ChangePresonalInfoActivity" |
| 114 | android:launchMode="singleTask" | 115 | android:launchMode="singleTask" |
| 115 | android:screenOrientation="landscape"> | 116 | android:screenOrientation="landscape"> |
| 116 | 117 | ||
| 117 | </activity> | 118 | </activity> |
| 118 | </application> | 119 | </application> |
| 119 | <!--权限--> | 120 | <!--权限--> |
| 120 | <uses-permission android:name="android.permission.CAMERA" /> | 121 | <uses-permission android:name="android.permission.CAMERA" /> |
| 121 | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | 122 | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> |
| 122 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | 123 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
| 123 | <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> | 124 | <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> |
| 124 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | 125 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 125 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | 126 | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| 126 | <uses-permission android:name="android.permission.CALL_PHONE" /> | 127 | <uses-permission android:name="android.permission.CALL_PHONE" /> |
| 127 | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | 128 | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| 128 | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> | 129 | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |
| 129 | <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> | 130 | <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.view.View; | 6 | import android.view.View; |
| 7 | import android.widget.TextView; | 7 | import android.widget.TextView; |
| 8 | 8 | ||
| 9 | import com.hjx.personalcenter.R; | 9 | import com.hjx.personalcenter.R; |
| 10 | import com.hjx.personalcenter.db.Content; | 10 | import com.hjx.personalcenter.db.Content; |
| 11 | import com.hjx.personalcenter.db.SaveParam; | ||
| 11 | 12 | ||
| 12 | /**账户管理 熊巍 | 13 | /**账户管理 熊巍 |
| 13 | * Created by h on 2017/8/12. | 14 | * Created by h on 2017/8/12. |
| 14 | */ | 15 | */ |
| 15 | 16 | ||
| 16 | public class AccountManagementActivity extends Activity implements View.OnClickListener { | 17 | public class AccountManagementActivity extends Activity implements View.OnClickListener { |
| 17 | private TextView changbangding,changpassword; | 18 | private TextView changbangding,changpassword,usernames; |
| 18 | @Override | 19 | @Override |
| 19 | protected void onCreate(Bundle savedInstanceState) { | 20 | protected void onCreate(Bundle savedInstanceState) { |
| 20 | super.onCreate(savedInstanceState); | 21 | super.onCreate(savedInstanceState); |
| 21 | setContentView(R.layout.activity_account_management); | 22 | setContentView(R.layout.activity_account_management); |
| 22 | initView(); | 23 | initView(); |
| 23 | initData(); | 24 | initData(); |
| 24 | initLister(); | 25 | initLister(); |
| 25 | } | 26 | } |
| 26 | 27 | ||
| 27 | private void initView() { | 28 | private void initView() { |
| 28 | changbangding = (TextView) findViewById(R.id.changBangding); | 29 | changbangding = (TextView) findViewById(R.id.changBangding); |
| 29 | changpassword = (TextView) findViewById(R.id.changpassword); | 30 | changpassword = (TextView) findViewById(R.id.changpassword); |
| 31 | usernames = (TextView) findViewById(R.id.cunt_username); | ||
| 30 | } | 32 | } |
| 31 | 33 | ||
| 32 | private void initData() { | 34 | private void initData() { |
| 35 | String cunt_username = SaveParam.getInstance().getLoginParam(this,"cunt_username"); | ||
| 36 | usernames.setText(cunt_username); | ||
| 33 | 37 | ||
| 34 | } | 38 | } |
| 35 | 39 | ||
| 36 | private void initLister() { | 40 | private void initLister() { |
| 37 | changbangding.setOnClickListener(this); | 41 | changbangding.setOnClickListener(this); |
| 38 | changpassword.setOnClickListener(this); | 42 | changpassword.setOnClickListener(this); |
| 39 | 43 | ||
| 40 | 44 | ||
| 41 | } | 45 | } |
| 42 | 46 | ||
| 43 | @Override | 47 | @Override |
| 44 | public void onClick(View v) { | 48 | public void onClick(View v) { |
| 45 | switch (v.getId()){ | 49 | switch (v.getId()){ |
| 46 | case R.id.changBangding: | 50 | case R.id.changBangding: |
| 47 | Intent changebangding = new Intent(); | 51 | Intent changebangding = new Intent(); |
| 48 | changebangding.setClass(AccountManagementActivity.this,ChangeBangDingActivity.class); | 52 | changebangding.setClass(AccountManagementActivity.this,ChangeBangDingActivity.class); |
| 49 | startActivity(changebangding); | 53 | startActivity(changebangding); |
| 50 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 54 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 51 | break; | 55 | break; |
| 52 | case R.id.changpassword: | 56 | case R.id.changpassword: |
| 53 | Content.authcodeflag = 1; | 57 | Content.authcodeflag = 1; |
| 54 | Intent changpwd = new Intent(); | 58 | Intent changpwd = new Intent(); |
| 55 | changpwd.setClass(AccountManagementActivity.this,ChangePasswordActivity.class); | 59 | changpwd.setClass(AccountManagementActivity.this,ChangePasswordActivity.class); |
| 56 | startActivity(changpwd); | 60 | startActivity(changpwd); |
| 57 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 61 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 58 | break; | 62 | break; |
| 59 | } | 63 | } |
| 60 | 64 | ||
| 61 | } | 65 | } |
| 62 | } | 66 | } |
| 63 | 67 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | ||
| 4 | import android.os.Bundle; | 3 | import android.os.Bundle; |
| 5 | import android.os.Handler; | 4 | import android.os.Handler; |
| 6 | import android.os.Message; | 5 | import android.os.Message; |
| 6 | import android.support.v7.app.AppCompatActivity; | ||
| 7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
| 8 | import android.view.View; | 8 | import android.view.View; |
| 9 | import android.widget.Button; | 9 | import android.widget.Button; |
| 10 | import android.widget.EditText; | 10 | import android.widget.EditText; |
| 11 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
| 12 | import android.widget.TextView; | ||
| 12 | 13 | ||
| 13 | import com.hjx.personalcenter.R; | 14 | import com.hjx.personalcenter.R; |
| 15 | import com.hjx.personalcenter.customdialog.CitysListDialog; | ||
| 16 | import com.hjx.personalcenter.customdialog.CountryDialog; | ||
| 17 | import com.hjx.personalcenter.customdialog.ProvinceListDialog; | ||
| 18 | import com.hjx.personalcenter.db.SaveParam; | ||
| 14 | import com.hjx.personalcenter.http.HttpCode; | 19 | import com.hjx.personalcenter.http.HttpCode; |
| 15 | import com.hjx.personalcenter.http.HttpManager; | 20 | import com.hjx.personalcenter.http.HttpManager; |
| 21 | import com.hjx.personalcenter.interfaces.DialogCallBack; | ||
| 22 | import com.hjx.personalcenter.model.CityInfo; | ||
| 23 | import com.hjx.personalcenter.model.CountyInfo; | ||
| 24 | import com.hjx.personalcenter.model.ProvinceInfo; | ||
| 16 | import com.hjx.personalcenter.util.AlertUtils; | 25 | import com.hjx.personalcenter.util.AlertUtils; |
| 17 | import com.hjx.personalcenter.util.Judgment; | 26 | import com.hjx.personalcenter.util.Judgment; |
| 18 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; | 27 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; |
| 19 | 28 | ||
| 20 | import org.json.JSONObject; | 29 | import org.json.JSONObject; |
| 21 | 30 | ||
| 31 | import java.util.ArrayList; | ||
| 32 | |||
| 22 | /** | 33 | /** |
| 23 | * Created by h on 2017/8/9. | 34 | * Created by h on 2017/8/9. |
| 24 | */ | 35 | */ |
| 25 | 36 | ||
| 26 | public class ChangeElectronicCardAdressInfoActivity extends Activity implements View.OnClickListener{ | 37 | public class ChangeElectronicCardAdressInfoActivity extends AppCompatActivity implements View.OnClickListener |
| 38 | ,DialogCallBack.ProvincesCallBack | ||
| 39 | ,DialogCallBack.CitysCallBack,DialogCallBack.CountryCallBack{ | ||
| 27 | private ImageView back_forgit; | 40 | private ImageView back_forgit; |
| 28 | private EditText forot_pwd_phone,forot_pwd_anthcode,adress,newadress; | 41 | private EditText forot_pwd_phone,forot_pwd_anthcode,newadress; |
| 42 | private TextView adress; | ||
| 29 | private Button forot_pwd_sub,forot_pwd_getanthcode; | 43 | private Button forot_pwd_sub,forot_pwd_getanthcode; |
| 30 | private String typeStr = "register"; | 44 | private String typeStr = "register"; |
| 31 | private int i = 0; | 45 | private int i = 0; |
| 32 | private Thread thread; | 46 | private Thread thread; |
| 33 | Handler handler = new Handler() { | 47 | Handler handler = new Handler() { |
| 34 | @Override | 48 | @Override |
| 35 | public void handleMessage(Message msg) { | 49 | public void handleMessage(Message msg) { |
| 36 | super.handleMessage(msg); | 50 | super.handleMessage(msg); |
| 37 | JSONObject jsonObject; | 51 | JSONObject jsonObject; |
| 38 | String status; | 52 | String status; |
| 39 | switch (msg.what) { | 53 | switch (msg.what) { |
| 40 | case HttpCode.AUTHCODE_SUCESS1: | 54 | case HttpCode.AUTHCODE_SUCESS1: |
| 41 | jsonObject = (JSONObject) msg.obj; | 55 | jsonObject = (JSONObject) msg.obj; |
| 42 | status = jsonObject.optString("status"); | 56 | status = jsonObject.optString("status"); |
| 43 | if (status.equals("100")) { | 57 | if (status.equals("100")) { |
| 44 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "验证码发送成功"); | 58 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "验证码发送成功"); |
| 45 | } | 59 | } |
| 46 | //AlertUtils.showToast(ForgotPassword.this, jsonObject.optString("message")); | 60 | //AlertUtils.showToast(ForgotPassword.this, jsonObject.optString("message")); |
| 47 | break; | 61 | break; |
| 48 | case HttpCode.AUTHCODE_FAIL1: | 62 | case HttpCode.AUTHCODE_FAIL1: |
| 49 | jsonObject = (JSONObject) msg.obj; | 63 | jsonObject = (JSONObject) msg.obj; |
| 50 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, jsonObject.optString("验证码发送失败,请检查网络")); | 64 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, jsonObject.optString("验证码发送失败,请检查网络")); |
| 51 | break; | 65 | break; |
| 52 | case 1: | 66 | case 1: |
| 53 | forot_pwd_getanthcode.setEnabled(false); | 67 | forot_pwd_getanthcode.setEnabled(false); |
| 54 | forot_pwd_getanthcode.setClickable(false); | 68 | forot_pwd_getanthcode.setClickable(false); |
| 55 | forot_pwd_getanthcode.setText(Integer.toString(i--)+" s"); | 69 | forot_pwd_getanthcode.setText(Integer.toString(i--)+" s"); |
| 56 | if (i<=0){ | 70 | if (i<=0){ |
| 57 | forot_pwd_getanthcode.setEnabled(true); | 71 | forot_pwd_getanthcode.setEnabled(true); |
| 58 | forot_pwd_getanthcode.setClickable(true); | 72 | forot_pwd_getanthcode.setClickable(true); |
| 59 | forot_pwd_getanthcode.setText("获取验证码"); | 73 | forot_pwd_getanthcode.setText("获取验证码"); |
| 60 | 74 | ||
| 61 | } | 75 | } |
| 62 | break; | 76 | break; |
| 63 | } | 77 | } |
| 64 | } | 78 | } |
| 65 | }; | 79 | }; |
| 66 | @Override | 80 | @Override |
| 67 | protected void onCreate(Bundle savedInstanceState) { | 81 | protected void onCreate(Bundle savedInstanceState) { |
| 68 | super.onCreate(savedInstanceState); | 82 | super.onCreate(savedInstanceState); |
| 69 | setContentView(R.layout.activity_change_card_validation); | 83 | setContentView(R.layout.activity_change_card_validation); |
| 70 | initView(); | 84 | initView(); |
| 71 | setLister(); | 85 | setLister(); |
| 72 | } | 86 | } |
| 73 | //获取验证码 | 87 | //获取验证码 |
| 74 | private void getauthcode() { | 88 | private void getauthcode() { |
| 75 | forot_pwd_anthcode.requestFocus(); | 89 | forot_pwd_anthcode.requestFocus(); |
| 76 | String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); | 90 | String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); |
| 77 | HttpManager.getInstance().authCode(typeStr, forot_pwd_phone1, handler, this); | 91 | HttpManager.getInstance().authCode(typeStr, forot_pwd_phone1, handler, this); |
| 78 | i = 60; | 92 | i = 60; |
| 79 | if(thread == null){ | 93 | if(thread == null){ |
| 80 | thread = new Thread( new ThreadShow()); | 94 | thread = new Thread( new ThreadShow()); |
| 81 | thread.start(); | 95 | thread.start(); |
| 82 | } | 96 | } |
| 83 | 97 | ||
| 84 | } | 98 | } |
| 85 | private void initView() { | 99 | private void initView() { |
| 86 | forot_pwd_phone = (EditText) findViewById(R.id.et_phonenumber); | 100 | forot_pwd_phone = (EditText) findViewById(R.id.et_phonenumber); |
| 87 | forot_pwd_anthcode = (EditText) findViewById(R.id.et_authcode); | 101 | forot_pwd_anthcode = (EditText) findViewById(R.id.et_authcode); |
| 88 | adress = (EditText) findViewById(R.id.et_newpassword); | 102 | adress = (TextView) findViewById(R.id.et_newpassword); |
| 89 | newadress = (EditText) findViewById(R.id.et_again_newpassword); | 103 | newadress = (EditText) findViewById(R.id.et_again_newpassword); |
| 90 | forot_pwd_sub = (Button) findViewById(R.id.btn_ok); | 104 | forot_pwd_sub = (Button) findViewById(R.id.btn_ok); |
| 91 | forot_pwd_getanthcode = (Button) findViewById(R.id.btn_authcode); | 105 | forot_pwd_getanthcode = (Button) findViewById(R.id.btn_authcode); |
| 92 | back_forgit= (ImageView) findViewById(R.id.cancel); | 106 | back_forgit= (ImageView) findViewById(R.id.cancel); |
| 93 | } | 107 | } |
| 94 | private void setLister() { | 108 | private void setLister() { |
| 95 | back_forgit.setOnClickListener(this); | 109 | back_forgit.setOnClickListener(this); |
| 96 | forot_pwd_sub.setOnClickListener(this); | 110 | forot_pwd_sub.setOnClickListener(this); |
| 97 | forot_pwd_getanthcode.setOnClickListener(this); | 111 | forot_pwd_getanthcode.setOnClickListener(this); |
| 112 | adress.setOnClickListener(this); | ||
| 98 | 113 | ||
| 99 | } | 114 | } |
| 100 | 115 | ||
| 101 | @Override | 116 | @Override |
| 102 | public void onClick(View view) { | 117 | public void onClick(View view) { |
| 103 | switch (view.getId()){ | 118 | switch (view.getId()){ |
| 104 | case R.id.btn_ok: | 119 | case R.id.btn_ok: |
| 105 | String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); | 120 | String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); |
| 106 | String forot_pwd_anthcode1 = forot_pwd_anthcode.getText().toString().trim(); | 121 | String forot_pwd_anthcode1 = forot_pwd_anthcode.getText().toString().trim(); |
| 107 | String forot_pwd_pwd3 = adress.getText().toString().trim(); | 122 | String forot_pwd_pwd3 = adress.getText().toString().trim(); |
| 108 | String forot_pwd_pwd4 = newadress.getText().toString().trim(); | 123 | String forot_pwd_pwd4 = newadress.getText().toString().trim(); |
| 109 | if (TextUtils.isEmpty(forot_pwd_phone1)|| | 124 | if (TextUtils.isEmpty(forot_pwd_phone1)|| |
| 110 | TextUtils.isEmpty(forot_pwd_pwd3) || TextUtils.isEmpty(forot_pwd_pwd4)){ | 125 | TextUtils.isEmpty(forot_pwd_pwd3) || TextUtils.isEmpty(forot_pwd_pwd4)){ |
| 111 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请将必填项填写完整"); | 126 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请将必填项填写完整"); |
| 112 | return; | 127 | return; |
| 113 | }else if (Judgment.getInstance().isPhoneNum(forot_pwd_phone1)){ | 128 | }else if (Judgment.getInstance().isPhoneNum(forot_pwd_phone1)){ |
| 114 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "手机号码输入有误"); | 129 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "手机号码输入有误"); |
| 115 | 130 | ||
| 116 | } else { | 131 | } else { |
| 117 | //修改地址接口 | 132 | //修改地址接口 |
| 118 | HttpManager.getInstance().changecardadressinfo(this,111,forot_pwd_phone1,forot_pwd_anthcode1,forot_pwd_pwd3+forot_pwd_pwd4); | 133 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); |
| 134 | long auserID = 0; | ||
| 135 | try { | ||
| 136 | auserID = Long.parseLong(userID); | ||
| 137 | HttpManager.getInstance().changecardadressinfo(this,auserID,forot_pwd_phone1,forot_pwd_anthcode1,forot_pwd_pwd3+forot_pwd_pwd4); | ||
| 138 | } catch (NumberFormatException e) { | ||
| 139 | e.printStackTrace(); | ||
| 140 | } | ||
| 141 | |||
| 119 | } | 142 | } |
| 120 | break; | 143 | break; |
| 121 | case R.id.btn_authcode: | 144 | case R.id.btn_authcode: |
| 122 | forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); | 145 | forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); |
| 123 | if (!PhoneNumCheckUtils.isPhone(forot_pwd_phone1)){ | 146 | if (!PhoneNumCheckUtils.isPhone(forot_pwd_phone1)){ |
| 124 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请输入正确的手机号"); | 147 | AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请输入正确的手机号"); |
| 125 | }else { | 148 | }else { |
| 126 | forot_pwd_anthcode.requestFocus(); | 149 | forot_pwd_anthcode.requestFocus(); |
| 127 | getauthcode(); | 150 | getauthcode(); |
| 128 | 151 | ||
| 129 | } | 152 | } |
| 130 | 153 | ||
| 131 | break; | 154 | break; |
| 155 | case R.id.et_newpassword: | ||
| 156 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) ChangeElectronicCardAdressInfoActivity.this).show(getSupportFragmentManager(), "ProvinceListDialog"); | ||
| 157 | break; | ||
| 132 | 158 | ||
| 133 | case R.id.cancel: | 159 | case R.id.cancel: |
| 134 | finish(); | 160 | finish(); |
| 135 | break; | 161 | break; |
| 136 | } | 162 | } |
| 137 | } | 163 | } |
| 164 | |||
| 165 | @Override | ||
| 166 | public void province1OnItemClick(ArrayList<CityInfo.CitiesBean> data, int position, int type) { | ||
| 167 | String regionName = data.get(position).getRegionName(); | ||
| 168 | String provice = SaveParam.getInstance().getLoginParam(this,"sheng"); | ||
| 169 | SaveParam.getInstance().saveLoginParam(this,"shi",regionName); | ||
| 170 | CountryDialog.getInstance((DialogCallBack.CountryCallBack) this).show(getSupportFragmentManager(), "CountryDialog"); | ||
| 171 | adress.setText(""); | ||
| 172 | adress.setText(provice+regionName); | ||
| 173 | |||
| 174 | |||
| 175 | } | ||
| 176 | |||
| 177 | @Override | ||
| 178 | public void province2OnItemClick(ArrayList<CountyInfo.CountiesBean> data, int position, int type) { | ||
| 179 | String regionName = data.get(position).getRegionName(); | ||
| 180 | String provices = SaveParam.getInstance().getLoginParam(this,"sheng"); | ||
| 181 | String citys = SaveParam.getInstance().getLoginParam(this,"shi"); | ||
| 182 | adress.setText(""); | ||
| 183 | adress.setText(provices+citys+regionName); | ||
| 184 | } | ||
| 185 | |||
| 186 | @Override | ||
| 187 | public void provinceOnItemClick(ArrayList<ProvinceInfo.ProvincesBean> data, int position, int type) { | ||
| 188 | String regionName = data.get(position).getRegionName(); | ||
| 189 | SaveParam.getInstance().saveLoginParam(this,"sheng",regionName); | ||
| 190 | CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog"); | ||
| 191 | |||
| 192 | } | ||
| 193 | |||
| 138 | // 线程类 定时器 | 194 | // 线程类 定时器 |
| 139 | class ThreadShow implements Runnable { | 195 | class ThreadShow implements Runnable { |
| 140 | 196 | ||
| 141 | @Override | 197 | @Override |
| 142 | public void run() { | 198 | public void run() { |
| 143 | // TODO Auto-generated method stub | 199 | // TODO Auto-generated method stub |
| 144 | while (true) { | 200 | while (true) { |
| 145 | try { | 201 | try { |
| 146 | Thread.sleep(1000); | 202 | Thread.sleep(1000); |
| 147 | Message msg = new Message(); | 203 | Message msg = new Message(); |
| 148 | msg.what = 1; | 204 | msg.what = 1; |
| 149 | handler.sendMessage(msg); | 205 | handler.sendMessage(msg); |
| 150 | System.out.println("send..."); | 206 | System.out.println("send..."); |
| 151 | } catch (Exception e) { | 207 | } catch (Exception e) { |
| 152 | // TODO Auto-generated catch block | 208 | // TODO Auto-generated catch block |
| 153 | e.printStackTrace(); | 209 | e.printStackTrace(); |
| 154 | System.out.println("thread error..."); | 210 | System.out.println("thread error..."); |
| 155 | } | 211 | } |
| 156 | } | 212 | } |
| 157 | } | 213 | } |
| 158 | } | 214 | } |
| 159 | 215 | ||
| 160 | } | 216 | } |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChoiseTextBookActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.content.Intent; | 3 | import android.content.Intent; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 5 | import android.os.Handler; | 5 | import android.os.Handler; |
| 6 | import android.os.Message; | 6 | import android.os.Message; |
| 7 | import android.support.v7.app.AppCompatActivity; | 7 | import android.support.v7.app.AppCompatActivity; |
| 8 | import android.view.View; | 8 | import android.view.View; |
| 9 | import android.widget.Button; | 9 | import android.widget.Button; |
| 10 | import android.widget.GridView; | 10 | import android.widget.GridView; |
| 11 | import android.widget.SimpleAdapter; | 11 | import android.widget.SimpleAdapter; |
| 12 | 12 | ||
| 13 | import com.hjx.personalcenter.R; | 13 | import com.hjx.personalcenter.R; |
| 14 | import com.hjx.personalcenter.customdialog.ElectronicCardDialog; | 14 | import com.hjx.personalcenter.customdialog.ElectronicCardDialog; |
| 15 | import com.hjx.personalcenter.db.SaveParam; | ||
| 15 | import com.hjx.personalcenter.http.HttpCode; | 16 | import com.hjx.personalcenter.http.HttpCode; |
| 16 | import com.hjx.personalcenter.http.HttpManager; | 17 | import com.hjx.personalcenter.http.HttpManager; |
| 17 | 18 | ||
| 18 | import org.json.JSONException; | 19 | import org.json.JSONException; |
| 19 | import org.json.JSONObject; | 20 | import org.json.JSONObject; |
| 20 | 21 | ||
| 21 | import java.util.ArrayList; | 22 | import java.util.ArrayList; |
| 22 | import java.util.HashMap; | 23 | import java.util.HashMap; |
| 23 | import java.util.List; | 24 | import java.util.List; |
| 24 | import java.util.Map; | 25 | import java.util.Map; |
| 25 | 26 | ||
| 26 | /**选择教材 | 27 | /**选择教材 |
| 27 | * Created by h on 2017/8/10. | 28 | * Created by h on 2017/8/10. |
| 28 | */ | 29 | */ |
| 29 | 30 | ||
| 30 | public class ChoiseTextBookActivity extends AppCompatActivity implements View.OnClickListener { | 31 | public class ChoiseTextBookActivity extends AppCompatActivity implements View.OnClickListener { |
| 31 | private GridView gridView; | 32 | private GridView gridView; |
| 32 | private Button btn_ok; | 33 | private Button btn_ok; |
| 33 | private List<Map<String, Object>> data_list; | 34 | private List<Map<String, Object>> data_list; |
| 34 | private SimpleAdapter sim_adapter; | 35 | private SimpleAdapter sim_adapter; |
| 35 | // 图片封装为一个数组 | 36 | // 图片封装为一个数组 |
| 36 | private int[] icon = { R.mipmap.ic_launcher, R.mipmap.ic_launcher, | 37 | private int[] icon = { R.mipmap.ic_launcher, R.mipmap.ic_launcher, |
| 37 | R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, | 38 | R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, |
| 38 | R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, | 39 | R.mipmap.ic_launcher, R.mipmap.ic_launcher, R.mipmap.ic_launcher, |
| 39 | R.mipmap.ic_launcher}; | 40 | R.mipmap.ic_launcher}; |
| 40 | private String[] subject = { "语文", "数学", "英语", "物理", "化学", "生物", "政治", | 41 | private String[] subject = { "语文", "数学", "英语", "物理", "化学", "生物", "政治", |
| 41 | "历史", "地理" }; | 42 | "历史", "地理" }; |
| 42 | private String[] publish = { "人民教育出版社", "人民教育出版社", "人民教育出版社", | 43 | private String[] publish = { "人民教育出版社", "人民教育出版社", "人民教育出版社", |
| 43 | "人民教育出版社", "人民教育出版社", "人民教育出版社", "人民教育出版社", | 44 | "人民教育出版社", "人民教育出版社", "人民教育出版社", "人民教育出版社", |
| 44 | "人民教育出版社", "人民教育出版社" }; | 45 | "人民教育出版社", "人民教育出版社" }; |
| 45 | 46 | ||
| 46 | 47 | ||
| 47 | Handler handler = new Handler(){ | 48 | Handler handler = new Handler(){ |
| 48 | @Override | 49 | @Override |
| 49 | public void handleMessage(Message msg) { | 50 | public void handleMessage(Message msg) { |
| 50 | super.handleMessage(msg); | 51 | super.handleMessage(msg); |
| 51 | JSONObject jsonObject; | 52 | JSONObject jsonObject; |
| 52 | String status; | 53 | String status; |
| 53 | switch (msg.what){ | 54 | switch (msg.what){ |
| 54 | case HttpCode.CHECKCARD: | 55 | case HttpCode.CHECKCARD: |
| 55 | try { | 56 | try { |
| 56 | jsonObject = new JSONObject( (String) msg.obj); | 57 | jsonObject = new JSONObject( (String) msg.obj); |
| 57 | status = jsonObject.optString("status"); | 58 | status = jsonObject.optString("status"); |
| 58 | if (status.equals("1")){ | 59 | if (status.equals("1")){ |
| 59 | Intent intent = new Intent(); | 60 | Intent intent = new Intent(); |
| 60 | intent.setClass(ChoiseTextBookActivity.this, TheStartPageActivity.class); | 61 | intent.setClass(ChoiseTextBookActivity.this, TheStartPageActivity.class); |
| 61 | ChoiseTextBookActivity.this.startActivity(intent); | 62 | ChoiseTextBookActivity.this.startActivity(intent); |
| 62 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 63 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 63 | finish(); | 64 | finish(); |
| 64 | }else if(status.equals("2001")){ | 65 | }else if(status.equals("2001")){ |
| 65 | ElectronicCardDialog.getInstance().show(getSupportFragmentManager(), "ElectronicCardDialog"); | 66 | ElectronicCardDialog.getInstance().show(getSupportFragmentManager(), "ElectronicCardDialog"); |
| 66 | } | 67 | } |
| 67 | 68 | ||
| 68 | } catch (JSONException e) { | 69 | } catch (JSONException e) { |
| 69 | e.printStackTrace(); | 70 | e.printStackTrace(); |
| 70 | } | 71 | } |
| 71 | 72 | ||
| 72 | break; | 73 | break; |
| 73 | 74 | ||
| 74 | } | 75 | } |
| 75 | 76 | ||
| 76 | } | 77 | } |
| 77 | }; | 78 | }; |
| 78 | 79 | ||
| 79 | @Override | 80 | @Override |
| 80 | protected void onCreate(Bundle savedInstanceState) { | 81 | protected void onCreate(Bundle savedInstanceState) { |
| 81 | super.onCreate(savedInstanceState); | 82 | super.onCreate(savedInstanceState); |
| 82 | setContentView(R.layout.activity_choisetextbook); | 83 | setContentView(R.layout.activity_choisetextbook); |
| 83 | initView(); | 84 | initView(); |
| 84 | initData(); | 85 | initData(); |
| 85 | initLister(); | 86 | initLister(); |
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | private void initView() { | 89 | private void initView() { |
| 89 | gridView = (GridView) findViewById(R.id.grideview); | 90 | gridView = (GridView) findViewById(R.id.grideview); |
| 90 | btn_ok = (Button) findViewById(R.id.btn_ok); | 91 | btn_ok = (Button) findViewById(R.id.btn_ok); |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | private void initData() { | 94 | private void initData() { |
| 94 | data_list = new ArrayList<Map<String, Object>>(); | 95 | data_list = new ArrayList<Map<String, Object>>(); |
| 95 | getData(); | 96 | getData(); |
| 96 | String [] from ={"image","text","text1"}; | 97 | String [] from ={"image","text","text1"}; |
| 97 | int [] to = {R.id.image,R.id.text}; | 98 | int [] to = {R.id.image,R.id.text}; |
| 98 | sim_adapter = new SimpleAdapter(this, data_list, R.layout.activity_choisetextbook_items, from, to); | 99 | sim_adapter = new SimpleAdapter(this, data_list, R.layout.activity_choisetextbook_items, from, to); |
| 99 | //配置适配器 | 100 | //配置适配器 |
| 100 | gridView.setAdapter(sim_adapter); | 101 | gridView.setAdapter(sim_adapter); |
| 101 | 102 | ||
| 102 | } | 103 | } |
| 103 | 104 | ||
| 104 | private void initLister() { | 105 | private void initLister() { |
| 105 | btn_ok.setOnClickListener(this); | 106 | btn_ok.setOnClickListener(this); |
| 106 | 107 | ||
| 107 | } | 108 | } |
| 108 | public List<Map<String, Object>> getData(){ | 109 | public List<Map<String, Object>> getData(){ |
| 109 | //cion和iconName的长度是相同的,这里任选其一都可以 | 110 | //cion和iconName的长度是相同的,这里任选其一都可以 |
| 110 | for(int i=0;i<icon.length;i++){ | 111 | for(int i=0;i<icon.length;i++){ |
| 111 | Map<String, Object> map = new HashMap<String, Object>(); | 112 | Map<String, Object> map = new HashMap<String, Object>(); |
| 112 | map.put("image", icon[i]); | 113 | map.put("image", icon[i]); |
| 113 | map.put("text", subject[i]); | 114 | map.put("text", subject[i]); |
| 114 | map.put("text1", publish[i]); | 115 | map.put("text1", publish[i]); |
| 115 | data_list.add(map); | 116 | data_list.add(map); |
| 116 | } | 117 | } |
| 117 | 118 | ||
| 118 | return data_list; | 119 | return data_list; |
| 119 | } | 120 | } |
| 120 | 121 | ||
| 121 | @Override | 122 | @Override |
| 122 | public void onClick(View v) { | 123 | public void onClick(View v) { |
| 123 | switch (v.getId()){ | 124 | switch (v.getId()){ |
| 124 | case R.id.btn_ok: | 125 | case R.id.btn_ok: |
| 125 | HttpManager.getInstance().cardinfocheck(this,836,handler); | 126 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); |
| 127 | try { | ||
| 128 | long auserID = Long.parseLong(userID); | ||
| 129 | HttpManager.getInstance().cardinfocheck(this,auserID,handler); | ||
| 130 | } catch (NumberFormatException e) { | ||
| 131 | e.printStackTrace(); | ||
| 132 | } | ||
| 133 | |||
| 126 | break; | 134 | break; |
| 127 | } | 135 | } |
| 128 | 136 | ||
| 129 | } | 137 | } |
| 130 | } | 138 | } |
| 131 | 139 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | ||
| 4 | import android.content.Intent; | 3 | import android.content.Intent; |
| 5 | import android.graphics.Color; | 4 | import android.graphics.Color; |
| 6 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.support.v7.app.AppCompatActivity; | ||
| 7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
| 8 | import android.view.View; | 8 | import android.view.View; |
| 9 | import android.widget.Button; | 9 | import android.widget.Button; |
| 10 | import android.widget.EditText; | 10 | import android.widget.EditText; |
| 11 | import android.widget.ImageView; | 11 | import android.widget.ImageView; |
| 12 | import android.widget.LinearLayout; | 12 | import android.widget.LinearLayout; |
| 13 | import android.widget.TextView; | 13 | import android.widget.TextView; |
| 14 | 14 | ||
| 15 | import com.bigkoo.pickerview.TimePickerView; | 15 | import com.bigkoo.pickerview.TimePickerView; |
| 16 | import com.hjx.personalcenter.R; | 16 | import com.hjx.personalcenter.R; |
| 17 | import com.hjx.personalcenter.customdialog.CitysListDialog; | ||
| 18 | import com.hjx.personalcenter.customdialog.CountryDialog; | ||
| 19 | import com.hjx.personalcenter.customdialog.ProvinceListDialog; | ||
| 20 | import com.hjx.personalcenter.db.Content; | ||
| 17 | import com.hjx.personalcenter.db.SaveParam; | 21 | import com.hjx.personalcenter.db.SaveParam; |
| 22 | import com.hjx.personalcenter.interfaces.DialogCallBack; | ||
| 23 | import com.hjx.personalcenter.model.CityInfo; | ||
| 24 | import com.hjx.personalcenter.model.CountyInfo; | ||
| 25 | import com.hjx.personalcenter.model.ProvinceInfo; | ||
| 18 | import com.hjx.personalcenter.util.AlertUtils; | 26 | import com.hjx.personalcenter.util.AlertUtils; |
| 19 | 27 | ||
| 20 | import java.text.SimpleDateFormat; | 28 | import java.text.SimpleDateFormat; |
| 29 | import java.util.ArrayList; | ||
| 21 | import java.util.Date; | 30 | import java.util.Date; |
| 22 | 31 | ||
| 23 | /**填写保卡信息 熊巍 | 32 | /**填写保卡信息 熊巍 |
| 24 | * Created by h on 2017/8/11. | 33 | * Created by h on 2017/8/11. |
| 25 | */ | 34 | */ |
| 26 | 35 | ||
| 27 | public class ElectronicCardEditInfoActivity extends Activity implements View.OnClickListener { | 36 | public class ElectronicCardEditInfoActivity extends AppCompatActivity implements View.OnClickListener |
| 37 | ,DialogCallBack.ProvincesCallBack | ||
| 38 | ,DialogCallBack.CitysCallBack,DialogCallBack.CountryCallBack{ | ||
| 28 | private LinearLayout lineL_buy_time; | 39 | private LinearLayout lineL_buy_time; |
| 29 | private TextView tv_buy_time,adress_shop,adress_custem; | 40 | private TextView tv_buy_time,adress_shop,adress_custem; |
| 30 | private EditText username,store,detalAdress,telphone; | 41 | private EditText username,store,detalAdress,telphone; |
| 31 | private TimePickerView pvTime; | 42 | private TimePickerView pvTime; |
| 32 | private Button btn_change_info; | 43 | private Button btn_change_info; |
| 33 | private ImageView iv_card_back; | 44 | private ImageView iv_card_back; |
| 34 | 45 | ||
| 35 | @Override | 46 | @Override |
| 36 | protected void onCreate(Bundle savedInstanceState) { | 47 | protected void onCreate(Bundle savedInstanceState) { |
| 37 | super.onCreate(savedInstanceState); | 48 | super.onCreate(savedInstanceState); |
| 38 | setContentView(R.layout.activity_electroniccard_info); | 49 | setContentView(R.layout.activity_electroniccard_info); |
| 39 | initView(); | 50 | initView(); |
| 40 | initData(); | 51 | initData(); |
| 41 | initLister(); | 52 | initLister(); |
| 42 | initTimePicker(); | 53 | initTimePicker(); |
| 43 | } | 54 | } |
| 44 | 55 | ||
| 45 | private void initView() { | 56 | private void initView() { |
| 46 | lineL_buy_time = (LinearLayout) findViewById(R.id.lineL_buy_time); | 57 | lineL_buy_time = (LinearLayout) findViewById(R.id.lineL_buy_time); |
| 47 | tv_buy_time = (TextView) findViewById(R.id.tv_buy_time); | 58 | tv_buy_time = (TextView) findViewById(R.id.tv_buy_time); |
| 48 | adress_shop = (TextView) findViewById(R.id.tv_edit_adress_shop); | 59 | adress_shop = (TextView) findViewById(R.id.tv_edit_adress_shop); |
| 49 | adress_custem = (TextView) findViewById(R.id.tv_edit_adress_custem); | 60 | adress_custem = (TextView) findViewById(R.id.tv_edit_adress_custem); |
| 50 | username = (EditText) findViewById(R.id.et_edit_username); | 61 | username = (EditText) findViewById(R.id.et_edit_username); |
| 51 | store = (EditText) findViewById(R.id.et_edit_store); | 62 | store = (EditText) findViewById(R.id.et_edit_store); |
| 52 | detalAdress = (EditText) findViewById(R.id.et_edit_adress_detail); | 63 | detalAdress = (EditText) findViewById(R.id.et_edit_adress_detail); |
| 53 | telphone = (EditText) findViewById(R.id.et_edit_telphone); | 64 | telphone = (EditText) findViewById(R.id.et_edit_telphone); |
| 54 | btn_change_info = (Button) findViewById(R.id.btn_change_info); | 65 | btn_change_info = (Button) findViewById(R.id.btn_change_info); |
| 66 | iv_card_back = (ImageView) findViewById(R.id.iv_card_back); | ||
| 55 | } | 67 | } |
| 56 | 68 | ||
| 57 | private void initData() { | 69 | private void initData() { |
| 58 | 70 | ||
| 59 | } | 71 | } |
| 60 | 72 | ||
| 61 | private void initLister() { | 73 | private void initLister() { |
| 62 | lineL_buy_time.setOnClickListener(this); | 74 | lineL_buy_time.setOnClickListener(this); |
| 63 | adress_shop.setOnClickListener(this); | 75 | adress_shop.setOnClickListener(this); |
| 64 | adress_custem.setOnClickListener(this); | 76 | adress_custem.setOnClickListener(this); |
| 65 | btn_change_info.setOnClickListener(this); | 77 | btn_change_info.setOnClickListener(this); |
| 66 | 78 | ||
| 67 | } | 79 | } |
| 68 | //自定义时间选择器 | 80 | //自定义时间选择器 |
| 69 | private void initTimePicker() { | 81 | private void initTimePicker() { |
| 70 | //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) | 82 | //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) |
| 71 | //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 | 83 | //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 |
| 72 | // Calendar selectedDate = Calendar.getInstance(); | 84 | // Calendar selectedDate = Calendar.getInstance(); |
| 73 | // Calendar startDate = Calendar.getInstance(); | 85 | // Calendar startDate = Calendar.getInstance(); |
| 74 | // startDate.set(1900, 1, 1); | 86 | // startDate.set(1900, 1, 1); |
| 75 | // Calendar endDate = Calendar.getInstance(); | 87 | // Calendar endDate = Calendar.getInstance(); |
| 76 | // endDate.set(2100, 1, 1); | 88 | // endDate.set(2100, 1, 1); |
| 77 | //时间选择器 | 89 | //时间选择器 |
| 78 | pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() { | 90 | pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() { |
| 79 | @Override | 91 | @Override |
| 80 | public void onTimeSelect(Date date, View v) {//选中事件回调 | 92 | public void onTimeSelect(Date date, View v) {//选中事件回调 |
| 81 | // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null | 93 | // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null |
| 82 | /*btn_Time.setText(getTime(date));*/ | 94 | /*btn_Time.setText(getTime(date));*/ |
| 83 | TextView btn = (TextView) v; | 95 | TextView btn = (TextView) v; |
| 84 | btn.setText(getTime(date)); | 96 | btn.setText(getTime(date)); |
| 85 | } | 97 | } |
| 86 | }) | 98 | }) |
| 87 | //年月日时分秒 的显示与否,不设置则默认全部显示 | 99 | //年月日时分秒 的显示与否,不设置则默认全部显示 |
| 88 | .setType(new boolean[]{true, true, true, false, false, false}) | 100 | .setType(new boolean[]{true, true, true, false, false, false}) |
| 89 | .setLabel("", "", "", "", "", "") | 101 | .setLabel("", "", "", "", "", "") |
| 90 | .isCenterLabel(false) | 102 | .isCenterLabel(false) |
| 91 | .setDividerColor(Color.DKGRAY) | 103 | .setDividerColor(Color.DKGRAY) |
| 92 | .setContentSize(21) | 104 | .setContentSize(21) |
| 93 | // .setDate(selectedDate) | 105 | // .setDate(selectedDate) |
| 94 | // .setRangDate(startDate, endDate) | 106 | // .setRangDate(startDate, endDate) |
| 95 | .setBackgroundId(0x80000000) //设置外部遮罩颜色 | 107 | .setBackgroundId(0x80000000) //设置外部遮罩颜色 |
| 96 | .setDecorView(null) | 108 | .setDecorView(null) |
| 97 | .setTitleText("购买日期") | 109 | .setTitleText("购买日期") |
| 98 | .setTitleSize(22) | 110 | .setTitleSize(22) |
| 99 | .setCancelColor(Color.GRAY) | 111 | .setCancelColor(Color.GRAY) |
| 100 | .setSubCalSize(22) | 112 | .setSubCalSize(22) |
| 101 | .setDividerColor(Color.GRAY) | 113 | .setDividerColor(Color.GRAY) |
| 102 | .setSubmitColor(Color.GRAY) | 114 | .setSubmitColor(Color.GRAY) |
| 103 | .build(); | 115 | .build(); |
| 104 | } | 116 | } |
| 105 | private String getTime(Date date) {//可根据需要自行截取数据显示 | 117 | private String getTime(Date date) {//可根据需要自行截取数据显示 |
| 106 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | 118 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| 107 | return format.format(date); | 119 | return format.format(date); |
| 108 | } | 120 | } |
| 109 | 121 | ||
| 110 | @Override | 122 | @Override |
| 111 | public void onClick(View v) { | 123 | public void onClick(View v) { |
| 112 | switch (v.getId()){ | 124 | switch (v.getId()){ |
| 113 | case R.id.lineL_buy_time: | 125 | case R.id.lineL_buy_time: |
| 114 | pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view | 126 | pvTime.show(tv_buy_time);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view |
| 115 | break; | 127 | break; |
| 116 | case R.id.btn_change_info: | 128 | case R.id.btn_change_info: |
| 117 | String info1 =username.getText().toString().trim(); | 129 | String info1 =username.getText().toString().trim(); |
| 118 | String info2 =adress_custem.getText().toString().trim(); | 130 | String info2 =adress_custem.getText().toString().trim(); |
| 119 | String info3 =detalAdress.getText().toString().trim(); | 131 | String info3 =detalAdress.getText().toString().trim(); |
| 120 | String info4 =tv_buy_time.getText().toString().trim(); | 132 | String info4 =tv_buy_time.getText().toString().trim(); |
| 121 | String info5 =adress_shop.getText().toString().trim(); | 133 | String info5 =adress_shop.getText().toString().trim(); |
| 122 | String info6 =store.getText().toString().trim(); | 134 | String info6 =store.getText().toString().trim(); |
| 123 | String info7 =telphone.getText().toString().trim(); | 135 | String info7 =telphone.getText().toString().trim(); |
| 124 | 136 | ||
| 125 | if (TextUtils.isEmpty(info1) || TextUtils.isEmpty(info2)||TextUtils.isEmpty(info3) | 137 | if (TextUtils.isEmpty(info1) || TextUtils.isEmpty(info2)||TextUtils.isEmpty(info3) |
| 126 | ||TextUtils.isEmpty(info4)||TextUtils.isEmpty(info5)||TextUtils.isEmpty(info6) | 138 | ||TextUtils.isEmpty(info4)||TextUtils.isEmpty(info5)||TextUtils.isEmpty(info6) |
| 127 | ||TextUtils.isEmpty(info7)) { | 139 | ||TextUtils.isEmpty(info7)) { |
| 128 | AlertUtils.showToast(ElectronicCardEditInfoActivity.this, "所有内容不能为空。"); | 140 | AlertUtils.showToast(ElectronicCardEditInfoActivity.this, "所有内容不能为空。"); |
| 129 | return; | 141 | return; |
| 130 | }else { | 142 | }else { |
| 131 | savedata(); | 143 | savedata(); |
| 132 | Intent intent = new Intent(); | 144 | Intent intent = new Intent(); |
| 133 | intent.setClass(ElectronicCardEditInfoActivity.this,ElectronicCardInfoOKActivity.class); | 145 | intent.setClass(ElectronicCardEditInfoActivity.this,ElectronicCardInfoOKActivity.class); |
| 134 | startActivity(intent); | 146 | startActivity(intent); |
| 135 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 147 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 136 | } | 148 | } |
| 137 | 149 | ||
| 138 | break; | 150 | break; |
| 139 | case R.id.tv_edit_adress_shop: | 151 | case R.id.tv_edit_adress_shop: |
| 152 | Content.adressflag =1; | ||
| 153 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) this).show(getSupportFragmentManager(), "ProvinceListDialog"); | ||
| 140 | 154 | ||
| 141 | adress_shop.setText("湖南省益阳市上河区"); | ||
| 142 | break; | 155 | break; |
| 143 | case R.id.tv_edit_adress_custem: | 156 | case R.id.tv_edit_adress_custem: |
| 144 | adress_custem.setText("湖南省益阳市上河区"); | 157 | Content.adressflag =2; |
| 158 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) this).show(getSupportFragmentManager(), "ProvinceListDialog"); | ||
| 159 | |||
| 160 | break; | ||
| 161 | case R.id.iv_card_back: | ||
| 162 | finish(); | ||
| 145 | break; | 163 | break; |
| 146 | 164 | ||
| 147 | } | 165 | } |
| 148 | 166 | ||
| 149 | 167 | ||
| 150 | } | 168 | } |
| 151 | //保存数据 | 169 | //保存数据 |
| 152 | private void savedata() { | 170 | private void savedata() { |
| 153 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CUNSTEMNAME, username.getText().toString().trim()); | 171 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CUNSTEMNAME, username.getText().toString().trim()); |
| 154 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.ADRESSCUNSTEM, adress_custem.getText().toString().trim()+detalAdress.getText().toString().trim()); | 172 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.ADRESSCUNSTEM, adress_custem.getText().toString().trim()+detalAdress.getText().toString().trim()); |
| 155 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTIME, tv_buy_time.getText().toString().trim()); | 173 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTIME, tv_buy_time.getText().toString().trim()); |
| 156 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPADRESS, adress_shop.getText().toString().trim()+store.getText().toString().trim()); | 174 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPADRESS, adress_shop.getText().toString().trim()+store.getText().toString().trim()); |
| 157 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTLEPHONE, telphone.getText().toString().trim()); | 175 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.SHOPTLEPHONE, telphone.getText().toString().trim()); |
| 158 | 176 | ||
| 159 | } | 177 | } |
| 178 | |||
| 179 | @Override | ||
| 180 | public void province1OnItemClick(ArrayList<CityInfo.CitiesBean> data, int position, int type) { | ||
| 181 | String regionName = data.get(position).getRegionName(); | ||
| 182 | String provice = SaveParam.getInstance().getLoginParam(this,"sheng"); | ||
| 183 | SaveParam.getInstance().saveLoginParam(this,"shi",regionName); | ||
| 184 | CountryDialog.getInstance((DialogCallBack.CountryCallBack) this).show(getSupportFragmentManager(), "CountryDialog"); | ||
| 185 | if (Content.adressflag ==1){ | ||
| 186 | adress_shop.setText(""); | ||
| 187 | adress_shop.setText(provice+regionName); | ||
| 188 | }else { | ||
| 189 | adress_custem.setText(""); | ||
| 190 | adress_custem.setText(provice+regionName); | ||
| 191 | } | ||
| 192 | |||
| 193 | } | ||
| 194 | |||
| 195 | @Override | ||
| 196 | public void province2OnItemClick(ArrayList<CountyInfo.CountiesBean> data, int position, int type) { | ||
| 197 | String regionName = data.get(position).getRegionName(); | ||
| 198 | String provices = SaveParam.getInstance().getLoginParam(this,"sheng"); | ||
| 199 | String citys = SaveParam.getInstance().getLoginParam(this,"shi"); | ||
| 200 | if (Content.adressflag ==1){ | ||
| 201 | adress_shop.setText(""); | ||
| 202 | adress_shop.setText(provices+citys+regionName); | ||
| 203 | }else { | ||
| 204 | adress_custem.setText(""); | ||
| 205 | adress_custem.setText(provices+citys+regionName); | ||
| 206 | } | ||
| 207 | |||
| 208 | |||
| 209 | |||
| 210 | } | ||
| 211 | |||
| 212 | @Override | ||
| 213 | public void provinceOnItemClick(ArrayList<ProvinceInfo.ProvincesBean> data, int position, int type) { | ||
| 214 | String regionName = data.get(position).getRegionName(); | ||
| 215 | SaveParam.getInstance().saveLoginParam(this,"sheng",regionName); | ||
| 216 | CitysListDialog.getInstance((DialogCallBack.CitysCallBack) this).show(getSupportFragmentManager(), "CitysListDialog"); | ||
| 217 | |||
| 218 | |||
| 219 | } |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 5 | import android.view.View; | 5 | import android.view.View; |
| 6 | import android.widget.Button; | 6 | import android.widget.Button; |
| 7 | import android.widget.ImageView; | 7 | import android.widget.ImageView; |
| 8 | import android.widget.TextView; | 8 | import android.widget.TextView; |
| 9 | 9 | ||
| 10 | import com.hjx.personalcenter.R; | 10 | import com.hjx.personalcenter.R; |
| 11 | import com.hjx.personalcenter.db.SaveParam; | 11 | import com.hjx.personalcenter.db.SaveParam; |
| 12 | import com.hjx.personalcenter.http.HttpManager; | 12 | import com.hjx.personalcenter.http.HttpManager; |
| 13 | import com.hjx.personalcenter.util.GetDevicesUtil; | 13 | import com.hjx.personalcenter.util.GetDevicesUtil; |
| 14 | 14 | ||
| 15 | /**确认保卡信息 | 15 | /**确认保卡信息 |
| 16 | * Created by h on 2017/8/11. | 16 | * Created by h on 2017/8/11. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | public class ElectronicCardInfoOKActivity extends Activity implements View.OnClickListener { | 19 | public class ElectronicCardInfoOKActivity extends Activity implements View.OnClickListener { |
| 20 | private Button btn_finish; | 20 | private Button btn_finish; |
| 21 | private ImageView iv_last_step; | 21 | private ImageView iv_last_step; |
| 22 | private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,shopadress,phone,tlePhone; | 22 | private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,shopadress,phone,tlePhone; |
| 23 | @Override | 23 | @Override |
| 24 | protected void onCreate(Bundle savedInstanceState) { | 24 | protected void onCreate(Bundle savedInstanceState) { |
| 25 | super.onCreate(savedInstanceState); | 25 | super.onCreate(savedInstanceState); |
| 26 | setContentView(R.layout.activity_ok_cardinfo); | 26 | setContentView(R.layout.activity_ok_cardinfo); |
| 27 | initView(); | 27 | initView(); |
| 28 | initData(); | 28 | initData(); |
| 29 | initLister(); | 29 | initLister(); |
| 30 | } | 30 | } |
| 31 | private void initView() { | 31 | private void initView() { |
| 32 | btn_finish = (Button) findViewById(R.id.btn_finish); | 32 | btn_finish = (Button) findViewById(R.id.btn_finish); |
| 33 | iv_last_step = (ImageView) findViewById(R.id.cancel); | 33 | iv_last_step = (ImageView) findViewById(R.id.cancel); |
| 34 | usename = (TextView) findViewById(R.id.iv_card_username); | 34 | usename = (TextView) findViewById(R.id.iv_card_username); |
| 35 | deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel); | 35 | deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel); |
| 36 | customer_address = (TextView) findViewById(R.id.tv_card_adress); | 36 | customer_address = (TextView) findViewById(R.id.tv_card_adress); |
| 37 | mac_adress = (TextView) findViewById(R.id.tv_card_mac); | 37 | mac_adress = (TextView) findViewById(R.id.tv_card_mac); |
| 38 | shoptime = (TextView) findViewById(R.id.tv_card_time); | 38 | shoptime = (TextView) findViewById(R.id.tv_card_time); |
| 39 | deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber); | 39 | deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber); |
| 40 | shopadress = (TextView) findViewById(R.id.tv_card_shopAdress); | 40 | shopadress = (TextView) findViewById(R.id.tv_card_shopAdress); |
| 41 | phone = (TextView) findViewById(R.id.tv_card_phone); | 41 | phone = (TextView) findViewById(R.id.tv_card_phone); |
| 42 | tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); | 42 | tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | private void initData() { | 45 | private void initData() { |
| 46 | //获取设备信息 | 46 | //获取设备信息 |
| 47 | deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel()); | 47 | deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel()); |
| 48 | deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber()); | 48 | deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber()); |
| 49 | mac_adress.setText(GetDevicesUtil.getDevicesInfo(this).getMac()); | 49 | mac_adress.setText(GetDevicesUtil.getDevicesInfo(this).getMac()); |
| 50 | //获取保卡信息 | 50 | //获取保卡信息 |
| 51 | usename.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CUNSTEMNAME)); | 51 | usename.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CUNSTEMNAME)); |
| 52 | customer_address.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.ADRESSCUNSTEM)); | 52 | customer_address.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.ADRESSCUNSTEM)); |
| 53 | shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME)); | 53 | shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME)); |
| 54 | shopadress.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPADRESS)); | 54 | shopadress.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPADRESS)); |
| 55 | tlePhone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTLEPHONE)); | 55 | tlePhone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTLEPHONE)); |
| 56 | phone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CARDPHONE)); | 56 | phone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CARDPHONE)); |
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | private void initLister() { | 61 | private void initLister() { |
| 62 | iv_last_step.setOnClickListener(this); | 62 | iv_last_step.setOnClickListener(this); |
| 63 | btn_finish.setOnClickListener(this); | 63 | btn_finish.setOnClickListener(this); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | @Override | 66 | @Override |
| 67 | public void onClick(View v) { | 67 | public void onClick(View v) { |
| 68 | switch (v.getId()){ | 68 | switch (v.getId()){ |
| 69 | case R.id.btn_finish: | 69 | case R.id.btn_finish: |
| 70 | HttpManager.getInstance().subcardinfo(this,736,usename.getText().toString().trim(), | 70 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); |
| 71 | long auserID = 0; | ||
| 72 | try { | ||
| 73 | auserID = Long.parseLong(userID); | ||
| 74 | } catch (NumberFormatException e) { | ||
| 75 | e.printStackTrace(); | ||
| 76 | } | ||
| 77 | HttpManager.getInstance().subcardinfo(this,auserID,usename.getText().toString().trim(), | ||
| 71 | customer_address.getText().toString().trim(),shopadress.getText().toString().trim(), | 78 | customer_address.getText().toString().trim(),shopadress.getText().toString().trim(), |
| 72 | shoptime.getText().toString().trim(),tlePhone.getText().toString().trim(), | 79 | shoptime.getText().toString().trim(),tlePhone.getText().toString().trim(), |
| 73 | deviceModel.getText().toString().trim(),deviceNumber.getText().toString().trim(), | 80 | deviceModel.getText().toString().trim(),deviceNumber.getText().toString().trim(), |
| 74 | mac_adress.getText().toString().trim(),phone.getText().toString().trim()); | 81 | mac_adress.getText().toString().trim(),phone.getText().toString().trim()); |
| 75 | break; | 82 | break; |
| 76 | case R.id.cancel: | 83 | case R.id.cancel: |
| 77 | finish(); | 84 | finish(); |
| 78 | break; | 85 | break; |
| 79 | } | 86 | } |
| 80 | } | 87 | } |
| 81 | 88 | ||
| 82 | 89 | ||
| 83 | } | 90 | } |
| 84 | 91 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.content.Intent; | 3 | import android.content.Intent; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 5 | import android.os.Handler; | 5 | import android.os.Handler; |
| 6 | import android.os.Message; | 6 | import android.os.Message; |
| 7 | import android.support.v7.app.AppCompatActivity; | 7 | import android.support.v7.app.AppCompatActivity; |
| 8 | import android.view.View; | 8 | import android.view.View; |
| 9 | import android.widget.ImageView; | 9 | import android.widget.ImageView; |
| 10 | import android.widget.TextView; | 10 | import android.widget.TextView; |
| 11 | 11 | ||
| 12 | import com.hjx.personalcenter.R; | 12 | import com.hjx.personalcenter.R; |
| 13 | import com.hjx.personalcenter.db.Content; | 13 | import com.hjx.personalcenter.db.Content; |
| 14 | import com.hjx.personalcenter.db.SaveParam; | 14 | import com.hjx.personalcenter.db.SaveParam; |
| 15 | import com.hjx.personalcenter.http.HttpCode; | 15 | import com.hjx.personalcenter.http.HttpCode; |
| 16 | import com.hjx.personalcenter.http.HttpManager; | 16 | import com.hjx.personalcenter.http.HttpManager; |
| 17 | import com.hjx.personalcenter.model.CardInfo; | 17 | import com.hjx.personalcenter.model.CardInfo; |
| 18 | 18 | ||
| 19 | import java.util.ArrayList; | 19 | import java.util.ArrayList; |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * Created by h on 2017/8/11. | 22 | * Created by h on 2017/8/11. |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | public class ElectronicCardLookInfoActivity extends AppCompatActivity implements View.OnClickListener{ | 25 | public class ElectronicCardLookInfoActivity extends AppCompatActivity implements View.OnClickListener{ |
| 26 | private ImageView iv_last_step; | 26 | private ImageView iv_last_step; |
| 27 | private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber, | 27 | private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber, |
| 28 | shopadress,phone,tlePhone,tv_card_adress_change,tv_card_phone_change; | 28 | shopadress,phone,tlePhone,tv_card_adress_change,tv_card_phone_change; |
| 29 | private ArrayList<CardInfo.DataBean> data = new ArrayList<>(); | 29 | private ArrayList<CardInfo.DataBean> data = new ArrayList<>(); |
| 30 | 30 | ||
| 31 | Handler handler = new Handler(){ | 31 | Handler handler = new Handler(){ |
| 32 | @Override | 32 | @Override |
| 33 | public void handleMessage(Message msg) { | 33 | public void handleMessage(Message msg) { |
| 34 | super.handleMessage(msg); | 34 | super.handleMessage(msg); |
| 35 | switch (msg.what){ | 35 | switch (msg.what){ |
| 36 | 36 | ||
| 37 | case HttpCode.SUCHCARDINFO: | 37 | case HttpCode.SUCHCARDINFO: |
| 38 | CardInfo.DataBean cardinfoBean =(CardInfo.DataBean)msg.obj; | 38 | CardInfo.DataBean cardinfoBean =(CardInfo.DataBean)msg.obj; |
| 39 | //获取设备信息 | 39 | //获取设备信息 |
| 40 | deviceModel.setText(cardinfoBean.getProductModel()); | 40 | deviceModel.setText(cardinfoBean.getProductModel()); |
| 41 | deviceNumber.setText(cardinfoBean.getDeviceNumber()); | 41 | deviceNumber.setText(cardinfoBean.getDeviceNumber()); |
| 42 | mac_adress.setText(cardinfoBean.getMacAddress()); | 42 | mac_adress.setText(cardinfoBean.getMacAddress()); |
| 43 | //获取保卡信息 | 43 | //获取保卡信息 |
| 44 | usename.setText(cardinfoBean.getCustomerName()); | 44 | usename.setText(cardinfoBean.getCustomerName()); |
| 45 | customer_address.setText(cardinfoBean.getCustomerAddress()); | 45 | customer_address.setText(cardinfoBean.getCustomerAddress()); |
| 46 | shoptime.setText(cardinfoBean.getBuyTime()); | 46 | shoptime.setText(cardinfoBean.getBuyTime()); |
| 47 | shopadress.setText(cardinfoBean.getBuyAddress()); | 47 | shopadress.setText(cardinfoBean.getBuyAddress()); |
| 48 | tlePhone.setText(cardinfoBean.getAlterSaleCall()); | 48 | tlePhone.setText(cardinfoBean.getAlterSaleCall()); |
| 49 | phone.setText(cardinfoBean.getMobilePhone()); | 49 | phone.setText(cardinfoBean.getMobilePhone()); |
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | break; | 52 | break; |
| 53 | 53 | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | } | 56 | } |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | @Override | 59 | @Override |
| 60 | protected void onCreate(Bundle savedInstanceState) { | 60 | protected void onCreate(Bundle savedInstanceState) { |
| 61 | super.onCreate(savedInstanceState); | 61 | super.onCreate(savedInstanceState); |
| 62 | setContentView(R.layout.activity_electronic_look_cardinfo); | 62 | setContentView(R.layout.activity_electronic_look_cardinfo); |
| 63 | initView(); | 63 | initView(); |
| 64 | initData(); | 64 | initData(); |
| 65 | initLister(); | 65 | initLister(); |
| 66 | } | 66 | } |
| 67 | |||
| 68 | @Override | ||
| 69 | protected void onResume() { | ||
| 70 | super.onResume(); | ||
| 71 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | ||
| 72 | try { | ||
| 73 | Long a = Long.parseLong(userID); | ||
| 74 | HttpManager.getInstance().getcardinfo(this,a,handler); | ||
| 75 | } catch (NumberFormatException e) { | ||
| 76 | e.printStackTrace(); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 67 | private void initView() { | 80 | private void initView() { |
| 68 | usename = (TextView) findViewById(R.id.iv_card_username); | 81 | usename = (TextView) findViewById(R.id.iv_card_username); |
| 69 | iv_last_step = (ImageView) findViewById(R.id.cancel); | 82 | iv_last_step = (ImageView) findViewById(R.id.cancel); |
| 70 | deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel); | 83 | deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel); |
| 71 | customer_address = (TextView) findViewById(R.id.tv_card_adress); | 84 | customer_address = (TextView) findViewById(R.id.tv_card_adress); |
| 72 | mac_adress = (TextView) findViewById(R.id.tv_card_mac); | 85 | mac_adress = (TextView) findViewById(R.id.tv_card_mac); |
| 73 | shoptime = (TextView) findViewById(R.id.tv_card_time); | 86 | shoptime = (TextView) findViewById(R.id.tv_card_time); |
| 74 | deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber); | 87 | deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber); |
| 75 | shopadress = (TextView) findViewById(R.id.tv_card_shopAdress); | 88 | shopadress = (TextView) findViewById(R.id.tv_card_shopAdress); |
| 76 | phone = (TextView) findViewById(R.id.tv_card_phone); | 89 | phone = (TextView) findViewById(R.id.tv_card_phone); |
| 77 | tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); | 90 | tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); |
| 78 | tv_card_adress_change = (TextView) findViewById(R.id.tv_card_adress_change); | 91 | tv_card_adress_change = (TextView) findViewById(R.id.tv_card_adress_change); |
| 79 | tv_card_phone_change = (TextView) findViewById(R.id.tv_card_phone_change); | 92 | tv_card_phone_change = (TextView) findViewById(R.id.tv_card_phone_change); |
| 80 | } | 93 | } |
| 81 | private void initData() { | 94 | private void initData() { |
| 82 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | ||
| 83 | try { | ||
| 84 | int a = Integer.parseInt(userID); | ||
| 85 | HttpManager.getInstance().getcardinfo(this,a,handler); | ||
| 86 | } catch (NumberFormatException e) { | ||
| 87 | e.printStackTrace(); | ||
| 88 | } | ||
| 89 | 95 | ||
| 90 | // //获取设备信息 | 96 | // //获取设备信息 |
| 91 | // deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel()); | 97 | // deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel()); |
| 92 | // deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber()); | 98 | // deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber()); |
| 93 | // mac_adress.setText(GetDevicesUtil.getDevicesInfo(this).getMac()); | 99 | // mac_adress.setText(GetDevicesUtil.getDevicesInfo(this).getMac()); |
| 94 | // //获取保卡信息 | 100 | // //获取保卡信息 |
| 95 | // usename.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CUNSTEMNAME)); | 101 | // usename.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CUNSTEMNAME)); |
| 96 | // customer_address.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.ADRESSCUNSTEM)); | 102 | // customer_address.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.ADRESSCUNSTEM)); |
| 97 | // shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME)); | 103 | // shoptime.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTIME)); |
| 98 | // shopadress.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPADRESS)); | 104 | // shopadress.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPADRESS)); |
| 99 | // tlePhone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTLEPHONE)); | 105 | // tlePhone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.SHOPTLEPHONE)); |
| 100 | // phone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CARDPHONE)); | 106 | // phone.setText(SaveParam.getInstance().getCustomizeParam(this,SaveParam.CARDPHONE)); |
| 101 | 107 | ||
| 102 | 108 | ||
| 103 | } | 109 | } |
| 104 | private void initLister() { | 110 | private void initLister() { |
| 105 | tv_card_adress_change.setOnClickListener(this); | 111 | tv_card_adress_change.setOnClickListener(this); |
| 106 | tv_card_phone_change.setOnClickListener(this); | 112 | tv_card_phone_change.setOnClickListener(this); |
| 107 | iv_last_step.setOnClickListener(this); | 113 | iv_last_step.setOnClickListener(this); |
| 108 | } | 114 | } |
| 109 | @Override | 115 | @Override |
| 110 | public void onClick(View v) { | 116 | public void onClick(View v) { |
| 111 | switch (v.getId()){ | 117 | switch (v.getId()){ |
| 112 | case R.id.tv_card_adress_change: | 118 | case R.id.tv_card_adress_change: |
| 113 | Intent intent = new Intent(); | 119 | Intent intent = new Intent(); |
| 114 | intent.setClass(this,ChangeElectronicCardAdressInfoActivity.class); | 120 | intent.setClass(this,ChangeElectronicCardAdressInfoActivity.class); |
| 115 | startActivity(intent); | 121 | startActivity(intent); |
| 116 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 122 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 117 | 123 | ||
| 118 | break; | 124 | break; |
| 119 | case R.id.tv_card_phone_change: | 125 | case R.id.tv_card_phone_change: |
| 120 | Content.authcodeflag =2; | 126 | Content.authcodeflag =2; |
| 121 | Intent intent1 = new Intent(); | 127 | Intent intent1 = new Intent(); |
| 122 | intent1.setClass(this,ElectronicCardValidationActivity.class); | 128 | intent1.setClass(this,ElectronicCardValidationActivity.class); |
| 123 | startActivity(intent1); | 129 | startActivity(intent1); |
| 124 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 130 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 125 | 131 | ||
| 126 | 132 | ||
| 127 | break; | 133 | break; |
| 128 | case R.id.cancel: | 134 | case R.id.cancel: |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.os.Handler; | 6 | import android.os.Handler; |
| 7 | import android.os.Message; | 7 | import android.os.Message; |
| 8 | import android.text.TextUtils; | 8 | import android.text.TextUtils; |
| 9 | import android.view.View; | 9 | import android.view.View; |
| 10 | import android.widget.Button; | 10 | import android.widget.Button; |
| 11 | import android.widget.EditText; | 11 | import android.widget.EditText; |
| 12 | import android.widget.TextView; | 12 | import android.widget.TextView; |
| 13 | 13 | ||
| 14 | import com.hjx.personalcenter.R; | 14 | import com.hjx.personalcenter.R; |
| 15 | import com.hjx.personalcenter.db.Content; | 15 | import com.hjx.personalcenter.db.Content; |
| 16 | import com.hjx.personalcenter.db.SaveParam; | 16 | import com.hjx.personalcenter.db.SaveParam; |
| 17 | import com.hjx.personalcenter.http.HttpCode; | 17 | import com.hjx.personalcenter.http.HttpCode; |
| 18 | import com.hjx.personalcenter.http.HttpManager; | 18 | import com.hjx.personalcenter.http.HttpManager; |
| 19 | import com.hjx.personalcenter.util.AlertUtils; | 19 | import com.hjx.personalcenter.util.AlertUtils; |
| 20 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; | 20 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; |
| 21 | 21 | ||
| 22 | import org.json.JSONObject; | 22 | import org.json.JSONObject; |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * Created by h on 2017/8/9. | 25 | * Created by h on 2017/8/9. |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | public class ElectronicCardValidationActivity extends Activity implements View.OnClickListener { | 28 | public class ElectronicCardValidationActivity extends Activity implements View.OnClickListener { |
| 29 | private Button btn_card_valiyanzhen,get_authcode; | 29 | private Button btn_card_valiyanzhen,get_authcode; |
| 30 | private EditText phonenumber,anth_6num;//;//密码 | 30 | private EditText phonenumber,anth_6num;//;//密码 |
| 31 | private TextView menu_title; | 31 | private TextView menu_title; |
| 32 | private int i = 0; | 32 | private int i = 0; |
| 33 | private Thread thread; | 33 | private Thread thread; |
| 34 | private String sourceStr ="android"; | 34 | private String sourceStr ="android"; |
| 35 | private String typeStr = "register"; | 35 | private String typeStr = "register"; |
| 36 | String authcode = ""; | 36 | String authcode = ""; |
| 37 | Handler handler = new Handler() { | 37 | Handler handler = new Handler() { |
| 38 | @Override | 38 | @Override |
| 39 | public void handleMessage(Message msg) { | 39 | public void handleMessage(Message msg) { |
| 40 | super.handleMessage(msg); | 40 | super.handleMessage(msg); |
| 41 | JSONObject jsonObject; | 41 | JSONObject jsonObject; |
| 42 | String status; | 42 | String status; |
| 43 | switch (msg.what) { | 43 | switch (msg.what) { |
| 44 | case HttpCode.AUTHCODE_SUCESS: | 44 | case HttpCode.AUTHCODE_SUCESS: |
| 45 | jsonObject = (JSONObject) msg.obj; | 45 | jsonObject = (JSONObject) msg.obj; |
| 46 | status = jsonObject.optString("status"); | 46 | status = jsonObject.optString("status"); |
| 47 | authcode = jsonObject.optString("jsessionid"); | 47 | authcode = jsonObject.optString("jsessionid"); |
| 48 | if (status.equals("100")) { | 48 | if (status.equals("100")) { |
| 49 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送成功"); | 49 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送成功"); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | break; | 52 | break; |
| 53 | case HttpCode.AUTHCODE_FAIL: | 53 | case HttpCode.AUTHCODE_FAIL: |
| 54 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送失败"); | 54 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "验证码发送失败"); |
| 55 | break; | 55 | break; |
| 56 | case 1: | 56 | case 1: |
| 57 | get_authcode.setEnabled(false); | 57 | get_authcode.setEnabled(false); |
| 58 | get_authcode.setClickable(false); | 58 | get_authcode.setClickable(false); |
| 59 | get_authcode.setText(Integer.toString(i--)+" s"); | 59 | get_authcode.setText(Integer.toString(i--)+" s"); |
| 60 | if (i<=0){ | 60 | if (i<=0){ |
| 61 | get_authcode.setEnabled(true); | 61 | get_authcode.setEnabled(true); |
| 62 | get_authcode.setClickable(true); | 62 | get_authcode.setClickable(true); |
| 63 | get_authcode.setText("获取验证码"); | 63 | get_authcode.setText("获取验证码"); |
| 64 | } | 64 | } |
| 65 | break; | 65 | break; |
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | }; | 68 | }; |
| 69 | @Override | 69 | @Override |
| 70 | protected void onCreate(Bundle savedInstanceState) { | 70 | protected void onCreate(Bundle savedInstanceState) { |
| 71 | super.onCreate(savedInstanceState); | 71 | super.onCreate(savedInstanceState); |
| 72 | setContentView(R.layout.activity_electroniccard_validation); | 72 | setContentView(R.layout.activity_electroniccard_validation); |
| 73 | initView(); | 73 | initView(); |
| 74 | initData(); | 74 | initData(); |
| 75 | initLister(); | 75 | initLister(); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | private void initView() { | 78 | private void initView() { |
| 79 | btn_card_valiyanzhen = (Button) findViewById(R.id.btn_card_valiyanzhen); | 79 | btn_card_valiyanzhen = (Button) findViewById(R.id.btn_card_valiyanzhen); |
| 80 | get_authcode = (Button) findViewById(R.id.btn_authcode); | 80 | get_authcode = (Button) findViewById(R.id.btn_authcode); |
| 81 | anth_6num = (EditText) findViewById(R.id.et_authcode); | 81 | anth_6num = (EditText) findViewById(R.id.et_authcode); |
| 82 | phonenumber = (EditText) findViewById(R.id.et_phonenumber); | 82 | phonenumber = (EditText) findViewById(R.id.et_phonenumber); |
| 83 | menu_title = (TextView) findViewById(R.id.menu_title); | 83 | menu_title = (TextView) findViewById(R.id.menu_title); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | private void initData() { | 86 | private void initData() { |
| 87 | if (Content.authcodeflag==1){ | 87 | if (Content.authcodeflag==1){ |
| 88 | menu_title.setText("更换绑定"); | 88 | menu_title.setText("更换绑定"); |
| 89 | btn_card_valiyanzhen.setText("确定"); | 89 | btn_card_valiyanzhen.setText("确定"); |
| 90 | 90 | ||
| 91 | }else if (Content.authcodeflag==2){ | 91 | }else if (Content.authcodeflag==2){ |
| 92 | menu_title.setText("修改保卡信息"); | 92 | menu_title.setText("修改保卡信息"); |
| 93 | btn_card_valiyanzhen.setText("确定"); | 93 | btn_card_valiyanzhen.setText("确定"); |
| 94 | 94 | ||
| 95 | }else { | 95 | }else { |
| 96 | menu_title.setText("填写保卡信息"); | 96 | menu_title.setText("填写保卡信息"); |
| 97 | btn_card_valiyanzhen.setText("下一步"); | 97 | btn_card_valiyanzhen.setText("下一步"); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | private void initLister() { | 104 | private void initLister() { |
| 105 | get_authcode.setOnClickListener(this); | 105 | get_authcode.setOnClickListener(this); |
| 106 | btn_card_valiyanzhen.setOnClickListener(this); | 106 | btn_card_valiyanzhen.setOnClickListener(this); |
| 107 | 107 | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | @Override | 110 | @Override |
| 111 | public void onClick(View v) { | 111 | public void onClick(View v) { |
| 112 | switch (v.getId()){ | 112 | switch (v.getId()){ |
| 113 | case R.id.btn_card_valiyanzhen: | 113 | case R.id.btn_card_valiyanzhen: |
| 114 | 114 | ||
| 115 | String usernameStr = phonenumber.getText().toString().trim(); | 115 | String usernameStr = phonenumber.getText().toString().trim(); |
| 116 | String authcodeStr = anth_6num.getText().toString().trim(); | 116 | String authcodeStr = anth_6num.getText().toString().trim(); |
| 117 | if (TextUtils.isEmpty(usernameStr) || TextUtils.isEmpty(authcodeStr)) { | 117 | if (TextUtils.isEmpty(usernameStr) || TextUtils.isEmpty(authcodeStr)) { |
| 118 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号,和验证码不能为空"); | 118 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号,和验证码不能为空"); |
| 119 | return; | 119 | return; |
| 120 | } else if (!PhoneNumCheckUtils.isPhone(usernameStr)){ | 120 | } else if (!PhoneNumCheckUtils.isPhone(usernameStr)){ |
| 121 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号码输入错误"); | 121 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "手机号码输入错误"); |
| 122 | 122 | ||
| 123 | }else if (!authcode.equals(authcodeStr)){ | 123 | }else if (!authcode.equals(authcodeStr)){ |
| 124 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "您输入的验证码不正确"); | 124 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "您输入的验证码不正确"); |
| 125 | }else { | 125 | }else { |
| 126 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | ||
| 127 | int auserID = 0; | ||
| 128 | try { | ||
| 129 | auserID = Integer.parseInt(userID); | ||
| 130 | } catch (NumberFormatException e) { | ||
| 131 | e.printStackTrace(); | ||
| 132 | } | ||
| 126 | if (Content.authcodeflag==1){ | 133 | if (Content.authcodeflag==1){ |
| 127 | //修改账户手机号 | 134 | //修改账户手机号 |
| 128 | HttpManager.getInstance().changecardinfophone(this, | 135 | HttpManager.getInstance().changecardinfophone(this, |
| 129 | 736,usernameStr,authcodeStr); | 136 | auserID,usernameStr,authcodeStr); |
| 130 | 137 | ||
| 131 | 138 | ||
| 132 | }else if (Content.authcodeflag==2){ | 139 | }else if (Content.authcodeflag==2){ |
| 133 | //修改保卡手机号 | 140 | //修改保卡手机号 |
| 134 | HttpManager.getInstance().changecardinfophone(this, | 141 | HttpManager.getInstance().changecardinfophone(this, |
| 135 | 736,usernameStr,authcodeStr); | 142 | auserID,usernameStr,authcodeStr); |
| 136 | }else { | 143 | }else { |
| 137 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); | 144 | String phone =phonenumber.getText().toString().trim(); |
| 145 | SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phone ); | ||
| 138 | Intent intent = new Intent(); | 146 | Intent intent = new Intent(); |
| 139 | intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | 147 | intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); |
| 140 | startActivity(intent); | 148 | startActivity(intent); |
| 141 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 149 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 142 | } | 150 | } |
| 143 | // SaveParam.getInstance().saveLoginParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); | 151 | // SaveParam.getInstance().saveLoginParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); |
| 144 | // Intent intent = new Intent(); | 152 | // Intent intent = new Intent(); |
| 145 | // intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); | 153 | // intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); |
| 146 | // startActivity(intent); | 154 | // startActivity(intent); |
| 147 | // overridePendingTransition(R.anim.rightin, R.anim.rightout); | 155 | // overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 148 | } | 156 | } |
| 149 | break; | 157 | break; |
| 150 | case R.id.btn_authcode: | 158 | case R.id.btn_authcode: |
| 151 | String usernameStr1 = phonenumber.getText().toString().trim(); | 159 | String usernameStr1 = phonenumber.getText().toString().trim(); |
| 152 | if (!PhoneNumCheckUtils.isPhone(usernameStr1)){ | 160 | if (!PhoneNumCheckUtils.isPhone(usernameStr1)){ |
| 153 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "请输入正确的手机号"); | 161 | AlertUtils.showToast(ElectronicCardValidationActivity.this, "请输入正确的手机号"); |
| 154 | }else { | 162 | }else { |
| 155 | anth_6num.requestFocus(); | 163 | anth_6num.requestFocus(); |
| 156 | HttpManager.getInstance().authCode(typeStr, usernameStr1, handler, ElectronicCardValidationActivity.this); | 164 | HttpManager.getInstance().authCode(typeStr, usernameStr1, handler, ElectronicCardValidationActivity.this); |
| 157 | i = 60; | 165 | i = 60; |
| 158 | if(thread == null){ | 166 | if(thread == null){ |
| 159 | thread = new Thread( new ThreadShow()); | 167 | thread = new Thread( new ThreadShow()); |
| 160 | thread.start(); | 168 | thread.start(); |
| 161 | } | 169 | } |
| 162 | 170 | ||
| 163 | } | 171 | } |
| 164 | 172 | ||
| 165 | break; | 173 | break; |
| 166 | } | 174 | } |
| 167 | } | 175 | } |
| 168 | // 线程类 定时器 | 176 | // 线程类 定时器 |
| 169 | class ThreadShow implements Runnable { | 177 | class ThreadShow implements Runnable { |
| 170 | 178 | ||
| 171 | @Override | 179 | @Override |
| 172 | public void run() { | 180 | public void run() { |
| 173 | // TODO Auto-generated method stub | 181 | // TODO Auto-generated method stub |
| 174 | while (true) { | 182 | while (true) { |
| 175 | try { | 183 | try { |
| 176 | Thread.sleep(1000); | 184 | Thread.sleep(1000); |
| 177 | Message msg = new Message(); | 185 | Message msg = new Message(); |
| 178 | msg.what = 1; | 186 | msg.what = 1; |
| 179 | handler.sendMessage(msg); | 187 | handler.sendMessage(msg); |
| 180 | System.out.println("send..."); | 188 | System.out.println("send..."); |
| 181 | } catch (Exception e) { | 189 | } catch (Exception e) { |
| 182 | // TODO Auto-generated catch block | 190 | // TODO Auto-generated catch block |
| 183 | e.printStackTrace(); | 191 | e.printStackTrace(); |
| 184 | System.out.println("thread error..."); | 192 | System.out.println("thread error..."); |
| 185 | } | 193 | } |
| 186 | } | 194 | } |
| 187 | } | 195 | } |
| 188 | } | 196 | } |
| 189 | } | 197 | } |
| 190 | 198 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/FeedBackActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.content.Intent; | 3 | import android.content.Intent; |
| 4 | import android.content.pm.PackageManager; | 4 | import android.content.pm.PackageManager; |
| 5 | import android.graphics.Color; | 5 | import android.graphics.Color; |
| 6 | import android.net.Uri; | 6 | import android.net.Uri; |
| 7 | import android.os.Build; | 7 | import android.os.Build; |
| 8 | import android.os.Bundle; | 8 | import android.os.Bundle; |
| 9 | import android.provider.MediaStore; | 9 | import android.provider.MediaStore; |
| 10 | import android.support.annotation.NonNull; | 10 | import android.support.annotation.NonNull; |
| 11 | import android.support.v4.content.FileProvider; | 11 | import android.support.v4.content.FileProvider; |
| 12 | import android.support.v7.app.AppCompatActivity; | 12 | import android.support.v7.app.AppCompatActivity; |
| 13 | import android.view.Gravity; | 13 | import android.view.Gravity; |
| 14 | import android.view.View; | 14 | import android.view.View; |
| 15 | import android.widget.AdapterView; | 15 | import android.widget.AdapterView; |
| 16 | import android.widget.EditText; | 16 | import android.widget.EditText; |
| 17 | import android.widget.ImageView; | 17 | import android.widget.ImageView; |
| 18 | import android.widget.TextView; | 18 | import android.widget.TextView; |
| 19 | import android.widget.Toast; | 19 | import android.widget.Toast; |
| 20 | 20 | ||
| 21 | import com.facebook.drawee.backends.pipeline.Fresco; | 21 | import com.facebook.drawee.backends.pipeline.Fresco; |
| 22 | import com.facebook.drawee.generic.GenericDraweeHierarchy; | 22 | import com.facebook.drawee.generic.GenericDraweeHierarchy; |
| 23 | import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder; | 23 | import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder; |
| 24 | import com.facebook.drawee.generic.RoundingParams; | 24 | import com.facebook.drawee.generic.RoundingParams; |
| 25 | import com.facebook.drawee.interfaces.DraweeController; | 25 | import com.facebook.drawee.interfaces.DraweeController; |
| 26 | import com.facebook.drawee.view.SimpleDraweeView; | 26 | import com.facebook.drawee.view.SimpleDraweeView; |
| 27 | import com.hjx.personalcenter.R; | 27 | import com.hjx.personalcenter.R; |
| 28 | import com.hjx.personalcenter.util.CropUtils; | 28 | import com.hjx.personalcenter.util.CropUtils; |
| 29 | import com.hjx.personalcenter.util.DialogPermission; | 29 | import com.hjx.personalcenter.util.DialogPermission; |
| 30 | import com.hjx.personalcenter.util.FileUtil; | 30 | import com.hjx.personalcenter.util.FileUtil; |
| 31 | import com.hjx.personalcenter.util.PermissionUtil; | 31 | import com.hjx.personalcenter.util.PermissionUtil; |
| 32 | import com.hjx.personalcenter.util.SharedPreferenceMark; | 32 | import com.hjx.personalcenter.util.SharedPreferenceMark; |
| 33 | import com.mylhyl.circledialog.CircleDialog; | 33 | import com.mylhyl.circledialog.CircleDialog; |
| 34 | import com.mylhyl.circledialog.callback.ConfigButton; | 34 | import com.mylhyl.circledialog.callback.ConfigButton; |
| 35 | import com.mylhyl.circledialog.callback.ConfigDialog; | 35 | import com.mylhyl.circledialog.callback.ConfigDialog; |
| 36 | import com.mylhyl.circledialog.params.ButtonParams; | 36 | import com.mylhyl.circledialog.params.ButtonParams; |
| 37 | import com.mylhyl.circledialog.params.DialogParams; | 37 | import com.mylhyl.circledialog.params.DialogParams; |
| 38 | 38 | ||
| 39 | import java.io.File; | 39 | import java.io.File; |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| 42 | * Created by h on 2017/8/11. | 42 | * Created by h on 2017/8/11. |
| 43 | */ | 43 | */ |
| 44 | 44 | ||
| 45 | public class FeedBackActivity extends AppCompatActivity implements View.OnClickListener { | 45 | public class FeedBackActivity extends AppCompatActivity implements View.OnClickListener { |
| 46 | private ImageView iv_cance,iv_show,iv_take; | 46 | private ImageView iv_cance,iv_show,iv_take; |
| 47 | private EditText content, phone; | 47 | private EditText content, phone; |
| 48 | private TextView tv_sub; | 48 | private TextView tv_sub; |
| 49 | private static final int REQUEST_CODE_TAKE_PHOTO = 1; | 49 | private static final int REQUEST_CODE_TAKE_PHOTO = 1; |
| 50 | private static final int REQUEST_CODE_ALBUM = 2; | 50 | private static final int REQUEST_CODE_ALBUM = 2; |
| 51 | private static final int REQUEST_CODE_CROUP_PHOTO = 3; | 51 | private static final int REQUEST_CODE_CROUP_PHOTO = 3; |
| 52 | SimpleDraweeView mSimpleDraweeView; | 52 | SimpleDraweeView mSimpleDraweeView; |
| 53 | private File file; | 53 | private File file; |
| 54 | private Uri uri; | 54 | private Uri uri; |
| 55 | @Override | 55 | @Override |
| 56 | protected void onCreate(Bundle savedInstanceState) { | 56 | protected void onCreate(Bundle savedInstanceState) { |
| 57 | super.onCreate(savedInstanceState); | 57 | super.onCreate(savedInstanceState); |
| 58 | Fresco.initialize(this); | 58 | Fresco.initialize(this); |
| 59 | setContentView(R.layout.activity_feedback); | 59 | setContentView(R.layout.activity_feedback); |
| 60 | initView(); | 60 | initView(); |
| 61 | initData(); | 61 | initData(); |
| 62 | initLister(); | 62 | initLister(); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | private void initView() { | 65 | private void initView() { |
| 66 | iv_cance = (ImageView) findViewById(R.id.cancel); | 66 | iv_cance = (ImageView) findViewById(R.id.cancel); |
| 67 | mSimpleDraweeView = (SimpleDraweeView) findViewById(R.id.show_iv); | 67 | mSimpleDraweeView = (SimpleDraweeView) findViewById(R.id.show_iv); |
| 68 | iv_take = (ImageView) findViewById(R.id.iv_take); | 68 | iv_take = (ImageView) findViewById(R.id.iv_take); |
| 69 | content = (EditText) findViewById(R.id.feedback_content); | 69 | content = (EditText) findViewById(R.id.feedback_content); |
| 70 | phone = (EditText) findViewById(R.id.feedback_phone); | 70 | phone = (EditText) findViewById(R.id.feedback_phone); |
| 71 | tv_sub = (TextView) findViewById(R.id.feedback_sub); | 71 | tv_sub = (TextView) findViewById(R.id.feedback_sub); |
| 72 | 72 | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | private void initData() { | 75 | private void initData() { |
| 76 | file = new File(FileUtil.getCachePath(this), "user-avatar.jpg"); | 76 | file = new File(FileUtil.getCachePath(this), "user-avatar.jpg"); |
| 77 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { | 77 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { |
| 78 | uri = Uri.fromFile(file); | 78 | uri = Uri.fromFile(file); |
| 79 | } else { | 79 | } else { |
| 80 | //通过FileProvider创建一个content类型的Uri(android 7.0需要这样的方法跨应用访问) | 80 | //通过FileProvider创建一个content类型的Uri(android 7.0需要这样的方法跨应用访问) |
| 81 | uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter", file); | 81 | uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter", file); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | private void initLister() { | 86 | private void initLister() { |
| 87 | iv_cance.setOnClickListener(this); | 87 | iv_cance.setOnClickListener(this); |
| 88 | iv_take.setOnClickListener(this); | 88 | iv_take.setOnClickListener(this); |
| 89 | tv_sub.setOnClickListener(this); | 89 | tv_sub.setOnClickListener(this); |
| 90 | mSimpleDraweeView.setOnClickListener(this); | ||
| 90 | 91 | ||
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | @Override | 94 | @Override |
| 94 | public void onClick(View v) { | 95 | public void onClick(View v) { |
| 95 | switch (v.getId()){ | 96 | switch (v.getId()){ |
| 96 | case R.id.cancel: | 97 | case R.id.cancel: |
| 97 | finish(); | 98 | finish(); |
| 98 | break; | 99 | break; |
| 99 | case R.id.iv_take: | 100 | case R.id.iv_take: |
| 100 | choiceAvatar(); | 101 | choiceAvatar(); |
| 101 | break; | 102 | break; |
| 102 | case R.id.feedback_sub: | 103 | case R.id.feedback_sub: |
| 103 | break; | 104 | break; |
| 105 | case R.id.show_iv: | ||
| 106 | |||
| 107 | break; | ||
| 104 | } | 108 | } |
| 105 | } | 109 | } |
| 106 | 110 | ||
| 107 | //拍摄头像 | 111 | //拍摄头像 |
| 108 | private void choiceAvatar() { | 112 | private void choiceAvatar() { |
| 109 | final String[] items = {"拍照", "从相册选择"}; | 113 | final String[] items = {"拍照", "从相册选择"}; |
| 110 | new CircleDialog.Builder(this) | 114 | new CircleDialog.Builder(this) |
| 111 | .configDialog(new ConfigDialog() { | 115 | .configDialog(new ConfigDialog() { |
| 112 | @Override | 116 | @Override |
| 113 | public void onConfig(DialogParams params) { | 117 | public void onConfig(DialogParams params) { |
| 114 | //增加弹出动画 | 118 | //增加弹出动画 |
| 115 | params.gravity = Gravity.CENTER; | 119 | params.gravity = Gravity.CENTER; |
| 116 | } | 120 | } |
| 117 | }) | 121 | }) |
| 118 | .setTitle("请选择图片来源") | 122 | .setTitle("请选择图片来源") |
| 119 | .setWidth(0.5f) | 123 | .setWidth(0.5f) |
| 120 | .setItems(items, new AdapterView.OnItemClickListener() { | 124 | .setItems(items, new AdapterView.OnItemClickListener() { |
| 121 | @Override | 125 | @Override |
| 122 | public void onItemClick(AdapterView<?> parent, View view, int | 126 | public void onItemClick(AdapterView<?> parent, View view, int |
| 123 | position, long id) { | 127 | position, long id) { |
| 124 | switch (position){ | 128 | switch (position){ |
| 125 | case 0: | 129 | case 0: |
| 126 | if (PermissionUtil.hasCameraPermission(FeedBackActivity.this)) { | 130 | if (PermissionUtil.hasCameraPermission(FeedBackActivity.this)) { |
| 127 | uploadAvatarFromPhotoRequest(); | 131 | uploadAvatarFromPhotoRequest(); |
| 128 | } | 132 | } |
| 129 | break; | 133 | break; |
| 130 | case 1: | 134 | case 1: |
| 131 | uploadAvatarFromAlbumRequest(); | 135 | uploadAvatarFromAlbumRequest(); |
| 132 | break; | 136 | break; |
| 133 | } | 137 | } |
| 134 | 138 | ||
| 135 | } | 139 | } |
| 136 | }) | 140 | }) |
| 137 | .setNegative("取消", null) | 141 | .setNegative("取消", null) |
| 138 | .configNegative(new ConfigButton() { | 142 | .configNegative(new ConfigButton() { |
| 139 | @Override | 143 | @Override |
| 140 | public void onConfig(ButtonParams params) { | 144 | public void onConfig(ButtonParams params) { |
| 141 | //取消按钮字体颜色 | 145 | //取消按钮字体颜色 |
| 142 | params.textColor = Color.RED; | 146 | params.textColor = Color.RED; |
| 143 | } | 147 | } |
| 144 | }) | 148 | }) |
| 145 | .show(); | 149 | .show(); |
| 146 | 150 | ||
| 147 | 151 | ||
| 148 | } | 152 | } |
| 149 | //照相 | 153 | //照相 |
| 150 | private void uploadAvatarFromPhotoRequest() { | 154 | private void uploadAvatarFromPhotoRequest() { |
| 151 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | 155 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
| 152 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | 156 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| 153 | intent.putExtra(MediaStore.Images.Media.ORIENTATION, 0); | 157 | intent.putExtra(MediaStore.Images.Media.ORIENTATION, 0); |
| 154 | intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); | 158 | intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); |
| 155 | startActivityForResult(intent, REQUEST_CODE_TAKE_PHOTO); | 159 | startActivityForResult(intent, REQUEST_CODE_TAKE_PHOTO); |
| 156 | } | 160 | } |
| 157 | 161 | ||
| 158 | //选择图库 | 162 | //选择图库 |
| 159 | private void uploadAvatarFromAlbumRequest() { | 163 | private void uploadAvatarFromAlbumRequest() { |
| 160 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | 164 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); |
| 161 | photoPickerIntent.setType("image/*"); | 165 | photoPickerIntent.setType("image/*"); |
| 162 | startActivityForResult(photoPickerIntent, REQUEST_CODE_ALBUM); | 166 | startActivityForResult(photoPickerIntent, REQUEST_CODE_ALBUM); |
| 163 | } | 167 | } |
| 164 | //回掉 | 168 | //回掉 |
| 165 | @Override | 169 | @Override |
| 166 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { | 170 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 167 | super.onActivityResult(requestCode, resultCode, data); | 171 | super.onActivityResult(requestCode, resultCode, data); |
| 168 | if (resultCode != -1) { | 172 | if (resultCode != -1) { |
| 169 | return; | 173 | return; |
| 170 | } | 174 | } |
| 171 | if (requestCode == REQUEST_CODE_ALBUM && data != null) { | 175 | if (requestCode == REQUEST_CODE_ALBUM && data != null) { |
| 172 | Uri newUri; | 176 | Uri newUri; |
| 173 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { | 177 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { |
| 174 | newUri = Uri.parse("file:///" + CropUtils.getPath(this, data.getData())); | 178 | newUri = Uri.parse("file:///" + CropUtils.getPath(this, data.getData())); |
| 175 | } else { | 179 | } else { |
| 176 | newUri = data.getData(); | 180 | newUri = data.getData(); |
| 177 | } | 181 | } |
| 178 | if (newUri != null) { | 182 | if (newUri != null) { |
| 179 | startPhotoZoom(newUri); | 183 | startPhotoZoom(newUri); |
| 180 | } else { | 184 | } else { |
| 181 | Toast.makeText(this, "没有得到相册图片", Toast.LENGTH_LONG).show(); | 185 | Toast.makeText(this, "没有得到相册图片", Toast.LENGTH_LONG).show(); |
| 182 | } | 186 | } |
| 183 | } else if (requestCode == REQUEST_CODE_TAKE_PHOTO) { | 187 | } else if (requestCode == REQUEST_CODE_TAKE_PHOTO) { |
| 184 | startPhotoZoom(uri); | 188 | startPhotoZoom(uri); |
| 185 | } else if (requestCode == REQUEST_CODE_CROUP_PHOTO) { | 189 | } else if (requestCode == REQUEST_CODE_CROUP_PHOTO) { |
| 186 | uploadAvatarFromPhoto(); | 190 | uploadAvatarFromPhoto(); |
| 187 | } | 191 | } |
| 188 | } | 192 | } |
| 189 | 193 | ||
| 190 | private void uploadAvatarFromPhoto() { | 194 | private void uploadAvatarFromPhoto() { |
| 191 | compressAndUploadAvatar(file.getPath()); | 195 | compressAndUploadAvatar(file.getPath()); |
| 192 | 196 | ||
| 193 | } | 197 | } |
| 194 | private void compressAndUploadAvatar(String fileSrc) { | 198 | private void compressAndUploadAvatar(String fileSrc) { |
| 195 | 199 | ||
| 196 | 200 | ||
| 197 | //上传到服务器 | 201 | //上传到服务器 |
| 198 | 202 | ||
| 199 | final File cover = FileUtil.getSmallBitmap(this, fileSrc); | 203 | final File cover = FileUtil.getSmallBitmap(this, fileSrc); |
| 200 | String mimeType = "image/*"; | 204 | String mimeType = "image/*"; |
| 201 | //requestBody = RequestBody.create(MediaType.parse(mimeType), file); | 205 | //requestBody = RequestBody.create(MediaType.parse(mimeType), file); |
| 202 | //String fileName = cover.getName(); | 206 | //String fileName = cover.getName(); |
| 203 | //HttpManager.getInstance().header(this, fileSrc); | 207 | //HttpManager.getInstance().header(this, fileSrc); |
| 204 | //photo = MultipartBody.Part.createFormData("portrait", fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length()), requestBody); | 208 | //photo = MultipartBody.Part.createFormData("portrait", fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length()), requestBody); |
| 205 | //Fresco设置圆形头像 | 209 | //Fresco设置圆形头像 |
| 206 | GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources()); | 210 | GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources()); |
| 207 | GenericDraweeHierarchy hierarchy = builder | 211 | GenericDraweeHierarchy hierarchy = builder |
| 208 | .setDesiredAspectRatio(1f) | 212 | .setDesiredAspectRatio(1f) |
| 209 | .setFailureImage(R.mipmap.blank) | 213 | .setFailureImage(R.mipmap.blank) |
| 210 | //圆形头像 | 214 | //圆形头像 |
| 211 | .setRoundingParams(RoundingParams.asCircle()) | 215 | .setRoundingParams(RoundingParams.fromCornersRadius(0.7f)) |
| 212 | .build(); | 216 | .build(); |
| 213 | 217 | ||
| 214 | //加载本地图片 | 218 | //加载本地图片 |
| 215 | Uri uri = Uri.fromFile(cover); | 219 | Uri uri = Uri.fromFile(cover); |
| 216 | DraweeController controller = Fresco.newDraweeControllerBuilder() | 220 | DraweeController controller = Fresco.newDraweeControllerBuilder() |
| 217 | .setOldController(mSimpleDraweeView.getController()) | 221 | .setOldController(mSimpleDraweeView.getController()) |
| 218 | .setUri(uri) | 222 | .setUri(uri) |
| 219 | .build(); | 223 | .build(); |
| 220 | mSimpleDraweeView.setHierarchy(hierarchy); | 224 | mSimpleDraweeView.setHierarchy(hierarchy); |
| 221 | mSimpleDraweeView.setController(controller); | 225 | mSimpleDraweeView.setController(controller); |
| 222 | 226 | ||
| 223 | } | 227 | } |
| 224 | 228 | ||
| 225 | public void startPhotoZoom(Uri uri) { | 229 | public void startPhotoZoom(Uri uri) { |
| 226 | Intent intent = new Intent("com.android.camera.action.CROP"); | 230 | Intent intent = new Intent("com.android.camera.action.CROP"); |
| 227 | intent.setDataAndType(uri, "image/*"); | 231 | intent.setDataAndType(uri, "image/*"); |
| 228 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | 232 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| 229 | intent.putExtra("crop", "true");// crop=true 有这句才能出来最后的裁剪页面. | 233 | intent.putExtra("crop", "true");// crop=true 有这句才能出来最后的裁剪页面. |
| 230 | intent.putExtra("aspectX", 1);// 这两项为裁剪框的比例. | 234 | // intent.putExtra("aspectX", 1);// 这两项为裁剪框的比例. |
| 231 | intent.putExtra("aspectY", 1);// x:y=1:1 | 235 | // intent.putExtra("aspectY", 1);// x:y=1:1 |
| 232 | // intent.putExtra("outputX", 400);//图片输出大小 | 236 | intent.putExtra("outputX", 400);//图片输出大小 |
| 233 | // intent.putExtra("outputY", 400); | 237 | intent.putExtra("outputY", 400); |
| 234 | intent.putExtra("output", Uri.fromFile(file)); | 238 | intent.putExtra("output", Uri.fromFile(file)); |
| 235 | intent.putExtra("outputFormat", "JPEG");// 返回格式 | 239 | intent.putExtra("outputFormat", "JPEG");// 返回格式 |
| 236 | startActivityForResult(intent, REQUEST_CODE_CROUP_PHOTO); | 240 | startActivityForResult(intent, REQUEST_CODE_CROUP_PHOTO); |
| 237 | } | 241 | } |
| 238 | 242 | ||
| 239 | @Override | 243 | @Override |
| 240 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { | 244 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { |
| 241 | switch (requestCode) { | 245 | switch (requestCode) { |
| 242 | 246 | ||
| 243 | case PermissionUtil.REQUEST_SHOWCAMERA: | 247 | case PermissionUtil.REQUEST_SHOWCAMERA: |
| 244 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { | 248 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { |
| 245 | // Permission Granted | 249 | // Permission Granted |
| 246 | uploadAvatarFromPhotoRequest(); | 250 | uploadAvatarFromPhotoRequest(); |
| 247 | 251 | ||
| 248 | } else { | 252 | } else { |
| 249 | if (!SharedPreferenceMark.getHasShowCamera()) { | 253 | if (!SharedPreferenceMark.getHasShowCamera()) { |
| 250 | SharedPreferenceMark.setHasShowCamera(true); | 254 | SharedPreferenceMark.setHasShowCamera(true); |
| 251 | new DialogPermission(this, "关闭摄像头权限影响扫描功能"); | 255 | new DialogPermission(this, "关闭摄像头权限影响扫描功能"); |
| 252 | 256 | ||
| 253 | } else { | 257 | } else { |
| 254 | Toast.makeText(this, "未获取摄像头权限", Toast.LENGTH_SHORT) | 258 | Toast.makeText(this, "未获取摄像头权限", Toast.LENGTH_SHORT) |
| 255 | .show(); | 259 | .show(); |
| 256 | } | 260 | } |
| 257 | } | 261 | } |
| 258 | break; | 262 | break; |
| 259 | default: | 263 | default: |
| 260 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); | 264 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); |
| 261 | } | 265 | } |
| 262 | } | 266 | } |
| 263 | } | 267 | } |
| 264 | 268 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/LoginAndRegisterActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.content.Intent; | ||
| 3 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 4 | import android.support.annotation.Nullable; | 5 | import android.support.annotation.Nullable; |
| 5 | import android.support.v4.app.Fragment; | 6 | import android.support.v4.app.Fragment; |
| 6 | import android.support.v4.view.ViewPager; | 7 | import android.support.v4.view.ViewPager; |
| 7 | import android.support.v7.app.AppCompatActivity; | 8 | import android.support.v7.app.AppCompatActivity; |
| 8 | 9 | ||
| 9 | import com.hjx.personalcenter.R; | 10 | import com.hjx.personalcenter.R; |
| 10 | import com.hjx.personalcenter.adapter.LoginAndRegisterAdapter; | 11 | import com.hjx.personalcenter.adapter.LoginAndRegisterAdapter; |
| 12 | import com.hjx.personalcenter.db.SaveParam; | ||
| 11 | import com.hjx.personalcenter.fragment.RegisterFragment; | 13 | import com.hjx.personalcenter.fragment.RegisterFragment; |
| 12 | import com.hjx.personalcenter.fragment.LoginFragment; | 14 | import com.hjx.personalcenter.fragment.LoginFragment; |
| 13 | import com.hjx.personalcenter.thirdparty.SlidingTabLayout; | 15 | import com.hjx.personalcenter.thirdparty.SlidingTabLayout; |
| 14 | 16 | ||
| 15 | import java.util.ArrayList; | 17 | import java.util.ArrayList; |
| 16 | import java.util.Arrays; | 18 | import java.util.Arrays; |
| 17 | import java.util.List; | 19 | import java.util.List; |
| 18 | 20 | ||
| 19 | /** | 21 | /** |
| 20 | * 登录和注册 熊巍 | 22 | * 登录和注册 熊巍 |
| 21 | * Created by h on 2017/8/8. | 23 | * Created by h on 2017/8/8. |
| 22 | */ | 24 | */ |
| 23 | 25 | ||
| 24 | public class LoginAndRegisterActivity extends AppCompatActivity { | 26 | public class LoginAndRegisterActivity extends AppCompatActivity { |
| 25 | private ViewPager viewPager; | 27 | private ViewPager viewPager; |
| 26 | private SlidingTabLayout tableLayout; | 28 | private SlidingTabLayout tableLayout; |
| 27 | private List<Fragment> loginlist; | 29 | private List<Fragment> loginlist; |
| 28 | private LoginAndRegisterAdapter logindapter; | 30 | private LoginAndRegisterAdapter logindapter; |
| 29 | private List<String> title = Arrays.asList("登录", "注册"); | 31 | private List<String> title = Arrays.asList("登录", "注册"); |
| 30 | 32 | ||
| 31 | @Override | 33 | @Override |
| 32 | protected void onCreate(@Nullable Bundle savedInstanceState) { | 34 | protected void onCreate(@Nullable Bundle savedInstanceState) { |
| 33 | super.onCreate(savedInstanceState); | 35 | super.onCreate(savedInstanceState); |
| 36 | String islogin =SaveParam.getInstance().getLoginParam(this,"login"); | ||
| 37 | if ("true".equals(islogin)){ | ||
| 38 | Intent intent = new Intent(); | ||
| 39 | intent.setClass(this,MainActivity.class); | ||
| 40 | startActivity(intent); | ||
| 41 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | ||
| 42 | finish(); | ||
| 43 | |||
| 44 | } | ||
| 34 | setContentView(R.layout.activity_loginandregister); | 45 | setContentView(R.layout.activity_loginandregister); |
| 35 | initView(); | 46 | initView(); |
| 36 | initData(); | 47 | initData(); |
| 37 | setLister(); | 48 | setLister(); |
| 38 | } | 49 | } |
| 39 | 50 | ||
| 40 | private void initView() { | 51 | private void initView() { |
| 41 | viewPager = (ViewPager) findViewById(R.id.viewpager_login); | 52 | viewPager = (ViewPager) findViewById(R.id.viewpager_login); |
| 42 | tableLayout = (SlidingTabLayout) findViewById(R.id.TabLayout_id); | 53 | tableLayout = (SlidingTabLayout) findViewById(R.id.TabLayout_id); |
| 43 | } | 54 | } |
| 44 | 55 | ||
| 45 | private void initData() { | 56 | private void initData() { |
| 46 | loginlist = new ArrayList<>(); | 57 | loginlist = new ArrayList<>(); |
| 47 | for (int i = 0; i < title.size(); i++) { | 58 | for (int i = 0; i < title.size(); i++) { |
| 48 | if (title.get(i).equals("登录")) { | 59 | if (title.get(i).equals("登录")) { |
| 49 | loginlist.add(LoginFragment.newInstance(i + 1)); | 60 | loginlist.add(LoginFragment.newInstance(i + 1)); |
| 50 | } else { | 61 | } else { |
| 51 | loginlist.add(RegisterFragment.newInstance(i + 1)); | 62 | loginlist.add(RegisterFragment.newInstance(i + 1)); |
| 52 | } | 63 | } |
| 53 | } | 64 | } |
| 54 | 65 | ||
| 55 | 66 | ||
| 56 | //设置Tab上的标题 | 67 | //设置Tab上的标题 |
| 57 | tableLayout.setData(title); | 68 | tableLayout.setData(title); |
| 58 | //设置关联的ViewPager | 69 | //设置关联的ViewPager |
| 59 | tableLayout.setViewPager(viewPager, 0); | 70 | tableLayout.setViewPager(viewPager, 0); |
| 60 | logindapter = new LoginAndRegisterAdapter(loginlist, getSupportFragmentManager()); | 71 | logindapter = new LoginAndRegisterAdapter(loginlist, getSupportFragmentManager()); |
| 61 | //给ViewPager设置适配器 | 72 | //给ViewPager设置适配器 |
| 62 | viewPager.setAdapter(logindapter); | 73 | viewPager.setAdapter(logindapter); |
| 63 | //设置滑动时数据不丢失 | 74 | //设置滑动时数据不丢失 |
| 64 | viewPager.setOffscreenPageLimit(1); | 75 | viewPager.setOffscreenPageLimit(1); |
| 65 | //将TabLayout和ViewPager关联起来。 | 76 | //将TabLayout和ViewPager关联起来。 |
| 66 | } | 77 | } |
| 67 | 78 | ||
| 68 | private void setLister() { | 79 | private void setLister() { |
| 69 | } | 80 | } |
| 70 | 81 | ||
| 71 | 82 | ||
| 72 | } | 83 | } |
| 73 | 84 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.content.pm.PackageManager; | 5 | import android.content.pm.PackageManager; |
| 6 | import android.net.Uri; | 6 | import android.net.Uri; |
| 7 | import android.os.Build; | 7 | import android.os.Build; |
| 8 | import android.os.Bundle; | 8 | import android.os.Bundle; |
| 9 | import android.os.Handler; | 9 | import android.os.Handler; |
| 10 | import android.os.Message; | 10 | import android.os.Message; |
| 11 | import android.provider.MediaStore; | 11 | import android.provider.MediaStore; |
| 12 | import android.support.annotation.NonNull; | 12 | import android.support.annotation.NonNull; |
| 13 | import android.support.v4.content.FileProvider; | 13 | import android.support.v4.content.FileProvider; |
| 14 | import android.support.v7.app.AppCompatActivity; | 14 | import android.support.v7.app.AppCompatActivity; |
| 15 | import android.support.v7.widget.LinearLayoutManager; | ||
| 16 | import android.support.v7.widget.RecyclerView; | ||
| 15 | import android.view.View; | 17 | import android.view.View; |
| 16 | import android.widget.ImageView; | 18 | import android.widget.ImageView; |
| 17 | import android.widget.LinearLayout; | 19 | import android.widget.LinearLayout; |
| 18 | import android.widget.TextView; | 20 | import android.widget.TextView; |
| 19 | import android.widget.Toast; | 21 | import android.widget.Toast; |
| 20 | 22 | ||
| 21 | import com.facebook.drawee.backends.pipeline.Fresco; | 23 | import com.facebook.drawee.backends.pipeline.Fresco; |
| 22 | import com.facebook.drawee.generic.GenericDraweeHierarchy; | 24 | import com.facebook.drawee.generic.GenericDraweeHierarchy; |
| 23 | import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder; | 25 | import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder; |
| 24 | import com.facebook.drawee.generic.RoundingParams; | 26 | import com.facebook.drawee.generic.RoundingParams; |
| 25 | import com.facebook.drawee.interfaces.DraweeController; | 27 | import com.facebook.drawee.interfaces.DraweeController; |
| 26 | import com.facebook.drawee.view.SimpleDraweeView; | 28 | import com.facebook.drawee.view.SimpleDraweeView; |
| 27 | import com.hjx.personalcenter.R; | 29 | import com.hjx.personalcenter.R; |
| 30 | import com.hjx.personalcenter.adapter.RecyclerViewAdapter; | ||
| 28 | import com.hjx.personalcenter.customdialog.HeadDialog; | 31 | import com.hjx.personalcenter.customdialog.HeadDialog; |
| 29 | import com.hjx.personalcenter.db.SaveParam; | 32 | import com.hjx.personalcenter.db.SaveParam; |
| 30 | import com.hjx.personalcenter.http.HttpCode; | 33 | import com.hjx.personalcenter.http.HttpCode; |
| 31 | import com.hjx.personalcenter.http.HttpManager; | 34 | import com.hjx.personalcenter.http.HttpManager; |
| 32 | import com.hjx.personalcenter.interfaces.DialogCallBack; | 35 | import com.hjx.personalcenter.interfaces.DialogCallBack; |
| 33 | import com.hjx.personalcenter.model.PesonalInfo; | 36 | import com.hjx.personalcenter.model.PesonalInfo; |
| 34 | import com.hjx.personalcenter.model.SignInfo; | 37 | import com.hjx.personalcenter.model.SignInfo; |
| 35 | import com.hjx.personalcenter.util.AlertUtils; | 38 | import com.hjx.personalcenter.util.AlertUtils; |
| 36 | import com.hjx.personalcenter.util.CropUtils; | 39 | import com.hjx.personalcenter.util.CropUtils; |
| 37 | import com.hjx.personalcenter.util.DialogPermission; | 40 | import com.hjx.personalcenter.util.DialogPermission; |
| 38 | import com.hjx.personalcenter.util.FileUtil; | 41 | import com.hjx.personalcenter.util.FileUtil; |
| 39 | import com.hjx.personalcenter.util.PermissionUtil; | 42 | import com.hjx.personalcenter.util.PermissionUtil; |
| 40 | import com.hjx.personalcenter.util.SharedPreferenceMark; | 43 | import com.hjx.personalcenter.util.SharedPreferenceMark; |
| 41 | import com.mylhyl.circledialog.CircleDialog; | 44 | import com.mylhyl.circledialog.CircleDialog; |
| 42 | import com.mylhyl.circledialog.callback.ConfigInput; | 45 | import com.mylhyl.circledialog.callback.ConfigInput; |
| 43 | import com.mylhyl.circledialog.params.InputParams; | 46 | import com.mylhyl.circledialog.params.InputParams; |
| 44 | import com.mylhyl.circledialog.view.listener.OnInputClickListener; | 47 | import com.mylhyl.circledialog.view.listener.OnInputClickListener; |
| 45 | import com.zaaach.toprightmenu.MenuItem; | 48 | import com.zaaach.toprightmenu.MenuItem; |
| 46 | import com.zaaach.toprightmenu.TopRightMenu; | 49 | import com.zaaach.toprightmenu.TopRightMenu; |
| 47 | 50 | ||
| 48 | import java.io.File; | 51 | import java.io.File; |
| 49 | import java.util.ArrayList; | 52 | import java.util.ArrayList; |
| 50 | import java.util.List; | 53 | import java.util.List; |
| 51 | 54 | ||
| 52 | public class MainActivity extends AppCompatActivity implements View.OnClickListener, DialogCallBack.CallBackView { | 55 | public class MainActivity extends AppCompatActivity implements View.OnClickListener, DialogCallBack.CallBackView { |
| 53 | private ImageView iv_imformatioan, iv_look_card, iv_setting, iv_sign, iv_sex; | 56 | private ImageView iv_imformatioan, iv_look_card, iv_setting, iv_sign, iv_sex; |
| 54 | private TextView tv_edit_presoninfo, tv_sign, | 57 | private TextView tv_edit_presoninfo, tv_sign, |
| 55 | tv_username, tv_username1, tv_mygad, tv_sex, tv_useinfo_adress, tv_useinfo_birthday, | 58 | tv_username, tv_username1, tv_mygad, tv_sex, tv_useinfo_adress, tv_useinfo_birthday, |
| 56 | tv_useinfo_qq, tv_useinfo_school, tv_useinfo_gender; | 59 | tv_useinfo_qq, tv_useinfo_school, tv_useinfo_gender; |
| 57 | private LinearLayout linel_mycuoti, linel_mynote, linel_mycollege, linel_myclass; | 60 | private LinearLayout linel_mycuoti, linel_mynote, linel_mycollege, linel_myclass; |
| 58 | private TopRightMenu mTopRightMenu; | 61 | private TopRightMenu mTopRightMenu; |
| 62 | //水平滑动 | ||
| 63 | private RecyclerView mRecyclerView; | ||
| 64 | private RecyclerViewAdapter RecyclerViewadapter; | ||
| 59 | private boolean showIcon = true; | 65 | private boolean showIcon = true; |
| 60 | private boolean dimBg = true; | 66 | private boolean dimBg = true; |
| 61 | private boolean needAnim = true; | 67 | private boolean needAnim = true; |
| 62 | private static final int REQUEST_CODE_TAKE_PHOTO = 1; | 68 | private static final int REQUEST_CODE_TAKE_PHOTO = 1; |
| 63 | private static final int REQUEST_CODE_ALBUM = 2; | 69 | private static final int REQUEST_CODE_ALBUM = 2; |
| 64 | private static final int REQUEST_CODE_CROUP_PHOTO = 3; | 70 | private static final int REQUEST_CODE_CROUP_PHOTO = 3; |
| 65 | SimpleDraweeView mSimpleDraweeView; | 71 | SimpleDraweeView mSimpleDraweeView; |
| 66 | private File file; | 72 | private File file; |
| 67 | private Uri uri; | 73 | private Uri uri; |
| 68 | Handler handler = new Handler(){ | 74 | Handler handler = new Handler(){ |
| 69 | @Override | 75 | @Override |
| 70 | public void handleMessage(Message msg) { | 76 | public void handleMessage(Message msg) { |
| 71 | super.handleMessage(msg); | 77 | super.handleMessage(msg); |
| 72 | switch (msg.what){ | 78 | switch (msg.what){ |
| 73 | case HttpCode.GETINFO: | 79 | case HttpCode.GETINFO: |
| 74 | PesonalInfo.DataBean cardinfoBean =(PesonalInfo.DataBean)msg.obj; | 80 | PesonalInfo.DataBean cardinfoBean =(PesonalInfo.DataBean)msg.obj; |
| 75 | tv_username.setText(cardinfoBean.getNickName()); | 81 | tv_username.setText(cardinfoBean.getNickName()); |
| 76 | tv_username1.setText(cardinfoBean.getNickName()); | 82 | tv_username1.setText(cardinfoBean.getNickName()); |
| 77 | tv_useinfo_adress.setText(cardinfoBean.getRegion().getRegionName()); | 83 | tv_useinfo_adress.setText(cardinfoBean.getRegion().getRegionName()); |
| 78 | tv_useinfo_birthday.setText(cardinfoBean.getBirthday()); | 84 | tv_useinfo_birthday.setText(cardinfoBean.getBirthday()); |
| 79 | tv_useinfo_qq.setText(cardinfoBean.getQq()); | 85 | tv_useinfo_qq.setText(cardinfoBean.getQq()); |
| 80 | tv_useinfo_school.setText(cardinfoBean.getSchool().getSchoolName()); | 86 | tv_useinfo_school.setText(cardinfoBean.getSchool().getSchoolName()); |
| 81 | tv_useinfo_gender.setText(cardinfoBean.getGrade().getGradeName()); | 87 | tv_useinfo_gender.setText(cardinfoBean.getGrade().getGradeName()); |
| 82 | String sex = cardinfoBean.getGender(); | 88 | String sex = cardinfoBean.getGender(); |
| 83 | if ("0".equals(sex)){ | 89 | if ("0".equals(sex)){ |
| 84 | tv_sex.setText("男"); | 90 | tv_sex.setText("男"); |
| 85 | iv_sex.setImageResource(R.mipmap.men); | 91 | iv_sex.setImageResource(R.mipmap.men); |
| 86 | }else { | 92 | }else { |
| 87 | tv_sex.setText("女"); | 93 | tv_sex.setText("女"); |
| 88 | iv_sex.setImageResource(R.mipmap.women); | 94 | iv_sex.setImageResource(R.mipmap.women); |
| 89 | } | 95 | } |
| 90 | break; | 96 | break; |
| 91 | case HttpCode.SIGN: | 97 | case HttpCode.SIGN: |
| 92 | SignInfo.DataBean dataBean = (SignInfo.DataBean)msg.obj; | 98 | SignInfo.DataBean dataBean = (SignInfo.DataBean)msg.obj; |
| 93 | tv_sign.setText(dataBean.getSignature()); | 99 | if (dataBean.getSignature()==null){ |
| 100 | tv_sign.setText("你还未设置个性签名"); | ||
| 101 | }else { | ||
| 102 | tv_sign.setText(dataBean.getSignature()); | ||
| 103 | } | ||
| 104 | |||
| 94 | break; | 105 | break; |
| 95 | } | 106 | } |
| 96 | } | 107 | } |
| 97 | }; | 108 | }; |
| 98 | 109 | ||
| 99 | @Override | 110 | @Override |
| 100 | protected void onCreate(Bundle savedInstanceState) { | 111 | protected void onCreate(Bundle savedInstanceState) { |
| 101 | super.onCreate(savedInstanceState); | 112 | super.onCreate(savedInstanceState); |
| 102 | Fresco.initialize(this); | 113 | Fresco.initialize(this); |
| 103 | setContentView(R.layout.activity_main); | 114 | setContentView(R.layout.activity_main); |
| 104 | initView(); | 115 | initView(); |
| 105 | initData(); | 116 | initData(); |
| 106 | initLister(); | 117 | initLister(); |
| 107 | } | 118 | } |
| 108 | 119 | ||
| 109 | private void initView() { | 120 | private void initView() { |
| 110 | iv_imformatioan = (ImageView) findViewById(R.id.iv_imformatioan); | 121 | iv_imformatioan = (ImageView) findViewById(R.id.iv_imformatioan); |
| 111 | iv_look_card = (ImageView) findViewById(R.id.iv_look_card); | 122 | iv_look_card = (ImageView) findViewById(R.id.iv_look_card); |
| 112 | tv_edit_presoninfo = (TextView) findViewById(R.id.tv_edit_presoninfo); | 123 | tv_edit_presoninfo = (TextView) findViewById(R.id.tv_edit_presoninfo); |
| 113 | iv_setting = (ImageView) findViewById(R.id.iv_setting); | 124 | iv_setting = (ImageView) findViewById(R.id.iv_setting); |
| 114 | iv_sign = (ImageView) findViewById(R.id.iv_sign); | 125 | iv_sign = (ImageView) findViewById(R.id.iv_sign); |
| 115 | tv_sign = (TextView) findViewById(R.id.tv_sign); | 126 | tv_sign = (TextView) findViewById(R.id.tv_sign); |
| 116 | //头像 | 127 | //头像 |
| 117 | mSimpleDraweeView = (SimpleDraweeView) findViewById(R.id.iv_head); | 128 | mSimpleDraweeView = (SimpleDraweeView) findViewById(R.id.iv_head); |
| 118 | //初始化个人信息 | 129 | //初始化个人信息 |
| 119 | iv_sex = (ImageView) findViewById(R.id.iv_sex); | 130 | iv_sex = (ImageView) findViewById(R.id.iv_sex); |
| 120 | tv_username = (TextView) findViewById(R.id.tv_username); | 131 | tv_username = (TextView) findViewById(R.id.tv_username); |
| 121 | tv_username1 = (TextView) findViewById(R.id.tv_username1); | 132 | tv_username1 = (TextView) findViewById(R.id.tv_username1); |
| 122 | tv_mygad = (TextView) findViewById(R.id.tv_mygad); | 133 | tv_mygad = (TextView) findViewById(R.id.tv_mygad); |
| 123 | tv_sex = (TextView) findViewById(R.id.tv_sex); | 134 | tv_sex = (TextView) findViewById(R.id.tv_sex); |
| 124 | tv_useinfo_adress = (TextView) findViewById(R.id.tv_useinfo_adress); | 135 | tv_useinfo_adress = (TextView) findViewById(R.id.tv_useinfo_adress); |
| 125 | tv_useinfo_birthday = (TextView) findViewById(R.id.tv_useinfo_birthday); | 136 | tv_useinfo_birthday = (TextView) findViewById(R.id.tv_useinfo_birthday); |
| 126 | tv_useinfo_qq = (TextView) findViewById(R.id.tv_useinfo_qq); | 137 | tv_useinfo_qq = (TextView) findViewById(R.id.tv_useinfo_qq); |
| 127 | tv_useinfo_school = (TextView) findViewById(R.id.tv_useinfo_school); | 138 | tv_useinfo_school = (TextView) findViewById(R.id.tv_useinfo_school); |
| 128 | tv_useinfo_gender = (TextView) findViewById(R.id.tv_useinfo_gender); | 139 | tv_useinfo_gender = (TextView) findViewById(R.id.tv_useinfo_gender); |
| 129 | //跳转其他应用 | 140 | //跳转其他应用 |
| 130 | linel_mycuoti = (LinearLayout) findViewById(R.id.linel_mycuoti); | 141 | linel_mycuoti = (LinearLayout) findViewById(R.id.linel_mycuoti); |
| 131 | linel_mynote = (LinearLayout) findViewById(R.id.linel_mynote); | 142 | linel_mynote = (LinearLayout) findViewById(R.id.linel_mynote); |
| 132 | linel_mycollege = (LinearLayout) findViewById(R.id.linel_mycollege); | 143 | linel_mycollege = (LinearLayout) findViewById(R.id.linel_mycollege); |
| 133 | linel_myclass = (LinearLayout) findViewById(R.id.linel_myclass); | 144 | linel_myclass = (LinearLayout) findViewById(R.id.linel_myclass); |
| 145 | // | ||
| 146 | mRecyclerView = (RecyclerView) findViewById(R.id.id_recyclerview_horizontal); | ||
| 134 | 147 | ||
| 135 | } | 148 | } |
| 136 | 149 | ||
| 137 | @Override | ||
| 138 | protected void onResume() { | ||
| 139 | super.onResume(); | ||
| 140 | //获取个人信息 | ||
| 141 | HttpManager.getInstance().getpresonalinfo(MainActivity.this,688,handler); | ||
| 142 | //获取个性签名 | ||
| 143 | HttpManager.getInstance().getsignatures(MainActivity.this,688,handler); | ||
| 144 | } | ||
| 145 | |||
| 146 | private void initData() { | 150 | private void initData() { |
| 151 | //加载最近学习视频 | ||
| 152 | List<String> datas = new ArrayList<>(); | ||
| 153 | datas.add("LiMing"); | ||
| 154 | datas.add("XiaoMing"); | ||
| 155 | datas.add("HanMeiMei"); | ||
| 156 | LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); | ||
| 157 | linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); | ||
| 158 | mRecyclerView.setLayoutManager(linearLayoutManager); | ||
| 159 | RecyclerViewadapter = new RecyclerViewAdapter(this, datas); | ||
| 160 | mRecyclerView.setAdapter(RecyclerViewadapter); | ||
| 147 | //加载个人信息 | 161 | //加载个人信息 |
| 148 | String xiongzuo = SaveParam.getInstance().getLoginParam(this,SaveParam.CONSTELLATION); | 162 | String xiongzuo = SaveParam.getInstance().getLoginParam(this,SaveParam.CONSTELLATION); |
| 149 | if (xiongzuo==null){ | 163 | if (xiongzuo==null){ |
| 150 | tv_mygad.setText(""); | 164 | tv_mygad.setText(""); |
| 151 | }else { | 165 | }else { |
| 152 | tv_mygad.setText(xiongzuo); | 166 | tv_mygad.setText(xiongzuo); |
| 153 | } | 167 | } |
| 154 | //HttpManager.getInstance().getpresonalinfo(MainActivity.this,688,handler); | 168 | //加载版本信息 |
| 169 | |||
| 170 | |||
| 171 | //获取个性签名 | ||
| 172 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | ||
| 173 | try { | ||
| 174 | long auserID = Long.parseLong(userID); | ||
| 175 | HttpManager.getInstance().getsignatures(MainActivity.this,auserID,handler); | ||
| 176 | |||
| 177 | } catch (NumberFormatException e) { | ||
| 178 | e.printStackTrace(); | ||
| 179 | } | ||
| 180 | |||
| 155 | 181 | ||
| 156 | 182 | ||
| 157 | //初始化图片 | 183 | //初始化图片 |
| 158 | file = new File(FileUtil.getCachePath(this), "user-avatar.jpg"); | 184 | file = new File(FileUtil.getCachePath(this), "user-avatar.jpg"); |
| 159 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { | 185 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { |
| 160 | uri = Uri.fromFile(file); | 186 | uri = Uri.fromFile(file); |
| 161 | } else { | 187 | } else { |
| 162 | //通过FileProvider创建一个content类型的Uri(android 7.0需要这样的方法跨应用访问) | 188 | //通过FileProvider创建一个content类型的Uri(android 7.0需要这样的方法跨应用访问) |
| 163 | uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter", file); | 189 | uri = FileProvider.getUriForFile(MyApplication.getContext(), "com.hjx.personalcenter", file); |
| 164 | } | 190 | } |
| 165 | 191 | ||
| 166 | } | 192 | } |
| 167 | 193 | ||
| 168 | private void initLister() { | 194 | private void initLister() { |
| 169 | iv_imformatioan.setOnClickListener(this); | 195 | iv_imformatioan.setOnClickListener(this); |
| 170 | iv_look_card.setOnClickListener(this); | 196 | iv_look_card.setOnClickListener(this); |
| 171 | tv_edit_presoninfo.setOnClickListener(this); | 197 | tv_edit_presoninfo.setOnClickListener(this); |
| 172 | iv_setting.setOnClickListener(this); | 198 | iv_setting.setOnClickListener(this); |
| 173 | iv_sign.setOnClickListener(this); | 199 | iv_sign.setOnClickListener(this); |
| 174 | mSimpleDraweeView.setOnClickListener(this); | 200 | mSimpleDraweeView.setOnClickListener(this); |
| 175 | linel_mycuoti.setOnClickListener(this); | 201 | linel_mycuoti.setOnClickListener(this); |
| 176 | linel_mynote.setOnClickListener(this); | 202 | linel_mynote.setOnClickListener(this); |
| 177 | linel_mycollege.setOnClickListener(this); | 203 | linel_mycollege.setOnClickListener(this); |
| 178 | linel_myclass.setOnClickListener(this); | 204 | linel_myclass.setOnClickListener(this); |
| 179 | 205 | ||
| 180 | } | 206 | } |
| 181 | 207 | ||
| 182 | @Override | 208 | @Override |
| 183 | public void onClick(View v) { | 209 | public void onClick(View v) { |
| 184 | switch (v.getId()) { | 210 | switch (v.getId()) { |
| 185 | case R.id.iv_imformatioan: | 211 | case R.id.iv_imformatioan: |
| 186 | Intent intent = new Intent(); | 212 | Intent intent = new Intent(); |
| 187 | intent.setClass(MainActivity.this, FeedBackActivity.class); | 213 | intent.setClass(MainActivity.this, FeedBackActivity.class); |
| 188 | startActivity(intent); | 214 | startActivity(intent); |
| 189 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 215 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 190 | break; | 216 | break; |
| 191 | case R.id.iv_look_card: | 217 | case R.id.iv_look_card: |
| 192 | Intent lookintent = new Intent(); | 218 | Intent lookintent = new Intent(); |
| 193 | lookintent.setClass(MainActivity.this, ElectronicCardLookInfoActivity.class); | 219 | lookintent.setClass(MainActivity.this, ElectronicCardLookInfoActivity.class); |
| 194 | startActivity(lookintent); | 220 | startActivity(lookintent); |
| 195 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 221 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 196 | break; | 222 | break; |
| 197 | case R.id.tv_edit_presoninfo: | 223 | case R.id.tv_edit_presoninfo: |
| 198 | Intent editintent = new Intent(); | 224 | Intent editintent = new Intent(); |
| 199 | editintent.setClass(MainActivity.this, ChangePresonalInfoActivity.class); | 225 | editintent.setClass(MainActivity.this, ChangePresonalInfoActivity.class); |
| 200 | startActivity(editintent); | 226 | startActivity(editintent); |
| 201 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 227 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 202 | break; | 228 | break; |
| 203 | case R.id.iv_head: | 229 | case R.id.iv_head: |
| 204 | HeadDialog.getInstance(this).show(getSupportFragmentManager(), "HeadDialog"); | 230 | HeadDialog.getInstance(this).show(getSupportFragmentManager(), "HeadDialog"); |
| 205 | break; | 231 | break; |
| 206 | case R.id.iv_setting: | 232 | case R.id.iv_setting: |
| 207 | mTopRightMenu = new TopRightMenu(MainActivity.this); | 233 | mTopRightMenu = new TopRightMenu(MainActivity.this); |
| 208 | List<MenuItem> menuItems = new ArrayList<>(); | 234 | List<MenuItem> menuItems = new ArrayList<>(); |
| 209 | menuItems.add(new MenuItem(R.mipmap.blank, "切换账户")); | 235 | menuItems.add(new MenuItem(R.mipmap.blank, "切换账户")); |
| 210 | menuItems.add(new MenuItem(R.mipmap.blank, "账户管理")); | 236 | menuItems.add(new MenuItem(R.mipmap.blank, "账户管理")); |
| 211 | mTopRightMenu | 237 | mTopRightMenu |
| 212 | .setHeight(150) //默认高度480 | 238 | .setHeight(150) //默认高度480 |
| 213 | .setWidth(320) //默认宽度wrap_content | 239 | .setWidth(320) //默认宽度wrap_content |
| 214 | .showIcon(showIcon) //显示菜单图标,默认为true | 240 | .showIcon(showIcon) //显示菜单图标,默认为true |
| 215 | .dimBackground(dimBg) //背景变暗,默认为true | 241 | .dimBackground(dimBg) //背景变暗,默认为true |
| 216 | .needAnimationStyle(needAnim) //显示动画,默认为true | 242 | .needAnimationStyle(needAnim) //显示动画,默认为true |
| 217 | .setAnimationStyle(R.style.TRM_ANIM_STYLE) //默认为R.style.TRM_ANIM_STYLE | 243 | .setAnimationStyle(R.style.TRM_ANIM_STYLE) //默认为R.style.TRM_ANIM_STYLE |
| 218 | .setOnMenuItemClickListener(new TopRightMenu.OnMenuItemClickListener() { | 244 | .setOnMenuItemClickListener(new TopRightMenu.OnMenuItemClickListener() { |
| 219 | @Override | 245 | @Override |
| 220 | public void onMenuItemClick(int position) { | 246 | public void onMenuItemClick(int position) { |
| 221 | switch (position) { | 247 | switch (position) { |
| 222 | case 0: | 248 | case 0: |
| 223 | //清除数据 | 249 | //清除数据 |
| 250 | SaveParam.getInstance().clearData(MainActivity.this); | ||
| 224 | Intent settingintent = new Intent(); | 251 | Intent settingintent = new Intent(); |
| 225 | settingintent.setClass(MainActivity.this, LoginAndRegisterActivity.class); | 252 | settingintent.setClass(MainActivity.this, LoginAndRegisterActivity.class); |
| 226 | startActivity(settingintent); | 253 | startActivity(settingintent); |
| 227 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 254 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 228 | break; | 255 | break; |
| 229 | case 1: | 256 | case 1: |
| 230 | Intent accontMintent = new Intent(); | 257 | Intent accontMintent = new Intent(); |
| 231 | accontMintent.setClass(MainActivity.this, AccountManagementActivity.class); | 258 | accontMintent.setClass(MainActivity.this, AccountManagementActivity.class); |
| 232 | startActivity(accontMintent); | 259 | startActivity(accontMintent); |
| 233 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 260 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 234 | break; | 261 | break; |
| 235 | } | 262 | } |
| 236 | } | 263 | } |
| 237 | }) | 264 | }) |
| 238 | .addMenuList(menuItems) | 265 | .addMenuList(menuItems) |
| 239 | .showAsDropDown(iv_setting, -250, 0); | 266 | .showAsDropDown(iv_setting, -250, 0); |
| 240 | break; | 267 | break; |
| 241 | case R.id.iv_sign: | 268 | case R.id.iv_sign: |
| 242 | new CircleDialog.Builder(this) | 269 | new CircleDialog.Builder(this) |
| 243 | .setCanceledOnTouchOutside(false) | 270 | .setCanceledOnTouchOutside(false) |
| 244 | .setCancelable(true) | 271 | .setCancelable(true) |
| 245 | .setTitle("个性签名") | 272 | .setTitle("个性签名") |
| 246 | .setInputHint("请输入个性签名") | 273 | .setInputHint("请输入个性签名") |
| 247 | .setWidth(0.5f) | 274 | .setWidth(0.5f) |
| 248 | .configInput(new ConfigInput() { | 275 | .configInput(new ConfigInput() { |
| 249 | @Override | 276 | @Override |
| 250 | public void onConfig(InputParams params) { | 277 | public void onConfig(InputParams params) { |
| 251 | // params.inputBackgroundResourceId = R.drawable.bg_input; | 278 | // params.inputBackgroundResourceId = R.drawable.bg_input; |
| 252 | } | 279 | } |
| 253 | }) | 280 | }) |
| 254 | .setNegative("取消", null) | 281 | .setNegative("取消", null) |
| 255 | .setPositiveInput("确定", new OnInputClickListener() { | 282 | .setPositiveInput("确定", new OnInputClickListener() { |
| 256 | @Override | 283 | @Override |
| 257 | public void onClick(String text, View v) { | 284 | public void onClick(String text, View v) { |
| 258 | if (text.equals("")) { | 285 | if (text.equals("")) { |
| 259 | AlertUtils.showToast(MainActivity.this, "请输入个性签名"); | 286 | AlertUtils.showToast(MainActivity.this, "请输入个性签名"); |
| 260 | } else { | 287 | } else { |
| 261 | HttpManager.getInstance().changsignature(MainActivity.this,688,text); | 288 | try { |
| 289 | String userID = SaveParam.getInstance().getLoginParam(MainActivity.this,"userId"); | ||
| 290 | long auserID = Long.parseLong(userID); | ||
| 291 | HttpManager.getInstance().changsignature(MainActivity.this,auserID,text); | ||
| 292 | } catch (NumberFormatException e) { | ||
| 293 | e.printStackTrace(); | ||
| 294 | } | ||
| 295 | |||
| 262 | tv_sign.setText(text); | 296 | tv_sign.setText(text); |
| 263 | } | 297 | } |
| 264 | 298 | ||
| 265 | } | 299 | } |
| 266 | }) | 300 | }) |
| 267 | .show(); | 301 | .show(); |
| 268 | break; | 302 | break; |
| 269 | case R.id.linel_mycuoti: | 303 | case R.id.linel_mycuoti: |
| 270 | AlertUtils.showToast(this, "hhahahah "); | 304 | AlertUtils.showToast(this, "hhahahah "); |
| 271 | break; | 305 | break; |
| 272 | case R.id.linel_mynote: | 306 | case R.id.linel_mynote: |
| 273 | AlertUtils.showToast(this, "hhahahah "); | 307 | AlertUtils.showToast(this, "hhahahah "); |
| 274 | break; | 308 | break; |
| 275 | case R.id.linel_mycollege: | 309 | case R.id.linel_mycollege: |
| 276 | AlertUtils.showToast(this, "hhahahah "); | 310 | AlertUtils.showToast(this, "hhahahah "); |
| 277 | break; | 311 | break; |
| 278 | case R.id.linel_myclass: | 312 | case R.id.linel_myclass: |
| 279 | AlertUtils.showToast(this, "hhahahah "); | 313 | AlertUtils.showToast(this, "hhahahah "); |
| 280 | break; | 314 | break; |
| 281 | } | 315 | } |
| 282 | 316 | ||
| 283 | } | 317 | } |
| 318 | |||
| 319 | @Override | ||
| 320 | protected void onResume() { | ||
| 321 | super.onResume(); | ||
| 322 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | ||
| 323 | try { | ||
| 324 | long auserID = Long.parseLong(userID); | ||
| 325 | //获取个人信息 | ||
| 326 | HttpManager.getInstance().getpresonalinfo(MainActivity.this,auserID,handler); | ||
| 327 | |||
| 328 | } catch (NumberFormatException e) { | ||
| 329 | e.printStackTrace(); | ||
| 330 | } | ||
| 331 | |||
| 332 | } | ||
| 333 | |||
| 284 | //回调头像监听 | 334 | //回调头像监听 |
| 285 | @Override | 335 | @Override |
| 286 | public void heard(Context context, View v) { | 336 | public void heard(Context context, View v) { |
| 287 | switch (v.getId()){ | 337 | switch (v.getId()){ |
| 288 | //选择默认图片 | 338 | //选择默认图片 |
| 289 | case R.id.oktakephone: | 339 | case R.id.oktakephone: |
| 290 | AlertUtils.showToast(this, "您选择了默认图片 "); | 340 | AlertUtils.showToast(this, "您选择了默认图片 "); |
| 291 | break; | 341 | break; |
| 292 | case R.id.canceltakephone: | 342 | case R.id.canceltakephone: |
| 293 | 343 | ||
| 294 | break; | 344 | break; |
| 295 | //拍摄和相册 | 345 | //拍摄和相册 |
| 296 | case R.id.take_pic: | 346 | case R.id.take_pic: |
| 297 | if (PermissionUtil.hasCameraPermission(MainActivity.this)) { | 347 | if (PermissionUtil.hasCameraPermission(MainActivity.this)) { |
| 298 | uploadAvatarFromPhotoRequest(); | 348 | uploadAvatarFromPhotoRequest(); |
| 299 | } | 349 | } |
| 300 | 350 | ||
| 301 | break; | 351 | break; |
| 302 | case R.id.xiangce: | 352 | case R.id.xiangce: |
| 303 | uploadAvatarFromAlbumRequest(); | 353 | uploadAvatarFromAlbumRequest(); |
| 304 | break; | 354 | break; |
| 305 | 355 | ||
| 306 | } | 356 | } |
| 307 | 357 | ||
| 308 | } | 358 | } |
| 309 | 359 | ||
| 310 | //照相 | 360 | //照相 |
| 311 | private void uploadAvatarFromPhotoRequest() { | 361 | private void uploadAvatarFromPhotoRequest() { |
| 312 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | 362 | Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
| 313 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | 363 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| 314 | intent.putExtra(MediaStore.Images.Media.ORIENTATION, 0); | 364 | intent.putExtra(MediaStore.Images.Media.ORIENTATION, 0); |
| 315 | intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); | 365 | intent.putExtra(MediaStore.EXTRA_OUTPUT, uri); |
| 316 | startActivityForResult(intent, REQUEST_CODE_TAKE_PHOTO); | 366 | startActivityForResult(intent, REQUEST_CODE_TAKE_PHOTO); |
| 317 | } | 367 | } |
| 318 | 368 | ||
| 319 | //选择图库 | 369 | //选择图库 |
| 320 | private void uploadAvatarFromAlbumRequest() { | 370 | private void uploadAvatarFromAlbumRequest() { |
| 321 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | 371 | Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); |
| 322 | photoPickerIntent.setType("image/*"); | 372 | photoPickerIntent.setType("image/*"); |
| 323 | startActivityForResult(photoPickerIntent, REQUEST_CODE_ALBUM); | 373 | startActivityForResult(photoPickerIntent, REQUEST_CODE_ALBUM); |
| 324 | } | 374 | } |
| 325 | //回掉 | 375 | //回掉 |
| 326 | @Override | 376 | @Override |
| 327 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { | 377 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 328 | super.onActivityResult(requestCode, resultCode, data); | 378 | super.onActivityResult(requestCode, resultCode, data); |
| 329 | if (resultCode != -1) { | 379 | if (resultCode != -1) { |
| 330 | return; | 380 | return; |
| 331 | } | 381 | } |
| 332 | if (requestCode == REQUEST_CODE_ALBUM && data != null) { | 382 | if (requestCode == REQUEST_CODE_ALBUM && data != null) { |
| 333 | Uri newUri; | 383 | Uri newUri; |
| 334 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { | 384 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { |
| 335 | newUri = Uri.parse("file:///" + CropUtils.getPath(this, data.getData())); | 385 | newUri = Uri.parse("file:///" + CropUtils.getPath(this, data.getData())); |
| 336 | } else { | 386 | } else { |
| 337 | newUri = data.getData(); | 387 | newUri = data.getData(); |
| 338 | } | 388 | } |
| 339 | if (newUri != null) { | 389 | if (newUri != null) { |
| 340 | startPhotoZoom(newUri); | 390 | startPhotoZoom(newUri); |
| 341 | } else { | 391 | } else { |
| 342 | Toast.makeText(this, "没有得到相册图片", Toast.LENGTH_LONG).show(); | 392 | Toast.makeText(this, "没有得到相册图片", Toast.LENGTH_LONG).show(); |
| 343 | } | 393 | } |
| 344 | } else if (requestCode == REQUEST_CODE_TAKE_PHOTO) { | 394 | } else if (requestCode == REQUEST_CODE_TAKE_PHOTO) { |
| 345 | startPhotoZoom(uri); | 395 | startPhotoZoom(uri); |
| 346 | } else if (requestCode == REQUEST_CODE_CROUP_PHOTO) { | 396 | } else if (requestCode == REQUEST_CODE_CROUP_PHOTO) { |
| 347 | uploadAvatarFromPhoto(); | 397 | uploadAvatarFromPhoto(); |
| 348 | } | 398 | } |
| 349 | } | 399 | } |
| 350 | 400 | ||
| 351 | private void uploadAvatarFromPhoto() { | 401 | private void uploadAvatarFromPhoto() { |
| 352 | compressAndUploadAvatar(file.getPath()); | 402 | compressAndUploadAvatar(file.getPath()); |
| 353 | 403 | ||
| 354 | } | 404 | } |
| 355 | private void compressAndUploadAvatar(String fileSrc) { | 405 | private void compressAndUploadAvatar(String fileSrc) { |
| 356 | 406 | ||
| 357 | 407 | ||
| 358 | //上传到服务器 | 408 | //上传到服务器 |
| 359 | 409 | ||
| 360 | final File cover = FileUtil.getSmallBitmap(this, fileSrc); | 410 | final File cover = FileUtil.getSmallBitmap(this, fileSrc); |
| 361 | String mimeType = "image/*"; | 411 | String mimeType = "image/*"; |
| 362 | //requestBody = RequestBody.create(MediaType.parse(mimeType), file); | 412 | //requestBody = RequestBody.create(MediaType.parse(mimeType), file); |
| 363 | //String fileName = cover.getName(); | 413 | //String fileName = cover.getName(); |
| 364 | //HttpManager.getInstance().header(this, fileSrc); | 414 | //HttpManager.getInstance().header(this, fileSrc); |
| 365 | //photo = MultipartBody.Part.createFormData("portrait", fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length()), requestBody); | 415 | //photo = MultipartBody.Part.createFormData("portrait", fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length()), requestBody); |
| 366 | //Fresco设置圆形头像 | 416 | //Fresco设置圆形头像 |
| 367 | GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources()); | 417 | GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources()); |
| 368 | GenericDraweeHierarchy hierarchy = builder | 418 | GenericDraweeHierarchy hierarchy = builder |
| 369 | .setDesiredAspectRatio(1f) | 419 | .setDesiredAspectRatio(1f) |
| 370 | .setFailureImage(R.mipmap.blank) | 420 | .setFailureImage(R.mipmap.blank) |
| 371 | //圆形头像 | 421 | //圆形头像 |
| 372 | .setRoundingParams(RoundingParams.asCircle()) | 422 | .setRoundingParams(RoundingParams.asCircle()) |
| 373 | .build(); | 423 | .build(); |
| 374 | 424 | ||
| 375 | //加载本地图片 | 425 | //加载本地图片 |
| 376 | Uri uri = Uri.fromFile(cover); | 426 | Uri uri = Uri.fromFile(cover); |
| 377 | DraweeController controller = Fresco.newDraweeControllerBuilder() | 427 | DraweeController controller = Fresco.newDraweeControllerBuilder() |
| 378 | .setOldController(mSimpleDraweeView.getController()) | 428 | .setOldController(mSimpleDraweeView.getController()) |
| 379 | .setUri(uri) | 429 | .setUri(uri) |
| 380 | .build(); | 430 | .build(); |
| 381 | mSimpleDraweeView.setHierarchy(hierarchy); | 431 | mSimpleDraweeView.setHierarchy(hierarchy); |
| 382 | mSimpleDraweeView.setController(controller); | 432 | mSimpleDraweeView.setController(controller); |
| 383 | 433 | ||
| 384 | } | 434 | } |
| 385 | 435 | ||
| 386 | public void startPhotoZoom(Uri uri) { | 436 | public void startPhotoZoom(Uri uri) { |
| 387 | Intent intent = new Intent("com.android.camera.action.CROP"); | 437 | Intent intent = new Intent("com.android.camera.action.CROP"); |
| 388 | intent.setDataAndType(uri, "image/*"); | 438 | intent.setDataAndType(uri, "image/*"); |
| 389 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | 439 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| 390 | intent.putExtra("crop", "true");// crop=true 有这句才能出来最后的裁剪页面. | 440 | intent.putExtra("crop", "true");// crop=true 有这句才能出来最后的裁剪页面. |
| 391 | intent.putExtra("aspectX", 1);// 这两项为裁剪框的比例. | 441 | intent.putExtra("aspectX", 1);// 这两项为裁剪框的比例. |
| 392 | intent.putExtra("aspectY", 1);// x:y=1:1 | 442 | intent.putExtra("aspectY", 1);// x:y=1:1 |
| 393 | // intent.putExtra("outputX", 400);//图片输出大小 | 443 | // intent.putExtra("outputX", 400);//图片输出大小 |
| 394 | // intent.putExtra("outputY", 400); | 444 | // intent.putExtra("outputY", 400); |
| 395 | intent.putExtra("output", Uri.fromFile(file)); | 445 | intent.putExtra("output", Uri.fromFile(file)); |
| 396 | intent.putExtra("outputFormat", "JPEG");// 返回格式 | 446 | intent.putExtra("outputFormat", "JPEG");// 返回格式 |
| 397 | startActivityForResult(intent, REQUEST_CODE_CROUP_PHOTO); | 447 | startActivityForResult(intent, REQUEST_CODE_CROUP_PHOTO); |
| 398 | } | 448 | } |
| 399 | 449 | ||
| 400 | @Override | 450 | @Override |
| 401 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { | 451 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { |
| 402 | switch (requestCode) { | 452 | switch (requestCode) { |
| 403 | 453 | ||
| 404 | case PermissionUtil.REQUEST_SHOWCAMERA: | 454 | case PermissionUtil.REQUEST_SHOWCAMERA: |
| 405 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { | 455 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { |
| 406 | // Permission Granted | 456 | // Permission Granted |
| 407 | uploadAvatarFromPhotoRequest(); | 457 | uploadAvatarFromPhotoRequest(); |
| 408 | 458 | ||
| 409 | } else { | 459 | } else { |
| 410 | if (!SharedPreferenceMark.getHasShowCamera()) { | 460 | if (!SharedPreferenceMark.getHasShowCamera()) { |
| 411 | SharedPreferenceMark.setHasShowCamera(true); | 461 | SharedPreferenceMark.setHasShowCamera(true); |
| 412 | new DialogPermission(this, "关闭摄像头权限影响扫描功能"); | 462 | new DialogPermission(this, "关闭摄像头权限影响扫描功能"); |
| 413 | 463 | ||
| 414 | } else { | 464 | } else { |
| 415 | Toast.makeText(this, "未获取摄像头权限", Toast.LENGTH_SHORT) | 465 | Toast.makeText(this, "未获取摄像头权限", Toast.LENGTH_SHORT) |
| 416 | .show(); | 466 | .show(); |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/TheStartPageActivity.java
| 1 | package com.hjx.personalcenter.activity; | 1 | package com.hjx.personalcenter.activity; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.view.View; | 6 | import android.view.View; |
| 7 | import android.widget.Button; | 7 | import android.widget.Button; |
| 8 | 8 | ||
| 9 | import com.hjx.personalcenter.R; | 9 | import com.hjx.personalcenter.R; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * Created by h on 2017/8/10. | 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 Activity implements View.OnClickListener { |
| 16 | private Button btn_start; | 16 | private Button btn_start; |
| 17 | @Override | 17 | @Override |
| 18 | protected void onCreate(Bundle savedInstanceState) { | 18 | protected void onCreate(Bundle savedInstanceState) { |
| 19 | super.onCreate(savedInstanceState); | 19 | super.onCreate(savedInstanceState); |
| 20 | setContentView(R.layout.activity_start_page); | 20 | setContentView(R.layout.activity_start_page); |
| 21 | initView(); | 21 | initView(); |
| 22 | initData(); | 22 | initData(); |
| 23 | initLister(); | 23 | initLister(); |
| 24 | } | 24 | } |
| 25 | private void initView() { | 25 | private void initView() { |
| 26 | btn_start = (Button) findViewById(R.id.btn_start); | 26 | btn_start = (Button) findViewById(R.id.btn_start); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | private void initData() { | 29 | private void initData() { |
| 30 | 30 | ||
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | private void initLister() { | 33 | private void initLister() { |
| 34 | btn_start.setOnClickListener(this); | 34 | btn_start.setOnClickListener(this); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | @Override | 37 | @Override |
| 38 | public void onClick(View v) { | 38 | public void onClick(View v) { |
| 39 | switch (v.getId()){ | 39 | switch (v.getId()){ |
| 40 | case R.id.btn_start: | 40 | case R.id.btn_start: |
| 41 | Intent intent = new Intent(); | 41 | Intent intent = new Intent(); |
| 42 | intent.setClass(TheStartPageActivity.this,MainActivity.class); | 42 | intent.setClass(TheStartPageActivity.this,MainActivity.class); |
| 43 | startActivity(intent); | 43 | startActivity(intent); |
| 44 | overridePendingTransition(R.anim.rightin, R.anim.rightout); | 44 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 45 | finish(); | ||
| 45 | break; | 46 | break; |
| 46 | } | 47 | } |
| 47 | } | 48 | } |
| 48 | } | 49 | } |
| 49 | 50 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/RecyclerViewAdapter.java
| File was created | 1 | package com.hjx.personalcenter.adapter; | |
| 2 | |||
| 3 | import android.content.Context; | ||
| 4 | import android.support.v7.widget.RecyclerView; | ||
| 5 | import android.view.LayoutInflater; | ||
| 6 | import android.view.View; | ||
| 7 | import android.view.ViewGroup; | ||
| 8 | import android.widget.Button; | ||
| 9 | import android.widget.TextView; | ||
| 10 | |||
| 11 | import com.hjx.personalcenter.R; | ||
| 12 | |||
| 13 | import java.util.List; | ||
| 14 | |||
| 15 | /** | ||
| 16 | * Author: zhangmiao | ||
| 17 | * Date: 2017/6/14 | ||
| 18 | */ | ||
| 19 | public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.RecyclerHolder> { | ||
| 20 | |||
| 21 | private static final String TAG = RecyclerViewAdapter.class.getSimpleName(); | ||
| 22 | |||
| 23 | private List<String> dataList; | ||
| 24 | private Context mContext; | ||
| 25 | private RecyclerView recyclerView; | ||
| 26 | |||
| 27 | public static int position = 0; | ||
| 28 | |||
| 29 | public RecyclerViewAdapter(Context context, List<String> dataList) { | ||
| 30 | mContext = context; | ||
| 31 | this.dataList = dataList; | ||
| 32 | } | ||
| 33 | |||
| 34 | @Override | ||
| 35 | public RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
| 36 | View view = LayoutInflater.from(mContext).inflate(R.layout.recycler_item_view, parent, false); | ||
| 37 | RecyclerHolder holder = new RecyclerHolder(view); | ||
| 38 | return holder; | ||
| 39 | } | ||
| 40 | |||
| 41 | @Override | ||
| 42 | public void onBindViewHolder(RecyclerHolder holder, final int position) { | ||
| 43 | holder.textView.setText(dataList.get(position)); | ||
| 44 | if (position == dataList.size() - 1) { | ||
| 45 | holder.button.setVisibility(View.GONE); | ||
| 46 | } | ||
| 47 | holder.button.setOnClickListener(new View.OnClickListener() { | ||
| 48 | @Override | ||
| 49 | public void onClick(View v) { | ||
| 50 | recyclerView.smoothScrollToPosition(position + 1); | ||
| 51 | RecyclerViewAdapter.position++; | ||
| 52 | } | ||
| 53 | }); | ||
| 54 | } | ||
| 55 | |||
| 56 | @Override | ||
| 57 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { | ||
| 58 | super.onAttachedToRecyclerView(recyclerView); | ||
| 59 | this.recyclerView = recyclerView; | ||
| 60 | } | ||
| 61 | |||
| 62 | @Override | ||
| 63 | public int getItemCount() { | ||
| 64 | return dataList.size(); | ||
| 65 | } | ||
| 66 | |||
| 67 | public class RecyclerHolder extends RecyclerView.ViewHolder { | ||
| 68 | TextView textView; | ||
| 69 | Button button; | ||
| 70 | |||
| 71 | public RecyclerHolder(View itemView) { | ||
| 72 | super(itemView); | ||
| 73 | textView = (TextView) itemView.findViewById(R.id.item_text); | ||
| 74 | button = (Button) itemView.findViewById(R.id.item_button); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | |||
| 78 | } | ||
| 79 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java
| 1 | package com.hjx.personalcenter.customdialog; | 1 | package com.hjx.personalcenter.customdialog; |
| 2 | 2 | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.content.Intent; | 4 | import android.content.Intent; |
| 5 | import android.graphics.Color; | 5 | import android.graphics.Color; |
| 6 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| 7 | import android.view.Gravity; | 7 | import android.view.Gravity; |
| 8 | import android.view.LayoutInflater; | 8 | import android.view.LayoutInflater; |
| 9 | import android.view.View; | 9 | import android.view.View; |
| 10 | import android.view.ViewGroup; | 10 | import android.view.ViewGroup; |
| 11 | 11 | ||
| 12 | import com.hjx.personalcenter.R; | 12 | import com.hjx.personalcenter.R; |
| 13 | import com.hjx.personalcenter.activity.ElectronicCardValidationActivity; | 13 | import com.hjx.personalcenter.activity.ElectronicCardValidationActivity; |
| 14 | import com.mylhyl.circledialog.BaseCircleDialog; | 14 | import com.mylhyl.circledialog.BaseCircleDialog; |
| 15 | import com.mylhyl.circledialog.res.values.CircleDimen; | 15 | import com.mylhyl.circledialog.res.values.CircleDimen; |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | * Created by h on 2017/8/10. | 18 | * Created by h on 2017/8/10. |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | public class ElectronicCardDialog extends BaseCircleDialog { | 21 | public class ElectronicCardDialog extends BaseCircleDialog { |
| 22 | public static ElectronicCardDialog getInstance() { | 22 | public static ElectronicCardDialog getInstance() { |
| 23 | ElectronicCardDialog dialogFragment = new ElectronicCardDialog(); | 23 | ElectronicCardDialog dialogFragment = new ElectronicCardDialog(); |
| 24 | dialogFragment.setCanceledBack(true); | 24 | dialogFragment.setCanceledBack(true); |
| 25 | dialogFragment.setCanceledOnTouchOutside(true); | 25 | dialogFragment.setCanceledOnTouchOutside(true); |
| 26 | dialogFragment.setRadius(CircleDimen.RADIUS); | 26 | dialogFragment.setRadius(CircleDimen.RADIUS); |
| 27 | dialogFragment.setWidth(0.8f); | 27 | dialogFragment.setWidth(0.8f); |
| 28 | dialogFragment.setGravity(Gravity.CENTER); | 28 | dialogFragment.setGravity(Gravity.CENTER); |
| 29 | dialogFragment.setBackgroundColor(Color.WHITE); | 29 | dialogFragment.setBackgroundColor(Color.WHITE); |
| 30 | return dialogFragment; | 30 | return dialogFragment; |
| 31 | } | 31 | } |
| 32 | @Override | 32 | @Override |
| 33 | public View createView(Context context, LayoutInflater inflater, ViewGroup container) { | 33 | public View createView(Context context, LayoutInflater inflater, ViewGroup container) { |
| 34 | return inflater.inflate(R.layout.custom_adilog_electroniccard, container, false); | 34 | return inflater.inflate(R.layout.custom_adilog_electroniccard, container, false); |
| 35 | } | 35 | } |
| 36 | @Override | 36 | @Override |
| 37 | public void onActivityCreated(Bundle savedInstanceState) { | 37 | public void onActivityCreated(Bundle savedInstanceState) { |
| 38 | super.onActivityCreated(savedInstanceState); | 38 | super.onActivityCreated(savedInstanceState); |
| 39 | getView().findViewById(R.id.fill_card).setOnClickListener(new View.OnClickListener() { | 39 | getView().findViewById(R.id.fill_card).setOnClickListener(new View.OnClickListener() { |
| 40 | @Override | 40 | @Override |
| 41 | public void onClick(View v) { | 41 | public void onClick(View v) { |
| 42 | //有保卡信息直接进入开始界面,没有则跳转保卡信息 | ||
| 43 | // Intent intent = new Intent(); | ||
| 44 | // intent.setClass(getActivity(),TheStartPageActivity.class); | ||
| 45 | // startActivity(intent); | ||
| 46 | // getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | ||
| 47 | Intent intent = new Intent(); | 42 | Intent intent = new Intent(); |
| 48 | intent.setClass(getActivity(),ElectronicCardValidationActivity.class); | 43 | intent.setClass(getActivity(),ElectronicCardValidationActivity.class); |
| 49 | startActivity(intent); | 44 | startActivity(intent); |
| 50 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | 45 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 51 | getActivity().finish(); | 46 | getActivity().finish(); |
| 52 | 47 | ||
| 53 | } | 48 | } |
| 54 | }); | 49 | }); |
| 55 | 50 | ||
| 56 | } | 51 | } |
| 57 | 52 | ||
| 58 | } | 53 | } |
| 59 | 54 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/db/Content.java
| 1 | package com.hjx.personalcenter.db; | 1 | package com.hjx.personalcenter.db; |
| 2 | 2 | ||
| 3 | /** | 3 | /** |
| 4 | * Created by h on 2017/8/17. | 4 | * Created by h on 2017/8/17. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | public class Content { | 7 | public class Content { |
| 8 | public static int authcodeflag;//1是进入填写保卡信息验证,2是修改保卡手机号验证,3是更改绑定验证 | 8 | public static int authcodeflag;//1是进入填写保卡信息验证,2是修改保卡手机号验证,3是更改绑定验证 |
| 9 | public static int adressflag;//1购买地址,2客户地址 | ||
| 9 | } | 10 | } |
| 10 | 11 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/LoginFragment.java
| 1 | package com.hjx.personalcenter.fragment; | 1 | package com.hjx.personalcenter.fragment; |
| 2 | 2 | ||
| 3 | import android.content.Intent; | 3 | import android.content.Intent; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 5 | import android.os.Handler; | ||
| 6 | import android.os.Message; | ||
| 5 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| 6 | import android.support.v4.app.Fragment; | 8 | import android.support.v4.app.Fragment; |
| 7 | import android.text.TextUtils; | 9 | import android.text.TextUtils; |
| 8 | import android.view.LayoutInflater; | 10 | import android.view.LayoutInflater; |
| 9 | import android.view.View; | 11 | import android.view.View; |
| 10 | import android.view.ViewGroup; | 12 | import android.view.ViewGroup; |
| 11 | import android.widget.Button; | 13 | import android.widget.Button; |
| 12 | import android.widget.EditText; | 14 | import android.widget.EditText; |
| 13 | import android.widget.TextView; | 15 | import android.widget.TextView; |
| 16 | import android.widget.Toast; | ||
| 14 | 17 | ||
| 15 | import com.hjx.personalcenter.R; | 18 | import com.hjx.personalcenter.R; |
| 16 | import com.hjx.personalcenter.activity.ForgotPasswordActivity; | 19 | import com.hjx.personalcenter.activity.ForgotPasswordActivity; |
| 17 | import com.hjx.personalcenter.activity.MainActivity; | 20 | import com.hjx.personalcenter.activity.MainActivity; |
| 21 | import com.hjx.personalcenter.customdialog.ElectronicCardDialog; | ||
| 22 | import com.hjx.personalcenter.http.HttpCode; | ||
| 18 | import com.hjx.personalcenter.http.HttpManager; | 23 | import com.hjx.personalcenter.http.HttpManager; |
| 19 | import com.hjx.personalcenter.util.AlertUtils; | 24 | import com.hjx.personalcenter.util.AlertUtils; |
| 20 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; | 25 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; |
| 21 | 26 | ||
| 27 | import org.json.JSONException; | ||
| 28 | import org.json.JSONObject; | ||
| 29 | |||
| 22 | /** | 30 | /** |
| 23 | * 登录 | 31 | * 登录 |
| 24 | * Created by h on 2017/8/8. | 32 | * Created by h on 2017/8/8. |
| 25 | */ | 33 | */ |
| 26 | 34 | ||
| 27 | public class LoginFragment extends Fragment implements View.OnClickListener { | 35 | public class LoginFragment extends Fragment implements View.OnClickListener { |
| 28 | private View mView; | 36 | private View mView; |
| 29 | private int type; | 37 | private int type; |
| 30 | private TextView tv_forget_pwd; | 38 | private TextView tv_forget_pwd; |
| 31 | private Button btn_login; | 39 | private Button btn_login; |
| 32 | private EditText phonenumber,login_pwwd; | 40 | private EditText phonenumber,login_pwwd; |
| 33 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; | 41 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; |
| 34 | Intent intent = new Intent(); | 42 | Intent intent = new Intent(); |
| 35 | public static LoginFragment newInstance(int type) { | 43 | public static LoginFragment newInstance(int type) { |
| 36 | LoginFragment fragment = new LoginFragment(); | 44 | LoginFragment fragment = new LoginFragment(); |
| 37 | Bundle bundle = new Bundle(); | 45 | Bundle bundle = new Bundle(); |
| 38 | bundle.putSerializable(TABLAYOUT_FRAGMENT, type); | 46 | bundle.putSerializable(TABLAYOUT_FRAGMENT, type); |
| 39 | fragment.setArguments(bundle); | 47 | fragment.setArguments(bundle); |
| 40 | return fragment; | 48 | return fragment; |
| 41 | 49 | ||
| 42 | } | 50 | } |
| 51 | Handler handler = new Handler(){ | ||
| 52 | @Override | ||
| 53 | public void handleMessage(Message msg) { | ||
| 54 | super.handleMessage(msg); | ||
| 55 | |||
| 56 | switch (msg.what){ | ||
| 57 | case HttpCode.LOGIN_SUCESS: | ||
| 58 | JSONObject jsonObject; | ||
| 59 | String status; | ||
| 60 | try { | ||
| 61 | jsonObject = new JSONObject((String) msg.obj); | ||
| 62 | status = jsonObject.getString("status"); | ||
| 63 | if (status.equals("100")) { | ||
| 64 | String access_token = jsonObject.getString("access_token"); | ||
| 65 | String userId = jsonObject.getString("userId"); | ||
| 66 | final String name = phonenumber.getText().toString().trim(); | ||
| 67 | final String pwd = login_pwwd.getText().toString().trim(); | ||
| 68 | // //登录成功,保存登录数据并且获取个人信息 | ||
| 69 | HttpManager.getInstance().saveLoginInfo(getActivity(), name, pwd, access_token, "true", userId); | ||
| 70 | try { | ||
| 71 | long auserID = Long.parseLong(userId); | ||
| 72 | //是否填写保卡 | ||
| 73 | HttpManager.getInstance().cardinfocheck(getActivity(),auserID,handler); | ||
| 74 | } catch (NumberFormatException e) { | ||
| 75 | e.printStackTrace(); | ||
| 76 | } | ||
| 77 | |||
| 78 | |||
| 79 | } else if (status.equals("200")) { | ||
| 80 | Toast.makeText(getActivity(), "用户名不存在!", Toast.LENGTH_LONG).show(); | ||
| 81 | return; | ||
| 82 | } else if (status.equals("204")) { | ||
| 83 | Toast.makeText(getActivity(), "密码错误!", Toast.LENGTH_LONG).show(); | ||
| 84 | } else { | ||
| 85 | Toast.makeText(getActivity(), "登录失败!请检查网络", Toast.LENGTH_LONG).show(); | ||
| 86 | |||
| 87 | |||
| 88 | } | ||
| 89 | } catch (JSONException e) { | ||
| 90 | e.printStackTrace(); | ||
| 91 | } | ||
| 92 | break; | ||
| 93 | case HttpCode.CHECKCARD: | ||
| 94 | try { | ||
| 95 | jsonObject = new JSONObject( (String) msg.obj); | ||
| 96 | status = jsonObject.optString("status"); | ||
| 97 | if (status.equals("1")){ | ||
| 98 | Intent intent = new Intent(); | ||
| 99 | intent.setClass(getActivity(), MainActivity.class); | ||
| 100 | getActivity().startActivity(intent); | ||
| 101 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | ||
| 102 | }else if(status.equals("2001")){ | ||
| 103 | ElectronicCardDialog.getInstance().show(getChildFragmentManager(), "ElectronicCardDialog"); | ||
| 104 | }else{ | ||
| 105 | Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_LONG).show(); | ||
| 106 | } | ||
| 107 | |||
| 108 | } catch (JSONException e) { | ||
| 109 | e.printStackTrace(); | ||
| 110 | } | ||
| 111 | |||
| 112 | break; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | }; | ||
| 43 | 116 | ||
| 44 | @Override | 117 | @Override |
| 45 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | 118 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 46 | if (mView == null) { | 119 | if (mView == null) { |
| 47 | mView = inflater.inflate(R.layout.fragment_loginandregister_login, container, false); | 120 | mView = inflater.inflate(R.layout.fragment_loginandregister_login, container, false); |
| 48 | initView(mView); | 121 | initView(mView); |
| 49 | initData(); | 122 | initData(); |
| 50 | setLister(); | 123 | setLister(); |
| 51 | 124 | ||
| 52 | 125 | ||
| 53 | } | 126 | } |
| 54 | return mView; | 127 | return mView; |
| 55 | } | 128 | } |
| 56 | //初始化 | 129 | //初始化 |
| 57 | private void initView(View mView) { | 130 | private void initView(View mView) { |
| 58 | tv_forget_pwd = (TextView) mView.findViewById(R.id.tv_forget_pwd); | 131 | tv_forget_pwd = (TextView) mView.findViewById(R.id.tv_forget_pwd); |
| 59 | phonenumber = (EditText) mView.findViewById(R.id.et_phonenumber); | 132 | phonenumber = (EditText) mView.findViewById(R.id.et_phonenumber); |
| 60 | login_pwwd = (EditText) mView.findViewById(R.id.et_password); | 133 | login_pwwd = (EditText) mView.findViewById(R.id.et_password); |
| 61 | btn_login = (Button) mView.findViewById(R.id.btn_login); | 134 | btn_login = (Button) mView.findViewById(R.id.btn_login); |
| 62 | 135 | ||
| 63 | } | 136 | } |
| 64 | private void initData() { | 137 | private void initData() { |
| 65 | } | 138 | } |
| 66 | private void setLister() { | 139 | private void setLister() { |
| 67 | tv_forget_pwd.setOnClickListener(this); | 140 | tv_forget_pwd.setOnClickListener(this); |
| 68 | btn_login.setOnClickListener(this); | 141 | btn_login.setOnClickListener(this); |
| 69 | } | 142 | } |
| 70 | 143 | ||
| 71 | 144 | ||
| 72 | @Override | 145 | @Override |
| 73 | public void onClick(View v) { | 146 | public void onClick(View v) { |
| 74 | switch (v.getId()){ | 147 | switch (v.getId()){ |
| 75 | case R.id.tv_forget_pwd: | 148 | case R.id.tv_forget_pwd: |
| 76 | intent.setClass(getActivity(),ForgotPasswordActivity.class); | 149 | intent.setClass(getActivity(),ForgotPasswordActivity.class); |
| 77 | startActivity(intent); | 150 | startActivity(intent); |
| 78 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | 151 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 79 | break; | 152 | break; |
| 80 | case R.id.btn_login: | 153 | case R.id.btn_login: |
| 81 | login(); | 154 | login(); |
| 82 | break; | 155 | break; |
| 83 | } | 156 | } |
| 84 | 157 | ||
| 85 | } | 158 | } |
| 86 | 159 | ||
| 87 | private void login() { | 160 | private void login() { |
| 88 | final String name = phonenumber.getText().toString().trim(); | 161 | final String name = phonenumber.getText().toString().trim(); |
| 89 | final String pwd = login_pwwd.getText().toString().trim(); | 162 | final String pwd = login_pwwd.getText().toString().trim(); |
| 90 | if (TextUtils.isEmpty(name) || TextUtils.isEmpty(pwd)) { | 163 | if (TextUtils.isEmpty(name) || TextUtils.isEmpty(pwd)) { |
| 91 | AlertUtils.showToast(getActivity(), "请输入手机号和密码"); | 164 | AlertUtils.showToast(getActivity(), "请输入手机号和密码"); |
| 92 | return; | 165 | return; |
| 93 | }else if (!PhoneNumCheckUtils.isPhone(name)){ | 166 | }else if (!PhoneNumCheckUtils.isPhone(name)){ |
| 94 | AlertUtils.showToast(getActivity(), "请输入正确的手机号"); | 167 | AlertUtils.showToast(getActivity(), "请输入正确的手机号"); |
| 95 | }else { | 168 | }else { |
| 96 | intent.setClass(getActivity(),MainActivity.class); | ||
| 97 | startActivity(intent); | ||
| 98 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | ||
| 99 | //登录接口 | 169 | //登录接口 |
| 100 | HttpManager.getInstance().login(name,pwd, getActivity()); | 170 | HttpManager.getInstance().login(name,pwd, getActivity(),handler); |
| 101 | } | 171 | } |
| 102 | 172 | ||
| 103 | 173 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java
| 1 | package com.hjx.personalcenter.fragment; | 1 | package com.hjx.personalcenter.fragment; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.graphics.Color; | 4 | import android.graphics.Color; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
| 7 | import android.support.v4.app.Fragment; | 7 | import android.support.v4.app.Fragment; |
| 8 | import android.view.Gravity; | 8 | import android.view.Gravity; |
| 9 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
| 10 | import android.view.View; | 10 | import android.view.View; |
| 11 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
| 12 | import android.widget.AdapterView; | 12 | import android.widget.AdapterView; |
| 13 | import android.widget.EditText; | 13 | import android.widget.EditText; |
| 14 | import android.widget.TextView; | 14 | import android.widget.TextView; |
| 15 | 15 | ||
| 16 | import com.bigkoo.pickerview.TimePickerView; | 16 | import com.bigkoo.pickerview.TimePickerView; |
| 17 | import com.hjx.personalcenter.R; | 17 | import com.hjx.personalcenter.R; |
| 18 | import com.hjx.personalcenter.customdialog.CitysListDialog; | 18 | import com.hjx.personalcenter.customdialog.CitysListDialog; |
| 19 | import com.hjx.personalcenter.customdialog.CountryDialog; | 19 | import com.hjx.personalcenter.customdialog.CountryDialog; |
| 20 | import com.hjx.personalcenter.customdialog.GradeListDialog; | 20 | import com.hjx.personalcenter.customdialog.GradeListDialog; |
| 21 | import com.hjx.personalcenter.customdialog.ProvinceListDialog; | 21 | import com.hjx.personalcenter.customdialog.ProvinceListDialog; |
| 22 | import com.hjx.personalcenter.customdialog.SchoolListDialog; | 22 | import com.hjx.personalcenter.customdialog.SchoolListDialog; |
| 23 | import com.hjx.personalcenter.db.SaveParam; | 23 | import com.hjx.personalcenter.db.SaveParam; |
| 24 | import com.hjx.personalcenter.http.HttpManager; | 24 | import com.hjx.personalcenter.http.HttpManager; |
| 25 | import com.hjx.personalcenter.interfaces.DialogCallBack; | 25 | import com.hjx.personalcenter.interfaces.DialogCallBack; |
| 26 | import com.hjx.personalcenter.model.ChangeInfo; | 26 | import com.hjx.personalcenter.model.ChangeInfo; |
| 27 | import com.hjx.personalcenter.model.CityInfo; | 27 | import com.hjx.personalcenter.model.CityInfo; |
| 28 | import com.hjx.personalcenter.model.CountyInfo; | 28 | import com.hjx.personalcenter.model.CountyInfo; |
| 29 | import com.hjx.personalcenter.model.GradeInfo; | 29 | import com.hjx.personalcenter.model.GradeInfo; |
| 30 | import com.hjx.personalcenter.model.ProvinceInfo; | 30 | import com.hjx.personalcenter.model.ProvinceInfo; |
| 31 | import com.hjx.personalcenter.model.SchoolInfo; | 31 | import com.hjx.personalcenter.model.SchoolInfo; |
| 32 | import com.hjx.personalcenter.util.AlertUtils; | 32 | import com.hjx.personalcenter.util.AlertUtils; |
| 33 | import com.hjx.personalcenter.util.BrithdayStar; | 33 | import com.hjx.personalcenter.util.BrithdayStar; |
| 34 | import com.mylhyl.circledialog.CircleDialog; | 34 | import com.mylhyl.circledialog.CircleDialog; |
| 35 | import com.mylhyl.circledialog.callback.ConfigButton; | 35 | import com.mylhyl.circledialog.callback.ConfigButton; |
| 36 | import com.mylhyl.circledialog.callback.ConfigDialog; | 36 | import com.mylhyl.circledialog.callback.ConfigDialog; |
| 37 | import com.mylhyl.circledialog.params.ButtonParams; | 37 | import com.mylhyl.circledialog.params.ButtonParams; |
| 38 | import com.mylhyl.circledialog.params.DialogParams; | 38 | import com.mylhyl.circledialog.params.DialogParams; |
| 39 | 39 | ||
| 40 | import org.apache.http.util.TextUtils; | 40 | import org.apache.http.util.TextUtils; |
| 41 | 41 | ||
| 42 | import java.io.UnsupportedEncodingException; | 42 | import java.io.UnsupportedEncodingException; |
| 43 | import java.text.SimpleDateFormat; | 43 | import java.text.SimpleDateFormat; |
| 44 | import java.util.ArrayList; | 44 | import java.util.ArrayList; |
| 45 | import java.util.Date; | 45 | import java.util.Date; |
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | * Created by h on 2017/8/12. | 48 | * Created by h on 2017/8/12. |
| 49 | */ | 49 | */ |
| 50 | 50 | ||
| 51 | public class PresonInfoFragment extends Fragment implements View.OnClickListener, DialogCallBack.GradeCallBack, DialogCallBack.ProvincesCallBack | 51 | public class PresonInfoFragment extends Fragment implements View.OnClickListener, DialogCallBack.GradeCallBack, DialogCallBack.ProvincesCallBack |
| 52 | , DialogCallBack.CitysCallBack, DialogCallBack.CountryCallBack, DialogCallBack.SchoolCallBack { | 52 | , DialogCallBack.CitysCallBack, DialogCallBack.CountryCallBack, DialogCallBack.SchoolCallBack { |
| 53 | private View mView; | 53 | private View mView; |
| 54 | private int type; | 54 | private int type; |
| 55 | private TimePickerView pvTime; | 55 | private TimePickerView pvTime; |
| 56 | private EditText tv_username1, tv_useinfo_adress1, tv_useinfo_qq; | 56 | private EditText tv_username1, tv_useinfo_adress1, tv_useinfo_qq; |
| 57 | private TextView tv_sex, tv_useinfo_adress, tv_useinfo_birthday, tv_useinfo_school, tv_useinfo_gender; | 57 | private TextView tv_sex, tv_useinfo_adress, tv_useinfo_birthday, tv_useinfo_school, tv_useinfo_gender; |
| 58 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; | 58 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; |
| 59 | 59 | ||
| 60 | public static PresonInfoFragment newInstance(int type) { | 60 | public static PresonInfoFragment newInstance(int type) { |
| 61 | PresonInfoFragment fragment = new PresonInfoFragment(); | 61 | PresonInfoFragment fragment = new PresonInfoFragment(); |
| 62 | Bundle bundle = new Bundle(); | 62 | Bundle bundle = new Bundle(); |
| 63 | bundle.putSerializable(TABLAYOUT_FRAGMENT, type); | 63 | bundle.putSerializable(TABLAYOUT_FRAGMENT, type); |
| 64 | fragment.setArguments(bundle); | 64 | fragment.setArguments(bundle); |
| 65 | return fragment; | 65 | return fragment; |
| 66 | 66 | ||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | @Override | 69 | @Override |
| 70 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | 70 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 71 | if (mView == null) { | 71 | if (mView == null) { |
| 72 | mView = inflater.inflate(R.layout.fragment_changge_presonal_info, container, false); | 72 | mView = inflater.inflate(R.layout.fragment_changge_presonal_info, container, false); |
| 73 | initView(mView); | 73 | initView(mView); |
| 74 | initData(); | 74 | initData(); |
| 75 | setLister(); | 75 | setLister(); |
| 76 | initTimePicker(); | 76 | initTimePicker(); |
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | } | 79 | } |
| 80 | return mView; | 80 | return mView; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | //初始化 | 83 | //初始化 |
| 84 | private void initView(View mView) { | 84 | private void initView(View mView) { |
| 85 | tv_username1 = (EditText) mView.findViewById(R.id.tv_username1); | 85 | tv_username1 = (EditText) mView.findViewById(R.id.tv_username1); |
| 86 | tv_useinfo_adress1 = (EditText) mView.findViewById(R.id.tv_useinfo_adress1); | 86 | tv_useinfo_adress1 = (EditText) mView.findViewById(R.id.tv_useinfo_adress1); |
| 87 | tv_useinfo_qq = (EditText) mView.findViewById(R.id.tv_useinfo_qq); | 87 | tv_useinfo_qq = (EditText) mView.findViewById(R.id.tv_useinfo_qq); |
| 88 | tv_sex = (TextView) mView.findViewById(R.id.tv_sex); | 88 | tv_sex = (TextView) mView.findViewById(R.id.tv_sex); |
| 89 | tv_useinfo_adress = (TextView) mView.findViewById(R.id.tv_useinfo_adress); | 89 | tv_useinfo_adress = (TextView) mView.findViewById(R.id.tv_useinfo_adress); |
| 90 | tv_useinfo_birthday = (TextView) mView.findViewById(R.id.tv_useinfo_birthday); | 90 | tv_useinfo_birthday = (TextView) mView.findViewById(R.id.tv_useinfo_birthday); |
| 91 | tv_useinfo_school = (TextView) mView.findViewById(R.id.tv_useinfo_school); | 91 | tv_useinfo_school = (TextView) mView.findViewById(R.id.tv_useinfo_school); |
| 92 | tv_useinfo_gender = (TextView) mView.findViewById(R.id.tv_useinfo_gender); | 92 | tv_useinfo_gender = (TextView) mView.findViewById(R.id.tv_useinfo_gender); |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | private void initData() { | 97 | private void initData() { |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | private void setLister() { | 100 | private void setLister() { |
| 101 | tv_sex.setOnClickListener(this); | 101 | tv_sex.setOnClickListener(this); |
| 102 | tv_useinfo_adress.setOnClickListener(this); | 102 | tv_useinfo_adress.setOnClickListener(this); |
| 103 | tv_useinfo_birthday.setOnClickListener(this); | 103 | tv_useinfo_birthday.setOnClickListener(this); |
| 104 | tv_useinfo_school.setOnClickListener(this); | 104 | tv_useinfo_school.setOnClickListener(this); |
| 105 | tv_useinfo_gender.setOnClickListener(this); | 105 | tv_useinfo_gender.setOnClickListener(this); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | @Override | 108 | @Override |
| 109 | public void onClick(View v) { | 109 | public void onClick(View v) { |
| 110 | String presonal1 = tv_username1.getText().toString().trim(); | 110 | String presonal1 = tv_username1.getText().toString().trim(); |
| 111 | String presonal2 = tv_useinfo_adress1.getText().toString().trim(); | 111 | String presonal2 = tv_useinfo_adress1.getText().toString().trim(); |
| 112 | String presonal3 = tv_sex.getText().toString().trim(); | 112 | String presonal3 = tv_sex.getText().toString().trim(); |
| 113 | String presonal4 = tv_useinfo_adress.getText().toString().trim(); | 113 | String presonal4 = tv_useinfo_adress.getText().toString().trim(); |
| 114 | String presonal5 = tv_useinfo_birthday.getText().toString().trim(); | 114 | String presonal5 = tv_useinfo_birthday.getText().toString().trim(); |
| 115 | String presonal6 = tv_useinfo_school.getText().toString().trim(); | 115 | String presonal6 = tv_useinfo_school.getText().toString().trim(); |
| 116 | String presonal7 = tv_useinfo_gender.getText().toString().trim(); | 116 | String presonal7 = tv_useinfo_gender.getText().toString().trim(); |
| 117 | String presonal8 = tv_useinfo_qq.getText().toString().trim(); | 117 | String presonal8 = tv_useinfo_qq.getText().toString().trim(); |
| 118 | switch (v.getId()) { | 118 | switch (v.getId()) { |
| 119 | case R.id.tv_sex: | 119 | case R.id.tv_sex: |
| 120 | final String[] items = {"男", "女"}; | 120 | final String[] items = {"男", "女"}; |
| 121 | new CircleDialog.Builder(getActivity()) | 121 | new CircleDialog.Builder(getActivity()) |
| 122 | .configDialog(new ConfigDialog() { | 122 | .configDialog(new ConfigDialog() { |
| 123 | @Override | 123 | @Override |
| 124 | public void onConfig(DialogParams params) { | 124 | public void onConfig(DialogParams params) { |
| 125 | //增加弹出动画 | 125 | //增加弹出动画 |
| 126 | params.gravity = Gravity.CENTER; | 126 | params.gravity = Gravity.CENTER; |
| 127 | } | 127 | } |
| 128 | }) | 128 | }) |
| 129 | .setTitle("请选择性别") | 129 | .setTitle("请选择性别") |
| 130 | .setWidth(0.5f) | 130 | .setWidth(0.5f) |
| 131 | .setItems(items, new AdapterView.OnItemClickListener() { | 131 | .setItems(items, new AdapterView.OnItemClickListener() { |
| 132 | @Override | 132 | @Override |
| 133 | public void onItemClick(AdapterView<?> parent, View view, int | 133 | public void onItemClick(AdapterView<?> parent, View view, int |
| 134 | position, long id) { | 134 | position, long id) { |
| 135 | switch (position) { | 135 | switch (position) { |
| 136 | case 0: | 136 | case 0: |
| 137 | tv_sex.setText("男"); | 137 | tv_sex.setText("男"); |
| 138 | break; | 138 | break; |
| 139 | case 1: | 139 | case 1: |
| 140 | tv_sex.setText("女"); | 140 | tv_sex.setText("女"); |
| 141 | break; | 141 | break; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | } | 144 | } |
| 145 | }) | 145 | }) |
| 146 | .setNegative("取消", null) | 146 | .setNegative("取消", null) |
| 147 | .configNegative(new ConfigButton() { | 147 | .configNegative(new ConfigButton() { |
| 148 | @Override | 148 | @Override |
| 149 | public void onConfig(ButtonParams params) { | 149 | public void onConfig(ButtonParams params) { |
| 150 | //取消按钮字体颜色 | 150 | //取消按钮字体颜色 |
| 151 | params.textColor = Color.RED; | 151 | params.textColor = Color.RED; |
| 152 | } | 152 | } |
| 153 | }) | 153 | }) |
| 154 | .show(); | 154 | .show(); |
| 155 | break; | 155 | break; |
| 156 | case R.id.tv_useinfo_adress: | 156 | case R.id.tv_useinfo_adress: |
| 157 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "ProvinceListDialog"); | 157 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "ProvinceListDialog"); |
| 158 | break; | 158 | break; |
| 159 | case R.id.tv_useinfo_birthday: | 159 | case R.id.tv_useinfo_birthday: |
| 160 | pvTime.show(tv_useinfo_birthday);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view | 160 | pvTime.show(tv_useinfo_birthday);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view |
| 161 | break; | 161 | break; |
| 162 | case R.id.tv_useinfo_school: | 162 | case R.id.tv_useinfo_school: |
| 163 | if (TextUtils.isEmpty(presonal4) || | 163 | if (TextUtils.isEmpty(presonal4) || |
| 164 | TextUtils.isEmpty(presonal7)) { | 164 | TextUtils.isEmpty(presonal7)) { |
| 165 | AlertUtils.showToast(getActivity(), "请先选择地区和年级!"); | 165 | AlertUtils.showToast(getActivity(), "请先选择地区和年级!"); |
| 166 | return; | 166 | return; |
| 167 | } else { | 167 | } else { |
| 168 | SchoolListDialog.getInstance((DialogCallBack.SchoolCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "SchoolListDialog"); | 168 | SchoolListDialog.getInstance((DialogCallBack.SchoolCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "SchoolListDialog"); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | 171 | ||
| 172 | break; | 172 | break; |
| 173 | case R.id.tv_useinfo_gender: | 173 | case R.id.tv_useinfo_gender: |
| 174 | GradeListDialog.getInstance((DialogCallBack.GradeCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "GradeListDialog"); | 174 | GradeListDialog.getInstance((DialogCallBack.GradeCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "GradeListDialog"); |
| 175 | break; | 175 | break; |
| 176 | case R.id.presonal_sub: | 176 | case R.id.presonal_sub: |
| 177 | if (TextUtils.isEmpty(presonal1) || | ||
| 178 | TextUtils.isEmpty(presonal2) || TextUtils.isEmpty(presonal3) || TextUtils.isEmpty(presonal4) || | ||
| 179 | TextUtils.isEmpty(presonal5) || TextUtils.isEmpty(presonal6) || TextUtils.isEmpty(presonal7) || | ||
| 180 | TextUtils.isEmpty(presonal8)) { | ||
| 181 | AlertUtils.showToast(getActivity(), "请将信息填写完整!"); | ||
| 182 | return; | ||
| 183 | } else { | ||
| 177 | 184 | ||
| 178 | int a = 0, b = 0; | 185 | int a = 0, b = 0; |
| 179 | long c = 0; | 186 | long c = 0; |
| 180 | //保存星座 | 187 | //保存星座 |
| 181 | if (!TextUtils.isEmpty(presonal5)) { | ||
| 182 | BrithdayStar brithdayStar = new BrithdayStar(); | 188 | BrithdayStar brithdayStar = new BrithdayStar(); |
| 183 | String s = brithdayStar.getConstellations(tv_useinfo_birthday.getText().toString()); | 189 | String s = brithdayStar.getConstellations(tv_useinfo_birthday.getText().toString()); |
| 184 | SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.CONSTELLATION, s); | 190 | SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.CONSTELLATION, s); |
| 185 | } | ||
| 186 | ChangeInfo changeinfo = new ChangeInfo(); | ||
| 187 | String regionId = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.COUNTRY); | ||
| 188 | String regionId1 = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.CITYS); | ||
| 189 | if (regionId == null) { | ||
| 190 | regionId = regionId1; | ||
| 191 | } | ||
| 192 | String grade = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); | ||
| 193 | String schoolid = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); | ||
| 194 | ChangeInfo.SchoolBean changeinfo2 = new ChangeInfo.SchoolBean(); | ||
| 195 | try { | ||
| 196 | a = Integer.parseInt(regionId); | ||
| 197 | b = Integer.parseInt(grade); | ||
| 198 | c = Long.parseLong(schoolid); | ||
| 199 | } catch (NumberFormatException e) { | ||
| 200 | e.printStackTrace(); | ||
| 201 | } | ||
| 202 | changeinfo.setId("688"); | ||
| 203 | changeinfo.setNickname(presonal1); | ||
| 204 | changeinfo.setRegionId(a); | ||
| 205 | changeinfo.setGradeId(b); | ||
| 206 | changeinfo2.setSchoolId(c); | ||
| 207 | if ("男".equals(presonal3)) { | ||
| 208 | changeinfo.setGender("0"); | ||
| 209 | } else { | ||
| 210 | changeinfo.setGender("1"); | ||
| 211 | } | ||
| 212 | changeinfo.setBirthday(presonal5); | ||
| 213 | ChangeInfo.ContactBean changeinfo1 = new ChangeInfo.ContactBean(); | ||
| 214 | changeinfo1.setQq(presonal8); | ||
| 215 | changeinfo.setRegionName(presonal4 + presonal2); | ||
| 216 | changeinfo.setSchool(changeinfo2); | ||
| 217 | changeinfo.setContact(changeinfo1); | ||
| 218 | |||
| 219 | try { | ||
| 220 | //提交个人信息 | ||
| 221 | HttpManager.getInstance().changepresonalinfo(getActivity(), changeinfo); | ||
| 222 | } catch (UnsupportedEncodingException e) { | ||
| 223 | e.printStackTrace(); | ||
| 224 | } | ||
| 225 | |||
| 226 | 191 | ||
| 227 | break; | 192 | ChangeInfo changeinfo = new ChangeInfo(); |
| 193 | String regionId = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.COUNTRY); | ||
| 194 | String regionId1 = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.CITYS); | ||
| 195 | if (regionId == null) { | ||
| 196 | regionId = regionId1; | ||
| 197 | } | ||
| 198 | String grade = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); | ||
| 199 | String schoolid = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); | ||
| 200 | ChangeInfo.SchoolBean changeinfo2 = new ChangeInfo.SchoolBean(); | ||
| 201 | try { | ||
| 202 | a = Integer.parseInt(regionId); | ||
| 203 | b = Integer.parseInt(grade); | ||
| 204 | c = Long.parseLong(schoolid); | ||
| 205 | } catch (NumberFormatException e) { | ||
| 206 | e.printStackTrace(); | ||
| 207 | } | ||
| 208 | String userID = SaveParam.getInstance().getLoginParam(getActivity(), "userId"); | ||
| 209 | |||
| 210 | changeinfo.setId(userID); | ||
| 211 | changeinfo.setNickname(presonal1); | ||
| 212 | changeinfo.setRegionId(a); | ||
| 213 | changeinfo.setGradeId(b); | ||
| 214 | changeinfo2.setSchoolId(c); | ||
| 215 | if ("男".equals(presonal3)) { | ||
| 216 | changeinfo.setGender("0"); | ||
| 217 | } else { | ||
| 218 | changeinfo.setGender("1"); | ||
| 219 | } | ||
| 220 | changeinfo.setBirthday(presonal5); | ||
| 221 | ChangeInfo.ContactBean changeinfo1 = new ChangeInfo.ContactBean(); | ||
| 222 | changeinfo1.setQq(presonal8); | ||
| 223 | changeinfo.setRegionName(presonal4 + presonal2); | ||
| 224 | changeinfo.setSchool(changeinfo2); | ||
| 225 | changeinfo.setContact(changeinfo1); | ||
| 226 | |||
| 227 | try { | ||
| 228 | //提交个人信息 | ||
| 229 | HttpManager.getInstance().changepresonalinfo(getActivity(), changeinfo); | ||
| 230 | } catch (UnsupportedEncodingException e) { | ||
| 231 | e.printStackTrace(); | ||
| 232 | } | ||
| 233 | |||
| 234 | |||
| 235 | break; | ||
| 236 | } | ||
| 228 | } | 237 | } |
| 229 | } | 238 | } |
| 230 | 239 | ||
| 231 | //自定义时间选择器 | 240 | //自定义时间选择器 |
| 232 | private void initTimePicker() { | 241 | private void initTimePicker() { |
| 233 | //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) | 242 | //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) |
| 234 | //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 | 243 | //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 |
| 235 | // Calendar selectedDate = Calendar.getInstance(); | 244 | // Calendar selectedDate = Calendar.getInstance(); |
| 236 | // Calendar startDate = Calendar.getInstance(); | 245 | // Calendar startDate = Calendar.getInstance(); |
| 237 | // startDate.set(1900, 1, 1); | 246 | // startDate.set(1900, 1, 1); |
| 238 | // Calendar endDate = Calendar.getInstance(); | 247 | // Calendar endDate = Calendar.getInstance(); |
| 239 | // endDate.set(2100, 1, 1); | 248 | // endDate.set(2100, 1, 1); |
| 240 | //时间选择器 | 249 | //时间选择器 |
| 241 | pvTime = new TimePickerView.Builder(getActivity(), new TimePickerView.OnTimeSelectListener() { | 250 | pvTime = new TimePickerView.Builder(getActivity(), new TimePickerView.OnTimeSelectListener() { |
| 242 | @Override | 251 | @Override |
| 243 | public void onTimeSelect(Date date, View v) {//选中事件回调 | 252 | public void onTimeSelect(Date date, View v) {//选中事件回调 |
| 244 | // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null | 253 | // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null |
| 245 | /*btn_Time.setText(getTime(date));*/ | 254 | /*btn_Time.setText(getTime(date));*/ |
| 246 | TextView btn = (TextView) v; | 255 | TextView btn = (TextView) v; |
| 247 | btn.setText(getTime(date)); | 256 | btn.setText(getTime(date)); |
| 248 | } | 257 | } |
| 249 | }) | 258 | }) |
| 250 | //年月日时分秒 的显示与否,不设置则默认全部显示 | 259 | //年月日时分秒 的显示与否,不设置则默认全部显示 |
| 251 | .setType(new boolean[]{true, true, true, false, false, false}) | 260 | .setType(new boolean[]{true, true, true, false, false, false}) |
| 252 | .setLabel("", "", "", "", "", "") | 261 | .setLabel("", "", "", "", "", "") |
| 253 | .isCenterLabel(false) | 262 | .isCenterLabel(false) |
| 254 | .setDividerColor(Color.DKGRAY) | 263 | .setDividerColor(Color.DKGRAY) |
| 255 | .setContentSize(21) | 264 | .setContentSize(21) |
| 256 | // .setDate(selectedDate) | 265 | // .setDate(selectedDate) |
| 257 | // .setRangDate(startDate, endDate) | 266 | // .setRangDate(startDate, endDate) |
| 258 | .setBackgroundId(0x80000000) //设置外部遮罩颜色 | 267 | .setBackgroundId(0x80000000) //设置外部遮罩颜色 |
| 259 | .setDecorView(null) | 268 | .setDecorView(null) |
| 260 | .setTitleText("购买日期") | 269 | .setTitleText("购买日期") |
| 261 | .setTitleSize(22) | 270 | .setTitleSize(22) |
| 262 | .setCancelColor(Color.GRAY) | 271 | .setCancelColor(Color.GRAY) |
| 263 | .setSubCalSize(22) | 272 | .setSubCalSize(22) |
| 264 | .setDividerColor(Color.GRAY) | 273 | .setDividerColor(Color.GRAY) |
| 265 | .setSubmitColor(Color.GRAY) | 274 | .setSubmitColor(Color.GRAY) |
| 266 | .build(); | 275 | .build(); |
| 267 | } | 276 | } |
| 268 | 277 | ||
| 269 | private String getTime(Date date) {//可根据需要自行截取数据显示 | 278 | private String getTime(Date date) {//可根据需要自行截取数据显示 |
| 270 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | 279 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| 271 | return format.format(date); | 280 | return format.format(date); |
| 272 | } | 281 | } |
| 273 | 282 | ||
| 274 | @Override | 283 | @Override |
| 275 | public void onAttach(Activity activity) { | 284 | public void onAttach(Activity activity) { |
| 276 | super.onAttach(activity); | 285 | super.onAttach(activity); |
| 277 | View rootView = activity.getWindow().getDecorView(); | 286 | View rootView = activity.getWindow().getDecorView(); |
| 278 | TextView sub = (TextView) rootView.findViewById(R.id.presonal_sub); | 287 | TextView sub = (TextView) rootView.findViewById(R.id.presonal_sub); |
| 279 | sub.setOnClickListener(this); | 288 | sub.setOnClickListener(this); |
| 280 | } | 289 | } |
| 281 | 290 | ||
| 282 | @Override | 291 | @Override |
| 283 | public void province1OnItemClick(ArrayList<CityInfo.CitiesBean> data, int position, int type) { | 292 | public void province1OnItemClick(ArrayList<CityInfo.CitiesBean> data, int position, int type) { |
| 284 | String regionName = data.get(position).getRegionName(); | 293 | String regionName = data.get(position).getRegionName(); |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java
| 1 | package com.hjx.personalcenter.fragment; | 1 | package com.hjx.personalcenter.fragment; |
| 2 | 2 | ||
| 3 | import android.content.Intent; | 3 | import android.content.Intent; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 5 | import android.os.Handler; | 5 | import android.os.Handler; |
| 6 | import android.os.Message; | 6 | import android.os.Message; |
| 7 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| 8 | import android.support.v4.app.Fragment; | 8 | import android.support.v4.app.Fragment; |
| 9 | import android.text.TextUtils; | 9 | import android.text.TextUtils; |
| 10 | import android.text.method.HideReturnsTransformationMethod; | 10 | import android.text.method.HideReturnsTransformationMethod; |
| 11 | import android.text.method.PasswordTransformationMethod; | 11 | import android.text.method.PasswordTransformationMethod; |
| 12 | import android.view.LayoutInflater; | 12 | import android.view.LayoutInflater; |
| 13 | import android.view.View; | 13 | import android.view.View; |
| 14 | import android.view.ViewGroup; | 14 | import android.view.ViewGroup; |
| 15 | import android.widget.Button; | 15 | import android.widget.Button; |
| 16 | import android.widget.EditText; | 16 | import android.widget.EditText; |
| 17 | import android.widget.ImageView; | 17 | import android.widget.ImageView; |
| 18 | 18 | ||
| 19 | import com.hjx.personalcenter.R; | 19 | import com.hjx.personalcenter.R; |
| 20 | import com.hjx.personalcenter.activity.RegisterInfoActivity; | 20 | import com.hjx.personalcenter.activity.RegisterInfoActivity; |
| 21 | import com.hjx.personalcenter.http.HttpCode; | 21 | import com.hjx.personalcenter.http.HttpCode; |
| 22 | import com.hjx.personalcenter.http.HttpManager; | 22 | import com.hjx.personalcenter.http.HttpManager; |
| 23 | import com.hjx.personalcenter.util.AlertUtils; | 23 | import com.hjx.personalcenter.util.AlertUtils; |
| 24 | import com.hjx.personalcenter.util.PasswordCheckUtils; | 24 | import com.hjx.personalcenter.util.PasswordCheckUtils; |
| 25 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; | 25 | import com.hjx.personalcenter.util.PhoneNumCheckUtils; |
| 26 | 26 | ||
| 27 | import org.json.JSONException; | 27 | import org.json.JSONException; |
| 28 | import org.json.JSONObject; | 28 | import org.json.JSONObject; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * 注册 | 31 | * 注册 |
| 32 | * Created by Administrator on 2016/11/7. | 32 | * Created by Administrator on 2016/11/7. |
| 33 | */ | 33 | */ |
| 34 | 34 | ||
| 35 | public class RegisterFragment extends Fragment implements View.OnClickListener { | 35 | public class RegisterFragment extends Fragment implements View.OnClickListener { |
| 36 | private View mView; | 36 | private View mView; |
| 37 | 37 | ||
| 38 | private Button btn_register,get_authcode; | 38 | private Button btn_register,get_authcode; |
| 39 | private EditText phonenumber,password,anth_6num;//;//密码 | 39 | private EditText phonenumber,password,anth_6num;//;//密码 |
| 40 | private ImageView openeyes; | 40 | private ImageView openeyes; |
| 41 | private String sourceStr ="android"; | 41 | private String sourceStr ="android"; |
| 42 | private String typeStr = "register"; | 42 | private String typeStr = "register"; |
| 43 | private int i = 0; | 43 | private int i = 0; |
| 44 | private Thread thread; | 44 | private Thread thread; |
| 45 | private int type; | 45 | private int type; |
| 46 | public static Boolean showPassword = false; | 46 | public static Boolean showPassword = false; |
| 47 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; | 47 | public static String TABLAYOUT_FRAGMENT = "tab_fragment"; |
| 48 | 48 | ||
| 49 | public static RegisterFragment newInstance(int type) { | 49 | public static RegisterFragment newInstance(int type) { |
| 50 | RegisterFragment fragment = new RegisterFragment(); | 50 | RegisterFragment fragment = new RegisterFragment(); |
| 51 | Bundle bundle = new Bundle(); | 51 | Bundle bundle = new Bundle(); |
| 52 | bundle.putSerializable(TABLAYOUT_FRAGMENT, type); | 52 | bundle.putSerializable(TABLAYOUT_FRAGMENT, type); |
| 53 | fragment.setArguments(bundle); | 53 | fragment.setArguments(bundle); |
| 54 | return fragment; | 54 | return fragment; |
| 55 | 55 | ||
| 56 | } | 56 | } |
| 57 | Handler handler = new Handler() { | 57 | Handler handler = new Handler() { |
| 58 | @Override | 58 | @Override |
| 59 | public void handleMessage(Message msg) { | 59 | public void handleMessage(Message msg) { |
| 60 | super.handleMessage(msg); | 60 | super.handleMessage(msg); |
| 61 | try { | 61 | try { |
| 62 | JSONObject jsonObject; | 62 | JSONObject jsonObject; |
| 63 | String status; | 63 | String status; |
| 64 | switch (msg.what) { | 64 | switch (msg.what) { |
| 65 | case HttpCode.REGISTERED_SUCESS: | 65 | case HttpCode.REGISTERED_SUCESS: |
| 66 | jsonObject = (JSONObject) msg.obj; | 66 | jsonObject = (JSONObject) msg.obj; |
| 67 | status = jsonObject.getString("status"); | 67 | status = jsonObject.getString("status"); |
| 68 | //AlertUtils.showToast(RegisterActivity.this, jsonObject.optString("message")); | 68 | //AlertUtils.showToast(RegisterActivity.this, jsonObject.optString("message")); |
| 69 | String access_token = jsonObject.getString("access_token"); | 69 | String access_token = jsonObject.getString("access_token"); |
| 70 | String userId = jsonObject.getString("userId"); | 70 | String userId = jsonObject.getString("userId"); |
| 71 | if (status.equals("100")) { | 71 | if (status.equals("100")) { |
| 72 | String usernameStr = phonenumber.getText().toString().trim(); | 72 | String usernameStr = phonenumber.getText().toString().trim(); |
| 73 | String passwordStr = password.getText().toString().trim(); | 73 | String passwordStr = password.getText().toString().trim(); |
| 74 | HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,"true",userId); | 74 | HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,"true",userId); |
| 75 | AlertUtils.showToast(getActivity(), "注册成功!"); | 75 | AlertUtils.showToast(getActivity(), "注册成功!"); |
| 76 | //检查信息是否填写完整 | ||
| 76 | Intent intent = new Intent(); | 77 | Intent intent = new Intent(); |
| 77 | intent.setClass(getActivity(),RegisterInfoActivity.class); | 78 | intent.setClass(getActivity(),RegisterInfoActivity.class); |
| 78 | startActivity(intent); | 79 | startActivity(intent); |
| 79 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | 80 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 80 | getActivity().finish(); | 81 | getActivity().finish(); |
| 81 | } | 82 | } |
| 82 | break; | 83 | break; |
| 83 | case HttpCode.REGISTERED_FAIL: | 84 | case HttpCode.REGISTERED_FAIL: |
| 84 | AlertUtils.showToast(getActivity(), "注册失败"); | 85 | AlertUtils.showToast(getActivity(), "注册失败"); |
| 85 | break; | 86 | break; |
| 86 | case HttpCode.AUTHCODE_SUCESS: | 87 | case HttpCode.AUTHCODE_SUCESS: |
| 87 | jsonObject = (JSONObject) msg.obj; | 88 | jsonObject = (JSONObject) msg.obj; |
| 88 | status = jsonObject.optString("status"); | 89 | status = jsonObject.optString("status"); |
| 89 | if (status.equals("100")) { | 90 | if (status.equals("100")) { |
| 90 | AlertUtils.showToast(getActivity(), "验证码发送成功"); | 91 | AlertUtils.showToast(getActivity(), "验证码发送成功"); |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | break; | 94 | break; |
| 94 | case HttpCode.AUTHCODE_FAIL: | 95 | case HttpCode.AUTHCODE_FAIL: |
| 95 | jsonObject = (JSONObject) msg.obj; | 96 | jsonObject = (JSONObject) msg.obj; |
| 96 | AlertUtils.showToast(getActivity(), "验证码发送失败"); | 97 | AlertUtils.showToast(getActivity(), "验证码发送失败"); |
| 97 | break; | 98 | break; |
| 98 | case HttpCode.IS_REFISTER: | 99 | case HttpCode.IS_REFISTER: |
| 99 | jsonObject = (JSONObject) msg.obj; | 100 | jsonObject = (JSONObject) msg.obj; |
| 100 | status = jsonObject.getString("status"); | 101 | status = jsonObject.getString("status"); |
| 101 | if (!status.equals("true")) { | 102 | if (!status.equals("true")) { |
| 102 | getauthcode(); | 103 | getauthcode(); |
| 103 | 104 | ||
| 104 | }else { | 105 | }else { |
| 105 | AlertUtils.showToast(getActivity(), "该手机号已经注册过了"); | 106 | AlertUtils.showToast(getActivity(), "该手机号已经注册过了"); |
| 106 | } | 107 | } |
| 107 | break; | 108 | break; |
| 108 | case 1: | 109 | case 1: |
| 109 | get_authcode.setEnabled(false); | 110 | get_authcode.setEnabled(false); |
| 110 | get_authcode.setClickable(false); | 111 | get_authcode.setClickable(false); |
| 111 | get_authcode.setText(Integer.toString(i--)+" s"); | 112 | get_authcode.setText(Integer.toString(i--)+" s"); |
| 112 | if (i<=0){ | 113 | if (i<=0){ |
| 113 | get_authcode.setEnabled(true); | 114 | get_authcode.setEnabled(true); |
| 114 | get_authcode.setClickable(true); | 115 | get_authcode.setClickable(true); |
| 115 | get_authcode.setText("获取验证码"); | 116 | get_authcode.setText("获取验证码"); |
| 116 | } | 117 | } |
| 117 | break; | 118 | break; |
| 118 | } | 119 | } |
| 119 | } catch (JSONException e) { | 120 | } catch (JSONException e) { |
| 120 | e.printStackTrace(); | 121 | e.printStackTrace(); |
| 121 | } | 122 | } |
| 122 | } | 123 | } |
| 123 | }; | 124 | }; |
| 124 | @Override | 125 | @Override |
| 125 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | 126 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 126 | if (mView == null) { | 127 | if (mView == null) { |
| 127 | mView = inflater.inflate(R.layout.fragment_loginandregister_register, container, false); | 128 | mView = inflater.inflate(R.layout.fragment_loginandregister_register, container, false); |
| 128 | initView(mView); | 129 | initView(mView); |
| 129 | initData(); | 130 | initData(); |
| 130 | setLister(); | 131 | setLister(); |
| 131 | 132 | ||
| 132 | 133 | ||
| 133 | } | 134 | } |
| 134 | return mView; | 135 | return mView; |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | private void initView(View mView) { | 138 | private void initView(View mView) { |
| 138 | get_authcode = (Button) mView.findViewById(R.id.btn_authcode); | 139 | get_authcode = (Button) mView.findViewById(R.id.btn_authcode); |
| 139 | anth_6num = (EditText) mView.findViewById(R.id.et_authcode); | 140 | anth_6num = (EditText) mView.findViewById(R.id.et_authcode); |
| 140 | phonenumber = (EditText) mView.findViewById(R.id.et_phonenumber); | 141 | phonenumber = (EditText) mView.findViewById(R.id.et_phonenumber); |
| 141 | password = (EditText) mView.findViewById(R.id.et_password); | 142 | password = (EditText) mView.findViewById(R.id.et_password); |
| 142 | openeyes= (ImageView) mView.findViewById(R.id.iv_pwd_change); | 143 | openeyes= (ImageView) mView.findViewById(R.id.iv_pwd_change); |
| 143 | btn_register = (Button) mView.findViewById(R.id.btn_register); | 144 | btn_register = (Button) mView.findViewById(R.id.btn_register); |
| 144 | 145 | ||
| 145 | } | 146 | } |
| 146 | private void initData() { | 147 | private void initData() { |
| 147 | } | 148 | } |
| 148 | private void setLister() { | 149 | private void setLister() { |
| 149 | get_authcode.setOnClickListener(this); | 150 | get_authcode.setOnClickListener(this); |
| 150 | openeyes.setOnClickListener(this); | 151 | openeyes.setOnClickListener(this); |
| 151 | btn_register.setOnClickListener(this); | 152 | btn_register.setOnClickListener(this); |
| 152 | } | 153 | } |
| 153 | 154 | ||
| 154 | 155 | ||
| 155 | @Override | 156 | @Override |
| 156 | public void onClick(View v) { | 157 | public void onClick(View v) { |
| 157 | switch (v.getId()){ | 158 | switch (v.getId()){ |
| 158 | case R.id.btn_register: | 159 | case R.id.btn_register: |
| 159 | //测试 | 160 | //测试 |
| 160 | Intent intent = new Intent(); | 161 | // |
| 161 | intent.setClass(getActivity(),RegisterInfoActivity.class); | ||
| 162 | startActivity(intent); | ||
| 163 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); | ||
| 164 | getActivity().finish(); | ||
| 165 | 162 | ||
| 166 | String usernameStr = phonenumber.getText().toString().trim(); | 163 | String usernameStr = phonenumber.getText().toString().trim(); |
| 167 | String authcodeStr = anth_6num.getText().toString().trim(); | 164 | String authcodeStr = anth_6num.getText().toString().trim(); |
| 168 | String passwordStr = password.getText().toString().trim(); | 165 | String passwordStr = password.getText().toString().trim(); |
| 169 | if (TextUtils.isEmpty(usernameStr) || TextUtils.isEmpty(authcodeStr)||TextUtils.isEmpty(passwordStr)) { | 166 | if (TextUtils.isEmpty(usernameStr) || TextUtils.isEmpty(authcodeStr)||TextUtils.isEmpty(passwordStr)) { |
| 170 | AlertUtils.showToast(getActivity(), "手机号,密码和验证码不能为空"); | 167 | AlertUtils.showToast(getActivity(), "手机号,密码和验证码不能为空"); |
| 171 | return; | 168 | return; |
| 172 | } else if(passwordStr.length()<8){ | 169 | } else if(passwordStr.length()<8){ |
| 173 | AlertUtils.showToast(getActivity(), "密码不能少于8位"); | 170 | AlertUtils.showToast(getActivity(), "密码不能少于8位"); |
| 174 | }else if (!PhoneNumCheckUtils.isPhone(usernameStr)){ | 171 | }else if (!PhoneNumCheckUtils.isPhone(usernameStr)){ |
| 175 | AlertUtils.showToast(getActivity(), "手机号码输入错误"); | 172 | AlertUtils.showToast(getActivity(), "手机号码输入错误"); |
| 176 | 173 | ||
| 177 | }else if(!passwordStr.matches(PasswordCheckUtils.PASSWORD_CHAR_AND_NUMBER)){ | 174 | }else if(!passwordStr.matches(PasswordCheckUtils.PASSWORD_CHAR_AND_NUMBER)){ |
| 178 | AlertUtils.showToast(getActivity(), "密码由英文和数字组成"); | 175 | AlertUtils.showToast(getActivity(), "密码由英文和数字组成"); |
| 179 | }else { | 176 | }else { |
| 180 | register(); | 177 | register(); |
| 181 | } | 178 | } |
| 182 | 179 | ||
| 183 | break; | 180 | break; |
| 184 | case R.id.iv_pwd_change: | 181 | case R.id.iv_pwd_change: |
| 185 | if(showPassword){//显示密码 | 182 | if(showPassword){//显示密码 |
| 186 | showPassword = !showPassword; | 183 | showPassword = !showPassword; |
| 187 | openeyes.setImageResource(R.mipmap.pwd_open); | 184 | openeyes.setImageResource(R.mipmap.pwd_open); |
| 188 | password.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); | 185 | password.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); |
| 189 | password.setSelection(password.getText().toString().length()); | 186 | password.setSelection(password.getText().toString().length()); |
| 190 | }else{//隐藏密码 | 187 | }else{//隐藏密码 |
| 191 | showPassword = !showPassword; | 188 | showPassword = !showPassword; |
| 192 | openeyes.setImageResource(R.mipmap.pwd_hide); | 189 | openeyes.setImageResource(R.mipmap.pwd_hide); |
| 193 | password.setTransformationMethod(PasswordTransformationMethod.getInstance()); | 190 | password.setTransformationMethod(PasswordTransformationMethod.getInstance()); |
| 194 | password.setSelection(password.getText().toString().length()); | 191 | password.setSelection(password.getText().toString().length()); |
| 195 | } | 192 | } |
| 196 | break; | 193 | break; |
| 197 | case R.id.btn_authcode: | 194 | case R.id.btn_authcode: |
| 198 | usernameStr = phonenumber.getText().toString().trim(); | 195 | usernameStr = phonenumber.getText().toString().trim(); |
| 199 | if (!PhoneNumCheckUtils.isPhone(usernameStr)){ | 196 | if (!PhoneNumCheckUtils.isPhone(usernameStr)){ |
| 200 | AlertUtils.showToast(getActivity(), "请输入正确的手机号"); | 197 | AlertUtils.showToast(getActivity(), "请输入正确的手机号"); |
| 201 | }else { | 198 | }else { |
| 202 | anth_6num.requestFocus(); | 199 | anth_6num.requestFocus(); |
| 203 | ifregister(); | 200 | ifregister(); |
| 204 | } | 201 | } |
| 205 | 202 | ||
| 206 | break; | 203 | break; |
| 207 | } | 204 | } |
| 208 | 205 | ||
| 209 | } | 206 | } |
| 210 | //获取验证码 | 207 | //获取验证码 |
| 211 | private void getauthcode() { | 208 | private void getauthcode() { |
| 212 | String usernameStr = phonenumber.getText().toString().trim(); | 209 | String usernameStr = phonenumber.getText().toString().trim(); |
| 213 | HttpManager.getInstance().authCode(typeStr, usernameStr, handler, getActivity()); | 210 | HttpManager.getInstance().authCode(typeStr, usernameStr, handler, getActivity()); |
| 214 | i = 60; | 211 | i = 60; |
| 215 | if(thread == null){ | 212 | if(thread == null){ |
| 216 | thread = new Thread( new ThreadShow()); | 213 | thread = new Thread( new ThreadShow()); |
| 217 | thread.start(); | 214 | thread.start(); |
| 218 | } | 215 | } |
| 219 | } | 216 | } |
| 220 | 217 | ||
| 221 | private void ifregister() { | 218 | private void ifregister() { |
| 222 | String usernameStr = phonenumber.getText().toString().trim(); | 219 | String usernameStr = phonenumber.getText().toString().trim(); |
| 223 | HttpManager.getInstance().isregistered(usernameStr, handler, getActivity()); | 220 | HttpManager.getInstance().isregistered(usernameStr, handler, getActivity()); |
| 224 | } | 221 | } |
| 225 | 222 | ||
| 226 | private void register() { | 223 | private void register() { |
| 227 | String usernameStr = phonenumber.getText().toString().trim(); | 224 | String usernameStr = phonenumber.getText().toString().trim(); |
| 228 | String authcodeStr = anth_6num.getText().toString().trim(); | 225 | String authcodeStr = anth_6num.getText().toString().trim(); |
| 229 | String passwordStr = password.getText().toString().trim(); | 226 | String passwordStr = password.getText().toString().trim(); |
| 230 | HttpManager.getInstance().register(getActivity(), usernameStr, passwordStr, authcodeStr, sourceStr,handler); | 227 | HttpManager.getInstance().register(getActivity(), usernameStr, passwordStr, authcodeStr, sourceStr,handler); |
| 231 | } | 228 | } |
| 232 | // 线程类 定时器 | 229 | // 线程类 定时器 |
| 233 | class ThreadShow implements Runnable { | 230 | class ThreadShow implements Runnable { |
| 234 | 231 | ||
| 235 | @Override | 232 | @Override |
| 236 | public void run() { | 233 | public void run() { |
| 237 | // TODO Auto-generated method stub | 234 | // TODO Auto-generated method stub |
| 238 | while (true) { | 235 | while (true) { |
| 239 | try { | 236 | try { |
| 240 | Thread.sleep(1000); | 237 | Thread.sleep(1000); |
| 241 | Message msg = new Message(); | 238 | Message msg = new Message(); |
| 242 | msg.what = 1; | 239 | msg.what = 1; |
| 243 | handler.sendMessage(msg); | 240 | handler.sendMessage(msg); |
| 244 | System.out.println("send..."); | 241 | System.out.println("send..."); |
| 245 | } catch (Exception e) { | 242 | } catch (Exception e) { |
| 246 | // TODO Auto-generated catch block | 243 | // TODO Auto-generated catch block |
| 247 | e.printStackTrace(); | 244 | e.printStackTrace(); |
| 248 | System.out.println("thread error..."); | 245 | System.out.println("thread error..."); |
| 249 | } | 246 | } |
| 250 | } | 247 | } |
| 251 | } | 248 | } |
| 252 | } | 249 | } |
| 253 | } | 250 | } |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpCode.java
| 1 | package com.hjx.personalcenter.http; | 1 | package com.hjx.personalcenter.http; |
| 2 | 2 | ||
| 3 | /** | 3 | /** |
| 4 | * Created by wei on 2017/6/21. | 4 | * Created by wei on 2017/6/21. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | public class HttpCode { | 7 | public class HttpCode { |
| 8 | //查询保卡信息 | 8 | //查询保卡信息 |
| 9 | public static final int SUCHCARDINFO = 1; | 9 | public static final int SUCHCARDINFO = 0; |
| 10 | //是否填写保卡信息 | 10 | //是否填写保卡信息 |
| 11 | public static final int CHECKCARD = 1; | 11 | public static final int CHECKCARD = 1; |
| 12 | //注册 | 12 | //注册 |
| 13 | public static final int REGISTERED_SUCESS = 2; | 13 | public static final int REGISTERED_SUCESS = 2; |
| 14 | public static final int REGISTERED_FAIL = 3; | 14 | public static final int REGISTERED_FAIL = 3; |
| 15 | //注册验证码 | 15 | //注册验证码 |
| 16 | public static final int AUTHCODE_SUCESS = 4; | 16 | public static final int AUTHCODE_SUCESS = 4; |
| 17 | public static final int AUTHCODE_FAIL = 5; | 17 | public static final int AUTHCODE_FAIL = 5; |
| 18 | //忘记密码验证码 | 18 | //忘记密码验证码 |
| 19 | public static final int AUTHCODE_SUCESS1 = 6; | 19 | public static final int AUTHCODE_SUCESS1 = 6; |
| 20 | public static final int AUTHCODE_FAIL1 = 7; | 20 | public static final int AUTHCODE_FAIL1 = 7; |
| 21 | //是否已经注册 | 21 | //是否已经注册 |
| 22 | public static final int IS_REFISTER = 8; | 22 | public static final int IS_REFISTER = 8; |
| 23 | //忘记密码 | 23 | //忘记密码 |
| 24 | public static final int PASSWORD_SUCESS = 9; | 24 | public static final int PASSWORD_SUCESS = 9; |
| 25 | public static final int PASSWORD_FAIL = 10; | 25 | public static final int PASSWORD_FAIL = 10; |
| 26 | //s省 | 26 | //s省 |
| 27 | public static final int PROVICES = 11; | 27 | public static final int PROVICES = 11; |
| 28 | //市 | 28 | //市 |
| 29 | public static final int CITYS = 12; | 29 | public static final int CITYS = 12; |
| 30 | //区 | 30 | //区 |
| 31 | public static final int COUNTRY = 13; | 31 | public static final int COUNTRY = 13; |
| 32 | //学校 | 32 | //学校 |
| 33 | public static final int SCHOOL = 14; | 33 | public static final int SCHOOL = 14; |
| 34 | //年级 | 34 | //年级 |
| 35 | public static final int GRADER = 15; | 35 | public static final int GRADER = 15; |
| 36 | //获取个人信息 | 36 | //获取个人信息 |
| 37 | public static final int GETINFO = 16; | 37 | public static final int GETINFO = 16; |
| 38 | //获取个性签名 | 38 | //获取个性签名 |
| 39 | public static final int SIGN = 17; | 39 | public static final int SIGN = 17; |
| 40 | //登录 | ||
| 41 | public static final int LOGIN_SUCESS = 18; | ||
| 40 | 42 | ||
| 41 | 43 | ||
| 42 | 44 | ||
| 43 | } | 45 | } |
| 44 | 46 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
| 1 | package com.hjx.personalcenter.http; | 1 | package com.hjx.personalcenter.http; |
| 2 | 2 | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.app.ProgressDialog; | 4 | import android.app.ProgressDialog; |
| 5 | import android.content.ComponentName; | 5 | import android.content.ComponentName; |
| 6 | import android.content.Context; | 6 | import android.content.Context; |
| 7 | import android.content.Intent; | 7 | import android.content.Intent; |
| 8 | import android.os.Handler; | 8 | import android.os.Handler; |
| 9 | import android.os.Message; | 9 | import android.os.Message; |
| 10 | import android.provider.Settings; | 10 | import android.provider.Settings; |
| 11 | import android.support.v4.app.FragmentActivity; | 11 | import android.support.v4.app.FragmentActivity; |
| 12 | import android.util.Log; | 12 | import android.util.Log; |
| 13 | import android.view.Gravity; | 13 | import android.view.Gravity; |
| 14 | import android.view.View; | 14 | import android.view.View; |
| 15 | import android.widget.Toast; | 15 | import android.widget.Toast; |
| 16 | 16 | ||
| 17 | import com.google.gson.Gson; | 17 | import com.google.gson.Gson; |
| 18 | import com.hjx.personalcenter.R; | 18 | import com.hjx.personalcenter.R; |
| 19 | import com.hjx.personalcenter.activity.LoginAndRegisterActivity; | 19 | import com.hjx.personalcenter.activity.LoginAndRegisterActivity; |
| 20 | import com.hjx.personalcenter.activity.TheStartPageActivity; | 20 | import com.hjx.personalcenter.activity.TheStartPageActivity; |
| 21 | import com.hjx.personalcenter.db.SaveParam; | 21 | import com.hjx.personalcenter.db.SaveParam; |
| 22 | import com.hjx.personalcenter.gson.GsonTool; | 22 | import com.hjx.personalcenter.gson.GsonTool; |
| 23 | import com.hjx.personalcenter.model.CardInfo; | 23 | import com.hjx.personalcenter.model.CardInfo; |
| 24 | import com.hjx.personalcenter.model.CityInfo; | 24 | import com.hjx.personalcenter.model.CityInfo; |
| 25 | import com.hjx.personalcenter.model.CountyInfo; | 25 | import com.hjx.personalcenter.model.CountyInfo; |
| 26 | import com.hjx.personalcenter.model.GradeInfo; | 26 | import com.hjx.personalcenter.model.GradeInfo; |
| 27 | import com.hjx.personalcenter.model.PesonalInfo; | 27 | import com.hjx.personalcenter.model.PesonalInfo; |
| 28 | import com.hjx.personalcenter.model.ProvinceInfo; | 28 | import com.hjx.personalcenter.model.ProvinceInfo; |
| 29 | import com.hjx.personalcenter.model.SchoolInfo; | 29 | import com.hjx.personalcenter.model.SchoolInfo; |
| 30 | import com.hjx.personalcenter.model.SignInfo; | 30 | import com.hjx.personalcenter.model.SignInfo; |
| 31 | import com.hjx.personalcenter.util.DialogPermission; | 31 | import com.hjx.personalcenter.util.DialogPermission; |
| 32 | import com.loopj.android.http.AsyncHttpResponseHandler; | 32 | import com.loopj.android.http.AsyncHttpResponseHandler; |
| 33 | import com.loopj.android.http.JsonHttpResponseHandler; | 33 | import com.loopj.android.http.JsonHttpResponseHandler; |
| 34 | import com.loopj.android.http.RequestParams; | 34 | import com.loopj.android.http.RequestParams; |
| 35 | import com.mylhyl.circledialog.CircleDialog; | 35 | import com.mylhyl.circledialog.CircleDialog; |
| 36 | import com.mylhyl.circledialog.callback.ConfigText; | 36 | import com.mylhyl.circledialog.callback.ConfigText; |
| 37 | import com.mylhyl.circledialog.params.TextParams; | 37 | import com.mylhyl.circledialog.params.TextParams; |
| 38 | 38 | ||
| 39 | import org.apache.http.Header; | 39 | import org.apache.http.Header; |
| 40 | import org.apache.http.entity.ByteArrayEntity; | 40 | import org.apache.http.entity.ByteArrayEntity; |
| 41 | import org.apache.http.message.BasicHeader; | 41 | import org.apache.http.message.BasicHeader; |
| 42 | import org.apache.http.protocol.HTTP; | 42 | import org.apache.http.protocol.HTTP; |
| 43 | import org.json.JSONException; | 43 | import org.json.JSONException; |
| 44 | import org.json.JSONObject; | 44 | import org.json.JSONObject; |
| 45 | 45 | ||
| 46 | import java.io.UnsupportedEncodingException; | 46 | import java.io.UnsupportedEncodingException; |
| 47 | import java.util.ArrayList; | 47 | import java.util.ArrayList; |
| 48 | import java.util.List; | 48 | import java.util.List; |
| 49 | 49 | ||
| 50 | public class HttpManager { | 50 | public class HttpManager { |
| 51 | private static HttpManager instance; | 51 | private static HttpManager instance; |
| 52 | private ProgressDialog mProgress = null; | 52 | private ProgressDialog mProgress = null; |
| 53 | 53 | ||
| 54 | public static HttpManager getInstance() { | 54 | public static HttpManager getInstance() { |
| 55 | if (instance == null) { | 55 | if (instance == null) { |
| 56 | instance = new HttpManager(); | 56 | instance = new HttpManager(); |
| 57 | } | 57 | } |
| 58 | return instance; | 58 | return instance; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | //登录接口 | 62 | //登录接口 |
| 63 | 63 | ||
| 64 | public void login(final String username, final String password, final Context mContext) { | 64 | public void login(final String username, final String password, final Context mContext, final Handler handler) { |
| 65 | mProgress = DialogPermission.showProgress(mContext, null, "正在登录...", | 65 | mProgress = DialogPermission.showProgress(mContext, null, "正在登录...", |
| 66 | false, true, null); | 66 | false, true, null); |
| 67 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 67 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 68 | HttpClient.getInstance().get(HttpUrl.loginUrl + "?username=" + username + "&password=" + password, new AsyncHttpResponseHandler() { | 68 | HttpClient.getInstance().get(HttpUrl.loginUrl + "?username=" + username + "&password=" + password, new AsyncHttpResponseHandler() { |
| 69 | @Override | 69 | @Override |
| 70 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 70 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 71 | 71 | closeProgress(); | |
| 72 | String str = new String(arg2); | 72 | Message msg = Message.obtain(); |
| 73 | JSONObject jsonObject = null; | 73 | msg.what = HttpCode.LOGIN_SUCESS; |
| 74 | try { | 74 | msg.obj = new String(arg2); |
| 75 | jsonObject = new JSONObject(new String(arg2)); | 75 | handler.sendMessage(msg); |
| 76 | String status = jsonObject.getString("status"); | ||
| 77 | if (status.equals("100")) { | ||
| 78 | String access_token = jsonObject.getString("access_token"); | ||
| 79 | String userId = jsonObject.getString("userId"); | ||
| 80 | // //登录成功,保存登录数据并且获取个人信息 | ||
| 81 | saveLoginInfo(mContext, username, password, access_token, "true", userId); | ||
| 82 | //HttpManager.getInstance().getuserinfo(username,mContext); | ||
| 83 | |||
| 84 | } else if (status.equals("200")) { | ||
| 85 | closeProgress(); | ||
| 86 | Toast.makeText(mContext, "用户名不存在!", Toast.LENGTH_LONG).show(); | ||
| 87 | return; | ||
| 88 | } else if (status.equals("204")) { | ||
| 89 | closeProgress(); | ||
| 90 | Toast.makeText(mContext, "密码错误!", Toast.LENGTH_LONG).show(); | ||
| 91 | } else { | ||
| 92 | closeProgress(); | ||
| 93 | Toast.makeText(mContext, "登录失败!请检查网络", Toast.LENGTH_LONG).show(); | ||
| 94 | |||
| 95 | |||
| 96 | } | ||
| 97 | } catch (JSONException e) { | ||
| 98 | e.printStackTrace(); | ||
| 99 | } | ||
| 100 | 76 | ||
| 101 | 77 | ||
| 102 | } | 78 | } |
| 103 | 79 | ||
| 104 | @Override | 80 | @Override |
| 105 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 81 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 106 | closeProgress(); | 82 | closeProgress(); |
| 107 | new CircleDialog.Builder((FragmentActivity) mContext) | 83 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 108 | .setCanceledOnTouchOutside(false) | 84 | .setCanceledOnTouchOutside(false) |
| 109 | .setCancelable(false) | 85 | .setCancelable(false) |
| 110 | .setWidth(0.5f) | 86 | .setWidth(0.5f) |
| 111 | .configText(new ConfigText() { | 87 | .configText(new ConfigText() { |
| 112 | @Override | 88 | @Override |
| 113 | public void onConfig(TextParams params) { | 89 | public void onConfig(TextParams params) { |
| 114 | params.gravity = Gravity.CENTER; | 90 | params.gravity = Gravity.CENTER; |
| 115 | params.padding = new int[]{50, 50, 50, 50}; | 91 | params.padding = new int[]{50, 50, 50, 50}; |
| 116 | } | 92 | } |
| 117 | }) | 93 | }) |
| 118 | .setText("当前无网络,请检查网络设置") | 94 | .setText("当前无网络,请检查网络设置") |
| 119 | .setNegative("继续使用", null) | 95 | .setNegative("继续使用", null) |
| 120 | .setPositive("设置网络", new View.OnClickListener() { | 96 | .setPositive("设置网络", new View.OnClickListener() { |
| 121 | @Override | 97 | @Override |
| 122 | public void onClick(View v) { | 98 | public void onClick(View v) { |
| 123 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 99 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 124 | mContext.startActivity(intent); | 100 | mContext.startActivity(intent); |
| 125 | } | 101 | } |
| 126 | }) | 102 | }) |
| 127 | .show(); | 103 | .show(); |
| 128 | } | 104 | } |
| 129 | }); | 105 | }); |
| 130 | } | 106 | } |
| 131 | 107 | ||
| 132 | //注册接口 | 108 | //注册接口 |
| 133 | public void register(final Context context, String username, String password, String smscode, String source, final Handler handler) { | 109 | public void register(final Context context, String username, String password, String smscode, String source, final Handler handler) { |
| 134 | mProgress = DialogPermission.showProgress(context, null, "正在注册...", | 110 | mProgress = DialogPermission.showProgress(context, null, "正在注册...", |
| 135 | false, true, null); | 111 | false, true, null); |
| 136 | JSONObject jsonObject = new JSONObject(); | 112 | JSONObject jsonObject = new JSONObject(); |
| 137 | ByteArrayEntity entity = null; | 113 | ByteArrayEntity entity = null; |
| 138 | try { | 114 | try { |
| 139 | jsonObject.put(HttpKey.USERNAME, username); | 115 | jsonObject.put(HttpKey.USERNAME, username); |
| 140 | jsonObject.put(HttpKey.PASSWORD, password); | 116 | jsonObject.put(HttpKey.PASSWORD, password); |
| 141 | jsonObject.put(HttpKey.SMSCODE, smscode); | 117 | jsonObject.put(HttpKey.SMSCODE, smscode); |
| 142 | jsonObject.put(HttpKey.SOURCE, source); | 118 | jsonObject.put(HttpKey.SOURCE, source); |
| 143 | Log.e("test", "jsonObject" + jsonObject); | 119 | Log.e("test", "jsonObject" + jsonObject); |
| 144 | entity = new ByteArrayEntity(jsonObject.toString().getBytes("UTF-8")); | 120 | entity = new ByteArrayEntity(jsonObject.toString().getBytes("UTF-8")); |
| 145 | entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); | 121 | entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); |
| 146 | } catch (JSONException e) { | 122 | } catch (JSONException e) { |
| 147 | e.printStackTrace(); | 123 | e.printStackTrace(); |
| 148 | } catch (UnsupportedEncodingException e) { | 124 | } catch (UnsupportedEncodingException e) { |
| 149 | e.printStackTrace(); | 125 | e.printStackTrace(); |
| 150 | } | 126 | } |
| 151 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 127 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 152 | HttpClient.getInstance().post(context, HttpUrl.registeredUrl, entity, "application/json", new JsonHttpResponseHandler() { | 128 | HttpClient.getInstance().post(context, HttpUrl.registeredUrl, entity, "application/json", new JsonHttpResponseHandler() { |
| 153 | @Override | 129 | @Override |
| 154 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | 130 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { |
| 155 | super.onSuccess(statusCode, headers, response); | 131 | super.onSuccess(statusCode, headers, response); |
| 156 | closeProgress(); | 132 | closeProgress(); |
| 157 | Log.e("test", "onSuccess" + response); | 133 | Log.e("test", "onSuccess" + response); |
| 158 | Message msg = Message.obtain(); | 134 | Message msg = Message.obtain(); |
| 159 | msg.what = HttpCode.REGISTERED_SUCESS; | 135 | msg.what = HttpCode.REGISTERED_SUCESS; |
| 160 | msg.obj = response; | 136 | msg.obj = response; |
| 161 | handler.sendMessage(msg); | 137 | handler.sendMessage(msg); |
| 162 | 138 | ||
| 163 | } | 139 | } |
| 164 | 140 | ||
| 165 | @Override | 141 | @Override |
| 166 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { | 142 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { |
| 167 | super.onFailure(statusCode, headers, throwable, errorResponse); | 143 | super.onFailure(statusCode, headers, throwable, errorResponse); |
| 168 | closeProgress(); | 144 | closeProgress(); |
| 169 | Log.e("test", "onFailure" + errorResponse); | 145 | Log.e("test", "onFailure" + errorResponse); |
| 170 | new CircleDialog.Builder((FragmentActivity) context) | 146 | new CircleDialog.Builder((FragmentActivity) context) |
| 171 | .setCanceledOnTouchOutside(false) | 147 | .setCanceledOnTouchOutside(false) |
| 172 | .setCancelable(false) | 148 | .setCancelable(false) |
| 173 | .setWidth(0.5f) | 149 | .setWidth(0.5f) |
| 174 | .configText(new ConfigText() { | 150 | .configText(new ConfigText() { |
| 175 | @Override | 151 | @Override |
| 176 | public void onConfig(TextParams params) { | 152 | public void onConfig(TextParams params) { |
| 177 | params.gravity = Gravity.CENTER; | 153 | params.gravity = Gravity.CENTER; |
| 178 | params.padding = new int[]{50, 50, 50, 50}; | 154 | params.padding = new int[]{50, 50, 50, 50}; |
| 179 | } | 155 | } |
| 180 | }) | 156 | }) |
| 181 | .setText("当前无网络,请检查网络设置") | 157 | .setText("当前无网络,请检查网络设置") |
| 182 | .setNegative("继续使用", null) | 158 | .setNegative("继续使用", null) |
| 183 | .setPositive("设置网络", new View.OnClickListener() { | 159 | .setPositive("设置网络", new View.OnClickListener() { |
| 184 | @Override | 160 | @Override |
| 185 | public void onClick(View v) { | 161 | public void onClick(View v) { |
| 186 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 162 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 187 | context.startActivity(intent); | 163 | context.startActivity(intent); |
| 188 | } | 164 | } |
| 189 | }) | 165 | }) |
| 190 | .show(); | 166 | .show(); |
| 191 | } | 167 | } |
| 192 | 168 | ||
| 193 | }); | 169 | }); |
| 194 | } | 170 | } |
| 195 | 171 | ||
| 196 | //注册验证码 | 172 | //注册验证码 |
| 197 | public void authCode(final String type, final String mobile, final Handler handler, final Context mContext) { | 173 | public void authCode(final String type, final String mobile, final Handler handler, final Context mContext) { |
| 198 | RequestParams params = new RequestParams(); | 174 | RequestParams params = new RequestParams(); |
| 199 | params.put(HttpKey.TYPE, type); | 175 | params.put(HttpKey.TYPE, type); |
| 200 | params.put(HttpKey.MOBIL, mobile); | 176 | params.put(HttpKey.MOBIL, mobile); |
| 201 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 177 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 202 | HttpClient.getInstance().post(HttpUrl.authCodedUrl, params, new JsonHttpResponseHandler() { | 178 | HttpClient.getInstance().post(HttpUrl.authCodedUrl, params, new JsonHttpResponseHandler() { |
| 203 | 179 | ||
| 204 | @Override | 180 | @Override |
| 205 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | 181 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { |
| 206 | Log.e("test", "onSuccess-----" + response); | 182 | Log.e("test", "onSuccess-----" + response); |
| 207 | Message msg = Message.obtain(); | 183 | Message msg = Message.obtain(); |
| 208 | msg.what = HttpCode.AUTHCODE_SUCESS; | 184 | msg.what = HttpCode.AUTHCODE_SUCESS; |
| 209 | msg.obj = response; | 185 | msg.obj = response; |
| 210 | handler.sendMessage(msg); | 186 | handler.sendMessage(msg); |
| 211 | } | 187 | } |
| 212 | 188 | ||
| 213 | @Override | 189 | @Override |
| 214 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { | 190 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { |
| 215 | new CircleDialog.Builder((FragmentActivity) mContext) | 191 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 216 | .setCanceledOnTouchOutside(false) | 192 | .setCanceledOnTouchOutside(false) |
| 217 | .setCancelable(false) | 193 | .setCancelable(false) |
| 218 | .setWidth(0.5f) | 194 | .setWidth(0.5f) |
| 219 | .configText(new ConfigText() { | 195 | .configText(new ConfigText() { |
| 220 | @Override | 196 | @Override |
| 221 | public void onConfig(TextParams params) { | 197 | public void onConfig(TextParams params) { |
| 222 | params.gravity = Gravity.CENTER; | 198 | params.gravity = Gravity.CENTER; |
| 223 | params.padding = new int[]{50, 50, 50, 50}; | 199 | params.padding = new int[]{50, 50, 50, 50}; |
| 224 | } | 200 | } |
| 225 | }) | 201 | }) |
| 226 | .setText("当前无网络,请检查网络设置") | 202 | .setText("当前无网络,请检查网络设置") |
| 227 | .setNegative("继续使用", null) | 203 | .setNegative("继续使用", null) |
| 228 | .setPositive("设置网络", new View.OnClickListener() { | 204 | .setPositive("设置网络", new View.OnClickListener() { |
| 229 | @Override | 205 | @Override |
| 230 | public void onClick(View v) { | 206 | public void onClick(View v) { |
| 231 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 207 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 232 | mContext.startActivity(intent); | 208 | mContext.startActivity(intent); |
| 233 | } | 209 | } |
| 234 | }) | 210 | }) |
| 235 | .show(); | 211 | .show(); |
| 236 | } | 212 | } |
| 237 | }); | 213 | }); |
| 238 | } | 214 | } |
| 239 | 215 | ||
| 240 | 216 | ||
| 241 | //手机号是否注册 | 217 | //手机号是否注册 |
| 242 | public void isregistered(final String mobile, final Handler handler, final Context mContext) { | 218 | public void isregistered(final String mobile, final Handler handler, final Context mContext) { |
| 243 | RequestParams params = new RequestParams(); | 219 | RequestParams params = new RequestParams(); |
| 244 | params.put(HttpKey.USERNAME, mobile); | 220 | params.put(HttpKey.USERNAME, mobile); |
| 245 | HttpClient.getInstance().get(HttpUrl.isRegiterUrl + "?mobile=" + mobile, new JsonHttpResponseHandler() { | 221 | HttpClient.getInstance().get(HttpUrl.isRegiterUrl + "?mobile=" + mobile, new JsonHttpResponseHandler() { |
| 246 | @Override | 222 | @Override |
| 247 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | 223 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { |
| 248 | Log.e("test", "isregistered" + response.toString()); | 224 | Log.e("test", "isregistered" + response.toString()); |
| 249 | Message msg = Message.obtain(); | 225 | Message msg = Message.obtain(); |
| 250 | msg.what = HttpCode.IS_REFISTER; | 226 | msg.what = HttpCode.IS_REFISTER; |
| 251 | msg.obj = response; | 227 | msg.obj = response; |
| 252 | handler.sendMessage(msg); | 228 | handler.sendMessage(msg); |
| 253 | 229 | ||
| 254 | } | 230 | } |
| 255 | 231 | ||
| 256 | @Override | 232 | @Override |
| 257 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { | 233 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { |
| 258 | new CircleDialog.Builder((FragmentActivity) mContext) | 234 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 259 | .setCanceledOnTouchOutside(false) | 235 | .setCanceledOnTouchOutside(false) |
| 260 | .setCancelable(false) | 236 | .setCancelable(false) |
| 261 | .setWidth(0.5f) | 237 | .setWidth(0.5f) |
| 262 | .configText(new ConfigText() { | 238 | .configText(new ConfigText() { |
| 263 | @Override | 239 | @Override |
| 264 | public void onConfig(TextParams params) { | 240 | public void onConfig(TextParams params) { |
| 265 | params.gravity = Gravity.CENTER; | 241 | params.gravity = Gravity.CENTER; |
| 266 | params.padding = new int[]{50, 50, 50, 50}; | 242 | params.padding = new int[]{50, 50, 50, 50}; |
| 267 | } | 243 | } |
| 268 | }) | 244 | }) |
| 269 | .setText("当前无网络,请检查网络设置") | 245 | .setText("当前无网络,请检查网络设置") |
| 270 | .setNegative("继续使用", null) | 246 | .setNegative("继续使用", null) |
| 271 | .setPositive("设置网络", new View.OnClickListener() { | 247 | .setPositive("设置网络", new View.OnClickListener() { |
| 272 | @Override | 248 | @Override |
| 273 | public void onClick(View v) { | 249 | public void onClick(View v) { |
| 274 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 250 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 275 | mContext.startActivity(intent); | 251 | mContext.startActivity(intent); |
| 276 | } | 252 | } |
| 277 | }) | 253 | }) |
| 278 | .show(); | 254 | .show(); |
| 279 | 255 | ||
| 280 | } | 256 | } |
| 281 | }); | 257 | }); |
| 282 | } | 258 | } |
| 283 | 259 | ||
| 284 | //修改密码 | 260 | //修改密码 |
| 285 | public void changepwd(final Context context, String username, String old_pwd1, String newpassword3) { | 261 | public void changepwd(final Context context, String username, String old_pwd1, String newpassword3) { |
| 286 | RequestParams params = new RequestParams(); | 262 | RequestParams params = new RequestParams(); |
| 287 | params.put(HttpKey.USERNAME, username); | 263 | params.put(HttpKey.USERNAME, username); |
| 288 | params.put(HttpKey.OLDPASS, old_pwd1); | 264 | params.put(HttpKey.OLDPASS, old_pwd1); |
| 289 | params.put(HttpKey.NEWPASS, newpassword3); | 265 | params.put(HttpKey.NEWPASS, newpassword3); |
| 290 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 266 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 291 | HttpClient.getInstance().setTimeout(10 * 1000); | 267 | HttpClient.getInstance().setTimeout(10 * 1000); |
| 292 | HttpClient.getInstance().post(HttpUrl.changepassword, params, new AsyncHttpResponseHandler() { | 268 | HttpClient.getInstance().post(HttpUrl.changepassword, params, new AsyncHttpResponseHandler() { |
| 293 | @Override | 269 | @Override |
| 294 | public void onSuccess(int i, Header[] headers, byte[] bytes) { | 270 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
| 295 | try { | 271 | try { |
| 296 | JSONObject jsonObject = new JSONObject(new String(bytes)); | 272 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
| 297 | String status = jsonObject.optString("status"); | 273 | String status = jsonObject.optString("status"); |
| 298 | if (status.equals("100")) { | 274 | if (status.equals("100")) { |
| 299 | Log.e("test", "onSuccess" + new String(bytes)); | 275 | Log.e("test", "onSuccess" + new String(bytes)); |
| 300 | Toast.makeText(context, "密码修改成功!", Toast.LENGTH_LONG).show(); | 276 | Toast.makeText(context, "密码修改成功!", Toast.LENGTH_LONG).show(); |
| 301 | SaveParam.getInstance().clearData((Activity) context); | 277 | SaveParam.getInstance().clearData((Activity) context); |
| 302 | Intent intent = new Intent(); | 278 | Intent intent = new Intent(); |
| 303 | intent.setClass(context, LoginAndRegisterActivity.class); | 279 | intent.setClass(context, LoginAndRegisterActivity.class); |
| 304 | ((Activity) context).startActivity(intent); | 280 | ((Activity) context).startActivity(intent); |
| 305 | ((Activity) context).finish(); | 281 | ((Activity) context).finish(); |
| 306 | } | 282 | } |
| 307 | } catch (JSONException e) { | 283 | } catch (JSONException e) { |
| 308 | e.printStackTrace(); | 284 | e.printStackTrace(); |
| 309 | } | 285 | } |
| 310 | } | 286 | } |
| 311 | 287 | ||
| 312 | @Override | 288 | @Override |
| 313 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { | 289 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
| 314 | Log.e("test", "onFailure" + new String(bytes)); | 290 | Log.e("test", "onFailure" + new String(bytes)); |
| 315 | new CircleDialog.Builder((FragmentActivity) context) | 291 | new CircleDialog.Builder((FragmentActivity) context) |
| 316 | .setCanceledOnTouchOutside(false) | 292 | .setCanceledOnTouchOutside(false) |
| 317 | .setCancelable(false) | 293 | .setCancelable(false) |
| 318 | .setWidth(0.5f) | 294 | .setWidth(0.5f) |
| 319 | .configText(new ConfigText() { | 295 | .configText(new ConfigText() { |
| 320 | @Override | 296 | @Override |
| 321 | public void onConfig(TextParams params) { | 297 | public void onConfig(TextParams params) { |
| 322 | params.gravity = Gravity.CENTER; | 298 | params.gravity = Gravity.CENTER; |
| 323 | params.padding = new int[]{50, 50, 50, 50}; | 299 | params.padding = new int[]{50, 50, 50, 50}; |
| 324 | } | 300 | } |
| 325 | }) | 301 | }) |
| 326 | .setText("当前无网络,请检查网络设置") | 302 | .setText("当前无网络,请检查网络设置") |
| 327 | .setNegative("继续使用", null) | 303 | .setNegative("继续使用", null) |
| 328 | .setPositive("设置网络", new View.OnClickListener() { | 304 | .setPositive("设置网络", new View.OnClickListener() { |
| 329 | @Override | 305 | @Override |
| 330 | public void onClick(View v) { | 306 | public void onClick(View v) { |
| 331 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 307 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 332 | context.startActivity(intent); | 308 | context.startActivity(intent); |
| 333 | } | 309 | } |
| 334 | }) | 310 | }) |
| 335 | .show(); | 311 | .show(); |
| 336 | } | 312 | } |
| 337 | }); | 313 | }); |
| 338 | 314 | ||
| 339 | } | 315 | } |
| 340 | 316 | ||
| 341 | //忘记密码 | 317 | //忘记密码 |
| 342 | public void forgetpassword(final Context context, String forot_pwd_phone1, String forot_pwd_pwd3, String forot_pwd_anthcode1, Handler handler) { | 318 | public void forgetpassword(final Context context, String forot_pwd_phone1, String forot_pwd_pwd3, String forot_pwd_anthcode1, Handler handler) { |
| 343 | RequestParams params = new RequestParams(); | 319 | RequestParams params = new RequestParams(); |
| 344 | params.put(HttpKey.USERNAME, forot_pwd_phone1); | 320 | params.put(HttpKey.USERNAME, forot_pwd_phone1); |
| 345 | params.put(HttpKey.PASSWORD, forot_pwd_pwd3); | 321 | params.put(HttpKey.PASSWORD, forot_pwd_pwd3); |
| 346 | params.put(HttpKey.AUTHCODE, forot_pwd_anthcode1); | 322 | params.put(HttpKey.AUTHCODE, forot_pwd_anthcode1); |
| 347 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 323 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 348 | HttpClient.getInstance().post(HttpUrl.forgetpassword, params, new AsyncHttpResponseHandler() { | 324 | HttpClient.getInstance().post(HttpUrl.forgetpassword, params, new AsyncHttpResponseHandler() { |
| 349 | @Override | 325 | @Override |
| 350 | public void onSuccess(int i, Header[] headers, byte[] bytes) { | 326 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
| 351 | try { | 327 | try { |
| 352 | JSONObject jsonObject = new JSONObject(new String(bytes)); | 328 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
| 353 | String status = jsonObject.optString("status"); | 329 | String status = jsonObject.optString("status"); |
| 354 | if (status.equals("100")) { | 330 | if (status.equals("100")) { |
| 355 | Log.e("test", "onSuccess" + new String(bytes)); | 331 | Log.e("test", "onSuccess" + new String(bytes)); |
| 356 | Toast.makeText(context, "密码修改成功!", Toast.LENGTH_LONG).show(); | 332 | Toast.makeText(context, "密码修改成功!", Toast.LENGTH_LONG).show(); |
| 357 | ((Activity) context).finish(); | 333 | ((Activity) context).finish(); |
| 358 | } | 334 | } |
| 359 | } catch (JSONException e) { | 335 | } catch (JSONException e) { |
| 360 | e.printStackTrace(); | 336 | e.printStackTrace(); |
| 361 | } | 337 | } |
| 362 | } | 338 | } |
| 363 | 339 | ||
| 364 | @Override | 340 | @Override |
| 365 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { | 341 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
| 366 | Log.e("test", "onFailure" + new String(bytes)); | 342 | Log.e("test", "onFailure" + new String(bytes)); |
| 367 | new CircleDialog.Builder((FragmentActivity) context) | 343 | new CircleDialog.Builder((FragmentActivity) context) |
| 368 | .setCanceledOnTouchOutside(false) | 344 | .setCanceledOnTouchOutside(false) |
| 369 | .setCancelable(false) | 345 | .setCancelable(false) |
| 370 | .setWidth(0.5f) | 346 | .setWidth(0.5f) |
| 371 | .configText(new ConfigText() { | 347 | .configText(new ConfigText() { |
| 372 | @Override | 348 | @Override |
| 373 | public void onConfig(TextParams params) { | 349 | public void onConfig(TextParams params) { |
| 374 | params.gravity = Gravity.CENTER; | 350 | params.gravity = Gravity.CENTER; |
| 375 | params.padding = new int[]{50, 50, 50, 50}; | 351 | params.padding = new int[]{50, 50, 50, 50}; |
| 376 | } | 352 | } |
| 377 | }) | 353 | }) |
| 378 | .setText("当前无网络,请检查网络设置") | 354 | .setText("当前无网络,请检查网络设置") |
| 379 | .setNegative("继续使用", null) | 355 | .setNegative("继续使用", null) |
| 380 | .setPositive("设置网络", new View.OnClickListener() { | 356 | .setPositive("设置网络", new View.OnClickListener() { |
| 381 | @Override | 357 | @Override |
| 382 | public void onClick(View v) { | 358 | public void onClick(View v) { |
| 383 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 359 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 384 | context.startActivity(intent); | 360 | context.startActivity(intent); |
| 385 | } | 361 | } |
| 386 | }) | 362 | }) |
| 387 | .show(); | 363 | .show(); |
| 388 | } | 364 | } |
| 389 | }); | 365 | }); |
| 390 | 366 | ||
| 391 | } | 367 | } |
| 392 | 368 | ||
| 393 | //保存用户登录信息 | 369 | //保存用户登录信息 |
| 394 | public void saveLoginInfo(Context context, String username, String password, String access_token, String loginStatus, String userId) { | 370 | public void saveLoginInfo(Context context, String username, String password, String access_token, String loginStatus, String userId) { |
| 395 | SaveParam.getInstance().saveLoginParam(context, "username", username); | 371 | SaveParam.getInstance().saveLoginParam(context, "username", username); |
| 396 | SaveParam.getInstance().saveLoginParam(context, "password", password); | 372 | SaveParam.getInstance().saveLoginParam(context, "password", password); |
| 397 | SaveParam.getInstance().saveLoginParam(context, "access_token", access_token); | 373 | SaveParam.getInstance().saveLoginParam(context, "access_token", access_token); |
| 398 | SaveParam.getInstance().saveLoginParam(context, "login", loginStatus); | 374 | SaveParam.getInstance().saveLoginParam(context, "login", loginStatus); |
| 399 | SaveParam.getInstance().saveLoginParam(context, "userId", userId); | 375 | SaveParam.getInstance().saveLoginParam(context, "userId", userId); |
| 400 | 376 | ||
| 401 | 377 | ||
| 402 | } | 378 | } |
| 403 | 379 | ||
| 404 | //保存用户登录信息 | 380 | //保存用户登录信息 |
| 405 | public void savePresonInfo(Context context, String lastname, String gender, String mobilePortrait) { | 381 | public void savePresonInfo(Context context, String lastname, String gender, String mobilePortrait) { |
| 406 | SaveParam.getInstance().saveLoginParam(context, "lastname", lastname); | 382 | SaveParam.getInstance().saveLoginParam(context, "lastname", lastname); |
| 407 | SaveParam.getInstance().saveLoginParam(context, "gender", gender); | 383 | SaveParam.getInstance().saveLoginParam(context, "gender", gender); |
| 408 | SaveParam.getInstance().saveLoginParam(context, "mobilePortrait", mobilePortrait); | 384 | SaveParam.getInstance().saveLoginParam(context, "mobilePortrait", mobilePortrait); |
| 409 | } | 385 | } |
| 410 | 386 | ||
| 411 | //提交保卡信息 | 387 | //提交保卡信息 |
| 412 | public void subcardinfo(final Context context, int userId, String customerName, String customerAddress, | 388 | public void subcardinfo(final Context context, long userId, String customerName, String customerAddress, |
| 413 | String buyAddress, String buyTime, String alterSaleCall, | 389 | String buyAddress, String buyTime, String alterSaleCall, |
| 414 | String productModel, String deviceNumber, String macAddress, | 390 | String productModel, String deviceNumber, String macAddress, |
| 415 | String mobilePhone) { | 391 | String mobilePhone) { |
| 416 | mProgress = DialogPermission.showProgress(context, null, "正在绑定保卡...", | 392 | mProgress = DialogPermission.showProgress(context, null, "正在绑定保卡...", |
| 417 | false, true, null); | 393 | false, true, null); |
| 418 | RequestParams params = new RequestParams(); | 394 | RequestParams params = new RequestParams(); |
| 419 | 395 | ||
| 420 | params.put(HttpKey.USEID, userId); | 396 | params.put(HttpKey.USEID, userId); |
| 421 | params.put(HttpKey.CUSTOMENAME, customerName); | 397 | params.put(HttpKey.CUSTOMENAME, customerName); |
| 422 | params.put(HttpKey.CUSTOMADRESS, customerAddress); | 398 | params.put(HttpKey.CUSTOMADRESS, customerAddress); |
| 423 | params.put(HttpKey.BUYADREES, buyAddress); | 399 | params.put(HttpKey.BUYADREES, buyAddress); |
| 424 | params.put(HttpKey.BUYTIME, buyTime); | 400 | params.put(HttpKey.BUYTIME, buyTime); |
| 425 | params.put(HttpKey.ALTERSALECALL, alterSaleCall); | 401 | params.put(HttpKey.ALTERSALECALL, alterSaleCall); |
| 426 | params.put(HttpKey.PRODUCTMODEL, productModel); | 402 | params.put(HttpKey.PRODUCTMODEL, productModel); |
| 427 | params.put(HttpKey.DEVICENUMBER, deviceNumber); | 403 | params.put(HttpKey.DEVICENUMBER, deviceNumber); |
| 428 | params.put(HttpKey.MACADRESS, macAddress); | 404 | params.put(HttpKey.MACADRESS, macAddress); |
| 429 | params.put(HttpKey.MOBILPHONE, mobilePhone); | 405 | params.put(HttpKey.MOBILPHONE, mobilePhone); |
| 430 | 406 | ||
| 431 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 407 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 432 | 408 | ||
| 433 | Log.e("test", "params" + params); | 409 | Log.e("test", "params" + params); |
| 434 | HttpClient.getInstance().setTimeout(5 * 1000); | 410 | HttpClient.getInstance().setTimeout(5 * 1000); |
| 435 | HttpClient.getInstance().post(context, HttpUrl.subcardinfo, params, new AsyncHttpResponseHandler() { | 411 | HttpClient.getInstance().post(context, HttpUrl.subcardinfo, params, new AsyncHttpResponseHandler() { |
| 436 | @Override | 412 | @Override |
| 437 | public void onSuccess(int i, Header[] headers, byte[] bytes) { | 413 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
| 438 | JSONObject jsonObject = null; | 414 | JSONObject jsonObject = null; |
| 439 | closeProgress(); | 415 | closeProgress(); |
| 440 | try { | 416 | try { |
| 441 | jsonObject = new JSONObject(new String(bytes)); | 417 | jsonObject = new JSONObject(new String(bytes)); |
| 442 | String status = jsonObject.optString("status"); | 418 | String status = jsonObject.optString("status"); |
| 443 | if (status.equals("1")) { | 419 | if (status.equals("1")) { |
| 444 | Log.e("test", "onSuccess" + jsonObject); | 420 | Log.e("test", "onSuccess" + jsonObject); |
| 445 | Toast.makeText(context, "保卡绑定成功!", Toast.LENGTH_LONG).show(); | 421 | Toast.makeText(context, "保卡绑定成功!", Toast.LENGTH_LONG).show(); |
| 446 | Intent intent = new Intent(); | 422 | Intent intent = new Intent(); |
| 447 | intent.setClass((Activity) context, TheStartPageActivity.class); | 423 | intent.setClass((Activity) context, TheStartPageActivity.class); |
| 448 | ((Activity) context).startActivity(intent); | 424 | ((Activity) context).startActivity(intent); |
| 449 | ((Activity) context).overridePendingTransition(R.anim.rightin, R.anim.rightout); | 425 | ((Activity) context).overridePendingTransition(R.anim.rightin, R.anim.rightout); |
| 450 | ((Activity) context).finish(); | 426 | ((Activity) context).finish(); |
| 451 | } | 427 | } |
| 452 | } catch (JSONException e) { | 428 | } catch (JSONException e) { |
| 453 | e.printStackTrace(); | 429 | e.printStackTrace(); |
| 454 | } | 430 | } |
| 455 | 431 | ||
| 456 | 432 | ||
| 457 | } | 433 | } |
| 458 | 434 | ||
| 459 | @Override | 435 | @Override |
| 460 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { | 436 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
| 461 | Log.e("test", "onFailure" + (throwable)); | 437 | Log.e("test", "onFailure" + (throwable)); |
| 462 | closeProgress(); | 438 | closeProgress(); |
| 463 | new CircleDialog.Builder((FragmentActivity) context) | 439 | new CircleDialog.Builder((FragmentActivity) context) |
| 464 | .setCanceledOnTouchOutside(false) | 440 | .setCanceledOnTouchOutside(false) |
| 465 | .setCancelable(false) | 441 | .setCancelable(false) |
| 466 | .setWidth(0.5f) | 442 | .setWidth(0.5f) |
| 467 | .configText(new ConfigText() { | 443 | .configText(new ConfigText() { |
| 468 | @Override | 444 | @Override |
| 469 | public void onConfig(TextParams params) { | 445 | public void onConfig(TextParams params) { |
| 470 | params.gravity = Gravity.CENTER; | 446 | params.gravity = Gravity.CENTER; |
| 471 | params.padding = new int[]{50, 50, 50, 50}; | 447 | params.padding = new int[]{50, 50, 50, 50}; |
| 472 | } | 448 | } |
| 473 | }) | 449 | }) |
| 474 | .setText("当前无网络,请检查网络设置") | 450 | .setText("当前无网络,请检查网络设置") |
| 475 | .setNegative("继续使用", null) | 451 | .setNegative("继续使用", null) |
| 476 | .setPositive("设置网络", new View.OnClickListener() { | 452 | .setPositive("设置网络", new View.OnClickListener() { |
| 477 | @Override | 453 | @Override |
| 478 | public void onClick(View v) { | 454 | public void onClick(View v) { |
| 479 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 455 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 480 | context.startActivity(intent); | 456 | context.startActivity(intent); |
| 481 | } | 457 | } |
| 482 | }) | 458 | }) |
| 483 | .show(); | 459 | .show(); |
| 484 | 460 | ||
| 485 | } | 461 | } |
| 486 | }); | 462 | }); |
| 487 | 463 | ||
| 488 | } | 464 | } |
| 489 | //获取保卡信息 | 465 | //获取保卡信息 |
| 490 | public void getcardinfo(final Context mContext, int userId , final Handler handler) { | 466 | public void getcardinfo(final Context mContext, long userId , final Handler handler) { |
| 491 | mProgress = DialogPermission.showProgress(mContext, null, "正在获取保卡信息...", | 467 | mProgress = DialogPermission.showProgress(mContext, null, "正在获取保卡信息...", |
| 492 | false, true, null); | 468 | false, true, null); |
| 493 | HttpClient.getInstance().setTimeout(5 * 1000); | 469 | HttpClient.getInstance().setTimeout(5 * 1000); |
| 494 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 470 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 495 | HttpClient.getInstance().get(HttpUrl.getcardinfo+ "?userId=" + userId , new AsyncHttpResponseHandler() { | 471 | HttpClient.getInstance().get(HttpUrl.getcardinfo+ "?userId=" + userId , new AsyncHttpResponseHandler() { |
| 496 | @Override | 472 | @Override |
| 497 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 473 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 498 | closeProgress(); | 474 | closeProgress(); |
| 499 | Log.e("test", "保卡信息" + new String(arg2)); | 475 | Log.e("test", "保卡信息" + new String(arg2)); |
| 500 | CardInfo cardInfo = GsonTool.getPerson(new String(arg2), CardInfo.class);//解析json数据 | 476 | CardInfo cardInfo = GsonTool.getPerson(new String(arg2), CardInfo.class);//解析json数据 |
| 501 | CardInfo.DataBean schoolInfoBeanList = cardInfo.getData(); | 477 | CardInfo.DataBean schoolInfoBeanList = cardInfo.getData(); |
| 502 | Message msg = Message.obtain(); | 478 | Message msg = Message.obtain(); |
| 503 | msg.what = HttpCode.SUCHCARDINFO; | 479 | msg.what = HttpCode.SUCHCARDINFO; |
| 504 | msg.obj = schoolInfoBeanList; | 480 | msg.obj = schoolInfoBeanList; |
| 505 | handler.sendMessage(msg); | 481 | handler.sendMessage(msg); |
| 506 | } | 482 | } |
| 507 | 483 | ||
| 508 | @Override | 484 | @Override |
| 509 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 485 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 510 | closeProgress(); | 486 | closeProgress(); |
| 511 | new CircleDialog.Builder((FragmentActivity) mContext) | 487 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 512 | .setCanceledOnTouchOutside(false) | 488 | .setCanceledOnTouchOutside(false) |
| 513 | .setCancelable(false) | 489 | .setCancelable(false) |
| 514 | .setWidth(0.5f) | 490 | .setWidth(0.5f) |
| 515 | .configText(new ConfigText() { | 491 | .configText(new ConfigText() { |
| 516 | @Override | 492 | @Override |
| 517 | public void onConfig(TextParams params) { | 493 | public void onConfig(TextParams params) { |
| 518 | params.gravity = Gravity.CENTER; | 494 | params.gravity = Gravity.CENTER; |
| 519 | params.padding = new int[]{50, 50, 50, 50}; | 495 | params.padding = new int[]{50, 50, 50, 50}; |
| 520 | } | 496 | } |
| 521 | }) | 497 | }) |
| 522 | .setText("当前无网络,请检查网络设置") | 498 | .setText("当前无网络,请检查网络设置") |
| 523 | .setNegative("继续使用", null) | 499 | .setNegative("继续使用", null) |
| 524 | .setPositive("设置网络", new View.OnClickListener() { | 500 | .setPositive("设置网络", new View.OnClickListener() { |
| 525 | @Override | 501 | @Override |
| 526 | public void onClick(View v) { | 502 | public void onClick(View v) { |
| 527 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 503 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 528 | mContext.startActivity(intent); | 504 | mContext.startActivity(intent); |
| 529 | } | 505 | } |
| 530 | }) | 506 | }) |
| 531 | .show(); | 507 | .show(); |
| 532 | } | 508 | } |
| 533 | }); | 509 | }); |
| 534 | } | 510 | } |
| 535 | //修改保卡信息电话 | 511 | //修改保卡信息电话 |
| 536 | public void changecardinfophone(final Context mContext, int userId, final String customerPhone, String authCode) { | 512 | public void changecardinfophone(final Context mContext, long userId, final String customerPhone, String authCode) { |
| 537 | RequestParams params = new RequestParams(); | 513 | RequestParams params = new RequestParams(); |
| 538 | params.put("userId", userId); | 514 | params.put("userId", userId); |
| 539 | params.put("customerPhone", customerPhone); | 515 | params.put("customerPhone", customerPhone); |
| 540 | params.put("authCode", authCode); | 516 | params.put("authCode", authCode); |
| 541 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 517 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 542 | HttpClient.getInstance().post(HttpUrl.changecardinfo, params, new AsyncHttpResponseHandler() { | 518 | HttpClient.getInstance().post(HttpUrl.changecardinfo, params, new AsyncHttpResponseHandler() { |
| 543 | @Override | 519 | @Override |
| 544 | public void onSuccess(int i, Header[] headers, byte[] bytes) { | 520 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
| 545 | try { | 521 | try { |
| 546 | JSONObject jsonObject = new JSONObject(new String(bytes)); | 522 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
| 547 | String status = jsonObject.optString("status"); | 523 | String status = jsonObject.optString("status"); |
| 548 | if (status.equals("1")) { | 524 | if (status.equals("1")) { |
| 549 | Toast.makeText(mContext, "手机号修改成功", Toast.LENGTH_LONG).show(); | 525 | Toast.makeText(mContext, "手机号修改成功", Toast.LENGTH_LONG).show(); |
| 550 | SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.CARDPHONE, customerPhone); | 526 | SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.CARDPHONE, customerPhone); |
| 551 | ((Activity) mContext).finish(); | 527 | ((Activity) mContext).finish(); |
| 552 | }else if (status.equals("1001")){ | 528 | }else if (status.equals("1001")){ |
| 553 | Toast.makeText(mContext, "验证码输入错误", Toast.LENGTH_LONG).show(); | 529 | Toast.makeText(mContext, "验证码输入错误", Toast.LENGTH_LONG).show(); |
| 554 | } | 530 | } |
| 555 | } catch (JSONException e) { | 531 | } catch (JSONException e) { |
| 556 | e.printStackTrace(); | 532 | e.printStackTrace(); |
| 557 | } | 533 | } |
| 558 | } | 534 | } |
| 559 | 535 | ||
| 560 | @Override | 536 | @Override |
| 561 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { | 537 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
| 562 | Log.e("test", "onFailure" + new String(bytes)); | 538 | Log.e("test", "onFailure" + new String(bytes)); |
| 563 | new CircleDialog.Builder((FragmentActivity) mContext) | 539 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 564 | .setCanceledOnTouchOutside(false) | 540 | .setCanceledOnTouchOutside(false) |
| 565 | .setCancelable(false) | 541 | .setCancelable(false) |
| 566 | .setWidth(0.5f) | 542 | .setWidth(0.5f) |
| 567 | .configText(new ConfigText() { | 543 | .configText(new ConfigText() { |
| 568 | @Override | 544 | @Override |
| 569 | public void onConfig(TextParams params) { | 545 | public void onConfig(TextParams params) { |
| 570 | params.gravity = Gravity.CENTER; | 546 | params.gravity = Gravity.CENTER; |
| 571 | params.padding = new int[]{50, 50, 50, 50}; | 547 | params.padding = new int[]{50, 50, 50, 50}; |
| 572 | } | 548 | } |
| 573 | }) | 549 | }) |
| 574 | .setText("当前无网络,请检查网络设置") | 550 | .setText("当前无网络,请检查网络设置") |
| 575 | .setNegative("继续使用", null) | 551 | .setNegative("继续使用", null) |
| 576 | .setPositive("设置网络", new View.OnClickListener() { | 552 | .setPositive("设置网络", new View.OnClickListener() { |
| 577 | @Override | 553 | @Override |
| 578 | public void onClick(View v) { | 554 | public void onClick(View v) { |
| 579 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 555 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 580 | mContext.startActivity(intent); | 556 | mContext.startActivity(intent); |
| 581 | } | 557 | } |
| 582 | }) | 558 | }) |
| 583 | .show(); | 559 | .show(); |
| 584 | } | 560 | } |
| 585 | }); | 561 | }); |
| 586 | } | 562 | } |
| 587 | //修改保卡信息地址 | 563 | //修改保卡信息地址 |
| 588 | public void changecardadressinfo(final Context mContext, int userId, final String customerPhone, String authCode, final String customerAddress) { | 564 | public void changecardadressinfo(final Context mContext, long userId, final String customerPhone, String authCode, final String customerAddress) { |
| 589 | RequestParams params = new RequestParams(); | 565 | RequestParams params = new RequestParams(); |
| 590 | params.put("userId", userId); | 566 | params.put("userId", userId); |
| 591 | params.put("customerPhone", customerPhone); | 567 | params.put("customerPhone", customerPhone); |
| 592 | params.put("authCode", authCode); | 568 | params.put("authCode", authCode); |
| 593 | params.put("customerAddress", customerAddress); | 569 | params.put("customerAddress", customerAddress); |
| 594 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 570 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 595 | HttpClient.getInstance().post(HttpUrl.changecardinfo, params, new AsyncHttpResponseHandler() { | 571 | HttpClient.getInstance().post(HttpUrl.changecardinfo, params, new AsyncHttpResponseHandler() { |
| 596 | @Override | 572 | @Override |
| 597 | public void onSuccess(int i, Header[] headers, byte[] bytes) { | 573 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
| 598 | try { | 574 | try { |
| 599 | JSONObject jsonObject = new JSONObject(new String(bytes)); | 575 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
| 600 | String status = jsonObject.optString("status"); | 576 | String status = jsonObject.optString("status"); |
| 601 | if (status.equals("1")) { | 577 | if (status.equals("1")) { |
| 602 | Toast.makeText(mContext, "手机号修改成功", Toast.LENGTH_LONG).show(); | 578 | Toast.makeText(mContext, "手机号修改成功", Toast.LENGTH_LONG).show(); |
| 603 | SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.ADRESSCUNSTEM, customerAddress); | 579 | SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.ADRESSCUNSTEM, customerAddress); |
| 604 | ((Activity) mContext).finish(); | 580 | ((Activity) mContext).finish(); |
| 605 | } | 581 | } |
| 606 | } catch (JSONException e) { | 582 | } catch (JSONException e) { |
| 607 | e.printStackTrace(); | 583 | e.printStackTrace(); |
| 608 | } | 584 | } |
| 609 | } | 585 | } |
| 610 | 586 | ||
| 611 | @Override | 587 | @Override |
| 612 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { | 588 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
| 613 | Log.e("test", "onFailure" + new String(bytes)); | 589 | Log.e("test", "onFailure" + new String(bytes)); |
| 614 | new CircleDialog.Builder((FragmentActivity) mContext) | 590 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 615 | .setCanceledOnTouchOutside(false) | 591 | .setCanceledOnTouchOutside(false) |
| 616 | .setCancelable(false) | 592 | .setCancelable(false) |
| 617 | .setWidth(0.5f) | 593 | .setWidth(0.5f) |
| 618 | .configText(new ConfigText() { | 594 | .configText(new ConfigText() { |
| 619 | @Override | 595 | @Override |
| 620 | public void onConfig(TextParams params) { | 596 | public void onConfig(TextParams params) { |
| 621 | params.gravity = Gravity.CENTER; | 597 | params.gravity = Gravity.CENTER; |
| 622 | params.padding = new int[]{50, 50, 50, 50}; | 598 | params.padding = new int[]{50, 50, 50, 50}; |
| 623 | } | 599 | } |
| 624 | }) | 600 | }) |
| 625 | .setText("当前无网络,请检查网络设置") | 601 | .setText("当前无网络,请检查网络设置") |
| 626 | .setNegative("继续使用", null) | 602 | .setNegative("继续使用", null) |
| 627 | .setPositive("设置网络", new View.OnClickListener() { | 603 | .setPositive("设置网络", new View.OnClickListener() { |
| 628 | @Override | 604 | @Override |
| 629 | public void onClick(View v) { | 605 | public void onClick(View v) { |
| 630 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 606 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 631 | mContext.startActivity(intent); | 607 | mContext.startActivity(intent); |
| 632 | } | 608 | } |
| 633 | }) | 609 | }) |
| 634 | .show(); | 610 | .show(); |
| 635 | } | 611 | } |
| 636 | }); | 612 | }); |
| 637 | } | 613 | } |
| 638 | //验证是否保卡信息 | 614 | //验证是否保卡信息 |
| 639 | public void cardinfocheck(final Context mContext, int userId, final Handler handler) { | 615 | public void cardinfocheck(final Context mContext, long userId, final Handler handler) { |
| 616 | mProgress = DialogPermission.showProgress(mContext, null, "正在验证保卡信息...", | ||
| 617 | false, true, null); | ||
| 640 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 618 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 641 | HttpClient.getInstance().get(HttpUrl.cardcheck+ "?userId=" + userId, new AsyncHttpResponseHandler() { | 619 | HttpClient.getInstance().get(HttpUrl.cardcheck+ "?userId=" + userId, new AsyncHttpResponseHandler() { |
| 642 | @Override | 620 | @Override |
| 643 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 621 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 644 | Log.e("test", "---" + new String(arg2)); | 622 | Log.e("test", "---" + new String(arg2)); |
| 623 | closeProgress(); | ||
| 645 | Message msg = Message.obtain(); | 624 | Message msg = Message.obtain(); |
| 646 | msg.what = HttpCode.CHECKCARD; | 625 | msg.what = HttpCode.CHECKCARD; |
| 647 | msg.obj = new String(arg2); | 626 | msg.obj = new String(arg2); |
| 648 | handler.sendMessage(msg); | 627 | handler.sendMessage(msg); |
| 649 | } | 628 | } |
| 650 | 629 | ||
| 651 | @Override | 630 | @Override |
| 652 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 631 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 632 | closeProgress(); | ||
| 653 | new CircleDialog.Builder((FragmentActivity) mContext) | 633 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 654 | .setCanceledOnTouchOutside(false) | 634 | .setCanceledOnTouchOutside(false) |
| 655 | .setCancelable(false) | 635 | .setCancelable(false) |
| 656 | .configText(new ConfigText() { | 636 | .configText(new ConfigText() { |
| 657 | @Override | 637 | @Override |
| 658 | public void onConfig(TextParams params) { | 638 | public void onConfig(TextParams params) { |
| 659 | params.gravity = Gravity.CENTER; | 639 | params.gravity = Gravity.CENTER; |
| 660 | params.padding = new int[]{250, 50, 250, 50}; | 640 | params.padding = new int[]{250, 50, 250, 50}; |
| 661 | } | 641 | } |
| 662 | }) | 642 | }) |
| 663 | .setText("当前无网络,请检查网络设置") | 643 | .setText("当前无网络,请检查网络设置") |
| 664 | .setNegative("取消", null) | 644 | .setNegative("取消", null) |
| 665 | .setPositive("确定", new View.OnClickListener() { | 645 | .setPositive("确定", new View.OnClickListener() { |
| 666 | @Override | 646 | @Override |
| 667 | public void onClick(View v) { | 647 | public void onClick(View v) { |
| 668 | Intent intent = new Intent("/"); | 648 | Intent intent = new Intent("/"); |
| 669 | ComponentName cm = new ComponentName("com.android.settings","com.android.settings.WirelessSettings"); | 649 | ComponentName cm = new ComponentName("com.android.settings","com.android.settings.WirelessSettings"); |
| 670 | intent.setComponent(cm); | 650 | intent.setComponent(cm); |
| 671 | intent.setAction("android.intent.action.VIEW"); | 651 | intent.setAction("android.intent.action.VIEW"); |
| 672 | ((Activity) mContext).startActivityForResult( intent , 0); | 652 | ((Activity) mContext).startActivityForResult( intent , 0); |
| 673 | } | 653 | } |
| 674 | }) | 654 | }) |
| 675 | .show(); | 655 | .show(); |
| 676 | //Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); | 656 | //Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); |
| 677 | } | 657 | } |
| 678 | }); | 658 | }); |
| 679 | } | 659 | } |
| 680 | 660 | ||
| 681 | ///获取年级 | 661 | ///获取年级 |
| 682 | public void getgrade(final Context mContext, final Handler handler) { | 662 | public void getgrade(final Context mContext, final Handler handler) { |
| 683 | HttpClient.getInstance().addHeader("Accept", "application/json"); | 663 | HttpClient.getInstance().addHeader("Accept", "application/json"); |
| 684 | HttpClient.getInstance().get(HttpUrl.gradesUrl, new AsyncHttpResponseHandler() { | 664 | HttpClient.getInstance().get(HttpUrl.gradesUrl, new AsyncHttpResponseHandler() { |
| 685 | @Override | 665 | @Override |
| 686 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 666 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 687 | Log.e("test", "年级" + new String(arg2)); | 667 | Log.e("test", "年级" + new String(arg2)); |
| 688 | GradeInfo gradeInfo = GsonTool.getPerson(new String(arg2), GradeInfo.class);//解析json数据 | 668 | GradeInfo gradeInfo = GsonTool.getPerson(new String(arg2), GradeInfo.class);//解析json数据 |
| 689 | List<GradeInfo.DataBean.ChildrenBean> gradeInfoLists = new ArrayList<GradeInfo.DataBean.ChildrenBean>(); | 669 | List<GradeInfo.DataBean.ChildrenBean> gradeInfoLists = new ArrayList<GradeInfo.DataBean.ChildrenBean>(); |
| 690 | for (int i = 0 ;i<gradeInfo.getData().size()-2;i++) { | 670 | for (int i = 0 ;i<gradeInfo.getData().size()-2;i++) { |
| 691 | String name = gradeInfo.getData().get(i).getName(); | 671 | String name = gradeInfo.getData().get(i).getName(); |
| 692 | int id = gradeInfo.getData().get(i).getId(); | 672 | int id = gradeInfo.getData().get(i).getId(); |
| 693 | List<GradeInfo.DataBean.ChildrenBean> gradeinfoList = gradeInfo.getData().get(i).getChildren(); | 673 | List<GradeInfo.DataBean.ChildrenBean> gradeinfoList = gradeInfo.getData().get(i).getChildren(); |
| 694 | for (int j = 0; j < gradeinfoList.size(); j++) { | 674 | for (int j = 0; j < gradeinfoList.size(); j++) { |
| 695 | String secondname = gradeinfoList.get(j).getName(); | 675 | String secondname = gradeinfoList.get(j).getName(); |
| 696 | int secondid = gradeinfoList.get(j).getId(); | 676 | int secondid = gradeinfoList.get(j).getId(); |
| 697 | GradeInfo.DataBean.ChildrenBean dataBean = new GradeInfo.DataBean.ChildrenBean(); | 677 | GradeInfo.DataBean.ChildrenBean dataBean = new GradeInfo.DataBean.ChildrenBean(); |
| 698 | dataBean.setName(secondname); | 678 | dataBean.setName(secondname); |
| 699 | dataBean.setId(secondid); | 679 | dataBean.setId(secondid); |
| 700 | gradeInfoLists.add(dataBean); | 680 | gradeInfoLists.add(dataBean); |
| 701 | } | 681 | } |
| 702 | 682 | ||
| 703 | } | 683 | } |
| 704 | 684 | ||
| 705 | Message message = Message.obtain(); | 685 | Message message = Message.obtain(); |
| 706 | message.what = HttpCode.GRADER; | 686 | message.what = HttpCode.GRADER; |
| 707 | message.obj = gradeInfoLists; | 687 | message.obj = gradeInfoLists; |
| 708 | handler.sendMessage(message); | 688 | handler.sendMessage(message); |
| 709 | 689 | ||
| 710 | 690 | ||
| 711 | } | 691 | } |
| 712 | 692 | ||
| 713 | @Override | 693 | @Override |
| 714 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 694 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 715 | new CircleDialog.Builder((FragmentActivity) mContext) | 695 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 716 | .setCanceledOnTouchOutside(false) | 696 | .setCanceledOnTouchOutside(false) |
| 717 | .setCancelable(false) | 697 | .setCancelable(false) |
| 718 | .setWidth(0.5f) | 698 | .setWidth(0.5f) |
| 719 | .configText(new ConfigText() { | 699 | .configText(new ConfigText() { |
| 720 | @Override | 700 | @Override |
| 721 | public void onConfig(TextParams params) { | 701 | public void onConfig(TextParams params) { |
| 722 | params.gravity = Gravity.CENTER; | 702 | params.gravity = Gravity.CENTER; |
| 723 | params.padding = new int[]{50, 50, 50, 50}; | 703 | params.padding = new int[]{50, 50, 50, 50}; |
| 724 | } | 704 | } |
| 725 | }) | 705 | }) |
| 726 | .setText("当前无网络,请检查网络设置") | 706 | .setText("当前无网络,请检查网络设置") |
| 727 | .setNegative("继续使用", null) | 707 | .setNegative("继续使用", null) |
| 728 | .setPositive("设置网络", new View.OnClickListener() { | 708 | .setPositive("设置网络", new View.OnClickListener() { |
| 729 | @Override | 709 | @Override |
| 730 | public void onClick(View v) { | 710 | public void onClick(View v) { |
| 731 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 711 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 732 | mContext.startActivity(intent); | 712 | mContext.startActivity(intent); |
| 733 | } | 713 | } |
| 734 | }) | 714 | }) |
| 735 | .show(); | 715 | .show(); |
| 736 | } | 716 | } |
| 737 | }); | 717 | }); |
| 738 | } | 718 | } |
| 739 | 719 | ||
| 740 | /** | 720 | /** |
| 741 | * 获取学校 | 721 | * 获取学校 |
| 742 | * @param mContext | 722 | * @param mContext |
| 743 | * @param regionId | 723 | * @param regionId |
| 744 | * @param gradeId | 724 | * @param gradeId |
| 745 | * @param handler | 725 | * @param handler |
| 746 | */ | 726 | */ |
| 747 | public void getschool(final Context mContext, int regionId, int gradeId, final Handler handler) { | 727 | public void getschool(final Context mContext, int regionId, int gradeId, final Handler handler) { |
| 748 | HttpClient.getInstance().addHeader("Accept", "application/json"); | 728 | HttpClient.getInstance().addHeader("Accept", "application/json"); |
| 749 | HttpClient.getInstance().get(HttpUrl.schoolUrl+ "?regionId=" + regionId+ "&gradeId=" + gradeId, new AsyncHttpResponseHandler() { | 729 | HttpClient.getInstance().get(HttpUrl.schoolUrl+ "?regionId=" + regionId+ "&gradeId=" + gradeId, new AsyncHttpResponseHandler() { |
| 750 | @Override | 730 | @Override |
| 751 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 731 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 752 | Log.e("test", "学校" + new String(arg2)); | 732 | Log.e("test", "学校" + new String(arg2)); |
| 753 | SchoolInfo schoolInfo = GsonTool.getPerson(new String(arg2), SchoolInfo.class);//解析json数据 | 733 | SchoolInfo schoolInfo = GsonTool.getPerson(new String(arg2), SchoolInfo.class);//解析json数据 |
| 754 | List<SchoolInfo.DataBean> schoolInfoBeanList = schoolInfo.getData(); | 734 | List<SchoolInfo.DataBean> schoolInfoBeanList = schoolInfo.getData(); |
| 755 | Message message = Message.obtain(); | 735 | Message message = Message.obtain(); |
| 756 | message.what = HttpCode.SCHOOL; | 736 | message.what = HttpCode.SCHOOL; |
| 757 | message.obj = schoolInfoBeanList; | 737 | message.obj = schoolInfoBeanList; |
| 758 | handler.sendMessage(message); | 738 | handler.sendMessage(message); |
| 759 | 739 | ||
| 760 | } | 740 | } |
| 761 | 741 | ||
| 762 | @Override | 742 | @Override |
| 763 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 743 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 764 | new CircleDialog.Builder((FragmentActivity) mContext) | 744 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 765 | .setCanceledOnTouchOutside(false) | 745 | .setCanceledOnTouchOutside(false) |
| 766 | .setCancelable(false) | 746 | .setCancelable(false) |
| 767 | .setWidth(0.5f) | 747 | .setWidth(0.5f) |
| 768 | .configText(new ConfigText() { | 748 | .configText(new ConfigText() { |
| 769 | @Override | 749 | @Override |
| 770 | public void onConfig(TextParams params) { | 750 | public void onConfig(TextParams params) { |
| 771 | params.gravity = Gravity.CENTER; | 751 | params.gravity = Gravity.CENTER; |
| 772 | params.padding = new int[]{50, 50, 50, 50}; | 752 | params.padding = new int[]{50, 50, 50, 50}; |
| 773 | } | 753 | } |
| 774 | }) | 754 | }) |
| 775 | .setText("当前无网络,请检查网络设置") | 755 | .setText("当前无网络,请检查网络设置") |
| 776 | .setNegative("继续使用", null) | 756 | .setNegative("继续使用", null) |
| 777 | .setPositive("设置网络", new View.OnClickListener() { | 757 | .setPositive("设置网络", new View.OnClickListener() { |
| 778 | @Override | 758 | @Override |
| 779 | public void onClick(View v) { | 759 | public void onClick(View v) { |
| 780 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 760 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 781 | mContext.startActivity(intent); | 761 | mContext.startActivity(intent); |
| 782 | } | 762 | } |
| 783 | }) | 763 | }) |
| 784 | .show(); | 764 | .show(); |
| 785 | } | 765 | } |
| 786 | }); | 766 | }); |
| 787 | } | 767 | } |
| 788 | 768 | ||
| 789 | 769 | ||
| 790 | 770 | ||
| 791 | /** | 771 | /** |
| 792 | * 获取个人信息 | 772 | * 获取个人信息 |
| 793 | * @param mContext | 773 | * @param mContext |
| 794 | * @param userId | 774 | * @param userId |
| 795 | * @param handler | 775 | * @param handler |
| 796 | */ | 776 | */ |
| 797 | public void getpresonalinfo(final Context mContext, int userId, final Handler handler) { | 777 | public void getpresonalinfo(final Context mContext, long userId, final Handler handler) { |
| 798 | mProgress = DialogPermission.showProgress(mContext, null, "正在获取个人信息...", | 778 | mProgress = DialogPermission.showProgress(mContext, null, "正在获取个人信息...", |
| 799 | false, true, null); | 779 | false, true, null); |
| 800 | HttpClient.getInstance().addHeader("Accept", "application/json"); | 780 | HttpClient.getInstance().addHeader("Accept", "application/json"); |
| 781 | HttpClient.getInstance().setConnectTimeout(5*1000); | ||
| 801 | HttpClient.getInstance().get(HttpUrl.getpresonalinfo+ "?userId=" + userId, new AsyncHttpResponseHandler() { | 782 | HttpClient.getInstance().get(HttpUrl.getpresonalinfo+ "?userId=" + userId, new AsyncHttpResponseHandler() { |
| 802 | @Override | 783 | @Override |
| 803 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 784 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 804 | closeProgress(); | 785 | closeProgress(); |
| 805 | Log.e("test", "个人信息" + new String(arg2)); | 786 | Log.e("test", "个人信息" + new String(arg2)); |
| 806 | PesonalInfo pesonalInfo = GsonTool.getPerson(new String(arg2), PesonalInfo.class);//解析json数据 | 787 | PesonalInfo pesonalInfo = GsonTool.getPerson(new String(arg2), PesonalInfo.class);//解析json数据 |
| 807 | PesonalInfo.DataBean pesonalInfoBeanList = pesonalInfo.getData(); | 788 | PesonalInfo.DataBean pesonalInfoBeanList = pesonalInfo.getData(); |
| 808 | Message message = Message.obtain(); | 789 | Message message = Message.obtain(); |
| 809 | message.what = HttpCode.GETINFO; | 790 | message.what = HttpCode.GETINFO; |
| 810 | message.obj = pesonalInfoBeanList; | 791 | message.obj = pesonalInfoBeanList; |
| 811 | handler.sendMessage(message); | 792 | handler.sendMessage(message); |
| 812 | 793 | ||
| 813 | } | 794 | } |
| 814 | 795 | ||
| 815 | @Override | 796 | @Override |
| 816 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 797 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 817 | closeProgress(); | 798 | closeProgress(); |
| 818 | new CircleDialog.Builder((FragmentActivity) mContext) | 799 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 819 | .setCanceledOnTouchOutside(false) | 800 | .setCanceledOnTouchOutside(false) |
| 820 | .setCancelable(false) | 801 | .setCancelable(false) |
| 821 | .setWidth(0.5f) | 802 | .setWidth(0.5f) |
| 822 | .configText(new ConfigText() { | 803 | .configText(new ConfigText() { |
| 823 | @Override | 804 | @Override |
| 824 | public void onConfig(TextParams params) { | 805 | public void onConfig(TextParams params) { |
| 825 | params.gravity = Gravity.CENTER; | 806 | params.gravity = Gravity.CENTER; |
| 826 | params.padding = new int[]{50, 50, 50, 50}; | 807 | params.padding = new int[]{50, 50, 50, 50}; |
| 827 | } | 808 | } |
| 828 | }) | 809 | }) |
| 829 | .setText("当前无网络,请检查网络设置") | 810 | .setText("当前无网络,请检查网络设置") |
| 830 | .setNegative("继续使用", null) | 811 | .setNegative("继续使用", null) |
| 831 | .setPositive("设置网络", new View.OnClickListener() { | 812 | .setPositive("设置网络", new View.OnClickListener() { |
| 832 | @Override | 813 | @Override |
| 833 | public void onClick(View v) { | 814 | public void onClick(View v) { |
| 834 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 815 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 835 | mContext.startActivity(intent); | 816 | mContext.startActivity(intent); |
| 836 | } | 817 | } |
| 837 | }) | 818 | }) |
| 838 | .show(); | 819 | .show(); |
| 839 | } | 820 | } |
| 840 | }); | 821 | }); |
| 841 | } | 822 | } |
| 842 | //修改个人信息 | 823 | //修改个人信息 |
| 843 | public void changepresonalinfo(final Context mContext, Object object) throws UnsupportedEncodingException { | 824 | public void changepresonalinfo(final Context mContext, Object object) throws UnsupportedEncodingException { |
| 844 | Gson gson = new Gson(); | 825 | Gson gson = new Gson(); |
| 845 | String jsonObject = gson.toJson(object); | 826 | String jsonObject = gson.toJson(object); |
| 846 | Log.e("test", "onSuccess" + jsonObject); | 827 | Log.e("test", "onSuccess" + jsonObject); |
| 847 | mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...", | 828 | mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...", |
| 848 | false, true, null); | 829 | false, true, null); |
| 849 | ByteArrayEntity entity = null; | 830 | ByteArrayEntity entity = null; |
| 850 | entity = new ByteArrayEntity(jsonObject.getBytes("UTF-8")); | 831 | entity = new ByteArrayEntity(jsonObject.getBytes("UTF-8")); |
| 851 | entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); | 832 | entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); |
| 852 | 833 | ||
| 853 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 834 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 854 | HttpClient.getInstance().put(mContext, HttpUrl.changepresonalinfo, entity, "application/json", new JsonHttpResponseHandler() { | 835 | HttpClient.getInstance().put(mContext, HttpUrl.changepresonalinfo, entity, "application/json", new JsonHttpResponseHandler() { |
| 855 | @Override | 836 | @Override |
| 856 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | 837 | public void onSuccess(int statusCode, Header[] headers, JSONObject response) { |
| 857 | super.onSuccess(statusCode, headers, response); | 838 | super.onSuccess(statusCode, headers, response); |
| 858 | closeProgress(); | 839 | closeProgress(); |
| 859 | String status = response.optString("status"); | 840 | String status = response.optString("status"); |
| 860 | if (status.equals("1")) { | 841 | if (status.equals("1")) { |
| 861 | Toast.makeText(mContext, "个人信息保存成功", Toast.LENGTH_LONG).show(); | 842 | Toast.makeText(mContext, "个人信息保存成功", Toast.LENGTH_LONG).show(); |
| 862 | ((Activity) mContext).finish(); | 843 | ((Activity) mContext).finish(); |
| 863 | } | 844 | } |
| 864 | Log.e("test", "onSuccess" + response); | 845 | Log.e("test", "onSuccess" + response); |
| 865 | 846 | ||
| 866 | } | 847 | } |
| 867 | 848 | ||
| 868 | @Override | 849 | @Override |
| 869 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { | 850 | public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { |
| 870 | super.onFailure(statusCode, headers, throwable, errorResponse); | 851 | super.onFailure(statusCode, headers, throwable, errorResponse); |
| 871 | closeProgress(); | 852 | closeProgress(); |
| 872 | Log.e("test", "onFailure" + errorResponse); | 853 | Log.e("test", "onFailure" + errorResponse); |
| 873 | new CircleDialog.Builder((FragmentActivity) mContext) | 854 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 874 | .setCanceledOnTouchOutside(false) | 855 | .setCanceledOnTouchOutside(false) |
| 875 | .setCancelable(false) | 856 | .setCancelable(false) |
| 876 | .setWidth(0.5f) | 857 | .setWidth(0.5f) |
| 877 | .configText(new ConfigText() { | 858 | .configText(new ConfigText() { |
| 878 | @Override | 859 | @Override |
| 879 | public void onConfig(TextParams params) { | 860 | public void onConfig(TextParams params) { |
| 880 | params.gravity = Gravity.CENTER; | 861 | params.gravity = Gravity.CENTER; |
| 881 | params.padding = new int[]{50, 50, 50, 50}; | 862 | params.padding = new int[]{50, 50, 50, 50}; |
| 882 | } | 863 | } |
| 883 | }) | 864 | }) |
| 884 | .setText("当前无网络,请检查网络设置") | 865 | .setText("当前无网络,请检查网络设置") |
| 885 | .setNegative("继续使用", null) | 866 | .setNegative("继续使用", null) |
| 886 | .setPositive("设置网络", new View.OnClickListener() { | 867 | .setPositive("设置网络", new View.OnClickListener() { |
| 887 | @Override | 868 | @Override |
| 888 | public void onClick(View v) { | 869 | public void onClick(View v) { |
| 889 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 870 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 890 | mContext.startActivity(intent); | 871 | mContext.startActivity(intent); |
| 891 | } | 872 | } |
| 892 | }) | 873 | }) |
| 893 | .show(); | 874 | .show(); |
| 894 | } | 875 | } |
| 895 | 876 | ||
| 896 | }); | 877 | }); |
| 897 | } | 878 | } |
| 898 | //修改个性签名 | 879 | //修改个性签名 |
| 899 | public void changsignature(final Context mContext, int userId, final String signature) { | 880 | public void changsignature(final Context mContext, long userId, final String signature) { |
| 900 | RequestParams params = new RequestParams(); | 881 | RequestParams params = new RequestParams(); |
| 901 | params.put("userId", userId); | 882 | params.put("userId", userId); |
| 902 | params.put("signature", signature); | 883 | params.put("signature", signature); |
| 903 | HttpClient.getInstance().addHeader("Accept", "*/*"); | 884 | HttpClient.getInstance().addHeader("Accept", "*/*"); |
| 904 | HttpClient.getInstance().post(HttpUrl.signature, params, new AsyncHttpResponseHandler() { | 885 | HttpClient.getInstance().post(HttpUrl.signature, params, new AsyncHttpResponseHandler() { |
| 905 | @Override | 886 | @Override |
| 906 | public void onSuccess(int i, Header[] headers, byte[] bytes) { | 887 | public void onSuccess(int i, Header[] headers, byte[] bytes) { |
| 907 | try { | 888 | try { |
| 908 | JSONObject jsonObject = new JSONObject(new String(bytes)); | 889 | JSONObject jsonObject = new JSONObject(new String(bytes)); |
| 909 | String status = jsonObject.optString("status"); | 890 | String status = jsonObject.optString("status"); |
| 910 | if (status.equals("1")) { | 891 | if (status.equals("1")) { |
| 911 | Toast.makeText(mContext, "个性签名修改成功", Toast.LENGTH_LONG).show(); | 892 | Toast.makeText(mContext, "个性签名修改成功", Toast.LENGTH_LONG).show(); |
| 912 | } | 893 | } |
| 913 | } catch (JSONException e) { | 894 | } catch (JSONException e) { |
| 914 | e.printStackTrace(); | 895 | e.printStackTrace(); |
| 915 | } | 896 | } |
| 916 | } | 897 | } |
| 917 | 898 | ||
| 918 | @Override | 899 | @Override |
| 919 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { | 900 | public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { |
| 920 | Log.e("test", "onFailure" + new String(bytes)); | 901 | Log.e("test", "onFailure" + new String(bytes)); |
| 921 | new CircleDialog.Builder((FragmentActivity) mContext) | 902 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 922 | .setCanceledOnTouchOutside(false) | 903 | .setCanceledOnTouchOutside(false) |
| 923 | .setCancelable(false) | 904 | .setCancelable(false) |
| 924 | .setWidth(0.5f) | 905 | .setWidth(0.5f) |
| 925 | .configText(new ConfigText() { | 906 | .configText(new ConfigText() { |
| 926 | @Override | 907 | @Override |
| 927 | public void onConfig(TextParams params) { | 908 | public void onConfig(TextParams params) { |
| 928 | params.gravity = Gravity.CENTER; | 909 | params.gravity = Gravity.CENTER; |
| 929 | params.padding = new int[]{50, 50, 50, 50}; | 910 | params.padding = new int[]{50, 50, 50, 50}; |
| 930 | } | 911 | } |
| 931 | }) | 912 | }) |
| 932 | .setText("当前无网络,请检查网络设置") | 913 | .setText("当前无网络,请检查网络设置") |
| 933 | .setNegative("继续使用", null) | 914 | .setNegative("继续使用", null) |
| 934 | .setPositive("设置网络", new View.OnClickListener() { | 915 | .setPositive("设置网络", new View.OnClickListener() { |
| 935 | @Override | 916 | @Override |
| 936 | public void onClick(View v) { | 917 | public void onClick(View v) { |
| 937 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 918 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 938 | mContext.startActivity(intent); | 919 | mContext.startActivity(intent); |
| 939 | } | 920 | } |
| 940 | }) | 921 | }) |
| 941 | .show(); | 922 | .show(); |
| 942 | } | 923 | } |
| 943 | }); | 924 | }); |
| 944 | } | 925 | } |
| 945 | 926 | ||
| 946 | /** | 927 | /** |
| 947 | * 获取个性签名 | 928 | * 获取个性签名 |
| 948 | * @param mContext | 929 | * @param mContext |
| 949 | * @param userId | 930 | * @param userId |
| 950 | * @param handler | 931 | * @param handler |
| 951 | */ | 932 | */ |
| 952 | public void getsignatures(final Context mContext,int userId , final Handler handler) { | 933 | public void getsignatures(final Context mContext,long userId , final Handler handler) { |
| 953 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 934 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 954 | HttpClient.getInstance().get(HttpUrl.getsignature+"?userId="+userId, new AsyncHttpResponseHandler() { | 935 | HttpClient.getInstance().get(HttpUrl.getsignature+"?userId="+userId, new AsyncHttpResponseHandler() { |
| 955 | @Override | 936 | @Override |
| 956 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 937 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 957 | Log.e("test", "个性签名" + new String(arg2)); | 938 | Log.e("test", "个性签名" + new String(arg2)); |
| 958 | SignInfo signInfo = GsonTool.getPerson(new String(arg2), SignInfo.class);//解析json数据 | 939 | SignInfo signInfo = GsonTool.getPerson(new String(arg2), SignInfo.class);//解析json数据 |
| 959 | SignInfo.DataBean signInfoBeanList = signInfo.getData(); | 940 | SignInfo.DataBean signInfoBeanList = signInfo.getData(); |
| 960 | Message message = Message.obtain(); | 941 | Message message = Message.obtain(); |
| 961 | message.what = HttpCode.SIGN; | 942 | message.what = HttpCode.SIGN; |
| 962 | message.obj = signInfoBeanList; | 943 | message.obj = signInfoBeanList; |
| 963 | handler.sendMessage(message); | 944 | handler.sendMessage(message); |
| 964 | 945 | ||
| 965 | } | 946 | } |
| 966 | 947 | ||
| 967 | @Override | 948 | @Override |
| 968 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 949 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 969 | Log.e("test", "失败原因" + arg3); | 950 | Log.e("test", "失败原因" + arg3); |
| 970 | new CircleDialog.Builder((FragmentActivity) mContext) | 951 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 971 | .setCanceledOnTouchOutside(false) | 952 | .setCanceledOnTouchOutside(false) |
| 972 | .setCancelable(false) | 953 | .setCancelable(false) |
| 973 | .setWidth(0.5f) | 954 | .setWidth(0.5f) |
| 974 | .configText(new ConfigText() { | 955 | .configText(new ConfigText() { |
| 975 | @Override | 956 | @Override |
| 976 | public void onConfig(TextParams params) { | 957 | public void onConfig(TextParams params) { |
| 977 | params.gravity = Gravity.CENTER; | 958 | params.gravity = Gravity.CENTER; |
| 978 | params.padding = new int[]{50, 50, 50, 50}; | 959 | params.padding = new int[]{50, 50, 50, 50}; |
| 979 | } | 960 | } |
| 980 | }) | 961 | }) |
| 981 | .setText("当前无网络,请检查网络设置") | 962 | .setText("当前无网络,请检查网络设置") |
| 982 | .setNegative("继续使用", null) | 963 | .setNegative("继续使用", null) |
| 983 | .setPositive("设置网络", new View.OnClickListener() { | 964 | .setPositive("设置网络", new View.OnClickListener() { |
| 984 | @Override | 965 | @Override |
| 985 | public void onClick(View v) { | 966 | public void onClick(View v) { |
| 986 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 967 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 987 | mContext.startActivity(intent); | 968 | mContext.startActivity(intent); |
| 988 | } | 969 | } |
| 989 | }) | 970 | }) |
| 990 | .show(); | 971 | .show(); |
| 991 | } | 972 | } |
| 992 | }); | 973 | }); |
| 993 | } | 974 | } |
| 994 | 975 | ||
| 995 | 976 | ||
| 996 | 977 | ||
| 997 | 978 | ||
| 998 | 979 | ||
| 999 | ///省级接口 | 980 | ///省级接口 |
| 1000 | public void provices(final Context mContext, final Handler handler) { | 981 | public void provices(final Context mContext, final Handler handler) { |
| 1001 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 982 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 1002 | HttpClient.getInstance().get(HttpUrl.provinceUrl, new AsyncHttpResponseHandler() { | 983 | HttpClient.getInstance().get(HttpUrl.provinceUrl, new AsyncHttpResponseHandler() { |
| 1003 | @Override | 984 | @Override |
| 1004 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 985 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 1005 | Log.e("test", "省" + new String(arg2)); | 986 | Log.e("test", "省" + new String(arg2)); |
| 1006 | ProvinceInfo provinceInfo = GsonTool.getPerson(new String(arg2), ProvinceInfo.class);//解析json数据 | 987 | ProvinceInfo provinceInfo = GsonTool.getPerson(new String(arg2), ProvinceInfo.class);//解析json数据 |
| 1007 | Log.e("test", "状态码" + provinceInfo.getStatus()); | 988 | Log.e("test", "状态码" + provinceInfo.getStatus()); |
| 1008 | List<ProvinceInfo.ProvincesBean> provincesBeanList = provinceInfo.getProvinces(); | 989 | List<ProvinceInfo.ProvincesBean> provincesBeanList = provinceInfo.getProvinces(); |
| 1009 | Message message = Message.obtain(); | 990 | Message message = Message.obtain(); |
| 1010 | message.what = HttpCode.PROVICES; | 991 | message.what = HttpCode.PROVICES; |
| 1011 | message.obj = provincesBeanList; | 992 | message.obj = provincesBeanList; |
| 1012 | handler.sendMessage(message); | 993 | handler.sendMessage(message); |
| 1013 | 994 | ||
| 1014 | } | 995 | } |
| 1015 | 996 | ||
| 1016 | @Override | 997 | @Override |
| 1017 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 998 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 1018 | new CircleDialog.Builder((FragmentActivity) mContext) | 999 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 1019 | .setCanceledOnTouchOutside(false) | 1000 | .setCanceledOnTouchOutside(false) |
| 1020 | .setCancelable(false) | 1001 | .setCancelable(false) |
| 1021 | .setWidth(0.5f) | 1002 | .setWidth(0.5f) |
| 1022 | .configText(new ConfigText() { | 1003 | .configText(new ConfigText() { |
| 1023 | @Override | 1004 | @Override |
| 1024 | public void onConfig(TextParams params) { | 1005 | public void onConfig(TextParams params) { |
| 1025 | params.gravity = Gravity.CENTER; | 1006 | params.gravity = Gravity.CENTER; |
| 1026 | params.padding = new int[]{50, 50, 50, 50}; | 1007 | params.padding = new int[]{50, 50, 50, 50}; |
| 1027 | } | 1008 | } |
| 1028 | }) | 1009 | }) |
| 1029 | .setText("当前无网络,请检查网络设置") | 1010 | .setText("当前无网络,请检查网络设置") |
| 1030 | .setNegative("继续使用", null) | 1011 | .setNegative("继续使用", null) |
| 1031 | .setPositive("设置网络", new View.OnClickListener() { | 1012 | .setPositive("设置网络", new View.OnClickListener() { |
| 1032 | @Override | 1013 | @Override |
| 1033 | public void onClick(View v) { | 1014 | public void onClick(View v) { |
| 1034 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 1015 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 1035 | mContext.startActivity(intent); | 1016 | mContext.startActivity(intent); |
| 1036 | } | 1017 | } |
| 1037 | }) | 1018 | }) |
| 1038 | .show(); | 1019 | .show(); |
| 1039 | } | 1020 | } |
| 1040 | }); | 1021 | }); |
| 1041 | } | 1022 | } |
| 1042 | 1023 | ||
| 1043 | //市级接口 | 1024 | //市级接口 |
| 1044 | public void cityinfo(final Context mContext, long regionId , final Handler handler) { | 1025 | public void cityinfo(final Context mContext, long regionId , final Handler handler) { |
| 1045 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 1026 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 1046 | HttpClient.getInstance().get(HttpUrl.cityUrl + "?regionId=" + regionId, new AsyncHttpResponseHandler() { | 1027 | HttpClient.getInstance().get(HttpUrl.cityUrl + "?regionId=" + regionId, new AsyncHttpResponseHandler() { |
| 1047 | @Override | 1028 | @Override |
| 1048 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 1029 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 1049 | Log.e("test", "市" + new String(arg2)); | 1030 | Log.e("test", "市" + new String(arg2)); |
| 1050 | Gson gson = new Gson(); | 1031 | Gson gson = new Gson(); |
| 1051 | CityInfo cityInfo = gson.fromJson(new String(arg2), CityInfo.class); | 1032 | CityInfo cityInfo = gson.fromJson(new String(arg2), CityInfo.class); |
| 1052 | List<CityInfo.CitiesBean> cityInfoBeanList = cityInfo.getCities(); | 1033 | List<CityInfo.CitiesBean> cityInfoBeanList = cityInfo.getCities(); |
| 1053 | Message message = Message.obtain(); | 1034 | Message message = Message.obtain(); |
| 1054 | message.what = HttpCode.CITYS; | 1035 | message.what = HttpCode.CITYS; |
| 1055 | message.obj = cityInfoBeanList; | 1036 | message.obj = cityInfoBeanList; |
| 1056 | handler.sendMessage(message); | 1037 | handler.sendMessage(message); |
| 1057 | 1038 | ||
| 1058 | 1039 | ||
| 1059 | } | 1040 | } |
| 1060 | 1041 | ||
| 1061 | @Override | 1042 | @Override |
| 1062 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 1043 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 1063 | new CircleDialog.Builder((FragmentActivity) mContext) | 1044 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 1064 | .setCanceledOnTouchOutside(false) | 1045 | .setCanceledOnTouchOutside(false) |
| 1065 | .setCancelable(false) | 1046 | .setCancelable(false) |
| 1066 | .setWidth(0.5f) | 1047 | .setWidth(0.5f) |
| 1067 | .configText(new ConfigText() { | 1048 | .configText(new ConfigText() { |
| 1068 | @Override | 1049 | @Override |
| 1069 | public void onConfig(TextParams params) { | 1050 | public void onConfig(TextParams params) { |
| 1070 | params.gravity = Gravity.CENTER; | 1051 | params.gravity = Gravity.CENTER; |
| 1071 | params.padding = new int[]{50, 50, 50, 50}; | 1052 | params.padding = new int[]{50, 50, 50, 50}; |
| 1072 | } | 1053 | } |
| 1073 | }) | 1054 | }) |
| 1074 | .setText("当前无网络,请检查网络设置") | 1055 | .setText("当前无网络,请检查网络设置") |
| 1075 | .setNegative("继续使用", null) | 1056 | .setNegative("继续使用", null) |
| 1076 | .setPositive("设置网络", new View.OnClickListener() { | 1057 | .setPositive("设置网络", new View.OnClickListener() { |
| 1077 | @Override | 1058 | @Override |
| 1078 | public void onClick(View v) { | 1059 | public void onClick(View v) { |
| 1079 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 1060 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 1080 | mContext.startActivity(intent); | 1061 | mContext.startActivity(intent); |
| 1081 | } | 1062 | } |
| 1082 | }) | 1063 | }) |
| 1083 | .show(); | 1064 | .show(); |
| 1084 | } | 1065 | } |
| 1085 | }); | 1066 | }); |
| 1086 | } | 1067 | } |
| 1087 | 1068 | ||
| 1088 | //区县级接口 | 1069 | //区县级接口 |
| 1089 | public void countyinfo(final Context mContext, int parentId, final Handler handler) { | 1070 | public void countyinfo(final Context mContext, int parentId, final Handler handler) { |
| 1090 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | 1071 | HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| 1091 | HttpClient.getInstance().get(HttpUrl.countyUrl + "?regionId=" + parentId, new AsyncHttpResponseHandler() { | 1072 | HttpClient.getInstance().get(HttpUrl.countyUrl + "?regionId=" + parentId, new AsyncHttpResponseHandler() { |
| 1092 | @Override | 1073 | @Override |
| 1093 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | 1074 | public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { |
| 1094 | Log.e("test", "区" + new String(arg2)); | 1075 | Log.e("test", "区" + new String(arg2)); |
| 1095 | Gson gson = new Gson(); | 1076 | Gson gson = new Gson(); |
| 1096 | CountyInfo countyInfo = gson.fromJson(new String(arg2), CountyInfo.class); | 1077 | CountyInfo countyInfo = gson.fromJson(new String(arg2), CountyInfo.class); |
| 1097 | List<CountyInfo.CountiesBean> countyInfoInfoBeanList = countyInfo.getCounties(); | 1078 | List<CountyInfo.CountiesBean> countyInfoInfoBeanList = countyInfo.getCounties(); |
| 1098 | Message message = Message.obtain(); | 1079 | Message message = Message.obtain(); |
| 1099 | message.what = HttpCode.COUNTRY; | 1080 | message.what = HttpCode.COUNTRY; |
| 1100 | message.obj = countyInfoInfoBeanList; | 1081 | message.obj = countyInfoInfoBeanList; |
| 1101 | handler.sendMessage(message); | 1082 | handler.sendMessage(message); |
| 1102 | 1083 | ||
| 1103 | 1084 | ||
| 1104 | } | 1085 | } |
| 1105 | 1086 | ||
| 1106 | @Override | 1087 | @Override |
| 1107 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | 1088 | public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { |
| 1108 | new CircleDialog.Builder((FragmentActivity) mContext) | 1089 | new CircleDialog.Builder((FragmentActivity) mContext) |
| 1109 | .setCanceledOnTouchOutside(false) | 1090 | .setCanceledOnTouchOutside(false) |
| 1110 | .setCancelable(false) | 1091 | .setCancelable(false) |
| 1111 | .setWidth(0.5f) | 1092 | .setWidth(0.5f) |
| 1112 | .configText(new ConfigText() { | 1093 | .configText(new ConfigText() { |
| 1113 | @Override | 1094 | @Override |
| 1114 | public void onConfig(TextParams params) { | 1095 | public void onConfig(TextParams params) { |
| 1115 | params.gravity = Gravity.CENTER; | 1096 | params.gravity = Gravity.CENTER; |
| 1116 | params.padding = new int[]{50, 50, 50, 50}; | 1097 | params.padding = new int[]{50, 50, 50, 50}; |
| 1117 | } | 1098 | } |
| 1118 | }) | 1099 | }) |
| 1119 | .setText("当前无网络,请检查网络设置") | 1100 | .setText("当前无网络,请检查网络设置") |
| 1120 | .setNegative("继续使用", null) | 1101 | .setNegative("继续使用", null) |
| 1121 | .setPositive("设置网络", new View.OnClickListener() { | 1102 | .setPositive("设置网络", new View.OnClickListener() { |
| 1122 | @Override | 1103 | @Override |
| 1123 | public void onClick(View v) { | 1104 | public void onClick(View v) { |
| 1124 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | 1105 | Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 |
| 1125 | mContext.startActivity(intent); | 1106 | mContext.startActivity(intent); |
| 1126 | } | 1107 | } |
| 1127 | }) | 1108 | }) |
| 1128 | .show(); | 1109 | .show(); |
| 1129 | } | 1110 | } |
| 1130 | }); | 1111 | }); |
| 1131 | } | 1112 | } |
| 1132 | 1113 | ||
| 1133 | 1114 | ||
| 1134 | private void closeProgress() { | 1115 | private void closeProgress() { |
| 1135 | try { | 1116 | try { |
| 1136 | if (mProgress != null) { | 1117 | if (mProgress != null) { |
| 1137 | mProgress.dismiss(); | 1118 | mProgress.dismiss(); |
| 1138 | mProgress = null; | 1119 | mProgress = null; |
| 1139 | } | 1120 | } |
| 1140 | } catch (Exception e) { | 1121 | } catch (Exception e) { |
| 1141 | e.printStackTrace(); | 1122 | e.printStackTrace(); |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/CardInfo.java
| 1 | package com.hjx.personalcenter.model; | 1 | package com.hjx.personalcenter.model; |
| 2 | 2 | ||
| 3 | /** | 3 | /** |
| 4 | * Created by h on 2017/8/18. | 4 | * Created by h on 2017/8/18. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | public class CardInfo { | 7 | public class CardInfo { |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | * status : 1 | 10 | * status : 1 |
| 11 | * pageSize : 1 | 11 | * pageSize : 1 |
| 12 | * data : {"customerName":"FuQiang","createTime":"2017-08-01 13:21:00","mobilePhone":"13162530008","buyTime":"2017-08-01 12:23:50","productModel":"GT-N7100","buyAddress":"HaojixingZhengZhou","customerAddress":"HeNamZhengSheng","alterSaleCall":"4022210201","macAddress":"00:22:F4:93:7A:B\n","deviceNumber":"A909A90997011012"} | 12 | * data : {"customerName":"FuQiang","createTime":"2017-08-01 13:21:00","mobilePhone":"13162530008","buyTime":"2017-08-01 12:23:50","productModel":"GT-N7100","buyAddress":"HaojixingZhengZhou","customerAddress":"HeNamZhengSheng","alterSaleCall":"4022210201","macAddress":"00:22:F4:93:7A:B\n","deviceNumber":"A909A90997011012"} |
| 13 | * msg : success | 13 | * msg : success |
| 14 | * pageNum : 9 | 14 | * pageNum : 9 |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | private int status; | 17 | private int status; |
| 18 | private int pageSize; | 18 | private int pageSize; |
| 19 | private DataBean data; | 19 | private DataBean data; |
| 20 | private String msg; | 20 | private String msg; |
| 21 | private int pageNum; | 21 | private int pageNum; |
| 22 | 22 | ||
| 23 | public int getStatus() { | 23 | public int getStatus() { |
| 24 | return status; | 24 | return status; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | public void setStatus(int status) { | 27 | public void setStatus(int status) { |
| 28 | this.status = status; | 28 | this.status = status; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | public int getPageSize() { | 31 | public int getPageSize() { |
| 32 | return pageSize; | 32 | return pageSize; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | public void setPageSize(int pageSize) { | 35 | public void setPageSize(int pageSize) { |
| 36 | this.pageSize = pageSize; | 36 | this.pageSize = pageSize; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | public DataBean getData() { | 39 | public DataBean getData() { |
| 40 | return data; | 40 | return data; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | public void setData(DataBean data) { | 43 | public void setData(DataBean data) { |
| 44 | this.data = data; | 44 | this.data = data; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | public String getMsg() { | 47 | public String getMsg() { |
| 48 | return msg; | 48 | return msg; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | public void setMsg(String msg) { | 51 | public void setMsg(String msg) { |
| 52 | this.msg = msg; | 52 | this.msg = msg; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | public int getPageNum() { | 55 | public int getPageNum() { |
| 56 | return pageNum; | 56 | return pageNum; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | public void setPageNum(int pageNum) { | 59 | public void setPageNum(int pageNum) { |
| 60 | this.pageNum = pageNum; | 60 | this.pageNum = pageNum; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | public static class DataBean { | 63 | public static class DataBean { |
| 64 | /** | 64 | /** |
| 65 | * customerName : FuQiang | 65 | * customerName : FuQiang |
| 66 | * createTime : 2017-08-01 13:21:00 | 66 | * createTime : 2017-08-01 13:21:00 |
| 67 | * mobilePhone : 13162530008 | 67 | * mobilePhone : 13162530008 |
| 68 | * buyTime : 2017-08-01 12:23:50 | 68 | * buyTime : 2017-08-01 12:23:50 |
| 69 | * productModel : GT-N7100 | 69 | * productModel : GT-N7100 |
| 70 | * buyAddress : HaojixingZhengZhou | 70 | * buyAddress : HaojixingZhengZhou |
| 71 | * customerAddress : HeNamZhengSheng | 71 | * customerAddress : HeNamZhengSheng |
| 72 | * alterSaleCall : 4022210201 | 72 | * alterSaleCall : 4022210201 |
| 73 | * macAddress : 00:22:F4:93:7A:B | 73 | * macAddress : 00:22:F4:93:7A:B |
| 74 | 74 | ||
| 75 | * deviceNumber : A909A90997011012 | 75 | * deviceNumber : A909A90997011012 |
| 76 | */ | 76 | */ |
| 77 | 77 | ||
| 78 | private String customerName; | 78 | private String customerName; |
| 79 | private String createTime; | 79 | private String createTime; |
| 80 | private String mobilePhone; | 80 | private String customerPhone; |
| 81 | private String buyTime; | 81 | private String buyTime; |
| 82 | private String productModel; | 82 | private String productModel; |
| 83 | private String buyAddress; | 83 | private String buyAddress; |
| 84 | private String customerAddress; | 84 | private String customerAddress; |
| 85 | private String alterSaleCall; | 85 | private String alterSaleCall; |
| 86 | private String macAddress; | 86 | private String macAddress; |
| 87 | private String deviceNumber; | 87 | private String deviceNumber; |
| 88 | 88 | ||
| 89 | public String getCustomerName() { | 89 | public String getCustomerName() { |
| 90 | return customerName; | 90 | return customerName; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | public void setCustomerName(String customerName) { | 93 | public void setCustomerName(String customerName) { |
| 94 | this.customerName = customerName; | 94 | this.customerName = customerName; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | public String getCreateTime() { | 97 | public String getCreateTime() { |
| 98 | return createTime; | 98 | return createTime; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | public void setCreateTime(String createTime) { | 101 | public void setCreateTime(String createTime) { |
| 102 | this.createTime = createTime; | 102 | this.createTime = createTime; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | public String getMobilePhone() { | 105 | public String getMobilePhone() { |
| 106 | return mobilePhone; | 106 | return customerPhone; |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | public void setMobilePhone(String mobilePhone) { | 109 | public void setMobilePhone(String mobilePhone) { |
| 110 | this.mobilePhone = mobilePhone; | 110 | this.customerPhone = mobilePhone; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | public String getBuyTime() { | 113 | public String getBuyTime() { |
| 114 | return buyTime; | 114 | return buyTime; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | public void setBuyTime(String buyTime) { | 117 | public void setBuyTime(String buyTime) { |
| 118 | this.buyTime = buyTime; | 118 | this.buyTime = buyTime; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | public String getProductModel() { | 121 | public String getProductModel() { |
| 122 | return productModel; | 122 | return productModel; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | public void setProductModel(String productModel) { | 125 | public void setProductModel(String productModel) { |
| 126 | this.productModel = productModel; | 126 | this.productModel = productModel; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | public String getBuyAddress() { | 129 | public String getBuyAddress() { |
| 130 | return buyAddress; | 130 | return buyAddress; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | public void setBuyAddress(String buyAddress) { | 133 | public void setBuyAddress(String buyAddress) { |
| 134 | this.buyAddress = buyAddress; | 134 | this.buyAddress = buyAddress; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | public String getCustomerAddress() { | 137 | public String getCustomerAddress() { |
| 138 | return customerAddress; | 138 | return customerAddress; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | public void setCustomerAddress(String customerAddress) { | 141 | public void setCustomerAddress(String customerAddress) { |
| 142 | this.customerAddress = customerAddress; | 142 | this.customerAddress = customerAddress; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | public String getAlterSaleCall() { | 145 | public String getAlterSaleCall() { |
| 146 | return alterSaleCall; | 146 | return alterSaleCall; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | public void setAlterSaleCall(String alterSaleCall) { | 149 | public void setAlterSaleCall(String alterSaleCall) { |
| 150 | this.alterSaleCall = alterSaleCall; | 150 | this.alterSaleCall = alterSaleCall; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | public String getMacAddress() { | 153 | public String getMacAddress() { |
| 154 | return macAddress; | 154 | return macAddress; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | public void setMacAddress(String macAddress) { | 157 | public void setMacAddress(String macAddress) { |
| 158 | this.macAddress = macAddress; | 158 | this.macAddress = macAddress; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | public String getDeviceNumber() { | 161 | public String getDeviceNumber() { |
| 162 | return deviceNumber; | 162 | return deviceNumber; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | public void setDeviceNumber(String deviceNumber) { | 165 | public void setDeviceNumber(String deviceNumber) { |
| 166 | this.deviceNumber = deviceNumber; | 166 | this.deviceNumber = deviceNumber; |
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | } | 169 | } |
| 170 | 170 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/SignInfo.java
| 1 | package com.hjx.personalcenter.model; | 1 | package com.hjx.personalcenter.model; |
| 2 | 2 | ||
| 3 | import java.io.Serializable; | 3 | import java.io.Serializable; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | * Created by h on 2017/8/23. | 6 | * Created by h on 2017/8/23. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | public class SignInfo implements Serializable{ | 9 | public class SignInfo implements Serializable{ |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * status : 1 | 12 | * status : 1 |
| 13 | * pageSize : 0 | 13 | * pageSize : 0 |
| 14 | * data : {"userId":645,"signature":"I Love You,WSQ"} | 14 | * data : {"userId":222222222243,"signature":"广告广告广告费"} |
| 15 | * msg : success | 15 | * msg : success |
| 16 | * pageNum : 0 | 16 | * pageNum : 0 |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | private int status; | 19 | private int status; |
| 20 | private int pageSize; | 20 | private int pageSize; |
| 21 | private DataBean data; | 21 | private DataBean data; |
| 22 | private String msg; | 22 | private String msg; |
| 23 | private int pageNum; | 23 | private int pageNum; |
| 24 | 24 | ||
| 25 | public int getStatus() { | 25 | public int getStatus() { |
| 26 | return status; | 26 | return status; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | public void setStatus(int status) { | 29 | public void setStatus(int status) { |
| 30 | this.status = status; | 30 | this.status = status; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | public int getPageSize() { | 33 | public int getPageSize() { |
| 34 | return pageSize; | 34 | return pageSize; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | public void setPageSize(int pageSize) { | 37 | public void setPageSize(int pageSize) { |
| 38 | this.pageSize = pageSize; | 38 | this.pageSize = pageSize; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | public DataBean getData() { | 41 | public DataBean getData() { |
| 42 | return data; | 42 | return data; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | public void setData(DataBean data) { | 45 | public void setData(DataBean data) { |
| 46 | this.data = data; | 46 | this.data = data; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | public String getMsg() { | 49 | public String getMsg() { |
| 50 | return msg; | 50 | return msg; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | public void setMsg(String msg) { | 53 | public void setMsg(String msg) { |
| 54 | this.msg = msg; | 54 | this.msg = msg; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | public int getPageNum() { | 57 | public int getPageNum() { |
| 58 | return pageNum; | 58 | return pageNum; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | public void setPageNum(int pageNum) { | 61 | public void setPageNum(int pageNum) { |
| 62 | this.pageNum = pageNum; | 62 | this.pageNum = pageNum; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | public static class DataBean { | 65 | public static class DataBean { |
| 66 | /** | 66 | /** |
| 67 | * userId : 645 | 67 | * userId : 222222222243 |
| 68 | * signature : I Love You,WSQ | 68 | * signature : 广告广告广告费 |
| 69 | */ | 69 | */ |
| 70 | 70 | ||
| 71 | private int userId; | 71 | private long userId; |
| 72 | private String signature; | 72 | private String signature; |
| 73 | 73 | ||
| 74 | public int getUserId() { | 74 | public long getUserId() { |
| 75 | return userId; | 75 | return userId; |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | public void setUserId(int userId) { | 78 | public void setUserId(long userId) { |
| 79 | this.userId = userId; | 79 | this.userId = userId; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | public String getSignature() { | 82 | public String getSignature() { |
| 83 | return signature; | 83 | return signature; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | public void setSignature(String signature) { | 86 | public void setSignature(String signature) { |
| 87 | this.signature = signature; | 87 | this.signature = signature; |
| 88 | } | 88 | } |
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/BigPictrueUtil.java
| File was created | 1 | package com.hjx.personalcenter.util; | |
| 2 | |||
| 3 | /** | ||
| 4 | * Created by h on 2017/8/24. | ||
| 5 | */ | ||
| 6 | |||
| 7 | public class BigPictrueUtil { | ||
| 8 | |||
| 9 | |||
| 10 | } | ||
| 11 |
PersonalCenter/app/src/main/res/layout/activity_account_management.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | android:orientation="vertical" | 3 | android:orientation="vertical" |
| 4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
| 5 | android:layout_height="match_parent"> | 5 | android:layout_height="match_parent"> |
| 6 | <RelativeLayout | 6 | <RelativeLayout |
| 7 | android:id="@+id/title" | 7 | android:id="@+id/title" |
| 8 | android:layout_width="match_parent" | 8 | android:layout_width="match_parent" |
| 9 | android:layout_height="wrap_content" | 9 | android:layout_height="wrap_content" |
| 10 | android:background="@color/login_text_blue" | 10 | android:background="@color/login_text_blue" |
| 11 | android:minHeight="50dp" > | 11 | android:minHeight="50dp" > |
| 12 | 12 | ||
| 13 | <ImageView | 13 | <ImageView |
| 14 | android:id="@+id/cancel" | 14 | android:id="@+id/cancel" |
| 15 | android:layout_width="wrap_content" | 15 | android:layout_width="wrap_content" |
| 16 | android:layout_height="wrap_content" | 16 | android:layout_height="wrap_content" |
| 17 | android:layout_centerVertical="true" | 17 | android:layout_centerVertical="true" |
| 18 | android:paddingLeft="20dp" | 18 | android:paddingLeft="20dp" |
| 19 | android:paddingRight="20dp" | 19 | android:paddingRight="20dp" |
| 20 | android:src="@mipmap/title_back" /> | 20 | android:src="@mipmap/title_back" /> |
| 21 | 21 | ||
| 22 | <TextView | 22 | <TextView |
| 23 | android:id="@+id/menu_title" | 23 | android:id="@+id/menu_title" |
| 24 | android:layout_width="wrap_content" | 24 | android:layout_width="wrap_content" |
| 25 | android:layout_height="wrap_content" | 25 | android:layout_height="wrap_content" |
| 26 | android:layout_centerInParent="true" | 26 | android:layout_centerInParent="true" |
| 27 | android:text="@string/account_management" | 27 | android:text="@string/account_management" |
| 28 | android:textColor="@android:color/white" | 28 | android:textColor="@android:color/white" |
| 29 | android:textSize="22sp" /> | 29 | android:textSize="22sp" /> |
| 30 | </RelativeLayout> | 30 | </RelativeLayout> |
| 31 | <LinearLayout | 31 | <LinearLayout |
| 32 | android:layout_width="wrap_content" | 32 | android:layout_width="wrap_content" |
| 33 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
| 34 | android:orientation="horizontal" | 34 | android:orientation="horizontal" |
| 35 | android:layout_margin="20dp" | 35 | android:layout_margin="20dp" |
| 36 | android:gravity="center_vertical"> | 36 | android:gravity="center_vertical"> |
| 37 | <View | 37 | <View |
| 38 | android:layout_width="5dp" | 38 | android:layout_width="5dp" |
| 39 | android:layout_height="20dp" | 39 | android:layout_height="20dp" |
| 40 | android:background="@color/login_text_blue"> | 40 | android:background="@color/login_text_blue"> |
| 41 | 41 | ||
| 42 | </View> | 42 | </View> |
| 43 | <TextView | 43 | <TextView |
| 44 | android:layout_width="wrap_content" | 44 | android:layout_width="wrap_content" |
| 45 | android:layout_height="wrap_content" | 45 | android:layout_height="wrap_content" |
| 46 | android:text="账户安全" | 46 | android:text="账户安全" |
| 47 | android:layout_marginLeft="5dp" | 47 | android:layout_marginLeft="5dp" |
| 48 | android:textSize="22sp" | 48 | android:textSize="22sp" |
| 49 | /> | 49 | /> |
| 50 | 50 | ||
| 51 | </LinearLayout> | 51 | </LinearLayout> |
| 52 | <LinearLayout | 52 | <LinearLayout |
| 53 | android:layout_width="match_parent" | 53 | android:layout_width="match_parent" |
| 54 | android:layout_height="wrap_content" | 54 | android:layout_height="wrap_content" |
| 55 | android:layout_marginLeft="60dp" | 55 | android:layout_marginLeft="60dp" |
| 56 | android:orientation="vertical"> | 56 | android:orientation="vertical"> |
| 57 | <LinearLayout | 57 | <LinearLayout |
| 58 | android:layout_width="match_parent" | 58 | android:layout_width="match_parent" |
| 59 | android:layout_height="wrap_content"> | 59 | android:layout_height="wrap_content"> |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | <TextView | 62 | <TextView |
| 63 | android:layout_width="0dp" | 63 | android:layout_width="0dp" |
| 64 | android:layout_height="wrap_content" | 64 | android:layout_height="wrap_content" |
| 65 | android:layout_weight="1.5" | 65 | android:layout_weight="1.5" |
| 66 | android:textSize="22sp" | 66 | android:textSize="22sp" |
| 67 | android:text="当前绑定手机号"/> | 67 | android:text="当前绑定手机号"/> |
| 68 | <TextView | 68 | <TextView |
| 69 | android:id="@+id/cunt_username" | ||
| 69 | android:layout_width="0dp" | 70 | android:layout_width="0dp" |
| 70 | android:layout_height="wrap_content" | 71 | android:layout_height="wrap_content" |
| 71 | android:layout_marginLeft="50dp" | 72 | android:layout_marginLeft="50dp" |
| 72 | android:layout_weight="6" | 73 | android:layout_weight="6" |
| 73 | android:textSize="22sp" | 74 | android:textSize="22sp" |
| 74 | android:text="123556677"/> | 75 | android:text=""/> |
| 75 | <TextView | 76 | <TextView |
| 76 | android:id="@+id/changBangding" | 77 | android:id="@+id/changBangding" |
| 77 | android:layout_width="0dp" | 78 | android:layout_width="0dp" |
| 78 | android:layout_height="wrap_content" | 79 | android:layout_height="wrap_content" |
| 79 | android:layout_weight="1" | 80 | android:layout_weight="1" |
| 80 | android:textSize="22sp" | 81 | android:textSize="22sp" |
| 81 | android:text="更换绑定"/> | 82 | android:text="更换绑定"/> |
| 82 | <ImageView | 83 | <ImageView |
| 83 | android:layout_width="wrap_content" | 84 | android:layout_width="wrap_content" |
| 84 | android:layout_height="wrap_content" | 85 | android:layout_height="wrap_content" |
| 85 | android:layout_weight="0.1" | 86 | android:layout_weight="0.1" |
| 86 | android:padding="10dp" | 87 | android:padding="10dp" |
| 87 | android:src="@mipmap/youjiantou"/> | 88 | android:src="@mipmap/youjiantou"/> |
| 88 | </LinearLayout> | 89 | </LinearLayout> |
| 89 | <LinearLayout | 90 | <LinearLayout |
| 90 | android:layout_width="match_parent" | 91 | android:layout_width="match_parent" |
| 91 | android:layout_marginTop="30dp" | 92 | android:layout_marginTop="30dp" |
| 92 | android:layout_height="wrap_content"> | 93 | android:layout_height="wrap_content"> |
| 93 | 94 | ||
| 94 | 95 | ||
| 95 | <TextView | 96 | <TextView |
| 96 | android:layout_width="0dp" | 97 | android:layout_width="0dp" |
| 97 | android:layout_height="wrap_content" | 98 | android:layout_height="wrap_content" |
| 98 | android:layout_weight="1.5" | 99 | android:layout_weight="1.5" |
| 99 | android:textSize="22sp" | 100 | android:textSize="22sp" |
| 100 | android:text="登录密码"/> | 101 | android:text="登录密码"/> |
| 101 | <TextView | 102 | <TextView |
| 102 | android:layout_width="0dp" | 103 | android:layout_width="0dp" |
| 103 | android:layout_height="wrap_content" | 104 | android:layout_height="wrap_content" |
| 104 | android:layout_marginLeft="50dp" | 105 | android:layout_marginLeft="50dp" |
| 105 | android:layout_weight="6" | 106 | android:layout_weight="6" |
| 106 | android:textSize="22sp" | 107 | android:textSize="22sp" |
| 107 | android:text="已设置"/> | 108 | android:text="已设置"/> |
| 108 | <TextView | 109 | <TextView |
| 109 | android:id="@+id/changpassword" | 110 | android:id="@+id/changpassword" |
| 110 | android:layout_width="0dp" | 111 | android:layout_width="0dp" |
| 111 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
| 112 | android:layout_weight="1" | 113 | android:layout_weight="1" |
| 113 | android:textSize="22sp" | 114 | android:textSize="22sp" |
| 114 | android:text="修改密码"/> | 115 | android:text="修改密码"/> |
| 115 | <ImageView | 116 | <ImageView |
| 116 | android:layout_width="wrap_content" | 117 | android:layout_width="wrap_content" |
| 117 | android:layout_height="wrap_content" | 118 | android:layout_height="wrap_content" |
| 118 | android:layout_weight="0.1" | 119 | android:layout_weight="0.1" |
| 119 | android:padding="10dp" | 120 | android:padding="10dp" |
| 120 | android:src="@mipmap/youjiantou"/> | 121 | android:src="@mipmap/youjiantou"/> |
| 121 | </LinearLayout> | 122 | </LinearLayout> |
| 122 | 123 | ||
| 123 | </LinearLayout> | 124 | </LinearLayout> |
| 124 | 125 | ||
| 125 | <View | 126 | <View |
| 126 | android:layout_width="match_parent" | 127 | android:layout_width="match_parent" |
| 127 | android:layout_margin="20dp" | 128 | android:layout_margin="20dp" |
| 128 | android:layout_height="0.7dp" | 129 | android:layout_height="0.7dp" |
| 129 | android:background="#FF909090" /> | 130 | android:background="#FF909090" /> |
| 130 | <LinearLayout | 131 | <LinearLayout |
| 131 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
| 132 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
| 133 | android:orientation="horizontal" | 134 | android:orientation="horizontal" |
| 134 | android:layout_margin="20dp" | 135 | android:layout_margin="20dp" |
| 135 | android:gravity="center_vertical"> | 136 | android:gravity="center_vertical"> |
| 136 | <View | 137 | <View |
| 137 | android:layout_width="5dp" | 138 | android:layout_width="5dp" |
| 138 | android:layout_height="20dp" | 139 | android:layout_height="20dp" |
| 139 | android:background="@color/login_text_blue"> | 140 | android:background="@color/login_text_blue"> |
| 140 | 141 | ||
| 141 | </View> | 142 | </View> |
| 142 | <TextView | 143 | <TextView |
| 143 | android:layout_width="wrap_content" | 144 | android:layout_width="wrap_content" |
| 144 | android:layout_height="wrap_content" | 145 | android:layout_height="wrap_content" |
| 145 | android:text="子账户管理" | 146 | android:text="子账户管理" |
| 146 | android:layout_marginLeft="5dp" | 147 | android:layout_marginLeft="5dp" |
| 147 | android:textSize="22sp" | 148 | android:textSize="22sp" |
| 148 | /> | 149 | /> |
| 149 | 150 | ||
| 150 | </LinearLayout> | 151 | </LinearLayout> |
| 151 | <GridView | 152 | <GridView |
| 152 | android:id="@+id/gv_accunt" | 153 | android:id="@+id/gv_accunt" |
| 153 | android:layout_width="match_parent" | 154 | android:layout_width="match_parent" |
| 154 | android:layout_height="wrap_content" | 155 | android:layout_height="wrap_content" |
| 155 | android:numColumns="3"> | 156 | android:numColumns="3"> |
| 156 | 157 | ||
| 157 | </GridView> | 158 | </GridView> |
| 158 | 159 | ||
| 159 | 160 | ||
| 160 | 161 | ||
| 161 | 162 | ||
| 162 | </LinearLayout> | 163 | </LinearLayout> |
PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
| 4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
| 5 | android:orientation="vertical"> | 5 | android:orientation="vertical"> |
| 6 | 6 | ||
| 7 | <RelativeLayout | 7 | <RelativeLayout |
| 8 | android:id="@+id/title" | 8 | android:id="@+id/title" |
| 9 | android:layout_width="match_parent" | 9 | android:layout_width="match_parent" |
| 10 | android:layout_height="wrap_content" | 10 | android:layout_height="wrap_content" |
| 11 | android:background="@color/login_text_blue" | 11 | android:background="@color/login_text_blue" |
| 12 | android:minHeight="50dp"> | 12 | android:minHeight="50dp"> |
| 13 | 13 | ||
| 14 | <ImageView | 14 | <ImageView |
| 15 | android:id="@+id/cancel" | 15 | android:id="@+id/cancel" |
| 16 | android:layout_width="wrap_content" | 16 | android:layout_width="wrap_content" |
| 17 | android:layout_height="wrap_content" | 17 | android:layout_height="wrap_content" |
| 18 | android:layout_centerVertical="true" | 18 | android:layout_centerVertical="true" |
| 19 | android:paddingLeft="20dp" | 19 | android:paddingLeft="20dp" |
| 20 | android:paddingRight="20dp" | 20 | android:paddingRight="20dp" |
| 21 | android:src="@mipmap/title_back" /> | 21 | android:src="@mipmap/title_back" /> |
| 22 | 22 | ||
| 23 | <TextView | 23 | <TextView |
| 24 | android:id="@+id/menu_title" | 24 | android:id="@+id/menu_title" |
| 25 | android:layout_width="wrap_content" | 25 | android:layout_width="wrap_content" |
| 26 | android:layout_height="wrap_content" | 26 | android:layout_height="wrap_content" |
| 27 | android:layout_centerInParent="true" | 27 | android:layout_centerInParent="true" |
| 28 | android:text="@string/string_electroniccard_info_look" | 28 | android:text="@string/string_electroniccard_info_look" |
| 29 | android:textColor="@android:color/white" | 29 | android:textColor="@android:color/white" |
| 30 | android:textSize="22sp" /> | 30 | android:textSize="22sp" /> |
| 31 | </RelativeLayout> | 31 | </RelativeLayout> |
| 32 | 32 | ||
| 33 | <LinearLayout | 33 | <LinearLayout |
| 34 | android:layout_width="match_parent" | 34 | android:layout_width="match_parent" |
| 35 | android:layout_height="wrap_content" | 35 | android:layout_height="wrap_content" |
| 36 | android:layout_margin="20dp" | 36 | android:layout_margin="20dp" |
| 37 | android:background="@mipmap/cardbackgrangd" | 37 | android:background="@mipmap/cardbackgrangd" |
| 38 | android:gravity="center" | 38 | android:gravity="center" |
| 39 | android:orientation="vertical"> | 39 | android:orientation="vertical"> |
| 40 | 40 | ||
| 41 | <LinearLayout | 41 | <LinearLayout |
| 42 | android:layout_width="match_parent" | 42 | android:layout_width="match_parent" |
| 43 | android:layout_height="wrap_content" | 43 | android:layout_height="wrap_content" |
| 44 | android:layout_marginTop="70dp" | 44 | android:layout_marginTop="70dp" |
| 45 | android:gravity="center_vertical" | 45 | android:gravity="center_vertical" |
| 46 | android:orientation="horizontal"> | 46 | android:orientation="horizontal"> |
| 47 | 47 | ||
| 48 | <LinearLayout | 48 | <LinearLayout |
| 49 | android:layout_width="0dp" | 49 | android:layout_width="0dp" |
| 50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
| 51 | android:layout_marginLeft="200dp" | 51 | android:layout_marginLeft="200dp" |
| 52 | android:layout_weight="1" | 52 | android:layout_weight="1" |
| 53 | android:gravity="center_vertical"> | 53 | android:gravity="center_vertical"> |
| 54 | 54 | ||
| 55 | <ImageView | 55 | <ImageView |
| 56 | android:layout_width="wrap_content" | 56 | android:layout_width="wrap_content" |
| 57 | android:layout_height="wrap_content" | 57 | android:layout_height="wrap_content" |
| 58 | android:src="@mipmap/logo_info" /> | 58 | android:src="@mipmap/logo_info" /> |
| 59 | 59 | ||
| 60 | <TextView | 60 | <TextView |
| 61 | android:layout_width="wrap_content" | 61 | android:layout_width="wrap_content" |
| 62 | android:layout_height="wrap_content" | 62 | android:layout_height="wrap_content" |
| 63 | android:layout_marginLeft="50dp" | 63 | android:layout_marginLeft="50dp" |
| 64 | android:background="@null" | 64 | android:background="@null" |
| 65 | android:text="电子保卡" | 65 | android:text="电子保卡" |
| 66 | android:textColor="@color/electronic_card" | 66 | android:textColor="@color/electronic_card" |
| 67 | android:textSize="22sp" /> | 67 | android:textSize="22sp" /> |
| 68 | 68 | ||
| 69 | </LinearLayout> | 69 | </LinearLayout> |
| 70 | 70 | ||
| 71 | <LinearLayout | 71 | <LinearLayout |
| 72 | android:layout_width="0dp" | 72 | android:layout_width="0dp" |
| 73 | android:layout_height="80dp" | 73 | android:layout_height="80dp" |
| 74 | android:layout_weight="1" | 74 | android:layout_weight="1" |
| 75 | android:layout_marginLeft="80dp" | 75 | android:layout_marginLeft="80dp" |
| 76 | android:gravity="center_vertical"> | 76 | android:gravity="center_vertical"> |
| 77 | 77 | ||
| 78 | <TextView | 78 | <TextView |
| 79 | android:layout_width="wrap_content" | 79 | android:layout_width="wrap_content" |
| 80 | android:layout_height="wrap_content" | 80 | android:layout_height="wrap_content" |
| 81 | android:text="客户姓名" | 81 | android:text="客户姓名" |
| 82 | android:textColor="@color/btn_text_color" | 82 | android:textColor="@color/btn_text_color" |
| 83 | android:textSize="22sp" /> | 83 | android:textSize="22sp" /> |
| 84 | 84 | ||
| 85 | <TextView | 85 | <TextView |
| 86 | android:id="@+id/iv_card_username" | 86 | android:id="@+id/iv_card_username" |
| 87 | android:layout_width="wrap_content" | 87 | android:layout_width="wrap_content" |
| 88 | android:layout_height="wrap_content" | 88 | android:layout_height="wrap_content" |
| 89 | android:layout_marginLeft="60dp" | 89 | android:layout_marginLeft="60dp" |
| 90 | android:text="王小明" | 90 | android:text="" |
| 91 | android:textColor="@color/btn_text_color" | 91 | android:textColor="@color/btn_text_color" |
| 92 | android:textSize="22sp" /> | 92 | android:textSize="22sp" /> |
| 93 | 93 | ||
| 94 | </LinearLayout> | 94 | </LinearLayout> |
| 95 | 95 | ||
| 96 | </LinearLayout> | 96 | </LinearLayout> |
| 97 | 97 | ||
| 98 | <LinearLayout | 98 | <LinearLayout |
| 99 | android:layout_width="match_parent" | 99 | android:layout_width="match_parent" |
| 100 | android:layout_height="wrap_content" | 100 | android:layout_height="wrap_content" |
| 101 | android:gravity="center_vertical" | 101 | android:gravity="center_vertical" |
| 102 | android:orientation="horizontal"> | 102 | android:orientation="horizontal"> |
| 103 | 103 | ||
| 104 | <LinearLayout | 104 | <LinearLayout |
| 105 | android:layout_width="0dp" | 105 | android:layout_width="0dp" |
| 106 | android:layout_height="60dp" | 106 | android:layout_height="60dp" |
| 107 | android:layout_weight="1" | 107 | android:layout_weight="1" |
| 108 | android:layout_marginLeft="200dp" | 108 | android:layout_marginLeft="200dp" |
| 109 | android:gravity="center_vertical"> | 109 | android:gravity="center_vertical"> |
| 110 | 110 | ||
| 111 | <TextView | 111 | <TextView |
| 112 | android:layout_width="wrap_content" | 112 | android:layout_width="wrap_content" |
| 113 | android:layout_height="wrap_content" | 113 | android:layout_height="wrap_content" |
| 114 | android:text="产品型号" | 114 | android:text="产品型号" |
| 115 | android:textColor="@color/btn_text_color" | 115 | android:textColor="@color/btn_text_color" |
| 116 | android:textSize="22sp" /> | 116 | android:textSize="22sp" /> |
| 117 | 117 | ||
| 118 | <TextView | 118 | <TextView |
| 119 | android:id="@+id/tv_card_deviceModel" | 119 | android:id="@+id/tv_card_deviceModel" |
| 120 | android:layout_width="wrap_content" | 120 | android:layout_width="wrap_content" |
| 121 | android:layout_height="wrap_content" | 121 | android:layout_height="wrap_content" |
| 122 | android:layout_marginLeft="50dp" | 122 | android:layout_marginLeft="50dp" |
| 123 | android:text="IPone888" | 123 | android:text="" |
| 124 | android:textSize="22sp" /> | 124 | android:textSize="22sp" /> |
| 125 | 125 | ||
| 126 | 126 | ||
| 127 | </LinearLayout> | 127 | </LinearLayout> |
| 128 | 128 | ||
| 129 | <LinearLayout | 129 | <LinearLayout |
| 130 | android:layout_width="0dp" | 130 | android:layout_width="0dp" |
| 131 | android:layout_height="60dp" | 131 | android:layout_height="60dp" |
| 132 | android:layout_weight="1" | 132 | android:layout_weight="1" |
| 133 | android:layout_marginLeft="80dp" | 133 | android:layout_marginLeft="80dp" |
| 134 | android:gravity="center_vertical"> | 134 | android:gravity="center_vertical"> |
| 135 | 135 | ||
| 136 | <TextView | 136 | <TextView |
| 137 | android:layout_width="wrap_content" | 137 | android:layout_width="wrap_content" |
| 138 | android:layout_height="wrap_content" | 138 | android:layout_height="wrap_content" |
| 139 | android:textColor="@color/btn_text_color" | ||
| 139 | android:text="客户地址" | 140 | android:text="客户地址" |
| 140 | android:textSize="22sp" /> | 141 | android:textSize="22sp" /> |
| 141 | 142 | ||
| 142 | <TextView | 143 | <TextView |
| 143 | android:id="@+id/tv_card_adress" | 144 | android:id="@+id/tv_card_adress" |
| 144 | android:layout_width="wrap_content" | 145 | android:layout_width="wrap_content" |
| 145 | android:layout_height="wrap_content" | 146 | android:layout_height="wrap_content" |
| 146 | android:layout_marginLeft="60dp" | 147 | android:layout_marginLeft="60dp" |
| 147 | android:background="@null" | 148 | android:text="" |
| 148 | android:text="北京市昭阳区三里屯" | ||
| 149 | android:textSize="22sp" /> | 149 | android:textSize="22sp" /> |
| 150 | <TextView | 150 | <TextView |
| 151 | android:id="@+id/tv_card_adress_change" | 151 | android:id="@+id/tv_card_adress_change" |
| 152 | android:layout_width="wrap_content" | 152 | android:layout_width="wrap_content" |
| 153 | android:layout_height="wrap_content" | 153 | android:layout_height="wrap_content" |
| 154 | android:layout_marginLeft="18dp" | 154 | android:layout_marginLeft="18dp" |
| 155 | android:background="@drawable/corcle_black_bg" | 155 | android:background="@drawable/corcle_black_bg" |
| 156 | android:text="修改" | 156 | android:text="修改" |
| 157 | android:paddingLeft="5dp" | 157 | android:paddingLeft="5dp" |
| 158 | android:paddingRight="5dp" | 158 | android:paddingRight="5dp" |
| 159 | android:textColor="@color/login_text_blue" | 159 | android:textColor="@color/login_text_blue" |
| 160 | android:textSize="18sp" /> | 160 | android:textSize="18sp" /> |
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | </LinearLayout> | 163 | </LinearLayout> |
| 164 | 164 | ||
| 165 | </LinearLayout> | 165 | </LinearLayout> |
| 166 | 166 | ||
| 167 | <LinearLayout | 167 | <LinearLayout |
| 168 | android:layout_width="match_parent" | 168 | android:layout_width="match_parent" |
| 169 | android:layout_height="wrap_content" | 169 | android:layout_height="wrap_content" |
| 170 | android:gravity="center_vertical" | 170 | android:gravity="center_vertical" |
| 171 | android:orientation="horizontal"> | 171 | android:orientation="horizontal"> |
| 172 | 172 | ||
| 173 | <LinearLayout | 173 | <LinearLayout |
| 174 | android:layout_width="0dp" | 174 | android:layout_width="0dp" |
| 175 | android:layout_height="60dp" | 175 | android:layout_height="60dp" |
| 176 | android:layout_weight="1" | 176 | android:layout_weight="1" |
| 177 | android:layout_marginLeft="200dp" | 177 | android:layout_marginLeft="200dp" |
| 178 | android:gravity="center_vertical"> | 178 | android:gravity="center_vertical"> |
| 179 | 179 | ||
| 180 | <TextView | 180 | <TextView |
| 181 | android:layout_width="wrap_content" | 181 | android:layout_width="wrap_content" |
| 182 | android:layout_height="wrap_content" | 182 | android:layout_height="wrap_content" |
| 183 | android:textColor="@color/btn_text_color" | ||
| 183 | android:text="MAC地址" | 184 | android:text="MAC地址" |
| 184 | android:textSize="22sp" /> | 185 | android:textSize="22sp" /> |
| 185 | 186 | ||
| 186 | <TextView | 187 | <TextView |
| 187 | android:id="@+id/tv_card_mac" | 188 | android:id="@+id/tv_card_mac" |
| 188 | android:layout_width="wrap_content" | 189 | android:layout_width="wrap_content" |
| 189 | android:layout_height="wrap_content" | 190 | android:layout_height="wrap_content" |
| 190 | android:layout_marginLeft="50dp" | 191 | android:layout_marginLeft="50dp" |
| 191 | android:background="@null" | 192 | android:background="@null" |
| 192 | android:text="237462873463278" | 193 | android:text="" |
| 193 | android:textSize="22sp" /> | 194 | android:textSize="22sp" /> |
| 194 | 195 | ||
| 195 | </LinearLayout> | 196 | </LinearLayout> |
| 196 | 197 | ||
| 197 | <LinearLayout | 198 | <LinearLayout |
| 198 | android:layout_width="0dp" | 199 | android:layout_width="0dp" |
| 199 | android:layout_height="60dp" | 200 | android:layout_height="60dp" |
| 200 | android:layout_weight="1" | 201 | android:layout_weight="1" |
| 201 | android:layout_marginLeft="80dp" | 202 | android:layout_marginLeft="80dp" |
| 202 | android:gravity="center_vertical"> | 203 | android:gravity="center_vertical"> |
| 203 | 204 | ||
| 204 | <TextView | 205 | <TextView |
| 205 | android:layout_width="wrap_content" | 206 | android:layout_width="wrap_content" |
| 206 | android:layout_height="wrap_content" | 207 | android:layout_height="wrap_content" |
| 207 | android:text="购买时间" | 208 | android:text="购买时间" |
| 208 | android:textColor="@color/btn_text_color" | 209 | android:textColor="@color/btn_text_color" |
| 209 | android:textSize="22sp" /> | 210 | android:textSize="22sp" /> |
| 210 | 211 | ||
| 211 | <TextView | 212 | <TextView |
| 212 | android:id="@+id/tv_card_time" | 213 | android:id="@+id/tv_card_time" |
| 213 | android:layout_width="wrap_content" | 214 | android:layout_width="wrap_content" |
| 214 | android:layout_height="wrap_content" | 215 | android:layout_height="wrap_content" |
| 215 | android:layout_marginLeft="60dp" | 216 | android:layout_marginLeft="60dp" |
| 216 | android:background="@null" | 217 | android:background="@null" |
| 217 | android:text="4433322-334--34" | 218 | android:text="" |
| 218 | android:textColor="@color/btn_text_color" | 219 | android:textColor="@color/btn_text_color" |
| 219 | android:textSize="22sp" /> | 220 | android:textSize="22sp" /> |
| 220 | </LinearLayout> | 221 | </LinearLayout> |
| 221 | 222 | ||
| 222 | </LinearLayout> | 223 | </LinearLayout> |
| 223 | 224 | ||
| 224 | <LinearLayout | 225 | <LinearLayout |
| 225 | android:layout_width="match_parent" | 226 | android:layout_width="match_parent" |
| 226 | android:layout_height="wrap_content" | 227 | android:layout_height="wrap_content" |
| 227 | android:gravity="center_vertical" | 228 | android:gravity="center_vertical" |
| 228 | android:orientation="horizontal"> | 229 | android:orientation="horizontal"> |
| 229 | 230 | ||
| 230 | <LinearLayout | 231 | <LinearLayout |
| 231 | android:layout_width="0dp" | 232 | android:layout_width="0dp" |
| 232 | android:layout_height="60dp" | 233 | android:layout_height="60dp" |
| 233 | android:layout_weight="1" | 234 | android:layout_weight="1" |
| 234 | android:layout_marginLeft="200dp" | 235 | android:layout_marginLeft="200dp" |
| 235 | android:gravity="center_vertical"> | 236 | android:gravity="center_vertical"> |
| 236 | 237 | ||
| 237 | <TextView | 238 | <TextView |
| 238 | android:layout_width="wrap_content" | 239 | android:layout_width="wrap_content" |
| 239 | android:layout_height="wrap_content" | 240 | android:layout_height="wrap_content" |
| 240 | android:text="机身编码" | 241 | android:text="机身编码" |
| 241 | android:textColor="@color/btn_text_color" | 242 | android:textColor="@color/btn_text_color" |
| 242 | android:textSize="22sp" /> | 243 | android:textSize="22sp" /> |
| 243 | 244 | ||
| 244 | <TextView | 245 | <TextView |
| 245 | android:id="@+id/tv_card_deviceNumber" | 246 | android:id="@+id/tv_card_deviceNumber" |
| 246 | android:layout_width="wrap_content" | 247 | android:layout_width="wrap_content" |
| 247 | android:layout_height="wrap_content" | 248 | android:layout_height="wrap_content" |
| 248 | android:layout_marginLeft="50dp" | 249 | android:layout_marginLeft="50dp" |
| 249 | android:hint="473463746343" | 250 | android:hint="" |
| 250 | android:textSize="22sp" /> | 251 | android:textSize="22sp" /> |
| 251 | 252 | ||
| 252 | </LinearLayout> | 253 | </LinearLayout> |
| 253 | 254 | ||
| 254 | <LinearLayout | 255 | <LinearLayout |
| 255 | android:layout_width="0dp" | 256 | android:layout_width="0dp" |
| 256 | android:layout_height="60dp" | 257 | android:layout_height="60dp" |
| 257 | android:layout_weight="1" | 258 | android:layout_weight="1" |
| 258 | android:layout_marginLeft="80dp" | 259 | android:layout_marginLeft="80dp" |
| 259 | android:gravity="center_vertical"> | 260 | android:gravity="center_vertical"> |
| 260 | 261 | ||
| 261 | <TextView | 262 | <TextView |
| 262 | android:id="@+id/tv_card_shopAdress" | ||
| 263 | android:layout_width="wrap_content" | 263 | android:layout_width="wrap_content" |
| 264 | android:layout_height="wrap_content" | 264 | android:layout_height="wrap_content" |
| 265 | android:text="购买地址" | 265 | android:text="购买地址" |
| 266 | android:textColor="@color/btn_text_color" | 266 | android:textColor="@color/btn_text_color" |
| 267 | android:textSize="22sp" /> | 267 | android:textSize="22sp" /> |
| 268 | 268 | ||
| 269 | <TextView | 269 | <TextView |
| 270 | android:id="@+id/tv_card_shopAdress" | ||
| 270 | android:layout_width="wrap_content" | 271 | android:layout_width="wrap_content" |
| 271 | android:layout_height="wrap_content" | 272 | android:layout_height="wrap_content" |
| 272 | android:layout_marginLeft="60dp" | 273 | android:layout_marginLeft="60dp" |
| 273 | android:text="啥啥啥 专卖店" | 274 | android:text="" |
| 274 | android:textColor="@color/btn_text_color" | 275 | android:textColor="@color/btn_text_color" |
| 275 | android:textSize="22sp" /> | 276 | android:textSize="22sp" /> |
| 276 | </LinearLayout> | 277 | </LinearLayout> |
| 277 | 278 | ||
| 278 | </LinearLayout> | 279 | </LinearLayout> |
| 279 | 280 | ||
| 280 | <LinearLayout | 281 | <LinearLayout |
| 281 | android:layout_width="match_parent" | 282 | android:layout_width="match_parent" |
| 282 | android:layout_height="wrap_content" | 283 | android:layout_height="wrap_content" |
| 283 | android:gravity="center_vertical" | 284 | android:gravity="center_vertical" |
| 284 | android:layout_marginBottom="30dp" | 285 | android:layout_marginBottom="30dp" |
| 285 | android:orientation="horizontal"> | 286 | android:orientation="horizontal"> |
| 286 | 287 | ||
| 287 | <LinearLayout | 288 | <LinearLayout |
| 288 | android:layout_width="0dp" | 289 | android:layout_width="0dp" |
| 289 | android:layout_height="60dp" | 290 | android:layout_height="60dp" |
| 290 | android:layout_weight="1" | 291 | android:layout_weight="1" |
| 291 | android:layout_marginLeft="200dp" | 292 | android:layout_marginLeft="200dp" |
| 292 | android:gravity="center_vertical"> | 293 | android:gravity="center_vertical"> |
| 293 | 294 | ||
| 294 | <TextView | 295 | <TextView |
| 295 | android:layout_width="wrap_content" | 296 | android:layout_width="wrap_content" |
| 296 | android:layout_height="wrap_content" | 297 | android:layout_height="wrap_content" |
| 297 | android:text="手机号码" | 298 | android:text="手机号码" |
| 298 | android:textColor="@color/btn_text_color" | 299 | android:textColor="@color/btn_text_color" |
| 299 | android:textSize="22sp" /> | 300 | android:textSize="22sp" /> |
| 300 | 301 | ||
| 301 | <TextView | 302 | <TextView |
| 302 | android:id="@+id/tv_card_phone" | 303 | android:id="@+id/tv_card_phone" |
| 303 | android:layout_width="wrap_content" | 304 | android:layout_width="wrap_content" |
| 304 | android:layout_height="wrap_content" | 305 | android:layout_height="wrap_content" |
| 305 | android:layout_marginLeft="50dp" | 306 | android:layout_marginLeft="50dp" |
| 306 | android:text="IPone888" | 307 | android:text="" |
| 307 | android:textSize="22sp" /> | 308 | android:textSize="22sp" /> |
| 308 | <TextView | 309 | <TextView |
| 309 | android:id="@+id/tv_card_phone_change" | 310 | android:id="@+id/tv_card_phone_change" |
| 310 | android:layout_width="wrap_content" | 311 | android:layout_width="wrap_content" |
| 311 | android:layout_height="wrap_content" | 312 | android:layout_height="wrap_content" |
| 312 | android:layout_marginLeft="18dp" | 313 | android:layout_marginLeft="18dp" |
| 313 | android:background="@drawable/corcle_black_bg" | 314 | android:background="@drawable/corcle_black_bg" |
| 314 | android:text="修改" | 315 | android:text="修改" |
| 315 | android:paddingLeft="5dp" | 316 | android:paddingLeft="5dp" |
| 316 | android:paddingRight="5dp" | 317 | android:paddingRight="5dp" |
| 317 | android:textColor="@color/login_text_blue" | 318 | android:textColor="@color/login_text_blue" |
| 318 | android:textSize="18sp" /> | 319 | android:textSize="18sp" /> |
| 319 | 320 | ||
| 320 | 321 | ||
| 321 | </LinearLayout> | 322 | </LinearLayout> |
| 322 | 323 | ||
| 323 | <LinearLayout | 324 | <LinearLayout |
| 324 | android:layout_width="0dp" | 325 | android:layout_width="0dp" |
| 325 | android:layout_height="60dp" | 326 | android:layout_height="60dp" |
| 326 | android:layout_weight="1" | 327 | android:layout_weight="1" |
| 327 | android:layout_marginLeft="80dp" | 328 | android:layout_marginLeft="80dp" |
| 328 | android:gravity="center_vertical"> | 329 | android:gravity="center_vertical"> |
| 329 | 330 | ||
| 330 | <TextView | 331 | <TextView |
| 331 | android:layout_width="wrap_content" | 332 | android:layout_width="wrap_content" |
| 332 | android:layout_height="wrap_content" | 333 | android:layout_height="wrap_content" |
| 334 | android:textColor="@color/btn_text_color" | ||
| 333 | android:text="本地售后电话" | 335 | android:text="本地售后电话" |
| 334 | android:textSize="22sp" /> | 336 | android:textSize="22sp" /> |
| 335 | 337 | ||
| 336 | <TextView | 338 | <TextView |
| 337 | android:id="@+id/tv_card_tleNember" | 339 | android:id="@+id/tv_card_tleNember" |
| 338 | android:layout_width="wrap_content" | 340 | android:layout_width="wrap_content" |
| 339 | android:layout_height="wrap_content" | 341 | android:layout_height="wrap_content" |
| 340 | android:layout_marginLeft="60dp" | 342 | android:layout_marginLeft="60dp" |
| 341 | android:background="@null" | 343 | android:background="@null" |
| 342 | android:text="1111111" | 344 | android:text="" |
| 343 | android:textSize="22sp" /> | 345 | android:textSize="22sp" /> |
| 344 | 346 | ||
| 345 | </LinearLayout> | 347 | </LinearLayout> |
| 346 | 348 | ||
| 347 | </LinearLayout> | 349 | </LinearLayout> |
| 348 | </LinearLayout> | 350 | </LinearLayout> |
| 349 | 351 | ||
| 350 | <LinearLayout | 352 | <LinearLayout |
| 351 | android:layout_width="match_parent" | 353 | android:layout_width="match_parent" |
| 352 | android:layout_height="wrap_content" | 354 | android:layout_height="wrap_content" |
| 353 | android:layout_marginTop="5dp" | 355 | android:layout_marginTop="5dp" |
| 354 | android:gravity="center" | 356 | android:gravity="center" |
| 355 | android:orientation="vertical"> | 357 | android:orientation="vertical"> |
| 356 | 358 | ||
| 357 | <TextView | 359 | <TextView |
| 358 | android:layout_width="wrap_content" | 360 | android:layout_width="wrap_content" |
| 359 | android:layout_height="wrap_content" | 361 | android:layout_height="wrap_content" |
| 360 | android:layout_marginTop="5dp" | 362 | android:layout_marginTop="5dp" |
| 361 | android:text="@string/electronic_card" | 363 | android:text="@string/electronic_card" |
| 362 | android:textColor="@color/electronic_text" | 364 | android:textColor="@color/electronic_text" |
| 363 | android:textSize="18sp" /> | 365 | android:textSize="18sp" /> |
| 364 | 366 | ||
| 365 | 367 | ||
| 366 | 368 | ||
| 367 | </LinearLayout> | 369 | </LinearLayout> |
| 368 | <LinearLayout | 370 | <LinearLayout |
| 369 | android:layout_width="match_parent" | 371 | android:layout_width="match_parent" |
| 370 | android:layout_height="wrap_content" | 372 | android:layout_height="wrap_content" |
| 371 | android:layout_marginTop="30dp" | 373 | android:layout_marginTop="30dp" |
| 372 | android:gravity="center" | 374 | android:gravity="center" |
| 373 | android:orientation="horizontal"> | 375 | android:orientation="horizontal"> |
| 374 | 376 | ||
| 375 | <ImageView | 377 | <ImageView |
| 376 | android:layout_width="wrap_content" | 378 | android:layout_width="wrap_content" |
| 377 | android:layout_height="wrap_content" | 379 | android:layout_height="wrap_content" |
| 378 | android:src="@mipmap/phone"/> | 380 | android:src="@mipmap/phone"/> |
| 379 | <TextView | 381 | <TextView |
| 380 | android:layout_width="wrap_content" | 382 | android:layout_width="wrap_content" |
| 381 | android:layout_height="wrap_content" | 383 | android:layout_height="wrap_content" |
| 382 | android:textSize="30sp" | 384 | android:textSize="30sp" |
| 383 | android:layout_marginLeft="5dp" | 385 | android:layout_marginLeft="5dp" |
| 384 | android:textColor="@color/login_text_blue" | 386 | android:textColor="@color/login_text_blue" |
| 385 | android:text="400-400-000"/> | 387 | android:text="400-400-000"/> |
| 386 | 388 | ||
| 387 | 389 | ||
| 388 | </LinearLayout> | 390 | </LinearLayout> |
| 389 | 391 | ||
| 390 | 392 |
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | android:id="@+id/card_view" | 3 | android:id="@+id/card_view" |
| 4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
| 5 | android:layout_height="match_parent" | 5 | android:layout_height="match_parent" |
| 6 | android:orientation="vertical"> | 6 | android:orientation="vertical"> |
| 7 | 7 | ||
| 8 | <RelativeLayout | 8 | <RelativeLayout |
| 9 | android:id="@+id/title" | 9 | android:id="@+id/title" |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
| 12 | android:background="@color/login_text_blue" | 12 | android:background="@color/login_text_blue" |
| 13 | android:minHeight="50dp"> | 13 | android:minHeight="50dp"> |
| 14 | 14 | ||
| 15 | <ImageView | 15 | <ImageView |
| 16 | android:id="@+id/iv_card_back" | 16 | android:id="@+id/iv_card_back" |
| 17 | android:layout_width="wrap_content" | 17 | android:layout_width="wrap_content" |
| 18 | android:layout_height="wrap_content" | 18 | android:layout_height="wrap_content" |
| 19 | android:layout_centerVertical="true" | 19 | android:layout_centerVertical="true" |
| 20 | android:paddingLeft="20dp" | 20 | android:paddingLeft="20dp" |
| 21 | android:paddingRight="20dp" | 21 | android:paddingRight="20dp" |
| 22 | android:src="@mipmap/title_back" /> | 22 | android:src="@mipmap/title_back" /> |
| 23 | 23 | ||
| 24 | <TextView | 24 | <TextView |
| 25 | android:id="@+id/menu_title" | 25 | android:id="@+id/menu_title" |
| 26 | android:layout_width="wrap_content" | 26 | android:layout_width="wrap_content" |
| 27 | android:layout_height="wrap_content" | 27 | android:layout_height="wrap_content" |
| 28 | android:layout_centerInParent="true" | 28 | android:layout_centerInParent="true" |
| 29 | android:text="@string/change_electroniccard_info_fill" | 29 | android:text="@string/change_electroniccard_info_fill" |
| 30 | android:textColor="@android:color/white" | 30 | android:textColor="@android:color/white" |
| 31 | android:textSize="22sp" /> | 31 | android:textSize="22sp" /> |
| 32 | </RelativeLayout> | 32 | </RelativeLayout> |
| 33 | 33 | ||
| 34 | <ImageView | 34 | <ImageView |
| 35 | android:layout_width="wrap_content" | 35 | android:layout_width="wrap_content" |
| 36 | android:layout_height="wrap_content" | 36 | android:layout_height="wrap_content" |
| 37 | android:layout_gravity="center" | 37 | android:layout_gravity="center" |
| 38 | android:layout_marginTop="20dp" | 38 | android:layout_marginTop="20dp" |
| 39 | android:src="@mipmap/change_info_icon" /> | 39 | android:src="@mipmap/change_info_icon" /> |
| 40 | 40 | ||
| 41 | <LinearLayout | 41 | <LinearLayout |
| 42 | android:layout_width="wrap_content" | 42 | android:layout_width="wrap_content" |
| 43 | android:layout_height="wrap_content" | 43 | android:layout_height="wrap_content" |
| 44 | android:layout_marginTop="60dp" | 44 | android:layout_marginTop="60dp" |
| 45 | android:orientation="horizontal"> | 45 | android:orientation="horizontal"> |
| 46 | 46 | ||
| 47 | <View | 47 | <View |
| 48 | android:layout_width="450dp" | 48 | android:layout_width="450dp" |
| 49 | android:layout_height="0.7dp" | 49 | android:layout_height="0.7dp" |
| 50 | android:layout_marginLeft="150dp" | 50 | android:layout_marginLeft="150dp" |
| 51 | android:background="@color/electronic_text"> | 51 | android:background="@color/electronic_text"> |
| 52 | 52 | ||
| 53 | </View> | 53 | </View> |
| 54 | 54 | ||
| 55 | <View | 55 | <View |
| 56 | android:layout_width="450dp" | 56 | android:layout_width="450dp" |
| 57 | android:layout_height="0.7dp" | 57 | android:layout_height="0.7dp" |
| 58 | android:layout_marginLeft="80dp" | 58 | android:layout_marginLeft="80dp" |
| 59 | android:background="@color/electronic_text"> | 59 | android:background="@color/electronic_text"> |
| 60 | 60 | ||
| 61 | </View> | 61 | </View> |
| 62 | 62 | ||
| 63 | 63 | ||
| 64 | </LinearLayout> | 64 | </LinearLayout> |
| 65 | 65 | ||
| 66 | <LinearLayout | 66 | <LinearLayout |
| 67 | android:layout_width="match_parent" | 67 | android:layout_width="match_parent" |
| 68 | android:layout_height="wrap_content" | 68 | android:layout_height="wrap_content" |
| 69 | android:layout_marginLeft="200dp" | 69 | android:layout_marginLeft="200dp" |
| 70 | android:gravity="center_vertical" | 70 | android:gravity="center_vertical" |
| 71 | android:orientation="horizontal"> | 71 | android:orientation="horizontal"> |
| 72 | 72 | ||
| 73 | <LinearLayout | 73 | <LinearLayout |
| 74 | android:layout_width="0dp" | 74 | android:layout_width="0dp" |
| 75 | android:layout_height="80dp" | 75 | android:layout_height="80dp" |
| 76 | android:layout_weight="1" | 76 | android:layout_weight="1" |
| 77 | android:gravity="center_vertical"> | 77 | android:gravity="center_vertical"> |
| 78 | 78 | ||
| 79 | <TextView | 79 | <TextView |
| 80 | android:layout_width="wrap_content" | 80 | android:layout_width="wrap_content" |
| 81 | android:layout_height="wrap_content" | 81 | android:layout_height="wrap_content" |
| 82 | android:text="客户姓名" | 82 | android:text="客户姓名" |
| 83 | android:textColor="@color/electronic_text" | ||
| 84 | android:textSize="22sp" /> | 83 | android:textSize="22sp" /> |
| 85 | 84 | ||
| 86 | <EditText | 85 | <EditText |
| 87 | android:id="@+id/et_edit_username" | 86 | android:id="@+id/et_edit_username" |
| 88 | android:layout_width="wrap_content" | 87 | android:layout_width="wrap_content" |
| 89 | android:layout_height="wrap_content" | 88 | android:layout_height="wrap_content" |
| 90 | android:layout_marginLeft="50dp" | 89 | android:layout_marginLeft="50dp" |
| 91 | android:background="@null" | 90 | android:background="@null" |
| 92 | android:hint="请输入" | 91 | android:hint="请输入" |
| 93 | android:textColor="@color/electronic_text" | 92 | android:textColor="@color/electronic_text" |
| 94 | android:textSize="22sp" /> | 93 | android:textSize="22sp" /> |
| 95 | 94 | ||
| 96 | </LinearLayout> | 95 | </LinearLayout> |
| 97 | 96 | ||
| 98 | <LinearLayout | 97 | <LinearLayout |
| 99 | android:layout_width="0dp" | 98 | android:layout_width="0dp" |
| 100 | android:layout_height="80dp" | 99 | android:layout_height="80dp" |
| 101 | android:layout_weight="1" | 100 | android:layout_weight="1" |
| 102 | android:gravity="center_vertical"> | 101 | android:gravity="center_vertical"> |
| 103 | 102 | ||
| 104 | <TextView | 103 | <TextView |
| 105 | android:layout_width="150dp" | 104 | android:layout_width="150dp" |
| 106 | android:layout_height="wrap_content" | 105 | android:layout_height="wrap_content" |
| 107 | android:text="购买地址" | 106 | android:text="购买地址" |
| 108 | android:textColor="@color/electronic_text" | ||
| 109 | android:textSize="22sp" /> | 107 | android:textSize="22sp" /> |
| 110 | 108 | ||
| 111 | <TextView | 109 | <TextView |
| 112 | android:id="@+id/tv_edit_adress_shop" | 110 | android:id="@+id/tv_edit_adress_shop" |
| 113 | android:layout_width="wrap_content" | 111 | android:layout_width="wrap_content" |
| 114 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
| 115 | android:layout_marginLeft="20dp" | 113 | android:layout_marginLeft="20dp" |
| 116 | android:text="请选择地区" | 114 | android:hint="请选择地区" |
| 117 | android:textColor="@color/btn_text_color" | 115 | android:textColor="@color/btn_text_color" |
| 118 | android:textSize="22sp" /> | 116 | android:textSize="22sp" /> |
| 119 | 117 | ||
| 120 | <ImageView | 118 | <ImageView |
| 121 | android:layout_width="wrap_content" | 119 | android:layout_width="wrap_content" |
| 122 | android:layout_height="wrap_content" | 120 | android:layout_height="wrap_content" |
| 123 | android:layout_marginLeft="60dp" | 121 | android:layout_marginLeft="60dp" |
| 124 | android:src="@mipmap/xiajiantou"> | 122 | android:src="@mipmap/xiajiantou"> |
| 125 | 123 | ||
| 126 | </ImageView> | 124 | </ImageView> |
| 127 | </LinearLayout> | 125 | </LinearLayout> |
| 128 | 126 | ||
| 129 | </LinearLayout> | 127 | </LinearLayout> |
| 130 | 128 | ||
| 131 | <LinearLayout | 129 | <LinearLayout |
| 132 | android:layout_width="wrap_content" | 130 | android:layout_width="wrap_content" |
| 133 | android:layout_height="wrap_content" | 131 | android:layout_height="wrap_content" |
| 134 | android:orientation="horizontal"> | 132 | android:orientation="horizontal"> |
| 135 | 133 | ||
| 136 | <View | 134 | <View |
| 137 | android:layout_width="450dp" | 135 | android:layout_width="450dp" |
| 138 | android:layout_height="0.7dp" | 136 | android:layout_height="0.7dp" |
| 139 | android:layout_marginLeft="150dp" | 137 | android:layout_marginLeft="150dp" |
| 140 | android:background="@color/electronic_text"> | 138 | android:background="@color/electronic_text"> |
| 141 | 139 | ||
| 142 | </View> | 140 | </View> |
| 143 | 141 | ||
| 144 | <View | 142 | <View |
| 145 | android:layout_width="450dp" | 143 | android:layout_width="450dp" |
| 146 | android:layout_height="0.7dp" | 144 | android:layout_height="0.7dp" |
| 147 | android:layout_marginLeft="80dp" | 145 | android:layout_marginLeft="80dp" |
| 148 | android:background="@color/electronic_text"> | 146 | android:background="@color/electronic_text"> |
| 149 | 147 | ||
| 150 | </View> | 148 | </View> |
| 151 | 149 | ||
| 152 | 150 | ||
| 153 | </LinearLayout> | 151 | </LinearLayout> |
| 154 | 152 | ||
| 155 | <LinearLayout | 153 | <LinearLayout |
| 156 | android:layout_width="match_parent" | 154 | android:layout_width="match_parent" |
| 157 | android:layout_height="wrap_content" | 155 | android:layout_height="wrap_content" |
| 158 | android:layout_marginLeft="200dp" | 156 | android:layout_marginLeft="200dp" |
| 159 | android:gravity="center_vertical" | 157 | android:gravity="center_vertical" |
| 160 | android:orientation="horizontal"> | 158 | android:orientation="horizontal"> |
| 161 | 159 | ||
| 162 | <LinearLayout | 160 | <LinearLayout |
| 163 | android:layout_width="0dp" | 161 | android:layout_width="0dp" |
| 164 | android:layout_height="80dp" | 162 | android:layout_height="80dp" |
| 165 | android:layout_weight="1" | 163 | android:layout_weight="1" |
| 166 | android:gravity="center_vertical"> | 164 | android:gravity="center_vertical"> |
| 167 | 165 | ||
| 168 | <TextView | 166 | <TextView |
| 169 | android:layout_width="wrap_content" | 167 | android:layout_width="wrap_content" |
| 170 | android:layout_height="wrap_content" | 168 | android:layout_height="wrap_content" |
| 171 | android:text="客户地址" | 169 | android:text="客户地址" |
| 172 | android:textColor="@color/electronic_text" | ||
| 173 | android:textSize="22sp" /> | 170 | android:textSize="22sp" /> |
| 174 | 171 | ||
| 175 | <TextView | 172 | <TextView |
| 176 | android:id="@+id/tv_edit_adress_custem" | 173 | android:id="@+id/tv_edit_adress_custem" |
| 177 | android:layout_width="wrap_content" | 174 | android:layout_width="wrap_content" |
| 178 | android:layout_height="wrap_content" | 175 | android:layout_height="wrap_content" |
| 179 | android:layout_marginLeft="50dp" | 176 | android:layout_marginLeft="50dp" |
| 180 | android:text="请选择地区" | 177 | android:hint="请选择地区" |
| 181 | android:textSize="22sp" /> | 178 | android:textSize="22sp" /> |
| 182 | 179 | ||
| 183 | <ImageView | 180 | <ImageView |
| 184 | android:layout_width="wrap_content" | 181 | android:layout_width="wrap_content" |
| 185 | android:layout_height="wrap_content" | 182 | android:layout_height="wrap_content" |
| 186 | android:layout_marginLeft="60dp" | 183 | android:layout_marginLeft="60dp" |
| 187 | android:src="@mipmap/xiajiantou"> | 184 | android:src="@mipmap/xiajiantou"> |
| 188 | 185 | ||
| 189 | </ImageView> | 186 | </ImageView> |
| 190 | 187 | ||
| 191 | 188 | ||
| 192 | </LinearLayout> | 189 | </LinearLayout> |
| 193 | 190 | ||
| 194 | <LinearLayout | 191 | <LinearLayout |
| 195 | android:layout_width="0dp" | 192 | android:layout_width="0dp" |
| 196 | android:layout_height="80dp" | 193 | android:layout_height="80dp" |
| 197 | android:layout_weight="1" | 194 | android:layout_weight="1" |
| 198 | android:gravity="center_vertical"> | 195 | android:gravity="center_vertical"> |
| 199 | 196 | ||
| 200 | <TextView | 197 | <TextView |
| 201 | android:layout_width="150dp" | 198 | android:layout_width="150dp" |
| 202 | android:layout_height="wrap_content" | 199 | android:layout_height="wrap_content" |
| 203 | android:text=" " | 200 | android:text=" " |
| 204 | android:textColor="@color/white" | 201 | android:textColor="@color/white" |
| 205 | android:textSize="22sp" /> | 202 | android:textSize="22sp" /> |
| 206 | 203 | ||
| 207 | <EditText | 204 | <EditText |
| 208 | android:id="@+id/et_edit_store" | 205 | android:id="@+id/et_edit_store" |
| 209 | android:layout_width="wrap_content" | 206 | android:layout_width="wrap_content" |
| 210 | android:layout_height="wrap_content" | 207 | android:layout_height="wrap_content" |
| 211 | android:layout_marginLeft="20dp" | 208 | android:layout_marginLeft="20dp" |
| 212 | android:background="@null" | 209 | android:background="@null" |
| 213 | android:hint="请输入商店名称" | 210 | android:hint="请输入商店名称" |
| 214 | android:textSize="22sp" /> | 211 | android:textSize="22sp" /> |
| 215 | 212 | ||
| 216 | </LinearLayout> | 213 | </LinearLayout> |
| 217 | 214 | ||
| 218 | </LinearLayout> | 215 | </LinearLayout> |
| 219 | 216 | ||
| 220 | <LinearLayout | 217 | <LinearLayout |
| 221 | android:layout_width="wrap_content" | 218 | android:layout_width="wrap_content" |
| 222 | android:layout_height="wrap_content" | 219 | android:layout_height="wrap_content" |
| 223 | 220 | ||
| 224 | android:orientation="horizontal"> | 221 | android:orientation="horizontal"> |
| 225 | 222 | ||
| 226 | <View | 223 | <View |
| 227 | android:layout_width="450dp" | 224 | android:layout_width="450dp" |
| 228 | android:layout_height="0.7dp" | 225 | android:layout_height="0.7dp" |
| 229 | android:layout_marginLeft="150dp" | 226 | android:layout_marginLeft="150dp" |
| 230 | android:background="@color/electronic_text"> | 227 | android:background="@color/electronic_text"> |
| 231 | 228 | ||
| 232 | </View> | 229 | </View> |
| 233 | 230 | ||
| 234 | <View | 231 | <View |
| 235 | android:layout_width="450dp" | 232 | android:layout_width="450dp" |
| 236 | android:layout_height="0.7dp" | 233 | android:layout_height="0.7dp" |
| 237 | android:layout_marginLeft="80dp" | 234 | android:layout_marginLeft="80dp" |
| 238 | android:background="@color/electronic_text"> | 235 | android:background="@color/electronic_text"> |
| 239 | 236 | ||
| 240 | </View> | 237 | </View> |
| 241 | 238 | ||
| 242 | 239 | ||
| 243 | </LinearLayout> | 240 | </LinearLayout> |
| 244 | 241 | ||
| 245 | <LinearLayout | 242 | <LinearLayout |
| 246 | android:layout_width="match_parent" | 243 | android:layout_width="match_parent" |
| 247 | android:layout_height="wrap_content" | 244 | android:layout_height="wrap_content" |
| 248 | android:layout_marginLeft="200dp" | 245 | android:layout_marginLeft="200dp" |
| 249 | android:gravity="center_vertical" | 246 | android:gravity="center_vertical" |
| 250 | android:orientation="horizontal"> | 247 | android:orientation="horizontal"> |
| 251 | 248 | ||
| 252 | <LinearLayout | 249 | <LinearLayout |
| 253 | android:layout_width="0dp" | 250 | android:layout_width="0dp" |
| 254 | android:layout_height="80dp" | 251 | android:layout_height="80dp" |
| 255 | android:layout_weight="1" | 252 | android:layout_weight="1" |
| 256 | android:gravity="center_vertical"> | 253 | android:gravity="center_vertical"> |
| 257 | 254 | ||
| 258 | <TextView | 255 | <TextView |
| 259 | android:layout_width="wrap_content" | 256 | android:layout_width="wrap_content" |
| 260 | android:layout_height="wrap_content" | 257 | android:layout_height="wrap_content" |
| 261 | android:text=" " | 258 | android:text=" " |
| 262 | android:textColor="@color/white" | 259 | android:textColor="@color/white" |
| 263 | android:textSize="22sp" /> | 260 | android:textSize="22sp" /> |
| 264 | 261 | ||
| 265 | <EditText | 262 | <EditText |
| 266 | android:id="@+id/et_edit_adress_detail" | 263 | android:id="@+id/et_edit_adress_detail" |
| 267 | android:layout_width="wrap_content" | 264 | android:layout_width="wrap_content" |
| 268 | android:layout_height="wrap_content" | 265 | android:layout_height="wrap_content" |
| 269 | android:layout_marginLeft="100dp" | 266 | android:layout_marginLeft="100dp" |
| 270 | android:background="@null" | 267 | android:background="@null" |
| 271 | android:hint="请输入详细地址" | 268 | android:hint="请输入详细地址" |
| 272 | android:textSize="22sp" /> | 269 | android:textSize="22sp" /> |
| 273 | 270 | ||
| 274 | </LinearLayout> | 271 | </LinearLayout> |
| 275 | 272 | ||
| 276 | <LinearLayout | 273 | <LinearLayout |
| 277 | android:layout_width="0dp" | 274 | android:layout_width="0dp" |
| 278 | android:layout_height="80dp" | 275 | android:layout_height="80dp" |
| 279 | android:layout_weight="1" | 276 | android:layout_weight="1" |
| 280 | android:gravity="center_vertical"> | 277 | android:gravity="center_vertical"> |
| 281 | 278 | ||
| 282 | <TextView | 279 | <TextView |
| 283 | android:layout_width="150dp" | 280 | android:layout_width="150dp" |
| 284 | android:layout_height="wrap_content" | 281 | android:layout_height="wrap_content" |
| 285 | android:text="本地售后电话" | 282 | android:text="本地售后电话" |
| 286 | android:textColor="@color/electronic_text" | ||
| 287 | android:textSize="22sp" /> | 283 | android:textSize="22sp" /> |
| 288 | 284 | ||
| 289 | <EditText | 285 | <EditText |
| 290 | android:id="@+id/et_edit_telphone" | 286 | android:id="@+id/et_edit_telphone" |
| 291 | android:layout_width="wrap_content" | 287 | android:layout_width="wrap_content" |
| 292 | android:layout_height="wrap_content" | 288 | android:layout_height="wrap_content" |
| 293 | android:layout_marginLeft="20dp" | 289 | android:layout_marginLeft="20dp" |
| 294 | android:background="@null" | 290 | android:background="@null" |
| 295 | android:hint="请输入" | 291 | android:hint="请输入" |
| 296 | android:textColor="@color/electronic_text" | 292 | android:textColor="@color/electronic_text" |
| 297 | android:textSize="22sp" /> | 293 | android:textSize="22sp" /> |
| 298 | </LinearLayout> | 294 | </LinearLayout> |
| 299 | 295 | ||
| 300 | </LinearLayout> | 296 | </LinearLayout> |
| 301 | 297 | ||
| 302 | <LinearLayout | 298 | <LinearLayout |
| 303 | android:layout_width="wrap_content" | 299 | android:layout_width="wrap_content" |
| 304 | android:layout_height="wrap_content" | 300 | android:layout_height="wrap_content" |
| 305 | 301 | ||
| 306 | android:orientation="horizontal"> | 302 | android:orientation="horizontal"> |
| 307 | 303 | ||
| 308 | <View | 304 | <View |
| 309 | android:layout_width="450dp" | 305 | android:layout_width="450dp" |
| 310 | android:layout_height="0.7dp" | 306 | android:layout_height="0.7dp" |
| 311 | android:layout_marginLeft="150dp" | 307 | android:layout_marginLeft="150dp" |
| 312 | android:background="@color/electronic_text"> | 308 | android:background="@color/electronic_text"> |
| 313 | 309 | ||
| 314 | </View> | 310 | </View> |
| 315 | 311 | ||
| 316 | <View | 312 | <View |
| 317 | android:layout_width="450dp" | 313 | android:layout_width="450dp" |
| 318 | android:layout_height="0.7dp" | 314 | android:layout_height="0.7dp" |
| 319 | android:layout_marginLeft="80dp" | 315 | android:layout_marginLeft="80dp" |
| 320 | android:background="@color/electronic_text"> | 316 | android:background="@color/electronic_text"> |
| 321 | 317 | ||
| 322 | </View> | 318 | </View> |
| 323 | 319 | ||
| 324 | 320 | ||
| 325 | </LinearLayout> | 321 | </LinearLayout> |
| 326 | 322 | ||
| 327 | <LinearLayout | 323 | <LinearLayout |
| 328 | android:layout_width="match_parent" | 324 | android:layout_width="match_parent" |
| 329 | android:layout_height="wrap_content" | 325 | android:layout_height="wrap_content" |
| 330 | android:layout_marginLeft="200dp" | 326 | android:layout_marginLeft="200dp" |
| 331 | android:gravity="center_vertical" | 327 | android:gravity="center_vertical" |
| 332 | android:orientation="horizontal"> | 328 | android:orientation="horizontal"> |
| 333 | 329 | ||
| 334 | <LinearLayout | 330 | <LinearLayout |
| 335 | android:id="@+id/lineL_buy_time" | 331 | android:id="@+id/lineL_buy_time" |
| 336 | android:layout_width="0dp" | 332 | android:layout_width="0dp" |
| 337 | android:layout_height="80dp" | 333 | android:layout_height="80dp" |
| 338 | android:layout_weight="1" | 334 | android:layout_weight="1" |
| 339 | android:gravity="center_vertical"> | 335 | android:gravity="center_vertical"> |
| 340 | 336 | ||
| 341 | <TextView | 337 | <TextView |
| 342 | android:layout_width="wrap_content" | 338 | android:layout_width="wrap_content" |
| 343 | android:layout_height="wrap_content" | 339 | android:layout_height="wrap_content" |
| 344 | android:text="购买时间" | 340 | android:text="购买时间" |
| 345 | android:textColor="@color/pickerview_wheelview_textcolor_center" | ||
| 346 | android:textSize="22sp" /> | 341 | android:textSize="22sp" /> |
| 347 | 342 | ||
| 348 | <TextView | 343 | <TextView |
| 349 | android:id="@+id/tv_buy_time" | 344 | android:id="@+id/tv_buy_time" |
| 350 | android:layout_width="wrap_content" | 345 | android:layout_width="wrap_content" |
| 351 | android:layout_height="wrap_content" | 346 | android:layout_height="wrap_content" |
| 352 | android:layout_marginLeft="50dp" | 347 | android:layout_marginLeft="50dp" |
| 353 | android:hint="请选择时间" | 348 | android:hint="请选择时间" |
| 354 | android:textSize="22sp" /> | 349 | android:textSize="22sp" /> |
| 355 | 350 | ||
| 356 | <ImageView | 351 | <ImageView |
| 357 | android:layout_width="wrap_content" | 352 | android:layout_width="wrap_content" |
| 358 | android:layout_height="wrap_content" | 353 | android:layout_height="wrap_content" |
| 359 | android:layout_marginLeft="60dp" | 354 | android:layout_marginLeft="60dp" |
| 360 | android:src="@mipmap/xiajiantou"> | 355 | android:src="@mipmap/xiajiantou"> |
| 361 | 356 | ||
| 362 | </ImageView> | 357 | </ImageView> |
| 363 | 358 | ||
| 364 | </LinearLayout> | 359 | </LinearLayout> |
| 365 | 360 | ||
| 366 | </LinearLayout> | 361 | </LinearLayout> |
| 367 | 362 | ||
| 368 | <LinearLayout | 363 | <LinearLayout |
| 369 | android:layout_width="wrap_content" | 364 | android:layout_width="wrap_content" |
| 370 | android:layout_height="wrap_content" | 365 | android:layout_height="wrap_content" |
| 371 | android:orientation="horizontal"> | 366 | android:orientation="horizontal"> |
| 372 | 367 | ||
| 373 | <View | 368 | <View |
| 374 | android:layout_width="450dp" | 369 | android:layout_width="450dp" |
| 375 | android:layout_height="0.7dp" | 370 | android:layout_height="0.7dp" |
| 376 | android:layout_marginLeft="150dp" | 371 | android:layout_marginLeft="150dp" |
| 377 | android:background="@color/electronic_text"> | 372 | android:background="@color/electronic_text"> |
| 378 | 373 | ||
| 379 | </View> | 374 | </View> |
| 380 | 375 | ||
| 381 | 376 | ||
| 382 | </LinearLayout> | 377 | </LinearLayout> |
| 383 | 378 | ||
| 384 | <Button | 379 | <Button |
| 385 | android:id="@+id/btn_change_info" | 380 | android:id="@+id/btn_change_info" |
| 386 | style="@style/button_login_register_style" | 381 | style="@style/button_login_register_style" |
| 387 | android:layout_marginLeft="200dp" | 382 | android:layout_marginLeft="200dp" |
| 388 | android:layout_marginRight="200dp" | 383 | android:layout_marginRight="200dp" |
| 389 | android:layout_marginTop="80dp" | 384 | android:layout_marginTop="80dp" |
| 390 | android:text="@string/string_regist_next" /> | 385 | android:text="@string/string_regist_next" /> |
| 391 | 386 | ||
| 392 | 387 | ||
| 393 | </LinearLayout> | 388 | </LinearLayout> |
PersonalCenter/app/src/main/res/layout/activity_main.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
| 4 | android:layout_height="match_parent" | 4 | android:layout_height="match_parent" |
| 5 | xmlns:fresco="http://schemas.android.com/apk/res-auto" | 5 | xmlns:fresco="http://schemas.android.com/apk/res-auto" |
| 6 | android:orientation="vertical"> | 6 | android:orientation="vertical"> |
| 7 | 7 | ||
| 8 | <RelativeLayout | 8 | <RelativeLayout |
| 9 | android:id="@+id/title" | 9 | android:id="@+id/title" |
| 10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
| 11 | android:layout_height="50dp" | 11 | android:layout_height="50dp" |
| 12 | android:background="@color/login_text_blue"> | 12 | android:background="@color/login_text_blue"> |
| 13 | 13 | ||
| 14 | <ImageView | 14 | <ImageView |
| 15 | android:id="@+id/cancel" | 15 | android:id="@+id/cancel" |
| 16 | android:layout_width="wrap_content" | 16 | android:layout_width="wrap_content" |
| 17 | android:layout_height="match_parent" | 17 | android:layout_height="match_parent" |
| 18 | android:paddingLeft="20dp" | 18 | android:paddingLeft="20dp" |
| 19 | android:paddingRight="20dp" | 19 | android:paddingRight="20dp" |
| 20 | android:visibility="gone" | 20 | android:visibility="gone" |
| 21 | android:src="@mipmap/title_back" /> | 21 | android:src="@mipmap/title_back" /> |
| 22 | 22 | ||
| 23 | <TextView | 23 | <TextView |
| 24 | android:id="@+id/menu_title" | 24 | android:id="@+id/menu_title" |
| 25 | android:layout_width="wrap_content" | 25 | android:layout_width="wrap_content" |
| 26 | android:layout_height="match_parent" | 26 | android:layout_height="match_parent" |
| 27 | android:layout_centerInParent="true" | 27 | android:layout_centerInParent="true" |
| 28 | android:gravity="center_vertical" | 28 | android:gravity="center_vertical" |
| 29 | android:text="@string/titel_preson" | 29 | android:text="@string/titel_preson" |
| 30 | android:textColor="@android:color/white" | 30 | android:textColor="@android:color/white" |
| 31 | android:textSize="22sp" /> | 31 | android:textSize="22sp" /> |
| 32 | 32 | ||
| 33 | <ImageView | 33 | <ImageView |
| 34 | android:id="@+id/iv_setting" | 34 | android:id="@+id/iv_setting" |
| 35 | android:layout_width="wrap_content" | 35 | android:layout_width="wrap_content" |
| 36 | android:layout_height="match_parent" | 36 | android:layout_height="match_parent" |
| 37 | android:layout_marginRight="10dp" | 37 | android:layout_marginRight="10dp" |
| 38 | android:layout_toLeftOf="@+id/iv_skin" | 38 | android:layout_toLeftOf="@+id/iv_skin" |
| 39 | android:gravity="center_vertical" | 39 | android:gravity="center_vertical" |
| 40 | android:padding="10dp" | 40 | android:padding="10dp" |
| 41 | android:src="@mipmap/shezhi" | 41 | android:src="@mipmap/shezhi" |
| 42 | android:textColor="@android:color/white" | 42 | android:textColor="@android:color/white" |
| 43 | android:textSize="22sp" /> | 43 | android:textSize="22sp" /> |
| 44 | 44 | ||
| 45 | <ImageView | 45 | <ImageView |
| 46 | android:id="@+id/iv_skin" | 46 | android:id="@+id/iv_skin" |
| 47 | android:layout_width="wrap_content" | 47 | android:layout_width="wrap_content" |
| 48 | android:layout_height="match_parent" | 48 | android:layout_height="match_parent" |
| 49 | android:layout_marginRight="10dp" | 49 | android:layout_marginRight="10dp" |
| 50 | android:layout_toLeftOf="@+id/iv_imformatioan" | 50 | android:layout_toLeftOf="@+id/iv_imformatioan" |
| 51 | android:gravity="center_vertical" | 51 | android:gravity="center_vertical" |
| 52 | android:padding="10dp" | 52 | android:padding="10dp" |
| 53 | android:src="@mipmap/pifu" | 53 | android:src="@mipmap/pifu" |
| 54 | android:textColor="@android:color/white" | 54 | android:textColor="@android:color/white" |
| 55 | android:textSize="22sp" /> | 55 | android:textSize="22sp" /> |
| 56 | 56 | ||
| 57 | <ImageView | 57 | <ImageView |
| 58 | android:id="@+id/iv_imformatioan" | 58 | android:id="@+id/iv_imformatioan" |
| 59 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
| 60 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
| 61 | android:layout_alignParentRight="true" | 61 | android:layout_alignParentRight="true" |
| 62 | android:layout_marginRight="10dp" | 62 | android:layout_marginRight="10dp" |
| 63 | android:gravity="center_vertical" | 63 | android:gravity="center_vertical" |
| 64 | android:padding="10dp" | 64 | android:padding="10dp" |
| 65 | android:src="@mipmap/fankui" | 65 | android:src="@mipmap/fankui" |
| 66 | android:textColor="@android:color/white" | 66 | android:textColor="@android:color/white" |
| 67 | android:textSize="22sp" /> | 67 | android:textSize="22sp" /> |
| 68 | 68 | ||
| 69 | 69 | ||
| 70 | </RelativeLayout> | 70 | </RelativeLayout> |
| 71 | 71 | ||
| 72 | <LinearLayout | 72 | <LinearLayout |
| 73 | android:layout_width="match_parent" | 73 | android:layout_width="match_parent" |
| 74 | android:layout_height="match_parent"> | 74 | android:layout_height="match_parent"> |
| 75 | 75 | ||
| 76 | <LinearLayout | 76 | <LinearLayout |
| 77 | android:layout_width="0dp" | 77 | android:layout_width="0dp" |
| 78 | android:layout_height="match_parent" | 78 | android:layout_height="match_parent" |
| 79 | android:layout_weight="1" | 79 | android:layout_weight="1" |
| 80 | android:orientation="vertical"> | 80 | android:orientation="vertical"> |
| 81 | 81 | ||
| 82 | <LinearLayout | 82 | <LinearLayout |
| 83 | android:layout_width="match_parent" | 83 | android:layout_width="match_parent" |
| 84 | android:layout_height="wrap_content" | 84 | android:layout_height="wrap_content" |
| 85 | android:layout_marginTop="20dp" | 85 | android:layout_marginTop="20dp" |
| 86 | android:orientation="horizontal"> | 86 | android:orientation="horizontal"> |
| 87 | <ImageView | 87 | <ImageView |
| 88 | android:id="@+id/iv_look_card" | 88 | android:id="@+id/iv_look_card" |
| 89 | android:layout_width="wrap_content" | 89 | android:layout_width="wrap_content" |
| 90 | android:layout_height="wrap_content" | 90 | android:layout_height="wrap_content" |
| 91 | android:padding="10dp" | 91 | android:padding="10dp" |
| 92 | android:layout_marginLeft="20dp" | 92 | android:layout_marginLeft="20dp" |
| 93 | android:src="@mipmap/card_icoc" /> | 93 | android:src="@mipmap/card_icoc" /> |
| 94 | <com.facebook.drawee.view.SimpleDraweeView | 94 | <com.facebook.drawee.view.SimpleDraweeView |
| 95 | android:id="@+id/iv_head" | 95 | android:id="@+id/iv_head" |
| 96 | android:layout_width="60dp" | 96 | android:layout_width="60dp" |
| 97 | android:layout_height="60dp" | 97 | android:layout_height="60dp" |
| 98 | android:layout_marginLeft="60dp" | 98 | android:layout_marginLeft="60dp" |
| 99 | android:layout_gravity="center" | 99 | android:layout_gravity="center" |
| 100 | fresco:placeholderImage="@mipmap/header_default" | 100 | fresco:placeholderImage="@mipmap/header_default" |
| 101 | fresco:roundAsCircle="true" | 101 | fresco:roundAsCircle="true" |
| 102 | fresco:placeholderImageScaleType="fitCenter" /> | 102 | fresco:placeholderImageScaleType="fitCenter" /> |
| 103 | 103 | ||
| 104 | <TextView | 104 | <TextView |
| 105 | android:layout_width="wrap_content" | 105 | android:layout_width="wrap_content" |
| 106 | android:layout_height="wrap_content" | 106 | android:layout_height="wrap_content" |
| 107 | android:layout_marginLeft="18dp" | 107 | android:layout_marginLeft="18dp" |
| 108 | android:layout_marginTop="20dp" | 108 | android:layout_marginTop="20dp" |
| 109 | android:background="@drawable/corcle_blue_bg" | 109 | android:background="@drawable/corcle_blue_bg" |
| 110 | android:paddingLeft="5dp" | 110 | android:paddingLeft="5dp" |
| 111 | android:paddingRight="5dp" | 111 | android:paddingRight="5dp" |
| 112 | android:gravity="center_vertical" | 112 | android:gravity="center_vertical" |
| 113 | android:text="签到" | 113 | android:text="签到" |
| 114 | android:textColor="@color/login_text_blue" | 114 | android:textColor="@color/login_text_blue" |
| 115 | android:textSize="18sp" /> | 115 | android:textSize="18sp" /> |
| 116 | 116 | ||
| 117 | </LinearLayout> | 117 | </LinearLayout> |
| 118 | 118 | ||
| 119 | <LinearLayout | 119 | <LinearLayout |
| 120 | android:layout_width="match_parent" | 120 | android:layout_width="match_parent" |
| 121 | android:layout_height="wrap_content" | 121 | android:layout_height="wrap_content" |
| 122 | android:layout_marginLeft="20dp" | 122 | android:layout_marginLeft="20dp" |
| 123 | android:layout_marginTop="20dp" | 123 | android:layout_marginTop="20dp" |
| 124 | android:orientation="horizontal"> | 124 | android:orientation="horizontal"> |
| 125 | 125 | ||
| 126 | <TextView | 126 | <TextView |
| 127 | android:id="@+id/tv_username" | 127 | android:id="@+id/tv_username" |
| 128 | android:layout_width="wrap_content" | 128 | android:layout_width="wrap_content" |
| 129 | android:layout_height="wrap_content" | 129 | android:layout_height="wrap_content" |
| 130 | android:text="熊巍" | 130 | android:text="熊巍" |
| 131 | android:textSize="20dp" /> | 131 | android:textSize="20dp" /> |
| 132 | 132 | ||
| 133 | <ImageView | 133 | <ImageView |
| 134 | android:id="@+id/iv_sex" | 134 | android:id="@+id/iv_sex" |
| 135 | android:layout_width="wrap_content" | 135 | android:layout_width="wrap_content" |
| 136 | android:layout_height="wrap_content" | 136 | android:layout_height="wrap_content" |
| 137 | android:layout_marginLeft="50dp" | 137 | android:layout_marginLeft="50dp" |
| 138 | android:src="@mipmap/men" /> | 138 | android:src="@mipmap/men" /> |
| 139 | 139 | ||
| 140 | </LinearLayout> | 140 | </LinearLayout> |
| 141 | 141 | ||
| 142 | <LinearLayout | 142 | <LinearLayout |
| 143 | android:layout_width="match_parent" | 143 | android:layout_width="match_parent" |
| 144 | android:layout_height="wrap_content" | 144 | android:layout_height="wrap_content" |
| 145 | android:layout_marginLeft="20dp" | 145 | android:layout_marginLeft="20dp" |
| 146 | android:layout_marginTop="20dp" | 146 | android:layout_marginTop="20dp" |
| 147 | android:gravity="center" | 147 | android:gravity="center" |
| 148 | android:orientation="horizontal"> | 148 | android:orientation="horizontal"> |
| 149 | 149 | ||
| 150 | <TextView | 150 | <TextView |
| 151 | android:id="@+id/tv_sign" | 151 | android:id="@+id/tv_sign" |
| 152 | android:layout_width="0dp" | 152 | android:layout_width="0dp" |
| 153 | android:layout_height="wrap_content" | 153 | android:layout_height="wrap_content" |
| 154 | android:layout_weight="5" | 154 | android:layout_weight="5" |
| 155 | android:text="请输入个性签名" | 155 | android:text="请输入个性签名" |
| 156 | android:textSize="18sp" /> | 156 | android:textSize="18sp" /> |
| 157 | 157 | ||
| 158 | <ImageView | 158 | <ImageView |
| 159 | android:id="@+id/iv_sign" | 159 | android:id="@+id/iv_sign" |
| 160 | android:layout_width="0dp" | 160 | android:layout_width="0dp" |
| 161 | android:layout_height="wrap_content" | 161 | android:layout_height="wrap_content" |
| 162 | android:layout_weight="1" | 162 | android:layout_weight="1" |
| 163 | android:padding="10dp" | 163 | android:padding="10dp" |
| 164 | android:src="@mipmap/pencil" /> | 164 | android:src="@mipmap/pencil" /> |
| 165 | 165 | ||
| 166 | 166 | ||
| 167 | </LinearLayout> | 167 | </LinearLayout> |
| 168 | 168 | ||
| 169 | <View | 169 | <View |
| 170 | android:layout_width="match_parent" | 170 | android:layout_width="match_parent" |
| 171 | android:layout_height="0.7dp" | 171 | android:layout_height="0.7dp" |
| 172 | android:layout_marginTop="20dp" | 172 | android:layout_marginTop="20dp" |
| 173 | android:background="@color/cutoff_line"> | 173 | android:background="@color/cutoff_line"> |
| 174 | 174 | ||
| 175 | </View> | 175 | </View> |
| 176 | 176 | ||
| 177 | <LinearLayout | 177 | <LinearLayout |
| 178 | android:id="@+id/linel_mycuoti" | 178 | android:id="@+id/linel_mycuoti" |
| 179 | android:layout_width="match_parent" | 179 | android:layout_width="match_parent" |
| 180 | android:layout_height="wrap_content" | 180 | android:layout_height="wrap_content" |
| 181 | android:layout_marginTop="30dp" | 181 | android:layout_marginTop="30dp" |
| 182 | android:orientation="vertical"> | 182 | android:orientation="vertical"> |
| 183 | 183 | ||
| 184 | <LinearLayout | 184 | <LinearLayout |
| 185 | android:layout_width="match_parent" | 185 | android:layout_width="match_parent" |
| 186 | android:layout_height="wrap_content" | 186 | android:layout_height="wrap_content" |
| 187 | android:gravity="center_vertical" | 187 | android:gravity="center_vertical" |
| 188 | android:orientation="horizontal"> | 188 | android:orientation="horizontal"> |
| 189 | 189 | ||
| 190 | <ImageView | 190 | <ImageView |
| 191 | android:layout_width="0dp" | 191 | android:layout_width="0dp" |
| 192 | android:layout_height="wrap_content" | 192 | android:layout_height="wrap_content" |
| 193 | android:layout_weight="1" | 193 | android:layout_weight="1" |
| 194 | android:src="@mipmap/wodecuoti" /> | 194 | android:src="@mipmap/wodecuoti" /> |
| 195 | 195 | ||
| 196 | <TextView | 196 | <TextView |
| 197 | android:layout_width="0dp" | 197 | android:layout_width="0dp" |
| 198 | android:layout_height="wrap_content" | 198 | android:layout_height="wrap_content" |
| 199 | android:layout_weight="5" | 199 | android:layout_weight="5" |
| 200 | android:text="我的错题" | 200 | android:text="我的错题" |
| 201 | android:textSize="20sp" /> | 201 | android:textSize="20sp" /> |
| 202 | 202 | ||
| 203 | <ImageView | 203 | <ImageView |
| 204 | android:layout_width="0dp" | 204 | android:layout_width="0dp" |
| 205 | android:layout_height="wrap_content" | 205 | android:layout_height="wrap_content" |
| 206 | android:layout_weight="1" | 206 | android:layout_weight="1" |
| 207 | android:src="@mipmap/youjiantou" /> | 207 | android:src="@mipmap/youjiantou" /> |
| 208 | 208 | ||
| 209 | </LinearLayout> | 209 | </LinearLayout> |
| 210 | 210 | ||
| 211 | <LinearLayout | 211 | <LinearLayout |
| 212 | android:id="@+id/linel_mynote" | 212 | android:id="@+id/linel_mynote" |
| 213 | android:layout_width="match_parent" | 213 | android:layout_width="match_parent" |
| 214 | android:layout_height="wrap_content" | 214 | android:layout_height="wrap_content" |
| 215 | android:layout_marginTop="35dp" | 215 | android:layout_marginTop="35dp" |
| 216 | android:gravity="center_vertical" | 216 | android:gravity="center_vertical" |
| 217 | android:orientation="horizontal"> | 217 | android:orientation="horizontal"> |
| 218 | 218 | ||
| 219 | <ImageView | 219 | <ImageView |
| 220 | android:layout_width="0dp" | 220 | android:layout_width="0dp" |
| 221 | android:layout_height="wrap_content" | 221 | android:layout_height="wrap_content" |
| 222 | android:layout_weight="1" | 222 | android:layout_weight="1" |
| 223 | android:src="@mipmap/wodebiji" /> | 223 | android:src="@mipmap/wodebiji" /> |
| 224 | 224 | ||
| 225 | <TextView | 225 | <TextView |
| 226 | android:layout_width="0dp" | 226 | android:layout_width="0dp" |
| 227 | android:layout_height="wrap_content" | 227 | android:layout_height="wrap_content" |
| 228 | android:layout_weight="5" | 228 | android:layout_weight="5" |
| 229 | android:text="我的笔记" | 229 | android:text="我的笔记" |
| 230 | android:textSize="20sp" /> | 230 | android:textSize="20sp" /> |
| 231 | 231 | ||
| 232 | <ImageView | 232 | <ImageView |
| 233 | android:layout_width="0dp" | 233 | android:layout_width="0dp" |
| 234 | android:layout_height="wrap_content" | 234 | android:layout_height="wrap_content" |
| 235 | android:layout_weight="1" | 235 | android:layout_weight="1" |
| 236 | android:src="@mipmap/youjiantou" /> | 236 | android:src="@mipmap/youjiantou" /> |
| 237 | 237 | ||
| 238 | </LinearLayout> | 238 | </LinearLayout> |
| 239 | 239 | ||
| 240 | <LinearLayout | 240 | <LinearLayout |
| 241 | android:id="@+id/linel_mycollege" | 241 | android:id="@+id/linel_mycollege" |
| 242 | android:layout_width="match_parent" | 242 | android:layout_width="match_parent" |
| 243 | android:layout_height="wrap_content" | 243 | android:layout_height="wrap_content" |
| 244 | android:layout_marginTop="35dp" | 244 | android:layout_marginTop="35dp" |
| 245 | android:gravity="center_vertical" | 245 | android:gravity="center_vertical" |
| 246 | android:orientation="horizontal"> | 246 | android:orientation="horizontal"> |
| 247 | 247 | ||
| 248 | <ImageView | 248 | <ImageView |
| 249 | android:layout_width="0dp" | 249 | android:layout_width="0dp" |
| 250 | android:layout_height="wrap_content" | 250 | android:layout_height="wrap_content" |
| 251 | android:layout_weight="1" | 251 | android:layout_weight="1" |
| 252 | android:src="@mipmap/wodeshoucang" /> | 252 | android:src="@mipmap/wodeshoucang" /> |
| 253 | 253 | ||
| 254 | <TextView | 254 | <TextView |
| 255 | android:layout_width="0dp" | 255 | android:layout_width="0dp" |
| 256 | android:layout_height="wrap_content" | 256 | android:layout_height="wrap_content" |
| 257 | android:layout_weight="5" | 257 | android:layout_weight="5" |
| 258 | android:text="我的收藏" | 258 | android:text="我的收藏" |
| 259 | android:textSize="20sp" /> | 259 | android:textSize="20sp" /> |
| 260 | 260 | ||
| 261 | <ImageView | 261 | <ImageView |
| 262 | android:layout_width="0dp" | 262 | android:layout_width="0dp" |
| 263 | android:layout_height="wrap_content" | 263 | android:layout_height="wrap_content" |
| 264 | android:layout_weight="1" | 264 | android:layout_weight="1" |
| 265 | android:src="@mipmap/youjiantou" /> | 265 | android:src="@mipmap/youjiantou" /> |
| 266 | 266 | ||
| 267 | </LinearLayout> | 267 | </LinearLayout> |
| 268 | 268 | ||
| 269 | <LinearLayout | 269 | <LinearLayout |
| 270 | android:id="@+id/linel_myclass" | 270 | android:id="@+id/linel_myclass" |
| 271 | android:layout_width="match_parent" | 271 | android:layout_width="match_parent" |
| 272 | android:layout_height="wrap_content" | 272 | android:layout_height="wrap_content" |
| 273 | android:layout_marginTop="35dp" | 273 | android:layout_marginTop="35dp" |
| 274 | android:gravity="center_vertical" | 274 | android:gravity="center_vertical" |
| 275 | android:orientation="horizontal"> | 275 | android:orientation="horizontal"> |
| 276 | 276 | ||
| 277 | <ImageView | 277 | <ImageView |
| 278 | android:layout_width="0dp" | 278 | android:layout_width="0dp" |
| 279 | android:layout_height="wrap_content" | 279 | android:layout_height="wrap_content" |
| 280 | android:layout_weight="1" | 280 | android:layout_weight="1" |
| 281 | android:src="@mipmap/wodebanji" /> | 281 | android:src="@mipmap/wodebanji" /> |
| 282 | 282 | ||
| 283 | <TextView | 283 | <TextView |
| 284 | android:layout_width="0dp" | 284 | android:layout_width="0dp" |
| 285 | android:layout_height="wrap_content" | 285 | android:layout_height="wrap_content" |
| 286 | android:layout_weight="5" | 286 | android:layout_weight="5" |
| 287 | android:text="我的班级" | 287 | android:text="我的班级" |
| 288 | android:textSize="20sp" /> | 288 | android:textSize="20sp" /> |
| 289 | 289 | ||
| 290 | <ImageView | 290 | <ImageView |
| 291 | android:layout_width="0dp" | 291 | android:layout_width="0dp" |
| 292 | android:layout_height="wrap_content" | 292 | android:layout_height="wrap_content" |
| 293 | android:layout_weight="1" | 293 | android:layout_weight="1" |
| 294 | android:src="@mipmap/youjiantou" /> | 294 | android:src="@mipmap/youjiantou" /> |
| 295 | 295 | ||
| 296 | </LinearLayout> | 296 | </LinearLayout> |
| 297 | 297 | ||
| 298 | 298 | ||
| 299 | </LinearLayout> | 299 | </LinearLayout> |
| 300 | 300 | ||
| 301 | <LinearLayout | 301 | <LinearLayout |
| 302 | android:layout_width="match_parent" | 302 | android:layout_width="match_parent" |
| 303 | android:layout_height="match_parent" | 303 | android:layout_height="match_parent" |
| 304 | android:layout_marginTop="120dp" | 304 | android:layout_marginTop="120dp" |
| 305 | android:background="@mipmap/xiaoguanggao"> | 305 | android:background="@mipmap/xiaoguanggao"> |
| 306 | 306 | ||
| 307 | </LinearLayout> | 307 | </LinearLayout> |
| 308 | 308 | ||
| 309 | 309 | ||
| 310 | </LinearLayout> | 310 | </LinearLayout> |
| 311 | 311 | ||
| 312 | 312 | ||
| 313 | <View | 313 | <View |
| 314 | android:layout_width="0.7dp" | 314 | android:layout_width="0.7dp" |
| 315 | android:layout_height="match_parent" | 315 | android:layout_height="match_parent" |
| 316 | android:background="@color/cutoff_line"> | 316 | android:background="@color/cutoff_line"> |
| 317 | 317 | ||
| 318 | </View> | 318 | </View> |
| 319 | 319 | ||
| 320 | <LinearLayout | 320 | <LinearLayout |
| 321 | android:layout_width="0dp" | 321 | android:layout_width="0dp" |
| 322 | android:layout_height="match_parent" | 322 | android:layout_height="match_parent" |
| 323 | android:layout_weight="2.5" | 323 | android:layout_weight="2.5" |
| 324 | android:orientation="vertical"> | 324 | android:orientation="vertical"> |
| 325 | 325 | ||
| 326 | <LinearLayout | 326 | <LinearLayout |
| 327 | android:layout_width="match_parent" | 327 | android:layout_width="match_parent" |
| 328 | android:layout_height="wrap_content" | 328 | android:layout_height="wrap_content" |
| 329 | android:layout_margin="20dp" | 329 | android:layout_margin="20dp" |
| 330 | android:gravity="center_vertical" | 330 | android:gravity="center_vertical" |
| 331 | android:orientation="horizontal"> | 331 | android:orientation="horizontal"> |
| 332 | 332 | ||
| 333 | <View | 333 | <View |
| 334 | android:layout_width="5dp" | 334 | android:layout_width="5dp" |
| 335 | android:layout_height="20dp" | 335 | android:layout_height="20dp" |
| 336 | android:background="@color/login_text_blue"> | 336 | android:background="@color/login_text_blue"> |
| 337 | 337 | ||
| 338 | </View> | 338 | </View> |
| 339 | 339 | ||
| 340 | <TextView | 340 | <TextView |
| 341 | android:layout_width="wrap_content" | 341 | android:layout_width="wrap_content" |
| 342 | android:layout_height="wrap_content" | 342 | android:layout_height="wrap_content" |
| 343 | android:layout_marginLeft="5dp" | 343 | android:layout_marginLeft="5dp" |
| 344 | android:text="最近学习" | 344 | android:text="最近学习" |
| 345 | android:textSize="22sp" /> | 345 | android:textSize="22sp" /> |
| 346 | 346 | ||
| 347 | </LinearLayout> | 347 | </LinearLayout> |
| 348 | 348 | ||
| 349 | <LinearLayout | 349 | <LinearLayout |
| 350 | android:layout_width="match_parent" | 350 | android:layout_width="match_parent" |
| 351 | android:layout_height="wrap_content"> | 351 | android:layout_height="wrap_content"> |
| 352 | 352 | ||
| 353 | <TextView | 353 | <android.support.v7.widget.RecyclerView |
| 354 | android:id="@+id/list_item_study" | 354 | android:id="@+id/id_recyclerview_horizontal" |
| 355 | android:layout_width="match_parent" | 355 | android:layout_width="match_parent" |
| 356 | android:layout_height="100dp" | 356 | android:layout_height="wrap_content" |
| 357 | android:layout_marginLeft="20dp" | 357 | android:layout_centerVertical="true" |
| 358 | android:layout_marginTop="10dp" | 358 | android:scrollbars="none" |
| 359 | android:gravity="center" | 359 | > |
| 360 | android:text="这里需要显示水平滑动的" /> | 360 | |
| 361 | </android.support.v7.widget.RecyclerView> | ||
| 361 | </LinearLayout> | 362 | </LinearLayout> |
| 362 | 363 | ||
| 363 | <View | 364 | <View |
| 364 | android:layout_width="match_parent" | 365 | android:layout_width="match_parent" |
| 365 | android:layout_height="0.7dp" | 366 | android:layout_height="0.7dp" |
| 366 | android:background="@color/cutoff_line"> | 367 | android:background="@color/cutoff_line"> |
| 367 | 368 | ||
| 368 | </View> | 369 | </View> |
| 369 | 370 | ||
| 370 | <LinearLayout | 371 | <LinearLayout |
| 371 | android:layout_width="match_parent" | 372 | android:layout_width="match_parent" |
| 372 | android:layout_height="wrap_content" | 373 | android:layout_height="wrap_content" |
| 373 | android:layout_margin="20dp" | 374 | android:layout_margin="20dp" |
| 374 | android:gravity="center_vertical" | 375 | android:gravity="center_vertical" |
| 375 | android:orientation="horizontal"> | 376 | android:orientation="horizontal"> |
| 376 | 377 | ||
| 377 | <View | 378 | <View |
| 378 | android:layout_width="5dp" | 379 | android:layout_width="5dp" |
| 379 | android:layout_height="20dp" | 380 | android:layout_height="20dp" |
| 380 | android:background="@color/login_text_blue"> | 381 | android:background="@color/login_text_blue"> |
| 381 | 382 | ||
| 382 | </View> | 383 | </View> |
| 383 | 384 | ||
| 384 | <TextView | 385 | <TextView |
| 385 | android:layout_width="0dp" | 386 | android:layout_width="0dp" |
| 386 | android:layout_height="wrap_content" | 387 | android:layout_height="wrap_content" |
| 387 | android:layout_marginLeft="5dp" | 388 | android:layout_marginLeft="5dp" |
| 388 | android:layout_weight="2" | 389 | android:layout_weight="2" |
| 389 | android:text="个人信息" | 390 | android:text="个人信息" |
| 390 | android:textSize="22sp" /> | 391 | android:textSize="22sp" /> |
| 391 | 392 | ||
| 392 | <TextView | 393 | <TextView |
| 393 | android:id="@+id/tv_edit_presoninfo" | 394 | android:id="@+id/tv_edit_presoninfo" |
| 394 | android:padding="5dp" | 395 | android:padding="5dp" |
| 395 | android:layout_width="0dp" | 396 | android:layout_width="0dp" |
| 396 | android:layout_height="wrap_content" | 397 | android:layout_height="wrap_content" |
| 397 | android:layout_marginLeft="10dp" | 398 | android:layout_marginLeft="10dp" |
| 398 | android:layout_weight="0.2" | 399 | android:layout_weight="0.2" |
| 399 | android:text="编辑" | 400 | android:text="编辑" |
| 400 | android:textSize="18sp" /> | 401 | android:textSize="18sp" /> |
| 401 | 402 | ||
| 402 | <ImageView | 403 | <ImageView |
| 403 | android:layout_width="0dp" | 404 | android:layout_width="0dp" |
| 404 | android:layout_height="wrap_content" | 405 | android:layout_height="wrap_content" |
| 405 | android:layout_weight="0.1" | 406 | android:layout_weight="0.1" |
| 406 | 407 | ||
| 407 | android:src="@mipmap/youjiantou" /> | 408 | android:src="@mipmap/youjiantou" /> |
| 408 | 409 | ||
| 409 | 410 | ||
| 410 | </LinearLayout> | 411 | </LinearLayout> |
| 411 | 412 | ||
| 412 | <LinearLayout | 413 | <LinearLayout |
| 413 | android:layout_width="match_parent" | 414 | android:layout_width="match_parent" |
| 414 | android:layout_height="wrap_content" | 415 | android:layout_height="wrap_content" |
| 415 | android:layout_marginLeft="50dp" | 416 | android:layout_marginLeft="50dp" |
| 416 | android:layout_marginTop="10dp" | 417 | android:layout_marginTop="10dp" |
| 417 | android:orientation="vertical"> | 418 | android:orientation="vertical"> |
| 418 | 419 | ||
| 419 | <LinearLayout | 420 | <LinearLayout |
| 420 | android:layout_width="match_parent" | 421 | android:layout_width="match_parent" |
| 421 | android:layout_height="wrap_content" | 422 | android:layout_height="wrap_content" |
| 422 | android:gravity="center_vertical" | 423 | android:gravity="center_vertical" |
| 423 | android:orientation="horizontal"> | 424 | android:orientation="horizontal"> |
| 424 | 425 | ||
| 425 | <TextView | 426 | <TextView |
| 426 | android:layout_width="0dp" | 427 | android:layout_width="0dp" |
| 427 | android:layout_height="wrap_content" | 428 | android:layout_height="wrap_content" |
| 428 | android:layout_weight="1" | 429 | android:layout_weight="1" |
| 429 | android:text="昵称" | 430 | android:text="昵称" |
| 430 | android:textSize="20sp" /> | 431 | android:textSize="20sp" /> |
| 431 | 432 | ||
| 432 | <TextView | 433 | <TextView |
| 433 | android:id="@+id/tv_username1" | 434 | android:id="@+id/tv_username1" |
| 434 | android:layout_width="0dp" | 435 | android:layout_width="0dp" |
| 435 | android:layout_height="wrap_content" | 436 | android:layout_height="wrap_content" |
| 436 | android:layout_weight="2" | 437 | android:layout_weight="2" |
| 437 | android:text="我的错题" | 438 | android:hint="未填写" |
| 438 | android:textSize="20sp" /> | 439 | android:textSize="20sp" /> |
| 439 | 440 | ||
| 440 | <TextView | 441 | <TextView |
| 441 | android:layout_width="1dp" | 442 | android:layout_width="1dp" |
| 442 | android:layout_height="wrap_content" | 443 | android:layout_height="wrap_content" |
| 443 | android:layout_weight="1" | 444 | android:layout_weight="1" |
| 444 | android:text="星座" | 445 | android:text="星座" |
| 445 | android:textSize="20sp" /> | 446 | android:textSize="20sp" /> |
| 446 | 447 | ||
| 447 | <TextView | 448 | <TextView |
| 448 | android:id="@+id/tv_mygad" | 449 | android:id="@+id/tv_mygad" |
| 449 | android:layout_width="0dp" | 450 | android:layout_width="0dp" |
| 450 | android:layout_height="wrap_content" | 451 | android:layout_height="wrap_content" |
| 451 | android:layout_weight="2" | 452 | android:layout_weight="2" |
| 452 | android:text="我的错题" | 453 | android:hint="未填写" |
| 453 | android:textSize="20sp" /> | 454 | android:textSize="20sp" /> |
| 454 | </LinearLayout> | 455 | </LinearLayout> |
| 455 | 456 | ||
| 456 | <LinearLayout | 457 | <LinearLayout |
| 457 | android:layout_width="match_parent" | 458 | android:layout_width="match_parent" |
| 458 | android:layout_height="wrap_content" | 459 | android:layout_height="wrap_content" |
| 459 | android:layout_marginTop="20dp" | 460 | android:layout_marginTop="20dp" |
| 460 | android:gravity="center_vertical" | 461 | android:gravity="center_vertical" |
| 461 | android:orientation="horizontal"> | 462 | android:orientation="horizontal"> |
| 462 | 463 | ||
| 463 | <TextView | 464 | <TextView |
| 464 | android:layout_width="0dp" | 465 | android:layout_width="0dp" |
| 465 | android:layout_height="wrap_content" | 466 | android:layout_height="wrap_content" |
| 466 | android:layout_weight="1" | 467 | android:layout_weight="1" |
| 467 | android:text="性别" | 468 | android:text="性别" |
| 468 | android:textSize="20sp" /> | 469 | android:textSize="20sp" /> |
| 469 | 470 | ||
| 470 | <TextView | 471 | <TextView |
| 471 | android:id="@+id/tv_sex" | 472 | android:id="@+id/tv_sex" |
| 472 | android:layout_width="0dp" | 473 | android:layout_width="0dp" |
| 473 | android:layout_height="wrap_content" | 474 | android:layout_height="wrap_content" |
| 474 | android:layout_weight="2" | 475 | android:layout_weight="2" |
| 475 | android:text="男" | 476 | android:hint="未填写" |
| 476 | android:textSize="20sp" /> | 477 | android:textSize="20sp" /> |
| 477 | 478 | ||
| 478 | <TextView | 479 | <TextView |
| 479 | android:layout_width="1dp" | 480 | android:layout_width="1dp" |
| 480 | android:layout_height="wrap_content" | 481 | android:layout_height="wrap_content" |
| 481 | android:layout_weight="1" | 482 | android:layout_weight="1" |
| 482 | android:text="地区" | 483 | android:text="地区" |
| 483 | android:textSize="20sp" /> | 484 | android:textSize="20sp" /> |
| 484 | 485 | ||
| 485 | <TextView | 486 | <TextView |
| 486 | android:id="@+id/tv_useinfo_adress" | 487 | android:id="@+id/tv_useinfo_adress" |
| 487 | android:layout_width="0dp" | 488 | android:layout_width="0dp" |
| 488 | android:layout_height="wrap_content" | 489 | android:layout_height="wrap_content" |
| 489 | android:layout_weight="2" | 490 | android:layout_weight="2" |
| 490 | android:text="我的错题" | 491 | android:hint="未填写" |
| 491 | android:textSize="20sp" /> | 492 | android:textSize="20sp" /> |
| 492 | </LinearLayout> | 493 | </LinearLayout> |
| 493 | 494 | ||
| 494 | <LinearLayout | 495 | <LinearLayout |
| 495 | android:layout_width="match_parent" | 496 | android:layout_width="match_parent" |
| 496 | android:layout_height="wrap_content" | 497 | android:layout_height="wrap_content" |
| 497 | android:layout_marginTop="20dp" | 498 | android:layout_marginTop="20dp" |
| 498 | android:gravity="center_vertical" | 499 | android:gravity="center_vertical" |
| 499 | android:orientation="horizontal"> | 500 | android:orientation="horizontal"> |
| 500 | 501 | ||
| 501 | <TextView | 502 | <TextView |
| 502 | android:layout_width="0dp" | 503 | android:layout_width="0dp" |
| 503 | android:layout_height="wrap_content" | 504 | android:layout_height="wrap_content" |
| 504 | android:layout_weight="1" | 505 | android:layout_weight="1" |
| 505 | android:text="生日" | 506 | android:text="生日" |
| 506 | android:textSize="20sp" /> | 507 | android:textSize="20sp" /> |
| 507 | 508 | ||
| 508 | <TextView | 509 | <TextView |
| 509 | android:id="@+id/tv_useinfo_birthday" | 510 | android:id="@+id/tv_useinfo_birthday" |
| 510 | android:layout_width="0dp" | 511 | android:layout_width="0dp" |
| 511 | android:layout_height="wrap_content" | 512 | android:layout_height="wrap_content" |
| 512 | android:layout_weight="2" | 513 | android:layout_weight="2" |
| 513 | android:text="我的错题" | 514 | android:hint="未填写" |
| 514 | android:textSize="20sp" /> | 515 | android:textSize="20sp" /> |
| 515 | 516 | ||
| 516 | <TextView | 517 | <TextView |
| 517 | android:layout_width="1dp" | 518 | android:layout_width="1dp" |
| 518 | android:layout_height="wrap_content" | 519 | android:layout_height="wrap_content" |
| 519 | android:layout_weight="1" | 520 | android:layout_weight="1" |
| 520 | android:text="学校" | 521 | android:text="学校" |
| 521 | android:textSize="20sp" /> | 522 | android:textSize="20sp" /> |
| 522 | 523 | ||
| 523 | <TextView | 524 | <TextView |
| 524 | android:id="@+id/tv_useinfo_school" | 525 | android:id="@+id/tv_useinfo_school" |
| 525 | android:layout_width="0dp" | 526 | android:layout_width="0dp" |
| 526 | android:layout_height="wrap_content" | 527 | android:layout_height="wrap_content" |
| 527 | android:layout_weight="2" | 528 | android:layout_weight="2" |
| 528 | android:text="我的错题" | 529 | android:hint="未填写" |
| 529 | android:textSize="20sp" /> | 530 | android:textSize="20sp" /> |
| 530 | </LinearLayout> | 531 | </LinearLayout> |
| 531 | 532 | ||
| 532 | <LinearLayout | 533 | <LinearLayout |
| 533 | android:layout_width="match_parent" | 534 | android:layout_width="match_parent" |
| 534 | android:layout_height="wrap_content" | 535 | android:layout_height="wrap_content" |
| 535 | android:layout_marginTop="20dp" | 536 | android:layout_marginTop="20dp" |
| 536 | android:gravity="center_vertical" | 537 | android:gravity="center_vertical" |
| 537 | android:orientation="horizontal"> | 538 | android:orientation="horizontal"> |
| 538 | 539 | ||
| 539 | <TextView | 540 | <TextView |
| 540 | android:layout_width="0dp" | 541 | android:layout_width="0dp" |
| 541 | android:layout_height="wrap_content" | 542 | android:layout_height="wrap_content" |
| 542 | android:layout_weight="1" | 543 | android:layout_weight="1" |
| 543 | android:text="Q Q" | 544 | android:text="Q Q" |
| 544 | android:textSize="20sp" /> | 545 | android:textSize="20sp" /> |
| 545 | 546 | ||
| 546 | <TextView | 547 | <TextView |
| 547 | android:id="@+id/tv_useinfo_qq" | 548 | android:id="@+id/tv_useinfo_qq" |
| 548 | android:layout_width="0dp" | 549 | android:layout_width="0dp" |
| 549 | android:layout_height="wrap_content" | 550 | android:layout_height="wrap_content" |
| 550 | android:layout_weight="2" | 551 | android:layout_weight="2" |
| 551 | android:text="我的错题" | 552 | android:hint="未填写" |
| 552 | android:textSize="20sp" /> | 553 | android:textSize="20sp" /> |
| 553 | 554 | ||
| 554 | <TextView | 555 | <TextView |
| 555 | android:layout_width="1dp" | 556 | android:layout_width="1dp" |
| 556 | android:layout_height="wrap_content" | 557 | android:layout_height="wrap_content" |
| 557 | android:layout_weight="1" | 558 | android:layout_weight="1" |
| 558 | android:text="年级" | 559 | android:text="年级" |
| 559 | android:textSize="20sp" /> | 560 | android:textSize="20sp" /> |
| 560 | 561 | ||
| 561 | <TextView | 562 | <TextView |
| 562 | android:id="@+id/tv_useinfo_gender" | 563 | android:id="@+id/tv_useinfo_gender" |
| 563 | android:layout_width="0dp" | 564 | android:layout_width="0dp" |
| 564 | android:layout_height="wrap_content" | 565 | android:layout_height="wrap_content" |
| 565 | android:layout_weight="2" | 566 | android:layout_weight="2" |
| 566 | android:text="我的错题" | 567 | android:hint="未填写" |
| 567 | android:textSize="20sp" /> | 568 | android:textSize="20sp" /> |
| 568 | </LinearLayout> | 569 | </LinearLayout> |
| 569 | 570 | ||
| 570 | 571 | ||
| 571 | </LinearLayout> | 572 | </LinearLayout> |
| 572 | <View | 573 | <View |
| 573 | android:layout_width="match_parent" | 574 | android:layout_width="match_parent" |
| 574 | android:layout_height="0.7dp" | 575 | android:layout_height="0.7dp" |
| 575 | android:layout_marginTop="20dp" | 576 | android:layout_marginTop="20dp" |
| 576 | android:background="@color/cutoff_line"> | 577 | android:background="@color/cutoff_line"> |
| 577 | 578 | ||
| 578 | </View> | 579 | </View> |
| 579 | <LinearLayout | 580 | <LinearLayout |
| 580 | android:layout_width="match_parent" | 581 | android:layout_width="match_parent" |
| 581 | android:layout_height="wrap_content" | 582 | android:layout_height="wrap_content" |
| 582 | android:layout_margin="20dp" | 583 | android:layout_margin="20dp" |
| 583 | android:gravity="center_vertical" | 584 | android:gravity="center_vertical" |
| 584 | android:orientation="horizontal"> | 585 | android:orientation="horizontal"> |
| 585 | 586 | ||
| 586 | <View | 587 | <View |
| 587 | android:layout_width="5dp" | 588 | android:layout_width="5dp" |
| 588 | android:layout_height="20dp" | 589 | android:layout_height="20dp" |
| 589 | android:background="@color/login_text_blue"> | 590 | android:background="@color/login_text_blue"> |
| 590 | 591 | ||
| 591 | </View> | 592 | </View> |
| 592 | 593 | ||
| 593 | <TextView | 594 | <TextView |
| 594 | android:layout_width="wrap_content" | 595 | android:layout_width="wrap_content" |
| 595 | android:layout_height="wrap_content" | 596 | android:layout_height="wrap_content" |
| 596 | android:layout_marginLeft="5dp" | 597 | android:layout_marginLeft="5dp" |
| 597 | android:text="版本信息" | 598 | android:text="版本信息" |
| 598 | android:textSize="22sp" /> | 599 | android:textSize="22sp" /> |
| 599 | 600 | ||
| 600 | </LinearLayout> | 601 | </LinearLayout> |
| 601 | 602 | ||
| 602 | <LinearLayout | 603 | <LinearLayout |
| 603 | android:layout_width="match_parent" | 604 | android:layout_width="match_parent" |
| 604 | android:layout_height="wrap_content" | 605 | android:layout_height="wrap_content" |
| 605 | android:layout_marginTop="20dp"> | 606 | android:layout_marginTop="20dp"> |
| 606 | 607 | ||
| 607 | <TextView | 608 | <TextView |
| 608 | android:layout_width="match_parent" | 609 | android:layout_width="match_parent" |
| 609 | android:layout_height="100dp" | 610 | android:layout_height="100dp" |
| 610 | android:layout_marginLeft="20dp" | 611 | android:layout_marginLeft="20dp" |
| 611 | android:layout_marginTop="10dp" | 612 | android:layout_marginTop="10dp" |
| 612 | android:gravity="center" | 613 | android:gravity="center" |
| 613 | android:text="这里需要显示水平滑动的" /> | 614 | android:text="这里需要显示水平滑动的" /> |
| 614 | </LinearLayout> | 615 | </LinearLayout> |
| 615 | 616 | ||
| 616 | 617 | ||
| 617 | </LinearLayout> | 618 | </LinearLayout> |
| 618 | 619 | ||
| 619 | 620 | ||
| 620 | </LinearLayout> | 621 | </LinearLayout> |
| 621 | 622 | ||
| 622 | 623 | ||
| 623 | </LinearLayout> | 624 | </LinearLayout> |
| 624 | 625 |
PersonalCenter/app/src/main/res/layout/recycler_item_view.xml
| File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
| 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | android:layout_width="match_parent" | ||
| 4 | android:layout_height="match_parent" | ||
| 5 | android:orientation="vertical"> | ||
| 6 | |||
| 7 | <LinearLayout | ||
| 8 | android:layout_width="wrap_content" | ||
| 9 | android:layout_height="wrap_content" | ||
| 10 | android:layout_gravity="center" | ||
| 11 | android:gravity="center" | ||
| 12 | android:orientation="vertical"> | ||
| 13 | |||
| 14 | <TextView | ||
| 15 | android:id="@+id/item_text" | ||
| 16 | android:layout_width="wrap_content" | ||
| 17 | android:layout_height="wrap_content" | ||
| 18 | android:text="test" | ||
| 19 | android:textColor="@android:color/black" | ||
| 20 | android:textSize="36sp" /> | ||
| 21 | |||
| 22 | <Button | ||
| 23 | android:id="@+id/item_button" | ||
| 24 | android:layout_width="wrap_content" | ||
| 25 | android:layout_height="wrap_content" | ||
| 26 | android:layout_marginTop="36dp" | ||
| 27 | android:text="下一页" | ||
| 28 | android:textSize="24sp" /> | ||
| 29 | </LinearLayout> | ||
| 30 | </LinearLayout> |