Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLUT-275: Hand raise will honour layout config #1771

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions packages/hms_room_kit/lib/src/hls_viewer/hls_hand_raise_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,33 @@ class HLSHandRaiseMenu extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Selector<MeetingStore, bool>(
selector: (_, meetingStore) => meetingStore.isRaisedHand,
builder: (_, isRaisedHand, __) {
return HMSEmbeddedButton(
onTap: () => {
context.read<MeetingStore>().toggleLocalPeerHandRaise(),
},
enabledBorderColor: HMSThemeColors.surfaceBrighter,
offColor: HMSThemeColors.surfaceDefault,
disabledBorderColor: HMSThemeColors.surfaceDefault,
onColor: HMSThemeColors.surfaceBrighter,
isActive: isRaisedHand,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset(
isRaisedHand
? "packages/hms_room_kit/lib/src/assets/icons/hand_off.svg"
: "packages/hms_room_kit/lib/src/assets/icons/hand_outline.svg",
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn),
semanticsLabel: "hand_raise_button",
if (HMSRoomLayout.isHandRaiseEnabled)
Selector<MeetingStore, bool>(
selector: (_, meetingStore) => meetingStore.isRaisedHand,
builder: (_, isRaisedHand, __) {
return HMSEmbeddedButton(
onTap: () => {
context.read<MeetingStore>().toggleLocalPeerHandRaise(),
},
enabledBorderColor: HMSThemeColors.surfaceBrighter,
offColor: HMSThemeColors.surfaceDefault,
disabledBorderColor: HMSThemeColors.surfaceDefault,
onColor: HMSThemeColors.surfaceBrighter,
isActive: isRaisedHand,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset(
isRaisedHand
? "packages/hms_room_kit/lib/src/assets/icons/hand_off.svg"
: "packages/hms_room_kit/lib/src/assets/icons/hand_outline.svg",
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
semanticsLabel: "hand_raise_button",
),
),
),
);
}),
);
}),
const SizedBox(
width: 8,
),
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
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,24 +213,24 @@ class _AppUtilitiesBottomSheetState extends State<AppUtilitiesBottomSheet> {
meetingStore.isBRB ? "I'm Back" : "Be Right Back"),

///This renders the raise hand option

MoreOptionItem(
onTap: () async {
context.read<MeetingStore>().toggleLocalPeerHandRaise();
Navigator.pop(context);
},
isActive: meetingStore.isRaisedHand,
optionIcon: SvgPicture.asset(
"packages/hms_room_kit/lib/src/assets/icons/hand_outline.svg",
height: 20,
width: 20,
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
),
optionText: meetingStore.isRaisedHand
? "Lower Hand"
: "Raise Hand"),
if (HMSRoomLayout.isHandRaiseEnabled)
MoreOptionItem(
onTap: () async {
context.read<MeetingStore>().toggleLocalPeerHandRaise();
Navigator.pop(context);
},
isActive: meetingStore.isRaisedHand,
optionIcon: SvgPicture.asset(
"packages/hms_room_kit/lib/src/assets/icons/hand_outline.svg",
height: 20,
width: 20,
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
),
optionText: meetingStore.isRaisedHand
? "Lower Hand"
: "Raise Hand"),

///This renders the polls and quizzes option
if ((meetingStore.localPeer?.role.permissions.pollRead ??
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Future<bool> initForegroundTask() async {
if (isPermissionsGiven) {
FlutterForegroundTask.init(
androidNotificationOptions: AndroidNotificationOptions(
foregroundServiceType: AndroidForegroundServiceType.CAMERA,
channelId: '100ms_flutter_notification',
channelName: '100ms Flutter Notification',
channelDescription:
Expand Down
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
Loading