Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/build.gradle.kts
#	build.gradle.kts
#	gradle/libs.versions.toml
#	gradle/wrapper/gradle-wrapper.properties
  • Loading branch information
saulhdev committed Nov 26, 2023
2 parents b674f4f + 0e924b7 commit 6830074
Show file tree
Hide file tree
Showing 56 changed files with 211 additions and 1,808 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ android {

packaging {
resources.pickFirsts.add("rome-utils-2.1.0.jar")
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

lint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package com.saulhdev.feeder.compose.components

import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.tween
import androidx.compose.foundation.clickable
Expand All @@ -26,10 +27,14 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Favorite
import androidx.compose.material.icons.outlined.FavoriteBorder
import androidx.compose.material.icons.outlined.Share
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
Expand All @@ -45,6 +50,15 @@ fun FavoriteButton(bookmarked: Boolean, onClick: () -> Unit) {
val interactionSource = remember { MutableInteractionSource() }
val coroutineScope = rememberCoroutineScope()
val scale = remember { Animatable(1f) }
val favoriteIcon by remember(bookmarked) {
mutableStateOf(
if (bookmarked) Icons.Outlined.Favorite else Icons.Outlined.FavoriteBorder
)
}
val favoriteColor by animateColorAsState(
targetValue = if (bookmarked) Color.Red else MaterialTheme.colorScheme.onSurface,
label = "favoriteColor",
)

IconButton(
modifier = Modifier
Expand All @@ -65,9 +79,9 @@ fun FavoriteButton(bookmarked: Boolean, onClick: () -> Unit) {
}
) {
Icon(
imageVector = Icons.Outlined.Favorite,
imageVector = favoriteIcon,
contentDescription = " ",
tint = if (bookmarked) Color.Red else Color.LightGray,
tint = favoriteColor,
modifier = Modifier
.scale(scale = scale.value)
.size(size = 28.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand Down Expand Up @@ -52,13 +51,16 @@ fun ArticleItem(
Card(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(16.dp))
.clip(MaterialTheme.shapes.large)
.background(MaterialTheme.colorScheme.surface)
.clickable {
onClick()
}
) {
Column {
Column(
modifier = Modifier
.padding(8.dp),
) {
if (content.background_url.isNotEmpty()
&& !content.background_url.contains(".rss")
) {
Expand All @@ -71,7 +73,7 @@ fun ArticleItem(
modifier = Modifier
.fillMaxWidth()
.height(240.dp)
.clip(RoundedCornerShape(16.dp)),
.clip(MaterialTheme.shapes.medium),
contentScale = ContentScale.Crop,
contentDescription = ""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Divider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
Expand All @@ -40,7 +39,6 @@ fun ComposeSwitchView(
onCheckedChange: ((Boolean) -> Unit),
isChecked: Boolean = false,
isEnabled: Boolean = true,
showDivider: Boolean = false,
applyPaddings: Boolean = false,
horizontalPadding: Dp = 16.dp,
verticalPadding: Dp = 16.dp,
Expand Down Expand Up @@ -68,9 +66,6 @@ fun ComposeSwitchView(
onCheckedChange(!checked)
}
) {
if (showDivider) {
Divider(modifier = Modifier.padding(horizontal = 16.dp))
}
Row(
modifier = modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ import androidx.compose.material.icons.filled.Refresh
import androidx.compose.material.pullrefresh.PullRefreshIndicator
import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullrefresh.rememberPullRefreshState
import androidx.compose.material3.Divider
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand All @@ -60,7 +60,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
Expand All @@ -73,10 +72,12 @@ import com.saulhdev.feeder.compose.navigation.LocalNavController
import com.saulhdev.feeder.compose.navigation.Routes
import com.saulhdev.feeder.db.ArticleRepository
import com.saulhdev.feeder.icon.Phosphor
import com.saulhdev.feeder.icon.phosphor.CaretUp
import com.saulhdev.feeder.icon.phosphor.CloudArrowDown
import com.saulhdev.feeder.icon.phosphor.CloudArrowUp
import com.saulhdev.feeder.icon.phosphor.GearSix
import com.saulhdev.feeder.icon.phosphor.Nut
import com.saulhdev.feeder.icon.phosphor.Power
import com.saulhdev.feeder.models.exportOpml
import com.saulhdev.feeder.models.importOpml
import com.saulhdev.feeder.plugin.PluginConnector
Expand Down Expand Up @@ -239,7 +240,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) {
)
}
)
Divider()
HorizontalDivider()
DropdownMenuItem(
text = {
Text(text = stringResource(id = R.string.sources_import_opml))
Expand Down Expand Up @@ -277,7 +278,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) {
)
}
)
Divider()
HorizontalDivider()

DropdownMenuItem(
text = {
Expand Down Expand Up @@ -305,7 +306,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) {
},
leadingIcon = {
Icon(
painter = painterResource(id = R.drawable.ic_restart),
imageVector = Phosphor.Power,
contentDescription = null,
)
}
Expand Down Expand Up @@ -369,7 +370,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) {
shape = CircleShape
) {
Icon(
painter = painterResource(id = R.drawable.ic_arrow_upward),
imageVector = Phosphor.CaretUp,
contentDescription = null,
tint = MaterialTheme.colorScheme.onPrimary
)
Expand Down
49 changes: 0 additions & 49 deletions app/src/main/java/com/saulhdev/feeder/feed/FeedAdapter.kt

This file was deleted.

This file was deleted.

125 changes: 0 additions & 125 deletions app/src/main/java/com/saulhdev/feeder/feed/binders/StoryCardBinder.kt

This file was deleted.

Loading

0 comments on commit 6830074

Please sign in to comment.