19个文件已修改
1个文件已删除
2 文件已重命名
5个文件已添加
| | |
| | | |
| | | /** |
| | | * byte 数组转16进制字符串 不加0前缀 |
| | | * |
| | | * @param bytes |
| | | * @return |
| | | */ |
| | |
| | | return bufferLittleEndian.getFloat(); |
| | | } |
| | | |
| | | /** |
| | | * 将带符号的32位浮点数装换byte数组 |
| | | * 低位在前高位在后 |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static byte[] folatToByte(Float value) { |
| | | ByteBuffer buffer = ByteBuffer.allocate(4); // 4个字节 |
| | | buffer.order(ByteOrder.LITTLE_ENDIAN); |
| | | buffer.putFloat(value); |
| | | byte[] byteArray = buffer.array(); |
| | | return byteArray; |
| | | } |
| | | |
| | | /** |
| | | * hex字符串转byte数组 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 将 4字节的16进制字符串,转换为32位带符号的十进制浮点型 |
| | | * |
| | |
| | | return Integer.toHexString(Float.floatToIntBits(value)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * float转Hex低位在前高位在后 |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static String floatToHexLowHigh(Float value) { |
| | | String hexString = Integer.toHexString(Float.floatToIntBits(value)); |
| | | hexString = spaceHex(hexString); |
| | | hexString = HighLowHex(hexString); |
| | | return hexString; |
| | | } |
| | | |
| | | |
| | | public static float hexToFloatLowHigh(byte[] data) { |
| | | List<Byte> byteList = new ArrayList<>(); |
| | | for (byte b : data) { |
| | | byteList.add(b); |
| | | } |
| | | Collections.reverse(byteList); |
| | | byte[] byteArray = new byte[byteList.size()]; |
| | | for (int i = 0; i < byteList.size(); i++) { |
| | | byteArray[i] = byteList.get(i); |
| | | } |
| | | String hex = bytesToHexNoAppen(byteArray); |
| | | int intValue = Integer.parseInt(hex, 16); // 将十六进制字符串转换为整数表示 |
| | | float floatValue = Float.intBitsToFloat(intValue); // 将整数表示转换为浮点数 |
| | | return floatValue; |
| | | } |
| | | |
| | | /** |
| | | * 十进制转16进制 |
| | | * |
| | |
| | | Context mContext; |
| | | DialogBack mDialogBack; |
| | | |
| | | String mEdtHint; |
| | | |
| | | public EdtDialog(Context context, Intent intent) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | | this.intent = intent; |
| | |
| | | public EdtDialog(Context context, DialogBack dialogBack) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mDialogBack=dialogBack; |
| | | mDialogBack = dialogBack; |
| | | initView(); |
| | | } |
| | | |
| | | /** |
| | | * @param context |
| | | * @param edtHint 输入框默认显示的内容 |
| | | * @param dialogBack |
| | | */ |
| | | public EdtDialog(Context context, String edtHint, DialogBack dialogBack) { |
| | | super(context, R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | mDialogBack = dialogBack; |
| | | mEdtHint = edtHint; |
| | | initView(); |
| | | } |
| | | |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(Gravity.CENTER); |
| | |
| | | setCanceledOnTouchOutside(false); |
| | | TextView textView = (TextView) this.findViewById(R.id.pw_ok); |
| | | final EditText editText = (EditText) this.findViewById(R.id.pw_et); |
| | | if (!TextUtils.isEmpty(mEdtHint)) { |
| | | editText.setHint(mEdtHint); |
| | | } |
| | | TextView cannel = (TextView) this.findViewById(R.id.pw_cannel); |
| | | textView.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (intent!=null){ |
| | | if (intent != null) { |
| | | if (TextUtils.isEmpty(editText.getText().toString())) { |
| | | // TipUtil.show(mContext, "请输入序列号"); |
| | | } else { |
| | |
| | | |
| | | } |
| | | } |
| | | if (mDialogBack!=null){ |
| | | if (mDialogBack != null) { |
| | | mDialogBack.onOk(editText.getText().toString()); |
| | | } |
| | | } |
| | |
| | | cannel.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (mDialogBack!=null){ |
| | | if (mDialogBack != null) { |
| | | mDialogBack.onCancel(); |
| | | } |
| | | EdtDialog.this.dismiss(); |
| | |
| | | <dimen name="text_size">20sp</dimen> |
| | | <dimen name="home_text_size">21sp</dimen> |
| | | <dimen name="new_card_size">20sp</dimen> |
| | | <dimen name="big_text_size">24sp</dimen> |
| | | |
| | | |
| | | <dimen name="title_bar_title_max_width">240dp</dimen> |
| | |
| | | byte[] electricityPriceBytes = new byte[4]; |
| | | System.arraycopy(zero, 4, electricityPriceBytes, 0, electricityPriceBytes.length); |
| | | |
| | | userCard.electricityPrice = HexUtil.hexToFloat(HexUtil.bytesToHex(electricityPriceBytes)); |
| | | userCard.electricityPrice = HexUtil.hexToFloatLowHigh(electricityPriceBytes); |
| | | userCard.state = BcdUtil.bcdToStr(zero[8]); |
| | | byte[] balanceBytes = new byte[4]; |
| | | System.arraycopy(zero, 9, balanceBytes, 0, balanceBytes.length); |
| | |
| | | |
| | | System.arraycopy(swipeNumbers, 0, data, 2, swipeNumbers.length); |
| | | |
| | | byte[] electricityPrices = HexUtil.hexToByteArray(HexUtil.folatToHexString(electricityPrice)); |
| | | byte[] electricityPrices = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricityPrice)); |
| | | |
| | | System.arraycopy(electricityPrices, 0, data, 4, electricityPrices.length); |
| | | try { |
| | |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.DomainActivity" /> |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.ElectricPriceActivity" /> |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.IdentifyingActivity" /> |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.ReplacementActivity" /> |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.RechargeDetailActivity" /> |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.PasswordCardActivity" /> |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.RegionActivity" /> |
| | | |
| | | <activity android:name="com.dayu.qihealonelibrary.activity.ManagerListActivity" /> |
| | | <activity |
| | | android:name="com.dayu.qihealonelibrary.activity.ManagerReadActivity" |
| | | android:exported="true" |
| | | android:launchMode="singleTop"> |
| | | <intent-filter> |
| | | <action android:name="android.nfc.action.ACTION_NDEF_DISCOVERED" /> |
| | | <category android:name="android.intent.category.DEFAULT" /> |
| | | <data android:mimeType="text/plain" /> |
| | | </intent-filter> |
| | | </activity> |
| | | </application> |
| | | |
| | | </manifest> |
File was renamed from qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/activity/ReplacementActivity.java |
| | |
| | | |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.EdtDialog; |
| | | import com.dayu.qihealonelibrary.adapter.ReplacementAdapter; |
| | | import com.dayu.qihealonelibrary.databinding.ActivityReplacementQhaBinding; |
| | | import com.dayu.qihealonelibrary.adapter.ManagerCardAdapter; |
| | | import com.dayu.qihealonelibrary.adapter.NewCardAdapter; |
| | | import com.dayu.qihealonelibrary.card.ManageCard; |
| | | import com.dayu.qihealonelibrary.databinding.ActivityManagerListQhaBinding; |
| | | import com.dayu.qihealonelibrary.dbBean.UserCardBean; |
| | | import com.scwang.smart.refresh.footer.ClassicsFooter; |
| | | import com.scwang.smart.refresh.layout.api.RefreshLayout; |
| | |
| | | import io.reactivex.rxjava3.schedulers.Schedulers; |
| | | |
| | | /** |
| | | * Created by Android Studio. |
| | | * author: zuo |
| | | * Date: 2023-11-20 |
| | | * Time: 17:32 |
| | | * 备注: 补卡界面 |
| | | * Date: 2024-05-09 |
| | | * Time: 11:20 |
| | | * 备注:管理卡选择本地用户界面 |
| | | */ |
| | | public class ReplacementActivity extends BaseActivity { |
| | | ActivityReplacementQhaBinding newcardListBinding; |
| | | public class ManagerListActivity extends BaseActivity { |
| | | |
| | | ActivityManagerListQhaBinding binding; |
| | | List<UserCardBean> userCardBeanList = new ArrayList<>(); |
| | | ReplacementAdapter adapter; |
| | | long beginTime; |
| | | long endTime; |
| | | ManagerCardAdapter adapter; |
| | | int page = 0; |
| | | |
| | | //每页数据条数 |
| | | int limit = 30; |
| | | RefreshLayout myRefreshLayout; |
| | | EdtDialog edtDialog; |
| | | String cardNumber; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | newcardListBinding = ActivityReplacementQhaBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(newcardListBinding.getRoot()); |
| | | setRightButton(); |
| | | binding = ActivityManagerListQhaBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(binding.getRoot()); |
| | | cardNumber = this.getIntent().getStringExtra("cardNumber"); |
| | | initList(); |
| | | getList(); |
| | | setRightButton(); |
| | | } |
| | | |
| | | |
| | | public void itemClick(View view) { |
| | | UserCardBean userCardBean = userCardBeanList.get((int) view.getTag()); |
| | | Intent intent = new Intent(ReplacementActivity.this, NFCWreatActivity.class); |
| | | intent.putExtra("dbUserCard", userCardBean); |
| | | ManageCard manageCard = new ManageCard(); |
| | | manageCard.setUserCard(cardNumber); |
| | | Intent intent = new Intent(ManagerListActivity.this, NFCWreatActivity.class); |
| | | intent.putExtra("manageCard", manageCard); |
| | | intent.putExtra("userCardBean_manager", userCardBean); |
| | | startActivity(intent); |
| | | this.finish(); |
| | | } |
| | | |
| | | private void initList() { |
| | | myRefreshLayout = (RefreshLayout) newcardListBinding.refreshLayout; |
| | | myRefreshLayout = (RefreshLayout) binding.refreshLayout; |
| | | myRefreshLayout.setEnableRefresh(false); |
| | | myRefreshLayout.setRefreshFooter(new ClassicsFooter(this)); |
| | | myRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { |
| | |
| | | getList(); |
| | | } |
| | | }); |
| | | adapter = new ReplacementAdapter(this, userCardBeanList); |
| | | adapter = new ManagerCardAdapter(this, userCardBeanList); |
| | | LinearLayoutManager layoutManager = new LinearLayoutManager(this); |
| | | newcardListBinding.recyclerView.setLayoutManager(layoutManager); |
| | | newcardListBinding.recyclerView.setAdapter(adapter); |
| | | binding.recyclerView.setLayoutManager(layoutManager); |
| | | binding.recyclerView.setAdapter(adapter); |
| | | } |
| | | |
| | | |
| | |
| | | Observable<List<UserCardBean>> observable = Observable.create(emitter -> { |
| | | // 在这里执行异步操作 |
| | | List<UserCardBean> beanList; |
| | | if (beginTime == 0 && endTime == 0) { |
| | | beanList = asynchBaseDao.userCardDao().findAll(page * limit, limit); |
| | | } else { |
| | | beanList = asynchBaseDao.userCardDao().findByTime(beginTime, endTime); |
| | | } |
| | | beanList = asynchBaseDao.userCardDao().findAll(page * limit, limit); |
| | | // 将结果发送给观察者 |
| | | emitter.onNext(beanList); |
| | | emitter.onComplete(); |
| | |
| | | ); |
| | | } |
| | | |
| | | |
| | | EdtDialog edtDialog; |
| | | |
| | | private void setRightButton() { |
| | | titleBar.setOnItemclickListner(ClickType_RIGHT_TEXT, new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | edtDialog = new EdtDialog(ReplacementActivity.this, new EdtDialog.DialogBack() { |
| | | @Override |
| | | public void onOk(String data) { |
| | | List<UserCardBean> beans = baseDao.userCardDao().findByData(data); |
| | | if (beans != null && beans.size() > 0) { |
| | | userCardBeanList.clear(); |
| | | userCardBeanList.addAll(beans); |
| | | adapter.notifyDataSetChanged(); |
| | | } else { |
| | | TipUtil.show("未找到该用户"); |
| | | } |
| | | edtDialog.dismiss(); |
| | | titleBar.setOnItemclickListner(ClickType_RIGHT_TEXT, v -> { |
| | | edtDialog = new EdtDialog(ManagerListActivity.this, "可输入姓名、身份证号、手机号搜索", new EdtDialog.DialogBack() { |
| | | @Override |
| | | public void onOk(String data) { |
| | | List<UserCardBean> beans = baseDao.userCardDao().findByData(data); |
| | | if (beans != null && beans.size() > 0) { |
| | | userCardBeanList.clear(); |
| | | userCardBeanList.addAll(beans); |
| | | adapter.notifyDataSetChanged(); |
| | | } else { |
| | | TipUtil.show("未找到该用户"); |
| | | } |
| | | edtDialog.dismiss(); |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | edtDialog.dismiss(); |
| | | } |
| | | }); |
| | | edtDialog.show(); |
| | | } |
| | | @Override |
| | | public void onCancel() { |
| | | edtDialog.dismiss(); |
| | | } |
| | | }); |
| | | edtDialog.show(); |
| | | }); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dayu.qihealonelibrary.activity; |
| | | |
| | | import android.content.Intent; |
| | | import android.nfc.NfcAdapter; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.view.LayoutInflater; |
| | | |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.qihealonelibrary.databinding.ActivityManagerReadQhaBinding; |
| | | import com.dayu.qihealonelibrary.tools.NfcReadHelper; |
| | | import com.dayu.qihealonelibrary.view.ProgressDialog; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-05-09 |
| | | * Time: 11:05 |
| | | * 备注: |
| | | */ |
| | | public class ManagerReadActivity extends BaseNfcActivity { |
| | | |
| | | ActivityManagerReadQhaBinding binding; |
| | | Intent intent; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | binding = ActivityManagerReadQhaBinding.inflate(LayoutInflater.from(this)); |
| | | setContentView(binding.getRoot()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onNewIntent(Intent intent) { |
| | | this.intent = intent; |
| | | ProgressDialog.show(this); |
| | | if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { |
| | | getCardNumber(); |
| | | } |
| | | super.onNewIntent(intent); |
| | | } |
| | | |
| | | |
| | | private void getCardNumber() { |
| | | String cardNumber = NfcReadHelper.getInstence(intent, this).getCardNumber(); |
| | | if (!TextUtils.isEmpty(cardNumber)) { |
| | | TipUtil.show(this, "读卡成功,接下来会跳转到用户列表选择补卡的用户。", new TipUtil.TipListener() { |
| | | @Override |
| | | public void onCancle() { |
| | | Intent intent = new Intent(ManagerReadActivity.this, ManagerListActivity.class); |
| | | intent.putExtra("cardNumber", cardNumber); |
| | | startActivity(intent); |
| | | ManagerReadActivity.this.finish(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } else { |
| | | TipUtil.show(this, "未读取到新卡卡号,请重新贴卡"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | private void initView() { |
| | | myBinding.cardReplacement.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | startActivity(new Intent(MyActivity.this, ReplacementActivity.class)); |
| | | } |
| | | }); |
| | | |
| | | myBinding.myAdmin.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | |
| | | import com.dayu.qihealonelibrary.card.ConfigurationPowerCard; |
| | | import com.dayu.qihealonelibrary.card.ConfigureDeviceRegistrationCrad; |
| | | import com.dayu.qihealonelibrary.card.DomainCard; |
| | | import com.dayu.qihealonelibrary.card.ElectricPriceCard; |
| | | import com.dayu.qihealonelibrary.card.ManageCard; |
| | | import com.dayu.qihealonelibrary.card.PassWordCard; |
| | | import com.dayu.qihealonelibrary.card.RegionCard; |
| | | import com.dayu.qihealonelibrary.card.RegisteredCard; |
| | | import com.dayu.qihealonelibrary.card.TestCard; |
| | | import com.dayu.qihealonelibrary.card.UserCard; |
| | |
| | | */ |
| | | public class NFCWreatActivity extends BaseNfcActivity { |
| | | |
| | | RegisteredCard registeredCard; |
| | | CleanUserCard cleanUserCard; |
| | | ManageCard manageCard; |
| | | DomainCard domainCard; |
| | | |
| | | CleanCard cleanCard; |
| | | ConfigureDeviceRegistrationCrad configureDeviceRegistrationCrad; |
| | | TestCard testCard; |
| | | //区域表号卡 |
| | | RegionCard regionCard; |
| | | ConfigurationPowerCard configurationPowerCard; |
| | | //密码卡 |
| | | PassWordCard passWordCard; |
| | | //用户电量单价卡 |
| | | ElectricPriceCard electricPriceCard; |
| | | UserCardBean userCardBeanByManager; |
| | | boolean electricPriceFlag = false; |
| | | boolean passwordFlag = false; |
| | | boolean cleanFlag = false; |
| | | boolean regionFlag = false; |
| | | boolean userFlag = false; |
| | | boolean manageCardFlag = false; |
| | | boolean registeredFlag = false; |
| | |
| | | Intent intent; |
| | | |
| | | |
| | | RegisteredCard registeredCard; |
| | | CleanUserCard cleanUserCard; |
| | | ManageCard manageCard; |
| | | DomainCard domainCard; |
| | | |
| | | CleanCard cleanCard; |
| | | ConfigureDeviceRegistrationCrad configureDeviceRegistrationCrad; |
| | | TestCard testCard; |
| | | |
| | | ConfigurationPowerCard configurationPowerCard; |
| | | //打印 |
| | | QHAloneApplication baseApp; |
| | | |
| | |
| | | if (this.getIntent().hasExtra("userCard")) { |
| | | userCard = (UserCard) this.getIntent().getSerializableExtra("userCard"); |
| | | } |
| | | if (this.getIntent().hasExtra("electricPriceCard")) { |
| | | electricPriceCard = (ElectricPriceCard) this.getIntent().getSerializableExtra("electricPriceCard"); |
| | | binding.cardData.setText("制作用户电量单价卡\n当前单价:" + electricPriceCard.getElectricPrice().toString() + "元"); |
| | | } |
| | | if (this.getIntent().hasExtra("passWordCard")) { |
| | | passWordCard = (PassWordCard) this.getIntent().getSerializableExtra("passWordCard"); |
| | | binding.cardData.setText("制作密码卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("cleanCard")) { |
| | | cleanCard = (CleanCard) this.getIntent().getSerializableExtra("cleanCard"); |
| | | binding.cardData.setText("制作清零卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("manageCard")) { |
| | | manageCard = (ManageCard) this.getIntent().getSerializableExtra("manageCard"); |
| | | binding.cardData.setText("制作管理卡"); |
| | | if (this.getIntent().hasExtra("userCardBean_manager")) { |
| | | userCardBeanByManager = (UserCardBean) this.getIntent().getSerializableExtra("userCardBean_manager"); |
| | | } |
| | | binding.cardData.setText("制作管理卡(请将管理卡贴在设备上)\n用户卡号:" + manageCard.getUserCard()); |
| | | } |
| | | if (this.getIntent().hasExtra("registeredCard")) { |
| | | registeredCard = (RegisteredCard) this.getIntent().getSerializableExtra("registeredCard"); |
| | |
| | | if (this.getIntent().hasExtra("configurationPowerCard")) { |
| | | configurationPowerCard = (ConfigurationPowerCard) this.getIntent().getSerializableExtra("configurationPowerCard"); |
| | | binding.cardData.setText("制作配置水泵功率卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("regionCard")) { |
| | | regionCard = (RegionCard) this.getIntent().getSerializableExtra("regionCard"); |
| | | binding.cardData.setText("制作区域表号卡"); |
| | | } |
| | | if (this.getIntent().hasExtra("morny")) { |
| | | // 充值逻辑 |
| | |
| | | || registeredCard != null || cleanUserCard != null |
| | | || domainCard != null || testCard != null |
| | | || configureDeviceRegistrationCrad != null |
| | | || configurationPowerCard != null) { |
| | | || configurationPowerCard != null || regionCard != null || passWordCard != null || electricPriceCard != null) { |
| | | if (userCard != null && TextUtils.isEmpty(morny)) { |
| | | userFlag = WriteCardUtils.setUser(intent, userCard, this); |
| | | } |
| | | if (electricPriceCard != null) { |
| | | setElectricPriceCard(intent, electricPriceCard); |
| | | } |
| | | if (passWordCard != null) { |
| | | setPassWordCard(intent, passWordCard); |
| | | } |
| | | if (regionCard != null) { |
| | | setRegionCard(intent, regionCard); |
| | | } |
| | | if (cleanCard != null) { |
| | | setClean(intent, cleanCard); |
| | | } |
| | | if (manageCard != null) { |
| | | setmanageCard(intent, manageCard); |
| | | if (manageCardFlag && userCardBeanByManager != null) { |
| | | //修改用户表信息 |
| | | userCardBeanByManager.setCardNumber(manageCard.getUserCard()); |
| | | baseDao.userCardDao().update(userCardBeanByManager); |
| | | } |
| | | } |
| | | if (registeredCard != null) { |
| | | setRegisteredCard(intent, registeredCard); |
| | |
| | | if (configurationPowerCard != null) { |
| | | setConfigurationPower(intent, configurationPowerCard); |
| | | } |
| | | if ((configPowerFlag || configDeviceRegiestFlag || testCardFlag || domainCrdFlag || userFlag || cleanFlag || manageCardFlag || registeredFlag || administrativeCardFlag || cleanUserCardFlag)) { |
| | | if (electricPriceFlag || passwordFlag || regionFlag || configPowerFlag || configDeviceRegiestFlag || testCardFlag || domainCrdFlag || userFlag || cleanFlag || manageCardFlag || registeredFlag || administrativeCardFlag || cleanUserCardFlag) { |
| | | try { |
| | | if (userFlag && userCardBean != null) { |
| | | //用户卡 |
| | |
| | | } |
| | | |
| | | private void setmanageCard(Intent intent, final ManageCard manageCard) { |
| | | manageCardFlag = NFCWriteHelper.getInstence(intent, this).writeData(manageCard.toZeroByte(baseDao), 1, 0); |
| | | manageCardFlag = NFCWriteHelper.getInstence(intent, this).writeData(manageCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param intent |
| | | * @param clearOrInitCard |
| | | */ |
| | | private void setClean(Intent intent, final CleanCard clearOrInitCard) { |
| | | private void setClean(Intent intent, CleanCard clearOrInitCard) { |
| | | cleanFlag = NFCWriteHelper.getInstence(intent, this).writeData(clearOrInitCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 保存区域表号卡 |
| | | * |
| | | * @param intent |
| | | * @param regionCard |
| | | */ |
| | | private void setRegionCard(Intent intent, RegionCard regionCard) { |
| | | regionFlag = NFCWriteHelper.getInstence(intent, this).writeData(regionCard.toByte(), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 密码卡 |
| | | * |
| | | * @param intent |
| | | * @param passWordCard |
| | | */ |
| | | private void setPassWordCard(Intent intent, PassWordCard passWordCard) { |
| | | passwordFlag = NFCWriteHelper.getInstence(intent, this).writeData(passWordCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 用户电量单价 |
| | | * |
| | | * @param intent |
| | | * @param electricPriceCard |
| | | */ |
| | | private void setElectricPriceCard(Intent intent, ElectricPriceCard electricPriceCard) { |
| | | electricPriceFlag = NFCWriteHelper.getInstence(intent, this).writeData(electricPriceCard.toByte(baseDao), 1, 0); |
| | | } |
| | | |
| | | /** |
| | | * 重新注册设备卡 |
| | |
| | | Intent intent = new Intent(ParameterActivity.this, PasswordCardActivity.class); |
| | | startActivity(intent); |
| | | }); |
| | | binding.parameterRegion.setOnClickListener(v -> { |
| | | Intent intent = new Intent(ParameterActivity.this, RegionActivity.class); |
| | | startActivity(intent); |
| | | }); |
| | | //区域表号卡 |
| | | // binding.parameterRegion.setOnClickListener(v -> { |
| | | // Intent intent = new Intent(ParameterActivity.this, RegionActivity.class); |
| | | // startActivity(intent); |
| | | // }); |
| | | } |
| | | } |
| | |
| | | ActivityPasswordCardQhaBinding binding; |
| | | |
| | | PassWordCardBean cardBean; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | |
| | | if (powerBean != null) { |
| | | this.cardBean = powerBean; |
| | | binding.villageOldNumber.setText(powerBean.getPassWord()); |
| | | } else { |
| | | cardBean = new PassWordCardBean(); |
| | | binding.villageOldNumber.setText("当前还未设置"); |
| | | } |
| | | } |
| | | |
| | |
| | | public void onClick(View v) { |
| | | String data = binding.villageNewNum.getText().toString(); |
| | | if (!TextUtils.isEmpty(data)) { |
| | | if (data.length()==12){ |
| | | if (data.length() == 12) { |
| | | cardBean.setPassWord(data); |
| | | baseDao.passWordCardDao().insert(cardBean); |
| | | TipUtil.show("保存成功"); |
| | | TipUtil.show(PasswordCardActivity.this, "保存成功"); |
| | | initData(); |
| | | }else { |
| | | } else { |
| | | TipUtil.show("请输入正确的12位字符的16进制卡密码"); |
| | | } |
| | | |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | | } |
| | | |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.MANAGE_CRAD: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为管理卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CLEAN_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为清零卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.REGISTERED_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为重新注册设备卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CLEAN_ALL_USER_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为删除全部用户卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.DOMAIN_CARD_TYPE: |
| | | viweGone(false); |
| | |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | | } |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.TEST_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为测试卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CONFIGURATION_CARD_TYPE: |
| | | viweGone(false); |
| | | redCardBinding.readCardTypeTV.setText("当前为配置设备注册信息卡"); |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.CONFIGURATION_POWER_CARD_TYPE: |
| | | viweGone(false); |
| | |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | | } |
| | | stopAnim(); |
| | | break; |
| | | case CardCommon.BLACK: |
| | | viweGone(false); |
| | |
| | | if (!data.isEmpty()) { |
| | | ElectricPriceCard electricPriceCard = ElectricPriceCard.getBean(data); |
| | | StringBuilder electricPriceBuilder = new StringBuilder(); |
| | | electricPriceBuilder.append("电量单价:").append(electricPriceCard.getElectricPrice()).append("\n"); |
| | | electricPriceBuilder.append("电量单价:").append(electricPriceCard.getElectricPrice()); |
| | | electricPriceBuilder.append("元"); |
| | | redCardBinding.readCardDataTV.setText(electricPriceBuilder.toString()); |
| | | } else { |
| | | TipUtil.show("卡片识别错误,请重试!"); |
| | |
| | | break; |
| | | default: |
| | | TipUtil.show(ReadCardAcitivy.this, "卡片无法识别"); |
| | | stopAnim(); |
| | | break; |
| | | } |
| | | |
| | | stopAnim(); |
| | | |
| | | } |
| | | |
| | |
| | | userCard = UserCard.getBean(data); |
| | | List<UserCardBean> userCardBeans = baseDao.userCardDao().findUserName(cardNumber); |
| | | AdminDataBean adminDataBean = baseDao.adminDao().findFirst(); |
| | | if (!userCardBeans.isEmpty()){ |
| | | userCardBean = userCardBeans.get(0); |
| | | if (adminDataBean.addressCode.equalsIgnoreCase(String.valueOf(userCard.getArerNumber()))) { |
| | | |
| | | |
| | | if (adminDataBean.addressCode.equalsIgnoreCase(String.valueOf(userCard.getArerNumber()))) { |
| | | if (!userCardBeans.isEmpty()) { |
| | | userCardBean = userCardBeans.get(0); |
| | | this.userName = userCardBean.getUserName(); |
| | | binding.rechargeReadLL.setVisibility(View.GONE); |
| | | binding.rechargeTextLL.setVisibility(View.VISIBLE); |
| | | binding.rechargeRegistBtn.setVisibility(View.VISIBLE); |
| | | binding.userName.setText(userName); |
| | | binding.redStatu.setText(state); |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | binding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | binding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | binding.redInitCode.setText(cardNumber); |
| | | binding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + ""); |
| | | binding.redTotalWater.setText("总用水量:" + userCard.getTotalWater()); |
| | | binding.redTotalPower.setText("总用电量:" + userCard.getTotalElectric()); |
| | | binding.redRemainderBlance.setText(MornyUtil.changeF2Y(userCard.getBalance()) + "元"); |
| | | binding.redRemainderWater.setText("剩余水量:" + userCard.getSurplusWater()); |
| | | } |
| | | |
| | | } else { |
| | | TipUtil.show(this, "不是本区域卡"); |
| | | userCardBean = new UserCardBean(); |
| | | userCardBean.setCardNumber(cardNumber); |
| | | userCardBean.setUserName("未知用户"); |
| | | userCardBean.setPhone("未知"); |
| | | userCardBean.setUserID("未知"); |
| | | userCardBean.setAddressCode(String.valueOf(userCard.getArerNumber())); |
| | | userCardBean.setSerial(String.valueOf(userCard.getArerNumber())); |
| | | this.userName = "未知用户"; |
| | | } |
| | | }else { |
| | | TipUtil.show(this, "未查询到该卡用户信息"); |
| | | } |
| | | |
| | | binding.rechargeReadLL.setVisibility(View.GONE); |
| | | binding.rechargeTextLL.setVisibility(View.VISIBLE); |
| | | binding.rechargeRegistBtn.setVisibility(View.VISIBLE); |
| | | binding.userName.setText(userName); |
| | | binding.redStatu.setText(state); |
| | | if (userCard != null) { |
| | | Calendar calendar = userCard.getRechargeDate(); |
| | | if (calendar != null) { |
| | | int year = calendar.get(Calendar.YEAR); |
| | | int month = calendar.get(Calendar.MONTH); // 月份从0开始,所以需要加1 |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | binding.redRechargeDate.setText("本卡最后购水日期:" + year + "年" + month + "月" + day + "日"); |
| | | } else { |
| | | binding.redRechargeDate.setText("本卡最后购水日期:无"); |
| | | } |
| | | binding.redInitCode.setText(cardNumber); |
| | | binding.redRechargeNumber.setText("本卡充值次数:" + userCard.getRechargeTimes() + ""); |
| | | binding.redTotalWater.setText("总用水量:" + userCard.getTotalWater()); |
| | | binding.redTotalPower.setText("总用电量:" + userCard.getTotalElectric()); |
| | | binding.redRemainderBlance.setText(MornyUtil.changeF2Y(userCard.getBalance()) + "元"); |
| | | binding.redRemainderWater.setText("剩余水量:" + userCard.getSurplusWater()); |
| | | } |
| | | |
| | | } else { |
| | | TipUtil.show(this, "不是本区域卡"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.dayu.qihealonelibrary.card.ConfigurationPowerCard; |
| | | import com.dayu.qihealonelibrary.card.ConfigureDeviceRegistrationCrad; |
| | | import com.dayu.qihealonelibrary.card.DomainCard; |
| | | import com.dayu.qihealonelibrary.card.ElectricPriceCard; |
| | | import com.dayu.qihealonelibrary.card.ManageCard; |
| | | import com.dayu.qihealonelibrary.card.PassWordCard; |
| | | import com.dayu.qihealonelibrary.card.RegionCard; |
| | | import com.dayu.qihealonelibrary.card.RegisteredCard; |
| | | import com.dayu.qihealonelibrary.card.TestCard; |
| | | import com.dayu.qihealonelibrary.databinding.ActivityAdminQhaBinding; |
| | | import com.dayu.qihealonelibrary.dbBean.AdminDataBean; |
| | | import com.dayu.qihealonelibrary.dbBean.DomainBean; |
| | | import com.dayu.qihealonelibrary.dbBean.ElectricPriceBean; |
| | | import com.dayu.qihealonelibrary.dbBean.PassWordCardBean; |
| | | import com.dayu.qihealonelibrary.dbBean.PowerBean; |
| | | import com.dayu.qihealonelibrary.view.AdminCardDialog; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | private void initView() { |
| | | |
| | | //制作管理卡 |
| | | adminBinding.adminAdmin.setOnClickListener(v -> { |
| | | |
| | | adminBinding.adminAdmin.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | ManageCard manageCard = new ManageCard(); |
| | | intent.putExtra("manageCard", manageCard); |
| | | startActivity(intent); |
| | | } |
| | | AdminCardDialog dialog=new AdminCardDialog(this); |
| | | dialog.show(); |
| | | |
| | | }); |
| | | //制作清零卡 |
| | | adminBinding.adminCleanZero.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | adminBinding.adminCleanZero.setOnClickListener(v -> { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | CleanCard cleanCard = new CleanCard(); |
| | | intent.putExtra("cleanCard", cleanCard); |
| | | startActivity(intent); |
| | | }); |
| | | //制作密码卡 |
| | | adminBinding.adminPassWordCard.setOnClickListener(v -> { |
| | | PassWordCardBean powerBean = baseDao.passWordCardDao().findFirst(); |
| | | if (powerBean != null) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | CleanCard cleanCard = new CleanCard(); |
| | | intent.putExtra("cleanCard", cleanCard); |
| | | PassWordCard passWordCard = new PassWordCard(); |
| | | passWordCard.setPassWord(powerBean.getPassWord()); |
| | | intent.putExtra("passWordCard", passWordCard); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | adminBinding.adminRegistered.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | RegisteredCard registeredCard = new RegisteredCard(); |
| | | intent.putExtra("registeredCard", registeredCard); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | //删除全部用户 |
| | | adminBinding.adminCleanUser.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | CleanUserCard cleanUserCard = new CleanUserCard(); |
| | | intent.putExtra("cleanUserCard", cleanUserCard); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | // 设置域名卡 |
| | | adminBinding.adminDomain.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | DomainBean domainBean = baseDao.domainPortDao().findFirst(); |
| | | DomainCard domainCard = new DomainCard(); |
| | | if (domainBean != null) { |
| | | domainCard.setDomainNumber(domainBean.getDomainNumber()); |
| | | domainCard.setDomainName(domainBean.getDomain()); |
| | | domainCard.setPort(domainBean.getPort()); |
| | | } else { |
| | | domainCard.setDomainNumber("1"); |
| | | domainCard.setDomainName("dayuyanjiuyuan.top"); |
| | | domainCard.setPort(8888); |
| | | } |
| | | intent.putExtra("domainCard", domainCard); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | |
| | | //制作测试卡 |
| | | adminBinding.adminTest.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | TestCard testCard = new TestCard(); |
| | | intent.putExtra("testCard", testCard); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | |
| | | //制作配置设备信息卡 |
| | | adminBinding.adminConfigDeviceRegistration.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | ConfigureDeviceRegistrationCrad configureDeviceRegistrationCrad = new ConfigureDeviceRegistrationCrad(); |
| | | intent.putExtra("configureDeviceRegistrationCrad", configureDeviceRegistrationCrad); |
| | | startActivity(intent); |
| | | } |
| | | }); |
| | | |
| | | //制作配置水泵功率卡 |
| | | adminBinding.adminConfigPower.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | PowerBean powerBean = baseDao.powerDao().findFirst(); |
| | | if (powerBean != null) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | ConfigurationPowerCard configurationPowerCard = new ConfigurationPowerCard(); |
| | | configurationPowerCard.setPower(powerBean.getPower()); |
| | | intent.putExtra("configurationPowerCard", configurationPowerCard); |
| | | startActivity(intent); |
| | | } else { |
| | | TipUtil.show("请先设置水泵功率"); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | adminBinding.adminPassWordCard.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | PassWordCardBean powerBean = baseDao.passWordCardDao().findFirst(); |
| | | if (powerBean != null) { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | PassWordCard passWordCard = new PassWordCard(); |
| | | passWordCard.setPassWord(powerBean.getPassWord()); |
| | | intent.putExtra("passWordCard", passWordCard); |
| | | startActivity(intent); |
| | | } else { |
| | | TipUtil.show("请先设置卡密码"); |
| | | } |
| | | } else { |
| | | TipUtil.show(this, "请先在参数设置内设置卡密码"); |
| | | } |
| | | }); |
| | | |
| | | //制作区域表号卡 |
| | | adminBinding.adminRegionCard.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | adminBinding.adminRegionCard.setOnClickListener(v -> { |
| | | |
| | | } |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | RegionCard regionCard = new RegionCard(); |
| | | AdminDataBean adminDataBean = baseDao.adminDao().findFirst(); |
| | | regionCard.setRegion(Integer.valueOf(adminDataBean.getAddressCode())); |
| | | regionCard.setControllerCodel(Integer.valueOf(adminDataBean.getAddressCode())); |
| | | intent.putExtra("regionCard", regionCard); |
| | | startActivity(intent); |
| | | }); |
| | | //制作设置用户电量单价卡 |
| | | adminBinding.adminElectricCard.setOnClickListener(v -> { |
| | | Intent intent = new Intent(SysActivity.this, NFCWreatActivity.class); |
| | | ElectricPriceBean electricPriceBean = baseDao.electricPriceDao().findFirst(); |
| | | if (electricPriceBean != null) { |
| | | ElectricPriceCard electricPriceCard = new ElectricPriceCard(); |
| | | electricPriceCard.setElectricPrice(electricPriceBean.getPrice()); |
| | | intent.putExtra("electricPriceCard", electricPriceCard); |
| | | startActivity(intent); |
| | | } else { |
| | | TipUtil.show(this, "请先在参数设置内设置电量单价"); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
File was renamed from qihealonelibrary/src/main/java/com/dayu/qihealonelibrary/adapter/ReplacementAdapter.java |
| | |
| | | import com.dayu.baselibrary.databinding.ItemNoMoreBinding; |
| | | import com.dayu.baselibrary.utils.DateUtil; |
| | | import com.dayu.qihealonelibrary.R; |
| | | import com.dayu.qihealonelibrary.activity.ReplacementActivity; |
| | | import com.dayu.qihealonelibrary.activity.ManagerListActivity; |
| | | import com.dayu.qihealonelibrary.databinding.QiheItemReplacementsBinding; |
| | | import com.dayu.qihealonelibrary.dbBean.UserCardBean; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class ReplacementAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> { |
| | | public class ManagerCardAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> { |
| | | |
| | | List<UserCardBean> rechargeList; |
| | | ReplacementActivity mContext; |
| | | ManagerListActivity mContext; |
| | | |
| | | public ReplacementAdapter(ReplacementActivity context, List<UserCardBean> rechargeList) { |
| | | public ManagerCardAdapter(ManagerListActivity context, List<UserCardBean> rechargeList) { |
| | | mContext = context; |
| | | this.rechargeList = rechargeList; |
| | | } |
| | |
| | | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { |
| | | if (holder instanceof ViewHolder) { |
| | | if (rechargeList.size() > 0) { |
| | | ((ViewHolder) holder).getBinding().userName.setText("用户名:" + rechargeList.get(position).getUserName()); |
| | | ((ViewHolder) holder).getBinding().userName.setText("姓名:" + rechargeList.get(position).getUserName()); |
| | | ((ViewHolder) holder).getBinding().userNo.setText("身份证号:" + rechargeList.get(position).getUserID()); |
| | | ((ViewHolder) holder).getBinding().cardNumber.setText("卡号:" + rechargeList.get(position).getCardNumber()); |
| | | ((ViewHolder) holder).getBinding().water.setText("电话:" + rechargeList.get(position).getPhone()); |
| | | ((ViewHolder) holder).getBinding().date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1)); |
| | | ((ViewHolder) holder).getBinding().item.setTag(position); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public static ElectricPriceCard getBean(List<byte[]> data){ |
| | | ElectricPriceCard regionCard=new ElectricPriceCard(); |
| | | byte[] zero=data.get(0); |
| | | regionCard.cardType= HexUtil.byteToHex(zero[0]); |
| | | public static ElectricPriceCard getBean(List<byte[]> data) { |
| | | ElectricPriceCard regionCard = new ElectricPriceCard(); |
| | | byte[] zero = data.get(0); |
| | | regionCard.cardType = HexUtil.byteToHex(zero[0]); |
| | | |
| | | byte[] cardDataByte = new byte[4]; |
| | | System.arraycopy(zero, 1, cardDataByte, 0, cardDataByte.length); |
| | |
| | | |
| | | byte[] electricPriceByte = new byte[4]; |
| | | System.arraycopy(zero, 5, electricPriceByte, 0, electricPriceByte.length); |
| | | regionCard.electricPrice = HexUtil.bytesToFloat(electricPriceByte); |
| | | regionCard.electricPrice = HexUtil.hexToFloatLowHigh(electricPriceByte); |
| | | |
| | | |
| | | return regionCard; |
| | |
| | | /** |
| | | * 第1扇区0块 存储的数据 |
| | | */ |
| | | public class Zero { |
| | | public class Zero { |
| | | public byte[] toByte() { |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
| | |
| | | System.arraycopy(regionBytes, 0, data, 1, regionBytes.length); |
| | | } |
| | | |
| | | byte[] controllerCodelBytes = HexUtil.folatToByte(electricPrice); |
| | | byte[] controllerCodelBytes = HexUtil.hexToByteArray(HexUtil.floatToHexLowHigh(electricPrice)); |
| | | if (controllerCodelBytes != null) { |
| | | System.arraycopy(controllerCodelBytes, 0, data, 5, controllerCodelBytes.length); |
| | | } |
| | |
| | | */ |
| | | public class ManageCard extends BaseCard implements Serializable { |
| | | public String cardType = CardCommon.MANAGE_CRAD;//卡类型 |
| | | // public String cardData = "A0B1C289";//标识码 |
| | | |
| | | |
| | | /** |
| | | * M1卡的0扇区0块通常用于存储一些基本的卡片信息 |
| | | * 第0字节:卡片类型(M1卡为0x08) |
| | | * 第1字节:卡片地址(通常为0x00) |
| | | * 第2-5字节:卡片序列号(4字节) |
| | | * 第6-8字节:卡片制造商代码(3字节) |
| | | * 第9字节:卡片版本 |
| | | * 第10-15字节:预留区域 |
| | | */ |
| | | public byte[] userCard; //用户卡号 |
| | | |
| | | |
| | | public String getCardData() { |
| | | return cardData; |
| | | } |
| | | |
| | | public byte[] toZeroByte(QHAloneAppDatabase QHAloneAppDatabase) { |
| | | /** |
| | | * M1卡的0扇区0块通常用于存储一些基本的卡片信息 |
| | | * 0-4字节是卡号 |
| | | */ |
| | | public String userCard; //用户卡号 |
| | | |
| | | public String getUserCard() { |
| | | return userCard; |
| | | } |
| | | |
| | | public void setUserCard(String userCard) { |
| | | this.userCard = userCard; |
| | | } |
| | | |
| | | public byte[] toByte(QHAloneAppDatabase QHAloneAppDatabase) { |
| | | setCardData(QHAloneAppDatabase, cardType); |
| | | Zero zero = new Zero(); |
| | | return zero.toByte(); |
| | |
| | | byte[] cardDataByte = HexUtil.hexToByteArray(cardData); |
| | | System.arraycopy(cardDataByte, 0, data, 1, cardDataByte.length); |
| | | |
| | | byte[] userCardByts = HexUtil.hexToByteArray(userCard); |
| | | if (userCard != null) { |
| | | System.arraycopy(userCard, 0, data, 5, userCard.length); |
| | | System.arraycopy(userCardByts, 0, data, 5, userCardByts.length); |
| | | } |
| | | |
| | | data[15] = getByteSum(data); |
| | |
| | | } |
| | | |
| | | |
| | | public class Zero extends BaseCard { |
| | | public class Zero { |
| | | public byte[] toByte() { |
| | | byte[] data = new byte[16]; |
| | | data[0] = HexUtil.hexToByte(cardType); |
New file |
| | |
| | | package com.dayu.qihealonelibrary.view; |
| | | |
| | | import static android.view.Gravity.CENTER; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Dialog; |
| | | import android.content.Intent; |
| | | import android.text.TextUtils; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.view.WindowManager; |
| | | import android.widget.RadioGroup; |
| | | import android.widget.TextView; |
| | | |
| | | import com.dayu.baselibrary.dao.BaseDaoSingleton; |
| | | import com.dayu.baselibrary.dao.LibraryDao; |
| | | import com.dayu.baselibrary.dbbean.LibraryBean; |
| | | import com.dayu.baselibrary.utils.TipUtil; |
| | | import com.dayu.baselibrary.view.ConfirmDialog; |
| | | import com.dayu.baselibrary.view.EdtDialog; |
| | | import com.dayu.baselibrary.view.LibraryDialog; |
| | | import com.dayu.qihealonelibrary.R; |
| | | import com.dayu.qihealonelibrary.activity.BaseActivity; |
| | | import com.dayu.qihealonelibrary.activity.ManagerReadActivity; |
| | | import com.dayu.qihealonelibrary.activity.NFCWreatActivity; |
| | | import com.dayu.qihealonelibrary.card.ManageCard; |
| | | |
| | | /** |
| | | * author: zuo |
| | | * Date: 2024-05-08 |
| | | * Time: 17:53 |
| | | * 备注:制作管理卡时选择本机用户还是手动输入 |
| | | */ |
| | | public class AdminCardDialog extends Dialog { |
| | | |
| | | BaseActivity mContext; |
| | | boolean ischose = false; |
| | | |
| | | int type; |
| | | |
| | | EdtDialog edtDialog; |
| | | |
| | | public AdminCardDialog(BaseActivity context) { |
| | | super(context, com.dayu.baselibrary.R.style.ws_pay_showSelfDialog); |
| | | mContext = context; |
| | | initView(); |
| | | } |
| | | |
| | | private void initView() { |
| | | getWindow().setGravity(CENTER); |
| | | setContentView(R.layout.admincard_dialog); |
| | | setCanceledOnTouchOutside(false); |
| | | RadioGroup radioGroup = findViewById(com.dayu.baselibrary.R.id.radioLibrary); |
| | | |
| | | radioGroup.setOnCheckedChangeListener((group, checkedId) -> { |
| | | ischose = true; |
| | | // 当选中的RadioButton发生变化时调用 |
| | | if (checkedId == R.id.local) { |
| | | type = 0; |
| | | } else if (checkedId == R.id.input) {// 处理选中Option 2的逻辑 |
| | | type = 1; |
| | | } |
| | | }); |
| | | TextView okBtn = findViewById(com.dayu.baselibrary.R.id.ok); |
| | | okBtn.setOnClickListener(v -> { |
| | | if (ischose) { |
| | | if (type == 0) { |
| | | Intent intent = new Intent(mContext, ManagerReadActivity.class); |
| | | mContext.startActivity(intent); |
| | | AdminCardDialog.this.dismiss(); |
| | | } else { |
| | | edtDialog = new EdtDialog(mContext, "请输入16进制的用户卡号", new EdtDialog.DialogBack() { |
| | | @Override |
| | | public void onOk(String data) { |
| | | if (!TextUtils.isEmpty(data) && data.length() == 8) { |
| | | Intent intent = new Intent(mContext, NFCWreatActivity.class); |
| | | ManageCard manageCard = new ManageCard(); |
| | | manageCard.setUserCard(data); |
| | | intent.putExtra("manageCard", manageCard); |
| | | mContext.startActivity(intent); |
| | | mContext.finish(); |
| | | } else { |
| | | TipUtil.show("请输入8字符的卡号"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | edtDialog.dismiss(); |
| | | } |
| | | }); |
| | | edtDialog.show(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void show() { |
| | | |
| | | super.show(); |
| | | /** |
| | | * 设置宽度全屏,要设置在show的后面 |
| | | */ |
| | | WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); |
| | | layoutParams.gravity = CENTER; |
| | | layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT; |
| | | getWindow().getDecorView().setPadding(0, 0, 0, 0); |
| | | getWindow().setAttributes(layoutParams); |
| | | } |
| | | |
| | | |
| | | public interface libraryBack { |
| | | void listener(int type); |
| | | } |
| | | } |
| | |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_registered" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:visibility="gone" |
| | | android:text="制作重新注册设备卡" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_CleanUser" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:visibility="gone" |
| | | android:text="制作删除全部用户卡" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_domain" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作设置域名卡" |
| | | android:visibility="gone" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_test" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作测试卡" |
| | | android:visibility="gone" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_configDeviceRegistration" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作配置设备信息卡" |
| | | android:visibility="gone" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_passWordCard" |
| | |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_configPower" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作配置水泵功率卡" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_blackCard" |
| | |
| | | android:padding="5dp" |
| | | android:text="制作黑卡" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="gone" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_regionCard" |
| | |
| | | android:text="制作区域表号卡" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/admin_electricCard" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:text="制作用户电量单价卡" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.dayu.baselibrary.view.TitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dimen_title_height" |
| | | android:background="@color/title_bar_bg" |
| | | app:centerText="选择本机用户" |
| | | app:leftImage="@mipmap/icon_back" |
| | | app:rightText="筛选" /> |
| | | |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:id="@+id/refreshLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@+id/titleBar"> |
| | | |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:id="@+id/recyclerView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#ffffff" |
| | | android:overScrollMode="never" |
| | | android:padding="10dp" /> |
| | | |
| | | <com.scwang.smart.refresh.footer.ClassicsFooter |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" /> |
| | | </com.scwang.smart.refresh.layout.SmartRefreshLayout> |
| | | |
| | | |
| | | </RelativeLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <com.dayu.baselibrary.view.TitleBar |
| | | android:id="@+id/titleBar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dimen_title_height" |
| | | android:background="@color/title_bar_bg" |
| | | app:centerText="读取卡片" |
| | | app:leftImage="@mipmap/icon_back" /> |
| | | |
| | | <ScrollView |
| | | android:id="@+id/read_userLL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@id/titleBar" |
| | | android:visibility="gone"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_margin="20dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_name" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="姓名:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="卡号:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_initCode" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:text="" |
| | | android:textSize="@dimen/text_size" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_blance" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余金额:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_remainder_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="剩余水量:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeDate" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="最后购水日期:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_rechargeNumber" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="充值次数:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_water" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用水量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_total_power" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="总用电量:" |
| | | android:textSize="@dimen/text_size" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/red_statu" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="15dp" |
| | | android:text="卡状态:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | </ScrollView> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/read_cardTypeLL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@id/titleBar" |
| | | android:gravity="center" |
| | | android:orientation="vertical" |
| | | android:visibility="visible"> |
| | | |
| | | <TextView |
| | | android:id="@+id/read_cardTypeTV" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerHorizontal="true" |
| | | android:layout_centerVertical="true" |
| | | android:layout_gravity="center" |
| | | android:gravity="center" |
| | | android:textSize="30sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/read_cardDataTV" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_centerHorizontal="true" |
| | | android:layout_centerVertical="true" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="20dp" |
| | | android:gravity="left" |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/read_imgLL" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@id/titleBar" |
| | | android:background="#ffffff" |
| | | android:orientation="vertical" |
| | | android:visibility="visible"> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_below="@id/titleBar" |
| | | android:layout_marginTop="40dp" |
| | | android:gravity="center" |
| | | android:text="请将用户新卡贴在设备上进行读卡" |
| | | android:textColor="@color/red" |
| | | android:textSize="@dimen/big_text_size" /> |
| | | |
| | | |
| | | <ImageView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_below="@id/textView" |
| | | android:scaleType="fitCenter" |
| | | android:src="@mipmap/nfc_write" /> |
| | | </LinearLayout> |
| | | |
| | | <com.wang.avi.AVLoadingIndicatorView |
| | | android:id="@+id/avi" |
| | | style="@style/AVLoadingIndicatorView" |
| | | android:layout_width="80dp" |
| | | android:layout_height="80dp" |
| | | android:layout_centerHorizontal="true" |
| | | android:layout_centerVertical="true" |
| | | android:visibility="gone" |
| | | app:indicatorColor="@color/title_bg" |
| | | app:indicatorName="BallClipRotatePulseIndicator" /> |
| | | |
| | | </RelativeLayout> |
| | |
| | | android:layout_marginLeft="20dp" |
| | | android:layout_marginTop="20dp" |
| | | android:padding="5dp" |
| | | android:visibility="gone" |
| | | android:text="区域表号设置" |
| | | android:textColor="@color/text_selecter" |
| | | android:textSize="@dimen/text_size" /> |
| | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="当前密码" |
| | | android:text="当前密码:" |
| | | android:textSize="@dimen/text_size" /> |
| | | |
| | | <TextView |
| | |
| | | android:layout_marginBottom="20dp" |
| | | android:hint="请输入新设置的12位16进制卡密码" |
| | | android:inputType="number|numberDecimal" |
| | | android:digits="0123456789." /> |
| | | android:lines="1" |
| | | android:maxLength="12" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/village_ok" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="#00ffffff" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_margin="@dimen/dialog_bg_margin" |
| | | android:background="@drawable/base_bg_dialog_top_stroke" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:layout_width="300dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | | android:gravity="center" |
| | | android:text="选择补卡方式" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="23sp" |
| | | android:textStyle="bold" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="2px" |
| | | android:layout_marginTop="20dp" |
| | | android:background="@color/line_bg" /> |
| | | |
| | | <RadioGroup |
| | | android:id="@+id/radioLibrary" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <RadioButton |
| | | android:id="@+id/local" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="50dp" |
| | | android:layout_marginTop="25dp" |
| | | android:layout_marginRight="50dp" |
| | | android:background="@drawable/radio_select" |
| | | android:button="@null" |
| | | android:gravity="center" |
| | | android:padding="6dp" |
| | | android:text="选择本机用户" |
| | | android:textColor="@drawable/radio_text_select" |
| | | android:textSize="20sp" /> |
| | | |
| | | <RadioButton |
| | | android:id="@+id/input" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="50dp" |
| | | android:layout_marginTop="25dp" |
| | | android:layout_marginRight="50dp" |
| | | android:background="@drawable/radio_select" |
| | | android:button="@null" |
| | | android:gravity="center" |
| | | android:padding="6dp" |
| | | android:text="单独输入卡号" |
| | | android:textColor="@drawable/radio_text_select" |
| | | android:textSize="20sp" /> |
| | | </RadioGroup> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="2px" |
| | | android:layout_marginTop="35dp" |
| | | android:background="@color/line_bg" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="horizontal" |
| | | android:padding="5dp"> |
| | | |
| | | <TextView |
| | | android:id="@+id/ok" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dialog_btn_height" |
| | | android:background="@drawable/textview_select_bg" |
| | | android:gravity="center" |
| | | android:paddingLeft="15dp" |
| | | android:paddingTop="5dp" |
| | | android:paddingRight="15dp" |
| | | android:paddingBottom="5dp" |
| | | android:text="确 认" |
| | | android:textColor="@color/dialog_btn" |
| | | android:textSize="20sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | |
| | | <variable |
| | | name="activity" |
| | | type="com.dayu.qihealonelibrary.activity.ReplacementActivity" /> |
| | | type="com.dayu.qihealonelibrary.activity.ManagerListActivity" /> |
| | | |
| | | </data> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | |
| | | android:textSize="14sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/cardNumber" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="卡号:" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/userNo" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="户号:123123" |
| | | android:text="身份证号:123123" |
| | | android:textSize="14sp" /> |
| | | |
| | | <TextView |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:text="水量:123123" |
| | | android:text="电话:123123" |
| | | android:textSize="14sp" /> |
| | | |
| | | <TextView |