HJAudioBubbleConfig.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // HJAudioBubbleConfig.m
  3. // HJAudioBubbleDemo
  4. //
  5. // Created by WHJ on 2017/12/1.
  6. // Copyright © 2017年 WHJ. All rights reserved.
  7. //
  8. #import "HJAudioBubbleConfig.h"
  9. @implementation HJAudioBubbleConfig
  10. #pragma mark - 单例内容
  11. static HJAudioBubbleConfig * shareSingleton;
  12. + (instancetype)sharedAudioBubbleConfig{
  13. static dispatch_once_t onceToken;
  14. dispatch_once (&onceToken, ^ {
  15. shareSingleton = [[super allocWithZone:NULL] init] ;
  16. [shareSingleton buildDefaultDatas];
  17. } );
  18. return shareSingleton;
  19. }
  20. + (id)allocWithZone:(struct _NSZone *)zone {
  21. return [self sharedAudioBubbleConfig] ;
  22. }
  23. + (id)copyWithZone:(struct _NSZone *)zone {
  24. return [self sharedAudioBubbleConfig];
  25. }
  26. #pragma mark - 业务内容
  27. - (void)buildDefaultDatas{
  28. //设置播放动画图片
  29. self.duration = 0.5f;
  30. self.iconMargin = 5.f;
  31. self.voiceDefaultImage = [UIImage imageNamed:@"du_voice_background002"];
  32. self.voiceAnimationImages = @[
  33. [UIImage imageNamed:@"du_voice_background001"],
  34. [UIImage imageNamed:@"du_voice_background002"],
  35. [UIImage imageNamed:@"du_voice_background004"],
  36. [UIImage imageNamed:@"du_voice_background005"],
  37. [UIImage imageNamed:@"du_voice_background006"],
  38. [UIImage imageNamed:@"du_voice_background007"],
  39. [UIImage imageNamed:@"du_voice_background008"],
  40. [UIImage imageNamed:@"du_voice_background009"]];
  41. // [UIImage imageNamed:@"du_voice_background003"]];
  42. //设置时长默认显示样式
  43. self.timeShowType = HJAudioBubbleTimeShowType_inContainer;
  44. self.timeFont = [UIFont systemFontOfSize:12];
  45. self.timeColor = [UIColor darkGrayColor];
  46. }
  47. @end