Commit d33967d5972f78ee8671b48d024a8c61b77f8746
1 parent
c7d05606
1 修复更改音箱名称点击默认可以点击保存按钮的问题
Showing
2 changed files
with
4 additions
and
1 deletions
config.gradle
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/ChangeDeviceNameView.java
| @@ -24,6 +24,7 @@ public class ChangeDeviceNameView implements MvpView { | @@ -24,6 +24,7 @@ public class ChangeDeviceNameView implements MvpView { | ||
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | public void initView(String deviceId) { | 26 | public void initView(String deviceId) { |
| 27 | + setBtnCantClick(); | ||
| 27 | this.deviceId = deviceId; | 28 | this.deviceId = deviceId; |
| 28 | //编辑框 | 29 | //编辑框 |
| 29 | fragment.binding.etName.addTextChangedListener(new TextWatcher() { | 30 | fragment.binding.etName.addTextChangedListener(new TextWatcher() { |
| @@ -77,6 +78,7 @@ public class ChangeDeviceNameView implements MvpView { | @@ -77,6 +78,7 @@ public class ChangeDeviceNameView implements MvpView { | ||
| 77 | */ | 78 | */ |
| 78 | private void setBtnCantClick() { | 79 | private void setBtnCantClick() { |
| 79 | fragment.binding.btnNext.setClickable(false); | 80 | fragment.binding.btnNext.setClickable(false); |
| 81 | + fragment.binding.btnNext.setFocusable(false); | ||
| 80 | fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); | 82 | fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); |
| 81 | } | 83 | } |
| 82 | 84 | ||
| @@ -85,6 +87,7 @@ public class ChangeDeviceNameView implements MvpView { | @@ -85,6 +87,7 @@ public class ChangeDeviceNameView implements MvpView { | ||
| 85 | */ | 87 | */ |
| 86 | private void setBtnClick() { | 88 | private void setBtnClick() { |
| 87 | fragment.binding.btnNext.setClickable(true); | 89 | fragment.binding.btnNext.setClickable(true); |
| 90 | + fragment.binding.btnNext.setFocusable(true); | ||
| 88 | fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | 91 | fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); |
| 89 | } | 92 | } |
| 90 | } | 93 | } |