Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
85d5365e
Commit
85d5365e
authored
1 month ago
by
Aleksandras Kostarevas
Browse files
Options
Downloads
Patches
Plain Diff
Fix default clipboard entry reappearing bug
parent
b1d9667e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/org/futo/inputmethod/latin/uix/actions/ClipboardHistoryAction.kt
+11
-7
11 additions, 7 deletions
...o/inputmethod/latin/uix/actions/ClipboardHistoryAction.kt
with
11 additions
and
7 deletions
java/src/org/futo/inputmethod/latin/uix/actions/ClipboardHistoryAction.kt
+
11
−
7
View file @
85d5365e
...
...
@@ -187,16 +187,18 @@ fun ClipboardEntryViewPreview() {
}
}
val
DefaultClipboardEntry
=
ClipboardEntry
(
timestamp
=
0L
,
pinned
=
true
,
text
=
"Clipboard entries will appear here"
,
uri
=
null
,
mimeTypes
=
listOf
()
)
class
ClipboardHistoryManager
(
val
context
:
Context
,
val
coroutineScope
:
LifecycleCoroutineScope
)
:
PersistentActionState
{
private
val
clipboardManager
=
context
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
val
clipboardHistory
=
mutableStateListOf
(
ClipboardEntry
(
timestamp
=
0L
,
pinned
=
true
,
text
=
"Clipboard entries will appear here"
,
uri
=
null
,
mimeTypes
=
listOf
()
))
val
clipboardHistory
=
mutableStateListOf
<
ClipboardEntry
>()
var
clipboardLoaded
=
false
...
...
@@ -351,6 +353,8 @@ class ClipboardHistoryManager(val context: Context, val coroutineScope: Lifecycl
clipboardHistory
.
clear
()
clipboardHistory
.
addAll
(
data
)
pruneOldItems
()
}
else
{
clipboardHistory
.
add
(
DefaultClipboardEntry
)
}
clipboardLoaded
=
true
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment