package com.meeting.demo.utils;

import com.huawei.hwmconf.sdk.model.conf.entity.HWMCustomSubViewPosition;
import com.meeting.demo.model.CustomSubViewModel;
import com.huawei.hwmconf.sdk.model.conf.entity.HWMCustomSubViewModel.HWMCustomSubViewAttachType;

public class CustomSubViewCache {

    private CustomSubViewModel customSubViewModelTopLeft = new CustomSubViewModel();
    private CustomSubViewModel customSubViewModelBottomCenter = new CustomSubViewModel();
    private CustomSubViewModel customSubViewModelBottomRight = new CustomSubViewModel();

    public static CustomSubViewCache getInstance() {
        return SingletonHolder.INSTANCE;
    }

    private CustomSubViewCache() {
        init();
    }


    public CustomSubViewModel getCustomSubViewModelTopLeft() {
        return customSubViewModelTopLeft;
    }

    public CustomSubViewModel getCustomSubViewModelBottomCenter() {
        return customSubViewModelBottomCenter;
    }

    public CustomSubViewModel getCustomSubViewModelBottomRight() {
        return customSubViewModelBottomRight;
    }

    private void init() {
        // TopLeft 默认配置
        customSubViewModelTopLeft.setOpen(false);
        customSubViewModelTopLeft.setEnableDrag(true);
        customSubViewModelTopLeft.setEnableAttach(true);
        customSubViewModelTopLeft.setShowFollowConfCtrlBar(false);
        customSubViewModelTopLeft.setAttachType(HWMCustomSubViewAttachType.HWM_CUSTOM_SUBVIEW_ATTACH_TYPE_LEFT_AND_RIGHT);
        customSubViewModelTopLeft.setHwmCustomSubViewPosition(HWMCustomSubViewPosition.HWM_CUSTOM_SUBVIEW_POSITION_TOP_LEFT);

        // BottomCenter 默认配置
        customSubViewModelBottomCenter.setOpen(false);
        customSubViewModelBottomCenter.setEnableDrag(true);
        customSubViewModelBottomCenter.setEnableAttach(true);
        customSubViewModelBottomCenter.setShowFollowConfCtrlBar(false);
        customSubViewModelBottomCenter.setAttachType(HWMCustomSubViewAttachType.HWM_CUSTOM_SUBVIEW_ATTACH_TYPE_TOP_AND_BOTTOM);
        customSubViewModelBottomCenter.setHwmCustomSubViewPosition(HWMCustomSubViewPosition.HWM_CUSTOM_SUBVIEW_POSITION_BOTTOM_CENTER);

        // BottomRight 默认配置
        customSubViewModelBottomRight.setOpen(false);
        customSubViewModelBottomRight.setEnableDrag(true);
        customSubViewModelBottomRight.setEnableAttach(false);
        customSubViewModelBottomRight.setShowFollowConfCtrlBar(true);
        customSubViewModelBottomRight.setAttachType(HWMCustomSubViewAttachType.HWM_CUSTOM_SUBVIEW_ATTACH_TYPE_LEFT_AND_RIGHT);
        customSubViewModelBottomRight.setHwmCustomSubViewPosition(HWMCustomSubViewPosition.HWM_CUSTOM_SUBVIEW_POSITION_BOTTOM_RIGHT);
    }

    private static class SingletonHolder {
        private static final CustomSubViewCache INSTANCE = new CustomSubViewCache();
    }
}
