@Suppress("ComplexCondition") fun getCurrentWallpaperFromSettings(settings: Settings): Wallpaper? { val name = settings.currentWallpaperName val textColor = settings.currentWallpaperTextColor val cardColorLight = settings.currentWallpaperCardColorLight val cardColorDark = settings.currentWallpaperCardColorDark return if (name.isNotEmpty() && textColor != 0L && cardColorLight != 0L && cardColorDark != 0L) { Wallpaper( name = name, textColor = textColor, cardColorLight = cardColorLight, cardColorDark = cardColorDark, collection = DefaultCollection, thumbnailFileState = ImageFileState.Downloaded, assetsFileState = ImageFileState.Downloaded, ) } else { null } }
Generate a wallpaper from metadata cached in Settings.