Commit 75f5d477d88386becf28dd2febbc179197ee546b
1 parent
840e11da
1 修改音箱名称
Showing
34 changed files
with
1670 additions
and
690 deletions
app/src/main/java/com/cnlive/strike/xiaojiaspeaker/MainActivity.java
| ... | ... | @@ -26,7 +26,11 @@ public class MainActivity extends AppCompatActivity { |
| 26 | 26 | protected void onCreate(Bundle savedInstanceState) { |
| 27 | 27 | super.onCreate(savedInstanceState); |
| 28 | 28 | setContentView(R.layout.activity_speaker_main); |
| 29 | - XiaoJIaCommInfo.setUserId(this, "10510277"); | |
| 29 | + XiaoJIaCommInfo.setUserId(this, "10514333"); | |
| 30 | + XiaoJIaCommInfo.setUserPhone(this, " 18301489586"); | |
| 31 | +// XiaoJIaCommInfo.setUserId(this, "10513196"); | |
| 32 | +// XiaoJIaCommInfo.setUserPhone(this, "15010140838"); | |
| 33 | + | |
| 30 | 34 | // startActivity(new Intent(MainActivity.this, ToolBarTestActivity.class)); |
| 31 | 35 | // startActivity(new Intent(MainActivity.this, BluetoothConnActivity.class)); |
| 32 | 36 | // startActivity(new Intent(MainActivity.this, BlueToothStep1Activity.class)); | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/commonInfo/XiaoJIaCommInfo.java
| ... | ... | @@ -22,9 +22,19 @@ public class XiaoJIaCommInfo { |
| 22 | 22 | private static final String KEY_FAMILY_ID = "xiaojia_family_id"; |
| 23 | 23 | //移动id |
| 24 | 24 | private static final String KEY_CMCC_ID = "xiaojia_cmcc_id"; |
| 25 | - // | |
| 25 | + //用户手机号 | |
| 26 | + private static final String KEY_USER_PHONE = "xiaojia_user_phone"; | |
| 27 | + | |
| 26 | 28 | private static final int MyCurrentMode = Context.MODE_MULTI_PROCESS; |
| 27 | 29 | |
| 30 | + public static void setUserPhone(Context context, String userPhone) { | |
| 31 | + MySpHelper.getInstance(context, MyCurrentMode).putString(KEY_USER_PHONE, userPhone); | |
| 32 | + } | |
| 33 | + | |
| 34 | + public static String getUserPhone(Context context) { | |
| 35 | + return MySpHelper.getInstance(context, MyCurrentMode).getString(KEY_USER_PHONE, ""); | |
| 36 | + } | |
| 37 | + | |
| 28 | 38 | public static void setCMCCId(Context context, String cmccId) { |
| 29 | 39 | MySpHelper.getInstance(context, MyCurrentMode).putString(KEY_CMCC_ID, cmccId); |
| 30 | 40 | } |
| ... | ... | @@ -34,7 +44,6 @@ public class XiaoJIaCommInfo { |
| 34 | 44 | } |
| 35 | 45 | |
| 36 | 46 | |
| 37 | - | |
| 38 | 47 | public static void setFamilyId(Context context, String familyId) { |
| 39 | 48 | MySpHelper.getInstance(context, MyCurrentMode).putString(KEY_FAMILY_ID, familyId); |
| 40 | 49 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/AllDeviceFragmentPresenter.java
| ... | ... | @@ -13,10 +13,9 @@ import com.cnlive.strike.xiaojiaspeaker.frame.view.AllDeviceFragmentView; |
| 13 | 13 | import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; |
| 14 | 14 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 15 | 15 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.NetworkResultBean; |
| 16 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 16 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 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; | |
| 20 | 19 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 21 | 20 | |
| 22 | 21 | import java.util.HashMap; |
| ... | ... | @@ -37,19 +36,18 @@ public class AllDeviceFragmentPresenter extends MvpBasePresenter<AllDeviceFragme |
| 37 | 36 | map.put("sid", sid); |
| 38 | 37 | map.put("phone", phone); |
| 39 | 38 | Logic.create(map) |
| 40 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<FamilyListBean>>() { | |
| 39 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<FamilyListBean>>() { | |
| 41 | 40 | @Override |
| 42 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<FamilyListBean>> dataCallback) { | |
| 41 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<FamilyListBean>> dataCallback) { | |
| 43 | 42 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getFamilyList(paramsMap)).subscribe(context, dataCallback); |
| 44 | 43 | } |
| 45 | - }).<SubscriptionBaseInfo<FamilyListBean>>event() | |
| 46 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<FamilyListBean>>() { | |
| 44 | + }).<APIBaseInfo<FamilyListBean>>event() | |
| 45 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<FamilyListBean>>() { | |
| 47 | 46 | @Override |
| 48 | - public void onSuccess(SubscriptionBaseInfo<FamilyListBean> baseInfo) { | |
| 47 | + public void onSuccess(APIBaseInfo<FamilyListBean> baseInfo) { | |
| 49 | 48 | if (null == getView()) { |
| 50 | 49 | return; |
| 51 | 50 | } |
| 52 | - GsonUtils.toJson(baseInfo); | |
| 53 | 51 | getView().hideLoadingView(); |
| 54 | 52 | getView().initAllDeviceList(baseInfo.getData()); |
| 55 | 53 | } |
| ... | ... | @@ -79,15 +77,15 @@ public class AllDeviceFragmentPresenter extends MvpBasePresenter<AllDeviceFragme |
| 79 | 77 | Map<String, String> map = new HashMap<>(); |
| 80 | 78 | map.put("familyId", familyId); |
| 81 | 79 | Logic.create(map) |
| 82 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<NetworkResultBean>>() { | |
| 80 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<NetworkResultBean>>() { | |
| 83 | 81 | @Override |
| 84 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<NetworkResultBean>> dataCallback) { | |
| 82 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<NetworkResultBean>> dataCallback) { | |
| 85 | 83 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getNetworkResult(paramsMap)).subscribe(context, dataCallback); |
| 86 | 84 | } |
| 87 | - }).<SubscriptionBaseInfo<NetworkResultBean>>event() | |
| 88 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<NetworkResultBean>>() { | |
| 85 | + }).<APIBaseInfo<NetworkResultBean>>event() | |
| 86 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<NetworkResultBean>>() { | |
| 89 | 87 | @Override |
| 90 | - public void onSuccess(SubscriptionBaseInfo<NetworkResultBean> baseInfo) { | |
| 88 | + public void onSuccess(APIBaseInfo<NetworkResultBean> baseInfo) { | |
| 91 | 89 | if (null == getView()) { |
| 92 | 90 | return; |
| 93 | 91 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/ChangeDeviceNamePresenter.java
0 → 100644
| 1 | +package com.cnlive.strike.xiaojiaspeaker.frame.presenter; | |
| 2 | + | |
| 3 | +import android.content.Context; | |
| 4 | +import android.util.Log; | |
| 5 | + | |
| 6 | +import com.cnlive.libs.base.logic.Logic; | |
| 7 | +import com.cnlive.libs.base.logic.callback.DataCallback; | |
| 8 | +import com.cnlive.libs.base.logic.callback.FailureCallback; | |
| 9 | +import com.cnlive.libs.base.logic.callback.SuccessCallback; | |
| 10 | +import com.cnlive.strike.xiaojiaspeaker.frame.view.ChangeDeviceNameView; | |
| 11 | +import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; | |
| 12 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; | |
| 13 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest; | |
| 15 | +import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; | |
| 16 | +import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; | |
| 17 | + | |
| 18 | +import java.util.HashMap; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +import io.reactivex.disposables.Disposable; | |
| 22 | + | |
| 23 | +public class ChangeDeviceNamePresenter extends MvpBasePresenter<ChangeDeviceNameView> { | |
| 24 | + | |
| 25 | + private String TAG = "ChangeDeviceNamePresenter"; | |
| 26 | + | |
| 27 | + public void changeDeviceName(Context context, String deviceId, String newName) { | |
| 28 | + if (null == getView()) { | |
| 29 | + return; | |
| 30 | + } | |
| 31 | + QMUITipDialogUtil.loadingDialog(context, "请稍后...", false); | |
| 32 | + Map<String, String> map = new HashMap<>(); | |
| 33 | + map.put("devId", deviceId); | |
| 34 | + map.put("newName", newName); | |
| 35 | + Logic.create(map) | |
| 36 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo>() { | |
| 37 | + @Override | |
| 38 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo> dataCallback) { | |
| 39 | + return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.changeDeviceName(paramsMap)).subscribe(context, dataCallback); | |
| 40 | + } | |
| 41 | + }).<APIBaseInfo>event() | |
| 42 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo>() { | |
| 43 | + @Override | |
| 44 | + public void onSuccess(APIBaseInfo baseInfo) { | |
| 45 | + Log.e(TAG, "onSuccess: "); | |
| 46 | + | |
| 47 | + if (null == getView()) { | |
| 48 | + return; | |
| 49 | + } | |
| 50 | + QMUITipDialogUtil.dismessDialog(); | |
| 51 | + QMUITipDialogUtil.successDialog(context, "保存成功", 1); | |
| 52 | + } | |
| 53 | + }) | |
| 54 | + .setFailureCallback(new FailureCallback() { | |
| 55 | + @Override | |
| 56 | + public void onFailure(int i, String s) { | |
| 57 | + //显示重试 | |
| 58 | + Log.e(TAG, "onFailure: " + s); | |
| 59 | + if (null == getView()) { | |
| 60 | + return; | |
| 61 | + } | |
| 62 | + QMUITipDialogUtil.dismessDialog(); | |
| 63 | + QMUITipDialogUtil.failedDialog(context, s, 1); | |
| 64 | + } | |
| 65 | + }) | |
| 66 | + | |
| 67 | + .start(); | |
| 68 | + } | |
| 69 | +} | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/DeviceManagerFragmentPresenter.java
| 1 | 1 | package com.cnlive.strike.xiaojiaspeaker.frame.presenter; |
| 2 | 2 | |
| 3 | +import android.content.Context; | |
| 4 | +import android.view.View; | |
| 5 | + | |
| 6 | +import com.cnlive.libs.base.logic.Logic; | |
| 7 | +import com.cnlive.libs.base.logic.callback.DataCallback; | |
| 8 | +import com.cnlive.libs.base.logic.callback.FailureCallback; | |
| 9 | +import com.cnlive.libs.base.logic.callback.SuccessCallback; | |
| 3 | 10 | import com.cnlive.strike.xiaojiaspeaker.frame.view.DeviceManagerFragmentView; |
| 11 | +import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; | |
| 12 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.DeviceDetail; | |
| 13 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest; | |
| 4 | 15 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 5 | 16 | |
| 17 | +import java.util.HashMap; | |
| 18 | +import java.util.Map; | |
| 19 | + | |
| 20 | +import io.reactivex.disposables.Disposable; | |
| 21 | + | |
| 6 | 22 | public class DeviceManagerFragmentPresenter extends MvpBasePresenter<DeviceManagerFragmentView> { |
| 23 | + public void getDeviceDetailMsg(Context context, String deviceId) { | |
| 24 | + if (null == getView()) { | |
| 25 | + return; | |
| 26 | + } | |
| 27 | + getView().showLoadingView(); | |
| 28 | + Map<String, String> map = new HashMap<>(); | |
| 29 | + map.put("devId", deviceId); | |
| 30 | + Logic.create(map) | |
| 31 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<DeviceDetail>>() { | |
| 32 | + @Override | |
| 33 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<DeviceDetail>> dataCallback) { | |
| 34 | + return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getDeviceDetailMsg(paramsMap)).subscribe(context, dataCallback); | |
| 35 | + } | |
| 36 | + }).<APIBaseInfo<DeviceDetail>>event() | |
| 37 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<DeviceDetail>>() { | |
| 38 | + @Override | |
| 39 | + public void onSuccess(APIBaseInfo<DeviceDetail> baseInfo) { | |
| 40 | + if (null == getView()) { | |
| 41 | + return; | |
| 42 | + } | |
| 43 | + | |
| 44 | + getView().hideLoadingView(); | |
| 45 | + getView().initData(baseInfo.getData()); | |
| 46 | + } | |
| 47 | + }) | |
| 48 | + .setFailureCallback(new FailureCallback() { | |
| 49 | + @Override | |
| 50 | + public void onFailure(int i, String s) { | |
| 51 | + //显示重试 | |
| 52 | + getView().showRetryView(i, new View.OnClickListener() { | |
| 53 | + @Override | |
| 54 | + public void onClick(View view) { | |
| 55 | + getDeviceDetailMsg(context, deviceId); | |
| 56 | + } | |
| 57 | + }); | |
| 58 | + } | |
| 59 | + }) | |
| 60 | + | |
| 61 | + .start(); | |
| 62 | + } | |
| 7 | 63 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/InvitFriendPresenter.java
| ... | ... | @@ -10,11 +10,9 @@ import com.cnlive.libs.base.logic.callback.FailureCallback; |
| 10 | 10 | import com.cnlive.libs.base.logic.callback.SuccessCallback; |
| 11 | 11 | import com.cnlive.strike.xiaojiaspeaker.frame.view.InvitFriendView; |
| 12 | 12 | import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; |
| 13 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean; | |
| 14 | 13 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| 15 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 16 | 15 | import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest; |
| 17 | -import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; | |
| 18 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 19 | 17 | |
| 20 | 18 | import java.util.HashMap; |
| ... | ... | @@ -42,15 +40,15 @@ public class InvitFriendPresenter extends MvpBasePresenter<InvitFriendView> { |
| 42 | 40 | map.put("sids", sids); |
| 43 | 41 | map.put("familyId", familyId); |
| 44 | 42 | Logic.create(map) |
| 45 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<RoleNetBean>>() { | |
| 43 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<RoleNetBean>>() { | |
| 46 | 44 | @Override |
| 47 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<RoleNetBean>> dataCallback) { | |
| 45 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<RoleNetBean>> dataCallback) { | |
| 48 | 46 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getSetRoleList(paramsMap)).subscribe(context, dataCallback); |
| 49 | 47 | } |
| 50 | - }).<SubscriptionBaseInfo<RoleNetBean>>event() | |
| 51 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<RoleNetBean>>() { | |
| 48 | + }).<APIBaseInfo<RoleNetBean>>event() | |
| 49 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<RoleNetBean>>() { | |
| 52 | 50 | @Override |
| 53 | - public void onSuccess(SubscriptionBaseInfo<RoleNetBean> baseInfo) { | |
| 51 | + public void onSuccess(APIBaseInfo<RoleNetBean> baseInfo) { | |
| 54 | 52 | Log.e(TAG, "onSuccess: "); |
| 55 | 53 | |
| 56 | 54 | if (null == getView()) { | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/SelectWifiFragmentPresenter.java
| ... | ... | @@ -2,24 +2,16 @@ package com.cnlive.strike.xiaojiaspeaker.frame.presenter; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.util.Log; |
| 5 | -import android.view.View; | |
| 6 | 5 | |
| 7 | 6 | import com.cnlive.libs.base.logic.Logic; |
| 8 | 7 | import com.cnlive.libs.base.logic.callback.DataCallback; |
| 9 | 8 | import com.cnlive.libs.base.logic.callback.FailureCallback; |
| 10 | 9 | import com.cnlive.libs.base.logic.callback.SuccessCallback; |
| 11 | -import com.cnlive.libs.base.util.AlertUtil; | |
| 12 | 10 | import com.cnlive.strike.xiaojiaspeaker.frame.view.SelectWifiFragmentView; |
| 13 | -import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceCMCC; | |
| 14 | 11 | import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; |
| 15 | -import com.cnlive.strike.xiaojiaspeaker.netWork.CmccRequest; | |
| 16 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.ConfigDeviceNetParam; | |
| 17 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | |
| 18 | 12 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.NetworkResultBean; |
| 19 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 20 | -import com.cnlive.strike.xiaojiaspeaker.netWork.result.ConfigDeviceNetResult; | |
| 13 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 21 | 14 | import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest; |
| 22 | -import com.cnlive.strike.xiaojiaspeaker.ui.activity.ConnBluetoothSuccessActivity; | |
| 23 | 15 | import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; |
| 24 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 25 | 17 | |
| ... | ... | @@ -27,9 +19,6 @@ import java.util.HashMap; |
| 27 | 19 | import java.util.Map; |
| 28 | 20 | |
| 29 | 21 | import io.reactivex.disposables.Disposable; |
| 30 | -import retrofit2.Call; | |
| 31 | -import retrofit2.Callback; | |
| 32 | -import retrofit2.Response; | |
| 33 | 22 | |
| 34 | 23 | public class SelectWifiFragmentPresenter extends MvpBasePresenter<SelectWifiFragmentView> { |
| 35 | 24 | private String TAG = "SelectWifiFragmentPresenter"; |
| ... | ... | @@ -43,15 +32,15 @@ public class SelectWifiFragmentPresenter extends MvpBasePresenter<SelectWifiFrag |
| 43 | 32 | Map<String, String> map = new HashMap<>(); |
| 44 | 33 | map.put("familyId", familyId); |
| 45 | 34 | Logic.create(map) |
| 46 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<NetworkResultBean>>() { | |
| 35 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<NetworkResultBean>>() { | |
| 47 | 36 | @Override |
| 48 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<NetworkResultBean>> dataCallback) { | |
| 37 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<NetworkResultBean>> dataCallback) { | |
| 49 | 38 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getNetworkResult(paramsMap)).subscribe(context, dataCallback); |
| 50 | 39 | } |
| 51 | - }).<SubscriptionBaseInfo<NetworkResultBean>>event() | |
| 52 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<NetworkResultBean>>() { | |
| 40 | + }).<APIBaseInfo<NetworkResultBean>>event() | |
| 41 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<NetworkResultBean>>() { | |
| 53 | 42 | @Override |
| 54 | - public void onSuccess(SubscriptionBaseInfo<NetworkResultBean> baseInfo) { | |
| 43 | + public void onSuccess(APIBaseInfo<NetworkResultBean> baseInfo) { | |
| 55 | 44 | if (null == getView()) { |
| 56 | 45 | return; |
| 57 | 46 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/SetFriendsRolePresenter.java
| ... | ... | @@ -10,9 +10,8 @@ import com.cnlive.libs.base.logic.callback.FailureCallback; |
| 10 | 10 | import com.cnlive.libs.base.logic.callback.SuccessCallback; |
| 11 | 11 | import com.cnlive.strike.xiaojiaspeaker.frame.view.SetFriendsRoleView; |
| 12 | 12 | import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; |
| 13 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | |
| 14 | 13 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| 15 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 16 | 15 | import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest; |
| 17 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 18 | 17 | |
| ... | ... | @@ -34,15 +33,15 @@ public class SetFriendsRolePresenter extends MvpBasePresenter<SetFriendsRoleView |
| 34 | 33 | map.put("sids", sids); |
| 35 | 34 | map.put("familyId", familyId); |
| 36 | 35 | Logic.create(map) |
| 37 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<RoleNetBean>>() { | |
| 36 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<RoleNetBean>>() { | |
| 38 | 37 | @Override |
| 39 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<RoleNetBean>> dataCallback) { | |
| 38 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<RoleNetBean>> dataCallback) { | |
| 40 | 39 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getSetRoleList(paramsMap)).subscribe(context, dataCallback); |
| 41 | 40 | } |
| 42 | - }).<SubscriptionBaseInfo<RoleNetBean>>event() | |
| 43 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<RoleNetBean>>() { | |
| 41 | + }).<APIBaseInfo<RoleNetBean>>event() | |
| 42 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<RoleNetBean>>() { | |
| 44 | 43 | @Override |
| 45 | - public void onSuccess(SubscriptionBaseInfo<RoleNetBean> baseInfo) { | |
| 44 | + public void onSuccess(APIBaseInfo<RoleNetBean> baseInfo) { | |
| 46 | 45 | Log.e(TAG, "onSuccess: "); |
| 47 | 46 | |
| 48 | 47 | if (null == getView()) { | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/UserManagerPresenter.java
| 1 | 1 | package com.cnlive.strike.xiaojiaspeaker.frame.presenter; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | +import android.text.TextUtils; | |
| 4 | 5 | import android.util.Log; |
| 5 | 6 | import android.view.View; |
| 6 | 7 | |
| ... | ... | @@ -12,7 +13,7 @@ import com.cnlive.strike.xiaojiaspeaker.frame.view.UserManagerView; |
| 12 | 13 | import com.cnlive.strike.xiaojiaspeaker.netWork.ApiServiceXiaoJia; |
| 13 | 14 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean; |
| 14 | 15 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| 15 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 16 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 16 | 17 | import com.cnlive.strike.xiaojiaspeaker.netWork.result.SubscriptionRequest; |
| 17 | 18 | import com.cnlive.strike.xiaojiaspeaker.util.QMUITipDialogUtil; |
| 18 | 19 | import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| ... | ... | @@ -26,7 +27,73 @@ public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> { |
| 26 | 27 | |
| 27 | 28 | private String TAG = "UserManagerPresenter"; |
| 28 | 29 | |
| 29 | - public void getFamilyRole(Context context, String sid, String familyId) { | |
| 30 | + /** | |
| 31 | + * 修改成员角色 | |
| 32 | + * | |
| 33 | + * @param context | |
| 34 | + * @param sid | |
| 35 | + * @param familyId | |
| 36 | + * @param role | |
| 37 | + */ | |
| 38 | + public void changeMemberRole(Context context, String sid, String familyId, String role, OnResposeListener onResposeListener) { | |
| 39 | + if (null == getView()) { | |
| 40 | + return; | |
| 41 | + } | |
| 42 | + QMUITipDialogUtil.loadingDialog(context, "请稍后...", false); | |
| 43 | + Map<String, String> map = new HashMap<>(); | |
| 44 | + map.put("sid", sid); | |
| 45 | + map.put("familyId", familyId); | |
| 46 | + if (!TextUtils.isEmpty(role)) { | |
| 47 | + map.put("role", role); | |
| 48 | + } | |
| 49 | + Logic.create(map) | |
| 50 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo>() { | |
| 51 | + @Override | |
| 52 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo> dataCallback) { | |
| 53 | + return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.changeMemberRole(paramsMap)).subscribe(context, dataCallback); | |
| 54 | + } | |
| 55 | + }).<APIBaseInfo>event() | |
| 56 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo>() { | |
| 57 | + @Override | |
| 58 | + public void onSuccess(APIBaseInfo baseInfo) { | |
| 59 | + Log.e(TAG, "onSuccess: "); | |
| 60 | + | |
| 61 | + if (null == getView()) { | |
| 62 | + return; | |
| 63 | + } | |
| 64 | + QMUITipDialogUtil.dismessDialog(); | |
| 65 | + if (null != onResposeListener) { | |
| 66 | + onResposeListener.onSuccess(); | |
| 67 | + } | |
| 68 | + | |
| 69 | + | |
| 70 | + } | |
| 71 | + }) | |
| 72 | + .setFailureCallback(new FailureCallback() { | |
| 73 | + @Override | |
| 74 | + public void onFailure(int i, String s) { | |
| 75 | + if (null == getView()) { | |
| 76 | + return; | |
| 77 | + } | |
| 78 | + QMUITipDialogUtil.dismessDialog(); | |
| 79 | + QMUITipDialogUtil.failedDialog(context, s, 1); | |
| 80 | + //显示重试 | |
| 81 | + Log.e(TAG, "onFailure: " + s); | |
| 82 | + } | |
| 83 | + }) | |
| 84 | + | |
| 85 | + .start(); | |
| 86 | + } | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 获取角色列表 | |
| 90 | + * | |
| 91 | + * @param context | |
| 92 | + * @param sid | |
| 93 | + * @param familyId | |
| 94 | + * @param phone | |
| 95 | + */ | |
| 96 | + public void getFamilyRole(Context context, String sid, String familyId, String phone) { | |
| 30 | 97 | if (null == getView()) { |
| 31 | 98 | return; |
| 32 | 99 | } |
| ... | ... | @@ -34,23 +101,24 @@ public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> { |
| 34 | 101 | Map<String, String> map = new HashMap<>(); |
| 35 | 102 | map.put("sid", sid); |
| 36 | 103 | map.put("familyId", familyId); |
| 104 | + map.put("phone", phone); | |
| 37 | 105 | Logic.create(map) |
| 38 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<FamilyRoleBean>>() { | |
| 106 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<FamilyRoleBean>>() { | |
| 39 | 107 | @Override |
| 40 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<FamilyRoleBean>> dataCallback) { | |
| 108 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<FamilyRoleBean>> dataCallback) { | |
| 41 | 109 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getFamilyRole(paramsMap)).subscribe(context, dataCallback); |
| 42 | 110 | } |
| 43 | - }).<SubscriptionBaseInfo<FamilyRoleBean>>event() | |
| 44 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<FamilyRoleBean>>() { | |
| 111 | + }).<APIBaseInfo<FamilyRoleBean>>event() | |
| 112 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<FamilyRoleBean>>() { | |
| 45 | 113 | @Override |
| 46 | - public void onSuccess(SubscriptionBaseInfo<FamilyRoleBean> baseInfo) { | |
| 114 | + public void onSuccess(APIBaseInfo<FamilyRoleBean> baseInfo) { | |
| 47 | 115 | Log.e(TAG, "onSuccess: "); |
| 48 | 116 | |
| 49 | 117 | if (null == getView()) { |
| 50 | 118 | return; |
| 51 | 119 | } |
| 52 | 120 | getView().hideLoadingView(); |
| 53 | - getView().initView(baseInfo.getData().getFamilyRoleList()); | |
| 121 | + getView().initView(baseInfo.getData()); | |
| 54 | 122 | |
| 55 | 123 | } |
| 56 | 124 | }) |
| ... | ... | @@ -62,7 +130,7 @@ public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> { |
| 62 | 130 | getView().showRetryView(i, new View.OnClickListener() { |
| 63 | 131 | @Override |
| 64 | 132 | public void onClick(View view) { |
| 65 | - getFamilyRole(context, sid, familyId); | |
| 133 | + getFamilyRole(context, sid, familyId, phone); | |
| 66 | 134 | } |
| 67 | 135 | }); |
| 68 | 136 | } |
| ... | ... | @@ -71,6 +139,7 @@ public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> { |
| 71 | 139 | .start(); |
| 72 | 140 | } |
| 73 | 141 | |
| 142 | + | |
| 74 | 143 | public void getSetRoleList(Context context, String sids, String familyId, FamilyRoleBean.FamilyRoleListBean bean) { |
| 75 | 144 | if (null == getView()) { |
| 76 | 145 | return; |
| ... | ... | @@ -80,15 +149,15 @@ public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> { |
| 80 | 149 | map.put("sids", sids); |
| 81 | 150 | map.put("familyId", familyId); |
| 82 | 151 | Logic.create(map) |
| 83 | - .action(new Logic.Action<Map<String, String>, SubscriptionBaseInfo<RoleNetBean>>() { | |
| 152 | + .action(new Logic.Action<Map<String, String>, APIBaseInfo<RoleNetBean>>() { | |
| 84 | 153 | @Override |
| 85 | - public Disposable action(Map<String, String> paramsMap, DataCallback<SubscriptionBaseInfo<RoleNetBean>> dataCallback) { | |
| 154 | + public Disposable action(Map<String, String> paramsMap, DataCallback<APIBaseInfo<RoleNetBean>> dataCallback) { | |
| 86 | 155 | return SubscriptionRequest.service(ApiServiceXiaoJia.class, api -> api.getSetRoleList(paramsMap)).subscribe(context, dataCallback); |
| 87 | 156 | } |
| 88 | - }).<SubscriptionBaseInfo<RoleNetBean>>event() | |
| 89 | - .setSuccessCallback(new SuccessCallback<SubscriptionBaseInfo<RoleNetBean>>() { | |
| 157 | + }).<APIBaseInfo<RoleNetBean>>event() | |
| 158 | + .setSuccessCallback(new SuccessCallback<APIBaseInfo<RoleNetBean>>() { | |
| 90 | 159 | @Override |
| 91 | - public void onSuccess(SubscriptionBaseInfo<RoleNetBean> baseInfo) { | |
| 160 | + public void onSuccess(APIBaseInfo<RoleNetBean> baseInfo) { | |
| 92 | 161 | Log.e(TAG, "onSuccess: "); |
| 93 | 162 | |
| 94 | 163 | if (null == getView()) { |
| ... | ... | @@ -112,4 +181,8 @@ public class UserManagerPresenter extends MvpBasePresenter<UserManagerView> { |
| 112 | 181 | |
| 113 | 182 | .start(); |
| 114 | 183 | } |
| 184 | + | |
| 185 | + public interface OnResposeListener { | |
| 186 | + void onSuccess(); | |
| 187 | + } | |
| 115 | 188 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/AllDeviceFragmentView.java
| ... | ... | @@ -24,8 +24,8 @@ public class AllDeviceFragmentView implements MvpView { |
| 24 | 24 | private AllDeviceFragment fragment; |
| 25 | 25 | private AllDeviceAdapter adapter; |
| 26 | 26 | private List<FamilyListBean.UsersBeanX.DeviceListBean> allDeviceInfoList; |
| 27 | - private List<PopMenuInfo> popMenuInfoList = null; | |
| 28 | - private PopMenu mPopMenu; | |
| 27 | +// private List<PopMenuInfo> popMenuInfoList = null; | |
| 28 | +// private PopMenu mPopMenu; | |
| 29 | 29 | private String TAG = "AllDeviceFragmentView"; |
| 30 | 30 | private FamilyListBean familyListBean; |
| 31 | 31 | |
| ... | ... | @@ -38,7 +38,7 @@ public class AllDeviceFragmentView implements MvpView { |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public void initView() { |
| 41 | - initPopView(); | |
| 41 | +// initPopView(); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public void initAllDeviceList(FamilyListBean familyListBean) { |
| ... | ... | @@ -46,7 +46,9 @@ public class AllDeviceFragmentView implements MvpView { |
| 46 | 46 | this.familyListBean = familyListBean; |
| 47 | 47 | this.allDeviceInfoList = new ArrayList<>(); |
| 48 | 48 | if (null != familyListBean && null != familyListBean.getUsers()) { |
| 49 | + int index = 0; | |
| 49 | 50 | for (FamilyListBean.UsersBeanX usersBean : familyListBean.getUsers()) { |
| 51 | + | |
| 50 | 52 | //存储自己为主人的家庭 |
| 51 | 53 | if (usersBean.getIsMaster() == FamilyListBean.THE_HOST) { |
| 52 | 54 | Log.e(TAG, "getId: " + usersBean.getUserId()); |
| ... | ... | @@ -58,10 +60,15 @@ public class AllDeviceFragmentView implements MvpView { |
| 58 | 60 | //存储移动token |
| 59 | 61 | XiaoJIaCommInfo.setToken(getContext(), usersBean.getToken()); |
| 60 | 62 | } |
| 63 | + | |
| 64 | + for (FamilyListBean.UsersBeanX.DeviceListBean deviceListBean : usersBean.getDeviceList()) { | |
| 65 | + deviceListBean.setParentPosition(index); | |
| 66 | + } | |
| 61 | 67 | //存储移动id |
| 62 | 68 | if (null != usersBean.getDeviceList()) { |
| 63 | 69 | this.allDeviceInfoList.addAll(usersBean.getDeviceList()); |
| 64 | 70 | } |
| 71 | + index++; | |
| 65 | 72 | } |
| 66 | 73 | } |
| 67 | 74 | adapter = new AllDeviceAdapter(getContext(), allDeviceInfoList); |
| ... | ... | @@ -76,69 +83,69 @@ public class AllDeviceFragmentView implements MvpView { |
| 76 | 83 | adapter.setOnItemClickListener(new AllDeviceAdapter.OnItemClickListener() { |
| 77 | 84 | @Override |
| 78 | 85 | public void onItemClick(int position, FamilyListBean.UsersBeanX.DeviceListBean AllDeviceInfo) { |
| 79 | - DeviceDetailActivity.startActivity(fragment.getActivity(),AllDeviceInfo); | |
| 86 | + DeviceDetailActivity.startActivity(fragment.getActivity(), AllDeviceInfo,familyListBean.getUsers().get(AllDeviceInfo.getParentPosition()).getId()); | |
| 80 | 87 | } |
| 81 | 88 | }); |
| 82 | 89 | } |
| 83 | 90 | |
| 84 | - public void initPopView() { | |
| 85 | -// View contentView = LayoutInflater.from(getContext()) | |
| 86 | -// .inflate(R.layout.activity_all_device, null); | |
| 87 | -// BottomSheetDialog dialog = new BottomSheetDialog(getContext()); | |
| 88 | -// dialog.setContentView(contentView); | |
| 89 | -// dialog.setCancelable(false); | |
| 90 | -// BottomSheetBehavior sheetBehavior = BottomSheetBehavior.from((View) contentView.getParent()); | |
| 91 | -// sheetBehavior.setPeekHeight(200); | |
| 92 | - //给布局设置透明背景色,让图片突出来 | |
| 93 | -// bottomSheetDialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet) | |
| 94 | -// .setBackgroundColor(getResources().getColor(android.R.color.transparent)); | |
| 95 | -// dialog.show(); | |
| 96 | - | |
| 97 | - popMenuInfoList = new ArrayList<>(); | |
| 98 | - PopMenuInfo popMenuInfo = new PopMenuInfo(); | |
| 99 | - popMenuInfo.setTitle("使用者管理"); | |
| 100 | - popMenuInfo.setNetImag("zsdfs"); | |
| 101 | - popMenuInfoList.add(popMenuInfo); | |
| 102 | - popMenuInfo = new PopMenuInfo(); | |
| 103 | - popMenuInfo.setTitle("添加设备"); | |
| 104 | - popMenuInfo.setNetImag("zsdfs"); | |
| 105 | - popMenuInfoList.add(popMenuInfo); | |
| 91 | +// public void initPopView() { | |
| 92 | +//// View contentView = LayoutInflater.from(getContext()) | |
| 93 | +//// .inflate(R.layout.activity_all_device, null); | |
| 94 | +//// BottomSheetDialog dialog = new BottomSheetDialog(getContext()); | |
| 95 | +//// dialog.setContentView(contentView); | |
| 96 | +//// dialog.setCancelable(false); | |
| 97 | +//// BottomSheetBehavior sheetBehavior = BottomSheetBehavior.from((View) contentView.getParent()); | |
| 98 | +//// sheetBehavior.setPeekHeight(200); | |
| 99 | +// //给布局设置透明背景色,让图片突出来 | |
| 100 | +//// bottomSheetDialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet) | |
| 101 | +//// .setBackgroundColor(getResources().getColor(android.R.color.transparent)); | |
| 102 | +//// dialog.show(); | |
| 103 | +// | |
| 104 | +// popMenuInfoList = new ArrayList<>(); | |
| 105 | +// PopMenuInfo popMenuInfo = new PopMenuInfo(); | |
| 106 | +// popMenuInfo.setTitle("使用者管理"); | |
| 107 | +// popMenuInfo.setNetImag("zsdfs"); | |
| 108 | +// popMenuInfoList.add(popMenuInfo); | |
| 106 | 109 | // popMenuInfo = new PopMenuInfo(); |
| 107 | -// popMenuInfo.setTitle("设备管理"); | |
| 108 | -//// popMenuInfo.setNetImag("zsdfs"); | |
| 110 | +// popMenuInfo.setTitle("添加设备"); | |
| 111 | +// popMenuInfo.setNetImag("zsdfs"); | |
| 109 | 112 | // popMenuInfoList.add(popMenuInfo); |
| 110 | - | |
| 111 | - if (null == mPopMenu) { | |
| 112 | - mPopMenu = new PopMenu.Builder(fragment.getActivity()) | |
| 113 | - .addData(popMenuInfoList) | |
| 114 | - .setBackgroundColorArray(new int[]{Color.parseColor("#363636"), Color.parseColor("#BF000000"), Color.parseColor("#BF000000")}) | |
| 115 | - .setLeftAndRightMargin(20) | |
| 116 | - .setTopMargin(20) | |
| 117 | - .setLineColor(R.color.white_50) | |
| 118 | - .setTextColor(R.color.white) | |
| 119 | - .setLineVisible(View.VISIBLE) | |
| 120 | -// .setArrowHeight(30f) | |
| 121 | -// .setArrowHeight(30f) | |
| 122 | - .setCancelable(false) | |
| 123 | - .setCornerRadius(10f) | |
| 124 | - .build(); | |
| 125 | - } | |
| 126 | - | |
| 127 | - mPopMenu.setmItemClickListener(new PopMenu.OnItemClickListener() { | |
| 128 | - @Override | |
| 129 | - public void onClick(int position, PopMenuInfo popMenuInfo) { | |
| 130 | - if (position == 1) { | |
| 131 | - BlueToothStep1Activity.startActivity(fragment.getActivity()); | |
| 132 | - } | |
| 133 | - } | |
| 134 | - }); | |
| 135 | - } | |
| 136 | - | |
| 137 | - public void showPop(View view) { | |
| 138 | - if (null != getContext() && null != mPopMenu) { | |
| 139 | - mPopMenu.show(view); | |
| 140 | - } | |
| 141 | - } | |
| 113 | +//// popMenuInfo = new PopMenuInfo(); | |
| 114 | +//// popMenuInfo.setTitle("设备管理"); | |
| 115 | +////// popMenuInfo.setNetImag("zsdfs"); | |
| 116 | +//// popMenuInfoList.add(popMenuInfo); | |
| 117 | +// | |
| 118 | +// if (null == mPopMenu) { | |
| 119 | +// mPopMenu = new PopMenu.Builder(fragment.getActivity()) | |
| 120 | +// .addData(popMenuInfoList) | |
| 121 | +// .setBackgroundColorArray(new int[]{Color.parseColor("#363636"), Color.parseColor("#BF000000"), Color.parseColor("#BF000000")}) | |
| 122 | +// .setLeftAndRightMargin(20) | |
| 123 | +// .setTopMargin(20) | |
| 124 | +// .setLineColor(R.color.white_50) | |
| 125 | +// .setTextColor(R.color.white) | |
| 126 | +// .setLineVisible(View.VISIBLE) | |
| 127 | +//// .setArrowHeight(30f) | |
| 128 | +//// .setArrowHeight(30f) | |
| 129 | +// .setCancelable(false) | |
| 130 | +// .setCornerRadius(10f) | |
| 131 | +// .build(); | |
| 132 | +// } | |
| 133 | +// | |
| 134 | +// mPopMenu.setmItemClickListener(new PopMenu.OnItemClickListener() { | |
| 135 | +// @Override | |
| 136 | +// public void onClick(int position, PopMenuInfo popMenuInfo) { | |
| 137 | +// if (position == 1) { | |
| 138 | +// BlueToothStep1Activity.startActivity(fragment.getActivity()); | |
| 139 | +// } | |
| 140 | +// } | |
| 141 | +// }); | |
| 142 | +// } | |
| 143 | +// | |
| 144 | +// public void showPop(View view) { | |
| 145 | +// if (null != getContext() && null != mPopMenu) { | |
| 146 | +// mPopMenu.show(view); | |
| 147 | +// } | |
| 148 | +// } | |
| 142 | 149 | |
| 143 | 150 | /** |
| 144 | 151 | * 显示loading | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/ChangeDeviceNameView.java
0 → 100644
| 1 | +package com.cnlive.strike.xiaojiaspeaker.frame.view; | |
| 2 | + | |
| 3 | +import android.app.Activity; | |
| 4 | +import android.content.Intent; | |
| 5 | +import android.support.v4.content.ContextCompat; | |
| 6 | +import android.text.Editable; | |
| 7 | +import android.text.TextWatcher; | |
| 8 | +import android.view.View; | |
| 9 | + | |
| 10 | +import com.cnlive.strike.xiaojiaspeaker.R; | |
| 11 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.ChangeDeviceNameActivity; | |
| 12 | +import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeDeviceNameFragment; | |
| 13 | +import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 14 | + | |
| 15 | +public class ChangeDeviceNameView implements MvpView { | |
| 16 | + private ChangeDeviceNameFragment fragment; | |
| 17 | + | |
| 18 | + public ChangeDeviceNameView(ChangeDeviceNameFragment fragment) { | |
| 19 | + this.fragment = fragment; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public Activity getContext() { | |
| 23 | + return fragment == null ? null : fragment.getActivity(); | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void initView() { | |
| 27 | + //编辑框 | |
| 28 | + fragment.binding.etName.addTextChangedListener(new TextWatcher() { | |
| 29 | + @Override | |
| 30 | + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | |
| 31 | + | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { | |
| 36 | + if (null != charSequence && charSequence.length() > 0) { | |
| 37 | + fragment.binding.ivClose.setVisibility(View.VISIBLE); | |
| 38 | + setBtnClick(); | |
| 39 | + } else { | |
| 40 | + fragment.binding.ivClose.setVisibility(View.GONE); | |
| 41 | + setBtnCantClick(); | |
| 42 | + } | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Override | |
| 46 | + public void afterTextChanged(Editable editable) { | |
| 47 | + | |
| 48 | + } | |
| 49 | + }); | |
| 50 | + //清除按钮点击事件 | |
| 51 | + fragment.binding.ivClose.setOnClickListener(new View.OnClickListener() { | |
| 52 | + @Override | |
| 53 | + public void onClick(View view) { | |
| 54 | + fragment.binding.etName.setText(""); | |
| 55 | + } | |
| 56 | + }); | |
| 57 | + } | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 设置绑定按钮不可点击 | |
| 63 | + */ | |
| 64 | + private void setBtnCantClick() { | |
| 65 | + if (fragment.binding.btnNext.isClickable()) { | |
| 66 | + fragment.binding.btnNext.setClickable(false); | |
| 67 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_btn_press)); | |
| 68 | + } | |
| 69 | + } | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * 设置绑定按钮可点击 | |
| 73 | + */ | |
| 74 | + private void setBtnClick() { | |
| 75 | + if (!fragment.binding.btnNext.isClickable()) { | |
| 76 | + fragment.binding.btnNext.setClickable(true); | |
| 77 | + fragment.binding.btnNext.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_btn_green)); | |
| 78 | + } | |
| 79 | + } | |
| 80 | +} | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/DeviceManagerFragmentView.java
| ... | ... | @@ -3,8 +3,15 @@ package com.cnlive.strike.xiaojiaspeaker.frame.view; |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.support.v7.widget.DefaultItemAnimator; |
| 5 | 5 | import android.support.v7.widget.LinearLayoutManager; |
| 6 | +import android.view.View; | |
| 6 | 7 | |
| 8 | +import com.cnlive.strike.xiaojiaspeaker.R; | |
| 7 | 9 | import com.cnlive.strike.xiaojiaspeaker.model.DeviceManagerMenu; |
| 10 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.DeviceDetail; | |
| 11 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | |
| 12 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.ChangeDeviceNameActivity; | |
| 13 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.DeviceManagerActivity; | |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.FirmwareUpdateActivity; | |
| 8 | 15 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.DeviceManagerMenuAdapter; |
| 9 | 16 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.DeviceManagerFragment; |
| 10 | 17 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| ... | ... | @@ -14,9 +21,10 @@ import java.util.List; |
| 14 | 21 | |
| 15 | 22 | public class DeviceManagerFragmentView implements MvpView { |
| 16 | 23 | private DeviceManagerFragment fragment; |
| 17 | - private DeviceManagerMenuAdapter adapter; | |
| 18 | - private List<DeviceManagerMenu> deviceManagerMenuList; | |
| 19 | - | |
| 24 | + // private DeviceManagerMenuAdapter adapter; | |
| 25 | +// private List<DeviceManagerMenu> deviceManagerMenuList; | |
| 26 | + private DeviceDetail deviceDetail; | |
| 27 | +private FamilyListBean.UsersBeanX.DeviceListBean currentDeviceInfo; | |
| 20 | 28 | public DeviceManagerFragmentView(DeviceManagerFragment fragment) { |
| 21 | 29 | this.fragment = fragment; |
| 22 | 30 | } |
| ... | ... | @@ -25,18 +33,102 @@ public class DeviceManagerFragmentView implements MvpView { |
| 25 | 33 | return fragment == null ? null : fragment.getActivity(); |
| 26 | 34 | } |
| 27 | 35 | |
| 28 | - public void initView() { | |
| 29 | - deviceManagerMenuList = new ArrayList<>(); | |
| 30 | - deviceManagerMenuList.add(new DeviceManagerMenu("音箱名称", "as", DeviceManagerMenu.NO_RIGHT_ARROW)); | |
| 31 | - deviceManagerMenuList.add(new DeviceManagerMenu("WIFI设置", "asd", DeviceManagerMenu.NORMAL)); | |
| 32 | - deviceManagerMenuList.add(new DeviceManagerMenu("设备信息", "asd", DeviceManagerMenu.NO_MENU_DETAIL)); | |
| 33 | - deviceManagerMenuList.add(new DeviceManagerMenu("固件升级", "asd", DeviceManagerMenu.NORMAL)); | |
| 34 | - deviceManagerMenuList.add(new DeviceManagerMenu("远程控制", "手机可远程控制音箱播放的内容,但仅限听见中国", DeviceManagerMenu.SWITCH_NORMAL)); | |
| 35 | - deviceManagerMenuList.add(new DeviceManagerMenu("小家音箱播放", "音箱可作为蓝牙音箱,播放手机内所有声音", DeviceManagerMenu.SWITCH_NORMAL)); | |
| 36 | - | |
| 37 | - adapter=new DeviceManagerMenuAdapter(getContext(),deviceManagerMenuList); | |
| 38 | - fragment.binding.rvMenu.setLayoutManager(new LinearLayoutManager(getContext())); | |
| 39 | - fragment.binding.rvMenu.setAdapter(adapter); | |
| 40 | - ((DefaultItemAnimator) fragment.binding.rvMenu.getItemAnimator()).setSupportsChangeAnimations(false); | |
| 36 | + public void initView(FamilyListBean.UsersBeanX.DeviceListBean currentDeviceInfo) { | |
| 37 | + this.currentDeviceInfo=currentDeviceInfo; | |
| 38 | +// deviceManagerMenuList = new ArrayList<>(); | |
| 39 | +// deviceManagerMenuList.add(new DeviceManagerMenu("音箱名称", "as", DeviceManagerMenu.NO_RIGHT_ARROW)); | |
| 40 | +// deviceManagerMenuList.add(new DeviceManagerMenu("WIFI设置", "asd", DeviceManagerMenu.NORMAL)); | |
| 41 | +// deviceManagerMenuList.add(new DeviceManagerMenu("设备信息", "asd", DeviceManagerMenu.NO_MENU_DETAIL)); | |
| 42 | +// deviceManagerMenuList.add(new DeviceManagerMenu("固件升级", "asd", DeviceManagerMenu.NORMAL)); | |
| 43 | +// deviceManagerMenuList.add(new DeviceManagerMenu("远程控制", "手机可远程控制音箱播放的内容,但仅限听见中国", DeviceManagerMenu.SWITCH_NORMAL)); | |
| 44 | +// deviceManagerMenuList.add(new DeviceManagerMenu("小家音箱播放", "音箱可作为蓝牙音箱,播放手机内所有声音", DeviceManagerMenu.SWITCH_NORMAL)); | |
| 45 | +// | |
| 46 | +// adapter=new DeviceManagerMenuAdapter(getContext(),deviceManagerMenuList); | |
| 47 | +// fragment.binding.rvMenu.setLayoutManager(new LinearLayoutManager(getContext())); | |
| 48 | +// fragment.binding.rvMenu.setAdapter(adapter); | |
| 49 | +// ((DefaultItemAnimator) fragment.binding.rvMenu.getItemAnimator()).setSupportsChangeAnimations(false); | |
| 50 | + | |
| 51 | + | |
| 52 | + //音箱名称 | |
| 53 | + fragment.binding.llDeviceName.setOnClickListener(new View.OnClickListener() { | |
| 54 | + @Override | |
| 55 | + public void onClick(View view) { | |
| 56 | + ChangeDeviceNameActivity.startActivity(getContext()); | |
| 57 | + } | |
| 58 | + }); | |
| 59 | + //wifi设置 | |
| 60 | + fragment.binding.llWifiSetting.setOnClickListener(new View.OnClickListener() { | |
| 61 | + @Override | |
| 62 | + public void onClick(View view) { | |
| 63 | + | |
| 64 | + } | |
| 65 | + }); | |
| 66 | + //设备信息 | |
| 67 | + fragment.binding.llDeviceInfo.setOnClickListener(new View.OnClickListener() { | |
| 68 | + @Override | |
| 69 | + public void onClick(View view) { | |
| 70 | + | |
| 71 | + } | |
| 72 | + }); | |
| 73 | + //固件升级 | |
| 74 | + fragment.binding.llDeviceUpdate.setOnClickListener(new View.OnClickListener() { | |
| 75 | + @Override | |
| 76 | + public void onClick(View view) { | |
| 77 | + FirmwareUpdateActivity.startActivity(getContext()); | |
| 78 | + } | |
| 79 | + }); | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void initData(DeviceDetail deviceDetail){ | |
| 83 | + this.deviceDetail = deviceDetail; | |
| 84 | + //设置音箱名称 | |
| 85 | + fragment.binding.tvDeviceName.setText(deviceDetail.getDeviceName()); | |
| 86 | + //设置wifi | |
| 87 | + fragment.binding.tvWifiName.setText(deviceDetail.getWifiName()); | |
| 88 | + //设置固件版本号 | |
| 89 | + fragment.binding.tvCurrentVersion.setText(deviceDetail.getVer()); | |
| 90 | + } | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 显示loading | |
| 94 | + */ | |
| 95 | + public void showLoadingView() { | |
| 96 | + if (fragment.binding.emptyLayout == null) { | |
| 97 | + return; | |
| 98 | + } | |
| 99 | + fragment.binding.emptyLayout.show(true); | |
| 100 | + } | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 隐藏loading | |
| 104 | + */ | |
| 105 | + public void hideLoadingView() { | |
| 106 | + if (fragment.binding.emptyLayout == null) { | |
| 107 | + return; | |
| 108 | + } | |
| 109 | + fragment.binding.emptyLayout.hide(); | |
| 110 | + } | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * 显示重试页面 | |
| 114 | + * | |
| 115 | + * @param errorCode | |
| 116 | + * @param listener | |
| 117 | + */ | |
| 118 | + public void showRetryView(int errorCode, View.OnClickListener listener) { | |
| 119 | + //显示空视图 | |
| 120 | + fragment.binding.emptyLayout.setVisibility(View.VISIBLE); | |
| 121 | + | |
| 122 | + if (fragment.binding.emptyLayout == null) return; | |
| 123 | + String titleText = ""; | |
| 124 | + String detailText = ""; | |
| 125 | + if (errorCode == -3) { | |
| 126 | + titleText = getContext().getString(R.string.msg_failed_network_title); | |
| 127 | + detailText = getContext().getString(R.string.msg_failed_network_detail); | |
| 128 | + } else { | |
| 129 | + titleText = getContext().getString(R.string.msg_failed_other_title); | |
| 130 | + detailText = getContext().getString(R.string.msg_failed_other_detail); | |
| 131 | + } | |
| 132 | + fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener); | |
| 41 | 133 | } |
| 42 | 134 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/UserManagerView.java
| ... | ... | @@ -3,11 +3,16 @@ package com.cnlive.strike.xiaojiaspeaker.frame.view; |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.graphics.Color; |
| 5 | 5 | import android.graphics.Typeface; |
| 6 | +import android.support.v4.content.ContextCompat; | |
| 6 | 7 | import android.support.v7.widget.LinearLayoutManager; |
| 8 | +import android.text.TextUtils; | |
| 7 | 9 | import android.view.View; |
| 10 | +import android.widget.Button; | |
| 8 | 11 | |
| 12 | +import com.cnlive.libs.base.util.AlertUtil; | |
| 9 | 13 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 10 | 14 | import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; |
| 15 | +import com.cnlive.strike.xiaojiaspeaker.frame.presenter.UserManagerPresenter; | |
| 11 | 16 | import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo; |
| 12 | 17 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean; |
| 13 | 18 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| ... | ... | @@ -35,6 +40,8 @@ public class UserManagerView implements MvpView { |
| 35 | 40 | private List<RoleInfo> roleInfoList; |
| 36 | 41 | private EditRoleDialog editRoleDialog; |
| 37 | 42 | private SelectDialog deleteDialog; |
| 43 | + private Button btn_invit; | |
| 44 | + private String currentSelectFamilyId; | |
| 38 | 45 | private String test = "{\n" + |
| 39 | 46 | "\t\"familyRoleList\": [{\n" + |
| 40 | 47 | "\t\t\t\"family_id\": \"fb8f160efc61431f96e8111e0cbfd349\",\n" + |
| ... | ... | @@ -81,26 +88,44 @@ public class UserManagerView implements MvpView { |
| 81 | 88 | return fragment == null ? null : fragment.getActivity(); |
| 82 | 89 | } |
| 83 | 90 | |
| 84 | - public void initView(List<FamilyRoleBean.FamilyRoleListBean> familyRoleList) { | |
| 85 | - this.familyRoleList = familyRoleList; | |
| 86 | - FamilyRoleBean bean1 = GsonUtil.GsonToBean(test, FamilyRoleBean.class); | |
| 87 | -// if (null != familyRoleList) { | |
| 88 | - for (FamilyRoleBean.FamilyRoleListBean bean : bean1.getFamilyRoleList()) { | |
| 89 | - if ("管理员".equals(bean.getRoleName())) { | |
| 90 | - bean.setType(FamilyRoleBean.FamilyRoleListBean.HOST); | |
| 91 | - } else { | |
| 92 | - bean.setType(FamilyRoleBean.FamilyRoleListBean.MEMBER); | |
| 91 | + public void setCurrentSelectFamily(String selectFamily) { | |
| 92 | + currentSelectFamilyId = selectFamily; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void initView(FamilyRoleBean familyRoleBean) { | |
| 96 | + this.familyRoleList = familyRoleBean.getFamilyRoleList(); | |
| 97 | +// FamilyRoleBean bean1 = GsonUtil.GsonToBean(test, FamilyRoleBean.class); | |
| 98 | + if (null != familyRoleList) { | |
| 99 | + for (FamilyRoleBean.FamilyRoleListBean bean : familyRoleList) { | |
| 100 | + if ("管理员".equals(bean.getRoleName())) { | |
| 101 | + bean.setType(FamilyRoleBean.FamilyRoleListBean.HOST); | |
| 102 | + } else { | |
| 103 | + bean.setType(FamilyRoleBean.FamilyRoleListBean.MEMBER); | |
| 104 | + } | |
| 105 | + } | |
| 106 | + } | |
| 107 | + for (int i = 0; i < familyRoleList.size(); i++) { | |
| 108 | + if ("管理员".equals(familyRoleList.get(i).getRoleName())) { | |
| 109 | + FamilyRoleBean.FamilyRoleListBean bean = familyRoleList.get(i); | |
| 110 | + familyRoleList.remove(i); | |
| 111 | + familyRoleList.add(0, bean); | |
| 93 | 112 | } |
| 94 | 113 | } |
| 95 | - for (int i = 0; i < bean1.getFamilyRoleList().size(); i++) { | |
| 96 | - if ("管理员".equals(bean1.getFamilyRoleList().get(i).getRoleName())) { | |
| 97 | - FamilyRoleBean.FamilyRoleListBean bean = bean1.getFamilyRoleList().get(i); | |
| 98 | - bean1.getFamilyRoleList().remove(i); | |
| 99 | - bean1.getFamilyRoleList().add(0, bean); | |
| 114 | + //判断是否是管理者 | |
| 115 | + if (FamilyRoleBean.HOST == familyRoleBean.getIsMaster()) { | |
| 116 | + //是否显示按钮 | |
| 117 | + if (null != familyRoleList && familyRoleList.size() > 1) { | |
| 118 | + fragment.binding.llBtn.setVisibility(View.GONE); | |
| 119 | + } else { | |
| 120 | + fragment.binding.llBtn.setVisibility(View.VISIBLE); | |
| 100 | 121 | } |
| 122 | + adapter = new UserManagerAdapter(getContext(), familyRoleList, true); | |
| 123 | + //是否显示使用者按钮 | |
| 124 | + addAdminBtn(); | |
| 125 | + } else { | |
| 126 | + adapter = new UserManagerAdapter(getContext(), familyRoleList, false); | |
| 127 | + | |
| 101 | 128 | } |
| 102 | -// } | |
| 103 | - adapter = new UserManagerAdapter(getContext(), bean1.getFamilyRoleList(), true); | |
| 104 | 129 | fragment.binding.rvUserManagerList.setLayoutManager(new LinearLayoutManager(getContext())); |
| 105 | 130 | fragment.binding.rvUserManagerList.setAdapter(adapter); |
| 106 | 131 | //编辑按钮点击事件 |
| ... | ... | @@ -123,7 +148,16 @@ public class UserManagerView implements MvpView { |
| 123 | 148 | }, "确定", new SelectDialog.DialogInterface() { |
| 124 | 149 | @Override |
| 125 | 150 | public void onClick(SelectDialog dialog) { |
| 126 | - dialog.dismiss(); | |
| 151 | + fragment.getPresenter().changeMemberRole(getContext(), bean.getSid() + "", bean.getFamily_id(), null, new UserManagerPresenter.OnResposeListener() { | |
| 152 | + @Override | |
| 153 | + public void onSuccess() { | |
| 154 | + dialog.dismiss(); | |
| 155 | + familyRoleList.remove(position); | |
| 156 | + if (null != adapter) { | |
| 157 | + adapter.notifyDataSetChanged(); | |
| 158 | + } | |
| 159 | + } | |
| 160 | + }); | |
| 127 | 161 | } |
| 128 | 162 | }); |
| 129 | 163 | deleteDialog.setRightBtnColor(R.color.btn_green); |
| ... | ... | @@ -150,6 +184,21 @@ public class UserManagerView implements MvpView { |
| 150 | 184 | }); |
| 151 | 185 | } |
| 152 | 186 | |
| 187 | + public void addAdminBtn() { | |
| 188 | + //添加邀请者按钮 | |
| 189 | + btn_invit = fragment.binding.topbar.addRightTextButton("邀请使用者", R.id.rightBtn); | |
| 190 | + btn_invit.setTextSize(15); | |
| 191 | + btn_invit.setTextColor(ContextCompat.getColor(getContext(), R.color.color_282828)); | |
| 192 | + btn_invit.setOnClickListener(new View.OnClickListener() { | |
| 193 | + @Override | |
| 194 | + public void onClick(View view) { | |
| 195 | + if (null != getContext()) { | |
| 196 | + showPop(btn_invit); | |
| 197 | + } | |
| 198 | + } | |
| 199 | + }); | |
| 200 | + } | |
| 201 | + | |
| 153 | 202 | public void initRoleDialog(RoleNetBean roleNetBean, FamilyRoleBean.FamilyRoleListBean familyRoleListBean) { |
| 154 | 203 | roleInfoList = new ArrayList<>(); |
| 155 | 204 | //整理数据 |
| ... | ... | @@ -191,8 +240,25 @@ public class UserManagerView implements MvpView { |
| 191 | 240 | } |
| 192 | 241 | |
| 193 | 242 | @Override |
| 194 | - public void onSaveClick(EditRoleDialog dialog) { | |
| 195 | - dialog.dismiss(); | |
| 243 | + public void onSaveClick(EditRoleDialog dialog, String selectSid, String selectRole, String selectRoleName) { | |
| 244 | + if (!TextUtils.isEmpty(selectSid) && !TextUtils.isEmpty(selectRole) && !TextUtils.isEmpty(currentSelectFamilyId)) { | |
| 245 | + fragment.getPresenter().changeMemberRole(getContext(), selectSid, familyRoleListBean.getFamily_id(), selectRole, new UserManagerPresenter.OnResposeListener() { | |
| 246 | + @Override | |
| 247 | + public void onSuccess() { | |
| 248 | + dialog.dismiss(); | |
| 249 | + if (!TextUtils.isEmpty(selectRole) && !TextUtils.isEmpty(selectRoleName)) { | |
| 250 | + familyRoleListBean.setId(Integer.parseInt(selectRole)); | |
| 251 | + familyRoleListBean.setRoleName(selectRoleName); | |
| 252 | + if (null != adapter) { | |
| 253 | + adapter.notifyDataSetChanged(); | |
| 254 | + } | |
| 255 | + } | |
| 256 | + } | |
| 257 | + }); | |
| 258 | + } else { | |
| 259 | + AlertUtil.showDeftToast(getContext(), "设置失败,请稍后重试"); | |
| 260 | + dialog.dismiss(); | |
| 261 | + } | |
| 196 | 262 | } |
| 197 | 263 | }); |
| 198 | 264 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/ApiServiceXiaoJia.java
| 1 | 1 | package com.cnlive.strike.xiaojiaspeaker.netWork; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.DeviceDetail; | |
| 4 | 5 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 5 | 6 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean; |
| 6 | 7 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.NetworkResultBean; |
| 7 | 8 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| 8 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 9 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 9 | 10 | |
| 10 | 11 | import java.util.Map; |
| 11 | 12 | |
| 12 | 13 | import io.reactivex.Observable; |
| 13 | 14 | import retrofit2.adapter.rxjava2.Result; |
| 15 | +import retrofit2.http.GET; | |
| 14 | 16 | import retrofit2.http.POST; |
| 15 | 17 | import retrofit2.http.QueryMap; |
| 16 | 18 | |
| ... | ... | @@ -19,7 +21,7 @@ import retrofit2.http.QueryMap; |
| 19 | 21 | */ |
| 20 | 22 | public interface ApiServiceXiaoJia { |
| 21 | 23 | @POST("Daren/sound/getSetRoleList.action") |
| 22 | - Observable<Result<SubscriptionBaseInfo<RoleNetBean>>> getSetRoleList(@QueryMap() Map<String, String> maps); | |
| 24 | + Observable<Result<APIBaseInfo<RoleNetBean>>> getSetRoleList(@QueryMap() Map<String, String> maps); | |
| 23 | 25 | |
| 24 | 26 | /** |
| 25 | 27 | * 获取家庭id |
| ... | ... | @@ -30,7 +32,7 @@ public interface ApiServiceXiaoJia { |
| 30 | 32 | * @return |
| 31 | 33 | */ |
| 32 | 34 | @POST("Daren/sound/getFamilyList.action") |
| 33 | - Observable<Result<SubscriptionBaseInfo<FamilyListBean>>> getFamilyList(@QueryMap() Map<String, String> maps); | |
| 35 | + Observable<Result<APIBaseInfo<FamilyListBean>>> getFamilyList(@QueryMap() Map<String, String> maps); | |
| 34 | 36 | |
| 35 | 37 | |
| 36 | 38 | /** |
| ... | ... | @@ -42,7 +44,7 @@ public interface ApiServiceXiaoJia { |
| 42 | 44 | * @return |
| 43 | 45 | */ |
| 44 | 46 | @POST("/Daren/sound/getNetworkResult.action") |
| 45 | - Observable<Result<SubscriptionBaseInfo<NetworkResultBean>>> getNetworkResult(@QueryMap() Map<String, String> maps); | |
| 47 | + Observable<Result<APIBaseInfo<NetworkResultBean>>> getNetworkResult(@QueryMap() Map<String, String> maps); | |
| 46 | 48 | |
| 47 | 49 | |
| 48 | 50 | /** |
| ... | ... | @@ -54,8 +56,39 @@ public interface ApiServiceXiaoJia { |
| 54 | 56 | * @return |
| 55 | 57 | */ |
| 56 | 58 | @POST("/Daren/sound/getFamilyRole.action") |
| 57 | - Observable<Result<SubscriptionBaseInfo<FamilyRoleBean>>> getFamilyRole(@QueryMap() Map<String, String> maps); | |
| 59 | + Observable<Result<APIBaseInfo<FamilyRoleBean>>> getFamilyRole(@QueryMap() Map<String, String> maps); | |
| 58 | 60 | |
| 61 | + /** | |
| 62 | + * 修改或移出家庭成员身份 | |
| 63 | + * sid Integer true 修改身份sid | |
| 64 | + * familyId String true 家庭id | |
| 65 | + * role Integer false 修改身份id | |
| 66 | + * | |
| 67 | + * @param maps | |
| 68 | + * @return | |
| 69 | + */ | |
| 70 | + @POST("/Daren/sound/updateFamilyMemberRole.action") | |
| 71 | + Observable<Result<APIBaseInfo>> changeMemberRole(@QueryMap() Map<String, String> maps); | |
| 59 | 72 | |
| 73 | + /** | |
| 74 | + * 获取设备详情信息 | |
| 75 | + * devIdStringtrue设备id | |
| 76 | + * | |
| 77 | + * @param maps | |
| 78 | + * @return | |
| 79 | + */ | |
| 80 | + @GET("/Daren/sound/getDeviceDetailMsg.action") | |
| 81 | + Observable<Result<APIBaseInfo<DeviceDetail>>> getDeviceDetailMsg(@QueryMap() Map<String, String> maps); | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 修改音箱名称 | |
| 85 | + * devId String true 设备id | |
| 86 | + * newName String true 新设备名称 | |
| 87 | + * | |
| 88 | + * @param maps | |
| 89 | + * @return | |
| 90 | + */ | |
| 91 | + @POST("/Daren/sound/updateDeviceName.action") | |
| 92 | + Observable<Result<APIBaseInfo>> changeDeviceName(@QueryMap() Map<String, String> maps); | |
| 60 | 93 | } |
| 61 | 94 | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/SubscriptionBaseInfo.java renamed to module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/APIBaseInfo.java
| ... | ... | @@ -5,7 +5,7 @@ import com.cnlive.libs.data.network.model.IBaseInfo; |
| 5 | 5 | /** |
| 6 | 6 | * Created by Lynn on 2019/3/27. |
| 7 | 7 | */ |
| 8 | -public class SubscriptionBaseInfo<T> implements IBaseInfo { | |
| 8 | +public class APIBaseInfo<T> implements IBaseInfo { | |
| 9 | 9 | private String errorCode = "0"; |
| 10 | 10 | private String errorMessage = ""; |
| 11 | 11 | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/DeviceDetail.java
0 → 100644
| 1 | +package com.cnlive.strike.xiaojiaspeaker.netWork.bean; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 设备详情页面 | |
| 5 | + */ | |
| 6 | +public class DeviceDetail { | |
| 7 | + | |
| 8 | + /** | |
| 9 | + * deviceName : 布丁 | |
| 10 | + * iP : | |
| 11 | + * mAC : | |
| 12 | + * sN : 400011F000000002 | |
| 13 | + * updateVer : | |
| 14 | + * ver : XiaoJiaSmartSpeaker_1.0.1.20190926 | |
| 15 | + * wifiName : | |
| 16 | + */ | |
| 17 | + | |
| 18 | + private String deviceName; | |
| 19 | + private String iP; | |
| 20 | + private String mAC; | |
| 21 | + private String sN; | |
| 22 | + private String updateVer; | |
| 23 | + private String ver; | |
| 24 | + private String wifiName; | |
| 25 | + | |
| 26 | + public String getDeviceName() { | |
| 27 | + return deviceName; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setDeviceName(String deviceName) { | |
| 31 | + this.deviceName = deviceName; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getIP() { | |
| 35 | + return iP; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setIP(String iP) { | |
| 39 | + this.iP = iP; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public String getMAC() { | |
| 43 | + return mAC; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setMAC(String mAC) { | |
| 47 | + this.mAC = mAC; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public String getSN() { | |
| 51 | + return sN; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setSN(String sN) { | |
| 55 | + this.sN = sN; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public String getUpdateVer() { | |
| 59 | + return updateVer; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setUpdateVer(String updateVer) { | |
| 63 | + this.updateVer = updateVer; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getVer() { | |
| 67 | + return ver; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setVer(String ver) { | |
| 71 | + this.ver = ver; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public String getWifiName() { | |
| 75 | + return wifiName; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setWifiName(String wifiName) { | |
| 79 | + this.wifiName = wifiName; | |
| 80 | + } | |
| 81 | +} | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/bean/FamilyListBean.java
| ... | ... | @@ -162,6 +162,15 @@ public class FamilyListBean implements Serializable { |
| 162 | 162 | private boolean power; |
| 163 | 163 | private boolean isdefense; |
| 164 | 164 | private String mcid; |
| 165 | + private int parentPosition; | |
| 166 | + | |
| 167 | + public int getParentPosition() { | |
| 168 | + return parentPosition; | |
| 169 | + } | |
| 170 | + | |
| 171 | + public void setParentPosition(int parentPosition) { | |
| 172 | + this.parentPosition = parentPosition; | |
| 173 | + } | |
| 165 | 174 | |
| 166 | 175 | public DetailBean getDetail() { |
| 167 | 176 | return detail; |
| ... | ... | @@ -315,7 +324,7 @@ public class FamilyListBean implements Serializable { |
| 315 | 324 | this.mcid = mcid; |
| 316 | 325 | } |
| 317 | 326 | |
| 318 | - public static class DetailBean implements Serializable { | |
| 327 | + public static class DetailBean implements Serializable { | |
| 319 | 328 | /** |
| 320 | 329 | * insurance : -1 |
| 321 | 330 | * users : [{"inrange":false,"manager":true,"headimg":"","name":"135****4805","userid":"12:3f2e8e64833ebee51a49a0d0000616d2"}] | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/netWork/result/SubscriptionRequest.java
| ... | ... | @@ -9,7 +9,7 @@ import com.cnlive.libs.data.network.Subscriber; |
| 9 | 9 | import com.cnlive.libs.data.network.interceptor.NetPPEncryptInterceptor; |
| 10 | 10 | import com.cnlive.libs.data.network.interceptor.NetPPPayEncryptInterceptor; |
| 11 | 11 | import com.cnlive.libs.data.network.interceptor.SignEncryptInterceptor; |
| 12 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.SubscriptionBaseInfo; | |
| 12 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.APIBaseInfo; | |
| 13 | 13 | |
| 14 | 14 | import io.reactivex.android.schedulers.AndroidSchedulers; |
| 15 | 15 | import io.reactivex.disposables.Disposable; |
| ... | ... | @@ -22,7 +22,7 @@ import static com.cnlive.libs.base.logic.Config.SUCCESS; |
| 22 | 22 | /** |
| 23 | 23 | * Created by Lynn on 2019/3/27. |
| 24 | 24 | */ |
| 25 | -public class SubscriptionRequest<Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends SubscriptionBaseInfo> { | |
| 25 | +public class SubscriptionRequest<Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends APIBaseInfo> { | |
| 26 | 26 | private static final String SP_CMS_URL_DEBUT = "http://cmstest.cnlive.com:8768/"; |
| 27 | 27 | private static final String SP_CMS_URL = "http://cms.cnlive.com:8768/"; |
| 28 | 28 | |
| ... | ... | @@ -51,22 +51,22 @@ public class SubscriptionRequest<Observable extends io.reactivex.Observable<Resu |
| 51 | 51 | return baseEndpoint(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends SubscriptionBaseInfo> | |
| 54 | + public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends APIBaseInfo> | |
| 55 | 55 | SubscriptionRequest<Observable, BaseData> service(Class<Service> clazz, ApiBuild.Api<Service, Observable, BaseData> api) { |
| 56 | 56 | return service(clazz, api, new SignEncryptInterceptor()); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends SubscriptionBaseInfo> | |
| 59 | + public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends APIBaseInfo> | |
| 60 | 60 | SubscriptionRequest<Observable, BaseData> serviceEncrypt(Class<Service> clazz, ApiBuild.Api<Service, Observable, BaseData> api) { |
| 61 | 61 | return service(clazz, api, new NetPPEncryptInterceptor()); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends SubscriptionBaseInfo> | |
| 64 | + public static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends APIBaseInfo> | |
| 65 | 65 | SubscriptionRequest<Observable, BaseData> servicePayEncrypt(Class<Service> clazz, ApiBuild.Api<Service, Observable, BaseData> api) { |
| 66 | 66 | return service(clazz, api, new NetPPPayEncryptInterceptor()); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - private static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends SubscriptionBaseInfo> | |
| 69 | + private static <Service, Observable extends io.reactivex.Observable<Result<BaseData>>, BaseData extends APIBaseInfo> | |
| 70 | 70 | SubscriptionRequest<Observable, BaseData> service(Class<Service> clazz, ApiBuild.Api<Service, Observable, BaseData> api, Interceptor... interceptor) { |
| 71 | 71 | |
| 72 | 72 | SubscriptionRequest<Observable, BaseData> request = new SubscriptionRequest<Observable, BaseData>(); | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/ChangeDeviceNameActivity.java
| ... | ... | @@ -15,6 +15,8 @@ import com.cnlive.libs.base.util.StatusBarUtil2; |
| 15 | 15 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 16 | 16 | import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityChangeDeviceNameBinding; |
| 17 | 17 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; |
| 18 | +import com.cnlive.strike.xiaojiaspeaker.ui.fragment.ChangeDeviceNameFragment; | |
| 19 | +import com.cnlive.strike.xiaojiaspeaker.ui.fragment.DeviceManagerFragment; | |
| 18 | 20 | |
| 19 | 21 | import java.io.Serializable; |
| 20 | 22 | |
| ... | ... | @@ -28,56 +30,8 @@ public class ChangeDeviceNameActivity extends AppCompatActivity { |
| 28 | 30 | protected void onCreate(Bundle savedInstanceState) { |
| 29 | 31 | super.onCreate(savedInstanceState); |
| 30 | 32 | 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) { | |
| 33 | + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, ChangeDeviceNameFragment.newInstance()).commitAllowingStateLoss(); | |
| 56 | 34 | |
| 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 | 35 | } |
| 82 | 36 | |
| 83 | 37 | public static void startActivity(Activity activity) { |
| ... | ... | @@ -85,23 +39,5 @@ public class ChangeDeviceNameActivity extends AppCompatActivity { |
| 85 | 39 | activity.startActivity(intent); |
| 86 | 40 | } |
| 87 | 41 | |
| 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 | 42 | |
| 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 | 43 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/DeviceDetailActivity.java
| ... | ... | @@ -6,6 +6,7 @@ import android.databinding.DataBindingUtil; |
| 6 | 6 | import android.support.v4.content.ContextCompat; |
| 7 | 7 | import android.support.v7.app.AppCompatActivity; |
| 8 | 8 | import android.os.Bundle; |
| 9 | +import android.text.TextUtils; | |
| 9 | 10 | import android.view.View; |
| 10 | 11 | |
| 11 | 12 | import com.cnlive.libs.base.util.StatusBarUtil; |
| ... | ... | @@ -33,23 +34,29 @@ public class DeviceDetailActivity extends AppCompatActivity { |
| 33 | 34 | initTopBar(allDeviceInfo.getName()); |
| 34 | 35 | } |
| 35 | 36 | } |
| 36 | - initView(); | |
| 37 | - | |
| 37 | + if (null != getIntent().getExtras()) { | |
| 38 | + String currentSelectFamilyId = getIntent().getExtras().getString("currentSelectFamilyId"); | |
| 39 | + if (!TextUtils.isEmpty(currentSelectFamilyId)) { | |
| 40 | + initView(currentSelectFamilyId); | |
| 41 | + } | |
| 42 | + } | |
| 38 | 43 | } |
| 39 | 44 | |
| 40 | - private void initView() { | |
| 45 | + private void initView(String currentSelectFamilyId) { | |
| 41 | 46 | //使用者管理 |
| 42 | 47 | binding.rlUserManager.setOnClickListener(new View.OnClickListener() { |
| 43 | 48 | @Override |
| 44 | 49 | public void onClick(View view) { |
| 45 | - UserManagerActivity.StartActivity(DeviceDetailActivity.this); | |
| 50 | + if (!TextUtils.isEmpty(currentSelectFamilyId)) { | |
| 51 | + UserManagerActivity.StartActivity(DeviceDetailActivity.this, currentSelectFamilyId); | |
| 52 | + } | |
| 46 | 53 | } |
| 47 | 54 | }); |
| 48 | 55 | //设备管理 |
| 49 | 56 | binding.rlDeviceManager.setOnClickListener(new View.OnClickListener() { |
| 50 | 57 | @Override |
| 51 | 58 | public void onClick(View view) { |
| 52 | - DeviceManagerActivity.startActivity(DeviceDetailActivity.this); | |
| 59 | + DeviceManagerActivity.startActivity(DeviceDetailActivity.this,allDeviceInfo); | |
| 53 | 60 | } |
| 54 | 61 | }); |
| 55 | 62 | //设备说明 |
| ... | ... | @@ -76,9 +83,10 @@ public class DeviceDetailActivity extends AppCompatActivity { |
| 76 | 83 | } |
| 77 | 84 | } |
| 78 | 85 | |
| 79 | - public static void startActivity(Activity activity, FamilyListBean.UsersBeanX.DeviceListBean allDeviceInfo) { | |
| 86 | + public static void startActivity(Activity activity, FamilyListBean.UsersBeanX.DeviceListBean allDeviceInfo, String currentSelectFamilyId) { | |
| 80 | 87 | Intent intent = new Intent(activity, DeviceDetailActivity.class); |
| 81 | 88 | intent.putExtra("allDeviceInfo", (Serializable) allDeviceInfo); |
| 89 | + intent.putExtra("currentSelectFamilyId", currentSelectFamilyId); | |
| 82 | 90 | activity.startActivity(intent); |
| 83 | 91 | } |
| 84 | 92 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/DeviceManagerActivity.java
| ... | ... | @@ -6,12 +6,14 @@ import android.databinding.DataBindingUtil; |
| 6 | 6 | import android.support.v4.content.ContextCompat; |
| 7 | 7 | import android.support.v7.app.AppCompatActivity; |
| 8 | 8 | import android.os.Bundle; |
| 9 | +import android.text.TextUtils; | |
| 9 | 10 | import android.view.View; |
| 10 | 11 | |
| 11 | 12 | import com.cnlive.libs.base.util.StatusBarUtil; |
| 12 | 13 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 13 | 14 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 14 | 15 | import com.cnlive.strike.xiaojiaspeaker.databinding.ActivityDeviceManagerBinding; |
| 16 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | |
| 15 | 17 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.DeviceManagerFragment; |
| 16 | 18 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.SelectWifiFragment; |
| 17 | 19 | |
| ... | ... | @@ -27,58 +29,65 @@ public class DeviceManagerActivity extends AppCompatActivity { |
| 27 | 29 | protected void onCreate(Bundle savedInstanceState) { |
| 28 | 30 | super.onCreate(savedInstanceState); |
| 29 | 31 | binding = DataBindingUtil.setContentView(this, R.layout.activity_device_manager); |
| 30 | -// getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, DeviceManagerFragment.newInstance()).commitAllowingStateLoss(); | |
| 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); | |
| 32 | + if (null!=getIntent().getExtras()){ | |
| 33 | + FamilyListBean.UsersBeanX.DeviceListBean currentDeviceInfo= (FamilyListBean.UsersBeanX.DeviceListBean) getIntent().getExtras().getSerializable("currentDeviceInfo"); | |
| 34 | + if (null!=currentDeviceInfo){ | |
| 35 | + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, DeviceManagerFragment.newInstance(currentDeviceInfo)).commitAllowingStateLoss(); | |
| 62 | 36 | } |
| 63 | - }); | |
| 64 | - } | |
| 65 | - | |
| 66 | - private void initTopBar() { | |
| 67 | - StatusBarUtil.setStatusBarWrite(this); | |
| 68 | - StatusBarUtil2.setColor(this, ContextCompat.getColor(this, R.color.white), 0); | |
| 69 | - if (null != binding) { | |
| 70 | - binding.topbar.setTitle("设备管理"); | |
| 71 | - //设置返回按钮 | |
| 72 | - binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() { | |
| 73 | - @Override | |
| 74 | - public void onClick(View view) { | |
| 75 | - finish(); | |
| 76 | - } | |
| 77 | - }); | |
| 78 | 37 | } |
| 38 | +// initTopBar(); | |
| 39 | +// initView(); | |
| 79 | 40 | } |
| 80 | 41 | |
| 81 | - public static void startActivity(Activity activity) { | |
| 82 | - activity.startActivity(new Intent(activity, DeviceManagerActivity.class)); | |
| 42 | +// private void initView() { | |
| 43 | +// //音箱名称 | |
| 44 | +// binding.llDeviceName.setOnClickListener(new View.OnClickListener() { | |
| 45 | +// @Override | |
| 46 | +// public void onClick(View view) { | |
| 47 | +// ChangeDeviceNameActivity.startActivity(DeviceManagerActivity.this); | |
| 48 | +// } | |
| 49 | +// }); | |
| 50 | +// //wifi设置 | |
| 51 | +// binding.llWifiSetting.setOnClickListener(new View.OnClickListener() { | |
| 52 | +// @Override | |
| 53 | +// public void onClick(View view) { | |
| 54 | +// | |
| 55 | +// } | |
| 56 | +// }); | |
| 57 | +// //设备信息 | |
| 58 | +// binding.llDeviceInfo.setOnClickListener(new View.OnClickListener() { | |
| 59 | +// @Override | |
| 60 | +// public void onClick(View view) { | |
| 61 | +// | |
| 62 | +// } | |
| 63 | +// }); | |
| 64 | +// //固件升级 | |
| 65 | +// binding.llDeviceUpdate.setOnClickListener(new View.OnClickListener() { | |
| 66 | +// @Override | |
| 67 | +// public void onClick(View view) { | |
| 68 | +// FirmwareUpdateActivity.startActivity(DeviceManagerActivity.this); | |
| 69 | +// } | |
| 70 | +// }); | |
| 71 | +// } | |
| 72 | +// | |
| 73 | +// private void initTopBar() { | |
| 74 | +// StatusBarUtil.setStatusBarWrite(this); | |
| 75 | +// StatusBarUtil2.setColor(this, ContextCompat.getColor(this, R.color.white), 0); | |
| 76 | +// if (null != binding) { | |
| 77 | +// binding.topbar.setTitle("设备管理"); | |
| 78 | +// //设置返回按钮 | |
| 79 | +// binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() { | |
| 80 | +// @Override | |
| 81 | +// public void onClick(View view) { | |
| 82 | +// finish(); | |
| 83 | +// } | |
| 84 | +// }); | |
| 85 | +// } | |
| 86 | +// } | |
| 87 | + | |
| 88 | + public static void startActivity(Activity activity, FamilyListBean.UsersBeanX.DeviceListBean currentDeviceInfo) { | |
| 89 | + Intent intent=new Intent(activity, DeviceManagerActivity.class); | |
| 90 | + intent.putExtra("currentDeviceInfo",currentDeviceInfo); | |
| 91 | + activity.startActivity(intent); | |
| 83 | 92 | } |
| 84 | 93 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/activity/UserManagerActivity.java
| ... | ... | @@ -4,6 +4,7 @@ import android.app.Activity; |
| 4 | 4 | import android.content.Intent; |
| 5 | 5 | import android.support.v7.app.AppCompatActivity; |
| 6 | 6 | import android.os.Bundle; |
| 7 | +import android.text.TextUtils; | |
| 7 | 8 | |
| 8 | 9 | import com.clj.fastble.data.BleDevice; |
| 9 | 10 | import com.cnlive.strike.xiaojiaspeaker.R; |
| ... | ... | @@ -16,12 +17,17 @@ public class UserManagerActivity extends AppCompatActivity { |
| 16 | 17 | protected void onCreate(Bundle savedInstanceState) { |
| 17 | 18 | super.onCreate(savedInstanceState); |
| 18 | 19 | setContentView(R.layout.activity_user_manager); |
| 19 | - getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, UserManagerFragment.newInstance()).commitAllowingStateLoss(); | |
| 20 | - | |
| 20 | + if (null != getIntent().getExtras()) { | |
| 21 | + String currentSelectFamilyId = getIntent().getExtras().getString("currentSelectFamilyId"); | |
| 22 | + if (!TextUtils.isEmpty(currentSelectFamilyId)) { | |
| 23 | + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, UserManagerFragment.newInstance(currentSelectFamilyId)).commitAllowingStateLoss(); | |
| 24 | + } | |
| 25 | + } | |
| 21 | 26 | } |
| 22 | 27 | |
| 23 | - public static void StartActivity(Activity activity) { | |
| 28 | + public static void StartActivity(Activity activity, String currentSelectFamilyId) { | |
| 24 | 29 | Intent intent = new Intent(activity, UserManagerActivity.class); |
| 30 | + intent.putExtra("currentSelectFamilyId", currentSelectFamilyId); | |
| 25 | 31 | activity.startActivity(intent); |
| 26 | 32 | } |
| 27 | 33 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/adapter/AllRoleDetailAdapter.java
| ... | ... | @@ -29,6 +29,11 @@ public class AllRoleDetailAdapter extends RecyclerView.Adapter { |
| 29 | 29 | private Map<String, Boolean> allowSelectMap; |
| 30 | 30 | private String TAG = "AllRoleDetailAdapter"; |
| 31 | 31 | private OnAllRoleClickListener onAllRoleClickListener; |
| 32 | + private OnDialogRoleClickListener onDialogRoleClickListener; | |
| 33 | + | |
| 34 | + public void setOnDialogRoleClickListener(OnDialogRoleClickListener onDialogRoleClickListener) { | |
| 35 | + this.onDialogRoleClickListener = onDialogRoleClickListener; | |
| 36 | + } | |
| 32 | 37 | |
| 33 | 38 | public void setOnAllRoleClickListener(OnAllRoleClickListener onAllRoleClickListener) { |
| 34 | 39 | this.onAllRoleClickListener = onAllRoleClickListener; |
| ... | ... | @@ -118,9 +123,12 @@ public class AllRoleDetailAdapter extends RecyclerView.Adapter { |
| 118 | 123 | binding.checkBox.toggle(); |
| 119 | 124 | //开始设置全局状态 |
| 120 | 125 | if (binding.checkBox.isChecked()) { |
| 121 | - if (null!=onAllRoleClickListener){ | |
| 126 | + if (null != onAllRoleClickListener) { | |
| 122 | 127 | onAllRoleClickListener.onSelect(allRoleList.get(position).getId()); |
| 123 | 128 | } |
| 129 | + if (null != onDialogRoleClickListener) { | |
| 130 | + onDialogRoleClickListener.onSelect(allRoleList.get(position)); | |
| 131 | + } | |
| 124 | 132 | //添加到选中的集合 |
| 125 | 133 | if (!selectId.equals(currentRoleId)) { |
| 126 | 134 | //重置状态 |
| ... | ... | @@ -128,9 +136,12 @@ public class AllRoleDetailAdapter extends RecyclerView.Adapter { |
| 128 | 136 | setRoleAdapter.getRoleInfoList().get(allRoleList.get(position).getParentPosition()).setSelectId(currentRoleId); |
| 129 | 137 | } |
| 130 | 138 | } else { |
| 131 | - if (null!=onAllRoleClickListener){ | |
| 139 | + if (null != onAllRoleClickListener) { | |
| 132 | 140 | onAllRoleClickListener.onCancel(); |
| 133 | 141 | } |
| 142 | + if (null != onDialogRoleClickListener) { | |
| 143 | + onDialogRoleClickListener.onCancel(); | |
| 144 | + } | |
| 134 | 145 | setRoleAdapter.getRoleInfoList().get(allRoleList.get(position).getParentPosition()).setSelectId(""); |
| 135 | 146 | } |
| 136 | 147 | //设置全局不允许选择 |
| ... | ... | @@ -145,4 +156,10 @@ public class AllRoleDetailAdapter extends RecyclerView.Adapter { |
| 145 | 156 | |
| 146 | 157 | void onSelect(int roleId); |
| 147 | 158 | } |
| 159 | + | |
| 160 | + public interface OnDialogRoleClickListener { | |
| 161 | + void onCancel(); | |
| 162 | + | |
| 163 | + void onSelect(RoleNetBean.RoleListBean bean); | |
| 164 | + } | |
| 148 | 165 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/adapter/SetRoleAdapter.java
| ... | ... | @@ -13,6 +13,7 @@ import com.cnlive.strike.application.GlideApp; |
| 13 | 13 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 14 | 14 | import com.cnlive.strike.xiaojiaspeaker.databinding.ItemListSetRoleBinding; |
| 15 | 15 | import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo; |
| 16 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; | |
| 16 | 17 | |
| 17 | 18 | import java.util.ArrayList; |
| 18 | 19 | import java.util.HashMap; |
| ... | ... | @@ -28,6 +29,11 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 28 | 29 | private int gridCount = -1; |
| 29 | 30 | private int isShowItemUserInfo = View.VISIBLE; |
| 30 | 31 | private OnSelectListener onSelectListener; |
| 32 | + private OnDialogRoleClickListener onDialogRoleClickListener; | |
| 33 | + | |
| 34 | + public void setOnDialogRoleClickListener(OnDialogRoleClickListener onDialogRoleClickListener) { | |
| 35 | + this.onDialogRoleClickListener = onDialogRoleClickListener; | |
| 36 | + } | |
| 31 | 37 | |
| 32 | 38 | public void setOnSelectListener(OnSelectListener onSelectListener) { |
| 33 | 39 | this.onSelectListener = onSelectListener; |
| ... | ... | @@ -95,18 +101,34 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 95 | 101 | adapter.setOnAllRoleClickListener(new AllRoleDetailAdapter.OnAllRoleClickListener() { |
| 96 | 102 | @Override |
| 97 | 103 | public void onCancel() { |
| 98 | - if (null!=onSelectListener){ | |
| 104 | + if (null != onSelectListener) { | |
| 99 | 105 | onSelectListener.onCancel(); |
| 100 | 106 | } |
| 101 | 107 | } |
| 102 | 108 | |
| 103 | 109 | @Override |
| 104 | 110 | public void onSelect(int roleId) { |
| 105 | - if (null!=onSelectListener){ | |
| 111 | + if (null != onSelectListener) { | |
| 106 | 112 | onSelectListener.onSelect(roleId); |
| 107 | 113 | } |
| 108 | 114 | } |
| 109 | 115 | }); |
| 116 | + //对话框 | |
| 117 | + adapter.setOnDialogRoleClickListener(new AllRoleDetailAdapter.OnDialogRoleClickListener() { | |
| 118 | + @Override | |
| 119 | + public void onCancel() { | |
| 120 | + if (null!=onDialogRoleClickListener){ | |
| 121 | + onDialogRoleClickListener.onCancel(); | |
| 122 | + } | |
| 123 | + } | |
| 124 | + | |
| 125 | + @Override | |
| 126 | + public void onSelect(RoleNetBean.RoleListBean bean) { | |
| 127 | + if (null!=onDialogRoleClickListener){ | |
| 128 | + onDialogRoleClickListener.onSelect(bean); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + }); | |
| 110 | 132 | } |
| 111 | 133 | |
| 112 | 134 | @Override |
| ... | ... | @@ -133,4 +155,10 @@ public class SetRoleAdapter extends RecyclerView.Adapter { |
| 133 | 155 | |
| 134 | 156 | void onCancel(); |
| 135 | 157 | } |
| 158 | + | |
| 159 | + public interface OnDialogRoleClickListener { | |
| 160 | + void onCancel(); | |
| 161 | + | |
| 162 | + void onSelect(RoleNetBean.RoleListBean bean); | |
| 163 | + } | |
| 136 | 164 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/AllDeviceFragment.java
| ... | ... | @@ -11,9 +11,11 @@ import com.cnlive.libs.base.util.StatusBarUtil; |
| 11 | 11 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 12 | 12 | import com.cnlive.strike.ui.widget.UIPopup; |
| 13 | 13 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | |
| 14 | 15 | import com.cnlive.strike.xiaojiaspeaker.databinding.FragmentAllDeviceBinding; |
| 15 | 16 | import com.cnlive.strike.xiaojiaspeaker.frame.presenter.AllDeviceFragmentPresenter; |
| 16 | 17 | import com.cnlive.strike.xiaojiaspeaker.frame.view.AllDeviceFragmentView; |
| 18 | +import com.cnlive.strike.xiaojiaspeaker.ui.activity.BlueToothStep1Activity; | |
| 17 | 19 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenuInfo; |
| 18 | 20 | import com.cnlive.strike.xiaojiaspeaker.ui.widget.popmenu.PopMenu; |
| 19 | 21 | import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton; |
| ... | ... | @@ -47,7 +49,7 @@ public class AllDeviceFragment extends MvpBindingFragment<AllDeviceFragmentView, |
| 47 | 49 | initTopBar(); |
| 48 | 50 | if (null != getMvpView()) { |
| 49 | 51 | getMvpView().initView(); |
| 50 | - getPresenter().getFamilyList(getActivity(),"123456","13585544805"); | |
| 52 | + getPresenter().getFamilyList(getActivity(), XiaoJIaCommInfo.getUserId(getActivity()), XiaoJIaCommInfo.getUserPhone(getActivity())); | |
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | |
| ... | ... | @@ -68,8 +70,10 @@ public class AllDeviceFragment extends MvpBindingFragment<AllDeviceFragmentView, |
| 68 | 70 | addButton.setOnClickListener(new View.OnClickListener() { |
| 69 | 71 | @Override |
| 70 | 72 | public void onClick(View view) { |
| 71 | - if (null!=getMvpView()){ | |
| 72 | - getMvpView().showPop(addButton); | |
| 73 | + if (null != getMvpView()) { | |
| 74 | +// getMvpView().showPop(addButton); | |
| 75 | + BlueToothStep1Activity.startActivity(getActivity()); | |
| 76 | + | |
| 73 | 77 | } |
| 74 | 78 | } |
| 75 | 79 | }); | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/ChangeDeviceNameFragment.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 | + | |
| 8 | +import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; | |
| 9 | +import com.cnlive.libs.base.util.StatusBarUtil; | |
| 10 | +import com.cnlive.libs.base.util.StatusBarUtil2; | |
| 11 | +import com.cnlive.strike.xiaojiaspeaker.R; | |
| 12 | +import com.cnlive.strike.xiaojiaspeaker.databinding.FragmentChangeDeviceNameBinding; | |
| 13 | +import com.cnlive.strike.xiaojiaspeaker.frame.presenter.ChangeDeviceNamePresenter; | |
| 14 | +import com.cnlive.strike.xiaojiaspeaker.frame.view.ChangeDeviceNameView; | |
| 15 | + | |
| 16 | +public class ChangeDeviceNameFragment extends MvpBindingFragment<ChangeDeviceNameView, ChangeDeviceNamePresenter, Object, FragmentChangeDeviceNameBinding> { | |
| 17 | + public static ChangeDeviceNameFragment newInstance() { | |
| 18 | + ChangeDeviceNameFragment fragment = new ChangeDeviceNameFragment(); | |
| 19 | + return fragment; | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + protected int getLayoutId() { | |
| 24 | + return R.layout.fragment_change_device_name; | |
| 25 | + } | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + public void onActivityCreated(@Nullable Bundle savedInstanceState) { | |
| 29 | + super.onActivityCreated(savedInstanceState); | |
| 30 | + | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | |
| 35 | + super.onViewCreated(view, savedInstanceState); | |
| 36 | + initTopBar(); | |
| 37 | + if (null != getMvpView()) { | |
| 38 | + getMvpView().initView(); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + | |
| 42 | + private void initTopBar() { | |
| 43 | + StatusBarUtil.setStatusBarWrite(getActivity()); | |
| 44 | + StatusBarUtil2.setColor(getActivity(), ContextCompat.getColor(getActivity(), R.color.white), 0); | |
| 45 | + if (null != binding) { | |
| 46 | + binding.topbar.setTitle("更改音箱名称"); | |
| 47 | + //设置返回按钮 | |
| 48 | + binding.topbar.addLeftImageButton(R.drawable.icon_back, R.id.left_back).setOnClickListener(new View.OnClickListener() { | |
| 49 | + @Override | |
| 50 | + public void onClick(View view) { | |
| 51 | + getActivity().finish(); | |
| 52 | + } | |
| 53 | + }); | |
| 54 | + } | |
| 55 | + } | |
| 56 | +} | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/DeviceManagerFragment.java
| ... | ... | @@ -3,6 +3,7 @@ package com.cnlive.strike.xiaojiaspeaker.ui.fragment; |
| 3 | 3 | import android.os.Bundle; |
| 4 | 4 | import android.support.annotation.Nullable; |
| 5 | 5 | import android.support.v4.content.ContextCompat; |
| 6 | +import android.text.TextUtils; | |
| 6 | 7 | import android.view.View; |
| 7 | 8 | |
| 8 | 9 | import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| ... | ... | @@ -12,6 +13,7 @@ import com.cnlive.strike.xiaojiaspeaker.R; |
| 12 | 13 | import com.cnlive.strike.xiaojiaspeaker.databinding.FragmentDeviceManagerBinding; |
| 13 | 14 | import com.cnlive.strike.xiaojiaspeaker.frame.presenter.DeviceManagerFragmentPresenter; |
| 14 | 15 | import com.cnlive.strike.xiaojiaspeaker.frame.view.DeviceManagerFragmentView; |
| 16 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyListBean; | |
| 15 | 17 | |
| 16 | 18 | /** |
| 17 | 19 | * 设备管理 |
| ... | ... | @@ -19,8 +21,12 @@ import com.cnlive.strike.xiaojiaspeaker.frame.view.DeviceManagerFragmentView; |
| 19 | 21 | * @author ys |
| 20 | 22 | */ |
| 21 | 23 | public class DeviceManagerFragment extends MvpBindingFragment<DeviceManagerFragmentView, DeviceManagerFragmentPresenter, Object, FragmentDeviceManagerBinding> { |
| 22 | - public static DeviceManagerFragment newInstance() { | |
| 24 | + | |
| 25 | + public static DeviceManagerFragment newInstance(FamilyListBean.UsersBeanX.DeviceListBean currentDeviceInfo) { | |
| 23 | 26 | DeviceManagerFragment fragment = new DeviceManagerFragment(); |
| 27 | + Bundle bundle=new Bundle(); | |
| 28 | + bundle.putSerializable("currentDeviceInfo",currentDeviceInfo); | |
| 29 | + fragment.setArguments(bundle); | |
| 24 | 30 | return fragment; |
| 25 | 31 | } |
| 26 | 32 | |
| ... | ... | @@ -41,7 +47,13 @@ public class DeviceManagerFragment extends MvpBindingFragment<DeviceManagerFragm |
| 41 | 47 | super.onViewCreated(view, savedInstanceState); |
| 42 | 48 | initTopBar(); |
| 43 | 49 | if (null != getMvpView()) { |
| 44 | - getMvpView().initView(); | |
| 50 | + if (null!=getArguments()){ | |
| 51 | + FamilyListBean.UsersBeanX.DeviceListBean currentDeviceInfo= (FamilyListBean.UsersBeanX.DeviceListBean) getArguments().getSerializable("currentDeviceInfo"); | |
| 52 | + if (null!=currentDeviceInfo&&!TextUtils.isEmpty(currentDeviceInfo.getMcid())){ | |
| 53 | + getMvpView().initView(currentDeviceInfo); | |
| 54 | + getPresenter().getDeviceDetailMsg(getActivity(),currentDeviceInfo.getMcid()); | |
| 55 | + } | |
| 56 | + } | |
| 45 | 57 | } |
| 46 | 58 | } |
| 47 | 59 | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/UserManagerFragment.java
| ... | ... | @@ -10,6 +10,7 @@ import com.cnlive.libs.base.frame.fragment.MvpBindingFragment; |
| 10 | 10 | import com.cnlive.libs.base.util.StatusBarUtil; |
| 11 | 11 | import com.cnlive.libs.base.util.StatusBarUtil2; |
| 12 | 12 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 13 | +import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | |
| 13 | 14 | import com.cnlive.strike.xiaojiaspeaker.databinding.FragmentUserManagerBinding; |
| 14 | 15 | import com.cnlive.strike.xiaojiaspeaker.frame.presenter.UserManagerPresenter; |
| 15 | 16 | import com.cnlive.strike.xiaojiaspeaker.frame.view.UserManagerView; |
| ... | ... | @@ -18,10 +19,13 @@ import com.cnlive.strike.xiaojiaspeaker.frame.view.UserManagerView; |
| 18 | 19 | * 使用者管理 |
| 19 | 20 | */ |
| 20 | 21 | public class UserManagerFragment extends MvpBindingFragment<UserManagerView, UserManagerPresenter, Object, FragmentUserManagerBinding> { |
| 21 | - private Button btn_invit; | |
| 22 | 22 | |
| 23 | - public static UserManagerFragment newInstance() { | |
| 23 | + | |
| 24 | + public static UserManagerFragment newInstance(String currentSelectFamilyId) { | |
| 24 | 25 | UserManagerFragment fragment = new UserManagerFragment(); |
| 26 | + Bundle bundle = new Bundle(); | |
| 27 | + bundle.putString("currentSelectFamilyId", currentSelectFamilyId); | |
| 28 | + fragment.setArguments(bundle); | |
| 25 | 29 | return fragment; |
| 26 | 30 | } |
| 27 | 31 | |
| ... | ... | @@ -41,11 +45,18 @@ public class UserManagerFragment extends MvpBindingFragment<UserManagerView, Use |
| 41 | 45 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 42 | 46 | super.onViewCreated(view, savedInstanceState); |
| 43 | 47 | initTopBar(); |
| 44 | -// getPresenter().getFamilyRole(getActivity(), "123456", XiaoJIaCommInfo.getFamilyId(getActivity())); | |
| 45 | - if (null != getMvpView()) { | |
| 46 | - getMvpView().initPopView(); | |
| 47 | - getMvpView().initView(null); | |
| 48 | + if (null != getArguments()) { | |
| 49 | + String currentSelectFamilyId = getArguments().getString("currentSelectFamilyId"); | |
| 50 | + if (null != getMvpView()) { | |
| 51 | + if (null != currentSelectFamilyId) { | |
| 52 | + getMvpView().setCurrentSelectFamily(currentSelectFamilyId); | |
| 53 | + } | |
| 54 | + getMvpView().initPopView(); | |
| 55 | +// getMvpView().initView(null); | |
| 56 | + } | |
| 48 | 57 | } |
| 58 | + getPresenter().getFamilyRole(getActivity(), XiaoJIaCommInfo.getUserId(getActivity()), XiaoJIaCommInfo.getFamilyId(getActivity()), XiaoJIaCommInfo.getUserPhone(getActivity())); | |
| 59 | + | |
| 49 | 60 | } |
| 50 | 61 | |
| 51 | 62 | private void initTopBar() { |
| ... | ... | @@ -60,18 +71,7 @@ public class UserManagerFragment extends MvpBindingFragment<UserManagerView, Use |
| 60 | 71 | } |
| 61 | 72 | } |
| 62 | 73 | }); |
| 63 | - //添加邀请者按钮 | |
| 64 | - btn_invit = binding.topbar.addRightTextButton("邀请使用者", R.id.rightBtn); | |
| 65 | - btn_invit.setTextSize(15); | |
| 66 | - btn_invit.setTextColor(ContextCompat.getColor(getContext(),R.color.color_282828)); | |
| 67 | - btn_invit.setOnClickListener(new View.OnClickListener() { | |
| 68 | - @Override | |
| 69 | - public void onClick(View view) { | |
| 70 | - if (null != getMvpView()) { | |
| 71 | - getMvpView().showPop(btn_invit); | |
| 72 | - } | |
| 73 | - } | |
| 74 | - }); | |
| 74 | + | |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } | ... | ... |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/widget/EditRoleDialog.java
| ... | ... | @@ -19,6 +19,7 @@ import com.cnlive.strike.application.GlideApp; |
| 19 | 19 | import com.cnlive.strike.xiaojiaspeaker.R; |
| 20 | 20 | import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo; |
| 21 | 21 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean; |
| 22 | +import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; | |
| 22 | 23 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.SetRoleAdapter; |
| 23 | 24 | |
| 24 | 25 | import java.util.List; |
| ... | ... | @@ -45,11 +46,17 @@ public class EditRoleDialog extends Dialog { |
| 45 | 46 | private List<RoleInfo> roleInfoList; |
| 46 | 47 | private SetRoleAdapter setRoleAdapter; |
| 47 | 48 | private OnClickListener onClickListener; |
| 48 | - | |
| 49 | + private String selectRole; | |
| 50 | + private String selectSid; | |
| 51 | + private String selectRoleName; | |
| 49 | 52 | public void setOnClickListener(OnClickListener onClickListener) { |
| 50 | 53 | this.onClickListener = onClickListener; |
| 51 | 54 | } |
| 52 | 55 | |
| 56 | + public SetRoleAdapter getSetRoleAdapter() { | |
| 57 | + return setRoleAdapter; | |
| 58 | + } | |
| 59 | + | |
| 53 | 60 | public void setData(List<RoleInfo> roleInfoList, FamilyRoleBean.FamilyRoleListBean bean) { |
| 54 | 61 | setRoleAdapter = new SetRoleAdapter(context, roleInfoList); |
| 55 | 62 | setRoleAdapter.setGridCount(3); |
| ... | ... | @@ -58,6 +65,19 @@ public class EditRoleDialog extends Dialog { |
| 58 | 65 | rv_role.setAdapter(setRoleAdapter); |
| 59 | 66 | GlideApp.with(context).load(bean.getUserMsg().getImage()).placeholder(R.drawable.xiaojia_touxiang).into(iv_icon); |
| 60 | 67 | tv_user_name.setText(bean.getUserMsg().getNickName()); |
| 68 | + setRoleAdapter.setOnDialogRoleClickListener(new SetRoleAdapter.OnDialogRoleClickListener() { | |
| 69 | + @Override | |
| 70 | + public void onCancel() { | |
| 71 | + | |
| 72 | + } | |
| 73 | + | |
| 74 | + @Override | |
| 75 | + public void onSelect(RoleNetBean.RoleListBean bean) { | |
| 76 | + selectSid = roleInfoList.get(bean.getParentPosition()).getUid(); | |
| 77 | + selectRole = bean.getId() + ""; | |
| 78 | + selectRoleName=bean.getRoleName(); | |
| 79 | + } | |
| 80 | + }); | |
| 61 | 81 | } |
| 62 | 82 | |
| 63 | 83 | public EditRoleDialog(@NonNull Context context) { |
| ... | ... | @@ -93,7 +113,7 @@ public class EditRoleDialog extends Dialog { |
| 93 | 113 | btn_cancel.setOnClickListener(new View.OnClickListener() { |
| 94 | 114 | @Override |
| 95 | 115 | public void onClick(View view) { |
| 96 | - if (null!=onClickListener){ | |
| 116 | + if (null != onClickListener) { | |
| 97 | 117 | onClickListener.onCancelClick(EditRoleDialog.this); |
| 98 | 118 | } |
| 99 | 119 | } |
| ... | ... | @@ -101,8 +121,8 @@ public class EditRoleDialog extends Dialog { |
| 101 | 121 | btn_ok.setOnClickListener(new View.OnClickListener() { |
| 102 | 122 | @Override |
| 103 | 123 | public void onClick(View view) { |
| 104 | - if (null!=onClickListener){ | |
| 105 | - onClickListener.onSaveClick(EditRoleDialog.this); | |
| 124 | + if (null != onClickListener && null != setRoleAdapter) { | |
| 125 | + onClickListener.onSaveClick(EditRoleDialog.this, selectSid, selectRole,selectRoleName); | |
| 106 | 126 | } |
| 107 | 127 | } |
| 108 | 128 | }); |
| ... | ... | @@ -111,7 +131,7 @@ public class EditRoleDialog extends Dialog { |
| 111 | 131 | public interface OnClickListener { |
| 112 | 132 | void onCancelClick(EditRoleDialog dialog); |
| 113 | 133 | |
| 114 | - void onSaveClick(EditRoleDialog dialog); | |
| 134 | + void onSaveClick(EditRoleDialog dialog,String selectSid, String selectRole, String selectRoleName); | |
| 115 | 135 | |
| 116 | 136 | } |
| 117 | 137 | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/activity_change_device_name.xml
| ... | ... | @@ -3,85 +3,16 @@ |
| 3 | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | 4 | xmlns:tools="http://schemas.android.com/tools"> |
| 5 | 5 | |
| 6 | - <LinearLayout | |
| 6 | + <RelativeLayout | |
| 7 | 7 | android:layout_width="match_parent" |
| 8 | 8 | android:layout_height="match_parent" |
| 9 | 9 | android:orientation="vertical" |
| 10 | - tools:context=".ui.activity.ChangeDeviceNameActivity"> | |
| 10 | + tools:context=".ui.activity.AllDeviceActivity"> | |
| 11 | 11 | |
| 12 | - <com.qmuiteam.qmui.widget.QMUITopBar | |
| 13 | - android:id="@+id/topbar" | |
| 12 | + <RelativeLayout | |
| 13 | + android:id="@+id/fragment_container" | |
| 14 | 14 | android:layout_width="match_parent" |
| 15 | - android:layout_height="?attr/qmui_topbar_height" | |
| 16 | - android:background="@color/white" /> | |
| 15 | + android:layout_height="match_parent"></RelativeLayout> | |
| 17 | 16 | |
| 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_xiaojia_btn_gray" | |
| 81 | - android:clickable="false" | |
| 82 | - android:text="保存" | |
| 83 | - android:textColor="@color/white" | |
| 84 | - android:textSize="16sp" | |
| 85 | - android:textStyle="bold" /> | |
| 86 | - </LinearLayout> | |
| 17 | + </RelativeLayout> | |
| 87 | 18 | </layout> |
| 88 | 19 | \ 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" | |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - xmlns:tools="http://schemas.android.com/tools" | |
| 7 | - android:layout_width="match_parent" | |
| 8 | - android:layout_height="match_parent" | |
| 9 | - android:background="@color/color_F2F2F2" | |
| 10 | - android:orientation="vertical" | |
| 11 | - tools:context=".ui.activity.SearchDeviceActivity"> | |
| 12 | - | |
| 13 | - <com.qmuiteam.qmui.widget.QMUITopBar | |
| 14 | - android:id="@+id/topbar" | |
| 4 | +<!-- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"--> | |
| 5 | +<!-- xmlns:app="http://schemas.android.com/apk/res-auto"--> | |
| 6 | +<!-- xmlns:tools="http://schemas.android.com/tools"--> | |
| 7 | +<!-- android:layout_width="match_parent"--> | |
| 8 | +<!-- android:layout_height="match_parent"--> | |
| 9 | +<!-- android:background="@color/color_F2F2F2"--> | |
| 10 | +<!-- android:orientation="vertical"--> | |
| 11 | +<!-- tools:context=".ui.activity.SearchDeviceActivity">--> | |
| 12 | + | |
| 13 | +<!-- <com.qmuiteam.qmui.widget.QMUITopBar--> | |
| 14 | +<!-- android:id="@+id/topbar"--> | |
| 15 | +<!-- android:layout_width="match_parent"--> | |
| 16 | +<!-- android:layout_height="?attr/qmui_topbar_height" />--> | |
| 17 | + | |
| 18 | +<!-- <ScrollView--> | |
| 19 | +<!-- android:layout_width="match_parent"--> | |
| 20 | +<!-- android:layout_height="wrap_content"--> | |
| 21 | +<!-- android:layout_below="@id/topbar">--> | |
| 22 | + | |
| 23 | +<!-- <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">--> | |
| 36 | + | |
| 37 | +<!-- <LinearLayout--> | |
| 38 | +<!-- android:layout_width="wrap_content"--> | |
| 39 | +<!-- android:layout_height="match_parent"--> | |
| 40 | +<!-- android:gravity="center|left">--> | |
| 41 | + | |
| 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>--> | |
| 54 | + | |
| 55 | +<!-- <LinearLayout--> | |
| 56 | +<!-- android:layout_width="0dp"--> | |
| 57 | +<!-- android:layout_height="match_parent"--> | |
| 58 | +<!-- android:layout_weight="1"--> | |
| 59 | +<!-- android:gravity="center|right">--> | |
| 60 | + | |
| 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" />--> | |
| 74 | + | |
| 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" />--> | |
| 81 | + | |
| 82 | +<!-- </LinearLayout>--> | |
| 83 | + | |
| 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">--> | |
| 94 | + | |
| 95 | +<!-- <LinearLayout--> | |
| 96 | +<!-- android:layout_width="wrap_content"--> | |
| 97 | +<!-- android:layout_height="match_parent"--> | |
| 98 | +<!-- android:gravity="center|left">--> | |
| 99 | + | |
| 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>--> | |
| 112 | + | |
| 113 | +<!-- <LinearLayout--> | |
| 114 | +<!-- android:layout_width="0dp"--> | |
| 115 | +<!-- android:layout_height="match_parent"--> | |
| 116 | +<!-- android:layout_weight="1"--> | |
| 117 | +<!-- android:gravity="center|right">--> | |
| 118 | + | |
| 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" />--> | |
| 132 | + | |
| 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" />--> | |
| 138 | + | |
| 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>--> | |
| 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>--> | |
| 256 | +<!-- </LinearLayout>--> | |
| 257 | +<!-- </ScrollView>--> | |
| 258 | + | |
| 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" />--> | |
| 269 | +<!-- <!– <RelativeLayout–>--> | |
| 270 | +<!-- <!– android:id="@+id/fragment_container"–>--> | |
| 271 | +<!-- <!– android:layout_width="match_parent"–>--> | |
| 272 | +<!-- <!– android:layout_height="match_parent"></RelativeLayout>–>--> | |
| 273 | +<!-- </RelativeLayout>--> | |
| 274 | + <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 275 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 276 | + xmlns:tools="http://schemas.android.com/tools" | |
| 15 | 277 | android:layout_width="match_parent" |
| 16 | - android:layout_height="?attr/qmui_topbar_height" /> | |
| 278 | + android:layout_height="match_parent" | |
| 279 | + android:orientation="vertical" | |
| 280 | + tools:context=".ui.activity.AllDeviceActivity"> | |
| 17 | 281 | |
| 18 | - <ScrollView | |
| 19 | - android:layout_width="match_parent" | |
| 20 | - android:layout_height="wrap_content" | |
| 21 | - android:layout_below="@id/topbar"> | |
| 22 | - | |
| 23 | - <LinearLayout | |
| 282 | + <RelativeLayout | |
| 283 | + android:id="@+id/fragment_container" | |
| 24 | 284 | 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"> | |
| 36 | - | |
| 37 | - <LinearLayout | |
| 38 | - android:layout_width="wrap_content" | |
| 39 | - android:layout_height="match_parent" | |
| 40 | - android:gravity="center|left"> | |
| 41 | - | |
| 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> | |
| 54 | - | |
| 55 | - <LinearLayout | |
| 56 | - android:layout_width="0dp" | |
| 57 | - android:layout_height="match_parent" | |
| 58 | - android:layout_weight="1" | |
| 59 | - android:gravity="center|right"> | |
| 60 | - | |
| 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" /> | |
| 74 | - | |
| 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" /> | |
| 81 | - | |
| 82 | - </LinearLayout> | |
| 83 | - | |
| 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"> | |
| 94 | - | |
| 95 | - <LinearLayout | |
| 96 | - android:layout_width="wrap_content" | |
| 97 | - android:layout_height="match_parent" | |
| 98 | - android:gravity="center|left"> | |
| 99 | - | |
| 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> | |
| 112 | - | |
| 113 | - <LinearLayout | |
| 114 | - android:layout_width="0dp" | |
| 115 | - android:layout_height="match_parent" | |
| 116 | - android:layout_weight="1" | |
| 117 | - android:gravity="center|right"> | |
| 118 | - | |
| 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" /> | |
| 132 | - | |
| 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" /> | |
| 138 | - | |
| 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> | |
| 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> | |
| 256 | - </LinearLayout> | |
| 257 | - </ScrollView> | |
| 258 | - | |
| 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" /> | |
| 269 | - <!-- <RelativeLayout--> | |
| 270 | - <!-- android:id="@+id/fragment_container"--> | |
| 271 | - <!-- android:layout_width="match_parent"--> | |
| 272 | - <!-- android:layout_height="match_parent"></RelativeLayout>--> | |
| 273 | - </RelativeLayout> | |
| 285 | + android:layout_height="match_parent"></RelativeLayout> | |
| 286 | + | |
| 287 | + </RelativeLayout> | |
| 274 | 288 | </layout> |
| 275 | 289 | \ No newline at end of file | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_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_xiaojia_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/fragment_device_manager.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | - xmlns:app="http://schemas.android.com/apk/res-auto"> | |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 4 | + xmlns:tools="http://schemas.android.com/tools"> | |
| 4 | 5 | |
| 5 | 6 | <LinearLayout |
| 6 | 7 | android:layout_width="match_parent" |
| 7 | 8 | android:layout_height="match_parent" |
| 8 | - android:background="@color/color_F2F2F2" | |
| 9 | 9 | android:orientation="vertical"> |
| 10 | 10 | |
| 11 | 11 | <com.qmuiteam.qmui.widget.QMUITopBar |
| 12 | 12 | android:id="@+id/topbar" |
| 13 | 13 | android:layout_width="match_parent" |
| 14 | 14 | android:layout_height="?attr/qmui_topbar_height" /> |
| 15 | + <!-- <LinearLayout--> | |
| 16 | + <!-- android:layout_width="match_parent"--> | |
| 17 | + <!-- android:layout_height="match_parent"--> | |
| 18 | + <!-- android:background="@color/color_F2F2F2"--> | |
| 19 | + <!-- android:orientation="vertical">--> | |
| 15 | 20 | |
| 16 | - <android.support.v7.widget.RecyclerView | |
| 17 | - android:id="@+id/rv_menu" | |
| 18 | - android:layout_width="match_parent" | |
| 19 | - android:layout_height="0dp" | |
| 20 | - android:layout_weight="1" | |
| 21 | - android:overScrollMode="never" /> | |
| 21 | + <!-- <com.qmuiteam.qmui.widget.QMUITopBar--> | |
| 22 | + <!-- android:id="@+id/topbar"--> | |
| 23 | + <!-- android:layout_width="match_parent"--> | |
| 24 | + <!-- android:layout_height="?attr/qmui_topbar_height" />--> | |
| 22 | 25 | |
| 23 | - <View | |
| 24 | - android:layout_width="match_parent" | |
| 25 | - android:layout_height="1dp" | |
| 26 | - android:background="@color/line_15" /> | |
| 26 | + <!-- <android.support.v7.widget.RecyclerView--> | |
| 27 | + <!-- android:id="@+id/rv_menu"--> | |
| 28 | + <!-- android:layout_width="match_parent"--> | |
| 29 | + <!-- android:layout_height="0dp"--> | |
| 30 | + <!-- android:layout_weight="1"--> | |
| 31 | + <!-- android:overScrollMode="never" />--> | |
| 32 | + | |
| 33 | + <!-- <View--> | |
| 34 | + <!-- android:layout_width="match_parent"--> | |
| 35 | + <!-- android:layout_height="1dp"--> | |
| 36 | + <!-- android:background="@color/line_15" />--> | |
| 37 | + | |
| 38 | + <!-- <TextView--> | |
| 39 | + <!-- android:layout_width="match_parent"--> | |
| 40 | + <!-- android:layout_height="60dp"--> | |
| 41 | + <!-- android:background="@drawable/selectable_item_white"--> | |
| 42 | + <!-- android:gravity="center"--> | |
| 43 | + <!-- android:text="删除设备"--> | |
| 44 | + <!-- android:clickable="true"--> | |
| 45 | + <!-- android:textColor="@color/color_EB3D3F"--> | |
| 46 | + <!-- android:textSize="15sp" />--> | |
| 47 | + | |
| 48 | + <!-- </LinearLayout>--> | |
| 27 | 49 | |
| 28 | - <TextView | |
| 50 | + <FrameLayout | |
| 29 | 51 | android:layout_width="match_parent" |
| 30 | - android:layout_height="60dp" | |
| 31 | - android:background="@drawable/selectable_item_white" | |
| 32 | - android:gravity="center" | |
| 33 | - android:text="删除设备" | |
| 34 | - android:clickable="true" | |
| 35 | - android:textColor="@color/color_EB3D3F" | |
| 36 | - android:textSize="15sp" /> | |
| 52 | + android:layout_height="match_parent"> | |
| 53 | + | |
| 54 | + <RelativeLayout | |
| 55 | + android:layout_width="match_parent" | |
| 56 | + android:layout_height="match_parent" | |
| 57 | + android:background="@color/color_F2F2F2" | |
| 58 | + android:orientation="vertical" | |
| 59 | + tools:context=".ui.activity.SearchDeviceActivity"> | |
| 60 | + | |
| 61 | + | |
| 62 | + <ScrollView | |
| 63 | + android:layout_width="match_parent" | |
| 64 | + android:layout_height="wrap_content"> | |
| 65 | + | |
| 66 | + <LinearLayout | |
| 67 | + android:layout_width="match_parent" | |
| 68 | + android:layout_height="wrap_content" | |
| 69 | + android:orientation="vertical"> | |
| 70 | + <!--音箱名称--> | |
| 71 | + <LinearLayout | |
| 72 | + android:id="@+id/ll_device_name" | |
| 73 | + android:layout_width="match_parent" | |
| 74 | + android:layout_height="50dp" | |
| 75 | + android:layout_marginTop="10dp" | |
| 76 | + android:layout_marginBottom="10dp" | |
| 77 | + android:background="@drawable/selectable_item_white" | |
| 78 | + android:clickable="true"> | |
| 79 | + | |
| 80 | + <LinearLayout | |
| 81 | + android:layout_width="wrap_content" | |
| 82 | + android:layout_height="match_parent" | |
| 83 | + android:gravity="center|left"> | |
| 84 | + | |
| 85 | + <TextView | |
| 86 | + android:id="@+id/tv_menu_title" | |
| 87 | + android:layout_width="wrap_content" | |
| 88 | + android:layout_height="wrap_content" | |
| 89 | + android:layout_centerVertical="true" | |
| 90 | + android:layout_marginLeft="10dp" | |
| 91 | + android:layout_marginRight="10dp" | |
| 92 | + android:maxLines="1" | |
| 93 | + android:text="音箱名称" | |
| 94 | + android:textColor="@color/color_282828" | |
| 95 | + android:textSize="16sp" /> | |
| 96 | + </LinearLayout> | |
| 97 | + | |
| 98 | + <LinearLayout | |
| 99 | + android:layout_width="0dp" | |
| 100 | + android:layout_height="match_parent" | |
| 101 | + android:layout_weight="1" | |
| 102 | + android:gravity="center|right"> | |
| 103 | + | |
| 104 | + <TextView | |
| 105 | + android:id="@+id/tv_device_name" | |
| 106 | + android:layout_width="wrap_content" | |
| 107 | + android:layout_height="wrap_content" | |
| 108 | + android:layout_centerVertical="true" | |
| 109 | + android:layout_marginLeft="10dp" | |
| 110 | + android:layout_marginRight="10dp" | |
| 111 | + android:layout_toEndOf="@id/iv_right" | |
| 112 | + android:layout_toRightOf="@id/tv_menu_title" | |
| 113 | + android:gravity="center|right" | |
| 114 | + android:maxLines="1" | |
| 115 | + android:textColor="@color/color_C3C3C3" | |
| 116 | + android:textSize="14sp" /> | |
| 117 | + | |
| 118 | + <ImageView | |
| 119 | + android:id="@+id/iv_right" | |
| 120 | + android:layout_width="7dp" | |
| 121 | + android:layout_height="13dp" | |
| 122 | + android:layout_marginRight="10dp" | |
| 123 | + android:background="@drawable/icon_item_right_arrow" /> | |
| 124 | + | |
| 125 | + </LinearLayout> | |
| 126 | + | |
| 127 | + </LinearLayout> | |
| 128 | + <!-- WIFI设置--> | |
| 129 | + <LinearLayout | |
| 130 | + android:id="@+id/ll_wifi_setting" | |
| 131 | + android:layout_width="match_parent" | |
| 132 | + android:layout_height="50dp" | |
| 133 | + android:layout_marginTop="10dp" | |
| 134 | + android:layout_marginBottom="10dp" | |
| 135 | + android:background="@drawable/selectable_item_white" | |
| 136 | + android:clickable="true"> | |
| 137 | + | |
| 138 | + <LinearLayout | |
| 139 | + android:layout_width="wrap_content" | |
| 140 | + android:layout_height="match_parent" | |
| 141 | + android:gravity="center|left"> | |
| 142 | + | |
| 143 | + <TextView | |
| 144 | + android:layout_width="wrap_content" | |
| 145 | + android:layout_height="wrap_content" | |
| 146 | + android:layout_centerVertical="true" | |
| 147 | + android:layout_marginLeft="10dp" | |
| 148 | + android:layout_marginRight="10dp" | |
| 149 | + android:maxLines="1" | |
| 150 | + android:text="WIFI设置" | |
| 151 | + android:textColor="@color/color_282828" | |
| 152 | + android:textSize="16sp" /> | |
| 153 | + </LinearLayout> | |
| 154 | + | |
| 155 | + <LinearLayout | |
| 156 | + android:layout_width="0dp" | |
| 157 | + android:layout_height="match_parent" | |
| 158 | + android:layout_weight="1" | |
| 159 | + android:gravity="center|right"> | |
| 160 | + | |
| 161 | + <TextView | |
| 162 | + android:id="@+id/tv_wifi_name" | |
| 163 | + android:layout_width="wrap_content" | |
| 164 | + android:layout_height="wrap_content" | |
| 165 | + android:layout_centerVertical="true" | |
| 166 | + android:layout_marginLeft="10dp" | |
| 167 | + android:layout_marginRight="10dp" | |
| 168 | + android:layout_toEndOf="@id/iv_right" | |
| 169 | + android:layout_toRightOf="@id/tv_menu_title" | |
| 170 | + android:gravity="center|right" | |
| 171 | + android:maxLines="1" | |
| 172 | + android:textColor="@color/color_C3C3C3" | |
| 173 | + android:textSize="14sp" /> | |
| 174 | + | |
| 175 | + <ImageView | |
| 176 | + android:layout_width="7dp" | |
| 177 | + android:layout_height="13dp" | |
| 178 | + android:layout_marginRight="10dp" | |
| 179 | + android:background="@drawable/icon_item_right_arrow" /> | |
| 180 | + | |
| 181 | + </LinearLayout> | |
| 182 | + | |
| 183 | + </LinearLayout> | |
| 184 | + <!-- 设备信息--> | |
| 185 | + <LinearLayout | |
| 186 | + android:id="@+id/ll_device_info" | |
| 187 | + android:layout_width="match_parent" | |
| 188 | + android:layout_height="50dp" | |
| 189 | + android:layout_marginTop="10dp" | |
| 190 | + android:layout_marginBottom="10dp" | |
| 191 | + android:background="@drawable/selectable_item_white" | |
| 192 | + android:clickable="true"> | |
| 193 | + | |
| 194 | + <LinearLayout | |
| 195 | + android:layout_width="wrap_content" | |
| 196 | + android:layout_height="match_parent" | |
| 197 | + android:gravity="center|left"> | |
| 198 | + | |
| 199 | + <TextView | |
| 200 | + android:id="@+id/tv_device_info" | |
| 201 | + android:layout_width="wrap_content" | |
| 202 | + android:layout_height="wrap_content" | |
| 203 | + android:layout_centerVertical="true" | |
| 204 | + android:layout_marginLeft="10dp" | |
| 205 | + android:layout_marginRight="10dp" | |
| 206 | + android:maxLines="1" | |
| 207 | + android:text="设备信息" | |
| 208 | + android:textColor="@color/color_282828" | |
| 209 | + android:textSize="16sp" /> | |
| 210 | + </LinearLayout> | |
| 211 | + | |
| 212 | + <LinearLayout | |
| 213 | + android:layout_width="0dp" | |
| 214 | + android:layout_height="match_parent" | |
| 215 | + android:layout_weight="1" | |
| 216 | + android:gravity="center|right"> | |
| 217 | + | |
| 218 | + <TextView | |
| 219 | + android:id="@+id/tv_device_info_detail" | |
| 220 | + android:layout_width="wrap_content" | |
| 221 | + android:layout_height="wrap_content" | |
| 222 | + android:layout_centerVertical="true" | |
| 223 | + android:layout_marginLeft="10dp" | |
| 224 | + android:layout_marginRight="10dp" | |
| 225 | + android:layout_toEndOf="@id/iv_right" | |
| 226 | + android:layout_toRightOf="@id/tv_menu_title" | |
| 227 | + android:gravity="center|right" | |
| 228 | + android:maxLines="1" | |
| 229 | + android:textColor="@color/color_C3C3C3" | |
| 230 | + android:textSize="14sp" /> | |
| 231 | + | |
| 232 | + <ImageView | |
| 233 | + android:layout_width="7dp" | |
| 234 | + android:layout_height="13dp" | |
| 235 | + android:layout_marginRight="10dp" | |
| 236 | + android:background="@drawable/icon_item_right_arrow" /> | |
| 237 | + | |
| 238 | + </LinearLayout> | |
| 239 | + | |
| 240 | + </LinearLayout> | |
| 241 | + <!-- 固件升级--> | |
| 242 | + <LinearLayout | |
| 243 | + android:id="@+id/ll_device_update" | |
| 244 | + android:layout_width="match_parent" | |
| 245 | + android:layout_height="50dp" | |
| 246 | + android:layout_marginTop="10dp" | |
| 247 | + android:layout_marginBottom="10dp" | |
| 248 | + android:background="@drawable/selectable_item_white" | |
| 249 | + android:clickable="true"> | |
| 250 | + | |
| 251 | + <LinearLayout | |
| 252 | + android:layout_width="wrap_content" | |
| 253 | + android:layout_height="match_parent" | |
| 254 | + android:gravity="center|left"> | |
| 255 | + | |
| 256 | + <TextView | |
| 257 | + android:id="@+id/tv_device_update" | |
| 258 | + android:layout_width="wrap_content" | |
| 259 | + android:layout_height="wrap_content" | |
| 260 | + android:layout_centerVertical="true" | |
| 261 | + android:layout_marginLeft="10dp" | |
| 262 | + android:layout_marginRight="10dp" | |
| 263 | + android:maxLines="1" | |
| 264 | + android:text="固件升级" | |
| 265 | + android:textColor="@color/color_282828" | |
| 266 | + android:textSize="16sp" /> | |
| 267 | + </LinearLayout> | |
| 268 | + | |
| 269 | + <LinearLayout | |
| 270 | + android:layout_width="0dp" | |
| 271 | + android:layout_height="match_parent" | |
| 272 | + android:layout_weight="1" | |
| 273 | + android:gravity="center|right"> | |
| 274 | + | |
| 275 | + <TextView | |
| 276 | + android:id="@+id/tv_current_version" | |
| 277 | + android:layout_width="wrap_content" | |
| 278 | + android:layout_height="wrap_content" | |
| 279 | + android:layout_centerVertical="true" | |
| 280 | + android:layout_marginLeft="10dp" | |
| 281 | + android:layout_marginRight="10dp" | |
| 282 | + android:layout_toEndOf="@id/iv_right" | |
| 283 | + android:layout_toRightOf="@id/tv_menu_title" | |
| 284 | + android:gravity="center|right" | |
| 285 | + android:maxLines="1" | |
| 286 | + android:textColor="@color/color_C3C3C3" | |
| 287 | + android:textSize="14sp" /> | |
| 288 | + | |
| 289 | + <ImageView | |
| 290 | + android:layout_width="7dp" | |
| 291 | + android:layout_height="13dp" | |
| 292 | + android:layout_marginRight="10dp" | |
| 293 | + android:background="@drawable/icon_item_right_arrow" /> | |
| 294 | + | |
| 295 | + </LinearLayout> | |
| 296 | + | |
| 297 | + </LinearLayout> | |
| 298 | + </LinearLayout> | |
| 299 | + </ScrollView> | |
| 300 | + | |
| 301 | + <TextView | |
| 302 | + android:layout_width="match_parent" | |
| 303 | + android:layout_height="60dp" | |
| 304 | + android:layout_alignParentBottom="true" | |
| 305 | + android:background="@drawable/selectable_item_white" | |
| 306 | + android:clickable="true" | |
| 307 | + android:gravity="center" | |
| 308 | + android:text="删除设备" | |
| 309 | + android:textColor="@color/color_EB3D3F" | |
| 310 | + android:textSize="15sp" /> | |
| 311 | + <!-- <RelativeLayout--> | |
| 312 | + <!-- android:id="@+id/fragment_container"--> | |
| 313 | + <!-- android:layout_width="match_parent"--> | |
| 314 | + <!-- android:layout_height="match_parent"></RelativeLayout>--> | |
| 315 | + </RelativeLayout> | |
| 316 | + | |
| 317 | + <com.cnlive.strike.ui.widget.UIEmptyView | |
| 318 | + android:id="@+id/empty_layout" | |
| 319 | + android:layout_width="match_parent" | |
| 320 | + android:layout_height="match_parent" | |
| 321 | + android:background="@color/color_fff" | |
| 322 | + android:visibility="gone" /> | |
| 323 | + </FrameLayout> | |
| 37 | 324 | |
| 38 | 325 | </LinearLayout> |
| 39 | 326 | </layout> |
| 40 | 327 | \ No newline at end of file | ... | ... |
module_xiaojiaSoundBox/src/main/res/layout/fragment_user_manager.xml
| ... | ... | @@ -55,10 +55,12 @@ |
| 55 | 55 | android:layout_weight="1" /> |
| 56 | 56 | |
| 57 | 57 | <LinearLayout |
| 58 | + android:id="@+id/ll_btn" | |
| 58 | 59 | android:layout_width="match_parent" |
| 59 | 60 | android:layout_height="wrap_content" |
| 60 | 61 | android:gravity="center" |
| 61 | - android:orientation="vertical"> | |
| 62 | + android:orientation="vertical" | |
| 63 | + android:visibility="gone"> | |
| 62 | 64 | |
| 63 | 65 | <Button |
| 64 | 66 | android:id="@+id/btn_invit_friend" | ... | ... |