open reader view when label chips are tapped

This commit is contained in:
Satindar Dhillon
2023-03-23 13:10:06 -07:00
parent b5f8a07a7f
commit eaf46057f4
3 changed files with 10 additions and 16 deletions

View File

@ -17,8 +17,8 @@ android {
applicationId "app.omnivore.omnivore"
minSdk 26
targetSdk 33
versionCode 29
versionName "0.0.29"
versionCode 30
versionName "0.0.30"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

View File

@ -3,16 +3,12 @@ package app.omnivore.omnivore.ui.library
import android.content.Intent
import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.pullrefresh.PullRefreshIndicator
import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullrefresh.rememberPullRefreshState
@ -22,14 +18,10 @@ import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.navigation.NavHostController
import app.omnivore.omnivore.Routes
import app.omnivore.omnivore.persistence.entities.SavedItemCardDataWithLabels
import app.omnivore.omnivore.persistence.entities.SavedItemLabel
import app.omnivore.omnivore.ui.components.LabelChipColors
import app.omnivore.omnivore.ui.components.LabelsSelectionSheet
import app.omnivore.omnivore.ui.savedItemViews.SavedItemCard
import app.omnivore.omnivore.ui.reader.PDFReaderActivity

View File

@ -29,17 +29,19 @@ fun SavedItemCard(cardData: SavedItemCardData, labels: List<SavedItemLabel>, onC
val publisherDisplayName = cardData.publisherDisplayName()
val listState = rememberLazyListState()
Column {
Column(
modifier = Modifier
.combinedClickable(
onClick = onClickHandler,
onLongClick = { isMenuExpanded = true }
)
) {
Row(
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.Top,
modifier = Modifier
.fillMaxWidth()
.padding(12.dp)
.combinedClickable(
onClick = onClickHandler,
onLongClick = { isMenuExpanded = true }
)
.background(if (isMenuExpanded) Color.LightGray else Color.Transparent)
) {
Column(
@ -96,7 +98,7 @@ fun SavedItemCard(cardData: SavedItemCardData, labels: List<SavedItemLabel>, onC
val chipColors = LabelChipColors.fromHex(label.color)
SuggestionChip(
onClick = {},
onClick = onClickHandler,
label = { Text(label.name) },
border = null,
colors = elevatedSuggestionChipColors(