Skip to content

Commit 826e56b

Browse files
committed
Update version 0.9.6
1 parent 19924e5 commit 826e56b

File tree

9 files changed

+98
-36
lines changed

9 files changed

+98
-36
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ android {
2121
applicationId "me.ash.reader"
2222
minSdk 26
2323
targetSdk 32
24-
versionCode 16
25-
versionName "0.9.5"
24+
versionCode 17
25+
versionName "0.9.6"
2626

2727
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2828
vectorDrawables {

app/src/main/java/me/ash/reader/data/repository/AbstractRssRepository.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ abstract class AbstractRssRepository constructor(
4242
private val dispatcherDefault: CoroutineDispatcher,
4343
) {
4444

45-
open val subscribe = true
46-
open val move = true
45+
open val subscribe: Boolean = true
46+
open val move: Boolean = true
47+
open val delete: Boolean = true
48+
open val update: Boolean = true
4749

4850
open suspend fun validCredentials(): Boolean = true
4951

app/src/main/java/me/ash/reader/data/repository/FeverRssRepository.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ class FeverRssRepository @Inject constructor(
5353
feedDao, workManager, rssHelper, notificationHelper, ioDispatcher, defaultDispatcher
5454
) {
5555

56-
override val subscribe = false
56+
override val subscribe: Boolean = false
5757
override val move: Boolean = false
58+
override val delete: Boolean = false
59+
override val update: Boolean = false
5860

5961
private suspend fun getFeverAPI() =
6062
FeverSecurityKey(accountDao.queryById(context.currentAccountId)!!.securityKey).run {

app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedOptionView.kt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ fun FeedOptionView(
3939
selectedParseFullContentPreset: Boolean = false,
4040
isMoveToGroup: Boolean = false,
4141
showGroup:Boolean = true,
42-
showUnsubscribe: Boolean = false,
42+
showUnsubscribe:Boolean = true,
43+
notSubscribeMode: Boolean = false,
4344
selectedGroupId: String = "",
4445
allowNotificationPresetOnClick: () -> Unit = {},
4546
parseFullContentPresetOnClick: () -> Unit = {},
@@ -68,6 +69,7 @@ fun FeedOptionView(
6869
selectedAllowNotificationPreset = selectedAllowNotificationPreset,
6970
selectedParseFullContentPreset = selectedParseFullContentPreset,
7071
showUnsubscribe = showUnsubscribe,
72+
notSubscribeMode = notSubscribeMode,
7173
allowNotificationPresetOnClick = allowNotificationPresetOnClick,
7274
parseFullContentPresetOnClick = parseFullContentPresetOnClick,
7375
clearArticlesOnClick = clearArticlesOnClick,
@@ -120,7 +122,8 @@ private fun EditableUrl(
120122
private fun Preset(
121123
selectedAllowNotificationPreset: Boolean = false,
122124
selectedParseFullContentPreset: Boolean = false,
123-
showUnsubscribe: Boolean = false,
125+
showUnsubscribe: Boolean = true,
126+
notSubscribeMode: Boolean = false,
124127
allowNotificationPresetOnClick: () -> Unit = {},
125128
parseFullContentPresetOnClick: () -> Unit = {},
126129
clearArticlesOnClick: () -> Unit = {},
@@ -168,20 +171,22 @@ private fun Preset(
168171
) {
169172
parseFullContentPresetOnClick()
170173
}
171-
if (showUnsubscribe) {
174+
if (notSubscribeMode) {
172175
RYSelectionChip(
173176
modifier = Modifier.animateContentSize(),
174177
content = stringResource(R.string.clear_articles),
175178
selected = false,
176179
) {
177180
clearArticlesOnClick()
178181
}
179-
RYSelectionChip(
180-
modifier = Modifier.animateContentSize(),
181-
content = stringResource(R.string.unsubscribe),
182-
selected = false,
183-
) {
184-
unsubscribeOnClick()
182+
if (showUnsubscribe) {
183+
RYSelectionChip(
184+
modifier = Modifier.animateContentSize(),
185+
content = stringResource(R.string.unsubscribe),
186+
selected = false,
187+
) {
188+
unsubscribeOnClick()
189+
}
185190
}
186191
}
187192
}

app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/feed/FeedOptionDrawer.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ fun FeedOptionDrawer(
6969
Spacer(modifier = Modifier.height(16.dp))
7070
Text(
7171
modifier = Modifier.roundClick {
72-
feedOptionViewModel.showRenameDialog()
72+
if (feedOptionViewModel.rssRepository.get().update) {
73+
feedOptionViewModel.showRenameDialog()
74+
}
7375
},
7476
text = feed?.name ?: stringResource(R.string.unknown),
7577
style = MaterialTheme.typography.headlineSmall,
@@ -87,7 +89,8 @@ fun FeedOptionDrawer(
8789
selectedParseFullContentPreset = feedOptionUiState.feed?.isFullContent ?: false,
8890
isMoveToGroup = true,
8991
showGroup = feedOptionViewModel.rssRepository.get().move,
90-
showUnsubscribe = true,
92+
showUnsubscribe = feedOptionViewModel.rssRepository.get().delete,
93+
notSubscribeMode = true,
9194
selectedGroupId = feedOptionUiState.feed?.groupId ?: "",
9295
allowNotificationPresetOnClick = {
9396
feedOptionViewModel.changeAllowNotificationPreset()
@@ -111,8 +114,10 @@ fun FeedOptionDrawer(
111114
context.openURL(feed?.url)
112115
},
113116
onFeedUrlLongClick = {
114-
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
115-
feedOptionViewModel.showFeedUrlDialog()
117+
if (feedOptionViewModel.rssRepository.get().update) {
118+
view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP)
119+
feedOptionViewModel.showFeedUrlDialog()
120+
}
116121
}
117122
)
118123
}

app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionDrawer.kt

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ import me.ash.reader.ui.ext.*
4141
@OptIn(ExperimentalMaterialApi::class)
4242
@Composable
4343
fun GroupOptionDrawer(
44-
groupOptionViewModel: GroupOptionViewModel = hiltViewModel(),
44+
viewModel: GroupOptionViewModel = hiltViewModel(),
4545
content: @Composable () -> Unit = {},
4646
) {
4747
val context = LocalContext.current
4848
val scope = rememberCoroutineScope()
49-
val groupOptionUiState = groupOptionViewModel.groupOptionUiState.collectAsStateValue()
49+
val groupOptionUiState = viewModel.groupOptionUiState.collectAsStateValue()
5050
val group = groupOptionUiState.group
5151
val toastString = stringResource(R.string.rename_toast, groupOptionUiState.newName)
5252

@@ -73,7 +73,9 @@ fun GroupOptionDrawer(
7373
Spacer(modifier = Modifier.height(16.dp))
7474
Text(
7575
modifier = Modifier.roundClick {
76-
groupOptionViewModel.showRenameDialog()
76+
if (viewModel.rssRepository.get().update) {
77+
viewModel.showRenameDialog()
78+
}
7779
},
7880
text = group?.name ?: stringResource(R.string.unknown),
7981
style = MaterialTheme.typography.headlineSmall,
@@ -102,17 +104,17 @@ fun GroupOptionDrawer(
102104
Subtitle(text = stringResource(R.string.preset))
103105

104106
Spacer(modifier = Modifier.height(10.dp))
105-
Preset(groupOptionViewModel, group, context)
107+
Preset(viewModel, group, context)
106108

107-
if (groupOptionUiState.groups.size != 1) {
109+
if (viewModel.rssRepository.get().move && groupOptionUiState.groups.size != 1) {
108110
Spacer(modifier = Modifier.height(26.dp))
109111
Subtitle(text = stringResource(R.string.move_to_group))
110112
Spacer(modifier = Modifier.height(10.dp))
111113

112114
if (groupOptionUiState.groups.size > 6) {
113-
LazyRowGroups(groupOptionUiState, group, groupOptionViewModel)
115+
LazyRowGroups(groupOptionUiState, group, viewModel)
114116
} else {
115-
FlowRowGroups(groupOptionUiState, group, groupOptionViewModel)
117+
FlowRowGroups(groupOptionUiState, group, viewModel)
116118
}
117119
}
118120

@@ -133,22 +135,22 @@ fun GroupOptionDrawer(
133135
visible = groupOptionUiState.renameDialogVisible,
134136
value = groupOptionUiState.newName,
135137
onValueChange = {
136-
groupOptionViewModel.inputNewName(it)
138+
viewModel.inputNewName(it)
137139
},
138140
onDismissRequest = {
139-
groupOptionViewModel.hideRenameDialog()
141+
viewModel.hideRenameDialog()
140142
},
141143
onConfirm = {
142-
groupOptionViewModel.rename()
143-
groupOptionViewModel.hideDrawer(scope)
144+
viewModel.rename()
145+
viewModel.hideDrawer(scope)
144146
context.showToast(toastString)
145147
}
146148
)
147149
}
148150

149151
@Composable
150152
private fun Preset(
151-
groupOptionViewModel: GroupOptionViewModel,
153+
viewModel: GroupOptionViewModel,
152154
group: Group?,
153155
context: Context,
154156
) {
@@ -172,7 +174,7 @@ private fun Preset(
172174
)
173175
},
174176
) {
175-
groupOptionViewModel.showAllAllowNotificationDialog()
177+
viewModel.showAllAllowNotificationDialog()
176178
}
177179
RYSelectionChip(
178180
modifier = Modifier.animateContentSize(),
@@ -188,22 +190,22 @@ private fun Preset(
188190
)
189191
},
190192
) {
191-
groupOptionViewModel.showAllParseFullContentDialog()
193+
viewModel.showAllParseFullContentDialog()
192194
}
193195
RYSelectionChip(
194196
modifier = Modifier.animateContentSize(),
195197
content = stringResource(R.string.clear_articles),
196198
selected = false,
197199
) {
198-
groupOptionViewModel.showClearDialog()
200+
viewModel.showClearDialog()
199201
}
200-
if (group?.id != context.currentAccountId.getDefaultGroupId()) {
202+
if (viewModel.rssRepository.get().delete && group?.id != context.currentAccountId.getDefaultGroupId()) {
201203
RYSelectionChip(
202204
modifier = Modifier.animateContentSize(),
203205
content = stringResource(R.string.delete_group),
204206
selected = false,
205207
) {
206-
groupOptionViewModel.showDeleteDialog()
208+
viewModel.showDeleteDialog()
207209
}
208210
}
209211
}

app/src/main/java/me/ash/reader/ui/page/home/feeds/drawer/group/GroupOptionViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import javax.inject.Inject
2323
@OptIn(ExperimentalMaterialApi::class)
2424
@HiltViewModel
2525
class GroupOptionViewModel @Inject constructor(
26-
private val rssRepository: RssRepository,
26+
val rssRepository: RssRepository,
2727
@MainDispatcher
2828
private val mainDispatcher: CoroutineDispatcher,
2929
@IODispatcher
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## 0.9.6
2+
3+
1. Support Fever API (beta)
4+
5+
2. Improve translation (thanks to all)
6+
7+
3. Fix the bug of being in sync all the time when switching accounts
8+
9+
4. Fix the bug that you can't modify other account settings
10+
11+
Fever is an outdated API, which is not fully compatible with modern readers.
12+
But as the first third-party service API supported by Read You, it's a good opportunity to get started.
13+
14+
There will be a supplemental update in the near future for bug fixes and additional translations.
15+
16+
17+
### Known bugs
18+
19+
1. Fever account can only pull the full amount of articles on the server during each sync
20+
21+
2. Notification feature of Fever account is not working
22+
23+
3. Full content parsing preset switch of Fever account is reset after each sync
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## 0.9.6
2+
3+
1. 支持 Fever API (beta)
4+
5+
2. 改进翻译(感谢所有人)
6+
7+
3. 修复切换账户时一直处于同步状态的问题
8+
9+
4. 修复无法修改其他账户设置的问题
10+
11+
Fever 是一个已经过时的 API,它对现代阅读器的功能并不完全兼容。
12+
但作为 Read You 所支持的第一个第三方服务 API,是一个很好的起步机会。
13+
14+
近期将会有一个补充更新,用于修复 bug 和补充翻译。
15+
16+
17+
### 已知问题
18+
19+
1. Fever 账户在每次同步时只能全量拉取服务器上的文章
20+
21+
2. Fever 账户的通知功能失效
22+
23+
3. Fever 账户的全文解析预设开关在每次同步后被重置

0 commit comments

Comments
 (0)