Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
31444aca
Commit
31444aca
authored
May 17, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 新增自定义刷新组件
parent
eedbbe52
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
182 additions
and
0 deletions
+182
-0
Podfile
galaxy/Podfile
+2
-0
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+16
-0
YHRefreshHeaderAnimator.swift
...s/Tools/CustomRefreshHeader/YHRefreshHeaderAnimator.swift
+134
-0
galaxy_refresher.gif
...xy/Classes/Tools/CustomRefreshHeader/galaxy_refresher.gif
+0
-0
Contents.json
.../galaxy/Res/Assets.xcassets/CustomRefresher/Contents.json
+6
-0
Contents.json
...tomRefresher/galaxy_icon_refresher.imageset/Contents.json
+22
-0
Group@2x.png
...stomRefresher/galaxy_icon_refresher.imageset/Group@2x.png
+0
-0
Group@3x.png
...stomRefresher/galaxy_icon_refresher.imageset/Group@3x.png
+0
-0
galaxy-Bridge-Header.h
galaxy/galaxy/Res/galaxy-Bridge-Header.h
+2
-0
No files found.
galaxy/Podfile
View file @
31444aca
...
...
@@ -81,6 +81,8 @@ target 'galaxy' do
pod
'BMPlayer'
,
'1.3.0'
#高斯模糊
pod
'VisualEffectView'
,
'4.1.5'
#GIF图播放
pod
'FLAnimatedImage'
,
'1.0.17'
end
...
...
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
31444aca
...
...
@@ -242,6 +242,8 @@
0493B3DC2BA7EFE600AF9393
/* YHCertificateSearchViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0493B3DB2BA7EFE600AF9393
/* YHCertificateSearchViewController.swift */
;
};
0493B3DE2BA80C2300AF9393
/* YHCertificateFilterButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0493B3DD2BA80C2300AF9393
/* YHCertificateFilterButton.swift */
;
};
049537852BA9B28500AF7E59
/* YHCertificateTemplateCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049537842BA9B28500AF7E59
/* YHCertificateTemplateCell.swift */
;
};
049663BA2BF6105C003C8295
/* YHRefreshHeaderAnimator.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049663B92BF6105C003C8295
/* YHRefreshHeaderAnimator.swift */
;
};
049663C02BF729F6003C8295
/* galaxy_refresher.gif in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049663BF2BF729F5003C8295
/* galaxy_refresher.gif */
;
};
049A48A82B49417300D0C641
/* YHAboutUsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
;
};
049A48AA2B49536000D0C641
/* YHAboutUsAdvantageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A92B49536000D0C641
/* YHAboutUsAdvantageCell.swift */
;
};
049AC4C62BC3E55300F857F4
/* YHServiceSectionView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049AC4C52BC3E55300F857F4
/* YHServiceSectionView.swift */
;
};
...
...
@@ -698,6 +700,8 @@
0493B3DB2BA7EFE600AF9393
/* YHCertificateSearchViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateSearchViewController.swift
;
sourceTree
=
"<group>"
;
};
0493B3DD2BA80C2300AF9393
/* YHCertificateFilterButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateFilterButton.swift
;
sourceTree
=
"<group>"
;
};
049537842BA9B28500AF7E59
/* YHCertificateTemplateCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateTemplateCell.swift
;
sourceTree
=
"<group>"
;
};
049663B92BF6105C003C8295
/* YHRefreshHeaderAnimator.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHRefreshHeaderAnimator.swift
;
sourceTree
=
"<group>"
;
};
049663BF2BF729F5003C8295
/* galaxy_refresher.gif */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.gif
;
path
=
galaxy_refresher.gif
;
sourceTree
=
"<group>"
;
};
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsViewController.swift
;
sourceTree
=
"<group>"
;
};
049A48A92B49536000D0C641
/* YHAboutUsAdvantageCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsAdvantageCell.swift
;
sourceTree
=
"<group>"
;
};
049AC4C52BC3E55300F857F4
/* YHServiceSectionView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceSectionView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1677,6 +1681,15 @@
path
=
ViewModel
;
sourceTree
=
"<group>"
;
};
049663B62BF60BB7003C8295
/* CustomRefreshHeader */
=
{
isa
=
PBXGroup
;
children
=
(
049663BF2BF729F5003C8295
/* galaxy_refresher.gif */
,
049663B92BF6105C003C8295
/* YHRefreshHeaderAnimator.swift */
,
);
path
=
CustomRefreshHeader
;
sourceTree
=
"<group>"
;
};
04A671562B9F18C800C1FB91
/* MyCertificates(我的证书) */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -2124,6 +2137,7 @@
A5ACE8EE2B4564F7002C94D2
/* Tools */
=
{
isa
=
PBXGroup
;
children
=
(
049663B62BF60BB7003C8295
/* CustomRefreshHeader */
,
0488518B2BF5FAA800C4E32D
/* Upload */
,
04AF514C2BEB57FC00009E3A
/* VideoPlay */
,
0468D4292B55017400CFB916
/* Analytics */
,
...
...
@@ -2463,6 +2477,7 @@
isa
=
PBXResourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
049663C02BF729F6003C8295
/* galaxy_refresher.gif in Resources */
,
045EEED42B9F171A0022A143
/* scoreOptionData.plist in Resources */
,
045EEED62B9F171A0022A143
/* YHQuestionList.plist in Resources */
,
A5C5B2EE2B4F9B8800A7C5D1
/* Localizable.xcstrings in Resources */
,
...
...
@@ -2651,6 +2666,7 @@
045EEEB22B9F171A0022A143
/* YHWorkActionView.swift in Sources */
,
A58AC09F2BAC05BA00A30FA9
/* YHFileListItemsView.swift in Sources */
,
045EEE8C2B9F171A0022A143
/* YHPreviewMainViewController.swift in Sources */
,
049663BA2BF6105C003C8295
/* YHRefreshHeaderAnimator.swift in Sources */
,
A5C382D12B5FAAB300C5E65C
/* YHContactItemModel.swift in Sources */
,
A5ACE9522B4564F7002C94D2
/* YHServiceCenterMainViewController.swift in Sources */
,
045EEF072B9F171A0022A143
/* YHBasicInfoFillViewModel.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Tools/CustomRefreshHeader/YHRefreshHeaderAnimator.swift
0 → 100644
View file @
31444aca
//
// YHRefreshHeaderAnimator.swift
// galaxy
//
// Created by edy on 2024/5/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
ESPullToRefresh
import
FLAnimatedImage
public
extension
ES
where
Base
:
UIScrollView
{
@discardableResult
func
addYHPullToRefresh
(
handler
:
@escaping
ESRefreshHandler
)
->
ESRefreshHeaderView
{
return
self
.
addPullToRefresh
(
animator
:
YHRefreshHeaderAnimator
.
init
(),
handler
:
handler
)
}
}
class
YHRefreshHeaderAnimator
:
UIView
,
ESRefreshProtocol
,
ESRefreshAnimatorProtocol
,
ESRefreshImpactProtocol
{
static
let
logoWidth
=
62.0
static
let
logoHeight
=
23.0
open
var
pullToRefreshDescription
=
"下拉刷新"
.
local
{
didSet
{
if
pullToRefreshDescription
!=
oldValue
{
titleLabel
.
text
=
pullToRefreshDescription
;
}
}
}
open
var
releaseToRefreshDescription
=
"松手开始刷新"
.
local
open
var
loadingDescription
=
"加载中..."
.
local
open
var
view
:
UIView
{
return
self
}
open
var
insets
:
UIEdgeInsets
=
UIEdgeInsets
.
zero
open
var
trigger
:
CGFloat
=
64.0
open
var
executeIncremental
:
CGFloat
=
64.0
open
var
state
:
ESRefreshViewState
=
.
pullToRefresh
fileprivate
let
logoImgView
:
UIImageView
=
{
let
imageView
=
UIImageView
(
image
:
UIImage
(
named
:
"galaxy_icon_refresher"
))
return
imageView
}()
fileprivate
let
animaitonImgView
:
FLAnimatedImageView
=
{
let
imgV
=
FLAnimatedImageView
()
imgV
.
isHidden
=
true
let
url
=
Bundle
.
main
.
url
(
forResource
:
"galaxy_refresher"
,
withExtension
:
"gif"
)
!
if
let
animatedImage
=
try
?
FLAnimatedImage
(
animatedGIFData
:
Data
(
contentsOf
:
url
))
{
imgV
.
animatedImage
=
animatedImage
}
else
{
print
(
"Error loading GIF"
)
}
return
imgV
}()
fileprivate
let
titleLabel
:
UILabel
=
{
let
label
=
UILabel
.
init
(
frame
:
CGRect
.
zero
)
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
UIColor
.
init
(
hex
:
0x0046B4
,
alpha
:
0.4
)
label
.
textAlignment
=
.
left
return
label
}()
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
titleLabel
.
text
=
pullToRefreshDescription
self
.
addSubview
(
logoImgView
)
self
.
addSubview
(
animaitonImgView
)
self
.
addSubview
(
titleLabel
)
}
public
required
init
(
coder
aDecoder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
open
func
refreshAnimationBegin
(
view
:
ESRefreshComponent
)
{
self
.
titleLabel
.
text
=
loadingDescription
self
.
animaitonImgView
.
isHidden
=
false
}
open
func
refreshAnimationEnd
(
view
:
ESRefreshComponent
)
{
self
.
animaitonImgView
.
isHidden
=
true
self
.
titleLabel
.
text
=
pullToRefreshDescription
}
open
func
refresh
(
view
:
ESRefreshComponent
,
progressDidChange
progress
:
CGFloat
)
{
// Do nothing
}
open
func
refresh
(
view
:
ESRefreshComponent
,
stateDidChange
state
:
ESRefreshViewState
)
{
guard
self
.
state
!=
state
else
{
return
}
self
.
state
=
state
switch
state
{
case
.
refreshing
,
.
autoRefreshing
:
titleLabel
.
text
=
loadingDescription
self
.
setNeedsLayout
()
break
case
.
releaseToRefresh
:
titleLabel
.
text
=
releaseToRefreshDescription
self
.
setNeedsLayout
()
self
.
impact
()
break
case
.
pullToRefresh
:
titleLabel
.
text
=
pullToRefreshDescription
self
.
setNeedsLayout
()
break
default
:
break
}
}
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
let
s
=
self
.
bounds
.
size
let
w
=
s
.
width
UIView
.
performWithoutAnimation
{
titleLabel
.
sizeToFit
()
logoImgView
.
frame
=
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
Self
.
logoWidth
,
height
:
Self
.
logoHeight
)
logoImgView
.
center
=
CGPoint
.
init
(
x
:
w
/
2.0
,
y
:
Self
.
logoHeight
/
2.0
)
animaitonImgView
.
frame
=
logoImgView
.
frame
titleLabel
.
center
=
CGPoint
.
init
(
x
:
w
/
2.0
,
y
:
logoImgView
.
frame
.
maxY
+
4
+
9
)
}
}
}
galaxy/galaxy/Classes/Tools/CustomRefreshHeader/galaxy_refresher.gif
0 → 100644
View file @
31444aca
58.7 KB
galaxy/galaxy/Res/Assets.xcassets/CustomRefresher/Contents.json
0 → 100644
View file @
31444aca
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/CustomRefresher/galaxy_icon_refresher.imageset/Contents.json
0 → 100644
View file @
31444aca
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Group@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Group@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/CustomRefresher/galaxy_icon_refresher.imageset/Group@2x.png
0 → 100644
View file @
31444aca
2.05 KB
galaxy/galaxy/Res/Assets.xcassets/CustomRefresher/galaxy_icon_refresher.imageset/Group@3x.png
0 → 100644
View file @
31444aca
2.86 KB
galaxy/galaxy/Res/galaxy-Bridge-Header.h
View file @
31444aca
...
...
@@ -15,6 +15,8 @@
#import "JPUSHService.h"
// iOS10注册APNs所需头文件
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
// GIF播放
#import "FLAnimatedImage.h"
#import <UserNotifications/UserNotifications.h>
#endif
...
...
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