Skip to content

Commit

Permalink
Hand raise will honour layout config
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed May 24, 2024
1 parent b9b9b83 commit a32e138
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class HLSHandRaiseMenu extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
if(HMSRoomLayout.isHandRaiseEnabled)
Selector<MeetingStore, bool>(
selector: (_, meetingStore) => meetingStore.isRaisedHand,
builder: (_, isRaisedHand, __) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class Elements {
Map<String, dynamic>? emojiReactions;
OnStageExp? onStageExp;
Map<String, dynamic>? brb;
Map<String, dynamic>? handRaise;

Elements(
{this.header,
Expand All @@ -117,7 +118,8 @@ class Elements {
this.videoTileLayout,
this.emojiReactions,
this.onStageExp,
this.brb});
this.brb,
this.handRaise});

Elements.fromJson(Map<String, dynamic>? json) {
if (json == null) {
Expand All @@ -128,6 +130,7 @@ class Elements {
emojiReactions = null;
onStageExp = null;
brb = null;
handRaise = null;
return;
}

Expand All @@ -146,6 +149,7 @@ class Elements {
? OnStageExp.fromJson(json['on_stage_exp'])
: null;
brb = json.containsKey("brb") ? json["brb"] : null;
handRaise = json.containsKey("hand_raise") ? json["hand_raise"] : null;
}

Map<String, dynamic> toJson() {
Expand Down
7 changes: 7 additions & 0 deletions packages/hms_room_kit/lib/src/layout_api/hms_room_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class HMSRoomLayout {
static Chat? chatData;
static bool isParticipantsListEnabled = true;
static bool isBRBEnabled = true;
static bool isHandRaiseEnabled = true;
static List<String>? offStageRoles = [];
static bool skipPreviewForRole = false;
static bool skipPreview = false;
Expand Down Expand Up @@ -265,6 +266,9 @@ class HMSRoomLayout {
isBRBEnabled =
roleLayoutData?.screens?.conferencing?.defaultConf?.elements?.brb !=
null;
isHandRaiseEnabled =
roleLayoutData?.screens?.conferencing?.defaultConf?.elements?.handRaise !=
null;
offStageRoles = roleLayoutData?.screens?.conferencing?.defaultConf
?.elements?.onStageExp?.offStageRoles;
skipPreviewForRole = roleLayoutData?.screens?.conferencing?.defaultConf
Expand All @@ -279,6 +283,9 @@ class HMSRoomLayout {
isBRBEnabled = roleLayoutData
?.screens?.conferencing?.hlsLiveStreaming?.elements?.brb !=
null;
isHandRaiseEnabled = roleLayoutData
?.screens?.conferencing?.hlsLiveStreaming?.elements?.handRaise !=
null;
offStageRoles = roleLayoutData?.screens?.conferencing?.hlsLiveStreaming
?.elements?.onStageExp?.offStageRoles;
skipPreviewForRole = roleLayoutData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class _AppUtilitiesBottomSheetState extends State<AppUtilitiesBottomSheet> {
meetingStore.isBRB ? "I'm Back" : "Be Right Back"),

///This renders the raise hand option
if(HMSRoomLayout.isHandRaiseEnabled)
MoreOptionItem(
onTap: () async {
context.read<MeetingStore>().toggleLocalPeerHandRaise();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ class _ChatTextUtilityState extends State<ChatTextUtility>
void didChangeMetrics() {
final bool isKeyboardOpen =
(MediaQuery.of(context).viewInsets.bottom).toInt() > 0;
if (Platform.isAndroid) {
showMenu = isKeyboardOpen;
} else {
showMenu = !isKeyboardOpen;
}
showMenu = !isKeyboardOpen;
setState(() {});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/hmssdk_flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 9fb9f6e431a2c6c79942252e94b241ac7972ac90

COCOAPODS: 1.15.2
COCOAPODS: 1.14.3
2 changes: 1 addition & 1 deletion packages/hmssdk_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
mobile_scanner:
app_links:
uuid:
flutter_foreground_task: ^6.1.3
flutter_foreground_task: ^6.2.0

flutter_svg: any
provider: any
Expand Down

0 comments on commit a32e138

Please sign in to comment.