package com.ym.modulecommon;

/**
 * App基础类库开关工具类
 * 本工具类的方法尽量在Application的onCreate()中尽早调用
 * 各个开关均已设置默认值，如端上需求需要改变相应状态，调用相关方法即可，详情见注释
 */
public class SettingAppLibraryConfigUtils {

    private SettingAppLibraryConfigUtils(){}

    public static Builder builder() {
        return new Builder();
    }

    static class Builder {

        // ==========================  Application开关 start  ==========================


        // ==========================  Application开关  end   ==========================

        // ==========================  Activity开关 start  ==========================

        /**
         * Activity是否保持屏幕常亮，默认为开
         */
        public Builder setActivityIsKeepScreenLight(Boolean isKeepScreenLight) {
            AppLibraryConfig.ActivityConfig.isKeepScreenLight = isKeepScreenLight;
            return this;
        }

        /**
         * Activity是否禁止截屏，默认为开
         */
        public Builder setActivityIsProhibitScreenshot(Boolean isProhibitScreenshot) {
            AppLibraryConfig.ActivityConfig.isProhibitScreenshot = isProhibitScreenshot;
            return this;
        }

        /**
         * Activity是否禁止横屏，默认为开
         */
        public Builder setActivityIsProhibitLandscape(Boolean isProhibitLandscape) {
            AppLibraryConfig.ActivityConfig.isProhibitLandscape = isProhibitLandscape;
            return this;
        }

        // ==========================  Activity开关  end  ==========================

        // ==========================  PhoneUtils开关 start  ==========================

        /**
         * PhoneUtils是否跳过验证
         */
        public Builder setIsTGYZ(Boolean isTGYZ) {
            AppLibraryConfig.PhoneUtilsConfig.isTGYZ = isTGYZ;
            return this;
        }

        /**
         * PhoneUtils是否跳过Token
         */
        public Builder setIsTGTK(Boolean isTGTK) {
            AppLibraryConfig.PhoneUtilsConfig.isTGTK = isTGTK;
            return this;
        }
        // ==========================  PhoneUtils开关  end   ==========================
    }
}
