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
5269ea1f
Commit
5269ea1f
authored
Dec 11, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
42a898b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
11 deletions
+40
-11
YHAIChatBannerCollectionCell.swift
...AI/AI-Dialogue(AI对话)/V/YHAIChatBannerCollectionCell.swift
+4
-4
YHAIChatBannerView.swift
...s/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerView.swift
+2
-2
YHAIChatCustomFlowLayout.swift
...les/AI/AI-Dialogue(AI对话)/V/YHAIChatCustomFlowLayout.swift
+5
-5
YHAIChatShadowView.swift
...s/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatShadowView.swift
+29
-0
No files found.
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerCollectionCell.swift
View file @
5269ea1f
...
...
@@ -23,14 +23,14 @@ class YHAIChatBannerCollectionCell: UICollectionViewCell {
lazy
var
titleLabel
:
UILabel
=
{
var
label
=
UILabel
()
label
.
font
=
.
PFSC_
R
(
ofSize
:
12
)
label
.
font
=
.
PFSC_
M
(
ofSize
:
12
)
label
.
textAlignment
=
.
left
label
.
textColor
=
UIColor
.
mainTextColor
label
.
textColor
=
UIColor
(
hex
:
0x6D788A
)
return
label
}()
lazy
var
shadowView
:
YHAI
Chat
ShadowView
=
{
let
v
=
YHAI
Chat
ShadowView
()
lazy
var
shadowView
:
YHAI
FlowMessage
ShadowView
=
{
let
v
=
YHAI
FlowMessage
ShadowView
()
return
v
}()
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatBannerView.swift
View file @
5269ea1f
...
...
@@ -182,8 +182,8 @@ class YHAIChatBannerView: UIView {
addSubview
(
collectionView
)
collectionView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
2
0
)
make
.
right
.
equalTo
(
-
2
0
)
make
.
left
.
equalTo
(
0
)
make
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
33.0
*
2
+
10.0
+
10.0
*
2.0
)
make
.
top
.
equalTo
(
bannerView
.
snp
.
bottom
)
.
offset
(
6
)
make
.
bottom
.
equalTo
(
-
6
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatCustomFlowLayout.swift
View file @
5269ea1f
...
...
@@ -13,8 +13,8 @@ class YHAIChatCustomFlowLayout: UICollectionViewFlowLayout {
let
cellHeight
=
33.0
let
verticalGap
=
10.0
let
horizonalGap
=
10.0
var
firstLineX
=
0.0
var
secondLineX
=
0.0
var
firstLineX
=
2
0.0
var
secondLineX
=
2
0.0
let
firstLineY
=
10.0
let
secondLineY
=
10.0
+
33.0
+
10.0
...
...
@@ -46,8 +46,8 @@ class YHAIChatCustomFlowLayout: UICollectionViewFlowLayout {
var
dataSource
:[
String
]
=
[]
{
didSet
{
attributes
.
removeAll
()
firstLineX
=
0.0
secondLineX
=
0.0
firstLineX
=
2
0.0
secondLineX
=
2
0.0
for
(
index
,
text
)
in
dataSource
.
enumerated
()
{
let
attribute
=
UICollectionViewLayoutAttributes
(
forCellWith
:
IndexPath
(
row
:
index
,
section
:
0
))
let
size
=
self
.
getSize
(
index
:
index
)
...
...
@@ -94,7 +94,7 @@ class YHAIChatCustomFlowLayout: UICollectionViewFlowLayout {
func
getSize
(
index
:
Int
)
->
CGSize
{
if
0
<=
index
,
index
<
dataSource
.
count
{
let
size
=
self
.
getwith
(
font
:
UIFont
.
PFSC_
R
(
ofSize
:
12
),
height
:
cellHeight
,
string
:
dataSource
[
index
])
let
size
=
self
.
getwith
(
font
:
UIFont
.
PFSC_
M
(
ofSize
:
12
),
height
:
cellHeight
,
string
:
dataSource
[
index
])
let
gap
=
10.0
let
width
=
size
.
width
+
gap
*
2.0
return
CGSize
(
width
:
width
,
height
:
cellHeight
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAIChatShadowView.swift
View file @
5269ea1f
...
...
@@ -31,6 +31,35 @@ class YHAIChatShadowView: UIView {
layer
.
shadowOffset
=
CGSize
(
width
:
0
,
height
:
4
)
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
// 确保在布局更新时更新阴影路径
setupShadow
()
}
}
class
YHAIFlowMessageShadowView
:
UIView
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setupShadow
()
}
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
setupShadow
()
}
private
func
setupShadow
()
{
// 创建阴影路径
let
shadowPath
=
UIBezierPath
(
roundedRect
:
bounds
,
cornerRadius
:
6
)
// 设置阴影属性
layer
.
shadowPath
=
shadowPath
.
cgPath
layer
.
shadowColor
=
UIColor
(
red
:
0
,
green
:
0
,
blue
:
0
,
alpha
:
0.06
)
.
cgColor
layer
.
shadowOpacity
=
1
layer
.
shadowOffset
=
CGSize
(
width
:
0
,
height
:
2
)
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
// 确保在布局更新时更新阴影路径
...
...
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