Skip to content

Commit d9a64d9

Browse files
Fix compilation error
1 parent 0931d44 commit d9a64d9

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

app/src/main/java/org/schabi/newpipe/ui/emptystate/EmptyStateComposable.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ enum class EmptyStateSpec(
9696
emojiText = "¯\\_(╹x╹)_/¯",
9797
descriptionText = R.string.error_unable_to_load_comments,
9898
),
99+
ErrorLoadingItems(
100+
emojiText = "¯\\_(╹x╹)_/¯",
101+
descriptionText = R.string.error_unable_to_load_items,
102+
),
99103
NoSearchResult(
100104
emojiText = "╰(°●°╰)",
101105
descriptionText = R.string.search_no_results,

app/src/main/java/org/schabi/newpipe/ui/screens/PlaylistScreen.kt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import android.content.res.Configuration
44
import androidx.compose.material3.Surface
55
import androidx.compose.runtime.Composable
66
import androidx.compose.runtime.getValue
7-
import androidx.compose.ui.res.stringResource
87
import androidx.compose.ui.tooling.preview.Preview
98
import androidx.lifecycle.compose.collectAsStateWithLifecycle
109
import androidx.lifecycle.viewmodel.compose.viewModel
1110
import androidx.paging.PagingData
1211
import androidx.paging.compose.collectAsLazyPagingItems
1312
import kotlinx.coroutines.flow.Flow
1413
import kotlinx.coroutines.flow.flowOf
15-
import org.schabi.newpipe.R
1614
import org.schabi.newpipe.extractor.stream.Description
1715
import org.schabi.newpipe.extractor.stream.StreamInfoItem
1816
import org.schabi.newpipe.extractor.stream.StreamType
@@ -49,18 +47,10 @@ private fun PlaylistScreen(
4947
)
5048
}
5149

52-
is Resource.Loading -> {
53-
LoadingIndicator()
54-
}
50+
is Resource.Loading -> LoadingIndicator()
5551

56-
is Resource.Error -> {
57-
// TODO use error panel instead
58-
EmptyStateComposable(
59-
EmptyStateSpec.NoVideos.copy(
60-
descriptionText = { stringResource(R.string.error_unable_to_load_streams) },
61-
)
62-
)
63-
}
52+
// TODO use error panel instead
53+
is Resource.Error -> EmptyStateComposable(EmptyStateSpec.ErrorLoadingItems)
6454
}
6555
}
6656

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@
871871
<string name="migration_info_6_7_message">SoundCloud has discontinued the original Top 50 charts. The corresponding tab has been removed from your main page.</string>
872872
<string name="auto_queue_description">Next</string>
873873
<string name="newpipe_extractor_description">NewPipeExtractor is a library for extracting things from streaming sites. It is a core component of NewPipe, but could be used independently.</string>
874-
<string name="error_unable_to_load_streams">Could not load streams</string>
874+
<string name="error_unable_to_load_items">Could not load items</string>
875875
<string name="playlist_uploader_icon_description">Playlist uploader icon</string>
876876
<plurals name="comments">
877877
<item quantity="one">%d comment</item>

0 commit comments

Comments
 (0)