Skip to content

Commit e47ae5a

Browse files
committed
Merge branch 'master' into develop
# Conflicts: # app/build.gradle.kts
2 parents 6232bbb + dcd7a9f commit e47ae5a

File tree

7 files changed

+41
-29
lines changed

7 files changed

+41
-29
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# v2.1.1
2+
3+
- Fix unclickable feeds at the bottom of the drawer on long lists (#301)
4+
- Fix folders not being updatable when having no feeds for local accounts (#312)
5+
- Remove AlphaSlider in ColorPickerDialog as alpha colors are not supported by Android color contrast utils (#308)
6+
- Fix an annoying bug where certain items could not being set read/starred when coming back from the pager
7+
- Do not display Feedly account type in account selection dialog
8+
19
# v2.1.0
210

311
This release focuses mainly on QOL improvements. You will find among them long time requested features. I hope in the future to be able to deliver new releases in less than six months.

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ android {
2121
defaultConfig {
2222
applicationId = "com.readrops.app"
2323

24-
versionCode = 21
25-
versionName = "2.1.0"
24+
versionCode = 22
25+
versionName = "2.1.1"
2626

2727
testInstrumentationRunner = "com.readrops.app.ReadropsTestRunner"
2828
}

app/src/main/java/com/readrops/app/account/dialog/AccountSelectionDialog.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fun AccountSelectionDialog(
2323
onDismiss = onDismiss
2424
) {
2525
AccountType.entries
26+
.filter { it != AccountType.FEEDLY }
2627
.forEach { type ->
2728
SelectableImageText(
2829
image = adaptiveIconPainterResource(id = type.iconRes),

app/src/main/java/com/readrops/app/feeds/color/ColorPickerDialog.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import androidx.compose.ui.graphics.RectangleShape
2020
import androidx.compose.ui.res.painterResource
2121
import androidx.compose.ui.res.stringResource
2222
import androidx.compose.ui.unit.dp
23-
import com.github.skydoves.colorpicker.compose.AlphaSlider
2423
import com.github.skydoves.colorpicker.compose.BrightnessSlider
2524
import com.github.skydoves.colorpicker.compose.HsvColorPicker
2625
import com.github.skydoves.colorpicker.compose.rememberColorPickerController
@@ -58,14 +57,6 @@ fun ColorPickerDialog(
5857
initialColor = color
5958
)
6059

61-
AlphaSlider(
62-
modifier = Modifier
63-
.fillMaxWidth()
64-
.padding(vertical = MaterialTheme.spacing.shortSpacing)
65-
.height(24.dp),
66-
controller = controller,
67-
)
68-
6960
BrightnessSlider(
7061
modifier = Modifier
7162
.fillMaxWidth()

app/src/main/java/com/readrops/app/item/ItemScreenModel.kt

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ import com.readrops.db.pojo.ItemWithFeed
4040
import com.readrops.db.queries.ItemSelectionQueryBuilder
4141
import com.readrops.db.queries.ItemsQueryBuilder
4242
import kotlinx.coroutines.CoroutineDispatcher
43+
import kotlinx.coroutines.DelicateCoroutinesApi
4344
import kotlinx.coroutines.Dispatchers
44-
import kotlinx.coroutines.NonCancellable
45+
import kotlinx.coroutines.GlobalScope
4546
import kotlinx.coroutines.flow.Flow
4647
import kotlinx.coroutines.flow.MutableStateFlow
4748
import kotlinx.coroutines.flow.SharingStarted
@@ -51,7 +52,6 @@ import kotlinx.coroutines.flow.map
5152
import kotlinx.coroutines.flow.stateIn
5253
import kotlinx.coroutines.flow.update
5354
import kotlinx.coroutines.launch
54-
import kotlinx.coroutines.withContext
5555
import org.koin.core.component.KoinComponent
5656
import org.koin.core.component.get
5757
import org.koin.core.parameter.parametersOf
@@ -92,6 +92,7 @@ class ItemScreenModel(
9292
)
9393
)
9494
)
95+
9596
// based type is Flow because with StateFlow when coming back from process death, pager doesn't resume
9697
// it might be due to stateIn() overlapping cachedIn(), but not sure
9798
var itemState: Flow<PagingData<ItemWithFeed>> = _itemState.asStateFlow()
@@ -360,23 +361,29 @@ class ItemScreenModel(
360361
itemWithFeed, context, useCustomShareIntentTpl.value, customShareIntentTpl.value
361362
)
362363

364+
@OptIn(DelicateCoroutinesApi::class)
363365
override fun onDispose() {
364-
screenModelScope.launch(dispatcher) {
365-
withContext(NonCancellable) {
366-
repository.setItemsRead(
367-
items = state.value.stateChanges
368-
.filter { it.readChange }
369-
.map { it.item }
370-
)
366+
// Use GlobalScope instead of NonCancellable
367+
// It seems that NonCancellable is not is sufficiently non cancellable
368+
// I ran multiple times into very frustrating situations where items were not set read
369+
// The risk of leak here is mitigated by the fact that only one shot operations are performed
370+
// If the coroutine is cancelled for whatever reason, only items state will be lost, which is not a big deal
371+
// and should happen very rarely
372+
GlobalScope.launch(dispatcher) {
373+
repository.setItemsRead(
374+
items = state.value.stateChanges
375+
.filter { it.readChange }
376+
.map { it.item }
377+
)
378+
379+
state.value.stateChanges
380+
.filter { it.starChange }
381+
.forEach {
382+
repository.setItemStarState(it.item.apply {
383+
isStarred = !isStarred
384+
})
385+
}
371386

372-
state.value.stateChanges
373-
.filter { it.starChange }
374-
.forEach {
375-
repository.setItemStarState(it.item.apply {
376-
isStarred = !isStarred
377-
})
378-
}
379-
}
380387
}
381388
}
382389
}

db/src/main/java/com/readrops/db/queries/FoldersAndFeedsQueryBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object FoldersAndFeedsQueryBuilder {
2121
"Feed.remote_id as feedRemoteId",
2222
"Folder.id As folderId",
2323
"Folder.name As folderName",
24-
"Feed.account_id as accountId",
24+
"Folder.account_id as accountId",
2525
"Folder.remoteId as folderRemoteId"
2626
)
2727

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* Fix unclickable feeds at the bottom of the drawer on long lists (#301)
2+
* Fix folders not being updatable when having no feeds for local accounts (#312)
3+
* Remove AlphaSlider in ColorPickerDialog as alpha colors are not supported by Android color contrast utils (#308)
4+
* Fix an annoying bug where certain items could not being set read/starred when coming back from the pager
5+
* Do not display Feedly account type in account selection dialog

0 commit comments

Comments
 (0)