更新时间:2024-07-30 GMT+08:00

自定义会中分享面板

在OpenSDKConfig中配置会中自定义的分享面板

分享效果参考图1

使用场景

在与会者列表页面,点击分享按钮的时候会弹出分享面板,用户可以自定义分享面板的样式和内容

注意事项

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

图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
//自定义分享菜单
public class CustomShareHandle implements IShareHandle {
    @Override
    public List<IShareModel> buildShareItems(Context context, ConfInfo confInfo, ShareTypeEnum shareTypeEnum) {
        String subject = confInfo.getConfSubject();
        String guestUrl = confInfo.getConfGuestUri();
        String time = DateUtil.getDateTimeStringForUi(confInfo.getConfStartTime(), confInfo.getConfEndTime());
        String chairman = confInfo.getConfScheduserName();
        String confId = confInfo.getConfId();
        String guestPwd = TextUtils.isEmpty(confInfo.getConfPwd()) ? Utils.getApp().getString(com.huawei.hwmmobileconfui.R.string.conf_no_pwd) : confInfo.getConfPwd();
        String content = String.format(Utils.getApp().getString(com.huawei.hwmmobileconfui.R.string.conf_share_content), subject, time, chairman, confId, guestPwd, guestUrl);
        //短信分享菜单
        SmsShareModel smsShareModel = new SmsShareModel();
        smsShareModel.setContent(content);
        //复制链接
        CopyShareModel copyShareModel = new CopyShareModel();
        copyShareModel.setContent(content);
        List<IShareModel> shareModels = new ArrayList<>();
        shareModels.add(smsShareModel);
        shareModels.add(copyShareModel);
        return shareModels;
    }
}
sdkConfig.setShareHandle(new CustomShareHandle());