更新时间:2022-05-10 GMT+08:00
分享

自定义底部菜单栏

自定义菜单主要用于实现会中界面底部菜单栏中菜单项的增减和自定义菜单项

底部菜单分四种场景,需要实现四种自定义方法:

1.CallAudioToolbar:音频点对点通话底部菜单栏自定义音频点对点通话自定义菜单

2.CallVideoToolbar:视频点对点通话底部菜单栏自定义视频点对点通话自定义菜单

3.ConfAudioToolbar:音频会议底部菜单栏自定义音频会议自定义菜单

4.ConfVideoToolbar:视频会议呼叫底部菜单栏自定义视频会议自定义菜单

使用场景

需要调整底部菜单栏中菜单项的应用场景

注意事项

1.SDK初始化的时候必须传入这个配置sdkConfig才会生效

自定义菜单设置

示例代码

1
2
3
4
5
6
7
ToolBarMenuProxy toolBarMenuProxy = new ToolBarMenuProxy();
toolBarMenuProxy.setCallAudioToolbarHandle(new CustomCallAudioToolbarHandle());
toolBarMenuProxy.setCallVideoToolbarHandle(new CustomCallVideoToolbarHandle());
toolBarMenuProxy.setConfAudioToolbarHandle(new CustomConfAudioToolbarHandle());
toolBarMenuProxy.setConfVideoToolbarHandle(new CustomConfVideoToolbarHandle());
sdkConfig.setToolBarMenuProxy(toolBarMenuProxy);
sdkConfig.setParticipantMenuStrategy(new CustomParticipantMenuHandle());

音频点对点通话自定义菜单

图1 音频点对点通话自定义菜单

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * 演示自定义"音频呼叫"场景下的toolbar菜单
 */
public class CustomCallAudioToolbarHandle implements IToolbarMenuStrategy {
    @Override
    public List<IConfMenu> buildMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new SpeakerMenu());
        if (TupConfig.isNeedScreenShare()) {
            confMenus.add(new ShareMenu());
        }
        confMenus.add(new InviteMenu());
        confMenus.add(new TransVideoMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        return null;
    }
    @Override
    public List<IConfMenu> buildSettingMenuItems() {
        return null;
    }
}

视频点对点通话自定义菜单

图2 视频点对点通话自定义菜单
图3 视频点对点通话更多自定义菜单
图4 视频呼叫会议设置自定义菜单

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * 演示自定义"视频呼叫"场景下的toolbar菜单
 */
public class CustomCallVideoToolbarHandle implements IToolbarMenuStrategy {
    @Override
    public List<IConfMenu> buildMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new SpeakerMenu());
        confMenus.add(new CameraMenu());
        if (TupConfig.isNeedScreenShare()) {
            confMenus.add(new ShareMenu());
        }
        confMenus.add(new InviteMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new InviteMoreMenu());
        confMenus.add(new SwitchCameraMenu());
        confMenus.add(new CallVideoToAudioMenu());
        confMenus.add(new CallAudioToVideoMenu());
        confMenus.add(new ConfSettingMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildSettingMenuItems() {
        List<IConfMenu> menus = new ArrayList<>();

        List<IConfMenu> audioVideomenuChildren = new ArrayList<>();
        IConfMenu beautyMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_beauty, R.string.hwmconf_setting_beauty, true);
        IConfMenu pipMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_hide_self, R.string.hwmconf_setting_pip, true);
        audioVideomenuChildren.add(beautyMenu);
        audioVideomenuChildren.add(pipMenu);
        MenuContainer audioVideoMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_audio_video, R.string.hwmconf_setting_audio_video, audioVideomenuChildren);

        List<IConfMenu> commonMenuChildren = new ArrayList<>();
        //网络检测
        IConfMenu networkDetectMenu = new RouterMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_network_detect, R.string.hwmconf_network_check, "cloudlink://hwmeeting/networkdetection");
        commonMenuChildren.add(networkDetectMenu);
        MenuContainer commonMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_common, R.string.hwmconf_setting_common, commonMenuChildren);

        menus.add(audioVideoMenuContainer);
        menus.add(commonMenuContainer);
        return menus;
    }
}

音频会议自定义菜单

图5 音频会议自定义菜单
图6 音频会议更多自定义菜单
图7 音频会议会议设置菜单

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
 * 演示自定义"音频会议"场景下的toolbar菜单
 */
