From d75bd41d19f3290522909ef21a1de5d870318011 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Sat, 11 Dec 2021 12:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=96=E6=9E=9C=E6=A0=91=E7=A4=BC=E7=89=A9?= =?UTF-8?q?=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 1 + xplan-ios.xcodeproj/project.pbxproj | 12 + .../Contents.json | 22 ++ .../candy_tree_levle_fifth@2x.png | Bin 0 -> 1024 bytes .../candy_tree_levle_fifth@3x.png | Bin 0 -> 1547 bytes .../Contents.json | 22 ++ .../candy_tree_levle_fourth@2x.png | Bin 0 -> 951 bytes .../candy_tree_levle_fourth@3x.png | Bin 0 -> 2287 bytes .../Contents.json | 22 ++ .../candy_tree_levle_third@2x.png | Bin 0 -> 781 bytes .../candy_tree_levle_third@3x.png | Bin 0 -> 1392 bytes .../View/AnimationView/XPRoomAnimationView.m | 4 +- .../View/AnimationView/XPRoomCandyGiftView.m | 6 +- .../CandyTree/Model/CandyTreeResultModel.h | 3 +- .../Model/XPCandyTreeAnimationModel.h | 33 ++ .../Model/XPCandyTreeAnimationModel.m | 12 + .../View/XPCandyTreeAnimationManager.h | 28 ++ .../View/XPCandyTreeAnimationManager.m | 291 ++++++++++++++++++ .../View/CandyTree/View/XPCandyTreeGiftView.h | 8 +- .../View/CandyTree/View/XPCandyTreeGiftView.m | 76 ++++- .../View/XPCandyTreeViewController.m | 16 + .../XPRoomMessageContainerView.m | 1 - 22 files changed, 536 insertions(+), 21 deletions(-) create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/candy_tree_levle_fifth@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/candy_tree_levle_fifth@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fourth.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fourth.imageset/candy_tree_levle_fourth@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fourth.imageset/candy_tree_levle_fourth@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/candy_tree_levle_third@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/candy_tree_levle_third@3x.png create mode 100644 xplan-ios/Main/Room/View/CandyTree/Model/XPCandyTreeAnimationModel.h create mode 100644 xplan-ios/Main/Room/View/CandyTree/Model/XPCandyTreeAnimationModel.m create mode 100644 xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.h create mode 100644 xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.m diff --git a/Gemfile.lock b/Gemfile.lock index d6644dd9..9462fadd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,6 +240,7 @@ GEM PLATFORMS arm64-darwin-20 + ruby DEPENDENCIES fastlane diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 9391ff41..880081db 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -303,6 +303,8 @@ E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = E8DEC99427648FA50078CB70 /* ClientConfig.m */; }; E8DEC98B27637EA50078CB70 /* candyTree_open.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8DEC98927637EA50078CB70 /* candyTree_open.svga */; }; E8DEC98C27637EA50078CB70 /* candyTree_transform.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */; }; + E8DEC98F27643EB30078CB70 /* XPCandyTreeAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E8DEC98E27643EB30078CB70 /* XPCandyTreeAnimationManager.m */; }; + E8DEC992276441AA0078CB70 /* XPCandyTreeAnimationModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8DEC991276441AA0078CB70 /* XPCandyTreeAnimationModel.m */; }; E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7626F2F15100F03460 /* XPMineViewController.m */; }; E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7926F2F16600F03460 /* XPMinePresent.m */; }; E8E70D7E26F2F19D00F03460 /* Api+Mine.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7D26F2F19D00F03460 /* Api+Mine.m */; }; @@ -918,6 +920,10 @@ E8DEC99427648FA50078CB70 /* ClientConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ClientConfig.m; sourceTree = ""; }; E8DEC98927637EA50078CB70 /* candyTree_open.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = candyTree_open.svga; sourceTree = ""; }; E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = candyTree_transform.svga; sourceTree = ""; }; + E8DEC98D27643EB30078CB70 /* XPCandyTreeAnimationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCandyTreeAnimationManager.h; sourceTree = ""; }; + E8DEC98E27643EB30078CB70 /* XPCandyTreeAnimationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCandyTreeAnimationManager.m; sourceTree = ""; }; + E8DEC990276441AA0078CB70 /* XPCandyTreeAnimationModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCandyTreeAnimationModel.h; sourceTree = ""; }; + E8DEC991276441AA0078CB70 /* XPCandyTreeAnimationModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCandyTreeAnimationModel.m; sourceTree = ""; }; E8E70D7526F2F15100F03460 /* XPMineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineViewController.h; sourceTree = ""; }; E8E70D7626F2F15100F03460 /* XPMineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineViewController.m; sourceTree = ""; }; E8E70D7826F2F16600F03460 /* XPMinePresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMinePresent.h; sourceTree = ""; }; @@ -2220,6 +2226,8 @@ E8A03DEB276301EF0098D9EA /* XPCandyTreeRankView.m */, E8A03DFA276350A60098D9EA /* XPCandyTreeGiftView.h */, E8A03DFB276350A60098D9EA /* XPCandyTreeGiftView.m */, + E8DEC98D27643EB30078CB70 /* XPCandyTreeAnimationManager.h */, + E8DEC98E27643EB30078CB70 /* XPCandyTreeAnimationManager.m */, ); path = View; sourceTree = ""; @@ -2242,6 +2250,8 @@ E8A03DF2276328FC0098D9EA /* CandyTreeRecordModel.m */, E8A03DF727634A590098D9EA /* CandyTreeResultModel.h */, E8A03DF827634A590098D9EA /* CandyTreeResultModel.m */, + E8DEC990276441AA0078CB70 /* XPCandyTreeAnimationModel.h */, + E8DEC991276441AA0078CB70 /* XPCandyTreeAnimationModel.m */, ); path = Model; sourceTree = ""; @@ -2875,6 +2885,7 @@ 18EE3FF12750D2AD00A452BF /* NIMTimeUtils.m in Sources */, E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */, E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */, + E8DEC992276441AA0078CB70 /* XPCandyTreeAnimationModel.m in Sources */, E890BC07273CF1800007C46B /* XPGiftCountCollectionViewCell.m in Sources */, E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */, E8EEB90326FC31DC007C6EBA /* XPMineUserInfoProtocol.h in Sources */, @@ -3025,6 +3036,7 @@ E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */, 189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */, E824545626F5E51900BE8163 /* XPMineVerifIdentityViewController.m in Sources */, + E8DEC98F27643EB30078CB70 /* XPCandyTreeAnimationManager.m in Sources */, 186A534726FC6ED900D67B2C /* TTAlertConfig.m in Sources */, 18F403EE2758CF2F00A6C548 /* MessageContentImage.m in Sources */, 18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/Contents.json new file mode 100644 index 00000000..2f26698b --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "candy_tree_levle_fifth@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "candy_tree_levle_fifth@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/candy_tree_levle_fifth@2x.png b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fifth.imageset/candy_tree_levle_fifth@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..b60dbf29f8bfd6c3f406a8c1b2e0e98242ea7d3a GIT binary patch literal 1024 zcmV+b1poVqP)mRR zfd6JQ^TcTK%WU$?YVp`~^VV|n({S^^X7jjV^R!>|tXlM_SoEJ$^qW!ihDG&yKJ(3O z^T%rSZ#ea1G4*yl^RA(b2{~bL-UqS^TTNL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s%;pKQ|M zO%*t#;QIe@^W@2ZTFtAnTx;5Sj|>UmZK2ts+G)MrzG`#PW>iYr0UGkITs=CtF@#s@ zr}F5Gyg(e+@QxEL_ptFO^eR6Q7{|5=@!SSp8a2%Z1 ZgukzX*DRR%1`GfI002ovPDHLkV1mEi_$~kd literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fourth.imageset/candy_tree_levle_fourth@3x.png b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_fourth.imageset/candy_tree_levle_fourth@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..b5ca78f59af8066541a4cda92409461371f7bcb6 GIT binary patch literal 2287 zcmVkKd^1ELDwp;)4hV$@-^X`N5!eafqUH|8Q^x}Hw2UaroSJ_r_-Y+jaQS zZu;eY_0Vnk@P+f(bNI|^`pjzk?1J>oYx~!7`00Q2(r^0IaryFw^TJ^NzhM5rVgBZQ z^yhx{!C?R2c=z&#^vY=b)^YjshWpL4!zus(02_2tPE!|3@&NM+eK#id>%On2dSn#g z-NC%5h*Ut%&Y~ou$N&HbnMp)JRA}DZkKJlwK@fz8{NR&j4C0L-_!C4FBq3fX z9`yZRXM4WsPAO*hupt}Rlr!C3)zv+obQ!q5N&h2mt}g@0bK~Lu?xNs|=(UO($Z)=b zP!El$ikd8l-`zhnPQIn_^Qx-W>uRxHtk>&BWwEjnngv>7x#U1{L9VLGe3g6LTj8%r z0F^1Cdt$kOQsDz^AbZ~$Y_6_;H1sX)!D5il!1@F(wM(V&4o=r80URTJ&1-S!64(eB zb+?|y>|M?2wb;;(Z)sK5sKJq=!>3sSp+O~TipYedbJIB&t;eEjm2YV+1|0{*2T?y= z|IDCn8>+J8MJsv3Dm75N zuPe|VG_O+{tyaU8VK}rigp^u|$_bzfH3yO*3N3N!a&ew64X!Dgu(z3zc$lo$;GI!Q z?L+pC>_-Bn7{Q#!(e*w-*=sSaDRx~=iPDlmJM;(rz+K^YXs703^e^!;{6n+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q8002ov JPDHLkV1nwpfKmVe literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/Contents.json new file mode 100644 index 00000000..e8739e55 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "candy_tree_levle_third@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "candy_tree_levle_third@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/candy_tree_levle_third@2x.png b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/candy_tree_levle_third@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..03c23d31f1da88d747693833f38bcb6af6846806 GIT binary patch literal 781 zcmV+o1M>WdP)DYQFJjxAI+;`DV5A zU61-`x$LBdE` z7-8VNP;rmFtwo5u#f__XpSBg1ukhd4-kwHe{-Xxw(tNLhM($7j>2&HXxl(N>OwfBD ziTjq>b8lh9L*5w^dp+OPxR<@rN9ygsd9_IN1?16dc;PO4nP5Zmsm!$U3+(M!CVSTX zQyqqlQFFj1Jq0VDkZ*M$U+O@<)`5Jg11V*=C}kLiGL(x(DQMV0jdpB?YHL=leQ~21 zrsPF^#SV56*dOo_b;X7HVx`#7#`3uivu=di)*NS&v?|c=k%E;mI|3p`CorBBp$d--#_**MY2F z!urarLuBHNg^DgOawK=Fu3Py}l_nKP$QEd_hy9q*20ppEkvL-CJIDEUo)eJV2(3nRXn4_Of?c&CCt$<0lxG56}X4Cdof684uor&@X(VN7p8&7Bh00000 LNkvXXu0mjfMz)sv literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/candy_tree_levle_third@3x.png b/xplan-ios/Assets.xcassets/Room/CandyTree/candy_tree_levle_third.imageset/candy_tree_levle_third@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..43405ad4136cf14843a376ea4ee4a68d6c92dabc GIT binary patch literal 1392 zcmV-$1&{iPP)Cm@MyU4Y{T$eg#2BE z{#}FpU55N!iThoS`dyLvU6=T3zVTg}_-w=RYrpYmx$<3|_i4NGU6lE2!SP*-`)9ZF zU7_}3t@LED^k1g+UZnP6sr6;D^k%j5VypFCqV`~?^<}j4U7z=3uk>oY@?);^X0!5O zr}STj|8K|n&oZc80000JbW%=J0QTk?VD(_@t(}}=E-qi--ma|H!qq5#MC&gSEOutwRgylv|Wyl^CB%JFB`vi9O`XSkE>PV`qi!t?n&4rx;KLy#q##jRotYnnEz#E}u1CCH>pL($3|hFoSjLo^Rk zkmHxzamjTMhM}le!YI(bidG=R{$ndj z>}KomzxtYu^E~=fW2Lo#NI6n~%ogz25+JA$TCSuG9LWD714pld{Ry$Bx}Qgu=6c>{ z&k}p=(byvqxzy3pAB`-cc_b6trPm;;dQCbS!bw9kg!=G7yPOBRzQ*O+0SkVPm3z6z zQ3Vttq2WS7RHXsx5G57q5|z1d*n3=DNLJ2+EyJ)ZgFj@B2k%jx+Tys-TrQ40Sq`2Q zeI#7T>?E^^Z6TxcF~CKpsn~EH{<$B6+=gKo2=Wn89P|(f{{JIOa@QRc0_q%k(uyLf z^@xJwtMz_&q3uLn1#20nA#?aGV0cE`#aW;5wxSYxIcMAmg5zi8`h_1(N_QR7`Yy~T{^3=#;8^nlm!6q;5>W)lfzX`qb)r3=D4jl%7BT-KKkya3{xlw zK_EOD2(kUy^_^wzf3z1RQAfy+k`&DbA;>Qa0_8lp_cgW;r<=Ya+-=}t!y8G%t|~u* zGZgMtx-t&`xHbCkZ#(-(B$`t3(sRHUmPU)Ai042GP;(516+lzZfHriV41?hVBoV_0 yf$809sD?$WLf)x|q|}C;VxQjlJBxl+F!=*{?b$;f!(#^k0000 +#import +NS_ASSUME_NONNULL_BEGIN + +@interface XPCandyTreeAnimationModel : NSObject +///移除的时间 +@property (nonatomic,assign) CGFloat removeTime; +///是不是移除动画 默认动画完 不移除 +@property (nonatomic,assign) BOOL isRemoveAnimation; +///开始的时间 +@property (nonatomic,assign) CGFloat beginTime; +///动画的key +@property (nonatomic,strong) NSString *animationKey; +///透明度起始值 +@property (nonatomic,assign) CGFloat alphaFromValue; +///透明度变化到的值 +@property (nonatomic,assign) CGFloat alphaToValue; +///持续的时间 +@property (nonatomic,assign) CGFloat durationTime; +///平移的时候动画的开始位置 +@property (nonatomic,assign) CGFloat offsetFromY; +///平移的时候动画的结束位置 +@property (nonatomic,assign) CGFloat offsetToY; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/CandyTree/Model/XPCandyTreeAnimationModel.m b/xplan-ios/Main/Room/View/CandyTree/Model/XPCandyTreeAnimationModel.m new file mode 100644 index 00000000..f12dce19 --- /dev/null +++ b/xplan-ios/Main/Room/View/CandyTree/Model/XPCandyTreeAnimationModel.m @@ -0,0 +1,12 @@ +// +// XPCandyTreeAnimationModel.m +// xplan-ios +// +// Created by 冯硕 on 2021/12/11. +// + +#import "XPCandyTreeAnimationModel.h" + +@implementation XPCandyTreeAnimationModel + +@end diff --git a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.h b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.h new file mode 100644 index 00000000..f804251b --- /dev/null +++ b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.h @@ -0,0 +1,28 @@ +// +// XPCandyTreeAnimationManager.h +// xplan-ios +// +// Created by 冯硕 on 2021/12/11. +// +/** + 开糖果的动画 + 1. 只有一个的时候 alpha 0-1 的动画 然后 alpha 1-0 + 2. 当第一个还没结束的时候第二个来了 第一个执行平移动画 向上移动 第二个做alpha 0-1 如果没有第三个的话 第一个 先执行 aplha 1-0 完成之后 第二个执行alpha 1-0 + 3. 第三个 同上面的逻辑 + 4. 第四个来的时候 第一个消失 第二个移动到第一个位置 第三个移动到第二个的位置 第四个执行alpha 0-1 + */ + +#import + +NS_ASSUME_NONNULL_BEGIN +@class CandyTreeGiftInfoModel; +@interface XPCandyTreeAnimationManager : NSObject + +///动画需要在什么地方执行 +@property (nonatomic,strong) UIView * containerView; + +- (void)receiveCandyTreeGift:(CandyTreeGiftInfoModel *)giftInfo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.m b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.m new file mode 100644 index 00000000..4c8d3f6d --- /dev/null +++ b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeAnimationManager.m @@ -0,0 +1,291 @@ +// +// XPCandyTreeAnimationManager.m +// xplan-ios +// +// Created by 冯硕 on 2021/12/11. +// + +#import "XPCandyTreeAnimationManager.h" +///Third +#import +#import "XPCandyTreeGiftView.h" +#import "XPCandyTreeAnimationModel.h" +#import "CandyTreeResultModel.h" + +#define KitemHeight 20 +#define KitemMargin 5 + +@interface XPCandyTreeAnimationManager () +///存放所有需要显示的礼物的 +@property (strong, nonatomic) NSMutableArray*giftAnimateQueue; +///可见池 +@property (strong,nonatomic)NSMutableArray * giftVisiablePool; +///Timer +@property (nonatomic ,strong)dispatch_source_t timer; +///是否正在动画 +@property (nonatomic,assign) BOOL isAnimationing; +///view的中心 +@property (nonatomic,assign) CGFloat offsetY; +@end + +@implementation XPCandyTreeAnimationManager + +- (void)receiveCandyTreeGift:(CandyTreeGiftInfoModel *)giftInfo { + XPCandyTreeGiftView * newAnimaView = [[XPCandyTreeGiftView alloc] init]; + newAnimaView.giftInfo = giftInfo; + NSString * giftTitle = [NSString stringWithFormat:@"%@ x %d", giftInfo.prizeName, giftInfo.prizeNum]; + CGFloat widht = [giftTitle boundingRectWithSize:CGSizeMake(200, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10]} context:nil].size.width + 10; + newAnimaView.frame = CGRectMake(7, 291, widht, KitemHeight); + self.offsetY = newAnimaView.center.y; + newAnimaView.alpha = 0; + ///把所有收到的礼物加到队列中 + [self.giftAnimateQueue addObject:newAnimaView]; + if (self.timer == nil) { + [self startTheGiftQueueTimer]; + } +} + +//扫描礼物队列 +- (void)startTheGiftQueueTimer { + ///没0.3秒刷新一次 + NSTimeInterval period = 0.3; //设置时间间隔 + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0), period * NSEC_PER_SEC, 0); //每秒执行 + dispatch_source_set_event_handler(_timer, ^{ + if (self.giftAnimateQueue.count > 0) { + dispatch_sync(dispatch_get_main_queue(), ^{ + //handle gift + if (!self.isAnimationing) { + if (self.giftAnimateQueue.count > 0) { + [self beginSendGiftAnimation1]; + } + } + }); + } else { + dispatch_source_cancel(_timer); + self.timer = nil; + } + + }); + dispatch_resume(_timer); + self.timer = _timer; +} + +- (void)beginSendGiftAnimation1 { + if (self.giftVisiablePool.count == 0) {///当前没有显示 + self.isAnimationing = YES; + XPCandyTreeGiftView * animaView = [self.giftAnimateQueue firstObject]; + [self.containerView addSubview:animaView]; + [self.giftVisiablePool addObject:animaView]; + ////加到了 显示的池中 从队列中移除 + [self.giftAnimateQueue removeObject:animaView]; + ///显示 + XPCandyTreeAnimationModel * model = [[XPCandyTreeAnimationModel alloc] init]; + model.animationKey = kPOPViewAlpha; + model.alphaFromValue = 0; + model.alphaToValue = 1; + model.beginTime = 0; + model.durationTime = 1; + model.removeTime = 2; + model.isRemoveAnimation = YES; + [animaView createAnimationWithAnimations:model finishBlock:^(BOOL finish) { + [animaView removeFromSuperview]; + [self.giftVisiablePool removeObject:animaView]; + } complete:^(BOOL complete) { + self.isAnimationing = NO; + }]; + + } else if(self.giftVisiablePool.count == 1) {///当前显示一个 + self.isAnimationing = YES; + ///在第一个已经显示的情况下 并且已经移除了的话 如果还有的话 那就继续显示第二个 + XPCandyTreeGiftView * currentVisibalView = [self.giftVisiablePool objectAtIndex:0]; + currentVisibalView.alpha = 1; + ///显示第二的时候 需要把第一个的动画 取消不然等会第一个就消失了 + [currentVisibalView canclueRemoveAnimation]; + ///需要显示view + XPCandyTreeGiftView * needVisiableReceiveInfor = [self.giftAnimateQueue objectAtIndex:0]; + needVisiableReceiveInfor.alpha = 1; + [self.containerView addSubview:needVisiableReceiveInfor]; + [self.containerView bringSubviewToFront:currentVisibalView]; + [self.giftVisiablePool addObject:needVisiableReceiveInfor]; + [self.giftAnimateQueue removeObject:needVisiableReceiveInfor]; + + XPCandyTreeAnimationModel * secondModel = [[XPCandyTreeAnimationModel alloc] init]; + secondModel.animationKey = kPOPViewCenter; + secondModel.offsetFromY = self.offsetY; + secondModel.offsetToY = self.offsetY-KitemHeight - KitemMargin; + secondModel.beginTime = 0; + secondModel.durationTime = 1; + secondModel.isRemoveAnimation = YES; + secondModel.removeTime = 2; + [currentVisibalView createAnimationWithAnimations:secondModel finishBlock:^(BOOL finish) { + ///a 1-0 结束的时候 + [currentVisibalView removeFromSuperview]; + [self.giftAnimateQueue removeObject:currentVisibalView]; + ///结束的时候才移除队列 + [self.giftAnimateQueue removeObject:needVisiableReceiveInfor]; + [needVisiableReceiveInfor removeFromSuperview]; + } complete:^(BOOL complete) { + self.isAnimationing = NO; + }]; + }else if(self.giftVisiablePool.count == 2) {///当前显示两个 + self.isAnimationing = YES; + ///最上面的view + XPCandyTreeGiftView * topVisiableView = [self.giftVisiablePool objectAtIndex:0]; + ///中间的那个view + XPCandyTreeGiftView * middleVisiableView = [self.giftVisiablePool objectAtIndex:1]; + + ///需要显示的的那个view + XPCandyTreeGiftView * needVisiableView = [self.giftAnimateQueue objectAtIndex:0]; + [self.containerView addSubview:needVisiableView]; + [self.giftVisiablePool addObject:needVisiableView]; + [self.giftAnimateQueue removeObject:needVisiableView]; + ///取消移除的动画 + [topVisiableView canclueRemoveAnimation]; + [middleVisiableView canclueRemoveAnimation]; + + XPCandyTreeAnimationModel * topPositionModel = [[XPCandyTreeAnimationModel alloc] init]; + topPositionModel.animationKey = kPOPViewCenter; + topPositionModel.offsetToY = self.offsetY -KitemHeight * 2 - KitemMargin * 2; + topPositionModel.offsetFromY = self.offsetY -KitemHeight - KitemMargin; + topPositionModel.beginTime = 0; + topPositionModel.durationTime = 1; + topPositionModel.isRemoveAnimation = YES; + topPositionModel.removeTime = 4; + [topVisiableView createAnimationWithAnimations:topPositionModel finishBlock:^(BOOL finish) { + [topVisiableView removeFromSuperview]; + [self.giftVisiablePool removeObject:topVisiableView]; + [middleVisiableView removeAmimation]; + } complete:^(BOOL complete) { + + }]; + + XPCandyTreeAnimationModel * middlePositionModel = [[XPCandyTreeAnimationModel alloc] init]; + middlePositionModel.animationKey = kPOPViewCenter; + middlePositionModel.offsetToY = self.offsetY -KitemHeight - KitemMargin; + middlePositionModel.offsetFromY = self.offsetY; + middlePositionModel.beginTime = 0.5; + middlePositionModel.durationTime = 1; + middlePositionModel.isRemoveAnimation = NO; + [middleVisiableView createAnimationWithAnimations:middlePositionModel finishBlock:^(BOOL finish) { + [middleVisiableView removeFromSuperview]; + [self.giftVisiablePool removeObject:topVisiableView]; + [needVisiableView removeAmimation]; + } complete:^(BOOL complete) { + + }]; + + ///显示 + XPCandyTreeAnimationModel * dowAlphtmodel = [[XPCandyTreeAnimationModel alloc] init]; + dowAlphtmodel.animationKey = kPOPViewAlpha; + dowAlphtmodel.alphaFromValue = 0; + dowAlphtmodel.alphaToValue = 1; + dowAlphtmodel.beginTime = 1; + dowAlphtmodel.durationTime = 1; + dowAlphtmodel.isRemoveAnimation = NO; + [needVisiableView createAnimationWithAnimations:dowAlphtmodel finishBlock:^(BOOL finish) { + [self.giftVisiablePool removeObject:needVisiableView]; + [needVisiableView removeFromSuperview]; + } complete:^(BOOL complete) { + self.isAnimationing = NO; + }]; + } else if(self.giftVisiablePool.count == 3) {///当前显示三个的 + self.isAnimationing = YES; + ///最上面的view + XPCandyTreeGiftView * topVisiableView = [self.giftVisiablePool objectAtIndex:0]; + ///中间的那个view + XPCandyTreeGiftView * middleVisiableView = [self.giftVisiablePool objectAtIndex:1]; + ///底部的那个view + XPCandyTreeGiftView * downVisiavleView = [self.giftVisiablePool objectAtIndex:2]; + ///需要显示的view + XPCandyTreeGiftView * needVisiavleView = [self.giftAnimateQueue objectAtIndex:0]; + [self.containerView addSubview:needVisiavleView]; + + [self.giftVisiablePool addObject:needVisiavleView]; + ///移除最上面的哪一个 + [self.giftVisiablePool removeObject:topVisiableView]; + + [self.giftAnimateQueue removeObject:needVisiavleView]; + ///取消移除的动画 + [topVisiableView canclueRemoveAnimation]; + [middleVisiableView canclueRemoveAnimation]; + [downVisiavleView canclueRemoveAnimation]; + + ///隐藏 + XPCandyTreeAnimationModel * model = [[XPCandyTreeAnimationModel alloc] init]; + model.animationKey = kPOPViewAlpha; + model.alphaFromValue = 1; + model.alphaToValue = 0; + model.beginTime = 0; + model.durationTime = 0.5; + model.isRemoveAnimation = NO; + [topVisiableView createAnimationWithAnimations:model finishBlock:^(BOOL finish) {///消失动画完成 + + } complete:^(BOOL complete) {///这一组动画完成 + [topVisiableView removeFromSuperview]; + }]; + + + XPCandyTreeAnimationModel * middlePositionModel = [[XPCandyTreeAnimationModel alloc] init]; + middlePositionModel.animationKey = kPOPViewCenter; + middlePositionModel.offsetToY = self.offsetY -KitemHeight * 2 - KitemMargin * 2; + middlePositionModel.offsetFromY = self.offsetY -KitemHeight - KitemMargin; + middlePositionModel.beginTime = 0.5; + middlePositionModel.durationTime = 1; + middlePositionModel.isRemoveAnimation = YES; + middlePositionModel.removeTime = 4; + [middleVisiableView createAnimationWithAnimations:middlePositionModel finishBlock:^(BOOL finish) { + [middleVisiableView removeFromSuperview]; + [downVisiavleView removeAmimation]; + [self.giftVisiablePool removeObject:middleVisiableView]; + } complete:^(BOOL complete) { + ///动画已经上去了 可以开始下一个动画 + }]; + + XPCandyTreeAnimationModel * downPositionModel = [[XPCandyTreeAnimationModel alloc] init]; + downPositionModel.animationKey = kPOPViewCenter; + downPositionModel.offsetToY = self.offsetY -KitemHeight - KitemMargin; + downPositionModel.offsetFromY = self.offsetY; + downPositionModel.beginTime = 1; + downPositionModel.durationTime = 1; + downPositionModel.isRemoveAnimation = NO; + [downVisiavleView createAnimationWithAnimations:downPositionModel finishBlock:^(BOOL finish) { + [downVisiavleView removeFromSuperview]; + [self.giftVisiablePool removeObject:downVisiavleView]; + [needVisiavleView removeAmimation]; + } complete:^(BOOL complete) { + + }]; + + ///最下面的那个 + XPCandyTreeAnimationModel * newModel = [[XPCandyTreeAnimationModel alloc] init]; + newModel.animationKey = kPOPViewAlpha; + newModel.alphaFromValue = 0; + newModel.alphaToValue = 1; + newModel.beginTime = 1.5; + newModel.durationTime = 0.5; + newModel.isRemoveAnimation = NO; + [needVisiavleView createAnimationWithAnimations:newModel finishBlock:^(BOOL finish) {///消失动画完成 + [needVisiavleView removeFromSuperview]; + [self.giftVisiablePool removeObject:needVisiavleView]; + } complete:^(BOOL complete) {///这一组动画完成 + self.isAnimationing = NO; + }]; + } +} + +#pragma mark - Getters And Setters +- (NSMutableArray *)giftAnimateQueue { + if (!_giftAnimateQueue) { + _giftAnimateQueue = [NSMutableArray array]; + } + return _giftAnimateQueue; +} + +- (NSMutableArray *)giftVisiablePool { + if (!_giftVisiablePool) { + _giftVisiablePool = [NSMutableArray array]; + } + return _giftVisiablePool; +} +@end diff --git a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.h b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.h index 474558b8..c6c85460 100644 --- a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.h +++ b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.h @@ -8,10 +8,16 @@ #import NS_ASSUME_NONNULL_BEGIN -@class CandyTreeGiftInfoModel; +@class CandyTreeGiftInfoModel, XPCandyTreeAnimationModel; @interface XPCandyTreeGiftView : UIView ///礼物的信息 @property (nonatomic,strong) CandyTreeGiftInfoModel *giftInfo; +///取消动画 +- (void)canclueRemoveAnimation; +///隐藏View +- (void)removeAmimation; +/// 开始动画 finishBlock 是一组动画完成 比如 alpha 0-1 然后再 1-0 complete 是XPCandyTreeAnimationModel 中的动画完成 +- (void)createAnimationWithAnimations:(XPCandyTreeAnimationModel *)model finishBlock:(void(^)(BOOL finish))finishBlock complete:(void(^)(BOOL complete))complete; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.m b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.m index 754cfe7c..b71fa16e 100644 --- a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.m +++ b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeGiftView.m @@ -7,14 +7,18 @@ #import "XPCandyTreeGiftView.h" ///Third +#import #import #import "CandyTreeResultModel.h" +#import "XPCandyTreeAnimationModel.h" @interface XPCandyTreeGiftView () ///礼物背景 @property (nonatomic,strong) UIImageView *backImageView; ///显示文字 @property (nonatomic,strong) UILabel *titleLabel; +///动画完成 +@property (nonatomic,copy) void(^FinishBlock)(BOOL finish); @end @implementation XPCandyTreeGiftView @@ -28,6 +32,60 @@ return self; } +#pragma mark - Public Method +///取消动画 +- (void)canclueRemoveAnimation { + [[self class] cancelPreviousPerformRequestsWithTarget:self]; +} + +/// 开始动画 +- (void)createAnimationWithAnimations:(XPCandyTreeAnimationModel *)model finishBlock:(void(^)(BOOL finish))finishBlock complete:(void(^)(BOOL complete))complete { + self.FinishBlock = finishBlock; + ///只有两个动画 一个平移的 一个alpha + if (model.animationKey == kPOPViewAlpha) { + POPBasicAnimation * OpacitySpring = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha]; + OpacitySpring.beginTime = CACurrentMediaTime() + model.beginTime; + OpacitySpring.toValue = @(model.alphaToValue); + OpacitySpring.fromValue = @(model.alphaFromValue); + OpacitySpring.duration = model.durationTime; + OpacitySpring.completionBlock = ^(POPAnimation *anim, BOOL finished) { + complete(finished); + }; + if (model.isRemoveAnimation) { + [self performSelector:@selector(removeAmimation) withObject:nil afterDelay:model.removeTime]; + } + [self pop_addAnimation:OpacitySpring forKey:@"OpacitySpring"]; + } else { + POPBasicAnimation *anSpring = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; + anSpring.fromValue = [NSValue valueWithCGPoint:CGPointMake(self.center.x, model.offsetFromY)];; + anSpring.toValue = [NSValue valueWithCGPoint:CGPointMake(self.center.x, model.offsetToY)];;; + anSpring.beginTime = CACurrentMediaTime() + model.beginTime; + anSpring.duration = model.durationTime; + anSpring.completionBlock = ^(POPAnimation *anim, BOOL finished) { + complete(finished); + }; + if (model.isRemoveAnimation) { + [self performSelector:@selector(removeAmimation) withObject:nil afterDelay:model.removeTime]; + } + [self pop_addAnimation:anSpring forKey:@"OpacitySpring"]; + } +} + +///隐藏View +- (void)removeAmimation { + POPBasicAnimation * OpacitySpring1 = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha]; + OpacitySpring1.beginTime = CACurrentMediaTime(); + OpacitySpring1.toValue = @(0); + OpacitySpring1.fromValue = @(1); + OpacitySpring1.duration = 0.5; + OpacitySpring1.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if(finished && self.FinishBlock){ + self.FinishBlock(YES); + } + }; + [self pop_addAnimation:OpacitySpring1 forKey:@"OpacitySpring"]; +} + #pragma mark - Private Method - (void)initSubViews { [self addSubview:self.backImageView]; @@ -36,9 +94,8 @@ - (void)initSubViewConstraints { [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self); + make.left.right.centerY.mas_equalTo(self); make.height.mas_equalTo(19); - make.right.mas_equalTo(self.titleLabel.mas_right).offset(3); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { @@ -50,15 +107,11 @@ - (void)setGiftInfo:(CandyTreeGiftInfoModel *)giftInfo { _giftInfo = giftInfo; if (_giftInfo) { - NSString * backImage= @""; - if (giftInfo.prizeLevel == CandyTreeGiftLevel_First) { - backImage = @""; - } else if(giftInfo.prizeLevel == CandyTreeGiftLevel_Second) { - backImage = @""; - } else if(giftInfo.prizeLevel == CandyTreeGiftLevel_Third) { - backImage = @""; - } else if(giftInfo.prizeLevel == CandyTreeGiftLevel_Four) { - backImage = @""; + NSString * backImage= @"candy_tree_levle_third"; + if(giftInfo.prizeLevel == CandyTreeGiftLevel_Fourth) { + backImage = @"candy_tree_levle_fourth"; + } else if(giftInfo.prizeLevel == CandyTreeGiftLevel_Fifth) { + backImage = @"candy_tree_levle_fifth"; } self.backImageView.image = [UIImage imageNamed:backImage]; if (_giftInfo.prizeName.length > 7) { @@ -67,6 +120,7 @@ NSString * giftTitle = [NSString stringWithFormat:@"%@ x %d", _giftInfo.prizeName, _giftInfo.prizeNum]; self.titleLabel.text = giftTitle; } + [self layoutIfNeeded]; } - (UIImageView *)backImageView { diff --git a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeViewController.m b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeViewController.m index 1b1c4e4e..964732a6 100644 --- a/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeViewController.m +++ b/xplan-ios/Main/Room/View/CandyTree/View/XPCandyTreeViewController.m @@ -15,6 +15,7 @@ #import "ThemeColor.h" #import "TTPopup.h" #import "XPHtmlUrl.h" +#import "XPCandyTreeAnimationManager.h" ///Model #import "RoomInfoModel.h" #import "AttachMentModel.h" @@ -84,6 +85,8 @@ @property (nonatomic,weak) idhostDelegate; ///是否正在采摘 @property (nonatomic,assign) BOOL isPicking; +///送礼物的动画 +@property (nonatomic,strong) XPCandyTreeAnimationManager *giftManager; @end @implementation XPCandyTreeViewController @@ -130,6 +133,11 @@ self.isPicking = NO; self.countLabel.text = result.remainKeyNum > 0 ? [NSString stringWithFormat:@"%ld", result.remainKeyNum] : @"0"; self.candyInfo.keyNum = result.remainKeyNum; + + [result.prizeItemList enumerateObjectsUsingBlock:^(CandyTreeGiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [self.giftManager receiveCandyTreeGift:obj]; + }]; + @kWeakify(self); [self.parser parseWithNamed:@"candyTree_transform" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { @kStrongify(self); @@ -607,5 +615,13 @@ return _pickButton; } +- (XPCandyTreeAnimationManager *)giftManager { + if (!_giftManager) { + _giftManager = [[XPCandyTreeAnimationManager alloc] init]; + _giftManager.containerView = self.backView; + } + return _giftManager; +} + @end diff --git a/xplan-ios/Main/Room/View/MessageContainerView/XPRoomMessageContainerView.m b/xplan-ios/Main/Room/View/MessageContainerView/XPRoomMessageContainerView.m index f619e3d7..4d2c7014 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/xplan-ios/Main/Room/View/MessageContainerView/XPRoomMessageContainerView.m @@ -146,7 +146,6 @@ NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { AttachmentModel *attachment = (AttachmentModel *)obj.attachment; - NSLog(@"%@", attachment); return [[[self supportMessageDic] objectForKey:@(attachment.first)] containsObject:@(attachment.second)]; } return NO;