diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 075c4979..fc1184db 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -116,9 +116,6 @@ android { packaging { resources.pickFirsts.add("rome-utils-2.1.0.jar") - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } } lint { diff --git a/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleButton.kt b/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleButton.kt index 16af3895..a0d6707e 100644 --- a/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleButton.kt +++ b/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleButton.kt @@ -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 @@ -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 @@ -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 @@ -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) diff --git a/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleItem.kt b/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleItem.kt index c80d064f..cebd3fb3 100644 --- a/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleItem.kt +++ b/app/src/main/java/com/saulhdev/feeder/compose/components/ArticleItem.kt @@ -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 @@ -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") ) { @@ -71,7 +73,7 @@ fun ArticleItem( modifier = Modifier .fillMaxWidth() .height(240.dp) - .clip(RoundedCornerShape(16.dp)), + .clip(MaterialTheme.shapes.medium), contentScale = ContentScale.Crop, contentDescription = "" ) diff --git a/app/src/main/java/com/saulhdev/feeder/compose/components/ComposeSwitchView.kt b/app/src/main/java/com/saulhdev/feeder/compose/components/ComposeSwitchView.kt index 0defb03d..c1ab6873 100644 --- a/app/src/main/java/com/saulhdev/feeder/compose/components/ComposeSwitchView.kt +++ b/app/src/main/java/com/saulhdev/feeder/compose/components/ComposeSwitchView.kt @@ -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 @@ -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, @@ -68,9 +66,6 @@ fun ComposeSwitchView( onCheckedChange(!checked) } ) { - if (showDivider) { - Divider(modifier = Modifier.padding(horizontal = 16.dp)) - } Row( modifier = modifier .fillMaxWidth() diff --git a/app/src/main/java/com/saulhdev/feeder/compose/pages/OverlayPage.kt b/app/src/main/java/com/saulhdev/feeder/compose/pages/OverlayPage.kt index 964af0f6..794b0047 100644 --- a/app/src/main/java/com/saulhdev/feeder/compose/pages/OverlayPage.kt +++ b/app/src/main/java/com/saulhdev/feeder/compose/pages/OverlayPage.kt @@ -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 @@ -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 @@ -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 @@ -239,7 +240,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) { ) } ) - Divider() + HorizontalDivider() DropdownMenuItem( text = { Text(text = stringResource(id = R.string.sources_import_opml)) @@ -277,7 +278,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) { ) } ) - Divider() + HorizontalDivider() DropdownMenuItem( text = { @@ -305,7 +306,7 @@ fun OverlayPage(navController: NavController = LocalNavController.current) { }, leadingIcon = { Icon( - painter = painterResource(id = R.drawable.ic_restart), + imageVector = Phosphor.Power, contentDescription = null, ) } @@ -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 ) diff --git a/app/src/main/java/com/saulhdev/feeder/feed/FeedAdapter.kt b/app/src/main/java/com/saulhdev/feeder/feed/FeedAdapter.kt deleted file mode 100644 index b9891057..00000000 --- a/app/src/main/java/com/saulhdev/feeder/feed/FeedAdapter.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.saulhdev.feeder.feed - -import android.util.SparseIntArray -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.recyclerview.widget.RecyclerView -import com.saulhdev.feeder.R -import com.saulhdev.feeder.feed.binders.StoryCardBinder -import com.saulhdev.feeder.sdk.FeedItem - -class FeedAdapter : RecyclerView.Adapter() { - private var list = listOf() - private lateinit var layoutInflater: LayoutInflater - private var theme: SparseIntArray? = null - - fun replace(new: List) { - list = new - notifyDataSetChanged() - } - - fun setTheme(theme: SparseIntArray) { - this.theme = theme - notifyDataSetChanged() - } - - override fun getItemCount(): Int { - return list.size - } - - override fun getItemViewType(position: Int): Int { - return (list[position].type.ordinal) - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): FeedViewHolder { - if (!::layoutInflater.isInitialized) layoutInflater = LayoutInflater.from(parent.context) - - val layoutResource = R.layout.feed_card_story_large - - return FeedViewHolder(viewType, layoutInflater.inflate(layoutResource, parent, false)) - } - - override fun onBindViewHolder(holder: FeedViewHolder, position: Int) { - val item = list[position] - StoryCardBinder.bind(theme, item, holder.itemView) - } - - inner class FeedViewHolder(val type: Int, itemView: View) : RecyclerView.ViewHolder(itemView) -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/feed/binders/FeedBinder.kt b/app/src/main/java/com/saulhdev/feeder/feed/binders/FeedBinder.kt deleted file mode 100644 index 6adb5ff2..00000000 --- a/app/src/main/java/com/saulhdev/feeder/feed/binders/FeedBinder.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.saulhdev.feeder.feed.binders - -import android.util.SparseIntArray -import android.view.View -import com.saulhdev.feeder.sdk.FeedItem - -interface FeedBinder { - fun bind(theme: SparseIntArray?, item: FeedItem, view: View) -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/feed/binders/StoryCardBinder.kt b/app/src/main/java/com/saulhdev/feeder/feed/binders/StoryCardBinder.kt deleted file mode 100644 index 1d0212d8..00000000 --- a/app/src/main/java/com/saulhdev/feeder/feed/binders/StoryCardBinder.kt +++ /dev/null @@ -1,125 +0,0 @@ -package com.saulhdev.feeder.feed.binders - -import android.content.Intent -import android.text.Html -import android.util.SparseIntArray -import android.view.View -import coil.load -import com.saulhdev.feeder.MainActivity -import com.saulhdev.feeder.R -import com.saulhdev.feeder.databinding.FeedCardStoryLargeBinding -import com.saulhdev.feeder.db.ArticleRepository -import com.saulhdev.feeder.db.ID_UNSET -import com.saulhdev.feeder.preference.FeedPreferences -import com.saulhdev.feeder.sdk.FeedItem -import com.saulhdev.feeder.theme.Theming -import com.saulhdev.feeder.utils.RelativeTimeHelper -import com.saulhdev.feeder.utils.isDark -import com.saulhdev.feeder.utils.launchView -import com.saulhdev.feeder.utils.openLinkInCustomTab -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch - -object StoryCardBinder : FeedBinder { - override fun bind(theme: SparseIntArray?, item: FeedItem, view: View) { - val context = view.context - val content = item.content - val binding = FeedCardStoryLargeBinding.bind(view) - val prefs = FeedPreferences.getInstance(context) - val repository = ArticleRepository(context) - var bookmarked = item.bookmarked - binding.storyTitle.text = content.title - binding.storySource.text = content.source.title - binding.storyDate.text = - RelativeTimeHelper.getDateFormattedRelative(view.context, (item.time / 1000) - 1000) - - if (content.text.isEmpty()) { - binding.storySummary.visibility = View.GONE - } else { - binding.storySummary.text = Html.fromHtml(content.text, 0).toString() - } - - if ( - content.background_url.isEmpty() || - content.background_url == "null" || - content.background_url.contains(".rss") - ) { - binding.storyPic.visibility = View.GONE - } else { - binding.storyPic.visibility = View.VISIBLE - binding.storyPic.load(content.background_url) { - crossfade(true) - crossfade(500) - } - } - - if (bookmarked) { - binding.saveButton.setImageResource(R.drawable.ic_heart_fill) - } else { - binding.saveButton.setImageResource(R.drawable.ic_heart) - } - - binding.saveButton.setOnClickListener { - CoroutineScope(Dispatchers.Main).launch { - repository.bookmarkArticle(item.id, !bookmarked) - bookmarked = !bookmarked - if (bookmarked) { - binding.saveButton.setImageResource(R.drawable.ic_heart_fill) - } else { - binding.saveButton.setImageResource(R.drawable.ic_heart) - } - } - } - - binding.shareButton.setOnClickListener { - CoroutineScope(Dispatchers.Main).launch { - if (item.id > ID_UNSET) { - val intent = Intent.createChooser( - Intent(Intent.ACTION_SEND).apply { - putExtra(Intent.EXTRA_TEXT, item.content.link) - putExtra(Intent.EXTRA_TITLE, item.title) - type = "text/plain" - }, - null - ) - context.startActivity(intent) - } - } - } - - binding.root.setOnClickListener { - if (prefs.openInBrowser.getValue()) { - view.context.launchView(content.link) - } else { - val scope = CoroutineScope(Dispatchers.Main) - - scope.launch { - if (prefs.offlineReader.getValue()) { - view.context.startActivity( - MainActivity.createIntent( - view.context, - "article_page/${item.id}/" - ) - ) - } else { - openLinkInCustomTab( - context, - item.content.link - ) - } - } - } - } - - theme ?: return - binding.cardStory.setBackgroundColor(theme.get(Theming.Colors.CARD_BG.ordinal)) - val themeCard = if (theme.get(Theming.Colors.CARD_BG.ordinal) - .isDark() - ) Theming.defaultDarkThemeColors else Theming.defaultLightThemeColors - binding.storyTitle.setTextColor(themeCard.get(Theming.Colors.TEXT_COLOR_PRIMARY.ordinal)) - binding.storySource.setTextColor(themeCard.get(Theming.Colors.TEXT_COLOR_SECONDARY.ordinal)) - binding.storyDate.setTextColor(themeCard.get(Theming.Colors.TEXT_COLOR_SECONDARY.ordinal)) - binding.storySummary.setTextColor(themeCard.get(Theming.Colors.TEXT_COLOR_SECONDARY.ordinal)) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/icon/phosphor/CaretUp.kt b/app/src/main/java/com/saulhdev/feeder/icon/phosphor/CaretUp.kt new file mode 100644 index 00000000..b1b7636b --- /dev/null +++ b/app/src/main/java/com/saulhdev/feeder/icon/phosphor/CaretUp.kt @@ -0,0 +1,48 @@ +package com.saulhdev.feeder.icon.phosphor + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType.Companion.NonZero +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.ImageVector.Builder +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import com.saulhdev.feeder.icon.Phosphor + +val Phosphor.CaretUp: ImageVector + get() { + if (_caret_up != null) { + return _caret_up!! + } + _caret_up = Builder( + name = "Caret-up", + defaultWidth = 24.dp, + defaultHeight = 24.dp, + viewportWidth = 256.0f, + viewportHeight = 256.0f, + ).apply { + path( + fill = SolidColor(Color(0xFF000000)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(208.0f, 168.0f) + arcToRelative(8.5f, 8.5f, 0.0f, false, true, -5.7f, -2.3f) + lineTo(128.0f, 91.3f) + lineTo(53.7f, 165.7f) + arcToRelative(8.1f, 8.1f, 0.0f, false, true, -11.4f, -11.4f) + lineToRelative(80.0f, -80.0f) + arcToRelative(8.1f, 8.1f, 0.0f, false, true, 11.4f, 0.0f) + lineToRelative(80.0f, 80.0f) + arcToRelative(8.1f, 8.1f, 0.0f, false, true, 0.0f, 11.4f) + arcTo(8.5f, 8.5f, 0.0f, false, true, 208.0f, 168.0f) + close() + } + } + .build() + return _caret_up!! + } + +private var _caret_up: ImageVector? = null diff --git a/app/src/main/java/com/saulhdev/feeder/icon/phosphor/Power.kt b/app/src/main/java/com/saulhdev/feeder/icon/phosphor/Power.kt new file mode 100644 index 00000000..6b31de60 --- /dev/null +++ b/app/src/main/java/com/saulhdev/feeder/icon/phosphor/Power.kt @@ -0,0 +1,51 @@ +package com.saulhdev.feeder.icon.phosphor + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType.Companion.NonZero +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.ImageVector.Builder +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import com.saulhdev.feeder.icon.Phosphor + +val Phosphor.Power: ImageVector + get() { + if (_power != null) { + return _power!! + } + _power = Builder( + name = "Power", + defaultWidth = 24.dp, + defaultHeight = 24.dp, + viewportWidth = 256.0f, + viewportHeight = 256.0f, + ).apply { + path( + fill = SolidColor(Color(0xFF000000)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(120.0f, 124.0f) + lineTo(120.0f, 48.0f) + arcToRelative(8.0f, 8.0f, 0.0f, false, true, 16.0f, 0.0f) + verticalLineToRelative(76.0f) + arcToRelative(8.0f, 8.0f, 0.0f, false, true, -16.0f, 0.0f) + close() + moveTo(180.4f, 47.5f) + arcToRelative(8.1f, 8.1f, 0.0f, false, false, -11.1f, 2.4f) + arcToRelative(7.9f, 7.9f, 0.0f, false, false, 2.3f, 11.0f) + arcToRelative(80.0f, 80.0f, 0.0f, true, true, -87.2f, 0.0f) + arcToRelative(7.9f, 7.9f, 0.0f, false, false, 2.3f, -11.0f) + arcToRelative(8.1f, 8.1f, 0.0f, false, false, -11.1f, -2.4f) + arcToRelative(96.0f, 96.0f, 0.0f, true, false, 104.8f, 0.0f) + close() + } + } + .build() + return _power!! + } + +private var _power: ImageVector? = null diff --git a/app/src/main/java/com/saulhdev/feeder/overlay/OverlayView.kt b/app/src/main/java/com/saulhdev/feeder/overlay/OverlayView.kt deleted file mode 100644 index e4cc6805..00000000 --- a/app/src/main/java/com/saulhdev/feeder/overlay/OverlayView.kt +++ /dev/null @@ -1,279 +0,0 @@ -package com.saulhdev.feeder.overlay - -import android.content.Context -import android.content.Intent -import android.content.res.ColorStateList -import android.graphics.drawable.ColorDrawable -import android.os.Bundle -import android.util.Log -import android.view.View -import android.widget.ImageView -import android.widget.TextView -import androidx.appcompat.view.ContextThemeWrapper -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout -import com.google.android.libraries.gsa.d.a.OverlayController -import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.saulhdev.feeder.MainActivity -import com.saulhdev.feeder.NFApplication -import com.saulhdev.feeder.R -import com.saulhdev.feeder.db.ArticleRepository -import com.saulhdev.feeder.feed.FeedAdapter -import com.saulhdev.feeder.launcherapi.LauncherAPI -import com.saulhdev.feeder.launcherapi.OverlayThemeHolder -import com.saulhdev.feeder.plugin.PluginConnector -import com.saulhdev.feeder.preference.FeedPreferences -import com.saulhdev.feeder.sdk.FeedItem -import com.saulhdev.feeder.sync.SyncRestClient -import com.saulhdev.feeder.theme.Theming -import com.saulhdev.feeder.utils.LinearLayoutManagerWrapper -import com.saulhdev.feeder.utils.OverlayBridge -import com.saulhdev.feeder.utils.clearLightFlags -import com.saulhdev.feeder.utils.isDark -import com.saulhdev.feeder.utils.setLightFlags -import com.saulhdev.feeder.vkpopup.DialogActionsVcByPopup -import com.saulhdev.feeder.vkpopup.PopupItem -import kotlinx.coroutines.CoroutineName -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import kotlinx.coroutines.plus - -class OverlayView(val context: Context) : - OverlayController(context, R.style.AppTheme, R.style.WindowTheme), - OverlayBridge.OverlayBridgeCallback { - private var apiInstance = LauncherAPI() - private lateinit var themeHolder: OverlayThemeHolder - - private lateinit var rootView: View - private lateinit var adapter: FeedAdapter - - private val list = mutableListOf() - val prefs = FeedPreferences.getInstance(context) - - private fun setTheme(force: String?) { - themeHolder.setTheme( - when (force ?: prefs.overlayTheme.getValue()) { - "auto_system" -> Theming.getThemeBySystem(context) - "dark" -> Theming.defaultDarkThemeColors - else -> Theming.defaultLightThemeColors - } - ) - } - - override fun onOptionsUpdated(bundle: Bundle) { - super.onOptionsUpdated(bundle) - apiInstance = LauncherAPI(bundle) - updateTheme() - } - - private fun updateTheme(force: String? = null) { - setTheme(force) - updateStubUi() - adapter.setTheme(themeHolder.currentTheme) - } - - private fun updateStubUi() { - val theme = if (themeHolder.currentTheme.get(Theming.Colors.OVERLAY_BG.ordinal) - .isDark() - ) Theming.defaultDarkThemeColors else Theming.defaultLightThemeColors - rootView.findViewById(R.id.header_preferences).imageTintList = - ColorStateList.valueOf( - theme.get( - Theming.Colors.TEXT_COLOR_PRIMARY.ordinal - ) - ) - rootView.findViewById(R.id.header_title) - .setTextColor(theme.get(Theming.Colors.TEXT_COLOR_PRIMARY.ordinal)) - } - - private fun initRecyclerView() { - val recyclerView = rootView.findViewById(R.id.recycler) - val buttonReturnToTop = - rootView.findViewById(R.id.button_return_to_top).apply { - visibility = View.GONE - setOnClickListener { - visibility = View.GONE - recyclerView.smoothScrollToPosition(0) - - } - } - - rootView.findViewById(R.id.swipe_to_refresh).setOnRefreshListener { - rootView.findViewById(R.id.recycler).recycledViewPool.clear() - refreshNotifications() - } - - adapter = FeedAdapter() - recyclerView.apply { - layoutManager = LinearLayoutManagerWrapper(context, LinearLayoutManager.VERTICAL, false) - adapter = this@OverlayView.adapter - } - - recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { - override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { - super.onScrolled(recyclerView, dx, dy) - if ((recyclerView.layoutManager as LinearLayoutManager) - .findFirstCompletelyVisibleItemPosition() < 5 - ) { - buttonReturnToTop.visibility = View.GONE - } else if ((recyclerView.layoutManager as LinearLayoutManager) - .findFirstCompletelyVisibleItemPosition() > 5 - ) { - buttonReturnToTop.visibility = View.VISIBLE - } - } - }) - } - - private fun initHeader() { - rootView.findViewById(R.id.header_preferences).setOnClickListener { - callMenuPopup(it) - } - } - - private fun callMenuPopup(view: View) { - val popup = DialogActionsVcByPopup(view) - popup.a(createMenuList(), { - it.first.backgroundTintList = ColorStateList.valueOf( - themeHolder.currentTheme.get( - Theming.Colors.OVERLAY_BG.ordinal - ) - ) - it.second.apply { - setActionLabelTextColor(themeHolder.currentTheme.get(Theming.Colors.TEXT_COLOR_PRIMARY.ordinal)) - setDividerColor(themeHolder.currentTheme.get(Theming.Colors.TEXT_COLOR_SECONDARY.ordinal)) - setActionIconTint(themeHolder.currentTheme.get(Theming.Colors.TEXT_COLOR_PRIMARY.ordinal)) - } - }) { - popup.dismiss() - when (it.id) { - "config" -> { - NFApplication.instance.startActivity( - Intent(NFApplication.instance, MainActivity::class.java).addFlags( - Intent.FLAG_ACTIVITY_NEW_TASK - ) - ) - } - - "reload" -> { - refreshNotifications() - } - - "restart" -> { - NFApplication.instance.restart(false) - } - } - } - } - - private fun createMenuList(): List { - return listOf( - PopupItem(R.drawable.ic_settings_outline_28, R.string.title_settings, 0, "config"), - PopupItem(R.drawable.ic_replay_24, R.string.action_reload, 0, "reload"), - PopupItem(R.drawable.ic_restart, R.string.action_restart, 1, "restart") - ) - } - - override fun onCreate(bundle: Bundle?) { - super.onCreate(bundle) - getWindow().decorView.systemUiVisibility = - View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - rootView = View.inflate( - ContextThemeWrapper(this, R.style.AppTheme), - R.layout.overlay_layout, - this.container - ) - - //themeHolder = OverlayThemeHolder(context, this) - - initRecyclerView() - initHeader() - refreshNotifications() - NFApplication.bridge.setCallback(this) - } - - private fun loadArticles() { - val repository = ArticleRepository(context) - val articles = SyncRestClient(context) - val scope = CoroutineScope(Dispatchers.IO) + CoroutineName("NeoFeedSync") - scope.launch { - val feeds = repository.getAllFeeds() - for (feed in feeds) { - articles.getArticleList(feed) - } - } - } - - private fun refreshNotifications() { - list.clear() - rootView.findViewById(R.id.recycler).recycledViewPool.clear() - adapter.notifyDataSetChanged() - loadArticles() - - PluginConnector.getFeedAsItLoads(0, { feed -> - list.addAll(feed) - }) { - list.sortByDescending { it.time } - adapter.replace(list) - rootView.findViewById(R.id.swipe_to_refresh).isRefreshing = false - } - } - - override fun onDestroy() { - super.onDestroy() - NFApplication.bridge.setCallback(null) - } - - override fun onScroll(f: Float) { - super.onScroll(f) - if (prefs.overlayTransparency.getValue() > 0.7f) { - if (themeHolder.shouldUseSN && !themeHolder.isSNApplied) { - themeHolder.isSNApplied = true - window.decorView.setLightFlags() - } - } else { - if (themeHolder.shouldUseSN && themeHolder.isSNApplied) { - themeHolder.isSNApplied = false - window.decorView.clearLightFlags() - } - } - - val bgColor = themeHolder.currentTheme.get(Theming.Colors.OVERLAY_BG.ordinal) - val color = - (prefs.overlayTransparency.getValue() * 255.0f).toInt() shl 24 or (bgColor and 0x00ffffff) - getWindow().setBackgroundDrawable(ColorDrawable(color)) - } - - override fun onClientMessage(action: String) { - if (prefs.debugging.getValue()) { - Log.d("OverlayView", "New message by OverlayBridge: $action") - } - } - - override fun applyNewTheme(value: String) { - updateTheme(value) - } - - override fun applyNewTransparency(value: Float) { - themeHolder.prefs.overlayTransparency.setValue(value) - } - - override fun applyNewCardBg(value: String) { - themeHolder.cardBgPref = value - updateTheme() - } - - override fun applyCompactCard(value: Boolean) { - adapter = FeedAdapter() - adapter.setTheme(themeHolder.currentTheme) - rootView.findViewById(R.id.recycler).adapter = adapter - refreshNotifications() - } - - override fun applySysColors(value: Boolean) { - themeHolder.systemColors = value - updateTheme() - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/utils/LinearLayoutManagerWrapper.kt b/app/src/main/java/com/saulhdev/feeder/utils/LinearLayoutManagerWrapper.kt deleted file mode 100644 index a7bdb511..00000000 --- a/app/src/main/java/com/saulhdev/feeder/utils/LinearLayoutManagerWrapper.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.saulhdev.feeder.utils - -import android.content.Context -import android.util.AttributeSet -import androidx.recyclerview.widget.LinearLayoutManager - -class LinearLayoutManagerWrapper : LinearLayoutManager { - constructor(context: Context?) : super(context) {} - constructor(context: Context?, orientation: Int, reverseLayout: Boolean) : super( - context, - orientation, - reverseLayout - ) { - } - - constructor( - context: Context?, - attrs: AttributeSet?, - defStyleAttr: Int, - defStyleRes: Int - ) : super(context, attrs, defStyleAttr, defStyleRes) { - } - - override fun supportsPredictiveItemAnimations(): Boolean { - return false - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/utils/RelativeTimeHelper.kt b/app/src/main/java/com/saulhdev/feeder/utils/RelativeTimeHelper.kt index 98b1aa2c..a55066e9 100644 --- a/app/src/main/java/com/saulhdev/feeder/utils/RelativeTimeHelper.kt +++ b/app/src/main/java/com/saulhdev/feeder/utils/RelativeTimeHelper.kt @@ -17,11 +17,11 @@ object RelativeTimeHelper { val resources = context.resources val j = i * 1000 val calendar = calendar - val i2 = calendar.get(Calendar.YEAR) - calendar.set(Calendar.MINUTE, 0) - calendar.set(Calendar.HOUR_OF_DAY, 0) - calendar.set(Calendar.SECOND, 0) - calendar.set(Calendar.MILLISECOND, 0) + val i2 = calendar[Calendar.YEAR] + calendar[Calendar.MINUTE] = 0 + calendar[Calendar.HOUR_OF_DAY] = 0 + calendar[Calendar.SECOND] = 0 + calendar[Calendar.MILLISECOND] = 0 val timeInMillis = calendar.timeInMillis var j2 = 86400000.toLong() var j3 = timeInMillis + j2 @@ -37,66 +37,72 @@ object RelativeTimeHelper { str = "%s %s %d:%02d" val tomorrow = resources.getString(R.string.tomorrow) val at = - resources.getString(if (calendar.get(Calendar.HOUR_OF_DAY) == 1) R.string.date_at_1am else R.string.date_at) - val hourOfDay = calendar.get(Calendar.HOUR_OF_DAY) - val minute = calendar.get(Calendar.MINUTE) + resources.getString(if (calendar[Calendar.HOUR_OF_DAY] == 1) R.string.date_at_1am else R.string.date_at) + val hourOfDay = calendar[Calendar.HOUR_OF_DAY] + val minute = calendar[Calendar.MINUTE] format = String.format(locale, str, tomorrow, at, hourOfDay, minute) return format } j3-- - if (j in timeInMillis..j3) { - locale = Locale.ENGLISH - str = "%s %s %d:%02d" - val today = resources.getString(R.string.today) - val at = - resources.getString(if (calendar.get(Calendar.HOUR_OF_DAY) == 1) R.string.date_at_1am else R.string.date_at) - val hourOfDay = calendar.get(Calendar.HOUR_OF_DAY) - val minute = calendar.get(Calendar.MINUTE) - format = String.format(locale, str, today, at, hourOfDay, minute) - return format - } else if (j < j2 || j >= timeInMillis) { - val string: String = if (calendar.get(Calendar.YEAR) != i2) { - resources.getString( - R.string.date_format_day_month_year, - calendar.get(Calendar.DAY_OF_MONTH), - resources.getStringArray(R.array.date_shortmonths)[min( - calendar.get(2), - Calendar.HOUR_OF_DAY - )], - calendar.get(Calendar.YEAR) - ) - } else { - resources.getString( - R.string.date_format_day_month, - calendar.get(Calendar.DAY_OF_MONTH), - resources.getStringArray(R.array.date_shortmonths)[min( - calendar.get(2), - Calendar.HOUR_OF_DAY - )] - ) + return when { + j in timeInMillis..j3 -> { + locale = Locale.ENGLISH + str = "%s %s %d:%02d" + val today = resources.getString(R.string.today) + val at = + resources.getString(if (calendar[Calendar.HOUR_OF_DAY] == 1) R.string.date_at_1am else R.string.date_at) + val hourOfDay = calendar[Calendar.HOUR_OF_DAY] + val minute = calendar[Calendar.MINUTE] + format = String.format(locale, str, today, at, hourOfDay, minute) + format + } + + j < j2 || j >= timeInMillis -> { + val string: String = if (calendar[Calendar.YEAR] != i2) { + resources.getString( + R.string.date_format_day_month_year, + calendar[Calendar.DAY_OF_MONTH], + resources.getStringArray(R.array.date_shortmonths)[min( + calendar[2], + Calendar.HOUR_OF_DAY + )], + calendar[Calendar.YEAR] + ) + } else { + resources.getString( + R.string.date_format_day_month, + calendar[Calendar.DAY_OF_MONTH], + resources.getStringArray(R.array.date_shortmonths)[min( + calendar[2], + Calendar.HOUR_OF_DAY + )] + ) + } + val stringBuilder = StringBuilder() + stringBuilder.append(string) + locale = Locale.ENGLISH + val str2 = " %s %d:%02d" + val at = + resources.getString(if (calendar[Calendar.HOUR_OF_DAY] == 1) R.string.date_at_1am else R.string.date_at) + val hourOfDay = calendar[Calendar.HOUR_OF_DAY] + val minute = calendar[Calendar.MINUTE] + format = String.format(locale, str2, at, hourOfDay, minute) + stringBuilder.append(format) + format = stringBuilder.toString() + format + } + + else -> { + locale = Locale.ENGLISH + str = "%s %s %d:%02d" + val yesterday = resources.getString(R.string.yesterday) + val at = + resources.getString(if (calendar[Calendar.HOUR_OF_DAY] == 1) R.string.date_at_1am else R.string.date_at) + val hourOfDay = calendar[Calendar.HOUR_OF_DAY] + val minute = calendar[Calendar.MINUTE] + format = String.format(locale, str, yesterday, at, hourOfDay, minute) + format } - val stringBuilder = StringBuilder() - stringBuilder.append(string) - locale = Locale.ENGLISH - val str2 = " %s %d:%02d" - val at = - resources.getString(if (calendar.get(Calendar.HOUR_OF_DAY) == 1) R.string.date_at_1am else R.string.date_at) - val hourOfDay = calendar.get(Calendar.HOUR_OF_DAY) - val minute = calendar.get(Calendar.MINUTE) - format = String.format(locale, str2, at, hourOfDay, minute) - stringBuilder.append(format) - format = stringBuilder.toString() - return format - } else { - locale = Locale.ENGLISH - str = "%s %s %d:%02d" - val yesterday = resources.getString(R.string.yesterday) - val at = - resources.getString(if (calendar.get(Calendar.HOUR_OF_DAY) == 1) R.string.date_at_1am else R.string.date_at) - val hourOfDay = calendar.get(Calendar.HOUR_OF_DAY) - val minute = calendar.get(Calendar.MINUTE) - format = String.format(locale, str, yesterday, at, hourOfDay, minute) - return format } } diff --git a/app/src/main/java/com/saulhdev/feeder/utils/RomeExtensionsKt.kt b/app/src/main/java/com/saulhdev/feeder/utils/RomeExtensionsKt.kt index 943da03c..1d8790ef 100644 --- a/app/src/main/java/com/saulhdev/feeder/utils/RomeExtensionsKt.kt +++ b/app/src/main/java/com/saulhdev/feeder/utils/RomeExtensionsKt.kt @@ -145,7 +145,7 @@ fun SyndPerson.asAuthor(): Author { fun SyndEntry.contentText(): String { val possiblyHtml = when { - contents != null && contents.isNotEmpty() -> { // Atom + !contents.isNullOrEmpty() -> { // Atom val contents = contents var possiblyHtml: String? = null diff --git a/app/src/main/java/com/saulhdev/feeder/utils/Utilities.kt b/app/src/main/java/com/saulhdev/feeder/utils/Utilities.kt index 12995e24..3a0e069e 100644 --- a/app/src/main/java/com/saulhdev/feeder/utils/Utilities.kt +++ b/app/src/main/java/com/saulhdev/feeder/utils/Utilities.kt @@ -15,7 +15,7 @@ class Utilities { intent.addCategory(Intent.CATEGORY_HOME) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK val componentName: ComponentName = intent.resolveActivity(pm) - if (!context.packageName.equals(componentName.packageName)) { + if (context.packageName != componentName.packageName) { intent = pm.getLaunchIntentForPackage(context.packageName)!! intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) } @@ -34,7 +34,7 @@ class Utilities { PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE ) val mgr: AlarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager - mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent) + mgr[AlarmManager.RTC, System.currentTimeMillis() + 100] = mPendingIntent // Kill the application exitProcess(0) diff --git a/app/src/main/java/com/saulhdev/feeder/views/HtmlToPlainTextConverter.kt b/app/src/main/java/com/saulhdev/feeder/views/HtmlToPlainTextConverter.kt index bec594a2..46297cf0 100644 --- a/app/src/main/java/com/saulhdev/feeder/views/HtmlToPlainTextConverter.kt +++ b/app/src/main/java/com/saulhdev/feeder/views/HtmlToPlainTextConverter.kt @@ -22,7 +22,7 @@ class HtmlToPlainTextConverter : ContentHandler { private var lastImageAlt: String? = null private val isOrderedList: Boolean - get() = !listings.isEmpty() && listings.peek().ordered + get() = listings.isNotEmpty() && listings.peek().ordered init { try { diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionAdapter.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionAdapter.kt deleted file mode 100644 index 6b69f3c2..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionAdapter.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.content.Context -import android.view.LayoutInflater -import android.view.ViewGroup -import androidx.recyclerview.widget.RecyclerView -import com.saulhdev.feeder.R - -class ActionAdapter(private val e: Context, private val f: ActionStyle) : - RecyclerView.Adapter() { - private val f2972a = LayoutInflater.from(this.e) - private var c: List = listOf() - private var d: ((PopupItem) -> Unit)? = null - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ActionVh { - return ActionVh(f2972a.inflate(R.layout.vklib_actionslistview_entry, parent, false), this.f) - } - - override fun getItemCount(): Int { - return this.c.size - } - - fun a(i: Int): PopupItem { - return this.c[i] - } - - override fun onBindViewHolder(holder: ActionVh, position: Int) { - holder.a(d!!) - holder.a(this.c[position]) - } - - override fun onViewRecycled(holder: ActionVh) { - super.onViewRecycled(holder) - holder.a(null) - } - - fun a(): ((PopupItem) -> Unit)? { - return this.d - } - - fun a(cVar: (PopupItem) -> Unit) { - this.d = cVar - } - - fun a(list: List) { - this.c = list - notifyDataSetChanged() - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionDivider.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionDivider.kt deleted file mode 100644 index 2ae47abd..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionDivider.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.graphics.Canvas -import android.graphics.Paint -import android.graphics.Rect -import android.view.View -import androidx.recyclerview.widget.RecyclerView - -class ActionDivider(private val style: DividerStyle) : RecyclerView.ItemDecoration() { - private val f2974a = Paint() - private val b = Rect() - - init { - this.f2974a.color = style.dividerColor - this.f2974a.isAntiAlias = false - this.f2974a.isDither = false - } - - override fun getItemOffsets( - outRect: Rect, - view: View, - parent: RecyclerView, - state: RecyclerView.State - ) { - if (a(parent, view)) { - outRect.bottom = style.dividerHeight - } - } - - override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { - super.onDraw(c, parent, state) - if (parent.childCount != 0) { - val paddingLeft = parent.paddingLeft - val measuredWidth = parent.measuredWidth - parent.paddingRight - - for (i in 0 until parent.childCount) { - val childAt = parent.getChildAt(i) - if (a(parent, childAt)) { - val bottom = - childAt.bottom + ((this.style.dividerHeight / 2) - (this.style.dividerSize / 2)) - this.b.set(paddingLeft, bottom, measuredWidth, this.style.dividerSize + bottom) - c.drawRect(this.b, this.f2974a) - } - } - } - } - - companion object { - fun a(recyclerView: RecyclerView, view: View): Boolean { - val cap = recyclerView.getChildAdapterPosition(view) - if (cap == -1) return false - val adapter = recyclerView.adapter as ActionAdapter - if (cap == adapter.itemCount - 1) return false - if (adapter.a(cap).group != adapter.a(cap + 1).group) return true - return false - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionStyle.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionStyle.kt deleted file mode 100644 index 4212a53d..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionStyle.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.graphics.drawable.Drawable -import androidx.annotation.UiThread - -@UiThread -data class ActionStyle( - var optionBackground: Drawable?, - var paddingStart: Int, - var paddingEnd: Int, - var iconSpace: Int, - var iconTint: Int?, - var textSize: Int, - var textColor: Int -) \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionVh.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionVh.kt deleted file mode 100644 index def13db3..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/ActionVh.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.graphics.PorterDuff -import android.graphics.PorterDuffColorFilter -import android.view.View -import android.view.ViewGroup -import android.widget.ImageView -import android.widget.TextView -import androidx.recyclerview.widget.RecyclerView -import com.saulhdev.feeder.R - -class ActionVh(private val f: View, private val g: ActionStyle) : RecyclerView.ViewHolder(f) { - private val b: ImageView = this.f.findViewById(R.id.icon) - private val c: TextView = this.f.findViewById(R.id.label) - private var d: PopupItem? = null - private var e: ((PopupItem) -> Unit)? = null - - init { - //this.f.background = this.g.optionBackground - this.f.setPaddingRelative(this.g.paddingStart, 0, this.g.paddingEnd, 0) - this.f.setOnClickListener { - if (d != null && e != null) { - e?.invoke(d!!) - } - } - if (this.g.iconTint != null) { - this.b.colorFilter = PorterDuffColorFilter(this.g.iconTint!!, PorterDuff.Mode.SRC_IN) - } - this.c.setTextSize(0, this.g.textSize.toFloat()) - this.c.setTextColor(this.g.textColor) - this.c.layoutParams = (this.c.layoutParams as ViewGroup.MarginLayoutParams).apply { - marginStart = g.iconSpace - } - } - - fun a(): ((PopupItem) -> Unit)? { - return this.e - } - - fun a(cVar: ((PopupItem) -> Unit)?) { - this.e = cVar - } - - fun a(aVar: PopupItem) { - this.d = aVar - this.b.setImageResource(aVar.icon) - this.c.setText(aVar.title) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/DialogActionsVcByPopup.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/DialogActionsVcByPopup.kt deleted file mode 100644 index d48a5fa7..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/DialogActionsVcByPopup.kt +++ /dev/null @@ -1,86 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.annotation.SuppressLint -import android.content.res.Resources -import android.graphics.Rect -import android.view.LayoutInflater -import android.view.View -import androidx.annotation.UiThread -import com.saulhdev.feeder.R -import kotlin.math.ceil - -@UiThread -class DialogActionsVcByPopup(private val d: View) { - private var b: (() -> Unit)? = null - private var c: PopupWindowImpl? = null - private fun a(): Boolean = this.c != null - - private fun intToDp(dp: Int): Int { - return ceil((dp * Resources.getSystem().displayMetrics.density).toDouble()).toInt() - } - - fun d(view: View): Rect { - val iArr = IntArray(2) - view.getLocationOnScreen(iArr) - return Rect(iArr[0], iArr[1], iArr[0] + view.measuredWidth, iArr[1] + view.measuredHeight) - } - - @SuppressLint("InflateParams") - fun a( - list: List, - setListViewParams: ((Pair) -> Unit)? = null, - onClick: (PopupItem) -> Unit - ) { - if (!a()) { - val context = this.d.context - val inflate = LayoutInflater.from(context).inflate(R.layout.replica_popup, null, false) - val dialogActionsListView = - inflate.findViewById(R.id.dialog_actions_list_content) - setListViewParams?.invoke( - Pair( - inflate.findViewById(R.id.dialog_actions_list_container), - dialogActionsListView - ) - ) - dialogActionsListView.setActions(list) - dialogActionsListView.setActionClickListener(onClick) - - inflate.measure( - View.MeasureSpec.makeMeasureSpec( - this.d.rootView.measuredWidth, - View.MeasureSpec.AT_MOST - ), - View.MeasureSpec.makeMeasureSpec( - this.d.rootView.measuredHeight - intToDp(64), - View.MeasureSpec.AT_MOST - ) - ) - inflate.layout(0, 0, inflate.measuredWidth, inflate.measuredHeight) - - val d2 = d(this.d) - val measuredWidth = (d2.right - inflate.measuredWidth) + intToDp(8) - val b2 = d2.top - intToDp(8) - val rect = Rect( - measuredWidth, - b2, - inflate.measuredWidth + measuredWidth, - inflate.measuredHeight + b2 - ) - - this.c = PopupWindowImpl(context).apply { - contentView = inflate - width = rect.width() - height = rect.height() - setOnDismissListener { c = null } - showAtLocation(d, 0, rect.left, rect.top) - } - } - } - - fun dismiss() { - if (a()) { - b?.invoke() - c?.dismiss() - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/DividerStyle.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/DividerStyle.kt deleted file mode 100644 index f2a7e221..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/DividerStyle.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import androidx.annotation.UiThread - -@UiThread -data class DividerStyle( - var dividerHeight: Int, - var dividerSize: Int, - var dividerColor: Int -) \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupContentAnimator.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupContentAnimator.kt deleted file mode 100644 index 16730f72..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupContentAnimator.kt +++ /dev/null @@ -1,167 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.animation.Animator -import android.animation.AnimatorListenerAdapter -import android.animation.AnimatorSet -import android.animation.ObjectAnimator -import android.animation.RectEvaluator -import android.content.res.Resources -import android.graphics.Rect -import android.os.Handler -import android.os.Looper -import android.view.View -import androidx.annotation.UiThread -import androidx.core.os.postDelayed -import androidx.interpolator.view.animation.FastOutLinearInInterpolator -import androidx.interpolator.view.animation.LinearOutSlowInInterpolator -import kotlin.math.ceil - -@UiThread -class PopupContentAnimator(private val g: View) { - companion object { - private fun intToDp(dp: Int): Int { - return ceil((dp * Resources.getSystem().displayMetrics.density).toDouble()).toInt() - } - - val h = (-(intToDp(4))).toFloat() - val j = (-(intToDp(4))).toFloat() - - val i = LinearOutSlowInInterpolator() - val k = FastOutLinearInInterpolator() - } - - var b: Animator? = null - var c: Animator? = null - private val d = Handler(Looper.getMainLooper()) - private var e: (() -> Unit)? = null - private var f: (() -> Unit)? = null - - fun a(action: () -> Unit) { - this.f = action - } - - private fun b() { - val rect = Rect(0, 0, this.g.measuredWidth, 0) - val rect2 = Rect(0, 0, this.g.measuredWidth, this.g.measuredHeight) - this.g.apply { - clipBounds = rect - alpha = 0.0f - translationY = h - visibility = View.VISIBLE - } - - val ofObject = ObjectAnimator.ofObject(this.g, "clipBounds", RectEvaluator(), rect, rect2) - val ofFloat = ObjectAnimator.ofFloat(this.g, View.ALPHA, 0.0f, 1.0f) - val ofFloat2 = ObjectAnimator.ofFloat(this.g, View.TRANSLATION_Y, h, 0.0f) - this.b = AnimatorSet().apply { - addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator) { - b = null - c = null - g.visibility = View.VISIBLE - } - }) - addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator) { - b = null - c = null - e?.invoke() - } - }) - duration = 225 - interpolator = i - playTogether(ofObject, ofFloat, ofFloat2) - start() - } - } - - fun a(z: Boolean) { - if (!a()) { - e() - if (d()) { - b() - } else { - b { b() } - } - } - } - - fun b(z: Boolean) { - if (a()) { - if (z) { - e() - if (d()) { - c() - } else { - b { c() } - } - } else { - e() - this.g.visibility = View.INVISIBLE - this.f?.invoke() - } - } - } - - private fun c() { - this.g.apply { - clipBounds = null - alpha = 1.0f - translationY = 0.0f - visibility = View.VISIBLE - } - val ofFloat = ObjectAnimator.ofFloat(this.g, View.ALPHA, 1.0f, 0.0f) - val ofFloat2 = ObjectAnimator.ofFloat(this.g, View.TRANSLATION_Y, 0.0f, j) - this.c = AnimatorSet().apply { - addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator) { - b = null - c = null - g.visibility = View.INVISIBLE - } - }) - addListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator) { - b = null - c = null - f?.invoke() - } - }) - duration = 150 - interpolator = k - playTogether(ofFloat, ofFloat2) - start() - } - } - - private fun d(): Boolean { - return this.g.measuredHeight > 0 - } - - private fun b(aVar: () -> Unit) { - this.g.visibility = View.INVISIBLE - this.d.postDelayed(50) { - aVar.invoke() - } - } - - private fun e() { - this.b?.cancel() - this.b = null - this.c?.cancel() - this.c = null - this.d.removeCallbacksAndMessages(null) - } - - private fun a(): Boolean { - if (this.b == null) { - if (this.g.visibility == View.VISIBLE) { - if (this.c == null) { - return true - } - } - return false - } - return true - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupItem.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupItem.kt deleted file mode 100644 index 6c5ddf88..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupItem.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import androidx.annotation.DrawableRes -import androidx.annotation.StringRes - -data class PopupItem( - @DrawableRes val icon: Int, - @StringRes val title: Int, - val group: Int, - val id: String -) \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupWindowImpl.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupWindowImpl.kt deleted file mode 100644 index 27e6bfbd..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/PopupWindowImpl.kt +++ /dev/null @@ -1,83 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.content.Context -import android.graphics.Canvas -import android.graphics.ColorFilter -import android.graphics.PixelFormat -import android.graphics.drawable.Drawable -import android.os.Handler -import android.view.View -import android.widget.PopupWindow -import androidx.annotation.UiThread - -@UiThread -class PopupWindowImpl(context: Context) : PopupWindow(context) { - private val f1304a = Handler() - private var b: PopupContentAnimator? = null - - init { - isClippingEnabled = false - isFocusable = true - animationStyle = 0 - setBackgroundDrawable(object : Drawable() { - override fun draw(canvas: Canvas) { - - } - - override fun setAlpha(alpha: Int) { - - } - - override fun getOpacity(): Int { - return PixelFormat.TRANSPARENT - } - - override fun setColorFilter(colorFilter: ColorFilter?) { - - } - - }) - } - - override fun showAsDropDown(view: View?) { - run { - super.showAsDropDown(view) - } - } - - override fun showAsDropDown(view: View?, i: Int, i2: Int) { - run { - super.showAsDropDown(view, i, i2) - } - } - - override fun showAsDropDown(view: View?, i: Int, i2: Int, i3: Int) { - run { - super.showAsDropDown(view, i, i2, i3) - } - } - - override fun showAtLocation(view: View?, i: Int, i2: Int, i3: Int) { - run { - super.showAtLocation(view, i, i2, i3) - } - } - - private fun run(aVar: () -> Unit) { - this.b = PopupContentAnimator(contentView) - this.b?.b(false) - aVar.invoke() - this.f1304a.post { - this.b?.a(true) - } - } - - override fun dismiss() { - this.f1304a.removeCallbacksAndMessages(null) - this.b?.a { - b = null - super.dismiss() - } - this.b?.b(true) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/saulhdev/feeder/vkpopup/VkLibActionsListView.kt b/app/src/main/java/com/saulhdev/feeder/vkpopup/VkLibActionsListView.kt deleted file mode 100644 index 5c453263..00000000 --- a/app/src/main/java/com/saulhdev/feeder/vkpopup/VkLibActionsListView.kt +++ /dev/null @@ -1,164 +0,0 @@ -package com.saulhdev.feeder.vkpopup - -import android.content.Context -import android.content.res.Resources -import android.graphics.drawable.Drawable -import android.util.AttributeSet -import android.util.DisplayMetrics -import androidx.annotation.ColorInt -import androidx.annotation.DrawableRes -import androidx.annotation.Px -import androidx.annotation.UiThread -import androidx.core.content.ContextCompat -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.saulhdev.feeder.R -import kotlin.math.ceil - -@UiThread -open class VkLibActionsListView @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : RecyclerView(context, attrs, defStyleAttr) { - private val f2979a: DividerStyle - private val b: ActionStyle - private var c: ActionDivider - private var d: ActionAdapter - - init { - val attr = - context.obtainStyledAttributes(attrs, R.styleable.VkLibActionsListView, defStyleAttr, 0) - val dHeight = attr.getDimensionPixelSize( - R.styleable.VkLibActionsListView_vklib_alv_dividerHeight, - a(1) - ) - val dSize = - attr.getDimensionPixelSize(R.styleable.VkLibActionsListView_vklib_alv_dividerSize, a(1)) - val dColor = - attr.getColor(R.styleable.VkLibActionsListView_vklib_alv_dividerColor, -16777216) - this.f2979a = DividerStyle(dHeight, dSize, dColor) - - val oBg = attr.getDrawable(R.styleable.VkLibActionsListView_vklib_alv_optionBackground) - val paddingStart = attr.getDimensionPixelSize( - R.styleable.VkLibActionsListView_vklib_alv_optionPaddingStart, - 0 - ) - val paddingEnd = attr.getDimensionPixelSize( - R.styleable.VkLibActionsListView_vklib_alv_optionPaddingEnd, - 0 - ) - val iconSpace = attr.getDimensionPixelSize( - R.styleable.VkLibActionsListView_vklib_alv_optionIconLabelSpace, - 0 - ) - val iconTint = Integer.valueOf( - attr.getColor( - R.styleable.VkLibActionsListView_vklib_alv_optionIconTint, - -16777216 - ) - ) - val textSize = attr.getDimensionPixelSize( - R.styleable.VkLibActionsListView_vklib_alv_optionLabelTextSize, - (((getDisplayMetrics().scaledDensity * 16.0f) + 0.5f).toInt()) - ) - val textColor = attr.getColor( - R.styleable.VkLibActionsListView_vklib_alv_optionLabelTextColor, - -16777216 - ) - this.b = - ActionStyle(oBg, paddingStart, paddingEnd, iconSpace, iconTint, textSize, textColor) - attr.recycle() - - this.c = ActionDivider(this.f2979a) - this.d = ActionAdapter(context, this.b) - this.layoutManager = LinearLayoutManager(context, VERTICAL, false) - this.addItemDecoration(this.c) - this.adapter = this.d - } - - fun setDividerHeight(@Px i: Int) { - this.f2979a.dividerHeight = i - a() - } - - fun setDividerSize(@Px i: Int) { - this.f2979a.dividerSize = i - a() - } - - fun setDividerColor(@ColorInt i: Int) { - this.f2979a.dividerColor = i - a() - } - - fun setActionBackground(@DrawableRes i: Int) { - if (i != 0) { - setActionBackground(ContextCompat.getDrawable(context, i)) - } else { - setActionBackground(null) - } - } - - fun setActionBackground(drawable: Drawable?) { - this.b.optionBackground = drawable - b() - } - - fun setActionPaddingStart(@Px i: Int) { - this.b.paddingStart = i - b() - } - - fun setActionIconTint(@ColorInt i: Int) { - this.b.iconTint = i - b() - } - - fun setActionPaddingEnd(@Px i: Int) { - this.b.paddingEnd = i - b() - } - - fun setActionIconLabelSpace(@Px i: Int) { - this.b.iconSpace = i - b() - } - - fun setActionLabelTextSize(@Px i: Int) { - this.b.textSize = i - b() - } - - fun setActionLabelTextColor(@ColorInt i: Int) { - this.b.textColor = i - b() - } - - fun setActionClickListener(cVar: (PopupItem) -> Unit) { - this.d.a(cVar) - } - - fun setActions(list: List) { - this.d.a(list) - if (list.isNotEmpty()) layoutManager?.scrollToPosition(0) - } - - private fun a() { - this.c = ActionDivider(this.f2979a) - adapter?.notifyDataSetChanged() - } - - private fun b() { - this.d = ActionAdapter(context, this.b) - adapter = this.d - } - - private fun getDisplayMetrics(): DisplayMetrics { - return Resources.getSystem().displayMetrics - } - - private fun a(i: Int): Int { - return ceil((getDisplayMetrics().density * 1.0f)).toInt() - } -} \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/vkim_bg_overlay.9.png b/app/src/main/res/drawable-hdpi/vkim_bg_overlay.9.png deleted file mode 100644 index de295f56..00000000 Binary files a/app/src/main/res/drawable-hdpi/vkim_bg_overlay.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/vkim_bg_overlay.9.png b/app/src/main/res/drawable-mdpi/vkim_bg_overlay.9.png deleted file mode 100644 index 2251ca5f..00000000 Binary files a/app/src/main/res/drawable-mdpi/vkim_bg_overlay.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/vkim_bg_overlay.9.png b/app/src/main/res/drawable-xhdpi/vkim_bg_overlay.9.png deleted file mode 100644 index 6dd5f10c..00000000 Binary files a/app/src/main/res/drawable-xhdpi/vkim_bg_overlay.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/vkim_bg_overlay.9.png b/app/src/main/res/drawable-xxhdpi/vkim_bg_overlay.9.png deleted file mode 100644 index 274b570f..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/vkim_bg_overlay.9.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/vkim_bg_overlay.9.png b/app/src/main/res/drawable-xxxhdpi/vkim_bg_overlay.9.png deleted file mode 100644 index b7f812cb..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/vkim_bg_overlay.9.png and /dev/null differ diff --git a/app/src/main/res/drawable/bg_back_to_top.xml b/app/src/main/res/drawable/bg_back_to_top.xml deleted file mode 100644 index d13c9fb9..00000000 --- a/app/src/main/res/drawable/bg_back_to_top.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/button_background.xml b/app/src/main/res/drawable/button_background.xml deleted file mode 100644 index b1ce4e01..00000000 --- a/app/src/main/res/drawable/button_background.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/button_state_pressed.xml b/app/src/main/res/drawable/button_state_pressed.xml deleted file mode 100644 index 363138a4..00000000 --- a/app/src/main/res/drawable/button_state_pressed.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_archive_tray.xml b/app/src/main/res/drawable/ic_archive_tray.xml deleted file mode 100644 index b5603ea6..00000000 --- a/app/src/main/res/drawable/ic_archive_tray.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_arrow_upward.xml b/app/src/main/res/drawable/ic_arrow_upward.xml deleted file mode 100644 index 46d5d587..00000000 --- a/app/src/main/res/drawable/ic_arrow_upward.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_filter_state.xml b/app/src/main/res/drawable/ic_filter_state.xml deleted file mode 100644 index 84d5b184..00000000 --- a/app/src/main/res/drawable/ic_filter_state.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_heart.xml b/app/src/main/res/drawable/ic_heart.xml deleted file mode 100644 index d7b22e88..00000000 --- a/app/src/main/res/drawable/ic_heart.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_heart_fill.xml b/app/src/main/res/drawable/ic_heart_fill.xml deleted file mode 100644 index 38013724..00000000 --- a/app/src/main/res/drawable/ic_heart_fill.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_list.xml b/app/src/main/res/drawable/ic_list.xml deleted file mode 100644 index c33020a6..00000000 --- a/app/src/main/res/drawable/ic_list.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/ic_more_vertical_24.xml b/app/src/main/res/drawable/ic_more_vertical_24.xml deleted file mode 100644 index 39926bc0..00000000 --- a/app/src/main/res/drawable/ic_more_vertical_24.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_replay_24.xml b/app/src/main/res/drawable/ic_replay_24.xml deleted file mode 100644 index 44cbde9c..00000000 --- a/app/src/main/res/drawable/ic_replay_24.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_restart.xml b/app/src/main/res/drawable/ic_restart.xml deleted file mode 100644 index aaaab018..00000000 --- a/app/src/main/res/drawable/ic_restart.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_settings_outline_28.xml b/app/src/main/res/drawable/ic_settings_outline_28.xml deleted file mode 100644 index ca282a58..00000000 --- a/app/src/main/res/drawable/ic_settings_outline_28.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml deleted file mode 100644 index 73001fad..00000000 --- a/app/src/main/res/drawable/ic_share.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/layout/feed_card_story_large.xml b/app/src/main/res/layout/feed_card_story_large.xml deleted file mode 100644 index d4792a61..00000000 --- a/app/src/main/res/layout/feed_card_story_large.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/notification_generic_content.xml b/app/src/main/res/layout/notification_generic_content.xml deleted file mode 100644 index dea93e32..00000000 --- a/app/src/main/res/layout/notification_generic_content.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/notification_simple.xml b/app/src/main/res/layout/notification_simple.xml deleted file mode 100644 index ce166f75..00000000 --- a/app/src/main/res/layout/notification_simple.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/overlay_header.xml b/app/src/main/res/layout/overlay_header.xml deleted file mode 100644 index dec55c31..00000000 --- a/app/src/main/res/layout/overlay_header.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/overlay_layout.xml b/app/src/main/res/layout/overlay_layout.xml deleted file mode 100755 index e3338804..00000000 --- a/app/src/main/res/layout/overlay_layout.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/preview.xml b/app/src/main/res/layout/preview.xml deleted file mode 100644 index c54a3814..00000000 --- a/app/src/main/res/layout/preview.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/replica_popup.xml b/app/src/main/res/layout/replica_popup.xml deleted file mode 100644 index c151e08e..00000000 --- a/app/src/main/res/layout/replica_popup.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/vklib_actionslistview_entry.xml b/app/src/main/res/layout/vklib_actionslistview_entry.xml deleted file mode 100644 index 37c52aff..00000000 --- a/app/src/main/res/layout/vklib_actionslistview_entry.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 50a984d2..db289b2d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,7 @@ plugins { alias(libs.plugins.kotlin.serialization) apply false alias(libs.plugins.ksp) apply false } + tasks.register("clean", Delete::class.java) { delete(layout.buildDirectory) } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cd9d93c8..4b15ae8b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,10 +7,11 @@ coil = "2.4.0" compose = "1.5.4" composeCompiler = "1.5.4" core-ktx = "1.12.0" -koin = "3.4.2" -koin-compiler = "1.2.2" +gradle = "8.1.4" +koin = "3.5.0" +koin-compiler = "1.3.0" kotlin = "1.9.20" -ksp = "1.9.20-1.0.13" +ksp = "1.9.20-1.0.14" material = "1.10.0" material3 = "1.2.0-alpha11" moshi = "1.15.0" @@ -21,7 +22,7 @@ retrofit = "2.9.0" rome = "2.1.0" room = "2.6.0" serialization = "1.9.20" -symbol-processing-api = "1.9.20-1.0.13" +symbol-processing-api = "1.9.20-1.0.14" swiperefreshlayout = "1.1.0" work-runtime-ktx = "2.8.1" datastore-preferences = "1.0.0" @@ -43,14 +44,17 @@ compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", versi compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose" } core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" } datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore-preferences" } -jsoup = { group = "org.jsoup", name = "jsoup", version = "1.16.1" } -kodein = { group = "org.kodein.di", name = "kodein-di-framework-android-x", version = "7.20.2" } +gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +gradle-8_0_2 = { module = "com.android.tools.build:gradle", version.ref = "android-gradle" } +jsoup = { group = "org.jsoup", name = "jsoup", version = "1.16.2" } +kodein = { group = "org.kodein.di", name = "kodein-di-framework-android-x", version = "7.21.0" } koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koin" } koin-android-compat = { group = "io.insert-koin", name = "koin-android-compat", version.ref = "koin" } koin-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koin" } koin-ksp-compiler = { group = "io.insert-koin", name = "koin-ksp-compiler", version.ref = "koin-compiler" } koin-navigation = { group = "io.insert-koin", name = "koin-androidx-navigation", version.ref = "koin" } koin-workmanager = { group = "io.insert-koin", name = "koin-androidx-workmanager", version.ref = "koin" } +kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } lifecycle-common-java8 = { group = "androidx.lifecycle", name = "lifecycle-common-java8", version.ref = "lifecycle" } lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycle" } lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 53b5dd73..f8b2332d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Oct 16 18:32:18 CST 2023 +#Sat Nov 25 01:52:01 CET 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists