Skip to content

Commit

Permalink
🧪 Research: empty state
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Friese <[email protected]>
  • Loading branch information
peterfriese committed Nov 12, 2021
1 parent 0dd0b72 commit cd6bb7b
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 2 deletions.
34 changes: 34 additions & 0 deletions code/frontend/MakeItSo/MakeItSo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

/* Begin PBXBuildFile section */
881EF5BD272DC399004761E5 /* View+Focus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881EF5BC272DC399004761E5 /* View+Focus.swift */; };
887B6FAB273ED4180028263D /* ContentView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B6FA8273ED4180028263D /* ContentView2.swift */; };
887B6FAC273ED4180028263D /* ContentView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B6FA8273ED4180028263D /* ContentView2.swift */; };
887B6FAD273ED4180028263D /* EmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B6FA9273ED4180028263D /* EmptyStateView.swift */; };
887B6FAE273ED4180028263D /* EmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B6FA9273ED4180028263D /* EmptyStateView.swift */; };
887B6FAF273ED4180028263D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B6FAA273ED4180028263D /* ContentView.swift */; };
887B6FB0273ED4180028263D /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887B6FAA273ED4180028263D /* ContentView.swift */; };
88FEECDA27275ABD00ED368C /* MakeItSoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88FEECCA27275ABC00ED368C /* MakeItSoApp.swift */; };
88FEECDB27275ABD00ED368C /* MakeItSoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88FEECCA27275ABC00ED368C /* MakeItSoApp.swift */; };
88FEECDE27275ABD00ED368C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 88FEECCC27275ABD00ED368C /* Assets.xcassets */; };
Expand All @@ -24,6 +30,9 @@

/* Begin PBXFileReference section */
881EF5BC272DC399004761E5 /* View+Focus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Focus.swift"; sourceTree = "<group>"; };
887B6FA8273ED4180028263D /* ContentView2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView2.swift; sourceTree = "<group>"; };
887B6FA9273ED4180028263D /* EmptyStateView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmptyStateView.swift; sourceTree = "<group>"; };
887B6FAA273ED4180028263D /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
88FEECCA27275ABC00ED368C /* MakeItSoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MakeItSoApp.swift; sourceTree = "<group>"; };
88FEECCC27275ABD00ED368C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
88FEECD127275ABD00ED368C /* MakeItSo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MakeItSo.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -61,6 +70,24 @@
path = Extensions;
sourceTree = "<group>";
};
887B6FA6273ED4180028263D /* Common */ = {
isa = PBXGroup;
children = (
887B6FA7273ED4180028263D /* Views */,
);
path = Common;
sourceTree = "<group>";
};
887B6FA7273ED4180028263D /* Views */ = {
isa = PBXGroup;
children = (
887B6FA9273ED4180028263D /* EmptyStateView.swift */,
887B6FAA273ED4180028263D /* ContentView.swift */,
887B6FA8273ED4180028263D /* ContentView2.swift */,
);
path = Views;
sourceTree = "<group>";
};
88FEECC427275ABC00ED368C = {
isa = PBXGroup;
children = (
Expand All @@ -73,6 +100,7 @@
88FEECC927275ABC00ED368C /* Shared */ = {
isa = PBXGroup;
children = (
887B6FA6273ED4180028263D /* Common */,
881EF5BB272DC366004761E5 /* Extensions */,
88FEECEB2727FEC100ED368C /* Features */,
88FEECCA27275ABC00ED368C /* MakeItSoApp.swift */,
Expand Down Expand Up @@ -241,8 +269,11 @@
files = (
88FEECF02727FEFF00ED368C /* Task.swift in Sources */,
88FEECFA27280F3D00ED368C /* TaskListRowView.swift in Sources */,
887B6FAD273ED4180028263D /* EmptyStateView.swift in Sources */,
88FEECDA27275ABD00ED368C /* MakeItSoApp.swift in Sources */,
881EF5BD272DC399004761E5 /* View+Focus.swift in Sources */,
887B6FAF273ED4180028263D /* ContentView.swift in Sources */,
887B6FAB273ED4180028263D /* ContentView2.swift in Sources */,
88FEECF32728044100ED368C /* TasksListView.swift in Sources */,
88FEECF72728072D00ED368C /* TasksListViewModel.swift in Sources */,
);
Expand All @@ -254,9 +285,12 @@
files = (
88FEECF12727FEFF00ED368C /* Task.swift in Sources */,
88FEECFB27280F3D00ED368C /* TaskListRowView.swift in Sources */,
887B6FB0273ED4180028263D /* ContentView.swift in Sources */,
88FEECDB27275ABD00ED368C /* MakeItSoApp.swift in Sources */,
887B6FAC273ED4180028263D /* ContentView2.swift in Sources */,
88FEECF42728044100ED368C /* TasksListView.swift in Sources */,
88FEECF82728072D00ED368C /* TasksListViewModel.swift in Sources */,
887B6FAE273ED4180028263D /* EmptyStateView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "88FEECD027275ABD00ED368C"
BuildableName = "MakeItSo.app"
BlueprintName = "MakeItSo (iOS)"
ReferencedContainer = "container:MakeItSo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "88FEECD027275ABD00ED368C"
BuildableName = "MakeItSo.app"
BlueprintName = "MakeItSo (iOS)"
ReferencedContainer = "container:MakeItSo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "88FEECD027275ABD00ED368C"
BuildableName = "MakeItSo.app"
BlueprintName = "MakeItSo (iOS)"
ReferencedContainer = "container:MakeItSo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
39 changes: 39 additions & 0 deletions code/frontend/MakeItSo/Shared/Common/Views/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// DemoView01.swift
// MakeItSo (iOS)
//
// Created by Peter Friese on 12.11.21.
// Copyright © 2021 Google LLC. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http:https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI

struct ContentView: View {
@State var isEmpty = true
var body: some View {
VStack {
if isEmpty {
Text("Hello, World!")
} else {
EmptyView()
}
}
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
36 changes: 36 additions & 0 deletions code/frontend/MakeItSo/Shared/Common/Views/ContentView2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// ContentView2.swift
// MakeItSo (iOS)
//
// Created by Peter Friese on 12.11.21.
// Copyright © 2021 Google LLC. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http:https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI

struct ContentView2: View {
@State var isEmpty = true
var body: some View {
Text("Hello, World!")
.emptyState($isEmpty) {
Text("Sorry - no content available")
}
}
}

struct ContentView2_Previews: PreviewProvider {
static var previews: some View {
ContentView2()
}
}
Loading

0 comments on commit cd6bb7b

Please sign in to comment.