Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TeamPrinterV2
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr
TeamPrinterV2
Commits
3a4599a8
Commit
3a4599a8
authored
Jul 24, 2024
by
Aleksandr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message for empty print jobs list
parent
d3152f57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
13 deletions
+34
-13
app/src/main/java/com/isidroid/c23/ui/screen/print_jobs/PrintJobsScreen.kt
+34
-13
No files found.
app/src/main/java/com/isidroid/c23/ui/screen/print_jobs/PrintJobsScreen.kt
View file @
3a4599a8
package
com.isidroid.c23.ui.screen.print_jobs
import
androidx.activity.compose.BackHandler
import
androidx.compose.foundation.layout.Box
import
androidx.compose.foundation.layout.fillMaxSize
import
androidx.compose.foundation.layout.fillMaxWidth
import
androidx.compose.foundation.layout.padding
import
androidx.compose.foundation.lazy.LazyColumn
import
androidx.compose.foundation.lazy.items
import
androidx.compose.material3.ExperimentalMaterial3Api
import
androidx.compose.material3.MaterialTheme
import
androidx.compose.material3.Scaffold
import
androidx.compose.material3.Text
import
androidx.compose.material3.TopAppBarDefaults
import
androidx.compose.runtime.Composable
import
androidx.compose.runtime.LaunchedEffect
import
androidx.compose.runtime.State
import
androidx.compose.ui.Alignment
import
androidx.compose.ui.Modifier
import
androidx.compose.ui.res.stringResource
import
androidx.compose.ui.text.style.TextAlign
import
androidx.compose.ui.unit.dp
import
com.isidroid.c23.R
import
com.isidroid.c23.ui._component.TopAppBarComponent
...
...
@@ -67,20 +73,34 @@ private fun ListComponent(
)
{
val
list
=
state
.
value
.
jobs
?:
return
LazyColumn
(
modifier
)
{
items
(
list
)
{
item
->
PrintJobListItemComponent
(
spotName
=
item
.
spotName
,
cost
=
item
.
cost
,
statusName
=
item
.
statusName
,
cover
=
item
.
cover
,
accessCode
=
item
.
accessCode
,
statusColor
=
item
.
statusColor
,
createdAt
=
item
.
createdAt
,
modifier
=
Modifier
.
padding
(
horizontal
=
12
.
dp
,
vertical
=
4
.
dp
),
clickOnCard
=
{
onEventSent
(
PrintJobsContract
.
Event
.
ToDetails
(
item
.
id
))
},
clickOnSpot
=
{
onEventSent
(
PrintJobsContract
.
Event
.
ToSpot
(
item
.
spotCode
))
}
if
(
list
.
isEmpty
())
{
Box
(
modifier
=
Modifier
.
fillMaxSize
(),
contentAlignment
=
Alignment
.
Center
)
{
Text
(
text
=
"No any print jobs found"
,
style
=
MaterialTheme
.
typography
.
labelLarge
,
modifier
=
Modifier
.
fillMaxWidth
(),
textAlign
=
TextAlign
.
Center
)
}
}
else
{
LazyColumn
(
modifier
)
{
items
(
list
)
{
item
->
PrintJobListItemComponent
(
spotName
=
item
.
spotName
,
cost
=
item
.
cost
,
statusName
=
item
.
statusName
,
cover
=
item
.
cover
,
accessCode
=
item
.
accessCode
,
statusColor
=
item
.
statusColor
,
createdAt
=
item
.
createdAt
,
modifier
=
Modifier
.
padding
(
horizontal
=
12
.
dp
,
vertical
=
4
.
dp
),
clickOnCard
=
{
onEventSent
(
PrintJobsContract
.
Event
.
ToDetails
(
item
.
id
))
},
clickOnSpot
=
{
onEventSent
(
PrintJobsContract
.
Event
.
ToSpot
(
item
.
spotCode
))
}
)
}
}
}
}
\ No newline at end of file
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