diff --git a/PersonalCenter/app/build.gradle b/PersonalCenter/app/build.gradle index 6257ec4..82077c6 100644 --- a/PersonalCenter/app/build.gradle +++ b/PersonalCenter/app/build.gradle @@ -39,4 +39,6 @@ dependencies { compile project(':pickerview') compile files('libs/android-async-http-1.4.8.jar') compile 'com.google.code.gson:gson:2.7' + compile 'com.zaaach:toprightmenu:1.0' + } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java index b5ac741..6873699 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java @@ -1,18 +1,62 @@ package com.hjx.personalcenter.activity; import android.app.Activity; +import android.content.Intent; import android.os.Bundle; +import android.view.View; +import android.widget.TextView; import com.hjx.personalcenter.R; +import com.hjx.personalcenter.db.Content; /**账户管理 熊巍 * Created by h on 2017/8/12. */ -public class AccountManagementActivity extends Activity { +public class AccountManagementActivity extends Activity implements View.OnClickListener { + private TextView changbangding,changpassword; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_account_management); + initView(); + initData(); + initLister(); + } + + private void initView() { + changbangding = (TextView) findViewById(R.id.changBangding); + changpassword = (TextView) findViewById(R.id.changpassword); + } + + private void initData() { + + } + + private void initLister() { + changbangding.setOnClickListener(this); + changpassword.setOnClickListener(this); + + + } + + @Override + public void onClick(View v) { + switch (v.getId()){ + case R.id.changBangding: + Intent changebangding = new Intent(); + changebangding.setClass(AccountManagementActivity.this,ChangeBangDingActivity.class); + startActivity(changebangding); + overridePendingTransition(R.anim.rightin, R.anim.rightout); + break; + case R.id.changpassword: + Content.authcodeflag = 1; + Intent changpwd = new Intent(); + changpwd.setClass(AccountManagementActivity.this,ChangePasswordActivity.class); + startActivity(changpwd); + overridePendingTransition(R.anim.rightin, R.anim.rightout); + break; + } + } } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java index 63e3070..07a92af 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangeElectronicCardAdressInfoActivity.java @@ -2,17 +2,159 @@ package com.hjx.personalcenter.activity; import android.app.Activity; import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.text.TextUtils; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; import com.hjx.personalcenter.R; +import com.hjx.personalcenter.http.HttpCode; +import com.hjx.personalcenter.http.HttpManager; +import com.hjx.personalcenter.util.AlertUtils; +import com.hjx.personalcenter.util.Judgment; +import com.hjx.personalcenter.util.PhoneNumCheckUtils; + +import org.json.JSONObject; /** * Created by h on 2017/8/9. */ -public class ChangeElectronicCardAdressInfoActivity extends Activity{ +public class ChangeElectronicCardAdressInfoActivity extends Activity implements View.OnClickListener{ + private ImageView back_forgit; + private EditText forot_pwd_phone,forot_pwd_anthcode,adress,newadress; + private Button forot_pwd_sub,forot_pwd_getanthcode; + private String typeStr = "register"; + private int i = 0; + private Thread thread; + Handler handler = new Handler() { + @Override + public void handleMessage(Message msg) { + super.handleMessage(msg); + JSONObject jsonObject; + String status; + switch (msg.what) { + case HttpCode.AUTHCODE_SUCESS1: + jsonObject = (JSONObject) msg.obj; + status = jsonObject.optString("status"); + if (status.equals("100")) { + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "验证码发送成功"); + } + //AlertUtils.showToast(ForgotPassword.this, jsonObject.optString("message")); + break; + case HttpCode.AUTHCODE_FAIL1: + jsonObject = (JSONObject) msg.obj; + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, jsonObject.optString("验证码发送失败,请检查网络")); + break; + case 1: + forot_pwd_getanthcode.setEnabled(false); + forot_pwd_getanthcode.setClickable(false); + forot_pwd_getanthcode.setText(Integer.toString(i--)+" s"); + if (i<=0){ + forot_pwd_getanthcode.setEnabled(true); + forot_pwd_getanthcode.setClickable(true); + forot_pwd_getanthcode.setText("获取验证码"); + + } + break; + } + } + }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_change_card_validation); + initView(); + setLister(); + } + //获取验证码 + private void getauthcode() { + forot_pwd_anthcode.requestFocus(); + String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); + HttpManager.getInstance().authCode(typeStr, forot_pwd_phone1, handler, this); + i = 60; + if(thread == null){ + thread = new Thread( new ThreadShow()); + thread.start(); + } + + } + private void initView() { + forot_pwd_phone = (EditText) findViewById(R.id.et_phonenumber); + forot_pwd_anthcode = (EditText) findViewById(R.id.et_authcode); + adress = (EditText) findViewById(R.id.et_newpassword); + newadress = (EditText) findViewById(R.id.et_again_newpassword); + forot_pwd_sub = (Button) findViewById(R.id.btn_ok); + forot_pwd_getanthcode = (Button) findViewById(R.id.btn_authcode); + back_forgit= (ImageView) findViewById(R.id.cancel); } + private void setLister() { + back_forgit.setOnClickListener(this); + forot_pwd_sub.setOnClickListener(this); + forot_pwd_getanthcode.setOnClickListener(this); + + } + + @Override + public void onClick(View view) { + switch (view.getId()){ + case R.id.btn_ok: + String forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); + String forot_pwd_anthcode1 = forot_pwd_anthcode.getText().toString().trim(); + String forot_pwd_pwd3 = adress.getText().toString().trim(); + String forot_pwd_pwd4 = newadress.getText().toString().trim(); + if (TextUtils.isEmpty(forot_pwd_phone1)|| + TextUtils.isEmpty(forot_pwd_pwd3) || TextUtils.isEmpty(forot_pwd_pwd4)){ + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请将必填项填写完整"); + return; + }else if (Judgment.getInstance().isPhoneNum(forot_pwd_phone1)){ + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "手机号码输入有误"); + + } else { + //修改地址接口 + HttpManager.getInstance().changecardadressinfo(this,111,forot_pwd_phone1,forot_pwd_anthcode1,forot_pwd_pwd3+forot_pwd_pwd4); + } + break; + case R.id.btn_authcode: + forot_pwd_phone1 = forot_pwd_phone.getText().toString().trim(); + if (!PhoneNumCheckUtils.isPhone(forot_pwd_phone1)){ + AlertUtils.showToast(ChangeElectronicCardAdressInfoActivity.this, "请输入正确的手机号"); + }else { + forot_pwd_anthcode.requestFocus(); + getauthcode(); + + } + + break; + + case R.id.cancel: + finish(); + break; + } + } + // 线程类 定时器 + class ThreadShow implements Runnable { + + @Override + public void run() { + // TODO Auto-generated method stub + while (true) { + try { + Thread.sleep(1000); + Message msg = new Message(); + msg.what = 1; + handler.sendMessage(msg); + System.out.println("send..."); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + System.out.println("thread error..."); + } + } + } + } + } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java index a7f8a25..3c9515d 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChangePasswordActivity.java @@ -23,7 +23,7 @@ import com.hjx.personalcenter.db.SaveParam; public class ChangePasswordActivity extends Activity implements View.OnClickListener { private EditText old_pwd,newpassword,newpassword1; private Button sub_change_pwd; - private ImageView back_change_pwd,eyes_iv_change1,eyes_iv_change2; + private ImageView back_change_pwd,eyes_iv_change1; public static Boolean showPassword = false; @Override protected void onCreate(Bundle savedInstanceState) { @@ -48,7 +48,6 @@ public class ChangePasswordActivity extends Activity implements View.OnClickList sub_change_pwd.setOnClickListener(this); back_change_pwd.setOnClickListener(this); eyes_iv_change1.setOnClickListener(this); - eyes_iv_change2.setOnClickListener(this); } @Override diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java index b35c25d..8d13bef 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardLookInfoActivity.java @@ -14,6 +14,7 @@ import com.hjx.personalcenter.db.Content; import com.hjx.personalcenter.db.SaveParam; import com.hjx.personalcenter.http.HttpCode; import com.hjx.personalcenter.http.HttpManager; +import com.hjx.personalcenter.model.CardInfo; import com.hjx.personalcenter.util.AlertUtils; import com.hjx.personalcenter.util.GetDevicesUtil; @@ -36,12 +37,16 @@ public class ElectronicCardLookInfoActivity extends AppCompatActivity implements JSONObject jsonObject; String status; switch (msg.what){ + case HttpCode.SUCHCARDINFO: + CardInfo cardInfo = new CardInfo(); try { jsonObject = new JSONObject( (String) msg.obj); status = jsonObject.optString("status"); if (status.equals("1")){ AlertUtils.showToast(ElectronicCardLookInfoActivity.this,"显示电子保卡信息"); + cardInfo.setCustomerName(jsonObject.optString("customerName")); + }else { AlertUtils.showToast(ElectronicCardLookInfoActivity.this,"保卡信息查询失败"); } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java index 06b4ea6..ed023ee 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardValidationActivity.java @@ -85,16 +85,16 @@ public class ElectronicCardValidationActivity extends Activity implements View.O private void initData() { if (Content.authcodeflag==1){ - menu_title.setText("填写保卡信息"); - btn_card_valiyanzhen.setText("下一步"); + menu_title.setText("更换绑定"); + btn_card_valiyanzhen.setText("确定"); }else if (Content.authcodeflag==2){ menu_title.setText("修改保卡信息"); btn_card_valiyanzhen.setText("确定"); }else { - menu_title.setText("更换绑定"); - btn_card_valiyanzhen.setText("确定"); + menu_title.setText("填写保卡信息"); + btn_card_valiyanzhen.setText("下一步"); } @@ -124,19 +124,21 @@ public class ElectronicCardValidationActivity extends Activity implements View.O AlertUtils.showToast(ElectronicCardValidationActivity.this, "您输入的验证码不正确"); }else { if (Content.authcodeflag==1){ - SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); - Intent intent = new Intent(); - intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); - startActivity(intent); - overridePendingTransition(R.anim.rightin, R.anim.rightout); + //修改账户手机号 + HttpManager.getInstance().changecardinfophone(this, + 736,usernameStr,authcodeStr); + }else if (Content.authcodeflag==2){ //修改保卡手机号 HttpManager.getInstance().changecardinfophone(this, 736,usernameStr,authcodeStr); }else { - //修改手机号 - menu_title.setText("更换绑定"); + SaveParam.getInstance().saveCustomizeParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); + Intent intent = new Intent(); + intent.setClass(ElectronicCardValidationActivity.this, ElectronicCardEditInfoActivity.class); + startActivity(intent); + overridePendingTransition(R.anim.rightin, R.anim.rightout); } // SaveParam.getInstance().saveLoginParam(this,SaveParam.CARDPHONE, phonenumber.getText().toString().trim()); // Intent intent = new Intent(); diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java index 9c40a3b..9a2471d 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java @@ -1,21 +1,41 @@ package com.hjx.personalcenter.activity; +import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import com.hjx.personalcenter.R; +import com.hjx.personalcenter.customdialog.HeadDialog; +import com.hjx.personalcenter.interfaces.DialogCallBack; +import com.hjx.personalcenter.util.AlertUtils; import com.mylhyl.circledialog.CircleDialog; import com.mylhyl.circledialog.callback.ConfigInput; import com.mylhyl.circledialog.params.InputParams; import com.mylhyl.circledialog.view.listener.OnInputClickListener; +import com.zaaach.toprightmenu.MenuItem; +import com.zaaach.toprightmenu.TopRightMenu; + +import java.util.ArrayList; +import java.util.List; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener, DialogCallBack.CallBackView { + private ImageView iv_imformatioan, iv_look_card, iv_setting, iv_sign, iv_head, iv_sex; + private TextView tv_edit_presoninfo, tv_sign, oktakephone, cancetakephone, + tv_username, tv_username1, tv_mygad, tv_sex, tv_useinfo_adress, tv_useinfo_birthday, + tv_useinfo_qq, tv_useinfo_school, tv_useinfo_gender; + private LinearLayout linel_mycuoti, linel_mynote, linel_mycollege, linel_myclass; + private TopRightMenu mTopRightMenu; + private boolean showIcon = true; + private boolean dimBg = true; + private boolean needAnim = true; -public class MainActivity extends AppCompatActivity implements View.OnClickListener { - private ImageView iv_imformatioan,iv_look_card,iv_setting,iv_sign; - private TextView tv_edit_presoninfo,tv_sign; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -32,9 +52,29 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe iv_setting = (ImageView) findViewById(R.id.iv_setting); iv_sign = (ImageView) findViewById(R.id.iv_sign); tv_sign = (TextView) findViewById(R.id.tv_sign); + //头像 + iv_head = (ImageView) findViewById(R.id.iv_head); + //初始化个人信息 + iv_sex = (ImageView) findViewById(R.id.iv_sex); + tv_username = (TextView) findViewById(R.id.tv_username); + tv_username1 = (TextView) findViewById(R.id.tv_username1); + tv_mygad = (TextView) findViewById(R.id.tv_mygad); + tv_sex = (TextView) findViewById(R.id.tv_sex); + tv_useinfo_adress = (TextView) findViewById(R.id.tv_useinfo_adress); + tv_useinfo_birthday = (TextView) findViewById(R.id.tv_useinfo_birthday); + tv_useinfo_qq = (TextView) findViewById(R.id.tv_useinfo_qq); + tv_useinfo_school = (TextView) findViewById(R.id.tv_useinfo_school); + tv_useinfo_gender = (TextView) findViewById(R.id.tv_useinfo_gender); + //跳转其他应用 + linel_mycuoti = (LinearLayout) findViewById(R.id.linel_mycuoti); + linel_mynote = (LinearLayout) findViewById(R.id.linel_mynote); + linel_mycollege = (LinearLayout) findViewById(R.id.linel_mycollege); + linel_myclass = (LinearLayout) findViewById(R.id.linel_myclass); + } private void initData() { + //加载个人信息 } @@ -44,35 +84,72 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe tv_edit_presoninfo.setOnClickListener(this); iv_setting.setOnClickListener(this); iv_sign.setOnClickListener(this); + iv_head.setOnClickListener(this); + linel_mycuoti.setOnClickListener(this); + linel_mynote.setOnClickListener(this); + linel_mycollege.setOnClickListener(this); + linel_myclass.setOnClickListener(this); } @Override public void onClick(View v) { - switch (v.getId()){ + switch (v.getId()) { case R.id.iv_imformatioan: Intent intent = new Intent(); - intent.setClass(MainActivity.this,FeedBackActivity.class); + intent.setClass(MainActivity.this, FeedBackActivity.class); startActivity(intent); overridePendingTransition(R.anim.rightin, R.anim.rightout); break; case R.id.iv_look_card: Intent lookintent = new Intent(); - lookintent.setClass(MainActivity.this,ElectronicCardLookInfoActivity.class); + lookintent.setClass(MainActivity.this, ElectronicCardLookInfoActivity.class); startActivity(lookintent); overridePendingTransition(R.anim.rightin, R.anim.rightout); break; case R.id.tv_edit_presoninfo: Intent editintent = new Intent(); - editintent.setClass(MainActivity.this,ChangePresonalInfoActivity.class); + editintent.setClass(MainActivity.this, ChangePresonalInfoActivity.class); startActivity(editintent); overridePendingTransition(R.anim.rightin, R.anim.rightout); break; + case R.id.iv_head: + HeadDialog.getInstance(this).show(getSupportFragmentManager(), "HeadDialog"); + break; case R.id.iv_setting: - Intent settingintent = new Intent(); - settingintent.setClass(MainActivity.this,LoginAndRegisterActivity.class); - startActivity(settingintent); - overridePendingTransition(R.anim.rightin, R.anim.rightout); + mTopRightMenu = new TopRightMenu(MainActivity.this); + List menuItems = new ArrayList<>(); + menuItems.add(new MenuItem(R.mipmap.blank, "切换账户")); + menuItems.add(new MenuItem(R.mipmap.blank, "账户管理")); + mTopRightMenu + .setHeight(150) //默认高度480 + .setWidth(320) //默认宽度wrap_content + .showIcon(showIcon) //显示菜单图标,默认为true + .dimBackground(dimBg) //背景变暗,默认为true + .needAnimationStyle(needAnim) //显示动画,默认为true + .setAnimationStyle(R.style.TRM_ANIM_STYLE) //默认为R.style.TRM_ANIM_STYLE + .setOnMenuItemClickListener(new TopRightMenu.OnMenuItemClickListener() { + @Override + public void onMenuItemClick(int position) { + switch (position) { + case 0: + //清除数据 + Intent settingintent = new Intent(); + settingintent.setClass(MainActivity.this, LoginAndRegisterActivity.class); + startActivity(settingintent); + overridePendingTransition(R.anim.rightin, R.anim.rightout); + break; + case 1: + Intent accontMintent = new Intent(); + accontMintent.setClass(MainActivity.this, AccountManagementActivity.class); + startActivity(accontMintent); + overridePendingTransition(R.anim.rightin, R.anim.rightout); + break; + } + } + }) + .addMenuList(menuItems) + .showAsDropDown(iv_setting, -250, 0); break; case R.id.iv_sign: new CircleDialog.Builder(this) @@ -91,13 +168,46 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe .setPositiveInput("确定", new OnInputClickListener() { @Override public void onClick(String text, View v) { - tv_sign.setText(text); + if (text.equals("")) { + AlertUtils.showToast(MainActivity.this, "请输入个性签名"); + } else { + tv_sign.setText(text); + } + } }) .show(); break; + case R.id.linel_mycuoti: + AlertUtils.showToast(this, "hhahahah "); + break; + case R.id.linel_mynote: + AlertUtils.showToast(this, "hhahahah "); + break; + case R.id.linel_mycollege: + AlertUtils.showToast(this, "hhahahah "); + break; + case R.id.linel_myclass: + AlertUtils.showToast(this, "hhahahah "); + break; + case R.id.oktakephone: + AlertUtils.showToast(this, "hhahahah "); + break; + case R.id.canceltakephone: + AlertUtils.showToast(this, "hhahahah "); + break; } } + + @Override + public void provinceOnItemClick(Context context, LayoutInflater inflater, ViewGroup container) { + View mView = inflater.inflate(R.layout.custom_adilog_lhead, container, false); + oktakephone = (TextView) mView.findViewById(R.id.oktakephone); + cancetakephone = (TextView) mView.findViewById(R.id.canceltakephone); + oktakephone.setOnClickListener(this); + cancetakephone.setOnClickListener(this); + + } } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java index a8062f6..91da830 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java @@ -82,6 +82,8 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl private void choiseregion() { HttpManager.getInstance().provices(RegisterInfoActivity.this); ProvinceListDialog.getInstance(this).show(getSupportFragmentManager(), "ProvinceListDialog"); +// HttpManager.getInstance().cityinfo(RegisterInfoActivity.this,111); +// CitysListDialog.getInstance(this).show(getSupportFragmentManager(), "CitysListDialog"); } //选择年级 diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/CitysListDialog.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/CitysListDialog.java index dc84f2f..3684772 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/CitysListDialog.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/CitysListDialog.java @@ -30,8 +30,11 @@ public class CitysListDialog extends BaseCircleDialog implements AdapterView.OnI private ListView listView; private DialogCallBack.CallBack mCallBack; private ArrayList data = new ArrayList<>(); - public static CitysListDialog getInstance() { - CitysListDialog dialogFragment = new CitysListDialog(); + public CitysListDialog(DialogCallBack.CallBack callBack) { + this.mCallBack = callBack; + } + public static CitysListDialog getInstance(DialogCallBack.CallBack callBack) { + CitysListDialog dialogFragment = new CitysListDialog(callBack); dialogFragment.setCanceledBack(true); dialogFragment.setCanceledOnTouchOutside(true); dialogFragment.setRadius(CircleDimen.RADIUS); @@ -71,12 +74,7 @@ public class CitysListDialog extends BaseCircleDialog implements AdapterView.OnI @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - //Toast.makeText(getActivity(), "你点击了第" + position + "个", Toast.LENGTH_LONG).show(); - switch (position){ - - - - } + mCallBack.provinceOnItemClick(parent,view,position,id); diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java index da63f42..259600a 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/ElectronicCardDialog.java @@ -11,7 +11,6 @@ import android.view.ViewGroup; import com.hjx.personalcenter.R; import com.hjx.personalcenter.activity.ElectronicCardValidationActivity; -import com.hjx.personalcenter.db.Content; import com.mylhyl.circledialog.BaseCircleDialog; import com.mylhyl.circledialog.res.values.CircleDimen; @@ -45,11 +44,11 @@ public class ElectronicCardDialog extends BaseCircleDialog { // intent.setClass(getActivity(),TheStartPageActivity.class); // startActivity(intent); // getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); - Content.authcodeflag =1; Intent intent = new Intent(); intent.setClass(getActivity(),ElectronicCardValidationActivity.class); startActivity(intent); getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); + getActivity().finish(); } }); diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/HeadDialog.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/HeadDialog.java new file mode 100644 index 0000000..367b4c8 --- /dev/null +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/HeadDialog.java @@ -0,0 +1,46 @@ +package com.hjx.personalcenter.customdialog; + +import android.content.Context; +import android.graphics.Color; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.hjx.personalcenter.R; +import com.hjx.personalcenter.interfaces.DialogCallBack; +import com.mylhyl.circledialog.BaseCircleDialog; +import com.mylhyl.circledialog.res.values.CircleDimen; + +/** + * Created by h on 2017/8/20. + */ + +public class HeadDialog extends BaseCircleDialog { + private View mView; + private DialogCallBack.CallBackView mCallBack; + + public HeadDialog(DialogCallBack.CallBackView callBack) { + this.mCallBack = callBack; + } + public static HeadDialog getInstance(DialogCallBack.CallBackView callBackview) { + HeadDialog dialogFragment = new HeadDialog(callBackview); + dialogFragment.setCanceledBack(true); + dialogFragment.setCanceledOnTouchOutside(true); + dialogFragment.setRadius(CircleDimen.RADIUS); + dialogFragment.setWidth(0.4f); + dialogFragment.setGravity(Gravity.CENTER); + dialogFragment.setBackgroundColor(Color.WHITE); + return dialogFragment; + } + + @Override + public View createView(Context context, LayoutInflater inflater, ViewGroup container) { + + if (mView == null) { + mView = inflater.inflate(R.layout.custom_adilog_lhead, container, false); + mCallBack.provinceOnItemClick(context,inflater,container); + } + return mView; + } +} diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java index 3862d1b..3484d6b 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java @@ -1,21 +1,32 @@ package com.hjx.personalcenter.fragment; +import android.graphics.Color; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.TextView; +import com.bigkoo.pickerview.TimePickerView; import com.hjx.personalcenter.R; +import com.hjx.personalcenter.util.AlertUtils; + +import java.text.SimpleDateFormat; +import java.util.Date; /** * Created by h on 2017/8/12. */ -public class PresonInfoFragment extends Fragment { +public class PresonInfoFragment extends Fragment implements View.OnClickListener { private View mView; private int type; + private TimePickerView pvTime; + private EditText tv_username1,tv_useinfo_adress1,tv_useinfo_qq; + private TextView tv_sex, tv_useinfo_adress, tv_useinfo_birthday, tv_useinfo_school, tv_useinfo_gender; public static String TABLAYOUT_FRAGMENT = "tab_fragment"; public static PresonInfoFragment newInstance(int type) { @@ -33,6 +44,7 @@ public class PresonInfoFragment extends Fragment { initView(mView); initData(); setLister(); + initTimePicker(); } @@ -40,11 +52,87 @@ public class PresonInfoFragment extends Fragment { } //初始化 private void initView(View mView) { + tv_username1 = (EditText) mView.findViewById(R.id.tv_username1); + tv_useinfo_adress1 = (EditText) mView.findViewById(R.id.tv_useinfo_adress1); + tv_useinfo_qq = (EditText) mView.findViewById(R.id.tv_useinfo_qq); + tv_sex = (TextView) mView.findViewById(R.id.tv_sex); + tv_useinfo_adress = (TextView) mView.findViewById(R.id.tv_useinfo_adress); + tv_useinfo_birthday = (TextView) mView.findViewById(R.id.tv_useinfo_birthday); + tv_useinfo_school = (TextView) mView.findViewById(R.id.tv_useinfo_school); + tv_useinfo_gender = (TextView) mView.findViewById(R.id.tv_useinfo_gender); + + } private void initData() { } private void setLister() { + tv_sex.setOnClickListener(this); + tv_useinfo_adress.setOnClickListener(this); + tv_useinfo_birthday.setOnClickListener(this); + tv_useinfo_school.setOnClickListener(this); + tv_useinfo_gender.setOnClickListener(this); } + @Override + public void onClick(View v) { + switch (v.getId()){ + case R.id.tv_sex: + AlertUtils.showToast(getActivity(),"正在开发"); + break; + case R.id.tv_useinfo_adress: + AlertUtils.showToast(getActivity(),"正在开发"); + break; + case R.id.tv_useinfo_birthday: + pvTime.show(tv_useinfo_birthday);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view + break; + case R.id.tv_useinfo_school: + AlertUtils.showToast(getActivity(),"正在开发"); + break; + case R.id.tv_useinfo_gender: + AlertUtils.showToast(getActivity(),"正在开发"); + break; + } + } + //自定义时间选择器 + private void initTimePicker() { + //控制时间范围(如果不设置范围,则使用默认时间1900-2100年,此段代码可注释) + //因为系统Calendar的月份是从0-11的,所以如果是调用Calendar的set方法来设置时间,月份的范围也要是从0-11 +// Calendar selectedDate = Calendar.getInstance(); +// Calendar startDate = Calendar.getInstance(); +// startDate.set(1900, 1, 1); +// Calendar endDate = Calendar.getInstance(); +// endDate.set(2100, 1, 1); + //时间选择器 + pvTime = new TimePickerView.Builder(getActivity(), new TimePickerView.OnTimeSelectListener() { + @Override + public void onTimeSelect(Date date, View v) {//选中事件回调 + // 这里回调过来的v,就是show()方法里面所添加的 View 参数,如果show的时候没有添加参数,v则为null + /*btn_Time.setText(getTime(date));*/ + TextView btn = (TextView) v; + btn.setText(getTime(date)); + } + }) + //年月日时分秒 的显示与否,不设置则默认全部显示 + .setType(new boolean[]{true, true, true, false, false, false}) + .setLabel("", "", "", "", "", "") + .isCenterLabel(false) + .setDividerColor(Color.DKGRAY) + .setContentSize(21) +// .setDate(selectedDate) +// .setRangDate(startDate, endDate) + .setBackgroundId(0x80000000) //设置外部遮罩颜色 + .setDecorView(null) + .setTitleText("购买日期") + .setTitleSize(22) + .setCancelColor(Color.GRAY) + .setSubCalSize(22) + .setDividerColor(Color.GRAY) + .setSubmitColor(Color.GRAY) + .build(); + } + private String getTime(Date date) {//可根据需要自行截取数据显示 + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + return format.format(date); + } } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java index 881a953..641ad83 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java @@ -71,7 +71,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { if (status.equals("100")) { String usernameStr = phonenumber.getText().toString().trim(); String passwordStr = password.getText().toString().trim(); - //HttpManager.getInstance().saveLoginInfo(usernameStr,passwordStr,access_token,"true",userId); + HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,"true",userId); AlertUtils.showToast(getActivity(), "注册成功!"); Intent intent = new Intent(); intent.setClass(getActivity(),RegisterInfoActivity.class); diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java index 0322df4..0174670 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java @@ -2,11 +2,16 @@ package com.hjx.personalcenter.http; import android.app.Activity; import android.app.ProgressDialog; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler; import android.os.Message; +import android.provider.Settings; +import android.support.v4.app.FragmentActivity; import android.util.Log; +import android.view.Gravity; +import android.view.View; import android.widget.Toast; import com.google.gson.Gson; @@ -22,6 +27,9 @@ import com.hjx.personalcenter.util.DialogPermission; import com.loopj.android.http.AsyncHttpResponseHandler; import com.loopj.android.http.JsonHttpResponseHandler; import com.loopj.android.http.RequestParams; +import com.mylhyl.circledialog.CircleDialog; +import com.mylhyl.circledialog.callback.ConfigText; +import com.mylhyl.circledialog.params.TextParams; import org.apache.http.Header; import org.apache.http.entity.ByteArrayEntity; @@ -89,7 +97,27 @@ public class HttpManager { @Override public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { closeProgress(); - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } @@ -132,7 +160,27 @@ public class HttpManager { super.onFailure(statusCode, headers, throwable, errorResponse); closeProgress(); Log.e("test", "onFailure" + errorResponse); - Toast.makeText(context, "请检查网络。。", Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) context) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + context.startActivity(intent); + } + }) + .show(); } }); @@ -157,7 +205,27 @@ public class HttpManager { @Override public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { - Toast.makeText(mContext, "请检查网络。。" + errorResponse, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } @@ -180,7 +248,27 @@ public class HttpManager { @Override public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { - Toast.makeText(mContext, "失敗" + errorResponse, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); @@ -217,8 +305,27 @@ public class HttpManager { @Override public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { Log.e("test", "onFailure" + new String(bytes)); - Toast.makeText(context, "密码修改失败,请检查网络!", Toast.LENGTH_LONG).show(); - onFinish(); + new CircleDialog.Builder((FragmentActivity) context) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + context.startActivity(intent); + } + }) + .show(); } }); @@ -250,7 +357,27 @@ public class HttpManager { @Override public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { Log.e("test", "onFailure" + new String(bytes)); - Toast.makeText(context, "忘记密码修改失败,请检查网络!", Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) context) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + context.startActivity(intent); + } + }) + .show(); } }); @@ -326,7 +453,27 @@ public class HttpManager { public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { Log.e("test", "onFailure" + (throwable)); closeProgress(); - Toast.makeText(context, "保卡绑定失败!,请检查网络", Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) context) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + context.startActivity(intent); + } + }) + .show(); } }); @@ -352,7 +499,27 @@ public class HttpManager { @Override public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { closeProgress(); - Toast.makeText(mContext, "请检查网络。。" , Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } @@ -384,12 +551,32 @@ public class HttpManager { @Override public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { Log.e("test", "onFailure" + new String(bytes)); - Toast.makeText(mContext, "请检查网络。。" + new String(bytes), Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } //修改保卡信息地址 - public void changecardinfo(final Context mContext,int userId,String customerPhone,String authCode,String customerAddress) { + public void changecardadressinfo(final Context mContext, int userId, final String customerPhone, String authCode, final String customerAddress) { RequestParams params = new RequestParams(); params.put("userId", userId); params.put("customerPhone", customerPhone); @@ -403,8 +590,9 @@ public class HttpManager { JSONObject jsonObject = new JSONObject(new String(bytes)); String status = jsonObject.optString("status"); if (status.equals("1")) { - Log.e("test", "省" + jsonObject); - Toast.makeText(mContext, "成功。。" + jsonObject, Toast.LENGTH_LONG).show(); + Toast.makeText(mContext, "手机号修改成功", Toast.LENGTH_LONG).show(); + SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.ADRESSCUNSTEM, customerAddress); + ((Activity) mContext).finish(); } } catch (JSONException e) { e.printStackTrace(); @@ -414,7 +602,27 @@ public class HttpManager { @Override public void onFailure(int i, Header[] headers, byte[] bytes, Throwable throwable) { Log.e("test", "onFailure" + new String(bytes)); - Toast.makeText(mContext, "请检查网络。。" + new String(bytes), Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } @@ -433,7 +641,30 @@ public class HttpManager { @Override public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{250, 50, 250, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("取消", null) + .setPositive("确定", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("/"); + ComponentName cm = new ComponentName("com.android.settings","com.android.settings.WirelessSettings"); + intent.setComponent(cm); + intent.setAction("android.intent.action.VIEW"); + ((Activity) mContext).startActivityForResult( intent , 0); + } + }) + .show(); + //Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); } }); } @@ -463,7 +694,27 @@ public class HttpManager { @Override public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } @@ -491,7 +742,27 @@ public class HttpManager { @Override public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } @@ -519,7 +790,27 @@ public class HttpManager { @Override public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { - Toast.makeText(mContext, "请检查网络。。" + arg3, Toast.LENGTH_LONG).show(); + new CircleDialog.Builder((FragmentActivity) mContext) + .setCanceledOnTouchOutside(false) + .setCancelable(false) + .setWidth(0.5f) + .configText(new ConfigText() { + @Override + public void onConfig(TextParams params) { + params.gravity = Gravity.CENTER; + params.padding = new int[]{50, 50, 50, 50}; + } + }) + .setText("当前无网络,请检查网络设置") + .setNegative("继续使用", null) + .setPositive("设置网络", new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 + mContext.startActivity(intent); + } + }) + .show(); } }); } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/interfaces/DialogCallBack.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/interfaces/DialogCallBack.java index a63cfa8..26f3e84 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/interfaces/DialogCallBack.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/interfaces/DialogCallBack.java @@ -1,6 +1,9 @@ package com.hjx.personalcenter.interfaces; +import android.content.Context; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.AdapterView; /** @@ -11,4 +14,7 @@ public class DialogCallBack { public interface CallBack{ void provinceOnItemClick(AdapterView parent, View view, int position, long id); } + public interface CallBackView{ + void provinceOnItemClick(Context context, LayoutInflater inflater, ViewGroup container); + } } diff --git a/PersonalCenter/app/src/main/res/anim/dialog_enter_anim.xml b/PersonalCenter/app/src/main/res/anim/dialog_enter_anim.xml new file mode 100644 index 0000000..b97db24 --- /dev/null +++ b/PersonalCenter/app/src/main/res/anim/dialog_enter_anim.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/PersonalCenter/app/src/main/res/anim/dialog_exit_anim.xml b/PersonalCenter/app/src/main/res/anim/dialog_exit_anim.xml new file mode 100644 index 0000000..fd09a5b --- /dev/null +++ b/PersonalCenter/app/src/main/res/anim/dialog_exit_anim.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/PersonalCenter/app/src/main/res/layout/activity_account_management.xml b/PersonalCenter/app/src/main/res/layout/activity_account_management.xml index 6ef6167..c492e85 100644 --- a/PersonalCenter/app/src/main/res/layout/activity_account_management.xml +++ b/PersonalCenter/app/src/main/res/layout/activity_account_management.xml @@ -73,6 +73,7 @@ android:textSize="22sp" android:text="123556677"/> - + android:hint="请选择地区" /> - + android:hint="请填写详细地址" /> + android:orientation="vertical"> + android:minHeight="50dp"> + android:paddingRight="250dp"> - - + android:id="@+id/pwd_rl" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="100dp"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml b/PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml index dc439a3..1827c9a 100644 --- a/PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml +++ b/PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml @@ -52,6 +52,7 @@ android:textSize="22sp" /> gu000JONklP(t`pL@;J+sSoFFy3CyE?so2(rM16gU(W2FbLO9!d*_~e zW>YkGV#KY$dSDtb#41Q0{sLNnXMv*@0a8W+jsOk;qb!{FfU`giaKg9av~P!w2Cg0P z0EPiuEF4=1crP&9z;9e01n%?g)Iz{l4Sf3I72ghh3pg35RqWe-(cJkDa9!ZQ5TqR5PZyQI#egkSPFOrhUcBs`Fa?+hj6=qlLGJiv;3TrI zaTpn!z5}i#n4_jiMT+K5Z7r9w&c-ncs0SVgZYlD&CxDNTl2x1MyrKwcRVo3ikjnKF z6u-s}k^w#dRs-i_`pQR0E2~YV?wAMs3@jzScsL(RozFTC{)!?=0n3r<^bVlfz<)JT zy4vDmB|=hx1|q^e)XjI=f&IW&$OQ2laKRlL3fzWFG}D3mfdLVIo#q^Nc=gB085n->cK4-wwzz8+X+5G#s$7c-YOWV6aE z76M)Ywk!4(z;J_jL58_lLAGPi3S#vfxS4P@WGJxFC|)ib3GdWp(BE2$jg^3HNV`Rl zI^_1Uq8`2C{UJvEGuE3*t%N6!q&Jn$BSi!seKUz}DxF84ILeR{^;u$Hf-W9NiQla0 z$a*c@2y9jCWk}Wd6XH!Q!<~-?bn)KD_;s@+iV4e+HVcjU$Zfuw;+_+$+;3Wm-sRg1 zJXM6x9+6ak;6UJ0;DK(wlWi_KKv#3oAMV(VbTt>vaG&m4Me?C2g=A0KALd z>fw{E$d%V_;Jc&^mhDLE*#e|F$T#PJ$6O2x@l;AtP;CSz0Pmr^KH38^&esHFLP?Zs zp~-w1vgtjt$lsnsmS>yzA2yi>$-d?=6{#JLL&P2Ij%QzfK8lpfz9#wC93Vo#i-b2@ z`d_pOGnlX@nKXKt+xrG|A3$phIh6)}R1Q32oJ?;-)8ud(*sUCx39Pcsr&qBG(Im+3 z6wRF#z^~}<4DSKnL8{E9{Qs9yFbKFCDb8w5@+X1Yv;W#L7pZ3SQ#kX0rtE`s6R@s? z$@DhXA(~ya5_y3H-mB;XY(}&Kt`@KZS%l9)8pQj#nq$aNw~U;3Qo8%=r@6?#7}X%l qtf+U>`YP?nL~#W9>!&7^wfldVq*0fq0Z4QJ0000& zUu+ab9LGO*EyWh4fVNr{5p4top#mk^ASejY7}TOj2}K0|#77P2v%Z;#(fDAZO)3RM zK%)Ww5CybGg$Lz9G!Y3=q7T3WBBCI~_I&v5$lmPC-t67p-LCy6m&?p=c6R1-vo|xp z`Q2sMkwa4*u*iFL04+dPFO+f(0!M&7z`Ne-oWDRu12YSF18A*K1Cyddz)IjtmEj)= z-N0^!9u$y1??xB^=fTVY)*+A4P*okmU=GNmR153}uGb3w4r~Ix2L>wGz)GkFm;@{X zMrpPmfGHVvl@cKKr#K3*4w> zZe(acQ94HOiJ4Z5tW*5jAEDAZ;A&tD@EdR#Z9R|@eXFHgvcPaH^G}D0?m!krCx9P; zz25r?FMob%?X0-|($d+eE7}I&Enp|m>7{jhC-8|^PPeB9jA>T`>k;{m=0GOxcZ6F_tUwxk4uen}5sgVnq2?VEfz2mypYw6*@ zMAt?oK`vk}GUWYI;F@0zc^5j|D=~5bbIOo+Re@{98uDBgj){>An1jGsEpK^&YaY_l zXMqE*jY@)Cz??z6TYfDER#?ifAPDYL;O}TntFBzvF)wTB3^FD6A#0RYWdF2|;8YFp zQt?f!j$GFKH%|)*Cawwz??)J#hV?= zZw6))^p2HN&4}BhxzviHx*bjfOOgH2HZQH)w|VxZ275WxgiI2h-g{FimAQV$=-TPM zh6Cd{@4@?-;M86TU4rb>CVT10h)-yq*RIGa7K~C7)+eJ82vfBDHqOI|{5YrmOu7*n zxi?wt(-An4on>hT(};9>dVz8?fsZin`K(GSn2|_lXBupW40#>EheYr}rxDBuq>~*6 zTQ73d+-tDiN(4A*1Ji(vlvxH_FYp-fkN0kZa~tp;4ofl3 z0kQ}TjqFGZn0n-so@=n_P?W;p+=cA@tZ>o*rVjap7Z_|dC`w^)79xj&!%P<@9gKo< zr@>YTic%PyMZlX#yiA@-UHRIy2073Es)Rb~5SPW>2AeAsB?Sjym1bKE+^k;^_lU^= zYk?P#+2fWX>lubbbKPsOMTMdiHgWNvsFBHp{zUV0?31M?y*Of|^xzTaRg7K&0B zoIJ$^rXKk&(EY$_**?Ruo*LxLYO%pqDikFrIB|d(1$>Nr%bTP&deaKjQ-h4Sr3PDE zP?QD{kE9h&sbE@w&ynSJm_{LR+CtjVgZWq{ZYWAQLg17FrWJ{#*8Ly=KN0N67zB=9 zK7)jqtTfb9E+|S0jvj+oG?+Hv3*Z`qZI@>^bx8NLWq?6NY*!1;whU3%q-PEtq$wF9J`KA2_6*-yZTmgeK%D z##B$$p+K||vkIA#_0Hswz@Rk*qp85&(ZoUl_Yw09@I1kz*K^280+eVIFCJ|7e zFqjOoykBjw{Q=yEgqFD|49*z@d?KJg_@h*dbjAeb2(or@g`#8|74^s=+4zX{l}$D< zYKi}_!FB-gw?+xA_sa%nECPC5k@dzZ6PU0i{$9l2dbq^<+Te^s;1r73D!WWz)?!}b zZ%1Naj>mLw8=UdTI_Jum?o*UZVCoHdJ&3m}?n8PToNJMhb4ASebC%0G<~bzBrCdM% zv%zUaM$YABx^Jk$zziTjo~=MTY;dkaW-HV7qpY%lIgLCzJr!(=4bDUaPRYSQQDg#h z9Ql&nUde`dvcb857=nSK$OJ}t_^TxwoXLpGq9SliV3P2gMjMFH6vu(g=J&I^eV;{@P;UG$Vc0uiuikKfUMzZa3ub!TyUolbrta0wmIC z7lu>+A*KOj4cD)x>wd(in}n&lS~`a?=!g7u%z7kP*cA2nf7ctrue 15dp + diff --git a/PersonalCenter/build.gradle b/PersonalCenter/build.gradle index 02f1714..a572f0e 100644 --- a/PersonalCenter/build.gradle +++ b/PersonalCenter/build.gradle @@ -10,6 +10,7 @@ buildscript { // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.novoda:bintray-release:0.3.4' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' } }