File tree Expand file tree Collapse file tree 4 files changed +48
-8
lines changed
app/src/main/java/org/schabi/newpipe/ui Expand file tree Collapse file tree 4 files changed +48
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.content.res.Configuration
44import androidx.compose.foundation.layout.Arrangement
55import androidx.compose.foundation.layout.Row
66import androidx.compose.foundation.layout.fillMaxWidth
7+ import androidx.compose.foundation.layout.heightIn
78import androidx.compose.foundation.layout.padding
89import androidx.compose.material3.Surface
910import androidx.compose.material3.Switch
@@ -74,7 +75,12 @@ fun RelatedItems(info: StreamInfo) {
7475 }
7576 if (info.relatedItems.isEmpty()) {
7677 item {
77- EmptyStateComposable (EmptyStateSpec .NoVideos )
78+ EmptyStateComposable (
79+ spec = EmptyStateSpec .NoComments ,
80+ modifier = Modifier
81+ .fillMaxWidth()
82+ .heightIn(min = 128 .dp)
83+ )
7884 }
7985 }
8086 }
Original file line number Diff line number Diff line change 11package org.schabi.newpipe.ui.components.video.comment
22
33import android.content.res.Configuration
4+ import androidx.compose.foundation.layout.fillMaxWidth
5+ import androidx.compose.foundation.layout.heightIn
46import androidx.compose.foundation.layout.padding
57import androidx.compose.foundation.lazy.LazyColumn
68import androidx.compose.foundation.lazy.rememberLazyListState
@@ -126,14 +128,22 @@ private fun CommentRepliesDialog(
126128 } else if (refresh is LoadState .Error ) {
127129 // TODO use error panel instead
128130 EmptyStateComposable (
129- EmptyStateSpec .DisabledComments .copy(
131+ spec = EmptyStateSpec .DisabledComments .copy(
130132 descriptionText = {
131133 stringResource(R .string.error_unable_to_load_comments)
132134 },
133135 ),
136+ modifier = Modifier
137+ .fillMaxWidth()
138+ .heightIn(min = 128 .dp)
134139 )
135140 } else {
136- EmptyStateComposable (EmptyStateSpec .NoComments )
141+ EmptyStateComposable (
142+ spec = EmptyStateSpec .NoComments ,
143+ modifier = Modifier
144+ .fillMaxWidth()
145+ .heightIn(min = 128 .dp)
146+ )
137147 }
138148 }
139149 } else {
Original file line number Diff line number Diff line change 11package org.schabi.newpipe.ui.components.video.comment
22
33import android.content.res.Configuration
4+ import androidx.compose.foundation.layout.fillMaxWidth
5+ import androidx.compose.foundation.layout.heightIn
46import androidx.compose.foundation.layout.padding
57import androidx.compose.foundation.lazy.LazyColumn
68import androidx.compose.foundation.lazy.rememberLazyListState
@@ -68,11 +70,22 @@ private fun CommentSection(
6870
6971 if (commentInfo.isCommentsDisabled) {
7072 item {
71- EmptyStateComposable (EmptyStateSpec .DisabledComments )
73+ EmptyStateComposable (
74+ spec = EmptyStateSpec .DisabledComments ,
75+ modifier = Modifier
76+ .fillMaxWidth()
77+ .heightIn(min = 128 .dp)
78+
79+ )
7280 }
7381 } else if (count == 0 ) {
7482 item {
75- EmptyStateComposable (EmptyStateSpec .NoComments )
83+ EmptyStateComposable (
84+ spec = EmptyStateSpec .NoComments ,
85+ modifier = Modifier
86+ .fillMaxWidth()
87+ .heightIn(min = 128 .dp)
88+ )
7689 }
7790 } else {
7891 // do not show anything if the comment count is unknown
@@ -121,11 +134,14 @@ private fun CommentSection(
121134 item {
122135 // TODO use error panel instead
123136 EmptyStateComposable (
124- EmptyStateSpec .DisabledComments .copy(
137+ spec = EmptyStateSpec .DisabledComments .copy(
125138 descriptionText = {
126139 stringResource(R .string.error_unable_to_load_comments)
127140 }
128- )
141+ ),
142+ modifier = Modifier
143+ .fillMaxWidth()
144+ .heightIn(min = 128 .dp)
129145 )
130146 }
131147 }
Original file line number Diff line number Diff line change 22
33package org.schabi.newpipe.ui.emptystate
44
5+ import androidx.compose.foundation.layout.fillMaxWidth
6+ import androidx.compose.foundation.layout.heightIn
57import androidx.compose.material3.LocalContentColor
68import androidx.compose.material3.MaterialTheme
79import androidx.compose.material3.contentColorFor
810import androidx.compose.runtime.CompositionLocalProvider
11+ import androidx.compose.ui.Modifier
912import androidx.compose.ui.platform.ComposeView
1013import androidx.compose.ui.platform.ViewCompositionStrategy
14+ import androidx.compose.ui.unit.dp
1115import org.schabi.newpipe.ui.theme.AppTheme
1216
1317@JvmOverloads
@@ -22,7 +26,11 @@ fun ComposeView.setEmptyStateComposable(
2226 LocalContentColor provides contentColorFor(MaterialTheme .colorScheme.background)
2327 ) {
2428 EmptyStateComposable (
25- spec = spec
29+ spec = spec,
30+ modifier = Modifier
31+ .fillMaxWidth()
32+ .heightIn(min = 128 .dp)
33+
2634 )
2735 }
2836 }
You can’t perform that action at this time.
0 commit comments