Commit 8e0ed9561a2be06c188d111afc9b1f37e8d3040b
1 parent
29237381
1 修改分享页二维码样式
Showing
26 changed files
with
176 additions
and
62 deletions
config.gradle
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/ChangeDeviceNameView.java
| 1 | 1 | package com.cnlive.strike.xiaojiaspeaker.frame.view; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | -import android.content.Intent; | |
| 5 | 4 | import android.support.v4.content.ContextCompat; |
| 6 | 5 | import android.text.Editable; |
| 7 | 6 | import android.text.TextWatcher; |
| ... | ... | @@ -9,8 +8,6 @@ import android.view.View; |
| 9 | 8 | |
| 10 | 9 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 11 | 10 | import com.cnlive.strike.xiaojiaspeaker.frame.presenter.ChangeDeviceNamePresenter; |
| 12 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.DeviceDetail; | |
| 13 | -import com.cnlive.strike.xiaojiaspeaker.ui.activity.ChangeDeviceNameActivity; | |
| 14 | 11 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeDeviceNameFragment; |
| 15 | 12 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 16 | 13 | |
| ... | ... | @@ -80,7 +77,7 @@ public class ChangeDeviceNameView implements MvpView { |
| 80 | 77 | */ |
| 81 | 78 | private void setBtnCantClick() { |
| 82 | 79 | fragment.binding.btnNext.setClickable(false); |
| 83 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_btn_press)); | |
| 80 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); | |
| 84 | 81 | } |
| 85 | 82 | |
| 86 | 83 | /** |
| ... | ... | @@ -88,6 +85,6 @@ public class ChangeDeviceNameView implements MvpView { |
| 88 | 85 | */ |
| 89 | 86 | private void setBtnClick() { |
| 90 | 87 | fragment.binding.btnNext.setClickable(true); |
| 91 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_green)); | |
| 88 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | |
| 92 | 89 | } |
| 93 | 90 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/ChangeWifiFragmentView.java
| 1 | 1 | package com.cnlive.strike.xiaojiaspeaker.frame.view; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | -import android.bluetooth.BluetoothGatt; | |
| 5 | 4 | import android.graphics.Typeface; |
| 6 | 5 | import android.net.wifi.ScanResult; |
| 7 | -import android.os.Handler; | |
| 8 | 6 | import android.support.v4.content.ContextCompat; |
| 9 | 7 | import android.support.v7.widget.LinearLayoutManager; |
| 10 | 8 | import android.text.TextUtils; |
| 11 | 9 | import android.util.Log; |
| 12 | 10 | import android.view.View; |
| 13 | 11 | |
| 14 | -import com.clj.fastble.BleManager; | |
| 15 | -import com.clj.fastble.callback.BleGattCallback; | |
| 16 | -import com.clj.fastble.callback.BleNotifyCallback; | |
| 17 | -import com.clj.fastble.callback.BleWriteCallback; | |
| 18 | -import com.clj.fastble.data.BleDevice; | |
| 19 | -import com.clj.fastble.exception.BleException; | |
| 20 | 12 | import com.cnlive.libs.base.util.AlertUtil; |
| 21 | 13 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 22 | -import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | |
| 23 | -import com.cnlive.strike.xiaojiaspeaker.constants.BlufiConstants; | |
| 24 | 14 | import com.cnlive.strike.xiaojiaspeaker.frame.presenter.ChangeWifiFragmentPresenter; |
| 25 | -import com.cnlive.strike.xiaojiaspeaker.frame.presenter.SelectWifiFragmentPresenter; | |
| 26 | 15 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 27 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.NetworkResultBean; | |
| 28 | -import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnBluetoothSuccessActivity; | |
| 29 | 16 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.WifiRecycleAdapter; |
| 30 | 17 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeWifiFragment; |
| 31 | -import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment; | |
| 32 | 18 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.TipDialog; |
| 33 | 19 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.WifiPwdDialog; |
| 34 | -import com.cnlive.strike.xiaojiaspeaker.util.BlueToothUtil; | |
| 35 | -import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; | |
| 36 | 20 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 37 | 21 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 38 | 22 | |
| 39 | -import java.io.UnsupportedEncodingException; | |
| 40 | 23 | import java.util.ArrayList; |
| 41 | 24 | import java.util.List; |
| 42 | 25 | |
| ... | ... | @@ -183,7 +166,7 @@ public class ChangeWifiFragmentView implements MvpView { |
| 183 | 166 | fragment.binding.llLoading.setVisibility(View.VISIBLE); |
| 184 | 167 | //设置按钮不可点击 |
| 185 | 168 | fragment.binding.btnNext.setClickable(false); |
| 186 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_btn_press)); | |
| 169 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); | |
| 187 | 170 | |
| 188 | 171 | } |
| 189 | 172 | |
| ... | ... | @@ -196,7 +179,7 @@ public class ChangeWifiFragmentView implements MvpView { |
| 196 | 179 | fragment.binding.llLoading.setVisibility(View.GONE); |
| 197 | 180 | //设置按钮可点击 |
| 198 | 181 | fragment.binding.btnNext.setClickable(true); |
| 199 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_green)); | |
| 182 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | |
| 200 | 183 | } |
| 201 | 184 | |
| 202 | 185 | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/InvitFriendView.java
| ... | ... | @@ -126,6 +126,7 @@ public class InvitFriendView implements MvpView { |
| 126 | 126 | String qrContent = jsonObject.toString(); |
| 127 | 127 | encryptionContent = SimpleDES.ebotongEncrypto(qrContent, "cnliveIm"); |
| 128 | 128 | encryptionContent = encryptionContent.replaceAll("\\\n", ""); |
| 129 | + encryptionContent = "http://apiwjj.cnlive.com/download/index.html" + "?isWjjQr=" + encryptionContent; | |
| 129 | 130 | QrService service = (QrService) ARouter.getInstance().navigation(QrService.class); |
| 130 | 131 | if (null == service) { |
| 131 | 132 | return; | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SearchDevicefragmentView.java
| ... | ... | @@ -2,35 +2,25 @@ package com.cnlive.strike.xiaojiaspeaker.frame.view; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.bluetooth.BluetoothAdapter; |
| 5 | -import android.bluetooth.BluetoothGatt; | |
| 6 | 5 | import android.content.Intent; |
| 7 | 6 | import android.support.v4.content.ContextCompat; |
| 8 | 7 | import android.support.v7.widget.DefaultItemAnimator; |
| 9 | 8 | import android.support.v7.widget.LinearLayoutManager; |
| 10 | 9 | import android.text.TextUtils; |
| 11 | -import android.util.Log; | |
| 12 | 10 | import android.view.View; |
| 13 | 11 | |
| 14 | 12 | import com.clj.fastble.BleManager; |
| 15 | -import com.clj.fastble.callback.BleGattCallback; | |
| 16 | -import com.clj.fastble.callback.BleNotifyCallback; | |
| 17 | 13 | import com.clj.fastble.callback.BleScanCallback; |
| 18 | -import com.clj.fastble.callback.BleWriteCallback; | |
| 19 | 14 | import com.clj.fastble.data.BleDevice; |
| 20 | -import com.clj.fastble.exception.BleException; | |
| 21 | 15 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 22 | -import com.cnlive.strike.xiaojiaspeaker.constants.BlufiConstants; | |
| 23 | 16 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothHelpActivity; |
| 24 | -import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothStep2Activity; | |
| 25 | 17 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectWifiActivity; |
| 26 | 18 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.BluetoothDeviceAdapter; |
| 27 | 19 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SearchDevicefragment; |
| 28 | 20 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; |
| 29 | -import com.cnlive.strike.xiaojiaspeaker.util.BlueToothUtil; | |
| 30 | 21 | import com.cnlive.strike.xiaojiaspeaker.util.WifiUtils; |
| 31 | 22 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 32 | 23 | |
| 33 | -import java.io.UnsupportedEncodingException; | |
| 34 | 24 | import java.util.ArrayList; |
| 35 | 25 | import java.util.List; |
| 36 | 26 | |
| ... | ... | @@ -234,7 +224,7 @@ public class SearchDevicefragmentView implements MvpView { |
| 234 | 224 | } |
| 235 | 225 | if (fragment.binding.btnBondDevice.isClickable()) { |
| 236 | 226 | fragment.binding.btnBondDevice.setClickable(false); |
| 237 | - fragment.binding.btnBondDevice.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_btn_press)); | |
| 227 | + fragment.binding.btnBondDevice.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); | |
| 238 | 228 | } |
| 239 | 229 | } |
| 240 | 230 | |
| ... | ... | @@ -247,7 +237,7 @@ public class SearchDevicefragmentView implements MvpView { |
| 247 | 237 | } |
| 248 | 238 | if (!fragment.binding.btnBondDevice.isClickable()) { |
| 249 | 239 | fragment.binding.btnBondDevice.setClickable(true); |
| 250 | - fragment.binding.btnBondDevice.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_green)); | |
| 240 | + fragment.binding.btnBondDevice.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | |
| 251 | 241 | } |
| 252 | 242 | } |
| 253 | 243 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SelectIMFriendView.java
| ... | ... | @@ -24,7 +24,6 @@ import com.cnlive.strike.xiaojiaspeaker.netWork.bean.XiaoJiaContactInfo; |
| 24 | 24 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.SetFriendsRoleActivity; |
| 25 | 25 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.SelectIMFriendAdapter; |
| 26 | 26 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectIMFriendFragment; |
| 27 | -import com.cnlive.strike.xiaojiaspeaker.util.utilcode.util.GsonUtils; | |
| 28 | 27 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 29 | 28 | |
| 30 | 29 | import java.util.ArrayList; |
| ... | ... | @@ -310,7 +309,7 @@ public class SelectIMFriendView implements MvpView, LetterBarView.OnLetterSelect |
| 310 | 309 | */ |
| 311 | 310 | public void nextBtnCanClick() { |
| 312 | 311 | fragment.binding.btnNext.setEnabled(true); |
| 313 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_green)); | |
| 312 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | |
| 314 | 313 | |
| 315 | 314 | } |
| 316 | 315 | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SelectWifiFragmentView.java
| ... | ... | @@ -180,7 +180,7 @@ public class SelectWifiFragmentView implements MvpView { |
| 180 | 180 | fragment.binding.llLoading.setVisibility(View.VISIBLE); |
| 181 | 181 | //设置按钮不可点击 |
| 182 | 182 | fragment.binding.btnNext.setClickable(false); |
| 183 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_btn_press)); | |
| 183 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); | |
| 184 | 184 | |
| 185 | 185 | } |
| 186 | 186 | |
| ... | ... | @@ -193,7 +193,7 @@ public class SelectWifiFragmentView implements MvpView { |
| 193 | 193 | fragment.binding.llLoading.setVisibility(View.GONE); |
| 194 | 194 | //设置按钮可点击 |
| 195 | 195 | fragment.binding.btnNext.setClickable(true); |
| 196 | - fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_green)); | |
| 196 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | private void connectDevice(BleDevice bleDevice, final String wifiSSID, final String wifiPwd) { | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SetFriendsRoleView.java
| 1 | 1 | package com.cnlive.strike.xiaojiaspeaker.frame.view; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | +import android.support.v4.content.ContextCompat; | |
| 4 | 5 | import android.support.v7.widget.GridLayoutManager; |
| 5 | 6 | import android.support.v7.widget.LinearLayoutManager; |
| 6 | 7 | import android.view.View; |
| ... | ... | @@ -19,6 +20,11 @@ public class SetFriendsRoleView implements MvpView { |
| 19 | 20 | private SetFriendsRoleFragment fragment; |
| 20 | 21 | private List<RoleInfo> roleInfoList; |
| 21 | 22 | private SetRoleAdapter adapter; |
| 23 | + private String currentSelFamilyId; | |
| 24 | + | |
| 25 | + public void setCurrentSelFamilyId(String currentSelFamilyId) { | |
| 26 | + this.currentSelFamilyId = currentSelFamilyId; | |
| 27 | + } | |
| 22 | 28 | |
| 23 | 29 | public SetFriendsRoleView(SetFriendsRoleFragment fragment) { |
| 24 | 30 | this.fragment = fragment; |
| ... | ... | @@ -29,6 +35,7 @@ public class SetFriendsRoleView implements MvpView { |
| 29 | 35 | } |
| 30 | 36 | |
| 31 | 37 | public void initView(RoleNetBean roleNetBean) { |
| 38 | + nextBtnCanNotClick(); | |
| 32 | 39 | roleInfoList = new ArrayList<>(); |
| 33 | 40 | //整理数据 |
| 34 | 41 | //获取选中的联系人 |
| ... | ... | @@ -56,6 +63,25 @@ public class SetFriendsRoleView implements MvpView { |
| 56 | 63 | adapter = new SetRoleAdapter(getContext(), roleInfoList); |
| 57 | 64 | fragment.binding.rvFriendsRole.setLayoutManager(new LinearLayoutManager(getContext())); |
| 58 | 65 | fragment.binding.rvFriendsRole.setAdapter(adapter); |
| 66 | + //设置点击 | |
| 67 | + adapter.setOnSelectListener(new SetRoleAdapter.OnSelectListener() { | |
| 68 | + @Override | |
| 69 | + public void onSelect(int roleId) { | |
| 70 | + | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Override | |
| 74 | + public void onCancel() { | |
| 75 | + | |
| 76 | + } | |
| 77 | + }); | |
| 78 | + //关闭提示 | |
| 79 | + fragment.binding.llCloseTip.setOnClickListener(new View.OnClickListener() { | |
| 80 | + @Override | |
| 81 | + public void onClick(View v) { | |
| 82 | + fragment.binding.flTipView.setVisibility(View.GONE); | |
| 83 | + } | |
| 84 | + }); | |
| 59 | 85 | } |
| 60 | 86 | |
| 61 | 87 | |
| ... | ... | @@ -101,4 +127,21 @@ public class SetFriendsRoleView implements MvpView { |
| 101 | 127 | } |
| 102 | 128 | fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener); |
| 103 | 129 | } |
| 130 | + | |
| 131 | + /** | |
| 132 | + * 下一步按钮可以点击 | |
| 133 | + */ | |
| 134 | + public void nextBtnCanClick() { | |
| 135 | + fragment.binding.btnNext.setEnabled(true); | |
| 136 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | |
| 137 | + | |
| 138 | + } | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * 下一步按钮可以点击 | |
| 142 | + */ | |
| 143 | + public void nextBtnCanNotClick() { | |
| 144 | + fragment.binding.btnNext.setEnabled(false); | |
| 145 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_gray)); | |
| 146 | + } | |
| 104 | 147 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/model/RoleInfo.java
| ... | ... | @@ -13,6 +13,15 @@ public class RoleInfo { |
| 13 | 13 | private String userName; |
| 14 | 14 | private List<RoleNetBean.RoleListBean> roleList; |
| 15 | 15 | private String selectId; |
| 16 | + private String familyId; | |
| 17 | + | |
| 18 | + public String getFamilyId() { | |
| 19 | + return familyId; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setFamilyId(String familyId) { | |
| 23 | + this.familyId = familyId; | |
| 24 | + } | |
| 16 | 25 | |
| 17 | 26 | public String getSelectId() { |
| 18 | 27 | return selectId; | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/InvitFamilyBean.java
0 → 100644
| 1 | +package com.cnlive.strike.xiaojiaspeaker.netWork.bean; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 邀请家人上传的数据 | |
| 5 | + */ | |
| 6 | +public class InvitFamilyBean { | |
| 7 | + | |
| 8 | + /** | |
| 9 | + * familyId : 1111 | |
| 10 | + * sid : 105102771 | |
| 11 | + * roleId : 1 | |
| 12 | + */ | |
| 13 | + | |
| 14 | + private String familyId; | |
| 15 | + private int sid; | |
| 16 | + private int roleId; | |
| 17 | + | |
| 18 | + public String getFamilyId() { | |
| 19 | + return familyId; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setFamilyId(String familyId) { | |
| 23 | + this.familyId = familyId; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public int getSid() { | |
| 27 | + return sid; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setSid(int sid) { | |
| 31 | + this.sid = sid; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public int getRoleId() { | |
| 35 | + return roleId; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setRoleId(int roleId) { | |
| 39 | + this.roleId = roleId; | |
| 40 | + } | |
| 41 | +} | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/adapter/SetRoleAdapter.java
| ... | ... | @@ -5,6 +5,7 @@ import android.databinding.DataBindingUtil; |
| 5 | 5 | import android.support.annotation.NonNull; |
| 6 | 6 | import android.support.v7.widget.GridLayoutManager; |
| 7 | 7 | import android.support.v7.widget.RecyclerView; |
| 8 | +import android.text.TextUtils; | |
| 8 | 9 | import android.view.LayoutInflater; |
| 9 | 10 | import android.view.View; |
| 10 | 11 | import android.view.ViewGroup; |
| ... | ... | @@ -13,6 +14,7 @@ import com.cnlive.strike.application.GlideApp; |
| 13 | 14 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 14 | 15 | import com.cnlive.strike.xiaojiaspeaker.databinding.ItemListSetRoleBinding; |
| 15 | 16 | import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo; |
| 17 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.InvitFamilyBean; | |
| 16 | 18 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| 17 | 19 | |
| 18 | 20 | import java.util.ArrayList; |
| ... | ... | @@ -30,6 +32,7 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 30 | 32 | private int isShowItemUserInfo = View.VISIBLE; |
| 31 | 33 | private OnSelectListener onSelectListener; |
| 32 | 34 | private OnDialogRoleClickListener onDialogRoleClickListener; |
| 35 | + private String currentSelectFamilyId; | |
| 33 | 36 | |
| 34 | 37 | public void setOnDialogRoleClickListener(OnDialogRoleClickListener onDialogRoleClickListener) { |
| 35 | 38 | this.onDialogRoleClickListener = onDialogRoleClickListener; |
| ... | ... | @@ -43,6 +46,35 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 43 | 46 | this.isShowItemUserInfo = isShowItemUserInfo; |
| 44 | 47 | } |
| 45 | 48 | |
| 49 | + /** | |
| 50 | + * 判断是否所有用户都设置了角色 | |
| 51 | + * | |
| 52 | + * @return | |
| 53 | + */ | |
| 54 | + public boolean isPeopleAllSetRole() { | |
| 55 | + boolean result = true; | |
| 56 | + for (int i = 0; i < roleInfoList.size(); i++) { | |
| 57 | + if (TextUtils.isEmpty(roleInfoList.get(i).getSelectId())) { | |
| 58 | + result = false; | |
| 59 | + break; | |
| 60 | + } | |
| 61 | + } | |
| 62 | + return result; | |
| 63 | + } | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 获取最后设置的结果 | |
| 67 | + */ | |
| 68 | + public String getRoleSetResult() { | |
| 69 | + String result = ""; | |
| 70 | + List<InvitFamilyBean> invitFamilyBeanList = new ArrayList<>(); | |
| 71 | + for (int i = 0; i < roleInfoList.size(); i++) { | |
| 72 | + InvitFamilyBean bean = new InvitFamilyBean(); | |
| 73 | + bean.setFamilyId(roleInfoList.get(i).getUid()); | |
| 74 | + } | |
| 75 | + return result; | |
| 76 | + } | |
| 77 | + | |
| 46 | 78 | public void setGridCount(int count) { |
| 47 | 79 | this.gridCount = count; |
| 48 | 80 | } |
| ... | ... | @@ -72,6 +104,20 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 72 | 104 | } |
| 73 | 105 | } |
| 74 | 106 | |
| 107 | + public SetRoleAdapter(Context context, List<RoleInfo> roleInfoList, String currentSelectFamilyId) { | |
| 108 | + this.context = context; | |
| 109 | + this.roleInfoList = roleInfoList; | |
| 110 | + this.currentSelectFamilyId = currentSelectFamilyId; | |
| 111 | + this.allowSelectMap = new HashMap<>(); | |
| 112 | + initNotAllowRoleId = new ArrayList<>(); | |
| 113 | + for (int i = 0; i < roleInfoList.get(0).getRoleList().size(); i++) { | |
| 114 | + allowSelectMap.put(roleInfoList.get(0).getRoleList().get(i).getId() + "", roleInfoList.get(0).getRoleList().get(i).isAllowUse()); | |
| 115 | + if (!roleInfoList.get(0).getRoleList().get(i).isAllowUse()) { | |
| 116 | + initNotAllowRoleId.add(roleInfoList.get(0).getRoleList().get(i).getId()); | |
| 117 | + } | |
| 118 | + } | |
| 119 | + } | |
| 120 | + | |
| 75 | 121 | @NonNull |
| 76 | 122 | @Override |
| 77 | 123 | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { |
| ... | ... | @@ -117,14 +163,14 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 117 | 163 | adapter.setOnDialogRoleClickListener(new AllRoleDetailAdapter.OnDialogRoleClickListener() { |
| 118 | 164 | @Override |
| 119 | 165 | public void onCancel() { |
| 120 | - if (null!=onDialogRoleClickListener){ | |
| 166 | + if (null != onDialogRoleClickListener) { | |
| 121 | 167 | onDialogRoleClickListener.onCancel(); |
| 122 | 168 | } |
| 123 | 169 | } |
| 124 | 170 | |
| 125 | 171 | @Override |
| 126 | 172 | public void onSelect(RoleNetBean.RoleListBean bean) { |
| 127 | - if (null!=onDialogRoleClickListener){ | |
| 173 | + if (null != onDialogRoleClickListener) { | |
| 128 | 174 | onDialogRoleClickListener.onSelect(bean); |
| 129 | 175 | } |
| 130 | 176 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/SetFriendsRoleFragment.java
| ... | ... | @@ -20,10 +20,11 @@ import com.cnlive.strike.xiaojiaspeaker.frame.view.SetFriendsRoleView; |
| 20 | 20 | public class SetFriendsRoleFragment extends MvpBindingFragment<SetFriendsRoleView, SetFriendsRolePresenter, Object, FragmentSetFriendRoleBinding> { |
| 21 | 21 | private String selectUid; |
| 22 | 22 | |
| 23 | - public static SetFriendsRoleFragment newInstance(String selectUid) { | |
| 23 | + public static SetFriendsRoleFragment newInstance(String selectUid,String currentSelFamilyId) { | |
| 24 | 24 | SetFriendsRoleFragment fragment = new SetFriendsRoleFragment(); |
| 25 | 25 | Bundle bundle = new Bundle(); |
| 26 | 26 | bundle.putString("selectUid", selectUid); |
| 27 | + bundle.putString("currentSelFamilyId", currentSelFamilyId); | |
| 27 | 28 | fragment.setArguments(bundle); |
| 28 | 29 | return fragment; |
| 29 | 30 | } |
| ... | ... | @@ -46,6 +47,8 @@ public class SetFriendsRoleFragment extends MvpBindingFragment<SetFriendsRoleVie |
| 46 | 47 | initTopBar(); |
| 47 | 48 | if (null != getArguments()) { |
| 48 | 49 | selectUid = getArguments().getString("selectUid"); |
| 50 | + String currentSelFamilyId=getArguments().getString("currentSelFamilyId"); | |
| 51 | + | |
| 49 | 52 | getPresenter().getSetRoleList(getActivity(), selectUid, XiaoJIaCommInfo.getFamilyId(getActivity())); |
| 50 | 53 | } else { |
| 51 | 54 | getActivity().finish(); | ... | ... |
module_xiaojiaSoundBox/src/main/res/drawable/selector_btn_gray.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <item android:drawable="@drawable/shape_xiaojia_btn_gray" android:state_pressed="false" /> |
| 4 | - <item android:drawable="@drawable/shape_btn_press" android:state_pressed="true" /> | |
| 4 | + <item android:drawable="@drawable/shape_xiaojia_btn_press" android:state_pressed="true" /> | |
| 5 | 5 | |
| 6 | 6 | </selector> |
| 7 | 7 | \ No newline at end of file | ... | ... |
module_xiaojiaSoundBox/src/main/res/drawable/selector_btn_green.xml renamed to module_xiaojiaSoundBox/src/main/res/drawable/selector_xiaojia_btn_green.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> |
| 3 | 3 | <item android:drawable="@drawable/shape_xiaojia_btn_green" android:state_pressed="false" /> |
| 4 | - <item android:drawable="@drawable/shape_btn_press" android:state_pressed="true" /> | |
| 4 | + <item android:drawable="@drawable/shape_xiaojia_btn_press" android:state_pressed="true" /> | |
| 5 | 5 | |
| 6 | 6 | </selector> |
| 7 | 7 | \ No newline at end of file | ... | ... |
module_xiaojiaSoundBox/src/main/res/drawable/shape_btn_press.xml renamed to module_xiaojiaSoundBox/src/main/res/drawable/shape_xiaojia_btn_press.xml
module_xiaojiaSoundBox/src/main/res/layout/activity_blue_tooth_step1.xml
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | android:layout_centerHorizontal="true" |
| 74 | 74 | android:layout_marginLeft="20dp" |
| 75 | 75 | android:layout_marginRight="20dp" |
| 76 | - android:background="@drawable/selector_btn_green" | |
| 76 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 77 | 77 | android:text="下一步" |
| 78 | 78 | android:textColor="@color/white" |
| 79 | 79 | android:textSize="16sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/activity_blue_tooth_step2.xml
| ... | ... | @@ -87,7 +87,7 @@ |
| 87 | 87 | android:layout_centerHorizontal="true" |
| 88 | 88 | android:layout_marginLeft="20dp" |
| 89 | 89 | android:layout_marginRight="20dp" |
| 90 | - android:background="@drawable/selector_btn_green" | |
| 90 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 91 | 91 | android:text="已听到“进入配网模式”" |
| 92 | 92 | android:textColor="@color/white" |
| 93 | 93 | android:textSize="16sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/activity_conn_bluetooth_success.xml
| ... | ... | @@ -55,7 +55,7 @@ |
| 55 | 55 | android:layout_alignParentBottom="true" |
| 56 | 56 | android:layout_centerHorizontal="true" |
| 57 | 57 | android:layout_gravity="center_horizontal" |
| 58 | - android:background="@drawable/selector_btn_green" | |
| 58 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 59 | 59 | android:text="邀请使用者" |
| 60 | 60 | android:textColor="@color/white" |
| 61 | 61 | android:textSize="16sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/activity_share_friend.xml
| ... | ... | @@ -141,7 +141,7 @@ |
| 141 | 141 | android:layout_height="wrap_content" |
| 142 | 142 | android:layout_marginLeft="5dp" |
| 143 | 143 | android:layout_marginRight="5dp" |
| 144 | - android:text="注册/登录 >" | |
| 144 | + android:text="扫码绑定" | |
| 145 | 145 | android:textColor="@color/color_282828" |
| 146 | 146 | android:textSize="12sp" |
| 147 | 147 | android:textStyle="bold" /> |
| ... | ... | @@ -176,7 +176,7 @@ |
| 176 | 176 | android:layout_alignParentBottom="true" |
| 177 | 177 | android:layout_centerHorizontal="true" |
| 178 | 178 | android:layout_marginBottom="15dp" |
| 179 | - android:background="@drawable/selector_btn_green" | |
| 179 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 180 | 180 | android:paddingLeft="15dp" |
| 181 | 181 | android:paddingTop="5dp" |
| 182 | 182 | android:paddingRight="15dp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_firmware_update.xml
| ... | ... | @@ -85,7 +85,7 @@ |
| 85 | 85 | android:id="@+id/btn_check_update" |
| 86 | 86 | android:layout_width="match_parent" |
| 87 | 87 | android:layout_height="45dp" |
| 88 | - android:background="@drawable/selector_btn_green" | |
| 88 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 89 | 89 | android:gravity="center" |
| 90 | 90 | android:text="检查更新" |
| 91 | 91 | android:textColor="@color/white" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_invit_friend.xml
| ... | ... | @@ -181,7 +181,7 @@ |
| 181 | 181 | android:layout_marginLeft="20dp" |
| 182 | 182 | android:layout_marginTop="30dp" |
| 183 | 183 | android:layout_marginRight="20dp" |
| 184 | - android:background="@drawable/selector_btn_green" | |
| 184 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 185 | 185 | android:text="保存并分享给家人" |
| 186 | 186 | android:textColor="@color/white" |
| 187 | 187 | android:textSize="16sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_search_device.xml
| ... | ... | @@ -67,7 +67,7 @@ |
| 67 | 67 | android:layout_width="90dp" |
| 68 | 68 | android:layout_height="35dp" |
| 69 | 69 | android:layout_marginTop="30dp" |
| 70 | - android:background="@drawable/selector_btn_green" | |
| 70 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 71 | 71 | android:text="@string/btn_retry" |
| 72 | 72 | android:textColor="@color/white" |
| 73 | 73 | android:textSize="16sp" |
| ... | ... | @@ -113,7 +113,7 @@ |
| 113 | 113 | android:layout_width="match_parent" |
| 114 | 114 | android:layout_height="40dp" |
| 115 | 115 | android:layout_margin="20dp" |
| 116 | - android:background="@drawable/selector_btn_green" | |
| 116 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 117 | 117 | android:text="@string/btn_next_step" |
| 118 | 118 | android:textColor="@color/white" |
| 119 | 119 | android:textSize="16sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_select_im_friend.xml
| ... | ... | @@ -91,8 +91,8 @@ |
| 91 | 91 | android:layout_marginLeft="30dp" |
| 92 | 92 | android:layout_marginTop="10dp" |
| 93 | 93 | android:layout_marginRight="30dp" |
| 94 | - android:layout_marginBottom="10dp" | |
| 95 | - android:background="@drawable/selector_btn_green" | |
| 94 | + android:layout_marginBottom="20dp" | |
| 95 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 96 | 96 | android:text="下一步" |
| 97 | 97 | android:textColor="@color/white" |
| 98 | 98 | android:textSize="17sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_select_wifi.xml
| ... | ... | @@ -74,7 +74,7 @@ |
| 74 | 74 | android:layout_width="match_parent" |
| 75 | 75 | android:layout_height="40dp" |
| 76 | 76 | android:layout_margin="20dp" |
| 77 | - android:background="@drawable/selector_btn_green" | |
| 77 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 78 | 78 | android:text="@string/btn_next_step" |
| 79 | 79 | android:textColor="@color/white" |
| 80 | 80 | android:textSize="16sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_set_friend_role.xml
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | android:orientation="vertical"> |
| 23 | 23 | |
| 24 | 24 | <FrameLayout |
| 25 | + android:id="@+id/fl_tip_view" | |
| 25 | 26 | android:layout_width="match_parent" |
| 26 | 27 | android:layout_height="45dp" |
| 27 | 28 | android:background="@color/color_F7B054"> |
| ... | ... | @@ -35,6 +36,7 @@ |
| 35 | 36 | android:textSize="15sp" /> |
| 36 | 37 | |
| 37 | 38 | <LinearLayout |
| 39 | + android:id="@+id/ll_close_tip" | |
| 38 | 40 | android:layout_width="wrap_content" |
| 39 | 41 | android:layout_height="match_parent" |
| 40 | 42 | android:layout_gravity="right" |
| ... | ... | @@ -67,8 +69,8 @@ |
| 67 | 69 | android:layout_marginLeft="30dp" |
| 68 | 70 | android:layout_marginTop="10dp" |
| 69 | 71 | android:layout_marginRight="30dp" |
| 70 | - android:layout_marginBottom="30dp" | |
| 71 | - android:background="@drawable/selector_btn_green" | |
| 72 | + android:layout_marginBottom="20dp" | |
| 73 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 72 | 74 | android:text="一键邀请" |
| 73 | 75 | android:textColor="@color/white" |
| 74 | 76 | android:textSize="17sp" | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_user_manager.xml
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | android:layout_marginLeft="40dp" |
| 74 | 74 | android:layout_marginTop="10dp" |
| 75 | 75 | android:layout_marginRight="40dp" |
| 76 | - android:background="@drawable/selector_btn_green" | |
| 76 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 77 | 77 | android:text="邀请网家家好友" |
| 78 | 78 | android:textColor="@color/white" |
| 79 | 79 | android:textSize="16sp" |
| ... | ... | @@ -89,7 +89,7 @@ |
| 89 | 89 | android:layout_marginTop="20dp" |
| 90 | 90 | android:layout_marginRight="40dp" |
| 91 | 91 | android:layout_marginBottom="30dp" |
| 92 | - android:background="@drawable/selector_btn_green" | |
| 92 | + android:background="@drawable/selector_xiaojia_btn_green" | |
| 93 | 93 | android:text="生成二维码邀请" |
| 94 | 94 | android:textColor="@color/white" |
| 95 | 95 | android:textSize="16sp" | ... | ... |