[update] New Icon& UI Theme

This commit is contained in:
acite
2025-09-14 19:59:28 +08:00
parent cc540903d3
commit f7701cc85b
30 changed files with 158 additions and 33 deletions

View File

@@ -11,6 +11,7 @@ import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.compose.ui.platform.LocalContext
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import coil3.ImageLoader
import coil3.network.okhttp.OkHttpNetworkFetcherFactory
@@ -18,14 +19,20 @@ import com.acitelight.aether.dataStore
import com.acitelight.aether.helper.insertInNaturalOrder
import com.acitelight.aether.model.Video
import com.acitelight.aether.service.ApiClient.createOkHttp
import com.acitelight.aether.service.FetchManager
import com.acitelight.aether.service.MediaManager
import com.acitelight.aether.service.MediaManager.queryVideoKlasses
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import javax.inject.Inject
class VideoScreenViewModel(application: Application) : AndroidViewModel(application)
@HiltViewModel
class VideoScreenViewModel @Inject constructor(
private val fetchManager: FetchManager
) : ViewModel()
{
private val _tabIndex = mutableIntStateOf(0)
val tabIndex: State<Int> = _tabIndex
@@ -83,6 +90,11 @@ class VideoScreenViewModel(application: Application) : AndroidViewModel(applicat
}
}
fun download(video :Video)
{
fetchManager.startVideoDownload(video)
}
init {
viewModelScope.launch {
init()