Commit 2999cac74dd7113d5fa96e019525e348b8455813
1 parent
6e7166fc
1 根据产品需求修改UI及逻辑
Showing
6 changed files
with
75 additions
and
32 deletions
config.gradle
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/DeviceManagerFragmentView.java
| @@ -80,10 +80,10 @@ public class DeviceManagerFragmentView implements MvpView { | @@ -80,10 +80,10 @@ public class DeviceManagerFragmentView implements MvpView { | ||
| 80 | 80 | ||
| 81 | if (currentUser.getIsMaster()==FamilyListBean.THE_HOST){ | 81 | if (currentUser.getIsMaster()==FamilyListBean.THE_HOST){ |
| 82 | //显示删除 | 82 | //显示删除 |
| 83 | - fragment.binding.tvDeleteDevice.setVisibility(View.VISIBLE); | 83 | + fragment.binding.llDeleteView.setVisibility(View.VISIBLE); |
| 84 | }else { | 84 | }else { |
| 85 | //隐藏删除 | 85 | //隐藏删除 |
| 86 | - fragment.binding.tvDeleteDevice.setVisibility(View.GONE); | 86 | + fragment.binding.llDeleteView.setVisibility(View.GONE); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | //音箱名称 | 89 | //音箱名称 |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/InvitFriendView.java
| @@ -3,7 +3,7 @@ package com.cnlive.strike.xiaojiaspeaker.frame.view; | @@ -3,7 +3,7 @@ package com.cnlive.strike.xiaojiaspeaker.frame.view; | ||
| 3 | import android.app.Activity; | 3 | import android.app.Activity; |
| 4 | import android.graphics.Bitmap; | 4 | import android.graphics.Bitmap; |
| 5 | import android.graphics.BitmapFactory; | 5 | import android.graphics.BitmapFactory; |
| 6 | -import android.net.Uri; | 6 | +import android.support.v4.content.ContextCompat; |
| 7 | import android.support.v7.widget.LinearLayoutManager; | 7 | import android.support.v7.widget.LinearLayoutManager; |
| 8 | import android.text.TextUtils; | 8 | import android.text.TextUtils; |
| 9 | import android.view.View; | 9 | import android.view.View; |
| @@ -18,13 +18,10 @@ import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | @@ -18,13 +18,10 @@ import com.cnlive.strike.xiaojiaspeaker.commonInfo.XiaoJIaCommInfo; | ||
| 18 | import com.cnlive.strike.xiaojiaspeaker.constants.XiaoJiaConst; | 18 | import com.cnlive.strike.xiaojiaspeaker.constants.XiaoJiaConst; |
| 19 | import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo; | 19 | import com.cnlive.strike.xiaojiaspeaker.model.RoleInfo; |
| 20 | import com.cnlive.strike.xiaojiaspeaker.model.XiaoJiaQrcode; | 20 | import com.cnlive.strike.xiaojiaspeaker.model.XiaoJiaQrcode; |
| 21 | -import com.cnlive.strike.xiaojiaspeaker.netWork.bean.FamilyRoleBean; | ||
| 22 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; | 21 | import com.cnlive.strike.xiaojiaspeaker.netWork.bean.RoleNetBean; |
| 23 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.ShareFriendActivity; | 22 | import com.cnlive.strike.xiaojiaspeaker.ui.activity.ShareFriendActivity; |
| 24 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.SetRoleAdapter; | 23 | import com.cnlive.strike.xiaojiaspeaker.ui.adapter.SetRoleAdapter; |
| 25 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.InvitFriendFragment; | 24 | import com.cnlive.strike.xiaojiaspeaker.ui.fragment.InvitFriendFragment; |
| 26 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.EditRoleDialog; | ||
| 27 | -import com.cnlive.strike.xiaojiaspeaker.ui.widget.SelectDialog; | ||
| 28 | import com.cnlive.strike.xiaojiaspeaker.util.CommonUtils; | 25 | import com.cnlive.strike.xiaojiaspeaker.util.CommonUtils; |
| 29 | import com.cnlive.strike.xiaojiaspeaker.util.DensityUtil; | 26 | import com.cnlive.strike.xiaojiaspeaker.util.DensityUtil; |
| 30 | import com.cnlive.strike.xiaojiaspeaker.util.GsonUtil; | 27 | import com.cnlive.strike.xiaojiaspeaker.util.GsonUtil; |
| @@ -56,8 +53,13 @@ public class InvitFriendView implements MvpView { | @@ -56,8 +53,13 @@ public class InvitFriendView implements MvpView { | ||
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | public void initView() { | 55 | public void initView() { |
| 56 | + setShareCantClick(); | ||
| 59 | this.currentSelectFamilyId = currentSelectFamilyId; | 57 | this.currentSelectFamilyId = currentSelectFamilyId; |
| 60 | fragment.binding.btnShare.setOnClickListener(v -> { | 58 | fragment.binding.btnShare.setOnClickListener(v -> { |
| 59 | + if ("0".equals(fragment.binding.btnShare.getTag().toString())) { | ||
| 60 | + AlertUtil.showDeftToast(getContext(), "请选择角色"); | ||
| 61 | + return; | ||
| 62 | + } | ||
| 61 | if (!TextUtils.isEmpty(encryptionContent)) { | 63 | if (!TextUtils.isEmpty(encryptionContent)) { |
| 62 | ShareFriendActivity.startActivity(fragment.getActivity(), XiaoJIaCommInfo.getUserIcon(getContext()), XiaoJIaCommInfo.getUserNickName(getContext()), encryptionContent); | 64 | ShareFriendActivity.startActivity(fragment.getActivity(), XiaoJIaCommInfo.getUserIcon(getContext()), XiaoJIaCommInfo.getUserNickName(getContext()), encryptionContent); |
| 63 | } else { | 65 | } else { |
| @@ -102,11 +104,13 @@ public class InvitFriendView implements MvpView { | @@ -102,11 +104,13 @@ public class InvitFriendView implements MvpView { | ||
| 102 | public void onSelect(int roleId) { | 104 | public void onSelect(int roleId) { |
| 103 | fragment.binding.llNoQrcode.setVisibility(View.GONE); | 105 | fragment.binding.llNoQrcode.setVisibility(View.GONE); |
| 104 | createQrcode(roleId); | 106 | createQrcode(roleId); |
| 107 | + setShareClick(); | ||
| 105 | } | 108 | } |
| 106 | 109 | ||
| 107 | @Override | 110 | @Override |
| 108 | public void onCancel() { | 111 | public void onCancel() { |
| 109 | fragment.binding.llNoQrcode.setVisibility(View.VISIBLE); | 112 | fragment.binding.llNoQrcode.setVisibility(View.VISIBLE); |
| 113 | + setShareCantClick(); | ||
| 110 | } | 114 | } |
| 111 | }); | 115 | }); |
| 112 | } | 116 | } |
| @@ -191,4 +195,27 @@ public class InvitFriendView implements MvpView { | @@ -191,4 +195,27 @@ public class InvitFriendView implements MvpView { | ||
| 191 | } | 195 | } |
| 192 | fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener); | 196 | fragment.binding.emptyLayout.show(false, titleText, detailText, getContext().getString(R.string.retry), R.drawable.wufalianjie, listener); |
| 193 | } | 197 | } |
| 198 | + | ||
| 199 | + /** | ||
| 200 | + * 设置绑定按钮不可点击 | ||
| 201 | + */ | ||
| 202 | + private void setShareCantClick() { | ||
| 203 | + if (null == getContext()) { | ||
| 204 | + return; | ||
| 205 | + } | ||
| 206 | + fragment.binding.btnShare.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_xiaojia_btn_press)); | ||
| 207 | + fragment.binding.btnShare.setTag("0"); | ||
| 208 | + | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + /** | ||
| 212 | + * 设置绑定按钮可点击 | ||
| 213 | + */ | ||
| 214 | + private void setShareClick() { | ||
| 215 | + if (null == getContext()) { | ||
| 216 | + return; | ||
| 217 | + } | ||
| 218 | + fragment.binding.btnShare.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.selector_xiaojia_btn_green)); | ||
| 219 | + fragment.binding.btnShare.setTag("1"); | ||
| 220 | + } | ||
| 194 | } | 221 | } |
module_xiaojiaSoundBox/src/main/res/layout/activity_blue_tooth_step2.xml
| @@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
| 69 | android:layout_marginTop="20dp" | 69 | android:layout_marginTop="20dp" |
| 70 | android:id="@+id/tv_previous_step" | 70 | android:id="@+id/tv_previous_step" |
| 71 | android:text="@string/previous_step_u" | 71 | android:text="@string/previous_step_u" |
| 72 | - android:textColor="@color/color_999999" | 72 | + android:textColor="@color/color_23D41E" |
| 73 | android:textSize="15sp" /> | 73 | android:textSize="15sp" /> |
| 74 | 74 | ||
| 75 | <LinearLayout | 75 | <LinearLayout |
module_xiaojiaSoundBox/src/main/res/layout/fragment_device_manager.xml
| @@ -47,17 +47,17 @@ | @@ -47,17 +47,17 @@ | ||
| 47 | 47 | ||
| 48 | <!-- </LinearLayout>--> | 48 | <!-- </LinearLayout>--> |
| 49 | 49 | ||
| 50 | - <FrameLayout | 50 | + |
| 51 | + <RelativeLayout | ||
| 51 | android:layout_width="match_parent" | 52 | android:layout_width="match_parent" |
| 52 | - android:layout_height="match_parent"> | 53 | + android:layout_height="match_parent" |
| 54 | + android:background="@color/color_F2F2F2" | ||
| 55 | + android:orientation="vertical" | ||
| 56 | + tools:context=".ui.activity.SearchDeviceActivity"> | ||
| 53 | 57 | ||
| 54 | - <RelativeLayout | 58 | + <FrameLayout |
| 55 | android:layout_width="match_parent" | 59 | 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 | - | 60 | + android:layout_height="match_parent"> |
| 61 | 61 | ||
| 62 | <ScrollView | 62 | <ScrollView |
| 63 | android:layout_width="match_parent" | 63 | android:layout_width="match_parent" |
| @@ -298,30 +298,45 @@ | @@ -298,30 +298,45 @@ | ||
| 298 | </LinearLayout> | 298 | </LinearLayout> |
| 299 | </ScrollView> | 299 | </ScrollView> |
| 300 | 300 | ||
| 301 | + <com.cnlive.strike.ui.widget.UIEmptyView | ||
| 302 | + android:id="@+id/empty_layout" | ||
| 303 | + android:layout_width="match_parent" | ||
| 304 | + android:layout_height="match_parent" | ||
| 305 | + android:background="@color/color_fff" | ||
| 306 | + android:clickable="true" | ||
| 307 | + android:focusable="true" | ||
| 308 | + android:visibility="gone" /> | ||
| 309 | + </FrameLayout> | ||
| 310 | + | ||
| 311 | + <LinearLayout | ||
| 312 | + android:id="@+id/ll_delete_view" | ||
| 313 | + android:layout_width="match_parent" | ||
| 314 | + android:layout_height="wrap_content" | ||
| 315 | + android:layout_alignParentBottom="true" | ||
| 316 | + android:orientation="vertical"> | ||
| 317 | + | ||
| 318 | + <View | ||
| 319 | + android:layout_width="match_parent" | ||
| 320 | + android:layout_height="1dp" | ||
| 321 | + android:background="@color/line" /> | ||
| 322 | + | ||
| 301 | <TextView | 323 | <TextView |
| 302 | android:id="@+id/tv_delete_device" | 324 | android:id="@+id/tv_delete_device" |
| 303 | android:layout_width="match_parent" | 325 | android:layout_width="match_parent" |
| 304 | android:layout_height="60dp" | 326 | android:layout_height="60dp" |
| 305 | - android:layout_alignParentBottom="true" | ||
| 306 | android:background="@drawable/selectable_xiaojia_item_white" | 327 | android:background="@drawable/selectable_xiaojia_item_white" |
| 307 | android:clickable="true" | 328 | android:clickable="true" |
| 308 | android:gravity="center" | 329 | android:gravity="center" |
| 309 | android:text="删除设备" | 330 | android:text="删除设备" |
| 310 | android:textColor="@color/color_EB3D3F" | 331 | android:textColor="@color/color_EB3D3F" |
| 311 | android:textSize="15sp" /> | 332 | android:textSize="15sp" /> |
| 312 | - <!-- <RelativeLayout--> | ||
| 313 | - <!-- android:id="@+id/fragment_container"--> | ||
| 314 | - <!-- android:layout_width="match_parent"--> | ||
| 315 | - <!-- android:layout_height="match_parent"></RelativeLayout>--> | ||
| 316 | - </RelativeLayout> | ||
| 317 | - | ||
| 318 | - <com.cnlive.strike.ui.widget.UIEmptyView | ||
| 319 | - android:id="@+id/empty_layout" | ||
| 320 | - android:layout_width="match_parent" | ||
| 321 | - android:layout_height="match_parent" | ||
| 322 | - android:background="@color/color_fff" | ||
| 323 | - android:visibility="gone" /> | ||
| 324 | - </FrameLayout> | 333 | + </LinearLayout> |
| 334 | + <!-- <RelativeLayout--> | ||
| 335 | + <!-- android:id="@+id/fragment_container"--> | ||
| 336 | + <!-- android:layout_width="match_parent"--> | ||
| 337 | + <!-- android:layout_height="match_parent"></RelativeLayout>--> | ||
| 338 | + </RelativeLayout> | ||
| 339 | + | ||
| 325 | 340 | ||
| 326 | </LinearLayout> | 341 | </LinearLayout> |
| 327 | </layout> | 342 | </layout> |
| 328 | \ No newline at end of file | 343 | \ No newline at end of file |
module_xiaojiaSoundBox/src/main/res/layout/fragment_invit_friend.xml
| @@ -192,10 +192,11 @@ | @@ -192,10 +192,11 @@ | ||
| 192 | android:layout_marginLeft="20dp" | 192 | android:layout_marginLeft="20dp" |
| 193 | android:layout_marginTop="30dp" | 193 | android:layout_marginTop="30dp" |
| 194 | android:layout_marginRight="20dp" | 194 | android:layout_marginRight="20dp" |
| 195 | - android:background="@drawable/selector_xiaojia_btn_green" | ||
| 196 | - android:text="保存并分享给家人" | 195 | + android:background="@drawable/shape_xiaojia_btn_gray" |
| 196 | + android:text="生成二维码海报" | ||
| 197 | android:textColor="@color/white" | 197 | android:textColor="@color/white" |
| 198 | android:textSize="16sp" | 198 | android:textSize="16sp" |
| 199 | + android:tag="0" | ||
| 199 | android:textStyle="bold" /> | 200 | android:textStyle="bold" /> |
| 200 | </LinearLayout> | 201 | </LinearLayout> |
| 201 | </LinearLayout> | 202 | </LinearLayout> |