Commit e1057e6433a28cb28ee5389db92acbc572454048

Authored by YangShuai
1 parent 0fb2d134

1 完成设备管理

Showing 22 changed files with 643 additions and 32 deletions
app/src/main/java/com/cnlive/strike/xiaojiaspeaker/MainActivity.java
... ... @@ -27,13 +27,13 @@ public class MainActivity extends AppCompatActivity {
27 27 // startActivity(new Intent(MainActivity.this, BluetoothConnActivity.class));
28 28 // startActivity(new Intent(MainActivity.this, BlueToothStep1Activity.class));
29 29 // startActivity(new Intent(MainActivity.this, ConnBluetoothSuccessActivity.class));
30   -// startActivity(new Intent(MainActivity.this, AllDeviceActivity.class));
  30 + startActivity(new Intent(MainActivity.this, AllDeviceActivity.class));
31 31 // startActivity(new Intent(MainActivity.this, DeviceInstructionActivity.class));
32 32 // startActivity(new Intent(MainActivity.this, DeviceManagerActivity.class));
33 33 // startActivity(new Intent(MainActivity.this, FirmwareUpdateActivity.class));
34 34 // startActivity(new Intent(MainActivity.this, SelectWifiActivity.class));
35 35 // startActivity(new Intent(MainActivity.this, ToolBarTestActivity.class));
36   - startActivity(new Intent(MainActivity.this, SelectIMFriendActivity.class));
  36 +// startActivity(new Intent(MainActivity.this, SelectIMFriendActivity.class));
37 37 finish();
38 38 }
39 39  
... ...
module_xiaojiaSoundBox/src/main/AndroidManifest.xml
... ... @@ -17,7 +17,8 @@
17 17 <uses-permission android:name="android.permission.INTERNET" />
18 18  
19 19 <application>
20   - <activity android:name=".ui.activity.SetFriendsRoleActivity"></activity>
  20 + <activity android:name=".ui.activity.DeviceDetailActivity"></activity>
  21 + <activity android:name=".ui.activity.SetFriendsRoleActivity" />
21 22 <activity android:name=".ui.activity.SelectIMFriendActivity" />
22 23 <activity android:name=".ui.activity.FirmwareUpdateActivity" />
23 24 <activity android:name=".ui.activity.DeviceManagerActivity" />
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/AllDeviceFragmentPresenter.java
... ... @@ -16,6 +16,7 @@ import com.cnlive.strike.xiaojiaspeaker.netWork.bean.NetworkResultBean;
16 16 import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo;
17 17 import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest;
18 18 import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil;
  19 +import com.cnlive.strike.xiaojiaspeaker.util.utilcode.util.GsonUtils;
19 20 import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
20 21  
21 22 import java.util.HashMap;
... ... @@ -48,6 +49,7 @@ public class AllDeviceFragmentPresenter extends MvpBasePresenter&lt;AllDeviceFragme
48 49 if (null == getView()) {
49 50 return;
50 51 }
  52 + GsonUtils.toJson(baseInfo);
51 53 getView().hideLoadingView();
52 54 getView().initAllDeviceList(baseInfo.getData());
53 55 }
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/SetFriendsRolePresenter.java
... ... @@ -29,6 +29,7 @@ public class SetFriendsRolePresenter extends MvpBasePresenter&lt;SetFriendsRoleView
29 29 if (null == getView()) {
30 30 return;
31 31 }
  32 + getView().showLoadingView();
32 33 Map<String, String> map = new HashMap<>();
33 34 map.put("sids", sids);
34 35 map.put("familyId", familyId);
... ... @@ -47,6 +48,7 @@ public class SetFriendsRolePresenter extends MvpBasePresenter&lt;SetFriendsRoleView
47 48 if (null == getView()) {
48 49 return;
49 50 }
  51 + getView().hideLoadingView();
