MGBaseBottomManager.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //
  2. // BottomAnimationView.h
  3. // LivenessDetection
  4. //
  5. // Created by megvii on 15/1/8.
  6. // Copyright (c) 2015Year megvii. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "LivenessEnumType.h"
  10. #import "MGBaseCountdownView.h"
  11. #import "MGLiveConfig.h"
  12. #import "MGLiveBundle.h"
  13. /**
  14. * 显示该步骤要操作的动画
  15. */
  16. @interface MGBaseBottomManager : UIView
  17. /**
  18. * 倒计时样式,默认 MGCountDownTypeRing 样式,通过初始化设置
  19. */
  20. @property (nonatomic, assign, readonly) MGCountDownType countDownType;
  21. /**
  22. * 动画是否停止
  23. */
  24. @property (nonatomic, assign, readonly) BOOL stopAnimaiton;
  25. /**
  26. * 只有在 MGCountDownTypeCustom 模式下,请手动设置该类
  27. */
  28. @property (nonatomic, strong) MGBaseCountdownView *countDownView;
  29. /**
  30. * 提示信息label, 需要子类初始化
  31. */
  32. @property (nonatomic, strong) UILabel *messageLabel;
  33. /**
  34. * 必须使用该方法初始化
  35. *
  36. * @param frame frame
  37. * @param countDownType 倒计时动画类型
  38. *
  39. * @return 初始化对象
  40. */
  41. - (instancetype)initWithFrame:(CGRect)frame
  42. andCountDownType:(MGCountDownType)countDownType;
  43. /**
  44. * 开始动画
  45. */
  46. - (void)startRollAnimation;
  47. /**
  48. * 初始化 界面参数值,不包涵 view,子类不需要重写;
  49. */
  50. - (void)recovery;
  51. /**
  52. * 显示提示信息
  53. *
  54. * @param message 信息
  55. */
  56. - (void)showMessageView:(NSString *)message;
  57. /**
  58. * 恢复初始状态,并显示信息
  59. *
  60. * @param title 信息
  61. */
  62. - (void)recoveryWithTitle:(NSString *)title;
  63. #pragma mark - 用户可能重写的方法
  64. /* 子类需要重写一下方法,并且重写时候调用 [super method]; 方法 */
  65. /**
  66. * 创建界面,除动画以外的界面,以及界面颜色之类的定制。 该类初始化时候被调用
  67. */
  68. - (void)creatBottomView;
  69. /**
  70. * 创建动画的界面,即两个imageview,进行动画提示。 该类初始化时候被调用
  71. */
  72. - (void)creatAniamtionView;
  73. /**
  74. * 恢复view的初始状态,主要负责动画的view
  75. */
  76. - (void)recoveryView;
  77. /**
  78. * 下一步 显示的动画,在动作结束进入下一个动作 被调用
  79. *
  80. * @param state 动画类型
  81. * @param time 倒计时间
  82. */
  83. - (void)willChangeAnimation:(MGLivenessDetectionType)state
  84. outTime:(CGFloat)time
  85. currentStep:(NSInteger)step;
  86. @end