Skip to content

Commit

Permalink
[1.223.*] Pre-release merge (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
tramline-github[bot] authored Aug 8, 2024
2 parents 08fe1c4 + b4f7874 commit 3bdfea2
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 86 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ user interface and experience to browse through the feeds, and supports Material
## Features ✨

- Supports RSS & Atom feeds
- Gorgeous home feed
- Pin frequently visited feeds
- Feed management: Add, Edit & Pin feeds
- Feed grouping
- Access to pinned feeds/groups from bottom bar
- Smart fetching: Twine looks for feeds when given any website homepage
- Reading view with shortcut to fetch full article
- Article shortcut to fetch full article in reader view
- Bookmark posts to read later
- Search posts
- Background sync
- Feed management: Add, Edit & Pin feeds
- Import and exports your feeds with OPML
- Import and exports your feeds with OPML
- Dynamic content theming
- Light/Dark mode support

## Tech Stack 📚

Expand Down
33 changes: 29 additions & 4 deletions shared/src/commonMain/composeResources/files/reader/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,25 @@ function updateStyles(colors) {
font-family: 'Golos Text', sans-serif;
overflow-wrap: break-word;
}
body:dir(rtl) {
padding-inline-start: 16px;
}
body:dir(ltr) {
padding-inline-end: 16px;
}
a {
color: ${colors.linkColor};
}
ul li::before {
content: "\u2022";
color: ${colors.textColor};
margin-right: 0.25em;
margin-inline-end: 0.25em;
}
ol li::before {
counter-increment: item;
content: counters(item, ".") ".";
color: ${colors.textColor};
margin-right: 0.25em;
margin-inline-end: 0.25em;
}
code, pre {
font-family: 'Source Code Pro', monospace;
Expand All @@ -93,7 +99,7 @@ function updateStyles(colors) {
border: 1px solid ${colors.dividerColor};
}
blockquote {
margin-left: 8px;
margin-inline-start: 8px;
padding-left: 8px;
border-left: 4px solid ${colors.linkColor}
}
Expand All @@ -105,16 +111,35 @@ function updateStyles(colors) {
}

async function renderReaderView(link, html, colors) {
console.log('Parsing content');
console.log('Preparing reader content for rendering');
//noinspection JSUnresolvedVariable
window.kmpJsBridge.callNative(
"renderProgress",
"Loading",
{}
);

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

document.getElementById("content").innerHTML += content;
document.querySelectorAll("pre").forEach((element) =>
element.dir = "auto"
);

updateStyles(colors)
processLinks();
processIFrames();
removeTitle();

document.body.style.display = "block";

console.log('Reader content rendered')
//noinspection JSUnresolvedVariable
window.kmpJsBridge.callNative(
"renderProgress",
"Idle",
{}
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ figcaption {
align-items: center;
}
.column {
margin-left: 16px;
margin-inline-start: 16px;
flex: 1;
}
.caption {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package dev.sasikanth.rss.reader.components

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import dev.sasikanth.rss.reader.ui.AppTheme
Expand All @@ -26,7 +25,7 @@ import dev.sasikanth.rss.reader.ui.AppTheme
fun Switch(checked: Boolean, modifier: Modifier = Modifier, onCheckedChange: (Boolean) -> Unit) {
MaterialTheme(
colorScheme =
darkColorScheme(
MaterialTheme.colorScheme.copy(
primary = AppTheme.colorScheme.tintedForeground,
onPrimary = AppTheme.colorScheme.tintedSurface,
outline = AppTheme.colorScheme.outline,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -314,7 +313,9 @@ private fun SearchBar(
}

Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
MaterialTheme(colorScheme = darkColorScheme(primary = AppTheme.colorScheme.tintedForeground)) {
MaterialTheme(
colorScheme = MaterialTheme.colorScheme.copy(primary = AppTheme.colorScheme.tintedForeground)
) {
OutlinedTextField(
modifier =
Modifier.weight(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -195,7 +194,9 @@ fun GroupNameTextField(
onValueChanged(input)
}

MaterialTheme(colorScheme = darkColorScheme(primary = AppTheme.colorScheme.tintedForeground)) {
MaterialTheme(
colorScheme = MaterialTheme.colorScheme.copy(primary = AppTheme.colorScheme.tintedForeground)
) {
OutlinedTextField(
modifier = modifier,
value = input.copy(selection = TextRange(input.text.length)),
Expand Down
Loading

0 comments on commit 3bdfea2

Please sign in to comment.