From dd0ce16dfb9ccb6f6500263a54f999adef2f0d44 Mon Sep 17 00:00:00 2001 From: Sasikanth Date: Wed, 7 Aug 2024 17:46:08 +0530 Subject: [PATCH 1/3] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6df7d653e..95a27a2c5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -20,6 +20,10 @@ Steps to reproduce the behavior: **Screenshots** If applicable, add screenshots to help explain your problem. + +**Feed Information** +Links to the feed that are having this issue + **Device Information** - Device: [e.g. Pixel 7] - OS: [e.g. Android 13] From a9a0af03aa28312019620b9d9d319b82218d322a Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 7 Aug 2024 18:23:27 +0530 Subject: [PATCH 2/3] Add feed icon to reader screen --- .../composeResources/files/reader/styles.css | 13 +++++++++++++ .../sasikanth/rss/reader/reader/ui/ReaderHTML.kt | 13 +++++++++++-- .../sasikanth/rss/reader/reader/ui/ReaderScreen.kt | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/shared/src/commonMain/composeResources/files/reader/styles.css b/shared/src/commonMain/composeResources/files/reader/styles.css index 154b5e8c0..c48531a32 100644 --- a/shared/src/commonMain/composeResources/files/reader/styles.css +++ b/shared/src/commonMain/composeResources/files/reader/styles.css @@ -12,12 +12,25 @@ figcaption { font-size: 14px; line-height: 1.6; } +.row { + display: flex; + justify-content: center; + align-items: center; +} +.column { + margin-left: 16px; + flex: 1; +} .caption { font-size: 12px; } .feedName { margin-bottom: 8px; } +.feedIcon { + width: 32px; + height: auto; +} img, figure, video, div, object { max-width: 100%; height: auto !important; diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderHTML.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderHTML.kt index d3e4ca00a..c6d719304 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderHTML.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderHTML.kt @@ -25,6 +25,7 @@ object ReaderHTML { title: String, feedName: String, feedHomePageLink: String, + feedIcon: String, publishedAt: String, locale: String, direction: LayoutDirection @@ -37,6 +38,7 @@ object ReaderHTML { postMetadata( feedName = feedName, feedHomePageLink = feedHomePageLink, + feedIcon = feedIcon, publishedAt = publishedAt, hasTitle = title.isNotBlank() ) @@ -69,6 +71,7 @@ object ReaderHTML { private fun postMetadata( feedName: String, feedHomePageLink: String, + feedIcon: String, publishedAt: String, hasTitle: Boolean, ): String { @@ -77,10 +80,16 @@ object ReaderHTML { appendLine("
") } + // language=HTML appendLine( """ - -
$publishedAt
+
+ Feed Icon +
+ +
$publishedAt
+
+

""" .trimIndent() diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderScreen.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderScreen.kt index af7080023..39922a0cb 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderScreen.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/reader/ui/ReaderScreen.kt @@ -246,6 +246,7 @@ internal fun ReaderScreen( title = state.title!!, feedName = state.feed!!.name, feedHomePageLink = state.feed!!.homepageLink, + feedIcon = state.feed!!.icon, publishedAt = state.publishedAt!!, locale = Locale.current.toLanguageTag(), direction = layoutDirection From 267d45ac28c1c30321ae1ec0e6e65d57beec7ed0 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 7 Aug 2024 19:42:28 +0530 Subject: [PATCH 3/3] Show loading indicator when featured posts are being refreshed --- .../kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt | 4 ++-- .../kotlin/dev/sasikanth/rss/reader/home/ui/HomeScreen.kt | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt index 8a88865da..67f3101be 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt @@ -48,7 +48,6 @@ import dev.sasikanth.rss.reader.utils.getTodayStartInstant import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.MutableStateFlow @@ -273,7 +272,6 @@ class HomePresenter( } } - @OptIn(FlowPreview::class) private fun init() { combine(observableActiveSource.activeSource, settingsRepository.postsType) { activeSource, @@ -286,6 +284,7 @@ class HomePresenter( it.copy( activeSource = activeSource, postsType = postsType, + loadingState = HomeLoadingState.Loading, featuredPosts = null, posts = null ) @@ -339,6 +338,7 @@ class HomePresenter( NTuple4(activeSource, postsAfter, unreadOnly, featuredPostsIds) } } + .onEach { _state.update { it.copy(loadingState = HomeLoadingState.Idle) } } .distinctUntilChanged() .onEach { (activeSource, postsAfter, unreadOnly, featuredPostsIds) -> val posts = diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeScreen.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeScreen.kt index 9c66cce42..80022893d 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeScreen.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/ui/HomeScreen.kt @@ -30,8 +30,6 @@ import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredHeight import androidx.compose.foundation.layout.requiredSize -import androidx.compose.foundation.layout.statusBars -import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.foundation.rememberScrollState @@ -182,7 +180,7 @@ internal fun HomeScreen( ) }, body = { paddingValues -> - Box { + Box(modifier = Modifier.fillMaxSize()) { when { hasFeeds == null || (posts == null || featuredPosts == null) -> { // no-op @@ -223,9 +221,7 @@ internal fun HomeScreen( PullRefreshIndicator( refreshing = state.isRefreshing, state = swipeRefreshState, - modifier = - Modifier.windowInsetsPadding(WindowInsets.statusBars) - .align(Alignment.TopCenter) + modifier = Modifier.padding(paddingValues).align(Alignment.TopCenter) ) } },