Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMRefresh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMRefresh
Commits
3030898c
Commit
3030898c
authored
Jun 01, 2020
by
luyueming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gif类放到库里
parent
9b732aa2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
5 deletions
+110
-5
Podfile.lock
Example/Podfile.lock
+2
-2
GMGifImageView.h
GMRefresh/Classes/GMGifImageView.h
+23
-0
GMGifImageView.m
GMRefresh/Classes/GMGifImageView.m
+82
-0
GMRefreshFooter.m
GMRefresh/Classes/GMRefreshFooter.m
+1
-1
GMRefreshHeader.m
GMRefresh/Classes/GMRefreshHeader.m
+2
-2
No files found.
Example/Podfile.lock
View file @
3030898c
...
...
@@ -5,7 +5,7 @@ PODS:
- GMCache
- MagicalRecord
- MJExtension
- GMRefresh (1.0.
4
):
- GMRefresh (1.0.
6
):
- GMPhobos
- MJRefresh
- MagicalRecord (2.3.2):
...
...
@@ -43,7 +43,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMPhobos: abab7c666c8a75549adea937e40e101d4d341b0d
GMRefresh: 6
35099e4d381d10564d7991d449898f0b54dfe74
GMRefresh: 6
4bccb48e2161969e5877168c33a7927d3020e42
MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
MJRefresh: 53e3e3219f204425ee6d3e62e8733d3295944cd6
...
...
GMRefresh/Classes/GMGifImageView.h
0 → 100644
View file @
3030898c
//
// GMGifImageView.h
// Gengmei
//
// Created by lizhen on 2019/3/15.
// Copyright © 2019 更美互动信息科技有限公司. All rights reserved.
//
@interface
GMGifImageView
:
UIImageView
-
(
instancetype
)
initWithSuperView
:(
UIView
*
)
superView
;
/**
开始下拉刷新动画, 参数为是否需要回到顶部动画
@param topAnimation 回到顶部是否需要动画
*/
-
(
void
)
startGifRefresh
:(
BOOL
)
topAnimation
;
-
(
void
)
stopGifRefresh
;
@end
GMRefresh/Classes/GMGifImageView.m
0 → 100644
View file @
3030898c
//
// GMGifImageView.m
// Gengmei
//
// Created by lizhen on 2019/3/15.
// Copyright © 2019 更美互动信息科技有限公司. All rights reserved.
//
#import "GMGifImageView.h"
#import <MJRefresh/MJRefresh.h>
#import "GMRefreshConstant.h"
@interface
GMGifImageView
()
@property
(
nonatomic
,
strong
)
NSMutableArray
*
refreshingImages
;
@property
(
nonatomic
,
strong
)
UITableView
*
table
;
@property
(
nonatomic
,
strong
)
UICollectionView
*
collectionView
;
@property
(
nonatomic
,
assign
)
BOOL
isTable
;
@end
@implementation
GMGifImageView
-
(
instancetype
)
initWithSuperView
:(
UIView
*
)
superView
{
if
(
self
=
[
super
init
])
{
if
([
superView
isKindOfClass
:[
UICollectionView
class
]])
{
self
.
isTable
=
NO
;
self
.
collectionView
=
(
UICollectionView
*
)
superView
;
}
else
if
([
superView
isKindOfClass
:[
UITableView
class
]])
{
self
.
isTable
=
YES
;
self
.
table
=
(
UITableView
*
)
superView
;
}
self
.
hidden
=
YES
;
NSTimeInterval
duration
=
self
.
refreshingImages
.
count
*
0
.
1
;
self
.
animationImages
=
self
.
refreshingImages
;
self
.
animationRepeatCount
=
MAXFLOAT
;
self
.
animationDuration
=
duration
;
[
superView
addSubview
:
self
];
CGFloat
width
=
100
;
CGFloat
x
=
(
superView
.
frame
.
size
.
width
-
width
)
*
0
.
5
;
self
.
frame
=
CGRectMake
(
x
,
-
100
,
width
,
width
);
}
return
self
;
}
-
(
NSMutableArray
*
)
refreshingImages
{
if
(
!
_refreshingImages
)
{
_refreshingImages
=
[
NSMutableArray
arrayWithCapacity
:
1
];
for
(
NSUInteger
i
=
1
;
i
<=
23
;
i
++
)
{
NSString
*
imageName
=
[
NSString
stringWithFormat
:
@"pullLoading%ld"
,
i
];
NSString
*
imagePath
=
GMRefreshImageName
(
imageName
);
UIImage
*
image
=
[
UIImage
imageNamed
:
imagePath
];
[
_refreshingImages
addObject
:
image
];
}
}
return
_refreshingImages
;
}
-
(
void
)
startGifRefresh
:
(
BOOL
)
topAnimation
{
/* 根据图片设置控件的高度 */
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
25
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
self
.
hidden
=
NO
;
[
self
startAnimating
];
});
if
(
self
.
isTable
)
{
[
self
.
table
setContentOffset
:
CGPointZero
animated
:
topAnimation
];
[
self
.
table
.
mj_header
beginRefreshing
];
}
else
{
[
self
.
collectionView
setContentOffset
:
CGPointZero
animated
:
topAnimation
];
[
self
.
collectionView
.
mj_header
beginRefreshing
];
}
}
-
(
void
)
stopGifRefresh
{
[
self
stopAnimating
];
self
.
hidden
=
YES
;
}
@end
GMRefresh/Classes/GMRefreshFooter.m
View file @
3030898c
...
...
@@ -37,7 +37,7 @@
-
(
void
)
executeRefreshingCallback
{
// 上拉数据时,页面上拉次数++
self
.
pageCtrl
.
up_loading_times
++
;
//
self.pageCtrl.up_loading_times++;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
MJRefreshHeader
*
header
=
_scrollView
.
mj_header
;
...
...
GMRefresh/Classes/GMRefreshHeader.m
View file @
3030898c
...
...
@@ -99,8 +99,8 @@
-
(
void
)
executeRefreshingCallback
{
// 下拉加载时,页面下拉次数++,同时将当前数据进行上报
self
.
pageCtrl
.
down_loading_times
++
;
[[
GMExposureManager
sharedManager
]
endExpoTrcakerForPageCtrl
:
self
.
pageCtrl
];
//
self.pageCtrl.down_loading_times++;
//
[[GMExposureManager sharedManager] endExpoTrcakerForPageCtrl:self.pageCtrl];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
MJRefreshFooter
*
footer
=
_scrollView
.
mj_footer
;
if
(
footer
&&
[
footer
isRefreshing
])
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment