diff options
author | Xin Li <delphij@google.com> | 2024-03-06 09:30:07 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2024-03-06 09:30:07 -0800 |
commit | c6e2265081bf623659b70c2934c4dff58ff44870 (patch) | |
tree | e097329009a3b14faea938f50b2ecf376c64ccfa /src/com/android/wallpaper/picker/preview/ui/viewmodel/floatingSheet/InfoFloatingSheetViewModel.kt | |
parent | 737aae0a5169a56827e044efbf13b8e2c493eb1b (diff) | |
parent | 6a102a5e0f7a735b1040bfc09e0194633ab6b262 (diff) | |
download | WallpaperPicker2-c6e2265081bf623659b70c2934c4dff58ff44870.tar.gz |
Merge Android 14 QPR2 to AOSP main
Bug: 319669529
Merged-In: I1efe62feb705cab519a067d3875225ace2f1a387
Change-Id: I307d8d2fbf48468fb09f66c0c8abb7ab71eea676
Diffstat (limited to 'src/com/android/wallpaper/picker/preview/ui/viewmodel/floatingSheet/InfoFloatingSheetViewModel.kt')
-rw-r--r-- | src/com/android/wallpaper/picker/preview/ui/viewmodel/floatingSheet/InfoFloatingSheetViewModel.kt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/com/android/wallpaper/picker/preview/ui/viewmodel/floatingSheet/InfoFloatingSheetViewModel.kt b/src/com/android/wallpaper/picker/preview/ui/viewmodel/floatingSheet/InfoFloatingSheetViewModel.kt new file mode 100644 index 00000000..29fa2553 --- /dev/null +++ b/src/com/android/wallpaper/picker/preview/ui/viewmodel/floatingSheet/InfoFloatingSheetViewModel.kt @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 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.picker.preview.ui.viewmodel.floatingSheet + +import com.android.wallpaper.model.wallpaper.WallpaperModel + +/** This data class represents the view data for the info floating sheet */ +data class InfoFloatingSheetViewModel( + val actionUrl: String?, + val attributions: List<String?>?, + val showMetadata: Boolean +) { + + constructor( + wallpaperModel: WallpaperModel + ) : this( + actionUrl = wallpaperModel.commonWallpaperData.exploreActionUrl, + attributions = wallpaperModel.commonWallpaperData.attributions, + showMetadata = + if (wallpaperModel is WallpaperModel.LiveWallpaperModel) { + wallpaperModel.liveWallpaperData.systemWallpaperInfo.showMetadataInPreview + } else { + true + } + ) +} |