ChatBottomBarView.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // ChatBottomBarView.h
  3. // BuguLive
  4. //
  5. // Created by 朱庆彬 on 2017/8/15.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "ChatBarTextView.h"
  9. #import "ChatEmojiView.h"
  10. #import "ChatMoreView.h"
  11. #import <Masonry/Masonry.h>
  12. #import <UIKit/UIKit.h>
  13. static CGFloat const kChatBarViewHeight = 234.0f;
  14. //kRealValue(358) + MG_BOTTOM_MARGIN;
  15. //KGiftViewHeight;
  16. static CGFloat const kChatBarBottomOffset = 8.f;
  17. static CGFloat const kChatBarTextViewBottomOffset = 6;
  18. static CGFloat const kChatBarTextViewFrameMinHeight = 37.f;
  19. static CGFloat const kChatBarTextViewFrameMaxHeight = 82.f;
  20. static CGFloat const kChatBarMaxHeight = kChatBarTextViewFrameMaxHeight + 2 * kChatBarTextViewBottomOffset;
  21. static CGFloat const kChatBarMinHeight = kChatBarTextViewFrameMinHeight + 2 * kChatBarTextViewBottomOffset;
  22. /**
  23. * chatBar显示类型
  24. */
  25. typedef NS_ENUM(NSUInteger, FWChatBarShowType) {
  26. FWChatBarShowTypeNothing /**不显示chatbar */,
  27. FWChatBarShowTypeFace /**显示表情View */,
  28. FWChatBarShowTypeVoice /**显示录音view */,
  29. FWChatBarShowTypeMore /**显示更多view */,
  30. FWChatBarShowTypeKeyboard /**显示键盘 */,
  31. };
  32. @protocol ChatBottomBarDelegate;
  33. @interface ChatBottomBarView : UIView
  34. @property (nonatomic, strong) UIView *inputBarBackgroundView; //输入栏目背景视图
  35. @property (nonatomic, strong) UIView *maskView; //无私信权限
  36. @property (strong, nonatomic) UIButton *voiceButton; //切换录音模式按钮
  37. @property (strong, nonatomic) UIButton *voiceRecordButton; //录音按钮
  38. @property (strong, nonatomic) UIButton *faceButton; //表情按钮
  39. @property (strong, nonatomic) UIButton *moreButton; //更多按钮
  40. @property (strong, nonatomic) ChatBarTextView *textView; //输入框
  41. @property (strong, nonatomic) ChatEmojiView *emojiView;
  42. @property (nonatomic, assign) FWChatBarShowType showType;
  43. @property (nonatomic, assign) BOOL mbhalf;
  44. //@property (weak, nonatomic) ChatFaceView *faceView;
  45. @property (weak, nonatomic) UIView *faceView;
  46. @property (weak, nonatomic) ChatMoreView *moreView;
  47. @property(nonatomic, strong) NSMutableArray *moreListArr;
  48. @property (weak, nonatomic) id<ChatBottomBarDelegate> delegate;
  49. @property (assign, nonatomic) CGSize keyboardSize;
  50. @property (assign, nonatomic) CGFloat oldTextViewHeight;
  51. @property (assign, nonatomic) CGFloat animationDuration;
  52. @property (nonatomic, assign, getter=isClosed) BOOL close;
  53. @property (nonatomic, assign, getter=shouldAllowTextViewContentOffset) BOOL allowTextViewContentOffset;
  54. @property(nonatomic, assign) BOOL isShowKeyBoard;
  55. @property(nonatomic, assign) CGFloat chatBarViewHeight;
  56. - (void)hideChatBottomBar;
  57. - (void)updateChatBarConstraintsIfNeededShouldCacheText:(BOOL)shouldCacheText;
  58. @end
  59. @protocol ChatBottomBarDelegate <NSObject>
  60. @optional
  61. - (void)chatMoreViewButton:(NSInteger)btnIndex;
  62. /**
  63. 改变聊天界面tableView 高度
  64. @param chatBar 底部菜单
  65. */
  66. - (void)chatBarFrameDidChange:(ChatBottomBarView *)chatBar shouldScrollToBottom:(CGFloat)keyBoardHeight showType:(FWChatBarShowType)showType showAnimationTime:(CGFloat)showAnimationTime;
  67. /**
  68. 发送普通的文字信息,可能带有表情
  69. @param chatBar chatBar
  70. @param message 发送的消息
  71. */
  72. - (void)chatBar:(ChatBottomBarView *)chatBar sendMessage:(NSString *)message;
  73. /**
  74. * 输入了 @ 的时候
  75. *
  76. */
  77. - (void)didInputAtSign:(ChatBottomBarView *)chatBar;
  78. - (NSArray *)regulationForBatchDeleteText;
  79. @end