Skip to content

Commit

Permalink
Merge pull request #1 from msasikanth/main
Browse files Browse the repository at this point in the history
Merge upstream changes.
  • Loading branch information
KotlinGeekDev authored Feb 21, 2025
2 parents 4d974ec + bc41d9f commit acfc569
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_prod_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: Configure Tramline
id: tramline
uses: tramlinehq/[email protected].6
uses: tramlinehq/[email protected].7
with:
input: ${{ github.event.inputs.tramline-input }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_prod_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- name: Configure Tramline
id: tramline
uses: tramlinehq/[email protected].6
uses: tramlinehq/[email protected].7
with:
input: ${{ github.event.inputs.tramline-input }}

Expand Down
4 changes: 4 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
org.gradle.jvmargs=-Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx4096M"
#Kotlin
kotlin.code.style=official
kotlin.native.cacheKind=none
#MPP
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
Expand Down
63 changes: 31 additions & 32 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
[versions]
kotlin = "2.0.21"
android_gradle_plugin = "8.7.0"
compose = "1.7.0"
kotlin = "2.1.10"
android_gradle_plugin = "8.8.1"
compose = "1.8.0-alpha03"
compose_material_icons_extended = "1.7.3"

android_sdk_compile = "34"
android_sdk_target = "34"
android_sdk_compile = "35"
android_sdk_target = "35"
android_sdk_min = "26"

sqldelight = "2.0.2"
ktor = "2.3.12"
kotlinx_coroutines = "1.9.0"
kotlinx_date_time = "0.6.1"
ktor = "2.3.13"
kotlinx_coroutines = "1.10.1"
kotlinx_date_time = "0.6.2"
kotlinx_immutable_collections = "0.3.8"
kotlinx_serialization_json = "1.7.3"
kotlinx_serialization_json = "1.8.0"
decompose = "3.0.0"
essenty = "2.1.0"
androidx_activity = "1.9.2"
essenty = "2.4.0"
androidx_activity = "1.10.0"
androidx_appcompat = "1.7.0"
androidx_core = "1.13.1"
androidx_collection = "1.4.4"
androidx_core = "1.15.0"
androidx_collection = "1.4.5"
androidx_test_runner = "1.6.2"
androidx_test_rules = "1.6.1"
androidx_work = "2.9.1"
androidx_datastore = "1.1.1"
androidx_work = "2.10.0"
androidx_datastore = "1.1.2"
androidx_browser = "1.8.0"
androidx_annotation = "1.8.2"
coil = "3.0.0-alpha09"
spotless = "6.25.0"
androidx_annotation = "1.9.1"
coil = "3.1.0"
spotless = "7.0.2"
ktfmt = "0.44"
kotlininject = "0.7.2"
ksp = "2.0.21-1.0.25"
ksp = "2.1.10-1.0.30"
material_color_utilities = "1.0.0-alpha01"
ksoup = "0.1.2"
sqliteAndroid = "3.45.0"
windowSizeClass = "0.5.0"
desugarJdk = "2.1.2"
desugarJdk = "2.1.4"
lyricist = "1.7.0"
atomicfu = "0.25.0"
okio = "3.9.1"
atomicfu = "0.27.0"
okio = "3.10.2"
paging = "3.3.0-alpha02-0.5.1"
stately = "2.1.0"
xmlutil = "0.90.1"
xmlutil = "0.90.3"
ktxml = "0.3.2"
uri = "0.0.18"
webview = "1.9.40-alpha03"
webview = "1.9.40"
uuid = "0.8.4"
bugsnag-plugin = "8.1.0"
bugsnag = "6.8.0"
bugsnag-plugin = "8.2.0"
bugsnag = "6.12.0"
crashkios-bugsnag = "0.9.0"
kermit = "2.0.4"
reorderable = "2.3.3"
kermit = "2.0.5"
reorderable = "2.4.3"
korlibs = "6.0.0"
filekit = "0.8.3"
filekit = "0.8.8"

[libraries]
compose_runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose" }
Expand All @@ -60,7 +60,7 @@ compose_ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "compose" }
compose_ui_util = { module = "org.jetbrains.compose.ui:ui-util", version.ref = "compose" }
compose_material = { module = "org.jetbrains.compose.material:material", version.ref = "compose" }
compose_material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose" }
compose_material_icons_extended = { module = "org.jetbrains.compose.material:material-icons-extended", version.ref = "compose" }
compose_material_icons_extended = { module = "org.jetbrains.compose.material:material-icons-extended", version.ref = "compose_material_icons_extended" }
compose_resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "compose" }
ktor_core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor_client_okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
Expand Down Expand Up @@ -114,7 +114,6 @@ stately-iso-collections = { module = "co.touchlab:stately-iso-collections", vers
xmlutil-core = { module = "io.github.pdvrieze.xmlutil:core", version.ref = "xmlutil" }
xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", version.ref = "xmlutil" }
ktxml = { module = "org.kobjects.ktxml:core", version.ref = "ktxml" }
uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" }
webview = { module = "io.github.kevinnzou:compose-webview-multiplatform", version.ref = "webview" }
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
bugsnag = { module = "com.bugsnag:bugsnag-android", version.ref = "bugsnag" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 4 additions & 2 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@
"-framework",
"\"shared\"",
"-lsqlite3",
"-ld_classic",
);
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}";
PRODUCT_NAME = "${APP_NAME}";
Expand All @@ -392,7 +393,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "V9V8885383";
DEVELOPMENT_TEAM = V9V8885383;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = V9V8885383;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -412,6 +413,7 @@
"-framework",
"\"shared\"",
"-lsqlite3",
"-ld_classic",
);
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}";
PRODUCT_NAME = "${APP_NAME}";
Expand Down Expand Up @@ -451,7 +453,7 @@
repositoryURL = "https://github.com/bugsnag/bugsnag-cocoa";
requirement = {
kind = exactVersion;
version = 6.30.0;
version = 6.32.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
3 changes: 2 additions & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
import com.android.build.api.dsl.ManagedVirtualDevice
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

Expand All @@ -28,7 +29,7 @@ plugins {
alias(libs.plugins.kotlin.compose)
}

composeCompiler { enableStrongSkippingMode = true }
composeCompiler { featureFlags = setOf(ComposeFeatureFlag.StrongSkipping) }

@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class ApplicationComponent(@get:Provides val context: Context) :
}

