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
ccdc9079
Commit
ccdc9079
authored
Dec 02, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// AI
parent
661245a8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
YHAIMainChatViewController.swift
...s/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
+7
-0
YHAIRobotChatViewController.swift
.../AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
+7
-0
YHAITabViewController.swift
...odules/AI/AI-Dialogue(AI对话)/C/YHAITabViewController.swift
+1
-0
YHAITextInputView.swift
...es/Modules/AI/AI-Dialogue(AI对话)/V/YHAITextInputView.swift
+6
-0
No files found.
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIMainChatViewController.swift
View file @
ccdc9079
...
...
@@ -57,6 +57,11 @@ class YHAIMainChatViewController: YHBaseViewController {
}
}
}
v
.
keyBoardChangeBlock
=
{
[
weak
self
]
isKeyBoardShow
in
guard
let
self
=
self
else
{
return
}
self
.
scrollToBottom
()
}
return
v
}()
...
...
@@ -94,10 +99,12 @@ class YHAIMainChatViewController: YHBaseViewController {
func
scrollToBottom
()
{
self
.
tableView
.
reloadData
{
if
self
.
messages
.
count
>
0
{
let
indexPath
=
IndexPath
(
row
:
self
.
messages
.
count
-
1
,
section
:
0
)
self
.
tableView
.
scrollToRow
(
at
:
indexPath
,
at
:
.
bottom
,
animated
:
true
)
}
}
}
func
sendMessage
(
_
text
:
String
)
{
self
.
manager
.
getMainChatConversationId
{
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAIRobotChatViewController.swift
View file @
ccdc9079
...
...
@@ -61,6 +61,11 @@ class YHAIRobotChatViewController: YHBaseViewController {
}
}
}
v
.
keyBoardChangeBlock
=
{
[
weak
self
]
isKeyBoardShow
in
guard
let
self
=
self
else
{
return
}
self
.
scrollToBottom
()
}
return
v
}()
...
...
@@ -106,10 +111,12 @@ class YHAIRobotChatViewController: YHBaseViewController {
func
scrollToBottom
()
{
self
.
tableView
.
reloadData
{
if
self
.
messages
.
count
>
0
{
let
indexPath
=
IndexPath
(
row
:
self
.
messages
.
count
-
1
,
section
:
0
)
self
.
tableView
.
scrollToRow
(
at
:
indexPath
,
at
:
.
bottom
,
animated
:
true
)
}
}
}
func
sendMessage
(
_
text
:
String
)
{
YHAIChatConfiguration
.
defaultConfig
.
removeThinkingMessageFromChatList
(
&
messages
)
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/C/YHAITabViewController.swift
View file @
ccdc9079
...
...
@@ -190,6 +190,7 @@ class YHAITabViewController: YHBaseViewController {
@objc
func
didJumoToAIChat
()
{
jumpToItemIndex
(
itemIndex
:
1
)
mainChatVC
.
bottomInputView
.
showKeyBoard
()
}
}
...
...
galaxy/galaxy/Classes/Modules/AI/AI-Dialogue(AI对话)/V/YHAITextInputView.swift
View file @
ccdc9079
...
...
@@ -129,6 +129,10 @@ class YHAITextInputView: UIView {
NotificationCenter
.
default
.
removeObserver
(
self
)
}
func
showKeyBoard
()
{
self
.
textView
.
becomeFirstResponder
()
}
func
createUI
()
{
self
.
addSubview
(
whiteView
)
...
...
@@ -187,6 +191,8 @@ class YHAITextInputView: UIView {
}
self
.
setNeedsLayout
()
self
.
layoutIfNeeded
()
keyBoardChangeBlock
?(
isKeyboardShow
)
}
}
}
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