From 661a7bcfd73f43258a5121a1695f2618abb1a6f2 Mon Sep 17 00:00:00 2001 From: xiongwei <861739889@qq.com> Date: Mon, 14 Aug 2017 18:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8C=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PersonalCenter/app/src/main/AndroidManifest.xml | 2 + .../activity/ElectronicCardEditInfoActivity.java | 36 ++++-- .../activity/ElectronicCardInfoOKActivity.java | 19 +++ .../hjx/personalcenter/activity/MainActivity.java | 31 ++++- .../fragment/VersionsInfoFragment.java | 2 +- .../com/hjx/personalcenter/model/DeviceInfo.java | 43 +++++++ .../hjx/personalcenter/util/GetDevicesUtil.java | 62 +++++++++ .../java/com/hjx/personalcenter/util/LogUtil.java | 143 +++++++++++++++++++++ .../com/hjx/personalcenter/util/MachineUtil.java | 82 ++++++++++++ .../com/hjx/personalcenter/util/SaveParam.java | 57 ++++++++ .../layout/activity_electronic_look_cardinfo.xml | 1 + .../res/layout/activity_electroniccard_info.xml | 19 ++- .../app/src/main/res/layout/activity_feedback.xml | 2 +- .../app/src/main/res/layout/activity_main.xml | 68 +++++----- .../src/main/res/layout/activity_ok_cardinfo.xml | 19 ++- 15 files changed, 531 insertions(+), 55 deletions(-) create mode 100644 PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/DeviceInfo.java create mode 100644 PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/GetDevicesUtil.java create mode 100644 PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/LogUtil.java create mode 100644 PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/MachineUtil.java create mode 100644 PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/SaveParam.java diff --git a/PersonalCenter/app/src/main/AndroidManifest.xml b/PersonalCenter/app/src/main/AndroidManifest.xml index 1d5e49a..e91f1b7 100644 --- a/PersonalCenter/app/src/main/AndroidManifest.xml +++ b/PersonalCenter/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ + + \ No newline at end of file diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java index c37c742..6cc8e90 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java @@ -6,6 +6,8 @@ import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -13,7 +15,6 @@ import com.bigkoo.pickerview.TimePickerView; import com.hjx.personalcenter.R; import java.text.SimpleDateFormat; -import java.util.Calendar; import java.util.Date; /**填写保卡信息 熊巍 @@ -22,9 +23,11 @@ import java.util.Date; public class ElectronicCardEditInfoActivity extends Activity implements View.OnClickListener { private LinearLayout lineL_buy_time; - private TextView tv_buy_time; + private TextView tv_buy_time,adress_shop,adress_custem; + private EditText username,store,detalAdress,telphone; private TimePickerView pvTime; private Button btn_change_info; + private ImageView iv_card_back; @Override protected void onCreate(Bundle savedInstanceState) { @@ -39,6 +42,12 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC private void initView() { lineL_buy_time = (LinearLayout) findViewById(R.id.lineL_buy_time); tv_buy_time = (TextView) findViewById(R.id.tv_buy_time); + adress_shop = (TextView) findViewById(R.id.tv_edit_adress_shop); + adress_custem = (TextView) findViewById(R.id.tv_edit_adress_custem); + username = (EditText) findViewById(R.id.et_edit_username); + store = (EditText) findViewById(R.id.et_edit_store); + detalAdress = (EditText) findViewById(R.id.et_edit_adress_detail); + telphone = (EditText) findViewById(R.id.et_edit_telphone); btn_change_info = (Button) findViewById(R.id.btn_change_info); } @@ -48,17 +57,20 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC private void initLister() { lineL_buy_time.setOnClickListener(this); + adress_shop.setOnClickListener(this); + adress_custem.setOnClickListener(this); btn_change_info.setOnClickListener(this); } + //自定义时间选择器 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); +// 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(this, new TimePickerView.OnTimeSelectListener() { @Override @@ -75,8 +87,8 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC .isCenterLabel(false) .setDividerColor(Color.DKGRAY) .setContentSize(21) - .setDate(selectedDate) - .setRangDate(startDate, endDate) +// .setDate(selectedDate) +// .setRangDate(startDate, endDate) .setBackgroundId(0x80000000) //设置外部遮罩颜色 .setDecorView(null) .setTitleText("购买日期") @@ -104,6 +116,12 @@ public class ElectronicCardEditInfoActivity extends Activity implements View.OnC startActivity(intent); overridePendingTransition(R.anim.rightin, R.anim.rightout); break; + case R.id.tv_edit_adress_shop: + + break; + case R.id.tv_edit_adress_custem: + break; + } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java index f5b8af5..434d5d3 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardInfoOKActivity.java @@ -5,8 +5,11 @@ import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; import com.hjx.personalcenter.R; +import com.hjx.personalcenter.util.GetDevicesUtil; /**确认保卡信息 * Created by h on 2017/8/11. @@ -14,6 +17,8 @@ import com.hjx.personalcenter.R; public class ElectronicCardInfoOKActivity extends Activity implements View.OnClickListener { private Button btn_finish; + private ImageView iv_last_step; + private TextView usename,deviceModel,customer_address,mac_adress,shoptime,deviceNumber,shopadress,phone,tlePhone; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -24,9 +29,23 @@ public class ElectronicCardInfoOKActivity extends Activity implements View.OnCli } private void initView() { btn_finish = (Button) findViewById(R.id.btn_finish); + usename = (TextView) findViewById(R.id.iv_card_username); + deviceModel = (TextView) findViewById(R.id.tv_card_deviceModel); + customer_address = (TextView) findViewById(R.id.tv_card_adress); + mac_adress = (TextView) findViewById(R.id.tv_card_mac); + shoptime = (TextView) findViewById(R.id.tv_card_time); + deviceNumber = (TextView) findViewById(R.id.tv_card_deviceNumber); + shopadress = (TextView) findViewById(R.id.tv_card_shopAdress); + phone = (TextView) findViewById(R.id.tv_card_phone); + tlePhone = (TextView) findViewById(R.id.tv_card_tleNember); } private void initData() { + //获取设备信息 + deviceModel.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceModel()); + deviceNumber.setText(GetDevicesUtil.getDevicesInfo(this).getDeviceNumber()); + mac_adress.setText(GetDevicesUtil.getDevicesInfo(this).getMac()); + //获取保卡信息 } 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 e7879a9..e702ac6 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 @@ -5,11 +5,13 @@ import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.ImageView; +import android.widget.TextView; import com.hjx.personalcenter.R; public class MainActivity extends AppCompatActivity implements View.OnClickListener { - ImageView iv_imformatioan; + private ImageView iv_imformatioan,iv_look_card,iv_setting; + private TextView tv_edit_presoninfo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -21,6 +23,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe private void initView() { iv_imformatioan = (ImageView) findViewById(R.id.iv_imformatioan); + iv_look_card = (ImageView) findViewById(R.id.iv_look_card); + tv_edit_presoninfo = (TextView) findViewById(R.id.tv_edit_presoninfo); + iv_setting = (ImageView) findViewById(R.id.iv_setting); } private void initData() { @@ -29,6 +34,10 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe private void initLister() { iv_imformatioan.setOnClickListener(this); + iv_look_card.setOnClickListener(this); + tv_edit_presoninfo.setOnClickListener(this); + iv_setting.setOnClickListener(this); + } @Override @@ -36,10 +45,28 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe switch (v.getId()){ case R.id.iv_imformatioan: Intent intent = new Intent(); - intent.setClass(MainActivity.this,LoginAndRegisterActivity.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); + 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); + startActivity(editintent); + overridePendingTransition(R.anim.rightin, R.anim.rightout); + 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); + break; } } diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java index b408650..fafc9c7 100644 --- a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java @@ -49,7 +49,7 @@ public class VersionsInfoFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { if (mView == null) { - mView = inflater.inflate(R.layout.activity_choisetextbook, container, false); + mView = inflater.inflate(R.layout.fragment_changge_version_info, container, false); initView(mView); initData(); setLister(); diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/DeviceInfo.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/DeviceInfo.java new file mode 100644 index 0000000..1d6851b --- /dev/null +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/DeviceInfo.java @@ -0,0 +1,43 @@ +package com.hjx.personalcenter.model; + +/** + * Created by h on 2017/8/14. + */ + +public class DeviceInfo { + private String mac = null; //:"D0-DF-9A-5F-A2-0A"网卡地址 + private String deviceNumber = null;//":"43234-51518888-2557", + private String deviceModel = null;//:"M18", + + + public String getDeviceNumber() { + return deviceNumber; + } + + public void setDeviceNumber(String deviceNumber) { + this.deviceNumber = deviceNumber; + } + + + + public String getDeviceModel() { + return deviceModel; + } + + public void setDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + } + + + + public String getMac() { + return mac; + } + + public void setMac(String mac) { + this.mac = mac; + } + + + +} diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/GetDevicesUtil.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/GetDevicesUtil.java new file mode 100644 index 0000000..da2efdf --- /dev/null +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/GetDevicesUtil.java @@ -0,0 +1,62 @@ +package com.hjx.personalcenter.util; + +import android.content.Context; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; +import android.util.Log; + +import com.hjx.personalcenter.model.DeviceInfo; + + +public class GetDevicesUtil { + private final static String LOG_TAG = "GetDevicesUtil"; + + public static String getDevicesJson(Context context){ + DeviceInfo mDeviceInfo = new DeviceInfo(); + initDevicesInfo(mDeviceInfo,context); + + StringBuilder sb = new StringBuilder(); + sb.append("\"devices\":[{"); + sb.append("\"deviceNumber\":").append("\"").append( mDeviceInfo.getDeviceNumber()).append("\","); + sb.append("\"deviceModel\":").append("\"").append(mDeviceInfo.getDeviceModel()).append("\","); + sb.append("\"mac\":").append("\"").append(mDeviceInfo.getMac()).append("\","); + sb.append("}]"); + Log.i(LOG_TAG, sb.toString()); + return sb.toString(); + } + + public static DeviceInfo getDevicesInfo(Context context){ + DeviceInfo mDeviceInfo = new DeviceInfo(); + initDevicesInfo(mDeviceInfo,context); + + return mDeviceInfo; + } + + public static void initDevicesInfo(DeviceInfo mDeviceInfo,Context context){ + mDeviceInfo.setDeviceModel(android.os.Build.MODEL); + Log.e(LOG_TAG,"" + mDeviceInfo.getDeviceModel()); + mDeviceInfo.setMac(getMacAddress(context)); + Log.e(LOG_TAG,"" + mDeviceInfo.getMac()); + + mDeviceInfo.setDeviceNumber(getCPUSerial(context)); + Log.e(LOG_TAG,"" + mDeviceInfo.getDeviceModel()); + } + + private static String getCPUSerial(Context context) { + return MachineUtil.getMachineCode(context); + } + + private static String getMacAddress(Context mContext){ + + String ret = null; + try { + WifiManager manager = (WifiManager)mContext.getSystemService(Context.WIFI_SERVICE); + WifiInfo info = manager.getConnectionInfo(); + ret = info.getMacAddress(); + } catch (Exception e) { + Log.e(LOG_TAG, "get wifi address wrong", e); + } + Log.i(LOG_TAG, "wifi address is" + ret); + return ret; + } +} diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/LogUtil.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/LogUtil.java new file mode 100644 index 0000000..ca71c0b --- /dev/null +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/LogUtil.java @@ -0,0 +1,143 @@ +package com.hjx.personalcenter.util; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class LogUtil +{ + private static com.hjx.personalcenter.util.LogUtil _lg; + //single + public static com.hjx.personalcenter.util.LogUtil Instance(){ + if(_lg == null){ + _lg = new com.hjx.personalcenter.util.LogUtil(); + } + return _lg; + } + + //日志保存的数量 ,默认保存最近10天的日志 + public int logSaveNum=10; + + /**插入日志*/ + public void WriteLog(String msg){ + if(LOG_SWITCH){ + System.out.println("插入日子的信息:" + msg); + File file = checkLogFileIsExist(); + if(file == null) + return; + FileOutputStream fos = null; + try + { + fos = new FileOutputStream(file, true); + fos.write((new Date().toLocaleString() + " " + msg).getBytes("gbk")); + fos.write("\r\n".getBytes("gbk")); + } + catch (FileNotFoundException e) + { + e.printStackTrace(); + } + catch (IOException e) + { + e.printStackTrace(); + } + finally{ + try + { + if(fos != null){ + fos.close(); + fos = null; + } + } + catch (IOException e) + { + e.printStackTrace(); + } + fos = null; + file = null; + } + } + } + /** + * 打印异常堆栈信息 + * @param e + * @return + */ + public void WriteStackTrace(Throwable e){ + if(e != null){ + //StringWriter sw = new StringWriter(); + //PrintWriter pw = new PrintWriter(sw); + //e.printStackTrace(pw); + //return sw.toString(); + WriteLog(e.getStackTrace().toString()); + } + //return ""; + } + + + + + private LogUtil() + { + CheckLogDele(); + + } + + private void CheckLogDele() + { + //todo 扫描sd卡下面的日志文件,删除超过logSaveNum的日志 + + } + + /**日志保存路径*/ + private static final String LOG_SAVE_PATH = "/sdcard/Log/"; //sd卡上的日志文件目录 + /**日志开关*/ + private static final boolean LOG_SWITCH = true; + + /**检查日志文件是否存在*/ + private File checkLogFileIsExist(){ + //if(!MemorySpaceManager.isSDExist()){ //sd 卡是否存在 + // return null; + //} + File file = new File(LOG_SAVE_PATH); + if(!file.exists()){ + file.mkdirs(); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateStr = sdf.format(new Date()); + file = new File(LOG_SAVE_PATH + dateStr + ".txt"); + if(!isLogExist(file)){ + try + { + file.createNewFile(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + sdf = null; + return file; + } + + /** + * 检查当天日志文件是否存在 + * @param file + * @return + */ + private boolean isLogExist(File file){ + File tempFile = new File(LOG_SAVE_PATH); + File[] files = tempFile.listFiles(); + if(files!=null){ + for(int i = 0; i < files.length; i++){ + if(files[0].getName().trim().equalsIgnoreCase(file.getName())){ + return true; + } + } + } + return false; + } + +} \ No newline at end of file diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/MachineUtil.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/MachineUtil.java new file mode 100644 index 0000000..a9c0e74 --- /dev/null +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/MachineUtil.java @@ -0,0 +1,82 @@ +package com.hjx.personalcenter.util; + +import android.content.Context; +import android.os.Build; +import android.telephony.TelephonyManager; +import android.text.TextUtils; + +import java.io.InputStreamReader; +import java.io.LineNumberReader; + +public class MachineUtil { + + public static String getMachineCode(Context context) { + String cpuAddress = null; + try{ +// PmpsManager pmps = new PmpsManager(); +// cpuAddress = pmps.getDeviceId(context); + }catch(Exception e){ + com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("mac地址获取失败"); + }catch(NoClassDefFoundError e){ + com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("设备不是好记星"); + } + if(!TextUtils.isEmpty(cpuAddress) && !"A818A81800".equals(cpuAddress)){ + //Log.e("=========.MACHINE.=========", "function 1 get device id:"+cpuAddress); + return cpuAddress; + } + + try{ + cpuAddress = android.provider.Settings.System.getString(context.getContentResolver(), "serial_number").trim(); + }catch(Exception e){ + com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("=========.MACHINE.=========function 2 get device id error"); + } + if(!TextUtils.isEmpty(cpuAddress)){ + //Log.e("=========.MACHINE.=========", "function 2 get device id:"+cpuAddress); + return cpuAddress; + } + + try { + if("Top".equals(Build.MODEL)){ + String str = "", strCPU = ""; + // 读取CPU信息 + Process pp = Runtime.getRuntime().exec("cat/proc/cpuinfo"); + InputStreamReader ir = new InputStreamReader(pp.getInputStream()); + LineNumberReader input = new LineNumberReader(ir); + // 查找CPU序列号 + for (int i = 1; i < 100; i++) { + str = input.readLine(); + if (str != null) { + // 查找到序列号所在行 + if (str.indexOf("Serial") > -1) { + // 提取序列号 + strCPU = str.substring(str.indexOf(":") + 1, str.length()); + cpuAddress = strCPU.trim(); + break; + } + } else { + break; + } + } + } + } catch (Exception e) { + com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("=========.MACHINE.=========function 3 get device id error"); + } + if(!TextUtils.isEmpty(cpuAddress)){ + //Log.e("=========.MACHINE.=========", "function 3 get device id:"+cpuAddress); + return cpuAddress; + } + + try{ + cpuAddress = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); + }catch(Exception e){ + com.hjx.personalcenter.util.LogUtil.Instance().WriteLog("=========.MACHINE.=========function 4 get device id error"); + } + if(!TextUtils.isEmpty(cpuAddress)){ + //Log.e("=========.MACHINE.=========", "function 4 get device id:"+cpuAddress); + return cpuAddress; + } + + cpuAddress = "unknown"; + return cpuAddress; + } +} diff --git a/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/SaveParam.java b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/SaveParam.java new file mode 100644 index 0000000..5fca376 --- /dev/null +++ b/PersonalCenter/app/src/main/java/com/hjx/personalcenter/util/SaveParam.java @@ -0,0 +1,57 @@ +package com.hjx.personalcenter.util; + +import android.app.Activity; +import android.content.Context; +import android.content.SharedPreferences; + +public class SaveParam { + + private static SaveParam instance; + public static SaveParam getInstance(){ + if (instance==null){ + instance = new SaveParam(); + } + return instance; + } + + + public void saveLoginParam(Context context,String spname, String spstr) { + SharedPreferences sp = context.getSharedPreferences("loginparam", + Activity.MODE_PRIVATE); + + sp.edit().putString(spname, spstr).commit(); + } + + public String getLoginParam(Context context,String spname) { + SharedPreferences sp = context.getSharedPreferences("loginparam", + Activity.MODE_PRIVATE); + String param = sp.getString(spname, null); + return param; + } + public void clearData(Context context) { + SharedPreferences sp = context.getSharedPreferences("loginparam", + Activity.MODE_PRIVATE); + sp.edit().clear().commit(); + } + + public void saveCustomizeParam(Context context,String spname, String spstr) { + SharedPreferences sp = context.getSharedPreferences("presoninfo", + Activity.MODE_PRIVATE); + + sp.edit().putString(spname, spstr).commit(); + + } + + public String getCustomizeParam(Context context,String spname) { + SharedPreferences sp = context.getSharedPreferences("presoninfo", + Activity.MODE_PRIVATE); + String param = sp.getString(spname, null); + return param; + } + + public void clearCustomizeParam(Context context ){ + SharedPreferences sp = context.getSharedPreferences("presoninfo", + Activity.MODE_PRIVATE); + sp.edit().clear().commit(); + } +} diff --git a/PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml b/PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml index 8f575db..42b1520 100644 --- a/PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml +++ b/PersonalCenter/app/src/main/res/layout/activity_electronic_look_cardinfo.xml @@ -273,6 +273,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" + android:layout_marginBottom="30dp" android:orientation="horizontal"> @@ -373,7 +379,6 @@ -