Skip to content

Commit

Permalink
[1.233.*] Pre-release merge (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
tramline-github[bot] authored Sep 18, 2024
2 parents 26221c7 + 43955ce commit f188b1b
Show file tree
Hide file tree
Showing 20 changed files with 246 additions and 275 deletions.
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "2.0.10"
kotlin = "2.0.20"
android_gradle_plugin = "8.5.2"
compose = "1.7.0-beta02"

Expand All @@ -9,10 +9,10 @@ android_sdk_min = "26"

sqldelight = "2.0.2"
ktor = "2.3.12"
kotlinx_coroutines = "1.9.0-RC"
kotlinx_coroutines = "1.9.0"
kotlinx_date_time = "0.6.0"
kotlinx_immutable_collections = "0.3.7"
kotlinx_serialization_json = "1.7.1"
kotlinx_serialization_json = "1.7.2"
decompose = "3.0.0"
essenty = "2.1.0"
androidx_activity = "1.9.2"
Expand All @@ -29,15 +29,15 @@ coil = "3.0.0-alpha09"
spotless = "6.25.0"
ktfmt = "0.44"
kotlininject = "0.7.1"
ksp = "2.0.10-1.0.24"
ksp = "2.0.20-1.0.25"
material_color_utilities = "1.0.0-alpha01"
ksoup = "0.1.2"
sqliteAndroid = "3.45.0"
windowSizeClass = "0.5.0"
desugarJdk = "2.1.2"
lyricist = "1.7.0"
atomicfu = "0.25.0"
okio = "3.9.0"
okio = "3.9.1"
paging = "3.3.0-alpha02-0.5.1"
stately = "2.0.7"
xmlutil = "0.90.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ val DeTwineStrings =
settingsHeaderBehaviour = "Verhalten",
settingsHeaderFeedback = "Feedback und Fehlerberichte",
settingsHeaderOpml = "OPML",
settingsHeaderTheme = "Theme",
settingsBrowserTypeTitle = "Verwende den In-App-Browser",
settingsBrowserTypeSubtitle =
"Wenn diese Option deaktiviert ist, werden Links in Ihrem Standardbrowser geöffnet.",
Expand Down Expand Up @@ -82,6 +83,9 @@ val DeTwineStrings =
settingsShowReaderViewTitle = "Aktiviere Leseansicht",
settingsShowReaderViewSubtitle =
"Artikel werden in einer vereinfachten, leicht lesbaren Ansicht angezeigt.",
settingsThemeAuto = "Auto",
settingsThemeLight = "Light",
settingsThemeDark = "Dark",
feeds = "Feeds",
editFeeds = "Feeds bearbeiten",
comments = "Kommentare",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ val EnTwineStrings =
settingsHeaderBehaviour = "Behavior",
settingsHeaderFeedback = "Feedback & bug reports",
settingsHeaderOpml = "OPML",
settingsHeaderTheme = "Theme",
settingsBrowserTypeTitle = "Use in-app browser",
settingsBrowserTypeSubtitle = "When turned off, links will open in your default browser.",
settingsEnableBlurTitle = "Enable blur in homepage",
Expand All @@ -90,6 +91,9 @@ val EnTwineStrings =
settingsPostsDeletionPeriodOneYear = "1 year",
settingsShowReaderViewTitle = "Enable reader view",
settingsShowReaderViewSubtitle = "Articles will be shown in a simplified, easy-to-read view",
settingsThemeAuto = "Auto",
settingsThemeLight = "Light",
settingsThemeDark = "Dark",
feeds = "Feeds",
editFeeds = "Edit feeds",
comments = "Comments",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ val TrTwineStrings =
settingsHeaderBehaviour = "Davranış",
settingsHeaderFeedback = "Geri bildirim & Hata raporları",
settingsHeaderOpml = "OPML",
settingsHeaderTheme = "Theme",
settingsBrowserTypeTitle = "Uygulama içi tarayıcıyı kullan",
settingsBrowserTypeSubtitle =
"Kapatıldığında, bağlantılar varsayılan tarayıcınızda açılacaktır.",
Expand All @@ -78,6 +79,9 @@ val TrTwineStrings =
settingsShowReaderViewTitle = "Okuyucu görünümünü etkinleştir",
settingsShowReaderViewSubtitle =
"Gönderiler basitleştirilmiş, okunması kolay bir görünümde gösterilecek.",
settingsThemeAuto = "Auto",
settingsThemeLight = "Light",
settingsThemeDark = "Dark",
feeds = "İçerikler",
editFeeds = "İçerikleri düzenle",
comments = "Yorumlar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ data class TwineStrings(
val settingsHeaderBehaviour: String,
val settingsHeaderOpml: String,
val settingsHeaderFeedback: String,
val settingsHeaderTheme: String,
val settingsBrowserTypeTitle: String,
val settingsBrowserTypeSubtitle: String,
val settingsEnableBlurTitle: String,
Expand All @@ -78,6 +79,9 @@ data class TwineStrings(
val settingsPostsDeletionPeriodOneYear: String,
val settingsShowReaderViewTitle: String,
val settingsShowReaderViewSubtitle: String,
val settingsThemeAuto: String,
val settingsThemeLight: String,
val settingsThemeDark: String,
val feeds: String,
val editFeeds: String,
val comments: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ val ZhTwineStrings =
settingsHeaderBehaviour = "行为",
settingsHeaderFeedback = "反馈与错误报告",
settingsHeaderOpml = "OPML",
settingsHeaderTheme = "Theme",
settingsBrowserTypeTitle = "使用内置浏览器",
settingsBrowserTypeSubtitle = "如果禁用,链接将在默认浏览器中打开。",
settingsEnableBlurTitle = "在主页启用模糊效果",
Expand All @@ -72,6 +73,9 @@ val ZhTwineStrings =
settingsPostsDeletionPeriodOneYear = "一年",
settingsShowReaderViewTitle = "启用阅读视图",
settingsShowReaderViewSubtitle = "文章将以简化、易读的视图显示",
settingsThemeAuto = "Auto",
settingsThemeLight = "Light",
settingsThemeDark = "Dark",
feeds = "订阅",
editFeeds = "编辑订阅",
comments = "评论",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async function renderReaderView(link, html, colors) {
);

//noinspection JSUnresolvedVariable
const result = await parse(html, link);
const result = await Mercury.parse(link, { html: html });
const content = result.content || html;

document.getElementById("content").innerHTML += content;
Expand Down

Large diffs are not rendered by default.

231 changes: 0 additions & 231 deletions shared/src/commonMain/composeResources/files/reader/readability.js

This file was deleted.

38 changes: 12 additions & 26 deletions shared/src/commonMain/composeResources/files/reader/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ h1 {
font-size: 24px;
}
body {
display: none;
display: block;
}
figure {
margin: 0;
Expand Down Expand Up @@ -41,42 +41,28 @@ ol li p {
li:not(:last-of-type) {
margin-bottom: 1em;
}
pre {
max-width: 100%;
margin: 0;
overflow: auto;
overflow-y: hidden;
word-wrap: normal;
word-break: normal;
border-radius: 4px;
padding: 8px;
}
pre {
line-height: 1.4286;
}
code {
padding: 1px 2px;
border-radius: 2px;
}
pre code {
letter-spacing: -.027em;
font-size: 1.15em;
}
iframe {
width: 100%;
max-width: 100%;
height: 250px;
max-height: 250px;
}
table {
display: flex;
flex-direction: column;
display: block;
overflow-x: auto;
}
table img {
max-width: 100%;
display: block;
height: auto;
margin-bottom: 16px;
}
table td {
pre {
display: block;
overflow-x: auto;
border-radius: 2px;
}
code {
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
line-height: 1.8em;
border-radius: 2px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import androidx.compose.material.SnackbarHost
import androidx.compose.material.SnackbarHostState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowRight
import androidx.compose.material.icons.filled.FolderOpen
import androidx.compose.material.icons.rounded.Close
import androidx.compose.material.icons.twotone.FolderOpen
import androidx.compose.material3.ButtonDefaults
Expand Down Expand Up @@ -213,9 +212,9 @@ fun AddFeedScreen(presenter: AddFeedPresenter, modifier: Modifier = Modifier) {
hint = LocalStrings.current.feedEntryLinkHint,
keyboardOptions =
KeyboardOptions(
imeAction = ImeAction.Next,
autoCorrectEnabled = false,
keyboardType = KeyboardType.Uri,
autoCorrect = false
imeAction = ImeAction.Next
)
)

Expand All @@ -229,9 +228,9 @@ fun AddFeedScreen(presenter: AddFeedPresenter, modifier: Modifier = Modifier) {
hint = LocalStrings.current.feedEntryTitleHint,
keyboardOptions =
KeyboardOptions(
imeAction = ImeAction.Done,
autoCorrectEnabled = false,
keyboardType = KeyboardType.Text,
autoCorrect = false
imeAction = ImeAction.Done
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fun App(
) {
val isSystemInDarkTheme = isSystemInDarkTheme()
val useDarkTheme =
remember(isSystemInDarkTheme) {
remember(isSystemInDarkTheme, appState.appThemeMode) {
when (appState.appThemeMode) {
AppThemeMode.Light -> false
AppThemeMode.Dark -> true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* Copyright 2024 Sasikanth Miriyampalli
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sasikanth.rss.reader.components

import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredHeightIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.unit.dp
import dev.sasikanth.rss.reader.ui.AppTheme

@Composable
fun ToggleableButtonGroup(
items: List<ToggleableButtonItem>,
onItemSelected: (ToggleableButtonItem) -> Unit,
modifier: Modifier = Modifier,
) {
Box(
modifier =
Modifier.then(modifier)
.requiredHeightIn(min = 56.dp)
.border(
width = 1.dp,
color = AppTheme.colorScheme.outlineVariant,
shape = RoundedCornerShape(50)
)
) {
val backgroundColor = AppTheme.colorScheme.tintedForeground
val selectedItemIndex by
animateFloatAsState(items.indexOfFirst { it.isSelected }.toFloat(), label = "selected_index")

Row(
modifier =
Modifier.padding(4.dp).drawBehind {
val spacingBetween = 4.dp.toPx()
val itemWidth = (size.width - spacingBetween * (items.size - 1)) / items.size

drawRoundRect(
color = backgroundColor,
topLeft =
Offset(
x = itemWidth * selectedItemIndex + spacingBetween * selectedItemIndex,
y = 0f
),
size = Size(width = itemWidth, height = size.height),
cornerRadius = CornerRadius(size.height / 2)
)
},
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp)
) {
items.forEach { toggleableButtonItem ->
TextButton(
modifier = Modifier.weight(1f).requiredHeightIn(min = 48.dp),
content = { Text(toggleableButtonItem.label) },
colors =
ButtonDefaults.textButtonColors(
contentColor =
if (toggleableButtonItem.isSelected) {
AppTheme.colorScheme.tintedSurface
} else {
AppTheme.colorScheme.tintedForeground
}
),
onClick = { onItemSelected(toggleableButtonItem) }
)
}
}
}
}

data class ToggleableButtonItem(
val label: String,
val isSelected: Boolean,
val identifier: Any?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private fun FeedLabelInput(
modifier = Modifier.fillMaxWidth(),
value = input,
onValueChange = { input = it },
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done, autoCorrect = false),
keyboardOptions = KeyboardOptions(autoCorrectEnabled = false, imeAction = ImeAction.Done),
keyboardActions =
KeyboardActions(
onDone = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object ReaderHTML {
feedHomePageLink: String,
publishedAt: String
): String {
val readabilityJS = readFile("readability.js")
val mercuryJS = readFile("mercury.web.js")
val readerJS = readFile("main.js")
val readerStyles = readFile("styles.css")

Expand All @@ -50,7 +50,7 @@ object ReaderHTML {
<link rel="preload" as='style' href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap">
<style>$readerStyles</style>
<script>$readabilityJS</script>
<script>$mercuryJS</script>
<script>$readerJS</script>
<title>$title</title>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package dev.sasikanth.rss.reader.settings

import dev.sasikanth.rss.reader.data.repository.AppThemeMode
import dev.sasikanth.rss.reader.data.repository.BrowserType
import dev.sasikanth.rss.reader.data.repository.Period

Expand All @@ -39,4 +40,6 @@ sealed interface SettingsEvent {
data object CancelOpmlImportOrExport : SettingsEvent

data class PostsDeletionPeriodChanged(val newPeriod: Period) : SettingsEvent

data class OnAppThemeModeChanged(val appThemeMode: AppThemeMode) : SettingsEvent
}
Loading

0 comments on commit f188b1b

Please sign in to comment.