/* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.wallpaper.testing import com.android.wallpaper.picker.category.domain.interactor.CuratedPhotosInteractor import com.android.wallpaper.picker.data.PhotosErrorData import com.android.wallpaper.picker.data.category.CategoryModel import com.android.wallpaper.picker.data.category.CollectionCategoryData import com.android.wallpaper.picker.data.category.CommonCategoryData import com.android.wallpaper.picker.data.category.PhotoCategoryModel import javax.inject.Inject import javax.inject.Singleton import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @Singleton class FakeCuratedPhotosInteractorImpl @Inject constructor() : CuratedPhotosInteractor { private val _category = MutableStateFlow(threeCuratedPhotos) override val category: Flow get() = _category override val dismissBanner: StateFlow get() = TODO("Not yet implemented") override fun setBannerDismissed(dismissed: Boolean) { TODO("Not yet implemented") } override fun refreshContent() {} fun setCategory(newCategory: PhotoCategoryModel) { _category.value = newCategory } companion object { val curatedPhotosTitle = "Curated Photos Title" val twoCuratedPhotos = PhotoCategoryModel( CategoryModel( CommonCategoryData(curatedPhotosTitle, "image_wallpapers", 51), collectionCategoryData = CollectionCategoryData( wallpaperModels = mutableListOf( WallpaperModelUtils.getStaticWallpaperModel( "wallpaper1", "collection1", ), WallpaperModelUtils.getStaticWallpaperModel( "wallpaper2", "collection1", ), ), thumbAsset = TestAsset(TestStaticWallpaperInfo.COLOR_DEFAULT, false), featuredThumbnailIndex = 0, isSingleWallpaperCategory = false, ), ), PhotosErrorData.OK, null, ) val threeCuratedPhotos = PhotoCategoryModel( CategoryModel( CommonCategoryData(curatedPhotosTitle, "image_wallpapers", 51), collectionCategoryData = CollectionCategoryData( wallpaperModels = mutableListOf( WallpaperModelUtils.getStaticWallpaperModel( "wallpaper1", "collection1", ), WallpaperModelUtils.getStaticWallpaperModel( "wallpaper2", "collection1", ), WallpaperModelUtils.getStaticWallpaperModel( "wallpaper3", "collection1", ), WallpaperModelUtils.getStaticWallpaperModel( "wallpaper4", "collection1", ), WallpaperModelUtils.getStaticWallpaperModel( "wallpaper5", "collection1", ), WallpaperModelUtils.getStaticWallpaperModel( "wallpaper6", "collection1", ), ), thumbAsset = TestAsset(TestStaticWallpaperInfo.COLOR_DEFAULT, false), featuredThumbnailIndex = 0, isSingleWallpaperCategory = false, ), ), PhotosErrorData.OK, null, ) } }