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
032bc955
Commit
032bc955
authored
Jun 26, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 我的好友
parent
276b2a29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
YHCommunityViewController.swift
...s/Modules/Community(社区)/C/YHCommunityViewController.swift
+24
-21
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHCommunityViewController.swift
View file @
032bc955
...
...
@@ -78,24 +78,28 @@ class YHCommunityViewController: YHBaseViewController {
var
unreadCount
:
Int
=
0
{
didSet
{
self
.
unreadLabel
.
isHidden
=
(
self
.
unreadCount
<=
0
)
if
0
<
self
.
unreadCount
&&
self
.
unreadCount
<
100
{
self
.
unreadLabel
.
text
=
"
\(
self
.
unreadCount
)
"
}
else
if
self
.
unreadCount
>=
100
{
self
.
unreadLabel
.
text
=
"99+"
}
var
width
=
unreadHeight
var
leftMargin
=
-
8
if
10
<=
self
.
unreadCount
&&
self
.
unreadCount
<
100
{
width
=
22.0
}
else
if
self
.
unreadCount
>=
100
{
width
=
30.0
leftMargin
=
-
14
}
self
.
unreadLabel
.
snp
.
updateConstraints
{
make
in
make
.
width
.
equalTo
(
width
)
make
.
left
.
equalTo
(
self
.
friendsBtn
.
snp
.
right
)
.
offset
(
leftMargin
)
}
self
.
updateUnreadCount
(
self
.
unreadCount
)
}
}
func
updateUnreadCount
(
_
count
:
Int
)
{
self
.
unreadLabel
.
isHidden
=
(
count
<=
0
)
if
0
<
count
&&
count
<
100
{
self
.
unreadLabel
.
text
=
"
\(
count
)
"
}
else
if
count
>=
100
{
self
.
unreadLabel
.
text
=
"99+"
}
var
width
=
unreadHeight
var
leftMargin
=
-
8
if
10
<=
count
&&
count
<
100
{
width
=
22.0
}
else
if
count
>=
100
{
width
=
30.0
leftMargin
=
-
14
}
self
.
unreadLabel
.
snp
.
updateConstraints
{
make
in
make
.
width
.
equalTo
(
width
)
make
.
left
.
equalTo
(
self
.
friendsBtn
.
snp
.
right
)
.
offset
(
leftMargin
)
}
}
...
...
@@ -206,8 +210,7 @@ extension YHCommunityViewController: JXSegmentedViewDelegate {
if
segmentedView
.
selectedIndex
==
0
{
bgImgV
.
isHidden
=
false
friendsBtn
.
isHidden
=
false
let
count
=
self
.
unreadCount
self
.
unreadCount
=
count
self
.
updateUnreadCount
(
self
.
unreadCount
)
segmentedDataSource
.
titleNormalColor
=
UIColor
(
hex
:
0xFFFFFF
,
alpha
:
0.6
)
segmentedDataSource
.
titleSelectedColor
=
.
white
let
indicator
=
JXSegmentedIndicatorLineView
()
...
...
@@ -217,7 +220,7 @@ extension YHCommunityViewController: JXSegmentedViewDelegate {
}
else
{
bgImgV
.
isHidden
=
true
friendsBtn
.
isHidden
=
true
self
.
u
nreadCount
=
0
self
.
u
pdateUnreadCount
(
0
)
segmentedDataSource
.
titleNormalColor
=
UIColor
(
hex
:
0x94a3b8
)
segmentedDataSource
.
titleSelectedColor
=
UIColor
.
mainTextColor
let
indicator
=
JXSegmentedIndicatorLineView
()
...
...
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