50 52 getView().initView(baseInfo.getData());
51 53  
52 54 }
... ... @@ -55,7 +57,13 @@ public class SetFriendsRolePresenter extends MvpBasePresenter&lt;SetFriendsRoleView
55 57 @Override
56 58 public void onFailure(int i, String s) {
57 59 //显示重试
58   - Log.e(TAG, "onFailure: "+s);
  60 + Log.e(TAG, "onFailure: " + s);
  61 + getView().showRetryView(i, new View.OnClickListener() {
  62 + @Override
  63 + public void onClick(View view) {
  64 + getSetRoleList(context, sids, familyId);
  65 + }
  66 + });
59 67 }
60 68 })
61 69  
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/AllDeviceFragmentView.java
... ... @@ -14,6 +14,7 @@ import com.cnlive.strike.xiaojiaspeaker.commonInfo.CommInfo;
14 14 import com.cnlive.strike.xiaojiaspeaker.model.AllDeviceInfo;
15 15 import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean;
16 16 import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothStep1Activity;
  17 +import com.cnlive.strike.xiaojiaspeaker.ui.activity.DeviceDetailActivity;
17 18 import com.cnlive.strike.xiaojiaspeaker.ui.activity.DeviceManagerActivity;
18 19 import com.cnlive.strike.xiaojiaspeaker.ui.adapter.AllDeviceAdapter;
19 20 import com.cnlive.strike.xiaojiaspeaker.ui.fragment.AllDeviceFragment;
... ... @@ -81,7 +82,7 @@ public class AllDeviceFragmentView implements MvpView {
81 82 adapter.setOnItemClickListener(new AllDeviceAdapter.OnItemClickListener() {
82 83 @Override
83 84 public void onItemClick(int position, FamilyListBean.UsersBeanX.DeviceListBean AllDeviceInfo) {
84   - DeviceManagerActivity.startActivity(fragment.getActivity());
  85 + DeviceDetailActivity.startActivity(fragment.getActivity(),AllDeviceInfo);
85 86 }
86 87 });
87 88 }
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SetFriendsRoleView.java
... ... @@ -3,6 +3,7 @@ package com.cnlive.strike.xiaojiaspeaker.frame.view;
3 3 import android.app.Activity;
4 4 import android.support.v7.widget.GridLayoutManager;
5 5 import android.support.v7.widget.LinearLayoutManager;
  6 +import android.view.View;
6 7  
7 8 import com.cnlive.strike.xiaojiaspeaker.R;
8 9 import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo;
... ... @@ -56,4 +57,48 @@ public class SetFriendsRoleView implements MvpView {
56 57 fragment.binding.rvFriendsRole.setLayoutManager(new LinearLayoutManager(getContext()));
57 58 fragment.binding.rvFriendsRole.setAdapter(adapter);
58 59 }
  60 +
  61 +
  62 + /**
  63 + * 显示loading
  64 + */
  65 + public void showLoadingView() {
  66 + if (fragment.binding.emptyLayout == null) {
  67 + return;
  68 + }
  69 + fragment.binding.emptyLayout.show(true);
  70 + }
  71 +
  72 + /**
  73 + * 隐藏loading
  74 + */
  75 + public void hideLoadingView() {
  76 + if (fragment.binding.emptyLayout == null) {
  77 + return;
  78 + }
  79 + fragment.binding.emptyLayout.hide();
  80 + }
  81 +
  82 + /**
  83 + * 显示重试页面
  84 + *
  85 + * @param errorCode
  86 + * @param listener
  87 + */
  88 + public void showRetryView(int errorCode, View.OnClickListener listener) {
  89 + //显示空视图
  90 + fragment.binding.emptyLayout.setVisibility(View.VISIBLE);
  91 +
  92 + if (fragment.binding.emptyLayout == null) return;
  93 + String titleText = "";
  94 + String detailText = "";
  95 + if (errorCode == -3) {
  96 + titleText = getContext().getString(R.string.msg_failed_network_title);
  97 + detailText = getContext().getString(R.string.msg_failed_network_detail);
  98 + } else {
  99 + titleText = getContext().getString(R.string.msg_failed_other_title);
  100 + detailText = getContext().getString(R.string.msg_failed_other_detail);
  101 + }
  102 + fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener);
  103 + }
59 104 }
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/FamilyListBean.java
1 1 package com.cnlive.strike.xiaojiaspeaker.netWork.bean;
2 2  
  3 +import java.io.Serializable;
3 4 import java.util.List;
4 5  
5 6 /**
6 7 * 家庭id
7 8 */
8   -public class FamilyListBean {
  9 +public class FamilyListBean implements Serializable {
9 10 public static final int THE_HOST = 0;//主人
10 11 public static final int THE_MEMBER = 1;//成员
11 12  
... ... @@ -34,7 +35,7 @@ public class FamilyListBean {
34 35 this.users = users;
35 36 }
36 37  
37   - public static class UsersBeanX {
  38 + public static class UsersBeanX implements Serializable {
38 39 /**
39 40 * id : bfafb2af39d8488896727505bddf6e79
40 41 * phone : 13585544805
... ... @@ -119,7 +120,7 @@ public class FamilyListBean {
119 120 this.deviceList = deviceList;
120 121 }
121 122  
122   - public static class DeviceListBean {
  123 + public static class DeviceListBean implements Serializable {
123 124 /**
124 125 * detail : {"insurance":-1,"users":[{"inrange":false,"manager":true,"headimg":"","name":"135****4805","userid":"12:3f2e8e64833ebee51a49a0d0000616d2"}],"phone":"","appId":"zI3YjQ4MGFiMmM2N","hall":0,"rvnotify":0,"is4GOn":false,"isChildLockOn":false,"isEarLightOn":false,"moment":{"maxid":0},"timbre":"NANNAN","device_type":"storybox","index_config":"app.homepage.0","net":"4G","hasAlarm":false,"online":false,"lock_status":0,"name":"布丁","battery":100,"autodefense":false,"power":false,"growplan":{},"custom":{"netType":[],"nickName":"布丁","devLogo":""},"fangchenmi":[],"power_supply":false,"chatlevel":0,"simFlow":0,"pcode":"","mtdetect":1,"wifissid":"","guard_times":[{"start":"09:00","end":"17:00"}],"sound":{"notifyvoice":"","nodisturb":false},"briefCode":"","volume":75,"ipcdetect":false,"msginfo":{"maxid":0},"tips":"点击完善宝宝信息","devices":[],"isdefense":false,"nightmode":{"state":"1","timerang":[{"start":"22:00","end":"07:00"}]},"mcid":"400011F000000002","face_track":{"user_push":"1","face_track":"2"},"playinfo":{}}
125 126 * phone :
... ... @@ -314,7 +315,7 @@ public class FamilyListBean {
314 315 this.mcid = mcid;
315 316 }
316 317  
317   - public static class DetailBean {
  318 + public static class DetailBean implements Serializable {
318 319 /**
319 320 * insurance : -1
320 321 * users : [{"inrange":false,"manager":true,"headimg":"","name":"135****4805","userid":"12:3f2e8e64833ebee51a49a0d0000616d2"}]
... ... @@ -749,13 +750,13 @@ public class FamilyListBean {
749 750 this.devices = devices;
750 751 }
751 752  
752   - public static class MomentBean {
  753 + public static class MomentBean implements Serializable {
753 754 }
754 755  
755   - public static class GrowplanBean {
  756 + public static class GrowplanBean implements Serializable {
756 757 }
757 758  
758   - public static class CustomBean {
  759 + public static class CustomBean implements Serializable {
759 760 /**
760 761 * netType : []
761 762 * nickName : 布丁
... ... @@ -791,7 +792,7 @@ public class FamilyListBean {
791 792 }
792 793 }
793 794  
794   - public static class SoundBean {
  795 + public static class SoundBean implements Serializable {
795 796 /**
796 797 * notifyvoice :
797 798 * nodisturb : false
... ... @@ -817,7 +818,7 @@ public class FamilyListBean {
817 818 }
818 819 }
819 820  
820   - public static class MsginfoBean {
  821 + public static class MsginfoBean implements Serializable {
821 822 /**
822 823 * maxid : 0
823 824 */
... ... @@ -833,7 +834,7 @@ public class FamilyListBean {
833 834 }
834 835 }
835 836  
836   - public static class NightmodeBean {
  837 + public static class NightmodeBean implements Serializable {
837 838 /**
838 839 * state : 1
839 840 * timerang : [{"start":"22:00","end":"07:00"}]
... ... @@ -858,7 +859,7 @@ public class FamilyListBean {
858 859 this.timerang = timerang;
859 860 }
860 861  
861   - public static class TimerangBean {
  862 + public static class TimerangBean implements Serializable {
862 863 /**
863 864 * start : 22:00
864 865 * end : 07:00
... ... @@ -885,13 +886,13 @@ public class FamilyListBean {
885 886 }
886 887 }
887 888  
888   - public static class FaceTrackBean {
  889 + public static class FaceTrackBean implements Serializable {
889 890 }
890 891  
891   - public static class PlayinfoBean {
  892 + public static class PlayinfoBean implements Serializable {
892 893 }
893 894  
894   - public static class UsersBean {
  895 + public static class UsersBean implements Serializable {
895 896 /**
896 897 * inrange : false
897 898 * manager : true
... ... @@ -947,7 +948,7 @@ public class FamilyListBean {
947 948 }
948 949 }
949 950  
950   - public static class GuardTimesBean {
  951 + public static class GuardTimesBean implements Serializable {
951 952 /**
952 953 * start : 09:00
953 954 * end : 17:00
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/DeviceDetailActivity.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.view.View;
  10 +
  11 +import com.cnlive.libs.base.util.StatusBarUtil;
  12 +import com.cnlive.libs.base.util.StatusBarUtil2;
  13 +import com.cnlive.strike.xiaojiaspeaker.R;
  14 +import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityDeviceDetailBinding;
  15 +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean;
  16 +
  17 +import java.io.Serializable;
  18 +
  19 +/**
  20 + * 设备详情
  21 + */
  22 +public class DeviceDetailActivity extends AppCompatActivity {
  23 + private ActivityDeviceDetailBinding binding;
  24 + private FamilyListBean.UsersBeanX.DeviceListBean allDeviceInfo;
  25 +
  26 + @Override
  27 + protected void onCreate(Bundle savedInstanceState) {
  28 + super.onCreate(savedInstanceState);
  29 + binding = DataBindingUtil.setContentView(this, R.layout.activity_device_detail);
  30 + if (null != getIntent().getExtras()) {
  31 + allDeviceInfo = (FamilyListBean.UsersBeanX.DeviceListBean) getIntent().getExtras().getSerializable("allDeviceInfo");
  32 + if (null != allDeviceInfo) {
  33 + initTopBar(allDeviceInfo.getName());
  34 + }
  35 + }
  36 + initView();
  37 +
  38 + }
  39 +
  40 + private void initView() {
  41 + //使用者管理
  42 + binding.rlUserManager.setOnClickListener(new View.OnClickListener() {
  43 + @Override
  44 + public void onClick(View view) {
  45 +
  46 + }
  47 + });
  48 + //设备管理
  49 + binding.rlDeviceManager.setOnClickListener(new View.OnClickListener() {
  50 + @Override
  51 + public void onClick(View view) {
  52 + DeviceManagerActivity.startActivity(DeviceDetailActivity.this);
  53 + }
  54 + });
  55 + //设备说明
  56 + binding.rlDeviceDeclare.setOnClickListener(new View.OnClickListener() {
  57 + @Override
  58 + public void onClick(View view) {
  59 +
  60 + }
  61 + });
  62 + }
  63 +
  64 + private void initTopBar(String deviceName) {
  65 + StatusBarUtil.setStatusBarWrite(this);
  66 + StatusBarUtil2.setColor(this, ContextCompat.getColor(this, R.color.white), 0);
  67 + if (null != binding) {
  68 + binding.topbar.setTitle(deviceName);
  69 + //设置返回按钮
  70 + binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() {
  71 + @Override
  72 + public void onClick(View view) {
  73 + finish();
  74 + }
  75 + });
  76 + }
  77 + }
  78 +
  79 + public static void startActivity(Activity activity, FamilyListBean.UsersBeanX.DeviceListBean allDeviceInfo) {
  80 + Intent intent = new Intent(activity, DeviceDetailActivity.class);
  81 + intent.putExtra("allDeviceInfo", (Serializable) allDeviceInfo);
  82 + activity.startActivity(intent);
  83 + }
  84 +}
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/DeviceManagerActivity.java
... ... @@ -3,9 +3,13 @@ package com.cnlive.strike.xiaojiaspeaker.ui.activity;
3 3 import android.app.Activity;
4 4 import android.content.Intent;
5 5 import android.databinding.DataBindingUtil;
  6 +import android.support.v4.content.ContextCompat;
6 7 import android.support.v7.app.AppCompatActivity;
7 8 import android.os.Bundle;
  9 +import android.view.View;
8 10  
  11 +import com.cnlive.libs.base.util.StatusBarUtil;
  12 +import com.cnlive.libs.base.util.StatusBarUtil2;
9 13 import com.cnlive.strike.xiaojiaspeaker.R;
10 14 import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityDeviceManagerBinding;
11 15 import com.cnlive.strike.xiaojiaspeaker.ui.fragment.DeviceManagerFragment;
... ... @@ -17,13 +21,29 @@ import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment;
17 21 * @author ys
18 22 */
19 23 public class DeviceManagerActivity extends AppCompatActivity {
  24 + private ActivityDeviceManagerBinding binding;
20 25  
21 26 @Override
22 27 protected void onCreate(Bundle savedInstanceState) {
23 28 super.onCreate(savedInstanceState);
24   - setContentView(R.layout.activity_device_manager);
25   - getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, DeviceManagerFragment.newInstance()).commitAllowingStateLoss();
  29 + binding = DataBindingUtil.setContentView(this, R.layout.activity_device_manager);
  30 +// getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, DeviceManagerFragment.newInstance()).commitAllowingStateLoss();
  31 + initTopBar();
  32 + }
26 33  
  34 + private void initTopBar() {
  35 + StatusBarUtil.setStatusBarWrite(this);
  36 + StatusBarUtil2.setColor(this, ContextCompat.getColor(this, R.color.white), 0);
  37 + if (null != binding) {
  38 + binding.topbar.setTitle("设备管理");
  39 + //设置返回按钮
  40 + binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() {
  41 + @Override
  42 + public void onClick(View view) {
  43 + finish();
  44 + }
  45 + });
  46 + }
27 47 }
28 48  
29 49 public static void startActivity(Activity activity) {
... ...
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/adapter/AllDeviceAdapter.java
... ... @@ -68,9 +68,9 @@ public class AllDeviceAdapter extends RecyclerView.Adapter {
68 68 binding.tvDeviceName.setText(allDeviceInfos.get(i).getName());
69 69 //判断设备是否在线
70 70 if (allDeviceInfos.get(i).isOnline()) {
71   - binding.tvDeviceState.setText("已启用");
  71 + binding.tvDeviceState.setText("在线");
72 72 } else {
73   - binding.tvDeviceState.setText("未启用");
  73 + binding.tvDeviceState.setText("掉线");
74 74 }
75 75 }
76 76  
... ...
module_xiaojiaSoundBox/src/main/res/drawable-hdpi/icon_device_declare.png 0 → 100644

1.91 KB

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

2.06 KB

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

2.08 KB

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

2.1 KB

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

2.01 KB

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

2.38 KB

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

4.17 KB

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

4.18 KB

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

4.74 KB

module_xiaojiaSoundBox/src/main/res/layout/activity_device_detail.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 +
  5 + <LinearLayout
  6 + android:layout_width="match_parent"
  7 + android:layout_height="match_parent"
  8 + android:background="@color/color_F2F2F2"
  9 + android:orientation="vertical">
  10 +
  11 + <com.qmuiteam.qmui.widget.QMUITopBar
  12 + android:id="@+id/topbar"
  13 + android:layout_width="match_parent"
  14 + android:layout_height="?attr/qmui_topbar_height" />
  15 + <!--远程控制-->
  16 + <LinearLayout
  17 + android:layout_width="match_parent"
  18 + android:layout_height="90dp"
  19 + android:layout_margin="10dp"
  20 + android:background="@drawable/shape_10_radius_white_bg"
  21 + android:clickable="true"
  22 + android:orientation="vertical">
  23 +
  24 + <LinearLayout
  25 + android:layout_width="match_parent"
  26 + android:layout_height="wrap_content"
  27 + android:layout_marginTop="20dp"
  28 + android:gravity="center_vertical">
  29 +
  30 + <TextView
  31 + android:id="@+id/tv_menu_title"
  32 + android:layout_width="0dp"
  33 + android:layout_height="wrap_content"
  34 + android:layout_marginLeft="10dp"
  35 + android:layout_marginRight="10dp"
  36 + android:layout_weight="1"
  37 + android:maxLines="1"
  38 + android:text="远程控制"
  39 + android:textColor="@color/color_282828"
  40 + android:textSize="16sp" />
  41 +
  42 + <com.cnlive.strike.xiaojiaspeaker.ui.widget.switchbutton.SwitchButton
  43 + android:id="@+id/sb_switch"
  44 + android:layout_width="wrap_content"
  45 + android:layout_height="wrap_content"
  46 + android:layout_gravity="right"
  47 + android:layout_marginRight="10dp"
  48 + app:kswBackDrawable="@drawable/miui_back_drawable"
  49 + app:kswThumbDrawable="@drawable/miui_thumb_drawable"
  50 + app:kswThumbHeight="20dp"
  51 + app:kswThumbRangeRatio="2.1"
  52 + app:kswThumbWidth="20dp" />
  53 + </LinearLayout>
  54 +
  55 + <TextView
  56 + android:id="@+id/tv_menu_detail"
  57 + android:layout_width="wrap_content"
  58 + android:layout_height="wrap_content"
  59 + android:layout_centerVertical="true"
  60 + android:layout_marginLeft="10dp"
  61 + android:layout_marginTop="10dp"
  62 + android:layout_marginRight="10dp"
  63 + android:layout_marginBottom="20dp"
  64 + android:layout_toEndOf="@id/iv_right"
  65 + android:layout_toRightOf="@id/tv_menu_title"
  66 + android:gravity="center|right"
  67 + android:maxLines="1"
  68 + android:text="手机可远程控制音箱播放的内容,但仅限听见中国"
  69 + android:textColor="@color/color_C3C3C3"
  70 + android:textSize="14sp" />
  71 +
  72 + </LinearLayout>
  73 + <!-- -->
  74 + <LinearLayout
  75 + android:layout_width="match_parent"
  76 + android:layout_height="wrap_content"
  77 + android:layout_margin="10dp"
  78 + android:background="@drawable/shape_10_radius_white_bg"
  79 + android:orientation="vertical">
  80 + <!--使用者管理-->
  81 + <LinearLayout
  82 + android:layout_width="match_parent"
  83 + android:layout_height="wrap_content"
  84 + android:orientation="vertical">
  85 +
  86 + <RelativeLayout
  87 + android:id="@+id/rl_user_manager"
  88 + android:layout_width="match_parent"
  89 + android:layout_height="60dp"
  90 + android:clickable="true">
  91 +
  92 + <ImageView
  93 + android:id="@+id/iv_user_manager"
  94 + android:layout_width="29dp"
  95 + android:layout_height="29dp"
  96 + android:layout_centerVertical="true"
  97 + android:layout_marginLeft="10dp"
  98 + android:background="@drawable/icon_user_manager" />
  99 +
  100 + <TextView
  101 + android:layout_width="wrap_content"
  102 + android:layout_height="wrap_content"
  103 + android:layout_centerVertical="true"
  104 + android:layout_marginLeft="10dp"
  105 + android:layout_toRightOf="@id/iv_user_manager"
  106 + android:text="使用者管理"
  107 + android:textColor="@color/color_282828" />
  108 +
  109 + <ImageView
  110 + android:layout_width="7dp"
  111 + android:layout_height="13dp"
  112 + android:layout_alignParentRight="true"
  113 + android:layout_centerVertical="true"
  114 + android:layout_marginRight="10dp"
  115 + android:background="@drawable/icon_item_right_arrow" />
  116 + </RelativeLayout>
  117 +
  118 + <View
  119 + android:layout_width="match_parent"
  120 + android:layout_height="1dp"
  121 + android:layout_marginLeft="10dp"
  122 + android:layout_marginRight="10dp"
  123 + android:background="@color/line" />
  124 + </LinearLayout>
  125 +
  126 +
  127 + <!--设备管理-->
  128 + <RelativeLayout
  129 + android:id="@+id/rl_device_manager"
  130 + android:layout_width="match_parent"
  131 + android:layout_height="60dp"
  132 + android:clickable="true">
  133 +
  134 + <ImageView
  135 + android:id="@+id/iv_device_manager"
  136 + android:layout_width="21dp"
  137 + android:layout_height="21dp"
  138 + android:layout_centerVertical="true"
  139 + android:layout_marginLeft="13dp"
  140 + android:background="@drawable/icon_device_manager" />
  141 +
  142 + <TextView
  143 + android:layout_width="wrap_content"
  144 + android:layout_height="wrap_content"
  145 + android:layout_centerVertical="true"
  146 + android:layout_marginLeft="15dp"
  147 + android:layout_toRightOf="@id/iv_device_manager"
  148 + android:text="设备管理"
  149 + android:textColor="@color/color_282828" />
  150 +
  151 + <View
  152 + android:layout_width="9dp"
  153 + android:layout_height="9dp"
  154 + android:layout_centerVertical="true"
  155 + android:layout_marginRight="10dp"
  156 + android:layout_toLeftOf="@id/iv_device_manager_continue"
  157 + android:background="@drawable/shape_red_circle" />
  158 +
  159 + <ImageView
  160 + android:id="@+id/iv_device_manager_continue"
  161 + android:layout_width="wrap_content"
  162 + android:layout_height="wrap_content"
  163 + android:layout_alignParentRight="true"
  164 + android:layout_centerVertical="true"
  165 + android:layout_marginRight="10dp"
  166 + android:background="@drawable/icon_item_right_arrow" />
  167 + </RelativeLayout>
  168 +
  169 + <View
  170 + android:layout_width="match_parent"
  171 + android:layout_height="1dp"
  172 + android:layout_marginLeft="10dp"
  173 + android:layout_marginRight="10dp"
  174 + android:background="@color/line" />
  175 + <!--设备说明-->
  176 + <RelativeLayout
  177 + android:id="@+id/rl_device_declare"
  178 + android:layout_width="match_parent"
  179 + android:layout_height="60dp"
  180 + android:clickable="true">
  181 +
  182 + <ImageView
  183 + android:id="@+id/iv_device_declare"
  184 + android:layout_width="23dp"
  185 + android:layout_height="23dp"
  186 + android:layout_centerVertical="true"
  187 + android:layout_marginLeft="13dp"
  188 + android:background="@drawable/icon_device_declare" />
  189 +
  190 + <TextView
  191 + android:layout_width="wrap_content"
  192 + android:layout_height="wrap_content"
  193 + android:layout_centerVertical="true"
  194 + android:layout_marginLeft="12dp"
  195 + android:layout_toRightOf="@id/iv_device_declare"
  196 + android:text="设备说明"
  197 + android:textColor="@color/color_282828" />
  198 +
  199 + <ImageView
  200 + android:layout_width="7dp"
  201 + android:layout_height="13dp"
  202 + android:layout_alignParentRight="true"
  203 + android:layout_centerVertical="true"
  204 + android:layout_marginRight="10dp"
  205 + android:background="@drawable/icon_item_right_arrow" />
  206 + </RelativeLayout>
  207 + <!-- -->
  208 + </LinearLayout>
  209 + </LinearLayout>
  210 +</layout>
0 211 \ 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   - <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4 + <LinearLayout 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"
8 8 android:layout_height="match_parent"
  9 + android:background="@color/color_F2F2F2"
  10 + android:orientation="vertical"
9 11 tools:context=".ui.activity.SearchDeviceActivity">
10 12  
11   - <RelativeLayout
12   - android:id="@+id/fragment_container"
  13 + <com.qmuiteam.qmui.widget.QMUITopBar
  14 + android:id="@+id/topbar"
13 15 android:layout_width="match_parent"
14   - android:layout_height="match_parent"></RelativeLayout>
15   - </RelativeLayout>
  16 + android:layout_height="?attr/qmui_topbar_height" />
  17 + <!--音箱名称-->
  18 + <LinearLayout
  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">
  25 +
  26 + <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>
  43 +
  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" />
  70 +
  71 + </LinearLayout>
  72 +
  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">
  82 +
  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>
  100 +
  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" />
  126 +
  127 + </LinearLayout>
  128 +
  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">
  138 +
  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>
  156 +
  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" />
  182 +
  183 + </LinearLayout>
  184 +
  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">
  194 +
  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>
  212 +
  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" />
  238 +
  239 + </LinearLayout>
  240 +
  241 + </LinearLayout>
  242 + <!-- <RelativeLayout-->
  243 + <!-- android:id="@+id/fragment_container"-->
  244 + <!-- android:layout_width="match_parent"-->
  245 + <!-- android:layout_height="match_parent"></RelativeLayout>-->
  246 + </LinearLayout>
16 247 </layout>
17 248 \ No newline at end of file
... ...
module_xiaojiaSoundBox/src/main/res/layout/fragment_set_friend_role.xml
... ... @@ -64,15 +64,23 @@
64 64 android:id="@+id/btn_next"
65 65 android:layout_width="match_parent"
66 66 android:layout_height="45dp"
67   - android:layout_margin="30dp"
  67 + android:layout_marginLeft="30dp"
  68 + android:layout_marginTop="10dp"
  69 + android:layout_marginRight="30dp"
  70 + android:layout_marginBottom="30dp"
68 71 android:background="@drawable/selector_btn_green"
69   - android:text="下一步"
  72 + android:text="一键邀请"
70 73 android:textColor="@color/white"
71 74 android:textSize="17sp"
72 75 android:textStyle="bold" />
73 76 </LinearLayout>
74 77 <!-- -->
75   -
  78 + <com.cnlive.strike.ui.widget.UIEmptyView
  79 + android:id="@+id/empty_layout"
  80 + android:layout_width="match_parent"
  81 + android:layout_height="match_parent"
  82 + android:background="@color/color_fff"
  83 + android:visibility="gone" />
76 84 <!-- -->
77 85 </FrameLayout>
78 86 <!-- 结尾-->
... ...