BogoChatBottomBarView.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //
  2. // BogoChatBottomBarView.h
  3. // BuguLive
  4. //
  5. // Created by 宋晨光 on 2021/5/28.
  6. // Copyright © 2021 xfg. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "ChatEmojiView.h"
  10. #import "ChatMoreView.h"
  11. #import <Masonry/Masonry.h>
  12. #import <UIKit/UIKit.h>
  13. static CGFloat const kBogoChatBarViewHeight = 234.0f;
  14. //kRealValue(358) + MG_BOTTOM_MARGIN;
  15. //KGiftViewHeight;
  16. static CGFloat const kBogoChatBarBottomOffset = 8.f;
  17. static CGFloat const kBogoChatBarTextViewBottomOffset = 6;
  18. static CGFloat const kBogoChatBarTextViewFrameMinHeight = 37.f;
  19. static CGFloat const kBogoChatBarTextViewFrameMaxHeight = 82.f;
  20. static CGFloat const kBogoChatBarMaxHeight = kBogoChatBarTextViewFrameMaxHeight + 2 * kBogoChatBarTextViewBottomOffset;
  21. static CGFloat const kBogoChatBarMinHeight = kBogoChatBarTextViewFrameMinHeight + 2 * kBogoChatBarTextViewBottomOffset;
  22. /**
  23. * chatBar显示类型
  24. */
  25. typedef NS_ENUM(NSUInteger, BOGOChatBarShowType) {
  26. BOGOChatBarShowTypeNothing /**不显示chatbar */,
  27. BOGOChatBarShowTypeFace /**显示表情View */,
  28. BOGOChatBarShowTypeVoice /**显示录音view */,
  29. BOGOChatBarShowTypeMore /**显示更多view */,
  30. BOGOChatBarShowTypeKeyboard /**显示键盘 */,
  31. };
  32. @protocol ChatBottomBarDelegate;
  33. NS_ASSUME_NONNULL_BEGIN
  34. @interface BogoChatBottomBarView : UIView
  35. @property (nonatomic, strong) UIView *inputBarBackgroundView; //输入栏目背景视图
  36. @property (nonatomic, strong) UIView *maskView; //无私信权限
  37. @property (strong, nonatomic) UIButton *voiceButton; //切换录音模式按钮
  38. @property (strong, nonatomic) UIButton *voiceRecordButton; //录音按钮
  39. @property (strong, nonatomic) UIButton *faceButton; //表情按钮
  40. @property (strong, nonatomic) UIButton *moreButton; //更多按钮
  41. @property (strong, nonatomic) ChatBarTextView *textView; //输入框
  42. @property (strong, nonatomic) ChatEmojiView *emojiView;
  43. @property (nonatomic, assign) BOGOChatBarShowType showType;
  44. @property (nonatomic, assign) BOOL mbhalf;
  45. //@property (weak, nonatomic) ChatFaceView *faceView;
  46. @property (weak, nonatomic) UIView *faceView;
  47. @property (weak, nonatomic) ChatMoreView *moreView;
  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. /**
  62. 改变聊天界面tableView 高度
  63. @param chatBar 底部菜单
  64. */
  65. - (void)chatBarFrameDidChange:(ChatBottomBarView *)chatBar shouldScrollToBottom:(CGFloat)keyBoardHeight showType:(BOGOChatBarShowType)showType showAnimationTime:(CGFloat)showAnimationTime;
  66. /**
  67. 发送普通的文字信息,可能带有表情
  68. @param chatBar chatBar
  69. @param message 发送的消息
  70. */
  71. - (void)chatBar:(ChatBottomBarView *)chatBar sendMessage:(NSString *)message;
  72. /**
  73. * 输入了 @ 的时候
  74. *
  75. */
  76. - (void)didInputAtSign:(ChatBottomBarView *)chatBar;
  77. - (NSArray *)regulationForBatchDeleteText;
  78. @end
  79. NS_ASSUME_NONNULL_END