[feat] Video position remember& New Icon and Theme

This commit is contained in:
acite
2025-09-18 23:44:07 +08:00
parent a15325deeb
commit 1b24312a95
26 changed files with 118 additions and 62 deletions

View File

@@ -8,58 +8,44 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Bookmarks
import androidx.compose.material.icons.filled.Key
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.max
import androidx.compose.ui.unit.sp
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.lifecycle.viewModelScope
import androidx.navigation.NavHostController
import coil3.compose.AsyncImage
import coil3.request.ImageRequest
import com.acitelight.aether.ToggleFullScreen
import com.acitelight.aether.model.BookMark
import com.acitelight.aether.model.ComicRecord
import com.acitelight.aether.service.MediaManager
import com.acitelight.aether.viewModel.ComicPageViewModel
import kotlinx.coroutines.launch
@@ -71,7 +57,6 @@ fun ComicPageView(
comicPageViewModel: ComicPageViewModel = hiltViewModel<ComicPageViewModel>()
) {
val colorScheme = MaterialTheme.colorScheme
comicPageViewModel.SetupClient()
comicPageViewModel.Resolve(comicId.hexToString(), page.toInt())
val title by comicPageViewModel.title
@@ -81,7 +66,7 @@ fun ComicPageView(
var showPlane by comicPageViewModel.showPlane
var showBookMarkPop by remember { mutableStateOf(false) }
comicPageViewModel.UpdateProcess(pagerState.currentPage)
comicPageViewModel.updateProcess(pagerState.currentPage)
val comic by comicPageViewModel.comic
comic?.let {
@@ -96,7 +81,7 @@ fun ComicPageView(
.clickable {
showPlane = !showPlane
if (showPlane) {
comicPageViewModel.coroutineScope?.launch {
comicPageViewModel.viewModelScope.launch {
comicPageViewModel.listState?.scrollToItem(index = pagerState.currentPage)
}
}
@@ -329,7 +314,7 @@ fun ComicPageView(
showBookMarkPop = false
}, { s ->
showBookMarkPop = false
comicPageViewModel.coroutineScope?.launch {
comicPageViewModel.viewModelScope.launch {
comicPageViewModel.mediaManager.postBookmark(
comicId.hexToString(),
BookMark(name = s, page = comicPageViewModel.pageList[pagerState.currentPage])