콘텐츠 플레이어
- 현재 재생중인 콘텐츠 아이템 배경 추가
This commit is contained in:
		| @@ -17,6 +17,7 @@ final class ContentPlayerPlayManager: NSObject, ObservableObject { | ||||
|      | ||||
|     private let repository = ContentGenerateUrlRepository() | ||||
|      | ||||
|     @Published var id = 0 | ||||
|     @Published var title = "" | ||||
|     @Published var nickname = "" | ||||
|     @Published var coverImageUrl = "" | ||||
| @@ -174,6 +175,7 @@ final class ContentPlayerPlayManager: NSObject, ObservableObject { | ||||
|     } | ||||
|      | ||||
|     private func urlGenerateSuccess(content: AudioContentPlaylistContent, url: String) { | ||||
|         id = content.id | ||||
|         title = content.title | ||||
|         nickname = content.creatorNickname | ||||
|         coverImageUrl = content.coverUrl | ||||
|   | ||||
| @@ -55,7 +55,17 @@ struct ContentPlayerView: View { | ||||
|                     ScrollView(.vertical) { | ||||
|                         LazyVStack(alignment: .leading, spacing: 0) { | ||||
|                             ForEach(0..<playerManager.playlist.count, id: \.self) { | ||||
|                                 PlaylistContentItemView(item: playerManager.playlist[$0]) | ||||
|                                 let item = playerManager.playlist[$0] | ||||
|                                 PlaylistContentItemView(item: item) | ||||
|                                     .padding(13.3) | ||||
|                                     .frame(maxWidth: .infinity) | ||||
|                                     .background( | ||||
|                                         Color.button | ||||
|                                             .opacity( | ||||
|                                                 item.id == playerManager.id ? 0.2 : 0 | ||||
|                                             ) | ||||
|                                     ) | ||||
|                                     .cornerRadius(6.7) | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
|   | ||||
| @@ -47,6 +47,8 @@ struct PlaylistContentItemView: View { | ||||
|                     .lineLimit(2) | ||||
|                     .truncationMode(.tail) | ||||
|             } | ||||
|              | ||||
|             Spacer() | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung