Commit 8db8e71e019aa26346644e717fdc201dd8c9b9b5

Authored by YangShuai
1 parent e1057e64

1 完成使用者管理界面搭建

Showing 40 changed files with 2125 additions and 214 deletions
module_xiaojiaSoundBox/src/main/AndroidManifest.xml
... ... @@ -17,7 +17,9 @@
17 17 <uses-permission android:name="android.permission.INTERNET" />
18 18  
19 19 <application>
20   - <activity android:name=".ui.activity.DeviceDetailActivity"></activity>
  20 + <activity android:name=".ui.activity.UserManagerActivity"></activity>
  21 + <activity android:name=".ui.activity.ChangeDeviceNameActivity" />
  22 + <activity android:name=".ui.activity.DeviceDetailActivity" />
21 23 <activity android:name=".ui.activity.SetFriendsRoleActivity" />
22 24 <activity android:name=".ui.activity.SelectIMFriendActivity" />
23 25 <activity android:name=".ui.activity.FirmwareUpdateActivity" />
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/UserManagerPresenter.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.frame.presenter;
  2 +
  3 +import android.content.Context;
  4 +import android.util.Log;
  5 +import android.view.View;
  6 +
  7 +import com.cnlive.libs.base.logic.Logic;
  8 +import com.cnlive.libs.base.logic.callback.DataCallback;
  9 +import com.cnlive.libs.base.logic.callback.FailureCallback;
  10 +import com.cnlive.libs.base.logic.callback.SuccessCallback;
  11 +import com.cnlive.strike.xiaojiaspeaker.frame.view.UserManagerView;
  12 +import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia;
  13 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean;
  14 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean;
  15 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo;
  16 +import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest;
  17 +import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil;
  18 +import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
  19 +
  20 +import java.util.HashMap;
  21 +import java.util.Map;
  22 +
  23 +import io.reactivex.disposables.Disposable;
  24 +
  25 +public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> {
  26 +
  27 + private String TAG = "UserManagerPresenter";
  28 +
  29 + public void getFamilyRole(Context context, String sid, String familyId) {
  30 + if (null == getView()) {
  31 + return;
  32 + }
  33 + getView().showLoadingView();
  34 + Map<String, String> map = new HashMap<>();
  35 + map.put("sid", sid);
  36 + map.put("familyId", familyId);
  37 + Logic.create(map)
  38 + .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<FamilyRoleBean>>() {
  39 + @Override
  40 + public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<FamilyRoleBean>> dataCallback) {
  41 + return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getFamilyRole(paramsMap)).subscribe(context, dataCallback);
  42 + }
  43 + }).<SubscriptionBaseInfo<FamilyRoleBean>>event()
  44 + .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<FamilyRoleBean>>() {
  45 + @Override
  46 + public void onSuccess(SubscriptionBaseInfo<FamilyRoleBean> baseInfo) {
  47 + Log.e(TAG, "onSuccess: ");
  48 +
  49 + if (null == getView()) {
  50 + return;
  51 + }
  52 + getView().hideLoadingView();
  53 + getView().initView(baseInfo.getData().getFamilyRoleList());
  54 +
  55 + }
  56 + })
  57 + .setFailureCallback(new FailureCallback() {
  58 + @Override
  59 + public void onFailure(int i, String s) {
  60 + //显示重试
  61 + Log.e(TAG, "onFailure: " + s);
  62 + getView().showRetryView(i, new View.OnClickListener() {
  63 + @Override
  64 + public void onClick(View view) {
  65 + getFamilyRole(context, sid, familyId);
  66 + }
  67 + });
  68 + }
  69 + })
  70 +
  71 + .start();
  72 + }
  73 +
  74 + public void getSetRoleList(Context context, String sids, String familyId, FamilyRoleBean.FamilyRoleListBean bean) {
  75 + if (null == getView()) {
  76 + return;
  77 + }
  78 + QMUITipDialogUtil.loadingDialog(context, "请稍后...", false);
  79 + Map<String, String> map = new HashMap<>();
  80 + map.put("sids", sids);
  81 + map.put("familyId", familyId);
  82 + Logic.create(map)
  83 + .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<RoleNetBean>>() {
  84 + @Override
  85 + public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<RoleNetBean>> dataCallback) {
  86 + return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getSetRoleList(paramsMap)).subscribe(context, dataCallback);
  87 + }
  88 + }).<SubscriptionBaseInfo<RoleNetBean>>event()
  89 + .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<RoleNetBean>>() {
  90 + @Override
  91 + public void onSuccess(SubscriptionBaseInfo<RoleNetBean> baseInfo) {
  92 + Log.e(TAG, "onSuccess: ");
  93 +
  94 + if (null == getView()) {
  95 + return;
  96 + }
  97 + QMUITipDialogUtil.dismessDialog();
  98 + getView().initRoleDialog(baseInfo.getData(), bean);
  99 + }
  100 + })
  101 + .setFailureCallback(new FailureCallback() {
  102 + @Override
  103 + public void onFailure(int i, String s) {
  104 + if (null == getView()) {
  105 + return;
  106 + }
  107 + //显示重试
  108 + QMUITipDialogUtil.dismessDialog();
  109 + QMUITipDialogUtil.failedDialog(context, s, 1);
  110 + }
  111 + })
  112 +
  113 + .start();
  114 + }
  115 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/UserManagerView.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.frame.view;
  2 +
  3 +import android.app.Activity;
  4 +import android.graphics.Color;
  5 +import android.graphics.Typeface;
  6 +import android.support.v7.widget.LinearLayoutManager;
  7 +import android.view.View;
  8 +
  9 +import com.cnlive.strike.xiaojiaspeaker.R;
  10 +import com.cnlive.strike.xiaojiaspeaker.commonInfo.CommInfo;
  11 +import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo;
  12 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean;
  13 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean;
  14 +import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothStep1Activity;
  15 +import com.cnlive.strike.xiaojiaspeaker.ui.activity.SelectIMFriendActivity;
  16 +import com.cnlive.strike.xiaojiaspeaker.ui.adapter.SetRoleAdapter;
  17 +import com.cnlive.strike.xiaojiaspeaker.ui.adapter.UserManagerAdapter;
  18 +import com.cnlive.strike.xiaojiaspeaker.ui.fragment.UserManagerFragment;
  19 +import com.cnlive.strike.xiaojiaspeaker.ui.widget.EditRoleDialog;
  20 +import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog;
  21 +import com.cnlive.strike.xiaojiaspeaker.ui.widget.TipDialog;
  22 +import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenu;
  23 +import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenuInfo;
  24 +import com.cnlive.strike.xiaojiaspeaker.util.GsonUtil;
  25 +import com.cnlive.strike.xiaojiaspeaker.util.utilcode.util.GsonUtils;
  26 +import com.hannesdorfmann.mosby3.mvp.MvpView;
  27 +
  28 +import java.util.ArrayList;
  29 +import java.util.List;
  30 +
  31 +public class UserManagerView implements MvpView {
  32 + private UserManagerFragment fragment;
  33 + private List<FamilyRoleBean.FamilyRoleListBean> familyRoleList;
  34 + private UserManagerAdapter adapter;
  35 + private List<PopMenuInfo> popMenuInfoList = null;
  36 + private PopMenu mPopMenu;
  37 + private List<RoleInfo> roleInfoList;
  38 + private EditRoleDialog editRoleDialog;
  39 + private SelectDialog deleteDialog;
  40 + private String test = "{\n" +
  41 + "\t\"familyRoleList\": [{\n" +
  42 + "\t\t\t\"family_id\": \"fb8f160efc61431f96e8111e0cbfd349\",\n" +
  43 + "\t\t\t\"roleName\": \"爷爷\",\n" +
  44 + "\t\t\t\"id\": 3,\n" +
  45 + "\t\t\t\"userMsg\": {\n" +
  46 + "\t\t\t\t\"image\": \"\",\n" +
  47 + "\t\t\t\t\"nickName\": \"demotest6\",\n" +
  48 + "\t\t\t\t\"userId\": \"123456\"\n" +
  49 + "\t\t\t},\n" +
  50 + "\t\t\t\"sid\": 123456\n" +
  51 + "\t\t},\n" +
  52 + "\t\t{\n" +
  53 + "\t\t\t\"family_id\": \"fb8f160efc61431f96e8111e0cbfd349\",\n" +
  54 + "\t\t\t\"roleName\": \"管理员\",\n" +
  55 + "\t\t\t\"id\": 11,\n" +
  56 + "\t\t\t\"userMsg\": {\n" +
  57 + "\t\t\t\t\"image\": \"http://yweb0.cnliveimg.com/images/headImg/2019/0903/1567494184454_small.jpg\",\n" +
  58 + "\t\t\t\t\"nickName\": \"泡泡龙1\",\n" +
  59 + "\t\t\t\t\"userId\": \"10505015\"\n" +
  60 + "\t\t\t},\n" +
  61 + "\t\t\t\"sid\": 10505015\n" +
  62 + "\t\t},\n" +
  63 + "\t\t{\n" +
  64 + "\t\t\t\"family_id\": \"fb8f160efc61431f96e8111e0cbfd349\",\n" +
  65 + "\t\t\t\"roleName\": \"妈妈\",\n" +
  66 + "\t\t\t\"id\": 2,\n" +
  67 + "\t\t\t\"userMsg\": {\n" +
  68 + "\t\t\t\t\"image\": \"http://yweb0.cnliveimg.com/images/headImg/2019/0927/1569568821902_small.jpg\",\n" +
  69 + "\t\t\t\t\"nickName\": \"徐近程\",\n" +
  70 + "\t\t\t\t\"userId\": \"10510277\"\n" +
  71 + "\t\t\t},\n" +
  72 + "\t\t\t\"sid\": 10510277\n" +
  73 + "\t\t}\n" +
  74 + "\t],\n" +
  75 + "\t\"isMaster\": 0\n" +
  76 + "}";
  77 +
  78 + public UserManagerView(UserManagerFragment fragment) {
  79 + this.fragment = fragment;
  80 + }
  81 +
  82 + public Activity getContext() {
  83 + return fragment == null ? null : fragment.getActivity();
  84 + }
  85 +
  86 + public void initView(List<FamilyRoleBean.FamilyRoleListBean> familyRoleList) {
  87 + this.familyRoleList = familyRoleList;
  88 + FamilyRoleBean bean1 = GsonUtil.GsonToBean(test, FamilyRoleBean.class);
  89 +// if (null != familyRoleList) {
  90 + for (FamilyRoleBean.FamilyRoleListBean bean : bean1.getFamilyRoleList()) {
  91 + if ("管理员".equals(bean.getRoleName())) {
  92 + bean.setType(FamilyRoleBean.FamilyRoleListBean.HOST);
  93 + } else {
  94 + bean.setType(FamilyRoleBean.FamilyRoleListBean.MEMBER);
  95 + }
  96 + }
  97 + for (int i = 0; i < bean1.getFamilyRoleList().size(); i++) {
  98 + if ("管理员".equals(bean1.getFamilyRoleList().get(i).getRoleName())) {
  99 + FamilyRoleBean.FamilyRoleListBean bean = bean1.getFamilyRoleList().get(i);
  100 + bean1.getFamilyRoleList().remove(i);
  101 + bean1.getFamilyRoleList().add(0, bean);
  102 + }
  103 + }
  104 +// }
  105 + adapter = new UserManagerAdapter(getContext(), bean1.getFamilyRoleList(), true);
  106 + fragment.binding.rvUserManagerList.setLayoutManager(new LinearLayoutManager(getContext()));
  107 + fragment.binding.rvUserManagerList.setAdapter(adapter);
  108 + //编辑按钮点击事件
  109 + adapter.setOnEditClickListener(new UserManagerAdapter.OnEditClickListener() {
  110 + @Override
  111 + public void editClick(int position, FamilyRoleBean.FamilyRoleListBean bean) {
  112 + fragment.getPresenter().getSetRoleList(getContext(), bean.getSid() + "", CommInfo.getFamilyId(getContext()), bean);
  113 + }
  114 + });
  115 + //删除按钮点击
  116 + adapter.setOnDeleteClickListener(new UserManagerAdapter.OnDeleteClickListener() {
  117 + @Override
  118 + public void deleteClick(int position, FamilyRoleBean.FamilyRoleListBean bean) {
  119 + if (null == deleteDialog) {
  120 + deleteDialog = new SelectDialog(getContext(), "移除后,该用户将不再具备管理\n音箱的权限,确定移除吗?", "取消", new SelectDialog.DialogInterface() {
  121 + @Override
  122 + public void onClick(SelectDialog dialog) {
  123 + dialog.dismiss();
  124 + }
  125 + }, "确定", new SelectDialog.DialogInterface() {
  126 + @Override
  127 + public void onClick(SelectDialog dialog) {
  128 + dialog.dismiss();
  129 + }
  130 + });
  131 + deleteDialog.setRightBtnColor(R.color.btn_green);
  132 + deleteDialog.setTipTextStyle(Typeface.DEFAULT);
  133 + }
  134 + if (!deleteDialog.isShowing()) {
  135 + deleteDialog.show();
  136 + }
  137 + }
  138 + });
  139 + //邀请网家家好友点击事件
  140 + fragment.binding.btnInvitFriend.setOnClickListener(new View.OnClickListener() {
  141 + @Override
  142 + public void onClick(View view) {
  143 + SelectIMFriendActivity.startActivity(getContext());
  144 + }
  145 + });
  146 + }
  147 +
  148 + public void initRoleDialog(RoleNetBean roleNetBean, FamilyRoleBean.FamilyRoleListBean familyRoleListBean) {
  149 + roleInfoList = new ArrayList<>();
  150 + //整理数据
  151 + //获取选中的联系人
  152 + if (null != roleNetBean.getRoleUserList()) {
  153 + RoleInfo roleInfo = null;
  154 + for (int i = 0; i < roleNetBean.getRoleUserList().size(); i++) {
  155 + roleInfo = new RoleInfo();
  156 + roleInfo.setUid(roleNetBean.getRoleUserList().get(i).getSid());
  157 + roleInfo.setUserName(roleNetBean.getRoleUserList().get(i).getNick());
  158 + roleInfo.setUserIcon(roleNetBean.getRoleUserList().get(i).getFace());
  159 + List<RoleNetBean.RoleListBean> roleList = new ArrayList<>();
  160 + for (int j = 0; j < roleNetBean.getRoleList().size(); j++) {
  161 + RoleNetBean.RoleListBean bean = new RoleNetBean.RoleListBean();
  162 + bean.setAllowUse(roleNetBean.getRoleList().get(j).isAllowUse());
  163 + bean.setId(roleNetBean.getRoleList().get(j).getId());
  164 + bean.setRoleName(roleNetBean.getRoleList().get(j).getRoleName());
  165 + bean.setParentPosition(i);
  166 + roleList.add(bean);
  167 + }
  168 + roleInfo.setRoleList(roleList);
  169 + roleInfoList.add(roleInfo);
  170 + }
  171 + }
  172 + //设置适配器
  173 + if (null == editRoleDialog) {
  174 + editRoleDialog = new EditRoleDialog(getContext());
  175 + }
  176 + editRoleDialog.setData(roleInfoList, familyRoleListBean);
  177 + editRoleDialog.setCancelable(false);
  178 + editRoleDialog.setCanceledOnTouchOutside(false);
  179 + if (!editRoleDialog.isShowing()) {
  180 + editRoleDialog.show();
  181 + }
  182 + editRoleDialog.setOnClickListener(new EditRoleDialog.OnClickListener() {
  183 + @Override
  184 + public void onCancelClick(EditRoleDialog dialog) {
  185 + dialog.dismiss();
  186 + }
  187 +
  188 + @Override
  189 + public void onSaveClick(EditRoleDialog dialog) {
  190 + dialog.dismiss();
  191 + }
  192 + });
  193 + }
  194 +
  195 + /**
  196 + * 显示loading
  197 + */
  198 + public void showLoadingView() {
  199 + if (fragment.binding.emptyLayout == null) {
  200 + return;
  201 + }
  202 + fragment.binding.emptyLayout.show(true);
  203 + }
  204 +
  205 + /**
  206 + * 隐藏loading
  207 + */
  208 + public void hideLoadingView() {
  209 + if (fragment.binding.emptyLayout == null) {
  210 + return;
  211 + }
  212 + fragment.binding.emptyLayout.hide();
  213 + }
  214 +
  215 + /**
  216 + * 显示重试页面
  217 + *
  218 + * @param errorCode
  219 + * @param listener
  220 + */
  221 + public void showRetryView(int errorCode, View.OnClickListener listener) {
  222 + //显示空视图
  223 + fragment.binding.emptyLayout.setVisibility(View.VISIBLE);
  224 +
  225 + if (fragment.binding.emptyLayout == null) return;
  226 + String titleText = "";
  227 + String detailText = "";
  228 + if (errorCode == -3) {
  229 + titleText = getContext().getString(R.string.msg_failed_network_title);
  230 + detailText = getContext().getString(R.string.msg_failed_network_detail);
  231 + } else {
  232 + titleText = getContext().getString(R.string.msg_failed_other_title);
  233 + detailText = getContext().getString(R.string.msg_failed_other_detail);
  234 + }
  235 + fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener);
  236 + }
  237 +
  238 + public void initPopView() {
  239 +// View contentView = LayoutInflater.from(getContext())
  240 +// .inflate(R.layout.activity_all_device, null);
  241 +// BottomSheetDialog dialog = new BottomSheetDialog(getContext());
  242 +// dialog.setContentView(contentView);
  243 +// dialog.setCancelable(false);
  244 +// BottomSheetBehavior sheetBehavior = BottomSheetBehavior.from((View) contentView.getParent());
  245 +// sheetBehavior.setPeekHeight(200);
  246 + //给布局设置透明背景色,让图片突出来
  247 +// bottomSheetDialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet)
  248 +// .setBackgroundColor(getResources().getColor(android.R.color.transparent));
  249 +// dialog.show();
  250 +
  251 + popMenuInfoList = new ArrayList<>();
  252 + PopMenuInfo popMenuInfo = new PopMenuInfo();
  253 + popMenuInfo.setTitle("邀请网家家好友");
  254 + popMenuInfo.setImgDrawable(R.drawable.icon_friend);
  255 + popMenuInfoList.add(popMenuInfo);
  256 + popMenuInfo = new PopMenuInfo();
  257 + popMenuInfo.setTitle("生成二维码邀请");
  258 + popMenuInfo.setImgDrawable(R.drawable.icon_qrcode);
  259 + popMenuInfoList.add(popMenuInfo);
  260 +
  261 + if (null == mPopMenu) {
  262 + mPopMenu = new PopMenu.Builder(fragment.getActivity())
  263 + .addData(popMenuInfoList)
  264 + .setBackgroundColorArray(new int[]{Color.parseColor("#363636"), Color.parseColor("#BF000000"), Color.parseColor("#BF000000")})
  265 + .setLeftAndRightMargin(20)
  266 + .setTopMargin(20)
  267 + .setLineColor(R.color.white_50)
  268 + .setTextColor(R.color.white)
  269 + .setLineVisible(View.GONE)
  270 +// .setArrowHeight(30f)
  271 +// .setArrowHeight(30f)
  272 + .setCancelable(false)
  273 + .setCornerRadius(20f)
  274 + .build();
  275 + }
  276 +
  277 + mPopMenu.setmItemClickListener(new PopMenu.OnItemClickListener() {
  278 + @Override
  279 + public void onClick(int position, PopMenuInfo popMenuInfo) {
  280 + if (position == 1) {
  281 + BlueToothStep1Activity.startActivity(fragment.getActivity());
  282 + }
  283 + }
  284 + });
  285 + }
  286 +
  287 + public void showPop(View view) {
  288 + if (null != getContext() && null != mPopMenu) {
  289 + mPopMenu.show(view);
  290 + }
  291 + }
  292 +
  293 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/ApiServiceXiaoJia.java
... ... @@ -2,6 +2,7 @@ package com.cnlive.strike.xiaojiaspeaker.netWork;
2 2  
3 3  
4 4 import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean;
  5 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean;
5 6 import com.cnlive.strike.xiaojiaspeaker.netWork.bean.NetworkResultBean;
6 7 import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean;
7 8 import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo;
... ... @@ -19,6 +20,7 @@ import retrofit2.http.QueryMap;
19 20 public interface ApiServiceXiaoJia {
20 21 @POST("Daren/sound/getSetRoleList.action")
21 22 Observable<Result<SubscriptionBaseInfo<RoleNetBean>>> getSetRoleList(@QueryMap() Map<String, String> maps);
  23 +
22 24 /**
23 25 * 获取家庭id
24 26 * sid Integer true sid
... ... @@ -41,5 +43,19 @@ public interface ApiServiceXiaoJia {
41 43 */
42 44 @POST("/Daren/sound/getNetworkResult.action")
43 45 Observable<Result<SubscriptionBaseInfo<NetworkResultBean>>> getNetworkResult(@QueryMap() Map<String, String> maps);
  46 +
  47 +
  48 + /**
  49 + * 获取家庭身份列表
  50 + * sid String true sid
  51 + * familyId String true 家庭id
  52 + *
  53 + * @param maps
  54 + * @return
  55 + */
  56 + @POST("/Daren/sound/getFamilyRole.action")
  57 + Observable<Result<SubscriptionBaseInfo<FamilyRoleBean>>> getFamilyRole(@QueryMap() Map<String, String> maps);
  58 +
  59 +
44 60 }
45 61  
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/FamilyRoleBean.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.netWork.bean;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * 家庭身份
  7 + */
  8 +public class FamilyRoleBean {
  9 + public static final int HOST = 1;//主人
  10 + public static final int MEMBER = 0;//成员
  11 + /**
  12 + * familyRoleList : [{"family_id":"fb8f160efc61431f96e8111e0cbfd349","roleName":"爷爷","id":3,"userMsg":{"image":"","nickName":"demotest6","userId":"123456"},"sid":123456},{"family_id":"fb8f160efc61431f96e8111e0cbfd349","roleName":"管理员","id":11,"userMsg":{"image":"http://yweb0.cnliveimg.com/images/headImg/2019/0903/1567494184454_small.jpg","nickName":"泡泡龙1","userId":"10505015"},"sid":10505015},{"family_id":"fb8f160efc61431f96e8111e0cbfd349","roleName":"妈妈","id":2,"userMsg":{"image":"http://yweb0.cnliveimg.com/images/headImg/2019/0927/1569568821902_small.jpg","nickName":"徐近程","userId":"10510277"},"sid":10510277}]
  13 + * isMaster : 0
  14 + */
  15 +
  16 + private int isMaster;
  17 + private List<FamilyRoleListBean> familyRoleList;
  18 +
  19 + public int getIsMaster() {
  20 + return isMaster;
  21 + }
  22 +
  23 + public void setIsMaster(int isMaster) {
  24 + this.isMaster = isMaster;
  25 + }
  26 +
  27 + public List<FamilyRoleListBean> getFamilyRoleList() {
  28 + return familyRoleList;
  29 + }
  30 +
  31 + public void setFamilyRoleList(List<FamilyRoleListBean> familyRoleList) {
  32 + this.familyRoleList = familyRoleList;
  33 + }
  34 +
  35 + public static class FamilyRoleListBean {
  36 + /**
  37 + * family_id : fb8f160efc61431f96e8111e0cbfd349
  38 + * roleName : 爷爷
  39 + * id : 3
  40 + * userMsg : {"image":"","nickName":"demotest6","userId":"123456"}
  41 + * sid : 123456
  42 + */
  43 + public static final int HOST = 0;//主人
  44 + public static final int MEMBER = 1;//成员
  45 +
  46 + private String family_id;
  47 + private String roleName;
  48 + private int id;
  49 + private UserMsgBean userMsg;
  50 + private int sid;
  51 + private int type;
  52 +
  53 + public int getType() {
  54 + return type;
  55 + }
  56 +
  57 + public void setType(int type) {
  58 + this.type = type;
  59 + }
  60 +
  61 + public String getFamily_id() {
  62 + return family_id;
  63 + }
  64 +
  65 + public void setFamily_id(String family_id) {
  66 + this.family_id = family_id;
  67 + }
  68 +
  69 + public String getRoleName() {
  70 + return roleName;
  71 + }
  72 +
  73 + public void setRoleName(String roleName) {
  74 + this.roleName = roleName;
  75 + }
  76 +
  77 + public int getId() {
  78 + return id;
  79 + }
  80 +
  81 + public void setId(int id) {
  82 + this.id = id;
  83 + }
  84 +
  85 + public UserMsgBean getUserMsg() {
  86 + return userMsg;
  87 + }
  88 +
  89 + public void setUserMsg(UserMsgBean userMsg) {
  90 + this.userMsg = userMsg;
  91 + }
  92 +
  93 + public int getSid() {
  94 + return sid;
  95 + }
  96 +
  97 + public void setSid(int sid) {
  98 + this.sid = sid;
  99 + }
  100 +
  101 + public static class UserMsgBean {
  102 + /**
  103 + * image :
  104 + * nickName : demotest6
  105 + * userId : 123456
  106 + */
  107 +
  108 + private String image;
  109 + private String nickName;
  110 + private String userId;
  111 +
  112 + public String getImage() {
  113 + return image;
  114 + }
  115 +
  116 + public void setImage(String image) {
  117 + this.image = image;
  118 + }
  119 +
  120 + public String getNickName() {
  121 + return nickName;
  122 + }
  123 +
  124 + public void setNickName(String nickName) {
  125 + this.nickName = nickName;
  126 + }
  127 +
  128 + public String getUserId() {
  129 + return userId;
  130 + }
  131 +
  132 + public void setUserId(String userId) {
  133 + this.userId = userId;
  134 + }
  135 + }
  136 + }
  137 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/ChangeDeviceNameActivity.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.ui.activity;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Intent;
  5 +import android.databinding.DataBindingUtil;
  6 +import android.support.v4.content.ContextCompat;
  7 +import android.support.v7.app.AppCompatActivity;
  8 +import android.os.Bundle;
  9 +import android.text.Editable;
  10 +import android.text.TextWatcher;
  11 +import android.view.View;
  12 +
  13 +import com.cnlive.libs.base.util.StatusBarUtil;
  14 +import com.cnlive.libs.base.util.StatusBarUtil2;
  15 +import com.cnlive.strike.xiaojiaspeaker.R;
  16 +import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityChangeDeviceNameBinding;
  17 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean;
  18 +
  19 +import java.io.Serializable;
  20 +
  21 +/**
  22 + * 更改音箱名称
  23 + */
  24 +public class ChangeDeviceNameActivity extends AppCompatActivity {
  25 + private ActivityChangeDeviceNameBinding binding;
  26 +
  27 + @Override
  28 + protected void onCreate(Bundle savedInstanceState) {
  29 + super.onCreate(savedInstanceState);
  30 + binding = DataBindingUtil.setContentView(this, R.layout.activity_change_device_name);
  31 + initTopBar();
  32 + initView();
  33 + }
  34 +
  35 + private void initView() {
  36 + //编辑框
  37 + binding.etName.addTextChangedListener(new TextWatcher() {
  38 + @Override
  39 + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
  40 +
  41 + }
  42 +
  43 + @Override
  44 + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
  45 + if (null != charSequence && charSequence.length() > 0) {
  46 + binding.ivClose.setVisibility(View.VISIBLE);
  47 + setBtnClick();
  48 + } else {
  49 + binding.ivClose.setVisibility(View.GONE);
  50 + setBtnCantClick();
  51 + }
  52 + }
  53 +
  54 + @Override
  55 + public void afterTextChanged(Editable editable) {
  56 +
  57 + }
  58 + });
  59 + //清除按钮点击事件
  60 + binding.ivClose.setOnClickListener(new View.OnClickListener() {
  61 + @Override
  62 + public void onClick(View view) {
  63 + binding.etName.setText("");
  64 + }
  65 + });
  66 + }
  67 +
  68 + private void initTopBar() {
  69 + StatusBarUtil.setStatusBarWrite(this);
  70 + StatusBarUtil2.setColor(this, ContextCompat.getColor(this, R.color.white), 0);
  71 + if (null != binding) {
  72 + binding.topbar.setTitle("更改音箱名称");
  73 + //设置返回按钮
  74 + binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() {
  75 + @Override
  76 + public void onClick(View view) {
  77 + finish();
  78 + }
  79 + });
  80 + }
  81 + }
  82 +
  83 + public static void startActivity(Activity activity) {
  84 + Intent intent = new Intent(activity, ChangeDeviceNameActivity.class);
  85 + activity.startActivity(intent);
  86 + }
  87 +
  88 + /**
  89 + * 设置绑定按钮不可点击
  90 + */
  91 + private void setBtnCantClick() {
  92 + if (binding.btnNext.isClickable()) {
  93 + binding.btnNext.setClickable(false);
  94 + binding.btnNext.setBackground(ContextCompat.getDrawable(ChangeDeviceNameActivity.this, R.drawable.shape_btn_press));
  95 + }
  96 + }
  97 +
  98 + /**
  99 + * 设置绑定按钮可点击
  100 + */
  101 + private void setBtnClick() {
  102 + if (!binding.btnNext.isClickable()) {
  103 + binding.btnNext.setClickable(true);
  104 + binding.btnNext.setBackground(ContextCompat.getDrawable(ChangeDeviceNameActivity.this, R.drawable.selector_btn_green));
  105 + }
  106 + }
  107 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/DeviceDetailActivity.java
... ... @@ -42,7 +42,7 @@ public class DeviceDetailActivity extends AppCompatActivity {
42 42 binding.rlUserManager.setOnClickListener(new View.OnClickListener() {
43 43 @Override
44 44 public void onClick(View view) {
45   -
  45 + UserManagerActivity.StartActivity(DeviceDetailActivity.this);
46 46 }
47 47 });
48 48 //设备管理
... ... @@ -56,7 +56,7 @@ public class DeviceDetailActivity extends AppCompatActivity {
56 56 binding.rlDeviceDeclare.setOnClickListener(new View.OnClickListener() {
57 57 @Override
58 58 public void onClick(View view) {
59   -
  59 + DeviceInstructionActivity.startActivity(DeviceDetailActivity.this);
60 60 }
61 61 });
62 62 }
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/DeviceManagerActivity.java
... ... @@ -29,6 +29,38 @@ public class DeviceManagerActivity extends AppCompatActivity {
29 29 binding = DataBindingUtil.setContentView(this, R.layout.activity_device_manager);
30 30 // getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, DeviceManagerFragment.newInstance()).commitAllowingStateLoss();
31 31 initTopBar();
  32 + initView();
  33 + }
  34 +
  35 + private void initView() {
  36 + //音箱名称
  37 + binding.llDeviceName.setOnClickListener(new View.OnClickListener() {
  38 + @Override
  39 + public void onClick(View view) {
  40 + ChangeDeviceNameActivity.startActivity(DeviceManagerActivity.this);
  41 + }
  42 + });
  43 + //wifi设置
  44 + binding.llWifiSetting.setOnClickListener(new View.OnClickListener() {
  45 + @Override
  46 + public void onClick(View view) {
  47 +
  48 + }
  49 + });
  50 + //设备信息
  51 + binding.llDeviceInfo.setOnClickListener(new View.OnClickListener() {
  52 + @Override
  53 + public void onClick(View view) {
  54 +
  55 + }
  56 + });
  57 + //固件升级
  58 + binding.llDeviceUpdate.setOnClickListener(new View.OnClickListener() {
  59 + @Override
  60 + public void onClick(View view) {
  61 + FirmwareUpdateActivity.startActivity(DeviceManagerActivity.this);
  62 + }
  63 + });
32 64 }
33 65  
34 66 private void initTopBar() {
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/SelectIMFriendActivity.java
1 1 package com.cnlive.strike.xiaojiaspeaker.ui.activity;
2 2  
  3 +import android.app.Activity;
  4 +import android.content.Intent;
3 5 import android.support.v7.app.AppCompatActivity;
4 6 import android.os.Bundle;
5 7  
... ... @@ -16,4 +18,9 @@ public class SelectIMFriendActivity extends AppCompatActivity {
16 18 getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, SelectIMFriendFragment.newInstance()).commit();
17 19  
18 20 }
  21 +
  22 + public static void startActivity(Activity activity) {
  23 + Intent intent = new Intent(activity, SelectIMFriendActivity.class);
  24 + activity.startActivity(intent);
  25 + }
19 26 }
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/UserManagerActivity.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.ui.activity;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Intent;
  5 +import android.support.v7.app.AppCompatActivity;
  6 +import android.os.Bundle;
  7 +
  8 +import com.clj.fastble.data.BleDevice;
  9 +import com.cnlive.strike.xiaojiaspeaker.R;
  10 +import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment;
  11 +import com.cnlive.strike.xiaojiaspeaker.ui.fragment.UserManagerFragment;
  12 +
  13 +public class UserManagerActivity extends AppCompatActivity {
  14 +
  15 + @Override
  16 + protected void onCreate(Bundle savedInstanceState) {
  17 + super.onCreate(savedInstanceState);
  18 + setContentView(R.layout.activity_user_manager);
  19 + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, UserManagerFragment.newInstance()).commitAllowingStateLoss();
  20 +
  21 + }
  22 +
  23 + public static void StartActivity(Activity activity) {
  24 + Intent intent = new Intent(activity, UserManagerActivity.class);
  25 + activity.startActivity(intent);
  26 + }
  27 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/adapter/SetRoleAdapter.java
... ... @@ -6,6 +6,7 @@ import android.support.annotation.NonNull;
6 6 import android.support.v7.widget.GridLayoutManager;
7 7 import android.support.v7.widget.RecyclerView;
8 8 import android.view.LayoutInflater;
  9 +import android.view.View;
9 10 import android.view.ViewGroup;
10 11  
11 12 import com.cnlive.strike.application.GlideApp;
... ... @@ -24,6 +25,16 @@ public class SetRoleAdapter extends RecyclerView.Adapter {
24 25 private Map<String, Boolean> allowSelectMap;
25 26 private AllRoleDetailAdapter adapter;
26 27 private List<Integer> initNotAllowRoleId;//服务器初始给的不允许点击的值
  28 + private int gridCount = -1;
  29 + private int isShowItemUserInfo = View.VISIBLE;
  30 +
  31 + public void setIsShowItemUserInfo(int isShowItemUserInfo) {
  32 + this.isShowItemUserInfo = isShowItemUserInfo;
  33 + }
  34 +
  35 + public void setGridCount(int count) {
  36 + this.gridCount = count;
  37 + }
27 38  
28 39 public List<RoleInfo> getRoleInfoList() {
29 40 return roleInfoList;
... ... @@ -63,9 +74,18 @@ public class SetRoleAdapter extends RecyclerView.Adapter {
63 74 ItemListSetRoleBinding binding = ((MyViewHolder) viewHolder).getBinding();
64 75 binding.tvName.setText(roleInfoList.get(position).getUserName());
65 76 GlideApp.with(context).load(roleInfoList.get(position).getUserIcon()).placeholder(R.drawable.touxiang).into(binding.ivIcon);
  77 + if (isShowItemUserInfo==View.VISIBLE){
  78 + binding.llUserInfo.setVisibility(View.VISIBLE);
  79 + }else {
  80 + binding.llUserInfo.setVisibility(View.GONE);
  81 + }
66 82 //设置适配器
67 83 adapter = new AllRoleDetailAdapter(context, roleInfoList.get(position).getRoleList(), this);
68   - binding.rvRoleList.setLayoutManager(new GridLayoutManager(context, 4));
  84 + if (-1 == gridCount) {
  85 + binding.rvRoleList.setLayoutManager(new GridLayoutManager(context, 4));
  86 + }else {
  87 + binding.rvRoleList.setLayoutManager(new GridLayoutManager(context, gridCount));
  88 + }
69 89 binding.rvRoleList.setAdapter(adapter);
70 90 }
71 91  
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/adapter/UserManagerAdapter.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.ui.adapter;
  2 +
  3 +import android.content.Context;
  4 +import android.databinding.DataBindingUtil;
  5 +import android.support.annotation.NonNull;
  6 +import android.support.v7.widget.RecyclerView;
  7 +import android.view.LayoutInflater;
  8 +import android.view.View;
  9 +import android.view.ViewGroup;
  10 +
  11 +import com.cnlive.strike.application.GlideApp;
  12 +import com.cnlive.strike.xiaojiaspeaker.R;
  13 +import com.cnlive.strike.xiaojiaspeaker.databinding.ItemListMenuSoundBoxNameBinding;
  14 +import com.cnlive.strike.xiaojiaspeaker.databinding.ItemListSetRoleBinding;
  15 +import com.cnlive.strike.xiaojiaspeaker.databinding.ItemListUserHostBinding;
  16 +import com.cnlive.strike.xiaojiaspeaker.databinding.ItemListUserMemberBinding;
  17 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean;
  18 +
  19 +import java.util.List;
  20 +
  21 +public class UserManagerAdapter extends RecyclerView.Adapter {
  22 + private Context context;
  23 + private List<FamilyRoleBean.FamilyRoleListBean> familyRoleList;
  24 + private boolean isAdmin;//是否是管理员
  25 + private OnEditClickListener onEditClickListener;
  26 + private OnDeleteClickListener onDeleteClickListener;
  27 +
  28 + public UserManagerAdapter(Context context, List<FamilyRoleBean.FamilyRoleListBean> familyRoleList, boolean isAdmin) {
  29 + this.context = context;
  30 + this.familyRoleList = familyRoleList;
  31 + this.isAdmin = isAdmin;
  32 + }
  33 +
  34 + public void setOnDeleteClickListener(OnDeleteClickListener onDeleteClickListener) {
  35 + this.onDeleteClickListener = onDeleteClickListener;
  36 + }
  37 +
  38 + public void setOnEditClickListener(OnEditClickListener onEditClickListener) {
  39 + this.onEditClickListener = onEditClickListener;
  40 + }
  41 +
  42 + @NonNull
  43 + @Override
  44 + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
  45 + LayoutInflater inflater = LayoutInflater.from(context);
  46 + switch (viewType) {
  47 + case FamilyRoleBean.FamilyRoleListBean.HOST:
  48 + ItemListUserHostBinding hostBinding = DataBindingUtil.inflate(inflater, R.layout.item_list_user_host, viewGroup, false);
  49 + return new UserHostViewHolder(hostBinding);
  50 + case FamilyRoleBean.FamilyRoleListBean.MEMBER:
  51 + ItemListUserMemberBinding memberBinding = DataBindingUtil.inflate(inflater, R.layout.item_list_user_member, viewGroup, false);
  52 + return new UserMemberViewHolder(memberBinding);
  53 + }
  54 + return null;
  55 + }
  56 +
  57 + @Override
  58 + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
  59 + switch (getItemViewType(position)) {
  60 + case FamilyRoleBean.FamilyRoleListBean.HOST:
  61 + ItemListUserHostBinding hostBinding = ((UserHostViewHolder) viewHolder).getBinding();
  62 + hostBinding.tvUserName.setText(familyRoleList.get(position).getUserMsg().getNickName());
  63 + hostBinding.tvUserRole.setText(familyRoleList.get(position).getRoleName());
  64 + //设置头像
  65 + GlideApp.with(context).load(familyRoleList.get(position).getUserMsg().getImage()).placeholder(R.drawable.touxiang).into(hostBinding.ivIcon);
  66 + if (!isAdmin) {
  67 + hostBinding.tvFlag.setVisibility(View.GONE);
  68 + } else {
  69 + hostBinding.tvFlag.setVisibility(View.VISIBLE);
  70 + }
  71 + break;
  72 + case FamilyRoleBean.FamilyRoleListBean.MEMBER:
  73 + ItemListUserMemberBinding memberBinding = ((UserMemberViewHolder) viewHolder).getBinding();
  74 + memberBinding.tvUserName.setText(familyRoleList.get(position).getUserMsg().getNickName());
  75 + memberBinding.tvUserRole.setText(familyRoleList.get(position).getRoleName());
  76 + //设置头像
  77 + GlideApp.with(context).load(familyRoleList.get(position).getUserMsg().getImage()).placeholder(R.drawable.touxiang).into(memberBinding.ivIcon);
  78 + if (position == familyRoleList.size() - 1) {
  79 + memberBinding.viewLine.setVisibility(View.GONE);
  80 + } else {
  81 + memberBinding.viewLine.setVisibility(View.VISIBLE);
  82 + }
  83 + if (!isAdmin) {
  84 + memberBinding.llMenu.setVisibility(View.GONE);
  85 + if (familyRoleList.get(position).getSid() == 10510277) {
  86 + memberBinding.tvFlag.setVisibility(View.VISIBLE);
  87 + } else {
  88 + memberBinding.tvFlag.setVisibility(View.GONE);
  89 + }
  90 + } else {
  91 + memberBinding.llMenu.setVisibility(View.VISIBLE);
  92 + memberBinding.tvFlag.setVisibility(View.GONE);
  93 + }
  94 + break;
  95 + }
  96 + }
  97 +
  98 + @Override
  99 + public int getItemViewType(int position) {
  100 + return familyRoleList.get(position).getType();
  101 + }
  102 +
  103 + @Override
  104 + public int getItemCount() {
  105 + return familyRoleList.size();
  106 + }
  107 +
  108 + /**
  109 + * 管理员
  110 + */
  111 + private class UserHostViewHolder extends RecyclerView.ViewHolder {
  112 +
  113 + public ItemListUserHostBinding getBinding() {
  114 + return binding;
  115 + }
  116 +
  117 + private ItemListUserHostBinding binding;
  118 +
  119 + public UserHostViewHolder(ItemListUserHostBinding binding) {
  120 + super(binding.getRoot());
  121 + this.binding = binding;
  122 + }
  123 + }
  124 +
  125 + /**
  126 + * 成员
  127 + */
  128 + private class UserMemberViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  129 + public ItemListUserMemberBinding getBinding() {
  130 + return binding;
  131 + }
  132 +
  133 + private ItemListUserMemberBinding binding;
  134 +
  135 + public UserMemberViewHolder(ItemListUserMemberBinding binding) {
  136 + super(binding.getRoot());
  137 + this.binding = binding;
  138 + //编辑
  139 + binding.llDelete.setOnClickListener(this);
  140 + //删除
  141 + binding.llEdit.setOnClickListener(this);
  142 + }
  143 +
  144 + @Override
  145 + public void onClick(View view) {
  146 + if (view.getId() == R.id.ll_edit) {
  147 + if (null != onEditClickListener) {
  148 + onEditClickListener.editClick(getAdapterPosition(), familyRoleList.get(getAdapterPosition()));
  149 + }
  150 + } else if (view.getId() == R.id.ll_delete) {
  151 + if (null != onDeleteClickListener) {
  152 + onDeleteClickListener.deleteClick(getAdapterPosition(), familyRoleList.get(getAdapterPosition()));
  153 + }
  154 + }
  155 + }
  156 + }
  157 +
  158 + public interface OnEditClickListener {
  159 + void editClick(int position, FamilyRoleBean.FamilyRoleListBean bean);
  160 + }
  161 +
  162 + public interface OnDeleteClickListener {
  163 + void deleteClick(int position, FamilyRoleBean.FamilyRoleListBean bean);
  164 + }
  165 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/UserManagerFragment.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.ui.fragment;
  2 +
  3 +import android.os.Bundle;
  4 +import android.support.annotation.Nullable;
  5 +import android.support.v4.content.ContextCompat;
  6 +import android.view.View;
  7 +import android.widget.Button;
  8 +
  9 +import com.cnlive.libs.base.frame.fragment.MvpBindingFragment;
  10 +import com.cnlive.libs.base.util.StatusBarUtil;
  11 +import com.cnlive.libs.base.util.StatusBarUtil2;
  12 +import com.cnlive.strike.xiaojiaspeaker.R;
  13 +import com.cnlive.strike.xiaojiaspeaker.commonInfo.CommInfo;
  14 +import com.cnlive.strike.xiaojiaspeaker.databinding.FragmentDeviceManagerBinding;
  15 +import com.cnlive.strike.xiaojiaspeaker.databinding.FragmentUserManagerBinding;
  16 +import com.cnlive.strike.xiaojiaspeaker.frame.presenter.UserManagerPresenter;
  17 +import com.cnlive.strike.xiaojiaspeaker.frame.view.UserManagerView;
  18 +
  19 +/**
  20 + * 使用者管理
  21 + */
  22 +public class UserManagerFragment extends MvpBindingFragment<UserManagerView, UserManagerPresenter, Object, FragmentUserManagerBinding> {
  23 + private Button btn_invit;
  24 +
  25 + public static UserManagerFragment newInstance() {
  26 + UserManagerFragment fragment = new UserManagerFragment();
  27 + return fragment;
  28 + }
  29 +
  30 + @Override
  31 + protected int getLayoutId() {
  32 + return R.layout.fragment_user_manager;
  33 + }
  34 +
  35 + @Override
  36 + public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  37 + super.onActivityCreated(savedInstanceState);
  38 + StatusBarUtil.setStatusBarWrite(getActivity());
  39 + StatusBarUtil2.setColor(getActivity(), ContextCompat.getColor(getActivity(), R.color.white), 0);
  40 + }
  41 +
  42 + @Override
  43 + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  44 + super.onViewCreated(view, savedInstanceState);
  45 + initTopBar();
  46 +// getPresenter().getFamilyRole(getActivity(), "123456", CommInfo.getFamilyId(getActivity()));
  47 + if (null != getMvpView()) {
  48 + getMvpView().initPopView();
  49 + getMvpView().initView(null);
  50 + }
  51 + }
  52 +
  53 + private void initTopBar() {
  54 + if (null != binding) {
  55 + binding.topbar.setTitle("使用者管理").setTextColor(ContextCompat.getColor(getActivity(), R.color.color_282828));
  56 + //设置返回按钮
  57 + binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() {
  58 + @Override
  59 + public void onClick(View view) {
  60 + if (null != getActivity()) {
  61 + getActivity().finish();
  62 + }
  63 + }
  64 + });
  65 + //添加邀请者按钮
  66 + btn_invit = binding.topbar.addRightTextButton("邀请使用者", R.id.rightBtn);
  67 + btn_invit.setTextSize(15);
  68 + btn_invit.setTextColor(ContextCompat.getColor(getContext(),R.color.color_282828));
  69 + btn_invit.setOnClickListener(new View.OnClickListener() {
  70 + @Override
  71 + public void onClick(View view) {
  72 + if (null != getMvpView()) {
  73 + getMvpView().showPop(btn_invit);
  74 + }
  75 + }
  76 + });
  77 + }
  78 + }
  79 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/EditRoleDialog.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.ui.widget;
  2 +
  3 +import android.app.Dialog;
  4 +import android.content.Context;
  5 +import android.os.Bundle;
  6 +import android.support.annotation.NonNull;
  7 +import android.support.v4.content.ContextCompat;
  8 +import android.support.v7.widget.LinearLayoutManager;
  9 +import android.support.v7.widget.RecyclerView;
  10 +import android.view.LayoutInflater;
  11 +import android.view.View;
  12 +import android.view.ViewGroup;
  13 +import android.view.WindowManager;
  14 +import android.widget.Button;
  15 +import android.widget.ImageView;
  16 +import android.widget.LinearLayout;
  17 +import android.widget.TextView;
  18 +
  19 +import com.cnlive.strike.application.GlideApp;
  20 +import com.cnlive.strike.xiaojiaspeaker.R;
  21 +import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo;
  22 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean;
  23 +import com.cnlive.strike.xiaojiaspeaker.ui.adapter.SetRoleAdapter;
  24 +
  25 +import org.w3c.dom.Text;
  26 +
  27 +import java.util.List;
  28 +
  29 +
  30 +/**
  31 + * 任务编辑对话框
  32 + *
  33 + * @author ShinnyYang
  34 + * @date 2019/3/27 14:11
  35 + */
  36 +public class EditRoleDialog extends Dialog {
  37 + private Context context;
  38 + private Button btn_cancel;
  39 + private Button btn_ok;
  40 + private LinearLayout ll_child;
  41 + private RecyclerView rv_role;
  42 + private ImageView iv_icon;
  43 + private TextView tv_user_name;
  44 + private View view;
  45 + // private DialogInterface cancelInterface;
  46 +// private DialogInterface okInterface;
  47 + private LinearLayout.LayoutParams layoutParams;
  48 + private List<RoleInfo> roleInfoList;
  49 + private SetRoleAdapter setRoleAdapter;
  50 + private OnClickListener onClickListener;
  51 +
  52 + public void setOnClickListener(OnClickListener onClickListener) {
  53 + this.onClickListener = onClickListener;
  54 + }
  55 +
  56 + public void setData(List<RoleInfo> roleInfoList, FamilyRoleBean.FamilyRoleListBean bean) {
  57 + setRoleAdapter = new SetRoleAdapter(context, roleInfoList);
  58 + setRoleAdapter.setGridCount(3);
  59 + setRoleAdapter.setIsShowItemUserInfo(View.GONE);
  60 + rv_role.setLayoutManager(new LinearLayoutManager(getContext()));
  61 + rv_role.setAdapter(setRoleAdapter);
  62 + GlideApp.with(context).load(bean.getUserMsg().getImage()).placeholder(R.drawable.touxiang).into(iv_icon);
  63 + tv_user_name.setText(bean.getUserMsg().getNickName());
  64 + }
  65 +
  66 + public EditRoleDialog(@NonNull Context context) {
  67 + super(context, R.style.MyDialog);
  68 + this.context = context;
  69 + view = LayoutInflater.from(context).inflate(R.layout.dialog_edit_role, null);
  70 + initView(view);
  71 + layoutParams = new LinearLayout.LayoutParams((int) (getScreenWidth(context) * 0.8), ViewGroup.LayoutParams.WRAP_CONTENT);
  72 + ll_child.setLayoutParams(layoutParams);
  73 + }
  74 +
  75 +
  76 + public EditRoleDialog(@NonNull Context context, View customview, int themeResId) {
  77 + super(context, themeResId);
  78 + this.context = context;
  79 + }
  80 +
  81 +
  82 + @Override
  83 + protected void onCreate(Bundle savedInstanceState) {
  84 + super.onCreate(savedInstanceState);
  85 + //显示视图
  86 + this.setContentView(view);
  87 + }
  88 +
  89 + private void initView(View rootView) {
  90 + this.btn_cancel = (Button) rootView.findViewById(R.id.btn_cancel);
  91 + this.btn_ok = (Button) rootView.findViewById(R.id.btn_ok);
  92 + this.ll_child = (LinearLayout) rootView.findViewById(R.id.ll_child);
  93 + this.rv_role = (RecyclerView) rootView.findViewById(R.id.rv_role);
  94 + this.iv_icon = (ImageView) rootView.findViewById(R.id.iv_icon);
  95 + this.tv_user_name = (TextView) rootView.findViewById(R.id.tv_user_name);
  96 + btn_cancel.setOnClickListener(new View.OnClickListener() {
  97 + @Override
  98 + public void onClick(View view) {
  99 + if (null!=onClickListener){
  100 + onClickListener.onCancelClick(EditRoleDialog.this);
  101 + }
  102 + }
  103 + });
  104 + btn_ok.setOnClickListener(new View.OnClickListener() {
  105 + @Override
  106 + public void onClick(View view) {
  107 + if (null!=onClickListener){
  108 + onClickListener.onSaveClick(EditRoleDialog.this);
  109 + }
  110 + }
  111 + });
  112 + }
  113 +
  114 + public interface OnClickListener {
  115 + void onCancelClick(EditRoleDialog dialog);
  116 +
  117 + void onSaveClick(EditRoleDialog dialog);
  118 +
  119 + }
  120 +
  121 + /**
  122 + * 获取屏幕宽度
  123 + *
  124 + * @param context
  125 + * @return
  126 + */
  127 + public static int getScreenWidth(Context context) {
  128 + WindowManager wm = (WindowManager) context
  129 + .getSystemService(Context.WINDOW_SERVICE);
  130 + int width = wm.getDefaultDisplay().getWidth();
  131 + return width;
  132 + }
  133 +
  134 + /**
  135 + * 获取屏幕高度
  136 + *
  137 + * @param context
  138 + * @return
  139 + */
  140 + public static int getScreenHeight(Context context) {
  141 + WindowManager wm = (WindowManager) context
  142 + .getSystemService(Context.WINDOW_SERVICE);
  143 + int height = wm.getDefaultDisplay().getHeight();
  144 + return height;
  145 + }
  146 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/SelectDialog.java
... ... @@ -2,6 +2,7 @@ package com.cnlive.strike.xiaojiaspeaker.ui.widget;
2 2  
3 3 import android.app.Dialog;
4 4 import android.content.Context;
  5 +import android.graphics.Typeface;
5 6 import android.os.Bundle;
6 7 import android.support.annotation.NonNull;
7 8 import android.support.v4.content.ContextCompat;
... ... @@ -61,6 +62,9 @@ public class SelectDialog extends Dialog {
61 62 }
62 63 }
63 64  
  65 + public void setTipTextStyle(Typeface typeface){
  66 + tv_dialog_tip.setTypeface(typeface);
  67 + }
64 68 public void setTipMessage(String message) {
65 69 tv_dialog_tip.setText(message);
66 70 }
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/popmenu/PopMenuAdapter.java
... ... @@ -70,6 +70,8 @@ public class PopMenuAdapter extends RecyclerView.Adapter {
70 70 } else {
71 71 binding.viewLine.setVisibility(View.VISIBLE);
72 72 }
  73 + }else {
  74 + binding.viewLine.setVisibility(View.GONE);
73 75 }
74 76 //判断图标是否显示
75 77 if (0 == popMenuInfoList.get(i).getImgDrawable() && TextUtils.isEmpty(popMenuInfoList.get(i).getNetImag())) {
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/util/GsonUtil.java 0 → 100644
  1 +package com.cnlive.strike.xiaojiaspeaker.util;
  2 +
  3 +import com.google.gson.Gson;
  4 +import com.google.gson.JsonArray;
  5 +import com.google.gson.JsonElement;
  6 +import com.google.gson.JsonObject;
  7 +import com.google.gson.JsonParser;
  8 +import com.google.gson.reflect.TypeToken;
  9 +
  10 +import java.util.ArrayList;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * Created by ShinnyYang
  16 + * on 2016/12/19.
  17 + */
  18 +public class GsonUtil {
  19 + private static Gson gson = null;
  20 +
  21 + static {
  22 + if (gson == null) {
  23 + gson = new Gson();
  24 + }
  25 + }
  26 +
  27 + private GsonUtil() {
  28 + }
  29 +
  30 + /**
  31 + * 转成json
  32 + *
  33 + * @param object
  34 + * @return
  35 + */
  36 + public static String GsonString(Object object) {
  37 + String gsonString = null;
  38 + if (gson != null) {
  39 + gsonString = gson.toJson(object);
  40 + }
  41 + return gsonString;
  42 + }
  43 +
  44 + /**
  45 + * 转成bean
  46 + *
  47 + * @param gsonString
  48 + * @param cls
  49 + * @return
  50 + */
  51 + public static <T> T GsonToBean(String gsonString, Class<T> cls) {
  52 + T t = null;
  53 + if (gson != null) {
  54 + t = gson.fromJson(gsonString, cls);
  55 + }
  56 + return t;
  57 + }
  58 +
  59 + /**
  60 + * 转成list
  61 + * 解决泛型问题
  62 + *
  63 + * @param json
  64 + * @param cls
  65 + * @param <T>
  66 + * @return
  67 + */
  68 + public static <T> List<T> jsonToList(String json, Class<T> cls) {
  69 + try {
  70 + Gson gson = new Gson();
  71 + List<T> list = new ArrayList<T>();
  72 + JsonArray array = new JsonParser().parse(json).getAsJsonArray();
  73 + for (final JsonElement elem : array) {
  74 + list.add(gson.fromJson(elem, cls));
  75 + }
  76 + return list;
  77 + } catch (Exception e) {
  78 + return null;
  79 + }
  80 + }
  81 +
  82 +
  83 + /**
  84 + * 转成list中有map的
  85 + *
  86 + * @param gsonString
  87 + * @return
  88 + */
  89 + public static List<Map<String, String>> GsonToListMaps(String gsonString) {
  90 + List<Map<String, String>> list = null;
  91 + if (gson != null) {
  92 + list = gson.fromJson(gsonString,
  93 + new TypeToken<List<Map<String, String>>>() {
  94 + }.getType());
  95 + }
  96 + for (int i = 0; i < list.size(); i++) {
  97 + for (Map.Entry<String, String> entry : list.get(i).entrySet()) {
  98 + if (entry.getValue() == null) {
  99 + entry.setValue("");
  100 + }
  101 + }
  102 + }
  103 + return list;
  104 + }
  105 +
  106 +
  107 + /**
  108 + * 转成map的
  109 + *
  110 + * @param gsonString
  111 + * @return
  112 + */
  113 + public static <T> Map<String, T> GsonToMaps(String gsonString) {
  114 + Map<String, T> map = null;
  115 + if (gson != null) {
  116 + map = gson.fromJson(gsonString, new TypeToken<Map<String, T>>() {
  117 + }.getType());
  118 + }
  119 + return map;
  120 + }
  121 +
  122 + /**
  123 + * 过滤null
  124 + *
  125 + * @param jsonElement
  126 + * @return
  127 + */
  128 + public static String StrConver(JsonElement jsonElement) {
  129 + if (jsonElement == null || jsonElement.isJsonNull() || jsonElement.equals("null")) {
  130 + return "";
  131 + } else {
  132 + return jsonElement.getAsString();
  133 + }
  134 + }
  135 +
  136 + public static int IntConver(JsonElement jsonElement) {
  137 + if (jsonElement.isJsonNull()) {
  138 + return 0;
  139 + } else {
  140 + return jsonElement.getAsInt();
  141 + }
  142 + }
  143 +
  144 + public static JsonObject toJsonObject(String str) {
  145 + return new JsonParser().parse(str).getAsJsonObject();
  146 + }
  147 +
  148 + public static JsonArray toJsonArray(String str) {
  149 + return new JsonParser().parse(str).getAsJsonArray();
  150 + }
  151 +
  152 +}
  153 +
... ...
module_xiaojiaSoundBox/src/main/res/drawable-hdpi/icon_friend.png 0 → 100644

901 Bytes

module_xiaojiaSoundBox/src/main/res/drawable-hdpi/icon_gray_close.png 0 → 100644

1004 Bytes

module_xiaojiaSoundBox/src/main/res/drawable-hdpi/icon_qrcode.png 0 → 100644

554 Bytes

module_xiaojiaSoundBox/src/main/res/drawable-v21/selectable_item_white.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/line">
  3 + <item android:drawable="@color/white"/>
  4 +</ripple>
  5 +
... ...
module_xiaojiaSoundBox/src/main/res/drawable-xhdpi/icon_friend.png 0 → 100644

1.17 KB

module_xiaojiaSoundBox/src/main/res/drawable-xhdpi/icon_gray_close.png 0 → 100644

1.12 KB

module_xiaojiaSoundBox/src/main/res/drawable-xhdpi/icon_qrcode.png 0 → 100644

731 Bytes

module_xiaojiaSoundBox/src/main/res/drawable-xxhdpi/icon_friend.png 0 → 100644

2.21 KB

module_xiaojiaSoundBox/src/main/res/drawable-xxhdpi/icon_gray_close.png 0 → 100644

2 KB

module_xiaojiaSoundBox/src/main/res/drawable-xxhdpi/icon_qrcode.png 0 → 100644

1.16 KB

module_xiaojiaSoundBox/src/main/res/drawable/selectable_item_white.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true" android:state_pressed="true"/>
  4 + <item android:drawable="@drawable/abc_list_selector_disabled_holo_light" android:state_enabled="false" android:state_focused="true"/>
  5 + <item android:drawable="@color/line" android:state_focused="true" android:state_pressed="true"/>
  6 + <item android:drawable="@color/line" android:state_focused="false" android:state_pressed="true"/>
  7 + <item android:drawable="@color/white"/>
  8 +</selector>
  9 +
... ...
module_xiaojiaSoundBox/src/main/res/drawable/selector_checkbox_no_default.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item android:drawable="@drawable/check_press" android:state_checked="true"/>
  4 + <item android:drawable="@drawable/check_normal" android:state_checked="false" />
  5 +
  6 +</selector>
0 7 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/drawable/shape_green_stroke.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <stroke
  4 + android:width="1dp"
  5 + android:color="@color/btn_green" />
  6 + <solid android:color="@color/white" />
  7 + <corners android:radius="20dp" />
  8 +</shape>
0 9 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/activity_change_device_name.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools">
  5 +
  6 + <LinearLayout
  7 + android:layout_width="match_parent"
  8 + android:layout_height="match_parent"
  9 + android:orientation="vertical"
  10 + tools:context=".ui.activity.ChangeDeviceNameActivity">
  11 +
  12 + <com.qmuiteam.qmui.widget.QMUITopBar
  13 + android:id="@+id/topbar"
  14 + android:layout_width="match_parent"
  15 + android:layout_height="?attr/qmui_topbar_height"
  16 + android:background="@color/white" />
  17 +
  18 + <LinearLayout
  19 + android:layout_width="match_parent"
  20 + android:layout_height="50dp"
  21 + android:layout_marginLeft="10dp"
  22 + android:layout_marginTop="20dp"
  23 + android:gravity="center_vertical">
  24 +
  25 + <TextView
  26 + android:layout_width="wrap_content"
  27 + android:layout_height="wrap_content"
  28 + android:text="音箱名称"
  29 + android:textColor="@color/color_282828"
  30 + android:textSize="15sp"
  31 + android:textStyle="bold" />
  32 +
  33 + <EditText
  34 + android:id="@+id/et_name"
  35 + android:layout_width="0dp"
  36 + android:layout_height="match_parent"
  37 + android:layout_marginLeft="10dp"
  38 + android:layout_marginRight="10dp"
  39 + android:layout_weight="1"
  40 + android:background="@null"
  41 + android:maxLength="40"
  42 + android:hint="请输入要修改的名称"
  43 + android:textColor="@color/color_282828"
  44 + android:textSize="14sp" />
  45 +
  46 + <ImageView
  47 + android:id="@+id/iv_close"
  48 + android:layout_width="wrap_content"
  49 + android:layout_height="wrap_content"
  50 + android:layout_marginRight="20dp"
  51 + android:background="@drawable/icon_gray_close"
  52 + android:visibility="invisible" />
  53 + </LinearLayout>
  54 +
  55 + <View
  56 + android:layout_width="match_parent"
  57 + android:layout_height="1dp"
  58 + android:layout_marginLeft="10dp"
  59 + android:layout_marginRight="10dp"
  60 + android:background="@color/line" />
  61 +
  62 + <TextView
  63 + android:layout_width="wrap_content"
  64 + android:layout_height="wrap_content"
  65 + android:layout_marginLeft="10dp"
  66 + android:layout_marginTop="10dp"
  67 + android:text="40个字符以内,支持汉字、字母、数字或下划线"
  68 + android:textColor="@color/color_999999"
  69 + android:textSize="12sp" />
  70 +
  71 + <Button
  72 + android:id="@+id/btn_next"
  73 + android:layout_width="match_parent"
  74 + android:layout_height="40dp"
  75 + android:layout_alignParentBottom="true"
  76 + android:layout_centerHorizontal="true"
  77 + android:layout_marginLeft="30dp"
  78 + android:layout_marginTop="20dp"
  79 + android:layout_marginRight="30dp"
  80 + android:background="@drawable/shape_btn_gray"
  81 + android:clickable="false"
  82 + android:text="保存"
  83 + android:textColor="@color/white"
  84 + android:textSize="16sp"
  85 + android:textStyle="bold" />
  86 + </LinearLayout>
  87 +</layout>
0 88 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/activity_device_manager.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <layout>
3 3  
4   - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4 + <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
5 5 xmlns:app="http://schemas.android.com/apk/res-auto"
6 6 xmlns:tools="http://schemas.android.com/tools"
7 7 android:layout_width="match_parent"
... ... @@ -14,234 +14,261 @@
14 14 android:id="@+id/topbar"
15 15 android:layout_width="match_parent"
16 16 android:layout_height="?attr/qmui_topbar_height" />
17   - <!--音箱名称-->
18   - <LinearLayout
  17 +
  18 + <ScrollView
19 19 android:layout_width="match_parent"
20   - android:layout_height="50dp"
21   - android:layout_marginTop="10dp"
22   - android:layout_marginBottom="10dp"
23   - android:background="@drawable/selectable_item_white"
24   - android:clickable="true">
  20 + android:layout_height="wrap_content"
  21 + android:layout_below="@id/topbar">
25 22  
26 23 <LinearLayout
27   - android:layout_width="wrap_content"
28   - android:layout_height="match_parent"
29   - android:gravity="center|left">
30   -
31   - <TextView
32   - android:id="@+id/tv_menu_title"
33   - android:layout_width="wrap_content"
34   - android:layout_height="wrap_content"
35   - android:layout_centerVertical="true"
36   - android:layout_marginLeft="10dp"
37   - android:layout_marginRight="10dp"
38   - android:maxLines="1"
39   - android:text="音箱名称"
40   - android:textColor="@color/color_282828"
41   - android:textSize="16sp" />
42   - </LinearLayout>
  24 + android:layout_width="match_parent"
  25 + android:layout_height="wrap_content"
  26 + android:orientation="vertical">
  27 + <!--音箱名称-->
  28 + <LinearLayout
  29 + android:id="@+id/ll_device_name"
  30 + android:layout_width="match_parent"
  31 + android:layout_height="50dp"
  32 + android:layout_marginTop="10dp"
  33 + android:layout_marginBottom="10dp"
  34 + android:background="@drawable/selectable_item_white"
  35 + android:clickable="true">
43 36  
44   - <LinearLayout
45   - android:layout_width="0dp"
46   - android:layout_height="match_parent"
47   - android:layout_weight="1"
48   - android:gravity="center|right">
49   -
50   - <TextView
51   - android:id="@+id/tv_menu_detail"
52   - android:layout_width="wrap_content"
53   - android:layout_height="wrap_content"
54   - android:layout_centerVertical="true"
55   - android:layout_marginLeft="10dp"
56   - android:layout_marginRight="10dp"
57   - android:layout_toEndOf="@id/iv_right"
58   - android:layout_toRightOf="@id/tv_menu_title"
59   - android:gravity="center|right"
60   - android:maxLines="1"
61   - android:textColor="@color/color_C3C3C3"
62   - android:textSize="14sp" />
63   -
64   - <ImageView
65   - android:id="@+id/iv_right"
66   - android:layout_width="7dp"
67   - android:layout_height="13dp"
68   - android:layout_marginRight="10dp"
69   - android:background="@drawable/icon_item_right_arrow" />
  37 + <LinearLayout
  38 + android:layout_width="wrap_content"
  39 + android:layout_height="match_parent"
  40 + android:gravity="center|left">
70 41  
71   - </LinearLayout>
  42 + <TextView
  43 + android:id="@+id/tv_menu_title"
  44 + android:layout_width="wrap_content"
  45 + android:layout_height="wrap_content"
  46 + android:layout_centerVertical="true"
  47 + android:layout_marginLeft="10dp"
  48 + android:layout_marginRight="10dp"
  49 + android:maxLines="1"
  50 + android:text="音箱名称"
  51 + android:textColor="@color/color_282828"
  52 + android:textSize="16sp" />
  53 + </LinearLayout>
72 54  
73   - </LinearLayout>
74   - <!-- WIFI设置-->
75   - <LinearLayout
76   - android:layout_width="match_parent"
77   - android:layout_height="50dp"
78   - android:layout_marginTop="10dp"
79   - android:layout_marginBottom="10dp"
80   - android:background="@drawable/selectable_item_white"
81   - android:clickable="true">
  55 + <LinearLayout
  56 + android:layout_width="0dp"
  57 + android:layout_height="match_parent"
  58 + android:layout_weight="1"
  59 + android:gravity="center|right">
82 60  
83   - <LinearLayout
84   - android:layout_width="wrap_content"
85   - android:layout_height="match_parent"
86   - android:gravity="center|left">
87   -
88   - <TextView
89   - android:id="@+id/tv_wifi_title"
90   - android:layout_width="wrap_content"
91   - android:layout_height="wrap_content"
92   - android:layout_centerVertical="true"
93   - android:layout_marginLeft="10dp"
94   - android:layout_marginRight="10dp"
95   - android:maxLines="1"
96   - android:text="WIFI设置"
97   - android:textColor="@color/color_282828"
98   - android:textSize="16sp" />
99   - </LinearLayout>
  61 + <TextView
  62 + android:id="@+id/tv_menu_detail"
  63 + android:layout_width="wrap_content"
  64 + android:layout_height="wrap_content"
  65 + android:layout_centerVertical="true"
  66 + android:layout_marginLeft="10dp"
  67 + android:layout_marginRight="10dp"
  68 + android:layout_toEndOf="@id/iv_right"
  69 + android:layout_toRightOf="@id/tv_menu_title"
  70 + android:gravity="center|right"
  71 + android:maxLines="1"
  72 + android:textColor="@color/color_C3C3C3"
  73 + android:textSize="14sp" />
100 74  
101   - <LinearLayout
102   - android:layout_width="0dp"
103   - android:layout_height="match_parent"
104   - android:layout_weight="1"
105   - android:gravity="center|right">
106   -
107   - <TextView
108   - android:id="@+id/tv_wifi_detail"
109   - android:layout_width="wrap_content"
110   - android:layout_height="wrap_content"
111   - android:layout_centerVertical="true"
112   - android:layout_marginLeft="10dp"
113   - android:layout_marginRight="10dp"
114   - android:layout_toEndOf="@id/iv_right"
115   - android:layout_toRightOf="@id/tv_menu_title"
116   - android:gravity="center|right"
117   - android:maxLines="1"
118   - android:textColor="@color/color_C3C3C3"
119   - android:textSize="14sp" />
120   -
121   - <ImageView
122   - android:layout_width="7dp"
123   - android:layout_height="13dp"
124   - android:layout_marginRight="10dp"
125   - android:background="@drawable/icon_item_right_arrow" />
  75 + <ImageView
  76 + android:id="@+id/iv_right"
  77 + android:layout_width="7dp"
  78 + android:layout_height="13dp"
  79 + android:layout_marginRight="10dp"
  80 + android:background="@drawable/icon_item_right_arrow" />
126 81  
127   - </LinearLayout>
  82 + </LinearLayout>
128 83  
129   - </LinearLayout>
130   - <!-- 设备信息-->
131   - <LinearLayout
132   - android:layout_width="match_parent"
133   - android:layout_height="50dp"
134   - android:layout_marginTop="10dp"
135   - android:layout_marginBottom="10dp"
136   - android:background="@drawable/selectable_item_white"
137   - android:clickable="true">
  84 + </LinearLayout>
  85 + <!-- WIFI设置-->
  86 + <LinearLayout
  87 + android:id="@+id/ll_wifi_setting"
  88 + android:layout_width="match_parent"
  89 + android:layout_height="50dp"
  90 + android:layout_marginTop="10dp"
  91 + android:layout_marginBottom="10dp"
  92 + android:background="@drawable/selectable_item_white"
  93 + android:clickable="true">
138 94  
139   - <LinearLayout
140   - android:layout_width="wrap_content"
141   - android:layout_height="match_parent"
142   - android:gravity="center|left">
143   -
144   - <TextView
145   - android:id="@+id/tv_device_info"
146   - android:layout_width="wrap_content"
147   - android:layout_height="wrap_content"
148   - android:layout_centerVertical="true"
149   - android:layout_marginLeft="10dp"
150   - android:layout_marginRight="10dp"
151   - android:maxLines="1"
152   - android:text="设备信息"
153   - android:textColor="@color/color_282828"
154   - android:textSize="16sp" />
155   - </LinearLayout>
  95 + <LinearLayout
  96 + android:layout_width="wrap_content"
  97 + android:layout_height="match_parent"
  98 + android:gravity="center|left">
156 99  
157   - <LinearLayout
158   - android:layout_width="0dp"
159   - android:layout_height="match_parent"
160   - android:layout_weight="1"
161   - android:gravity="center|right">
162   -
163   - <TextView
164   - android:id="@+id/tv_device_info_detail"
165   - android:layout_width="wrap_content"
166   - android:layout_height="wrap_content"
167   - android:layout_centerVertical="true"
168   - android:layout_marginLeft="10dp"
169   - android:layout_marginRight="10dp"
170   - android:layout_toEndOf="@id/iv_right"
171   - android:layout_toRightOf="@id/tv_menu_title"
172   - android:gravity="center|right"
173   - android:maxLines="1"
174   - android:textColor="@color/color_C3C3C3"
175   - android:textSize="14sp" />
176   -
177   - <ImageView
178   - android:layout_width="7dp"
179   - android:layout_height="13dp"
180   - android:layout_marginRight="10dp"
181   - android:background="@drawable/icon_item_right_arrow" />
  100 + <TextView
  101 + android:id="@+id/tv_wifi_title"
  102 + android:layout_width="wrap_content"
  103 + android:layout_height="wrap_content"
  104 + android:layout_centerVertical="true"
  105 + android:layout_marginLeft="10dp"
  106 + android:layout_marginRight="10dp"
  107 + android:maxLines="1"
  108 + android:text="WIFI设置"
  109 + android:textColor="@color/color_282828"
  110 + android:textSize="16sp" />
  111 + </LinearLayout>
182 112  
183   - </LinearLayout>
  113 + <LinearLayout
  114 + android:layout_width="0dp"
  115 + android:layout_height="match_parent"
  116 + android:layout_weight="1"
  117 + android:gravity="center|right">
184 118  
185   - </LinearLayout>
186   - <!-- 固件升级-->
187   - <LinearLayout
188   - android:layout_width="match_parent"
189   - android:layout_height="50dp"
190   - android:layout_marginTop="10dp"
191   - android:layout_marginBottom="10dp"
192   - android:background="@drawable/selectable_item_white"
193   - android:clickable="true">
  119 + <TextView
  120 + android:id="@+id/tv_wifi_detail"
  121 + android:layout_width="wrap_content"
  122 + android:layout_height="wrap_content"
  123 + android:layout_centerVertical="true"
  124 + android:layout_marginLeft="10dp"
  125 + android:layout_marginRight="10dp"
  126 + android:layout_toEndOf="@id/iv_right"
  127 + android:layout_toRightOf="@id/tv_menu_title"
  128 + android:gravity="center|right"
  129 + android:maxLines="1"
  130 + android:textColor="@color/color_C3C3C3"
  131 + android:textSize="14sp" />
194 132  
195   - <LinearLayout
196   - android:layout_width="wrap_content"
197   - android:layout_height="match_parent"
198   - android:gravity="center|left">
199   -
200   - <TextView
201   - android:id="@+id/tv_device_update"
202   - android:layout_width="wrap_content"
203   - android:layout_height="wrap_content"
204   - android:layout_centerVertical="true"
205   - android:layout_marginLeft="10dp"
206   - android:layout_marginRight="10dp"
207   - android:maxLines="1"
208   - android:text="固件升级"
209   - android:textColor="@color/color_282828"
210   - android:textSize="16sp" />
211   - </LinearLayout>
  133 + <ImageView
  134 + android:layout_width="7dp"
  135 + android:layout_height="13dp"
  136 + android:layout_marginRight="10dp"
  137 + android:background="@drawable/icon_item_right_arrow" />
212 138  
213   - <LinearLayout
214   - android:layout_width="0dp"
215   - android:layout_height="match_parent"
216   - android:layout_weight="1"
217   - android:gravity="center|right">
218   -
219   - <TextView
220   - android:id="@+id/tv_device_update_detail"
221   - android:layout_width="wrap_content"
222   - android:layout_height="wrap_content"
223   - android:layout_centerVertical="true"
224   - android:layout_marginLeft="10dp"
225   - android:layout_marginRight="10dp"
226   - android:layout_toEndOf="@id/iv_right"
227   - android:layout_toRightOf="@id/tv_menu_title"
228   - android:gravity="center|right"
229   - android:maxLines="1"
230   - android:textColor="@color/color_C3C3C3"
231   - android:textSize="14sp" />
232   -
233   - <ImageView
234   - android:layout_width="7dp"
235   - android:layout_height="13dp"
236   - android:layout_marginRight="10dp"
237   - android:background="@drawable/icon_item_right_arrow" />
  139 + </LinearLayout>
  140 +
  141 + </LinearLayout>
  142 + <!-- 设备信息-->
  143 + <LinearLayout
  144 + android:id="@+id/ll_device_info"
  145 + android:layout_width="match_parent"
  146 + android:layout_height="50dp"
  147 + android:layout_marginTop="10dp"
  148 + android:layout_marginBottom="10dp"
  149 + android:background="@drawable/selectable_item_white"
  150 + android:clickable="true">
  151 +
  152 + <LinearLayout
  153 + android:layout_width="wrap_content"
  154 + android:layout_height="match_parent"
  155 + android:gravity="center|left">
  156 +
  157 + <TextView
  158 + android:id="@+id/tv_device_info"
  159 + android:layout_width="wrap_content"
  160 + android:layout_height="wrap_content"
  161 + android:layout_centerVertical="true"
  162 + android:layout_marginLeft="10dp"
  163 + android:layout_marginRight="10dp"
  164 + android:maxLines="1"
  165 + android:text="设备信息"
  166 + android:textColor="@color/color_282828"
  167 + android:textSize="16sp" />
  168 + </LinearLayout>
  169 +
  170 + <LinearLayout
  171 + android:layout_width="0dp"
  172 + android:layout_height="match_parent"
  173 + android:layout_weight="1"
  174 + android:gravity="center|right">
  175 +
  176 + <TextView
  177 + android:id="@+id/tv_device_info_detail"
  178 + android:layout_width="wrap_content"
  179 + android:layout_height="wrap_content"
  180 + android:layout_centerVertical="true"
  181 + android:layout_marginLeft="10dp"
  182 + android:layout_marginRight="10dp"
  183 + android:layout_toEndOf="@id/iv_right"
  184 + android:layout_toRightOf="@id/tv_menu_title"
  185 + android:gravity="center|right"
  186 + android:maxLines="1"
  187 + android:textColor="@color/color_C3C3C3"
  188 + android:textSize="14sp" />
  189 +
  190 + <ImageView
  191 + android:layout_width="7dp"
  192 + android:layout_height="13dp"
  193 + android:layout_marginRight="10dp"
  194 + android:background="@drawable/icon_item_right_arrow" />
  195 +
  196 + </LinearLayout>
238 197  
  198 + </LinearLayout>
  199 + <!-- 固件升级-->
  200 + <LinearLayout
  201 + android:id="@+id/ll_device_update"
  202 + android:layout_width="match_parent"
  203 + android:layout_height="50dp"
  204 + android:layout_marginTop="10dp"
  205 + android:layout_marginBottom="10dp"
  206 + android:background="@drawable/selectable_item_white"
  207 + android:clickable="true">
  208 +
  209 + <LinearLayout
  210 + android:layout_width="wrap_content"
  211 + android:layout_height="match_parent"
  212 + android:gravity="center|left">
  213 +
  214 + <TextView
  215 + android:id="@+id/tv_device_update"
  216 + android:layout_width="wrap_content"
  217 + android:layout_height="wrap_content"
  218 + android:layout_centerVertical="true"
  219 + android:layout_marginLeft="10dp"
  220 + android:layout_marginRight="10dp"
  221 + android:maxLines="1"
  222 + android:text="固件升级"
  223 + android:textColor="@color/color_282828"
  224 + android:textSize="16sp" />
  225 + </LinearLayout>
  226 +
  227 + <LinearLayout
  228 + android:layout_width="0dp"
  229 + android:layout_height="match_parent"
  230 + android:layout_weight="1"
  231 + android:gravity="center|right">
  232 +
  233 + <TextView
  234 + android:id="@+id/tv_device_update_detail"
  235 + android:layout_width="wrap_content"
  236 + android:layout_height="wrap_content"
  237 + android:layout_centerVertical="true"
  238 + android:layout_marginLeft="10dp"
  239 + android:layout_marginRight="10dp"
  240 + android:layout_toEndOf="@id/iv_right"
  241 + android:layout_toRightOf="@id/tv_menu_title"
  242 + android:gravity="center|right"
  243 + android:maxLines="1"
  244 + android:textColor="@color/color_C3C3C3"
  245 + android:textSize="14sp" />
  246 +
  247 + <ImageView
  248 + android:layout_width="7dp"
  249 + android:layout_height="13dp"
  250 + android:layout_marginRight="10dp"
  251 + android:background="@drawable/icon_item_right_arrow" />
  252 +
  253 + </LinearLayout>
  254 +
  255 + </LinearLayout>
239 256 </LinearLayout>
  257 + </ScrollView>
240 258  
241   - </LinearLayout>
  259 + <TextView
  260 + android:layout_width="match_parent"
  261 + android:layout_height="60dp"
  262 + android:layout_alignParentBottom="true"
  263 + android:background="@drawable/selectable_item_white"
  264 + android:clickable="true"
  265 + android:gravity="center"
  266 + android:text="删除设备"
  267 + android:textColor="@color/color_EB3D3F"
  268 + android:textSize="15sp" />
242 269 <!-- <RelativeLayout-->
243 270 <!-- android:id="@+id/fragment_container"-->
244 271 <!-- android:layout_width="match_parent"-->
245 272 <!-- android:layout_height="match_parent"></RelativeLayout>-->
246   - </LinearLayout>
  273 + </RelativeLayout>
247 274 </layout>
248 275 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/activity_user_manager.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context=".ui.activity.SearchDeviceActivity">
  8 +
  9 +
  10 + <RelativeLayout
  11 + android:id="@+id/fragment_container"
  12 + android:layout_width="match_parent"
  13 + android:layout_height="match_parent"></RelativeLayout>
  14 +</RelativeLayout>
0 15 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/dialog_edit_role.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:gravity="center_horizontal">
  6 +
  7 +
  8 + <LinearLayout
  9 + android:id="@+id/ll_child"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:background="@drawable/free_dialog_bg"
  13 + android:orientation="vertical"
  14 + android:paddingTop="10dp">
  15 +
  16 + <TextView
  17 + android:id="@+id/tv_dialog_tip"
  18 + android:layout_width="wrap_content"
  19 + android:layout_height="wrap_content"
  20 + android:layout_gravity="center"
  21 + android:layout_marginTop="15dp"
  22 + android:gravity="center"
  23 + android:text="编辑角色"
  24 + android:textColor="@color/black"
  25 + android:textSize="20sp" />
  26 +
  27 +
  28 + <View
  29 + android:layout_width="match_parent"
  30 + android:layout_height="1dp"
  31 + android:layout_marginLeft="10dp"
  32 + android:layout_marginTop="15dp"
  33 + android:layout_marginRight="10dp"
  34 + android:background="@color/line" />
  35 +
  36 + <LinearLayout
  37 + android:layout_width="match_parent"
  38 + android:layout_height="60dp"
  39 + android:gravity="center">
  40 +
  41 + <ImageView
  42 + android:id="@+id/iv_icon"
  43 + android:layout_width="40dp"
  44 + android:layout_height="40dp" />
  45 +
  46 + <TextView
  47 + android:id="@+id/tv_user_name"
  48 + android:layout_width="wrap_content"
  49 + android:layout_height="wrap_content"
  50 + android:layout_marginLeft="10dp"
  51 + android:text="用户昵称"
  52 + android:textColor="@color/color_282828"
  53 + android:textSize="17sp" />
  54 + </LinearLayout>
  55 +
  56 + <android.support.v7.widget.RecyclerView
  57 + android:id="@+id/rv_role"
  58 + android:layout_width="match_parent"
  59 + android:layout_height="wrap_content"
  60 + android:minHeight="50dp"
  61 + android:paddingLeft="10dp" />
  62 +
  63 + <View
  64 + android:layout_width="match_parent"
  65 + android:layout_height="1dp"
  66 + android:layout_marginLeft="10dp"
  67 + android:layout_marginRight="10dp"
  68 + android:background="@color/line" />
  69 +
  70 + <LinearLayout
  71 + android:layout_width="match_parent"
  72 + android:layout_height="40dp"
  73 + android:orientation="horizontal">
  74 +
  75 +
  76 + <LinearLayout
  77 + android:layout_width="0dp"
  78 + android:layout_height="match_parent"
  79 + android:layout_gravity="center"
  80 + android:layout_weight="1"
  81 + android:gravity="center">
  82 +
  83 + <Button
  84 + android:id="@+id/btn_cancel"
  85 + android:layout_width="match_parent"
  86 + android:layout_height="match_parent"
  87 + android:layout_gravity="center"
  88 + android:background="@drawable/selector_dialog_btn_left"
  89 + android:text="取消"
  90 + android:textColor="@color/color_282828"
  91 + android:textSize="17sp" />
  92 + </LinearLayout>
  93 +
  94 + <View
  95 + android:layout_width="1dp"
  96 + android:layout_height="match_parent"
  97 + android:background="@color/line" />
  98 +
  99 + <LinearLayout
  100 + android:layout_width="0dp"
  101 + android:layout_height="match_parent"
  102 + android:layout_gravity="center"
  103 + android:layout_weight="1"
  104 + android:gravity="center">
  105 +
  106 + <Button
  107 + android:id="@+id/btn_ok"
  108 + android:layout_width="match_parent"
  109 + android:layout_height="match_parent"
  110 + android:layout_gravity="center"
  111 + android:background="@drawable/selector_dialog_btn_right"
  112 + android:text="保存"
  113 + android:textColor="@color/btn_green"
  114 + android:textSize="17sp" />
  115 + </LinearLayout>
  116 +
  117 + </LinearLayout>
  118 + </LinearLayout>
  119 +</LinearLayout>
... ...
module_xiaojiaSoundBox/src/main/res/layout/fragment_user_manager.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout>
  3 +
  4 + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:orientation="vertical">
  8 +
  9 + <com.qmuiteam.qmui.widget.QMUITopBar
  10 + android:id="@+id/topbar"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="?attr/qmui_topbar_height" />
  13 +
  14 + <FrameLayout
  15 + android:layout_width="match_parent"
  16 + android:layout_height="45dp"
  17 + android:background="@color/color_F7B054">
  18 +
  19 + <TextView
  20 + android:layout_width="300dp"
  21 + android:layout_height="wrap_content"
  22 + android:layout_gravity="center"
  23 + android:text="使用者可以共同管理音箱,最多支持10个人管理"
  24 + android:textColor="@color/white"
  25 + android:textSize="14sp" />
  26 +
  27 + <LinearLayout
  28 + android:layout_width="wrap_content"
  29 + android:layout_height="match_parent"
  30 + android:layout_gravity="right"
  31 + android:clickable="true"
  32 + android:gravity="center"
  33 + android:paddingRight="10dp">
  34 +
  35 + <ImageView
  36 + android:layout_width="25dp"
  37 + android:layout_height="25dp"
  38 + android:background="@drawable/icon_set_role_close" />
  39 + </LinearLayout>
  40 + </FrameLayout>
  41 +
  42 + <FrameLayout
  43 + android:layout_width="match_parent"
  44 + android:layout_height="match_parent">
  45 +
  46 + <LinearLayout
  47 + android:layout_width="match_parent"
  48 + android:layout_height="match_parent"
  49 + android:orientation="vertical">
  50 +
  51 + <android.support.v7.widget.RecyclerView
  52 + android:id="@+id/rv_user_manager_list"
  53 + android:layout_width="match_parent"
  54 + android:layout_height="0dp"
  55 + android:layout_weight="1" />
  56 +
  57 + <LinearLayout
  58 + android:layout_width="match_parent"
  59 + android:layout_height="wrap_content"
  60 + android:gravity="center"
  61 + android:orientation="vertical">
  62 +
  63 + <Button
  64 + android:id="@+id/btn_invit_friend"
  65 + android:layout_width="match_parent"
  66 + android:layout_height="40dp"
  67 + android:layout_alignParentBottom="true"
  68 + android:layout_centerHorizontal="true"
  69 + android:layout_marginLeft="40dp"
  70 + android:layout_marginTop="10dp"
  71 + android:layout_marginRight="40dp"
  72 + android:background="@drawable/selector_btn_green"
  73 + android:text="邀请网家家好友"
  74 + android:textColor="@color/white"
  75 + android:textSize="16sp"
  76 + android:textStyle="bold" />
  77 +
  78 + <Button
  79 + android:id="@+id/btn_qrcode"
  80 + android:layout_width="match_parent"
  81 + android:layout_height="40dp"
  82 + android:layout_alignParentBottom="true"
  83 + android:layout_centerHorizontal="true"
  84 + android:layout_marginLeft="40dp"
  85 + android:layout_marginTop="20dp"
  86 + android:layout_marginRight="40dp"
  87 + android:layout_marginBottom="30dp"
  88 + android:background="@drawable/selector_btn_green"
  89 + android:text="生成二维码邀请"
  90 + android:textColor="@color/white"
  91 + android:textSize="16sp"
  92 + android:textStyle="bold" />
  93 + </LinearLayout>
  94 + </LinearLayout>
  95 +
  96 +
  97 + <com.cnlive.strike.ui.widget.UIEmptyView
  98 + android:id="@+id/empty_layout"
  99 + android:layout_width="match_parent"
  100 + android:layout_height="match_parent"
  101 + android:background="@color/color_fff"
  102 + android:visibility="gone" />
  103 + </FrameLayout>
  104 + </LinearLayout>
  105 +</layout>
0 106 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/item_list_set_role.xml
... ... @@ -16,6 +16,7 @@
16 16 android:orientation="vertical">
17 17  
18 18 <LinearLayout
  19 + android:id="@+id/ll_user_info"
19 20 android:layout_width="match_parent"
20 21 android:layout_height="60dp"
21 22 android:gravity="center_vertical">
... ...
module_xiaojiaSoundBox/src/main/res/layout/item_list_user_host.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout>
  3 +
  4 + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="60dp"
  7 + android:layout_marginBottom="10dp"
  8 + android:background="@color/white"
  9 + android:gravity="center_vertical">
  10 +
  11 + <ImageView
  12 + android:id="@+id/iv_icon"
  13 + android:layout_width="40dp"
  14 + android:layout_height="40dp"
  15 + android:layout_marginLeft="10dp" />
  16 +
  17 + <LinearLayout
  18 + android:layout_width="0dp"
  19 + android:layout_height="match_parent"
  20 + android:layout_marginLeft="10dp"
  21 + android:layout_weight="1"
  22 + android:gravity="center_vertical"
  23 + android:orientation="vertical">
  24 +
  25 + <LinearLayout
  26 + android:layout_width="match_parent"
  27 + android:layout_height="wrap_content"
  28 + android:gravity="center_vertical">
  29 +
  30 + <TextView
  31 + android:id="@+id/tv_user_name"
  32 + android:layout_width="wrap_content"
  33 + android:layout_height="wrap_content"
  34 + android:ellipsize="end"
  35 + android:maxLength="6"
  36 + android:text="用户名称"
  37 + android:textColor="@color/color_282828"
  38 + android:textSize="16sp"
  39 + android:textStyle="bold" />
  40 +
  41 + <TextView
  42 + android:id="@+id/tv_user_role"
  43 + android:layout_width="wrap_content"
  44 + android:layout_height="wrap_content"
  45 + android:layout_marginLeft="10dp"
  46 + android:background="@drawable/shape_green_stroke"
  47 + android:ellipsize="end"
  48 + android:maxLength="6"
  49 + android:paddingLeft="5dp"
  50 + android:paddingRight="5dp"
  51 + android:text="管理员"
  52 + android:textColor="@color/btn_green"
  53 + android:textSize="11sp" />
  54 + </LinearLayout>
  55 +
  56 + <TextView
  57 + android:id="@+id/tv_user_phone"
  58 + android:layout_width="wrap_content"
  59 + android:layout_height="wrap_content"
  60 + android:layout_marginTop="5dp"
  61 + android:ellipsize="end"
  62 + android:text="用户手机号"
  63 + android:textColor="@color/color_999999"
  64 + android:textSize="12sp" />
  65 +
  66 + </LinearLayout>
  67 +
  68 + <TextView
  69 + android:id="@+id/tv_flag"
  70 + android:layout_width="wrap_content"
  71 + android:layout_height="wrap_content"
  72 + android:layout_marginRight="10dp"
  73 + android:ellipsize="end"
  74 + android:maxLength="6"
  75 + android:text="我"
  76 + android:textColor="@color/color_282828"
  77 + android:textSize="17sp" />
  78 + </LinearLayout>
  79 +</layout>
0 80 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/item_list_user_member.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layout xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <LinearLayout
  5 + android:layout_width="match_parent"
  6 + android:layout_height="wrap_content"
  7 + android:orientation="vertical">
  8 +
  9 + <LinearLayout
  10 + android:layout_width="match_parent"
  11 + android:layout_height="60dp"
  12 + android:background="@color/white"
  13 + android:gravity="center_vertical">
  14 +
  15 + <ImageView
  16 + android:id="@+id/iv_icon"
  17 + android:layout_width="40dp"
  18 + android:layout_height="40dp"
  19 + android:layout_marginLeft="10dp" />
  20 +
  21 + <LinearLayout
  22 + android:layout_width="0dp"
  23 + android:layout_height="match_parent"
  24 + android:layout_marginLeft="10dp"
  25 + android:layout_weight="1"
  26 + android:gravity="center_vertical"
  27 + android:orientation="vertical">
  28 +
  29 + <LinearLayout
  30 + android:layout_width="match_parent"
  31 + android:layout_height="wrap_content"
  32 + android:gravity="center_vertical">
  33 +
  34 + <TextView
  35 + android:id="@+id/tv_user_name"
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:ellipsize="end"
  39 + android:maxLength="6"
  40 + android:text="用户名称"
  41 + android:textColor="@color/color_282828"
  42 + android:textSize="16sp"
  43 + android:textStyle="bold" />
  44 +
  45 + <TextView
  46 + android:id="@+id/tv_user_role"
  47 + android:layout_width="wrap_content"
  48 + android:layout_height="wrap_content"
  49 + android:layout_marginLeft="10dp"
  50 + android:background="@drawable/shape_green_stroke"
  51 + android:ellipsize="end"
  52 + android:maxLength="6"
  53 + android:paddingLeft="5dp"
  54 + android:paddingRight="5dp"
  55 + android:text="管理员"
  56 + android:textColor="@color/btn_green"
  57 + android:textSize="11sp" />
  58 + </LinearLayout>
  59 +
  60 + <TextView
  61 + android:id="@+id/tv_user_phone"
  62 + android:layout_width="wrap_content"
  63 + android:layout_height="wrap_content"
  64 + android:layout_marginTop="5dp"
  65 + android:ellipsize="end"
  66 + android:text="用户手机号"
  67 + android:textColor="@color/color_999999"
  68 + android:textSize="12sp" />
  69 +
  70 + </LinearLayout>
  71 +
  72 + <FrameLayout
  73 + android:layout_width="wrap_content"
  74 + android:layout_height="match_parent">
  75 +
  76 + <LinearLayout
  77 + android:id="@+id/ll_menu"
  78 + android:layout_width="wrap_content"
  79 + android:layout_height="match_parent"
  80 + android:gravity="center_vertical">
  81 +
  82 +
  83 + <LinearLayout
  84 + android:layout_width="wrap_content"
  85 + android:layout_height="match_parent">
  86 +
  87 + <LinearLayout
  88 + android:id="@+id/ll_edit"
  89 + android:layout_width="wrap_content"
  90 + android:layout_height="match_parent"
  91 + android:gravity="center_vertical">
  92 +
  93 + <TextView
  94 + android:layout_width="wrap_content"
  95 + android:layout_height="wrap_content"
  96 + android:layout_marginLeft="10dp"
  97 + android:layout_marginRight="10dp"
  98 + android:ellipsize="end"
  99 + android:maxLength="6"
  100 + android:text="编辑"
  101 + android:textColor="@color/color_282828"
  102 + android:textSize="15sp" />
  103 + </LinearLayout>
  104 +
  105 + <LinearLayout
  106 + android:id="@+id/ll_delete"
  107 + android:layout_width="wrap_content"
  108 + android:layout_height="match_parent"
  109 + android:gravity="center_vertical">
  110 +
  111 + <TextView
  112 + android:layout_width="wrap_content"
  113 + android:layout_height="wrap_content"
  114 + android:layout_marginLeft="10dp"
  115 + android:layout_marginRight="10dp"
  116 + android:ellipsize="end"
  117 + android:maxLength="6"
  118 + android:text="移除"
  119 + android:textColor="@color/qmui_config_color_red"
  120 + android:textSize="15sp" />
  121 + </LinearLayout>
  122 + </LinearLayout>
  123 + </LinearLayout>
  124 +
  125 + <TextView
  126 + android:id="@+id/tv_flag"
  127 + android:layout_width="wrap_content"
  128 + android:layout_height="wrap_content"
  129 + android:layout_gravity="center_vertical|right"
  130 + android:layout_marginRight="10dp"
  131 + android:ellipsize="end"
  132 + android:maxLength="6"
  133 + android:text="我"
  134 + android:textColor="@color/color_282828"
  135 + android:textSize="17sp"
  136 + android:visibility="gone" />
  137 + </FrameLayout>
  138 + </LinearLayout>
  139 +
  140 + <View
  141 + android:id="@+id/view_line"
  142 + android:layout_width="match_parent"
  143 + android:layout_height="1dp"
  144 + android:background="@color/line" />
  145 + </LinearLayout>
  146 +</layout>
0 147 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/list_item_wifi1.xml
... ... @@ -6,7 +6,7 @@
6 6 android:id="@+id/rl_root"
7 7 android:layout_width="match_parent"
8 8 android:layout_height="60dp"
9   - android:background="@drawable/ripple_bg"
  9 + android:background="@drawable/selectable_item_white"
10 10 android:clickable="true"
11 11 android:focusable="true"
12 12 android:minHeight="50dp"
... ...
module_xiaojiaSoundBox/src/main/res/values/styles.xml
... ... @@ -13,7 +13,7 @@
13 13 <style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
14 14 <item name="android:button">@null</item>
15 15 <item name="android:maxHeight">21dp</item>
16   - <item name="android:background">@drawable/selector_checkbox</item>
  16 + <item name="android:background">@drawable/selector_checkbox_no_default</item>
17 17 </style>
18 18 <!-- switch-->
19 19 <style name="SwitchButtonMD" tools:ignore="ResourceName">
... ...