BBALikeAnimationButton.h
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// BBALikeAnimationButton.h
// BBAPods-BBAUIKit
//
// Created by Li,Xin(MAD) on 2018/1/2.
// Copyright © 2018年 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
@class FLAnimatedImageView;
typedef NS_ENUM(NSInteger, BBALikeAnimationButtonHorizontalAlignment) {
BBALikeAnimationButtonHorizontalAlignmentLeft,
BBALikeAnimationButtonHorizontalAlignmentCenter,
BBALikeAnimationButtonHorizontalAlignmentRight
};
typedef NS_ENUM(NSInteger, BBALikeAnimationButtonImageStyle) {
BBALikeAnimationButtonImageStyleDefault,
BBALikeAnimationButtonImageStyleGreyStyle,
BBALikeAnimationButtonImageStyleHeartStyle, // unavailable
BBALikeAnimationButtonImageStyleTopCommentStyle,
BBALikeAnimationButtonImageStyleDefaultAlphaStyle,
BBALikeAnimationButtonImageStyleNotificationStyle, // 11.15 消息改版通知模版点赞样式
};
extern NSString * const kBBALikeAnimationButtonTextColorNormal; //!< 未点赞状态时,点赞数默认颜色值
extern NSString * const kBBALikeAnimationButtonTextColorUped; //!< 已点赞状态时,点赞数默认颜色值
@interface BBALikeAnimationButton : UIControl
@property (nonatomic, strong) UIFont *textFont; //点赞字体
@property (nonatomic, strong) UIColor *normalTextColor; //!< 未点赞状态时,点赞数颜色, 不会立即生效,需要调用setText:isUped:(animated:)后更新, 默认值是 @see kBBALikeAnimationButtonTextColorNormal
@property (nonatomic, strong) UIColor *normalTextGreyStyleColor; //灰色风格点赞数颜色
@property (nonatomic, strong) UIColor *upedTextColor; //!< 已点赞状态时,点赞数颜色, 默认值是 @see kBBALikeAnimationButtonTextColorUped
@property (nonatomic, assign, readonly) BOOL isUped; //!< 是否是点赞态 , Default is NO.
@property (nonatomic, copy, readonly) NSString *text;
@property (nonatomic, assign) UIEdgeInsets contentInsets; //!< 内容边距 Default is UIEdgeInsetsZero ;
@property (nonatomic, assign) CGFloat spaceBetweenImageAndText; //!< Defalut is 0.f;
@property (nonatomic, assign) BBALikeAnimationButtonHorizontalAlignment horizontalAlignment ; //!< 水平方向对齐方式 默认左对齐
@property (nonatomic, strong, readonly)FLAnimatedImageView *animationImageView; //动效视图
- (instancetype)initWithFrame:(CGRect)frame specificThemeMode:(NSString *)specificThemeMode;
//初始化设置点赞文本以及是否点赞过
- (void)setText:(NSString *)text isUped:(bool)isUped;
//设置点赞文本以及是否以动画方式展示
- (void)setText:(NSString *)text isUped:(bool)isUped animated:(BOOL)animated;
- (void)setText:(NSString *)text isUped:(bool)isUped animated:(BOOL)animated imageStyle:(BBALikeAnimationButtonImageStyle)imageStyle ;
@end