more code clean up
This commit is contained in:
@@ -23,31 +23,29 @@ struct ContentView: View {
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
|
||||
// top header storage
|
||||
// MARK: top header storage
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var currentSelectedHeaderViewBackDays: Int = 30
|
||||
@AppStorage(UserDefaultsStore.Keys.contentViewHeaderTagViewOneViewType.rawValue, store: GroupUserDefaults.groupDefaults) private var firstSwichableHeaderViewType: MainSwitchableViewType = .total
|
||||
@AppStorage(UserDefaultsStore.Keys.contentViewHeaderTagViewTwoViewType.rawValue, store: GroupUserDefaults.groupDefaults) private var secondSwichableHeaderViewType: MainSwitchableViewType = .total
|
||||
@AppStorage(UserDefaultsStore.Keys.contentViewHeaderTag.rawValue, store: GroupUserDefaults.groupDefaults) private var switchableViewSelectedIndex = 1
|
||||
//
|
||||
|
||||
// edit row
|
||||
// MARK: edit row properties
|
||||
@State private var showingSheet = false
|
||||
@State private var selectedEntry: MoodEntry?
|
||||
//
|
||||
|
||||
// MARK: ?? properties
|
||||
@State private var showTodayInput = true
|
||||
@State private var showUpdateEntryAlert = false
|
||||
|
||||
// header properties
|
||||
// MARK: header properties
|
||||
@State private var headerHeight: CGFloat = ContentViewConstants.maxHeaderHeight
|
||||
@State private var headerViewType: MainSwitchableViewType = .total
|
||||
@State private var currentSelectedHeaderViewViewType: MainSwitchableViewType = .total
|
||||
@State private var headerOpacity: Double = 1.0
|
||||
//
|
||||
|
||||
let minHeaderHeight = ContentViewConstants.minHeaderHeight
|
||||
let maxHeaderHeight = ContentViewConstants.maxHeaderHeight
|
||||
|
||||
|
||||
@ObservedObject var viewModel = ContentModeViewModel()
|
||||
|
||||
init(){
|
||||
@@ -110,7 +108,7 @@ struct ContentView: View {
|
||||
|
||||
// MARK: functions that do view type work
|
||||
func calcuateViewAlpha() {
|
||||
let perc = (((Double(headerHeight) - minHeaderHeight) * 100) / (maxHeaderHeight - minHeaderHeight)) / 100
|
||||
let perc = (((Double(headerHeight) - ContentViewConstants.minHeaderHeight) * 100) / (ContentViewConstants.maxHeaderHeight - ContentViewConstants.minHeaderHeight)) / 100
|
||||
headerOpacity = perc
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user