return AppInfo(
versionName = packageInfo.versionName,
versionName = packageInfo.versionName ?: "0.0.1",
versionCode = versionCode,
isDebugBuild = (applicationInfo.flags and FLAG_DEBUGGABLE) != 0,
cachePath = { context.cacheDir.absolutePath }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import coil3.fetch.FetchResult
import coil3.fetch.Fetcher
import coil3.fetch.SourceFetchResult
import coil3.getExtra
import coil3.network.CacheResponse
import coil3.network.CacheStrategy
import coil3.network.ConnectivityChecker
import coil3.network.HttpException
import coil3.network.NetworkClient
import coil3.network.NetworkFetcher
Expand Down Expand Up @@ -68,25 +68,24 @@ class FavIconFetcher(
val snapshot = readFromDiskCache()
try {
// Fast path: fetch the fav icon from the disk cache without performing a network request.
var output: CacheStrategy.Output? = null
var output: CacheStrategy.ReadResult? = null
if (snapshot != null) {
var cacheResponse = snapshot.toCacheResponse()
if (cacheResponse != null) {
val input = CacheStrategy.Input(cacheResponse, newRequest(), options)
output = cacheStrategy.value.compute(input)
cacheResponse = output.cacheResponse
output = cacheStrategy.value.read(cacheResponse, newRequest(), options)
cacheResponse = output.response
}
if (cacheResponse != null) {
return SourceFetchResult(
source = snapshot.toImageSource(),
mimeType = getMimeType(url, cacheResponse.responseHeaders[CONTENT_TYPE]),
mimeType = getMimeType(url, cacheResponse.headers[CONTENT_TYPE]),
dataSource = DataSource.DISK,
)
}
}

// Slow path: fetch the fav icon by parsing response HTML
val networkRequest = output?.networkRequest ?: newRequest()
val networkRequest = output?.request ?: newRequest()
return executeNetworkRequest(networkRequest) { response ->
// Write the response to the disk cache then open a new snapshot.
val responseBody = checkNotNull(response.body) { "body == null" }
Expand Down Expand Up @@ -207,9 +206,9 @@ class FavIconFetcher(
return contentType?.substringBefore(';')
}

private fun DiskCache.Snapshot.toCacheResponse(): CacheResponse? {
private fun DiskCache.Snapshot.toCacheResponse(): NetworkResponse? {
return try {
fileSystem.read(metadata) { CacheResponse(this) }
fileSystem.read(metadata) { NetworkResponse(body = NetworkResponseBody(this)) }
} catch (_: IOException) {
// If we can't parse the metadata, ignore this entry.
null
Expand Down Expand Up @@ -283,6 +282,7 @@ class FavIconFetcher(
networkClient = networkClientLazy,
diskCache = diskCacheLazy,
cacheStrategy = cacheStrategyLazy,
connectivityChecker = ConnectivityChecker.ONLINE
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object FavIconImageLoader {
add(
FavIconFetcher.Factory(
networkClient = { HttpClient().asNetworkClient() },
cacheStrategy = { CacheStrategy() }
cacheStrategy = { CacheStrategy.DEFAULT }
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -69,7 +69,6 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.style.TextAlign
Expand Down Expand Up @@ -126,7 +125,7 @@ fun FeedInfoBottomSheet(
.only(WindowInsetsSides.Bottom)
.union(WindowInsets.ime.only(WindowInsetsSides.Bottom))
},
sheetState = SheetState(skipPartiallyExpanded = true, density = LocalDensity.current),
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
scrimColor = SYSTEM_SCRIM
) {
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState
import androidx.compose.material3.Text
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
Expand All @@ -51,7 +51,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import app.cash.paging.compose.collectAsLazyPagingItems
import dev.sasikanth.rss.reader.components.Button
Expand Down Expand Up @@ -79,7 +78,7 @@ fun GroupSelectionSheet(presenter: GroupSelectionPresenter, modifier: Modifier =
.only(WindowInsetsSides.Bottom)
.union(WindowInsets.ime.only(WindowInsetsSides.Bottom))
},
sheetState = SheetState(skipPartiallyExpanded = true, density = LocalDensity.current),
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
scrimColor = SYSTEM_SCRIM
) {
val state by presenter.state.collectAsState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:OptIn(ExperimentalMaterialApi::class)

package dev.sasikanth.rss.reader.home

import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.SheetValue
import app.cash.paging.cachedIn
import app.cash.paging.createPager
Expand Down Expand Up @@ -50,7 +48,20 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.transformLatest
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlinx.datetime.Instant
Expand Down Expand Up @@ -361,7 +372,7 @@ class HomePresenter(

_state.update { it.copy(posts = posts, loadingState = HomeLoadingState.Idle) }
}
.onEach { (_, _, _, featuredPosts) ->
.transformLatest { (_, _, _, featuredPosts) ->
val featuredPostsWithSeedColor =
featuredPosts.map { featuredPost ->
val seedColor =
Expand All @@ -373,6 +384,7 @@ class HomePresenter(
}

_state.update { it.copy(featuredPosts = featuredPostsWithSeedColor.toImmutableList()) }
emit(Unit)
}
.launchIn(coroutineScope)
}
Expand Down

0 comments on commit acfc569

Please sign in to comment.