Skip to content

Commit

Permalink
Merge pull request #1 from aapis/responsive-design
Browse files Browse the repository at this point in the history
Release 8 - responsive design
  • Loading branch information
aapis authored Nov 15, 2020
2 parents 3a33fc1 + 8c24e9a commit d173b47
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 40 deletions.
8 changes: 4 additions & 4 deletions DLPrototype.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@
CODE_SIGN_ENTITLEMENTS = DLPrototype/DLPrototype.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = "\"DLPrototype/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -474,7 +474,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = com.yegcollective.DLPrototype;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -488,7 +488,7 @@
CODE_SIGN_ENTITLEMENTS = DLPrototype/DLPrototype.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = "\"DLPrototype/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -498,7 +498,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = com.yegcollective.DLPrototype;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
21 changes: 17 additions & 4 deletions DLPrototype/Views/Add.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ struct Add : View {

var body: some View {
VStack(alignment: .leading) {
Text("Append to \(category.title).log")
.font(.title)
HStack {
Text(Image(systemName: "doc.append.fill"))
.font(.title)
Text("Append to \(category.title).log")
.font(.title)
}

Divider()

HStack {
TextField("Job ID", text: self.$jobId)
.frame(width: 100)
.font(Font.system(size: 16, design: .default))

TextField("Enter your daily log text here", text: $text)
.font(Font.system(size: 16, design: .default))

Button("Log", action: {
if self.$text.wrappedValue != "" && self.$jobId.wrappedValue != "" {
Expand All @@ -39,11 +47,16 @@ struct Add : View {
print("You have to type something")
}
})
.background(Color.accentColor)
.font(Font.system(size: 16, design: .default))
}

Divider()

ScrollView {
TextField("Content here", text: $todayLogLines)
TextField("Click \"New Day\" below to get started", text: $todayLogLines)
.disabled(true)
.font(Font.system(size: 16, design: .default))
}

HStack {
Expand All @@ -61,7 +74,7 @@ struct Add : View {
})
}
}
.frame(width: 700, height: 700)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.padding()
.onAppear(perform: populateTodayView)
}
Expand Down
51 changes: 27 additions & 24 deletions DLPrototype/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,40 @@ struct ContentView: View {

init() {
categories.append(Category(title: "Daily"))
categories.append(Category(title: "Standup"))
categories.append(Category(title: "Reflection"))
// categories.append(Category(title: "Standup"))
// categories.append(Category(title: "Reflection"))
// createLogFiles()
}

var body: some View {
VStack {
NavigationView {
List {
ForEach(categories) { category in
Text(category.title)
.bold()

NavigationLink(destination: Add(category: category)) {
Text("Add")
.padding(10)
}

NavigationLink(destination: Log(category: category)) {
Text("View")
.padding(10)
}

NavigationLink(destination: Search(category: category)) {
Text("Search")
.padding(10)
GeometryReader { geometry in
VStack {
NavigationView {
List {
ForEach(categories) { category in
NavigationLink(destination: Add(category: category)) {
Text("Add")
.padding(10)
}

NavigationLink(destination: Log(category: category)) {
Text("View")
.padding(10)
}

NavigationLink(destination: Search(category: category)) {
Text("Search")
.padding(10)
}
}
}
}.listStyle(SidebarListStyle())
.listStyle(SidebarListStyle())
.padding(.top)
.frame(minWidth: 300, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
}
.navigationViewStyle(DoubleColumnNavigationViewStyle())
.frame(width: geometry.size.width, height: geometry.size.height)
}
.navigationViewStyle(DoubleColumnNavigationViewStyle())
}
}

Expand Down
12 changes: 8 additions & 4 deletions DLPrototype/Views/Log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ struct Log: View {

var body: some View {
VStack(alignment: .leading) {
Text("\(category.title).log")
.font(.title)
HStack {
Text(Image(systemName: "doc.fill"))
.font(.title)
Text("\(category.title).log")
.font(.title)
}

Spacer()
Divider()

ScrollView {
Text(readFile())
}

Spacer()
}
.frame(width: 700, height: 700)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.padding()
}

Expand Down
23 changes: 19 additions & 4 deletions DLPrototype/Views/Search.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,48 @@ struct Search: View {

var body: some View {
VStack(alignment: .leading) {
Text("Search \(category.title).log")
.font(.title)
HStack {
Text(Image(systemName: "magnifyingglass.circle.fill"))
.font(.title)
Text("Search \(category.title).log")
.font(.title)
}

Divider()

HStack {
// formerly in ComboBox
Picker("Date", selection: $selection) {
ForEach(dateList) { item in
Text(item.title).tag(item.tag)
Text(item.title)
.tag(item.tag)
.font(Font.system(size: 16, design: .default))
}
}
.frame(width: 200)
.font(Font.system(size: 16, design: .default))
.onAppear(perform: {
self.dateList = self.generateDateList()
})

TextField("Search terms", text: $searchText)
.font(Font.system(size: 16, design: .default))

Button("Search", action: {
self.$searchByDate.wrappedValue = self.dateList[self.$selection.wrappedValue].title

self.getFilteredLogRows()
})
.background(Color.accentColor)
.font(Font.system(size: 16, design: .default))
}

Divider()

ScrollView {
TextField("No results", text: $searchResults)
.disabled(true)
.font(Font.system(size: 16, design: .default))
}

Spacer()
Expand All @@ -64,7 +79,7 @@ struct Search: View {
pasteBoard.setString(data, forType: .string)
})
}
.frame(width: 700, height: 700)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.padding()
}

Expand Down

0 comments on commit d173b47

Please sign in to comment.