Files
Reflect/Shared/views/SampleEntryView.swift
Trey t 9bf6190bab add customize onboarding views
make tab bar text color selected text color
2022-04-05 23:46:01 -05:00

52 lines
1.8 KiB
Swift

//
// SampleEntryView.swift
// Feels (iOS)
//
// Created by Trey Tartt on 4/5/22.
//
import SwiftUI
struct SampleEntryView: View {
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
var body: some View {
ZStack {
theme.currentTheme.secondaryBGColor
VStack {
HStack {
Spacer()
Image(systemName: "arrow.triangle.2.circlepath.circle")
.resizable()
.frame(width: 20, height: 20, alignment: .trailing)
.foregroundColor(Color(UIColor.systemGray))
.onTapGesture {
sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
}
}
Spacer()
}.padding()
VStack(alignment:.leading) {
Text(String(localized: "customize_view_view_example_row"))
.padding([.leading, .top])
.foregroundColor(textColor)
Divider()
EntryListView(entry: sampleListEntry)
.padding()
}
}
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
}
struct SampleEntryView_Previews: PreviewProvider {
static var previews: some View {
SampleEntryView()
}
}