Skip to content

Commit 71db804

Browse files
Merge tag 'v1.4.1' into develop
Version 1.4.1
2 parents 091ced1 + 3fe9b70 commit 71db804

5 files changed

Lines changed: 14 additions & 11 deletions

File tree

.github/workflows/publishing.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ jobs:
142142
case "${{ github.ref_name }}" in
143143
v*.*.*)
144144
export track=beta;;
145-
hotfix/*)
146-
export track=beta;;
147145
*)
148146
export track=internal;;
149147
esac

app/src/legacy/kotlin/app/fyreplace/fyreplace/legacy/extensions/ViewExt.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.view.HapticFeedbackConstants
66
import android.view.View
77
import android.view.inputmethod.InputMethodManager
88
import androidx.core.graphics.Insets
9+
import androidx.core.graphics.Insets.max
910
import androidx.core.view.ViewCompat
1011
import androidx.core.view.WindowInsetsCompat
1112
import androidx.core.view.updatePadding
@@ -21,7 +22,9 @@ fun View.updatePaddingWithSystemInsets(basePadding: Insets) =
2122

2223
fun View.updatePaddingWithImeInsets(basePadding: Insets) =
2324
ViewCompat.setOnApplyWindowInsetsListener(this) { view, insets ->
24-
view.updatePadding(basePadding + insets.getInsets(WindowInsetsCompat.Type.ime()))
25+
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime())
26+
val barInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
27+
view.updatePadding(basePadding + max(imeInsets, barInsets))
2528
return@setOnApplyWindowInsetsListener insets
2629
}
2730

app/src/legacy/kotlin/app/fyreplace/fyreplace/legacy/ui/fragments/FeedFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ class FeedFragment :
7272
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
7373
super.onViewCreated(view, savedInstanceState)
7474
adapter = FeedAdapter(em, viewLifecycleOwner, cvm.isAuthenticated, this, this)
75+
adapter.replaceAll(vm.posts.value)
7576
bd.recyclerView.adapter = adapter
7677
bd.swipe.setOnRefreshListener { launch { refreshListing() } }
78+
vm.posts.launchCollect(action = adapter::replaceAll)
7779
}
7880

7981
override fun onStart() {
@@ -117,7 +119,6 @@ class FeedFragment :
117119
vm.startListing().launchCollect(retry = if (retryCount < 3) ::retryListing else null) {
118120
bd.swipe.isRefreshing = false
119121
retryCount = 0
120-
adapter.replaceAll(it)
121122
}.invokeOnCompletion {
122123
if (listing == currentListing) {
123124
bd.swipe.isRefreshing = false

app/src/legacy/kotlin/app/fyreplace/fyreplace/legacy/viewmodels/FeedViewModel.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class FeedViewModel @Inject constructor(
3131
private val postService: PostServiceClient
3232
) : BaseViewModel() {
3333
private lateinit var votesChannel: SendChannel<Vote>
34-
private val posts = MutableStateFlow(emptyList<Post>())
34+
private val mPosts = MutableStateFlow(emptyList<Post>())
35+
val posts = mPosts.asStateFlow()
3536
val isEmpty = posts.map(List<Post>::isEmpty).asState(true)
3637
val emptyText = MutableStateFlow(R.string.feed_empty).asStateFlow()
3738
private val stalePostIds = mutableSetOf<ByteString>()
@@ -68,7 +69,7 @@ class FeedViewModel @Inject constructor(
6869
}
6970

7071
fun reset() {
71-
posts.value = emptyList()
72+
mPosts.value = emptyList()
7273
stalePostIds.clear()
7374
}
7475

@@ -80,7 +81,7 @@ class FeedViewModel @Inject constructor(
8081
spread = spread
8182
)
8283
)
83-
posts.value = posts.value.filter { it.id != postId }
84+
mPosts.value = posts.value.filter { it.id != postId }
8485
}
8586

8687
private suspend fun FlowCollector<List<Post>>.emitFeed(newPost: Post) {
@@ -102,20 +103,20 @@ class FeedViewModel @Inject constructor(
102103
pruneStalePosts()
103104
}
104105

105-
posts.value = newFeed
106+
mPosts.value = newFeed
106107
emit(newFeed)
107108
}
108109

109110
private fun pruneStalePosts() {
110111
for (id in stalePostIds) {
111-
posts.value = posts.value.filter { it.id != id }
112+
mPosts.value = posts.value.filter { it.id != id }
112113
}
113114

114115
stalePostIds.clear()
115116
}
116117

117118
private fun incrementCommentCount(postId: ByteString) {
118-
posts.value = posts.value.map {
119+
mPosts.value = posts.value.map {
119120
when (it.id) {
120121
postId -> it.copy(comment_count = it.comment_count + 1)
121122
else -> it

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
androidPlugin = "9.1.0"
2+
androidPlugin = "9.1.1"
33
kotlinPlugin = "2.3.20"
44
sentryPlugin = "6.4.0"
55
openapiPlugin = "7.21.0"

0 commit comments

Comments
 (0)