public class CustomConfAudioToolbarHandle implements IToolbarMenuStrategy {
    @Override
    public List<IConfMenu> buildMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new SpeakerMenu());
        confMenus.add(new ParticipantMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ChatMenu());
        confMenus.add(new HandsUpOrDownMenu());
        confMenus.add(new OpenOrCloseRecordMenu());
        confMenus.add(new ConfSettingMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildSettingMenuItems() {
        List<IConfMenu> menus = new ArrayList<>();

        List<IConfMenu> audioVideomenuChildren = new ArrayList<>();
        IConfMenu howlDetectMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_whistle_detection, R.string.hwmconf_setting_howling_detect, true);
        audioVideomenuChildren.add(howlDetectMenu);
        MenuContainer audioVideoMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_audio_video, R.string.hwmconf_setting_audio_video, audioVideomenuChildren);

        List<IConfMenu> securityMenuChildren = new ArrayList<>();
        //锁定会议
        IConfMenu lockConfMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_lock_meeting, R.string.hwmconf_lock, false);
        securityMenuChildren.add(lockConfMenu);
        MenuContainer securityMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_security, R.string.hwmconf_setting_safe, securityMenuChildren);

        List<IConfMenu> attendeePermissionMenuChildren = new ArrayList<>();
        //允许解除静音
        IConfMenu allowReleaseMuteMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_allow_unmute, R.string.hwmconf_allow_ummute_self, false);
        IConfMenu allowShareMuteMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_allow_sharing, R.string.hwmconf_allow_sharing, false);
        attendeePermissionMenuChildren.add(allowReleaseMuteMenu);
        attendeePermissionMenuChildren.add(allowShareMuteMenu);
        MenuContainer attendeePermissionMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_paticipant_permission, R.string.hwmconf_setting_participant_permission, attendeePermissionMenuChildren);

        List<IConfMenu> commonMenuChildren = new ArrayList<>();
        //网络检测
        IConfMenu networkDetectMenu = new RouterMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_network_detect, R.string.hwmconf_network_check, "cloudlink://hwmeeting/networkdetection");
        commonMenuChildren.add(networkDetectMenu);
        MenuContainer commonMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_common, R.string.hwmconf_setting_common, commonMenuChildren);

        menus.add(audioVideoMenuContainer);
        menus.add(securityMenuContainer);
        menus.add(attendeePermissionMenuContainer);
        menus.add(commonMenuContainer);
        return menus;
    }
}

视频会议自定义菜单

图8 视频会议自定义菜单
图9 视频会议更多自定义菜单
图10 视频会议会议设置自定义菜单

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
 * 演示自定义"视频会议"场景下的toolbar菜单
 */
public class CustomConfVideoToolbarHandle implements IToolbarMenuStrategy {
    @Override
    public List<IConfMenu> buildMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new CameraMenu());
        confMenus.add(new ParticipantMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ChatMenu());
        confMenus.add(new HandsUpOrDownMenu());
        confMenus.add(new OpenOrCloseRecordMenu());
        confMenus.add(new SwitchCameraMenu());
        confMenus.add(new ConfSettingMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildSettingMenuItems() {
        List<IConfMenu> menus = new ArrayList<>();

        List<IConfMenu> audioVideomenuChildren = new ArrayList<>();
        IConfMenu howlDetectMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_whistle_detection, R.string.hwmconf_setting_howling_detect, true);
        IConfMenu beautyMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_beauty, R.string.hwmconf_setting_beauty, true);
        IConfMenu pipMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_hide_self, R.string.hwmconf_setting_pip, true);
        audioVideomenuChildren.add(howlDetectMenu);
        audioVideomenuChildren.add(beautyMenu);
        audioVideomenuChildren.add(pipMenu);
        MenuContainer audioVideoMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_audio_video, R.string.hwmconf_setting_audio_video, audioVideomenuChildren);

        List<IConfMenu> securityMenuChildren = new ArrayList<>();
        //锁定会议
        IConfMenu lockConfMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_lock_meeting, R.string.hwmconf_lock, false);
        securityMenuChildren.add(lockConfMenu);
        MenuContainer securityMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_security, R.string.hwmconf_setting_safe, securityMenuChildren);


        List<IConfMenu> attendeePermissionMenuChildren = new ArrayList<>();
        //允许解除静音
        IConfMenu allowReleaseMuteMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_allow_unmute, R.string.hwmconf_allow_ummute_self, false);
        IConfMenu allowShareMuteMenu = new SwitchMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_allow_sharing, R.string.hwmconf_allow_sharing, false);
        attendeePermissionMenuChildren.add(allowReleaseMuteMenu);
        attendeePermissionMenuChildren.add(allowShareMuteMenu);
        /*
         * 【演示】在会议设置里新增一个设置项
         */
        IConfMenu customeSettingMenuTest1 = new SwitchMenu(R.id.conf_setting_menu_test1, R.string.menu_conf_setting_menu_test1, false);
        attendeePermissionMenuChildren.add(customeSettingMenuTest1);
        MenuContainer attendeePermissionMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_paticipant_permission, R.string.hwmconf_setting_participant_permission, attendeePermissionMenuChildren);


        List<IConfMenu> commonMenuChildren = new ArrayList<>();
        //网络检测
        IConfMenu networkDetectMenu = new RouterMenu(com.huawei.hwmmobileconfui.R.id.hwmconf_confsetting_network_detect, R.string.hwmconf_network_check, "cloudlink://hwmeeting/networkdetection");
        commonMenuChildren.add(networkDetectMenu);
        MenuContainer commonMenuContainer = new MenuContainer(com.huawei.hwmmobileconfui.R.id.hwmconf_setting_menu_common, R.string.hwmconf_setting_common, commonMenuChildren);

        menus.add(audioVideoMenuContainer);
        menus.add(securityMenuContainer);
        menus.add(attendeePermissionMenuContainer);
        menus.add(commonMenuContainer);


        /*
         * 【演示】在会议设置里新增加一个设置项组
         */
        List<IConfMenu> customChildren = new ArrayList<>();
        //网络检测
        IConfMenu customeSettingMenuTest2 = new RouterMenu(R.id.conf_setting_menu_test2, R.string.menu_conf_setting_menu_test1, "test");
        customChildren.add(customeSettingMenuTest2);
        MenuContainer customContainer = new MenuContainer(R.id.conf_setting_menu_test_group, R.string.menu_conf_setting_menu_test_group, customChildren);
        menus.add(customContainer);

        return menus;
    }
}

分享:

    相关文档

    相关产品

close