Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
9472cffb
Verified
Commit
9472cffb
authored
2 years ago
by
Mikolai Gütschow
Browse files
Options
Downloads
Patches
Plain Diff
remember list in ThreadItemView preview
parent
6f0708dc
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#13331
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/forums/ThreadItemView.kt
+18
-12
18 additions, 12 deletions
...n/org/briarproject/briar/desktop/forums/ThreadItemView.kt
with
18 additions
and
12 deletions
briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/forums/ThreadItemView.kt
+
18
−
12
View file @
9472cffb
...
...
@@ -34,11 +34,13 @@ import androidx.compose.foundation.layout.padding
import
androidx.compose.foundation.layout.size
import
androidx.compose.foundation.layout.width
import
androidx.compose.foundation.lazy.LazyColumn
import
androidx.compose.foundation.lazy.items
import
androidx.compose.foundation.selection.selectable
import
androidx.compose.foundation.shape.CircleShape
import
androidx.compose.material.MaterialTheme
import
androidx.compose.material.Text
import
androidx.compose.runtime.Composable
import
androidx.compose.runtime.remember
import
androidx.compose.ui.Alignment.Companion.Center
import
androidx.compose.ui.Alignment.Companion.CenterVertically
import
androidx.compose.ui.Modifier
...
...
@@ -67,14 +69,19 @@ import kotlin.random.Random
@Suppress
(
"HardCodedStringLiteral"
)
fun
main
()
=
preview
{
LazyColumn
{
for
(
i
in
1
..
5
)
{
item
{
ThreadItemView
(
item
=
ForumPostItem
(
val
list
=
remember
{
(
0
..
8
).
map
{
i
->
ForumPostItem
(
h
=
getRandomForumPostHeader
(),
text
=
getRandomString
(
Random
.
nextInt
(
1
,
1337
)),
).
apply
{
setLevel
(
Random
.
nextInt
(
0
,
6
))
},
).
apply
{
setLevel
(
i
%
7
)
}
}
}
LazyColumn
{
items
(
list
)
{
item
->
ThreadItemView
(
item
=
item
,
maxNestingLevel
=
3
,
selectedPost
=
null
,
onPostSelected
=
{},
...
...
@@ -82,7 +89,6 @@ fun main() = preview {
}
}
}
}
@Composable
fun
ThreadItemView
(
...
...
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