9 changed files with 145 additions and 14 deletions
-
8kplayer.xcodeproj/project.pbxproj
-
8kplayer/core/DatabaseManager.swift
-
20kplayer/detail/DetailViewController+Show.swift
-
17kplayer/detail/DetailViewController.swift
-
11kplayer/detail/EditItemView.swift
-
15kplayer/photo/SPhotoModel.swift
-
46kplayer/photo/SPhotoView.swift
-
20kplayer/util/AsyncImage.swift
-
14kplayer/video/SVideoPlayer.swift
@ -0,0 +1,15 @@ |
|||
// |
|||
// Created by Marco Schmickler on 22.06.22. |
|||
// Copyright (c) 2022 Marco Schmickler. All rights reserved. |
|||
// |
|||
|
|||
import Foundation |
|||
|
|||
class SPhotoModel : ObservableObject { |
|||
@Published var allItems : [MediaItem] |
|||
@Published var index = 0 |
|||
|
|||
init(allItems: [MediaItem]) { |
|||
self.allItems = allItems |
|||
} |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
// |
|||
// Created by Marco Schmickler on 22.06.22. |
|||
// Copyright (c) 2022 Marco Schmickler. All rights reserved. |
|||
// |
|||
|
|||
import Foundation |
|||
import SwiftUI |
|||
|
|||
struct SPhotoView : View { |
|||
var completionHandler: ((Bool) -> Void)? |
|||
var model: SPhotoModel |
|||
|
|||
var body: some View { |
|||
VStack { |
|||
HStack { |
|||
Group { |
|||
Button(action: { |
|||
completionHandler!(true) |
|||
}, label: { |
|||
Text("cancel") |
|||
}) |
|||
.buttonStyle(BorderlessButtonStyle()) |
|||
} |
|||
}.frame(height: 50) |
|||
AsyncImage(item: model.allItems[model.index], thumb: false, placeholder: { Text("Loading ...") }, |
|||
image: { Image(uiImage: $0).resizable() }) |
|||
|
|||
ScrollView(.horizontal, showsIndicators: false) { |
|||
HStack { |
|||
ForEach(model.allItems) { item in |
|||
Button(action: { |
|||
gotoSnapshot(item) |
|||
}) { |
|||
AsyncImage(item: item, placeholder: { Text("Loading ...") }, |
|||
image: { Image(uiImage: $0).resizable() }) |
|||
} |
|||
}.frame(height: 70) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
func gotoSnapshot(_ item: MediaItem) { |
|||
|
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue