VoiceLianmaiView.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // VoiceLianmaiView.m
  3. // BuguLive
  4. //
  5. // Created by 志刚杨 on 2022/10/13.
  6. // Copyright © 2022 xfg. All rights reserved.
  7. //
  8. #import "VoiceLianmaiView.h"
  9. @interface VoiceLianmaiView ()
  10. @end
  11. @implementation VoiceLianmaiView
  12. {
  13. }
  14. #pragma mark - LifeCycle
  15. - (void)dealloc {
  16. [self removeNotificationObserver];
  17. }
  18. - (void)setTotalVolume:(NSInteger)totalVolume
  19. {
  20. _totalVolume = totalVolume;
  21. if(_totalVolume > 10)
  22. {
  23. _yyimg.hidden = NO;
  24. }
  25. else
  26. {
  27. _yyimg.hidden = YES;
  28. }
  29. }
  30. - (void)awakeFromNib {
  31. [super awakeFromNib];
  32. //设置view
  33. [self setupView];
  34. //请求数据
  35. [self requestData];
  36. self.micbutton.userInteractionEnabled = NO;
  37. //设置通知
  38. [self addNotificationObserver];
  39. ViewRadius(self.headImageView, kRealValue(50)/2);
  40. _yyimg = [[YYAnimatedImageView alloc] init];
  41. _yyimg.image = [YYImage imageNamed:@"mic_pppp.webp"];
  42. self.backgroundColor = kClearColor;
  43. _yyimg.backgroundColor = kClearColor;
  44. _yyimg.hidden = YES;
  45. [self addSubview:_yyimg];
  46. [_yyimg mas_makeConstraints:^(MASConstraintMaker *make) {
  47. make.center.equalTo(self);
  48. make.width.equalTo(self).offset(20);
  49. make.height.equalTo(self).offset(20);
  50. }];
  51. [self sendSubviewToBack:_yyimg];
  52. }
  53. #pragma mark - View
  54. - (void)setupView {
  55. }
  56. #pragma mark - Network
  57. - (void)requestData {
  58. }
  59. #pragma mark- Delegate
  60. #pragma mark UITableDatasource & UITableviewDelegate
  61. #pragma mark - Private
  62. #pragma mark - Event
  63. #pragma mark - Public
  64. #pragma mark - NSNotificationCenter
  65. - (void)addNotificationObserver {
  66. }
  67. - (void)removeNotificationObserver {
  68. }
  69. #pragma mark - Setter
  70. #pragma mark - Getter
  71. @end