BBABlankPageTipView.h 6.06 KB
//
//  BBABlankPageTipView.h
//  BBAPods
//
//  Created by liushaohua02 on 31/07/2020.
//  Copyright © 2017 Baidu. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, BBABlankPageTipViewThemesMode) {
    /// 日间模式
    BBABlankPageTipViewThemesModeLight,
    /// 暗黑模式
    BBABlankPageTipViewThemesModeDark,
    /// 自动模式,随应用设置改变,默认使用此选项
    BBABlankPageTipViewThemesModeAuto
};

typedef NS_ENUM(NSInteger, BBABlankPageButtonShowType) {
    /// 按钮背景颜色为白色 默认为此类型
    BBABlankPageButtonShowTypeWhite,
    /// 按钮背景颜色为蓝色
    BBABlankPageButtonShowTypeBlue
};

typedef void (^BBABlankPageTipViewButtonActionBlock)(void);

@interface BBABlankPageTipView : UIView

/// 主内容视图
@property (nonatomic, strong, readonly) UIView *contentView;
/// 主内容视图中的icon
@property (nonatomic, strong) UIImageView *imageView;
/// 主内容视图中主标题文字
@property (nonatomic, strong) UILabel *label;
/// 主内容视图中的 辅助说明文字
@property (nonatomic, strong) UILabel *descLabel;
/// 重新加载按钮
@property (nonatomic, strong) UIButton *button;
//  重新加载按钮是否可点击, 默认可点击
@property (nonatomic, assign) BOOL enableButtonDefaultAction;
/// 设置网络按钮
@property (nonatomic, strong) UIButton *detectionNetworkButton;

/// 空白提示页面
/// @param frame frame description
/// @param imageName 图片名称 (必传)
/// @param labelText 标题 (必传)
/// @param descText 描述文字
/// @param buttonTitle 按钮文字
/// @param buttonShowType 按钮展示类型,默认是白色背景Style
/// @param buttonClickCallBack 按钮点击回调
- (instancetype)initWithFrame:(CGRect)frame
                    imageName:(NSString *)imageName
                    labelText:(NSString *)labelText
                     descText:(NSString *)descText
                  buttonTitle:(NSString *)buttonTitle
               buttonShowType:(BBABlankPageButtonShowType)buttonShowType
          buttonClickCallBack:(BBABlankPageTipViewButtonActionBlock)buttonClickCallBack;

/// 空白提示页面
/// @param frame 空白页面的Frame
/// @param imageName 图片名称 (必传)
/// @param labelText 标题 (必传)
/// @param buttonTitle 按钮文案
/// @param buttonShowType 按钮展示类型,默认是白色背景Style
/// @param buttonClickCallBack 按钮点击回调
/// @param detectionNetworkCallBack 设置网络按钮点击回调,只有设置了此Block回调,才会展示检查网络的超链接按钮,点击会后自动回调 detectionNetworkCallBack
- (instancetype)initWithFrame:(CGRect)frame
                    imageName:(NSString *)imageName
                    labelText:(NSString *)labelText
                  buttonTitle:(NSString *)buttonTitle
               buttonShowType:(BBABlankPageButtonShowType)buttonShowType
          buttonClickCallBack:(BBABlankPageTipViewButtonActionBlock)buttonClickCallBack
detectionNetworkClickCallBack:(BBABlankPageTipViewButtonActionBlock)detectionNetworkCallBack;

/// 空白提示页面
/// @param frame 空白页面的Frame
/// @param imageName 图片名称 (必传)
/// @param labelText 标题 (必传)
- (instancetype)initWithFrame:(CGRect)frame
                    imageName:(NSString *)imageName
                    labelText:(NSString *)labelText;
/// 空白提示页面
/// @param imageName 图片名称(必传)
/// @param labelText 标题 (必传)
- (instancetype)initWithImageName:(NSString *)imageName
                        labelText:(NSString *)labelText;

/// 重新布局子view
- (void)layoutView;

/// 支持指定主题模式
/// @param themesMode 主题模式
- (void)setThemesMode:(BBABlankPageTipViewThemesMode)themesMode;

- (instancetype)initWithFrame:(CGRect)frame
                    imageName:(NSString *)imageName
                    labelText:(NSString *)labelText
                     descText:(NSString *)descText
                  buttonTitle:(NSString *)buttonTitle
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));

- (instancetype)initWithFrame:(CGRect)frame
                    imageName:(NSString *)imageName
                    labelText:(NSString *)labelText
                  buttonTitle:(NSString *)buttonTitle
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));

- (instancetype)initWithFrame:(CGRect)frame
                    imageName:(NSString *)imageName
                    labelText:(NSString *)labelText
                  buttonTitle:(NSString *)buttonTitle
             detectionNetwork:(BOOL)needShow
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: detectionNetworkClickCallBack: instead")));

- (instancetype)initWithImageName:(NSString *)imageName
                        labelText:(NSString *)labelText
                      buttonTitle:(NSString *)buttonTitle
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));

/////////////////////////////////////////////////////////
/**
 *下面代码是为了兼容视频SDK,切勿使用,待业务方删除
 */

typedef NS_ENUM(NSInteger, BBABlankPageTipType) {
    BBABlankPageTipTypeWiFi
};

typedef enum : NSUInteger {
    BBABlankPageTipDefaultWhiteBackground = 0,
    BBABlankPageTipBlackBackground = 1,
} BBABlankPageTipBackgroundModel;

typedef void (^BBABlankPageTipViewButtonActionBlock)(void);

- (instancetype)initWithFrame:(CGRect)frame
                      tipType:(BBABlankPageTipType)tipType
            buttonActionBlock:(BBABlankPageTipViewButtonActionBlock)buttonActionBlock
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));;

-(void)backgroundModel:(BBABlankPageTipBackgroundModel)bgModel;


@end