Skip to content

Commit 04a7313

Browse files
committed
更改冒泡显示样式
1 parent a3071bd commit 04a7313

13 files changed

+158
-70
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
4E2719C71AB07ED6006AE214 /* dot_line@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E2719C61AB07ED6006AE214 /* dot_line@2x.png */; };
117117
4E2906A21A403B7D008A5B97 /* FileDownloadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E2906A11A403B7D008A5B97 /* FileDownloadView.m */; };
118118
4E2BF3BC1B957D4F00A5A0A8 /* file_activity_icon_delete_history@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E2BF3BB1B957D4F00A5A0A8 /* file_activity_icon_delete_history@2x.png */; };
119+
4E2BF3C21B95B97A00A5A0A8 /* tweet_btn_comment@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E2BF3BE1B95B97A00A5A0A8 /* tweet_btn_comment@2x.png */; };
120+
4E2BF3C31B95B97A00A5A0A8 /* tweet_btn_like@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E2BF3BF1B95B97A00A5A0A8 /* tweet_btn_like@2x.png */; };
121+
4E2BF3C41B95B97A00A5A0A8 /* tweet_btn_liked@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E2BF3C01B95B97A00A5A0A8 /* tweet_btn_liked@2x.png */; };
122+
4E2BF3C51B95B97A00A5A0A8 /* tweet_btn_share@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E2BF3C11B95B97A00A5A0A8 /* tweet_btn_share@2x.png */; };
119123
4E35A99F1A3EC47E00CE35F1 /* FileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E35A99E1A3EC47E00CE35F1 /* FileViewController.m */; };
120124
4E38CF5F1A7A28AF005536C0 /* CodeBranchTagButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E38CF5E1A7A28AF005536C0 /* CodeBranchTagButton.m */; };
121125
4E38CF621A7B7C99005536C0 /* CodeBranchOrTag.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E38CF611A7B7C99005536C0 /* CodeBranchOrTag.m */; };
@@ -606,7 +610,6 @@
606610
8E6F1C951A03BD6000BF79C8 /* ProjectMemberActivityListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E6F1C941A03BD6000BF79C8 /* ProjectMemberActivityListViewController.m */; };
607611
8E7612F41A08B1EA005BE797 /* tipIcon_TaskComment@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E7612F31A08B1EA005BE797 /* tipIcon_TaskComment@2x.png */; };
608612
8E80296D19F4E23100A470A2 /* creator_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E80296C19F4E23100A470A2 /* creator_image@2x.png */; };
609-
8E872CFE19EFEF0C002C8F34 /* tweet_like_btn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E872CFD19EFEF0C002C8F34 /* tweet_like_btn@2x.png */; };
610613
8E872D0019EFEFF7002C8F34 /* tweet_more_comment_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E872CFF19EFEFF7002C8F34 /* tweet_more_comment_icon@2x.png */; };
611614
8E8F7B2C19EF6306006BA8BD /* btn_followed_both@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E8F7B2219EF6306006BA8BD /* btn_followed_both@2x.png */; };
612615
8E8F7B2D19EF6306006BA8BD /* btn_followed_not@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E8F7B2319EF6306006BA8BD /* btn_followed_not@2x.png */; };
@@ -759,7 +762,6 @@
759762
8EA6D1A019E240C40076D59C /* tipIcon_TweetLike@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EA6CFBB19E240C40076D59C /* tipIcon_TweetLike@2x.png */; };
760763
8EA6D1A119E240C40076D59C /* tipIcon_UserFollow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EA6CFBC19E240C40076D59C /* tipIcon_UserFollow@2x.png */; };
761764
8EA6D1A319E240C40076D59C /* tweet_comment_btn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EA6CFBE19E240C40076D59C /* tweet_comment_btn@2x.png */; };
762-
8EA6D1A519E240C40076D59C /* tweet_liked_btn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EA6CFC019E240C40076D59C /* tweet_liked_btn@2x.png */; };
763765
8EA6D1A819E240C40076D59C /* xtsegment_bordor_left@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EA6CFC319E240C40076D59C /* xtsegment_bordor_left@2x.png */; };
764766
8EA6D1AA19E240C40076D59C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8EA6CFC519E240C40076D59C /* Images.xcassets */; };
765767
8EA6D1AB19E240C40076D59C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EA6CFC619E240C40076D59C /* main.m */; };
@@ -1046,6 +1048,10 @@
10461048
4E2906A01A403B7D008A5B97 /* FileDownloadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileDownloadView.h; sourceTree = "<group>"; };
10471049
4E2906A11A403B7D008A5B97 /* FileDownloadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileDownloadView.m; sourceTree = "<group>"; };
10481050
4E2BF3BB1B957D4F00A5A0A8 /* file_activity_icon_delete_history@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_activity_icon_delete_history@2x.png"; sourceTree = "<group>"; };
1051+
4E2BF3BE1B95B97A00A5A0A8 /* tweet_btn_comment@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_btn_comment@2x.png"; sourceTree = "<group>"; };
1052+
4E2BF3BF1B95B97A00A5A0A8 /* tweet_btn_like@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_btn_like@2x.png"; sourceTree = "<group>"; };
1053+
4E2BF3C01B95B97A00A5A0A8 /* tweet_btn_liked@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_btn_liked@2x.png"; sourceTree = "<group>"; };
1054+
4E2BF3C11B95B97A00A5A0A8 /* tweet_btn_share@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_btn_share@2x.png"; sourceTree = "<group>"; };
10491055
4E35A99D1A3EC47E00CE35F1 /* FileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileViewController.h; sourceTree = "<group>"; };
10501056
4E35A99E1A3EC47E00CE35F1 /* FileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileViewController.m; sourceTree = "<group>"; };
10511057
4E38CF5D1A7A28AF005536C0 /* CodeBranchTagButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeBranchTagButton.h; sourceTree = "<group>"; };
@@ -1809,7 +1815,6 @@
18091815
8E6F1C941A03BD6000BF79C8 /* ProjectMemberActivityListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectMemberActivityListViewController.m; sourceTree = "<group>"; };
18101816
8E7612F31A08B1EA005BE797 /* tipIcon_TaskComment@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_TaskComment@2x.png"; sourceTree = "<group>"; };
18111817
8E80296C19F4E23100A470A2 /* creator_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "creator_image@2x.png"; sourceTree = "<group>"; };
1812-
8E872CFD19EFEF0C002C8F34 /* tweet_like_btn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_like_btn@2x.png"; sourceTree = "<group>"; };
18131818
8E872CFF19EFEFF7002C8F34 /* tweet_more_comment_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_more_comment_icon@2x.png"; sourceTree = "<group>"; };
18141819
8E8F7B2219EF6306006BA8BD /* btn_followed_both@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_followed_both@2x.png"; sourceTree = "<group>"; };
18151820
8E8F7B2319EF6306006BA8BD /* btn_followed_not@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_followed_not@2x.png"; sourceTree = "<group>"; };
@@ -1989,7 +1994,6 @@
19891994
8EA6CFBB19E240C40076D59C /* tipIcon_TweetLike@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_TweetLike@2x.png"; sourceTree = "<group>"; };
19901995
8EA6CFBC19E240C40076D59C /* tipIcon_UserFollow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_UserFollow@2x.png"; sourceTree = "<group>"; };
19911996
8EA6CFBE19E240C40076D59C /* tweet_comment_btn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_comment_btn@2x.png"; sourceTree = "<group>"; };
1992-
8EA6CFC019E240C40076D59C /* tweet_liked_btn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tweet_liked_btn@2x.png"; sourceTree = "<group>"; };
19931997
8EA6CFC319E240C40076D59C /* xtsegment_bordor_left@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xtsegment_bordor_left@2x.png"; sourceTree = "<group>"; };
19941998
8EA6CFC419E240C40076D59C /* xtsegment_bordor_right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "xtsegment_bordor_right@2x.png"; sourceTree = "<group>"; };
19951999
8EA6CFC519E240C40076D59C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
@@ -2420,6 +2424,17 @@
24202424
path = NProjectViewController;
24212425
sourceTree = "<group>";
24222426
};
2427+
4E2BF3BD1B95B97A00A5A0A8 /* tweet_btn */ = {
2428+
isa = PBXGroup;
2429+
children = (
2430+
4E2BF3BE1B95B97A00A5A0A8 /* tweet_btn_comment@2x.png */,
2431+
4E2BF3BF1B95B97A00A5A0A8 /* tweet_btn_like@2x.png */,
2432+
4E2BF3C01B95B97A00A5A0A8 /* tweet_btn_liked@2x.png */,
2433+
4E2BF3C11B95B97A00A5A0A8 /* tweet_btn_share@2x.png */,
2434+
);
2435+
path = tweet_btn;
2436+
sourceTree = "<group>";
2437+
};
24232438
4E53EB4C1AF9CC520034FE1C /* RKSwipeBetweenViewControllers */ = {
24242439
isa = PBXGroup;
24252440
children = (
@@ -3748,6 +3763,7 @@
37483763
8EA6CF5D19E240C40076D59C /* Images */ = {
37493764
isa = PBXGroup;
37503765
children = (
3766+
4E2BF3BD1B95B97A00A5A0A8 /* tweet_btn */,
37513767
4E93F2341B84356500017916 /* file_menu_icon */,
37523768
4EAE06BB1B7B51AF00179F4B /* file_activity_icon */,
37533769
4E0022A11B7362EF005308DE /* intro_pages */,
@@ -3796,8 +3812,6 @@
37963812
8EA6CFA619E240C40076D59C /* tabbar_background@2x.png */,
37973813
8EA6CFA819E240C40076D59C /* tasks_all@2x.png */,
37983814
8EA6CFBE19E240C40076D59C /* tweet_comment_btn@2x.png */,
3799-
8E872CFD19EFEF0C002C8F34 /* tweet_like_btn@2x.png */,
3800-
8EA6CFC019E240C40076D59C /* tweet_liked_btn@2x.png */,
38013815
8E872CFF19EFEFF7002C8F34 /* tweet_more_comment_icon@2x.png */,
38023816
8EA6CFC319E240C40076D59C /* xtsegment_bordor_left@2x.png */,
38033817
8EA6CFC419E240C40076D59C /* xtsegment_bordor_right@2x.png */,
@@ -4563,6 +4577,7 @@
45634577
7E8E59831B6F91C40083CA02 /* bubble_right_play_1@2x.png in Resources */,
45644578
8B3516511B6CE9460049BC45 /* search_tweet_colck@2x.png in Resources */,
45654579
8E97CE6A1A0A3424006F9AD7 /* keyboard_page_unselected@2x.png in Resources */,
4580+
4E2BF3C31B95B97A00A5A0A8 /* tweet_btn_like@2x.png in Resources */,
45664581
4E07D3161A4D3CA6009EDDF2 /* logo_coding@2x.png in Resources */,
45674582
4E96E7D91A1B537E0037C098 /* icon_file_apk@2x.png in Resources */,
45684583
4E996C021ABBF56A00C704F1 /* n_btn_followed_both@2x.png in Resources */,
@@ -4677,7 +4692,6 @@
46774692
4E07D3151A4D3CA6009EDDF2 /* icon_user_monkey@2x.png in Resources */,
46784693
8EA6D17519E240C40076D59C /* placeholder_coding_square_80@2x.png in Resources */,
46794694
B94C1B6B1AC945FB0000C271 /* NewProject.storyboard in Resources */,
4680-
8EA6D1A519E240C40076D59C /* tweet_liked_btn@2x.png in Resources */,
46814695
8ED2AAFA19F60D5200607A1D /* loading_loop@2x.png in Resources */,
46824696
8B3516501B6CE9460049BC45 /* icon_topic_hotTop@2x.png in Resources */,
46834697
4EE1A23D1B5F3834004284F1 /* project_tag_btn@2x.png in Resources */,
@@ -4756,6 +4770,7 @@
47564770
4EF17EE51B3C3112003CDD2D /* intro_tip_4@3x.png in Resources */,
47574771
8E97CEB41A0C7E26006F9AD7 /* coding_emoji_29@2x.png in Resources */,
47584772
4EAE06C11B7B51AF00179F4B /* file_activity_icon_move_file@2x.png in Resources */,
4773+
4E2BF3C21B95B97A00A5A0A8 /* tweet_btn_comment@2x.png in Resources */,
47594774
8EA6D18A19E240C40076D59C /* task_selected@2x.png in Resources */,
47604775
4EB845341AB83C3B0030DC69 /* git_icon_star@2x.png in Resources */,
47614776
8E97CE641A0A3424006F9AD7 /* keyboard_emotion@2x.png in Resources */,
@@ -4774,6 +4789,7 @@
47744789
4EF17ED81B3C3112003CDD2D /* intro_icon_4@3x.png in Resources */,
47754790
4EAE06921B7880BA00179F4B /* me_info_arrow_left@2x.png in Resources */,
47764791
4E5F39071ACBFDCD0010515D /* keyboard_photo@2x.png in Resources */,
4792+
4E2BF3C51B95B97A00A5A0A8 /* tweet_btn_share@2x.png in Resources */,
47774793
4E0022A91B7362EF005308DE /* intro_page0_ip6@2x.png in Resources */,
47784794
4E76D4DE1A5A7B4A0094A35E /* text_clear_btn@2x.png in Resources */,
47794795
4E96E7E41A1B537E0037C098 /* icon_file_xls@2x.png in Resources */,
@@ -4794,7 +4810,6 @@
47944810
8EA6D17F19E240C40076D59C /* section_btn_open@2x.png in Resources */,
47954811
4EACB4411A2C448F0097ABB3 /* button_file_move_unable@2x.png in Resources */,
47964812
4E0BD8851B6C7F0A0061CAA6 /* mock_topicAdlist.geojson in Resources */,
4797-
8E872CFE19EFEF0C002C8F34 /* tweet_like_btn@2x.png in Resources */,
47984813
8EA6D17419E240C40076D59C /* placeholder_coding_square_55@2x.png in Resources */,
47994814
8E8F7B3119EF6306006BA8BD /* btn_privateMsg_stranger@2x.png in Resources */,
48004815
4E03AC9A1A5BDDF9002B000B /* STARTIMAGE.jpg in Resources */,
@@ -4937,6 +4952,7 @@
49374952
8E97CE521A0A3410006F9AD7 /* addUserBtn_Nav@2x.png in Resources */,
49384953
4EAE06A71B7B1AE100179F4B /* button_file_activity@2x.png in Resources */,
49394954
4EAE06C21B7B51AF00179F4B /* file_activity_icon_update_file@2x.png in Resources */,
4955+
4E2BF3C41B95B97A00A5A0A8 /* tweet_btn_liked@2x.png in Resources */,
49404956
8EC911291A027A54009EAE99 /* nav_project_code@2x.png in Resources */,
49414957
4E6383C41B3265DC00D98648 /* mrpr_icon_arrow@2x.png in Resources */,
49424958
4EED9DD11B53BBCF000E5827 /* twoFABtn_Nav@2x.png in Resources */,
Loading
876 Bytes
Loading
Loading
877 Bytes
Loading
-2.18 KB
Binary file not shown.
-2.07 KB
Binary file not shown.

Coding_iOS/Util/OC_Category/UIButton+Common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@
2424
- (void)configPriMsgBtnWithUser:(User *)curUser fromCell:(BOOL)fromCell;
2525
+ (UIButton *)btnPriMsgWithUser:(User *)curUser;
2626

27+
+ (UIButton *)tweetBtnWithFrame:(CGRect)frame image:(NSString *)imageName;
28+
- (void)animateToImage:(NSString *)imageName;
2729
@end

Coding_iOS/Util/OC_Category/UIButton+Common.m

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import "UIButton+Common.h"
1010
#import "Login.h"
11+
#import <POP+MCAnimate/POP+MCAnimate.h>
12+
#import <math.h>
1113

1214
@implementation UIButton (Common)
1315
+ (UIButton *)buttonWithTitle:(NSString *)title titleColor:(UIColor *)color{
@@ -119,4 +121,51 @@ + (UIButton *)btnPriMsgWithUser:(User *)curUser{
119121
return btn;
120122
}
121123

124+
+ (UIButton *)tweetBtnWithFrame:(CGRect)frame image:(NSString *)imageName{
125+
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
126+
button.frame = frame;
127+
[button setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
128+
[button doBorderWidth:0.5 color:[UIColor colorWithHexString:@"0xCCCCCC"] cornerRadius:CGRectGetHeight(button.frame)/2];
129+
return button;
130+
}
131+
- (void)animateToImage:(NSString *)imageName{
132+
UIImage *image = [UIImage imageNamed:imageName];
133+
if (!image) {
134+
return;
135+
}
136+
[self setImage:image forState:UIControlStateNormal];
137+
if ([self superview]) {
138+
UIImageView *imageV = [[UIImageView alloc] initWithImage:image];
139+
imageV.frame = self.imageView.frame;
140+
141+
UIView *superV = [self superview];
142+
CGPoint superCenterP = [self convertPoint:imageV.center toView:superV];
143+
imageV.center = superCenterP;
144+
[superV addSubview:imageV];
145+
146+
//animate and remove subview
147+
[NSObject pop_animate:^{
148+
CGPoint centerP = imageV.center;
149+
centerP.x += CGRectGetWidth(self.frame) /2;
150+
centerP.y -= CGRectGetHeight(self.frame) *2;
151+
imageV.pop_velocity.center = imageV.center;
152+
imageV.pop_springBounciness = 10;
153+
imageV.pop_springSpeed = 5;
154+
imageV.pop_spring.center = centerP;
155+
156+
imageV.layer.pop_rotation = M_PI_4/2;
157+
imageV.pop_scaleXY = CGPointMake(2.0, 2.0);
158+
imageV.pop_spring.alpha = 0.5;
159+
} completion:^(BOOL finished) {
160+
[NSObject pop_animate:^{
161+
CGPoint centerP = imageV.center;
162+
centerP.y -= CGRectGetHeight(self.frame);
163+
imageV.pop_easeInEaseOut.center = centerP;
164+
imageV.pop_spring.alpha = 0;
165+
} completion:^(BOOL finished) {
166+
[imageV removeFromSuperview];
167+
}];
168+
}];
169+
}
170+
}
122171
@end

0 commit comments

Comments
 (0)