BBAToolBarInputView.h 1.77 KB
//
//  BBAToolBarInputView.h
//  BBAPods
//
//  Created by liaoxuejun on 16/9/1.
//  Copyright © 2016年 Baidu. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, BBAToolBarInputViewType) {
    BBAToolBarInputViewTypeSimple, //非图集使用
    BBAToolBarInputViewTypeDarkLight,  //图集使用
    BBAToolBarInputViewTypeLight,  //小视频使用
};

///动画类型
typedef NS_ENUM(NSInteger, BBAToolBarInputViewPlaceholderAnimationType) {
    ///无动画
    BBAToolBarInputViewPlaceholderAnimationTypeNone = 0,
    ///打字效果动画
    BBAToolBarInputViewPlaceholderAnimationTypeTyping,
};

typedef void(^BBAToolBarInputViewEmotionBlock)(void);

/// toolbar上输入框默认高度
extern const CGFloat kBBAToolBarInputViewHeight;

@interface BBAToolBarInputView : UIButton

@property (nonatomic, assign) BBAToolBarInputViewType toolBarInputViewType;
@property (nonatomic, assign) BBAToolBarInputViewPlaceholderAnimationType animationType;
@property (nonatomic, assign, getter = isShowEmotion) BOOL showEmotion;
@property (nonatomic, copy) BBAToolBarInputViewEmotionBlock emotionBlock;

- (instancetype)initWithFrame:(CGRect)frame placeholder:(NSString *)text style:(BBAToolBarInputViewType)style;
- (instancetype)initWithFrame:(CGRect)frame placeholder:(NSString *)text;
- (instancetype)initWithFrame:(CGRect)frame;
- (void)setPromptText:(NSAttributedString *)attributes;
- (void)setCommentDraft:(NSString *)draftStr;
- (NSString *)getCommentDraft;
- (void)setDefaultText;
//按照默认样式重置placeholder
- (void)setPlaceholderWithDefaultStyle:(NSString *)text;
- (void)startPlaceHolderAnimaiotn;


/**
 关闭评论,评论输入框置灰,不可点击
 */
- (void)enableInputView;

/**
 关闭评论,评论输入框可点击
 */
- (void)disableInpuView;

@end