Skip to content

Commit

Permalink
Merge pull request #110 from blyscuit/feature/#29-selection-ui
Browse files Browse the repository at this point in the history
[#29] [iOS] [UI] As a user, I can see Survey Detail selection picker
  • Loading branch information
blyscuit authored Feb 2, 2023
2 parents d5c6f56 + 8e4a158 commit 0f3642e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 5 deletions.
4 changes: 4 additions & 0 deletions iosApp/Survey.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
09D09E01296E7BFD009F88AF /* ViewId+SurveyQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09D09DFE296E7BFD009F88AF /* ViewId+SurveyQuestion.swift */; };
09D09E05296E7CF9009F88AF /* SurveyQuestionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09D09E02296E7CF9009F88AF /* SurveyQuestionSpec.swift */; };
09D09E09296E7D55009F88AF /* SurveyQuestionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09D09E06296E7D55009F88AF /* SurveyQuestionScreen.swift */; };
09D09E0B296E837F009F88AF /* QuestionPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09D09E0A296E837F009F88AF /* QuestionPickerView.swift */; };
09E6ABF32951D105007F1EE3 /* KIF+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09E6ABF12951D103007F1EE3 /* KIF+Swift.swift */; };
09E6ABFD2951D32F007F1EE3 /* ViewId.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09636B1428D8148C00A5CB97 /* ViewId.swift */; };
09E6ABFE2951D333007F1EE3 /* ViewId+General.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09636B2F28D8267D00A5CB97 /* ViewId+General.swift */; };
Expand Down Expand Up @@ -315,6 +316,7 @@
09D09DFE296E7BFD009F88AF /* ViewId+SurveyQuestion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewId+SurveyQuestion.swift"; sourceTree = "<group>"; };
09D09E02296E7CF9009F88AF /* SurveyQuestionSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyQuestionSpec.swift; sourceTree = "<group>"; };
09D09E06296E7D55009F88AF /* SurveyQuestionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyQuestionScreen.swift; sourceTree = "<group>"; };
09D09E0A296E837F009F88AF /* QuestionPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionPickerView.swift; sourceTree = "<group>"; };
09E6ABE42951CF3E007F1EE3 /* SurveyKIFUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SurveyKIFUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
09E6ABF12951D103007F1EE3 /* KIF+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KIF+Swift.swift"; sourceTree = "<group>"; };
09E6AC0B2951D5DD007F1EE3 /* AccountSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSpec.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -897,6 +899,7 @@
isa = PBXGroup;
children = (
09D09DFC296E6B35009F88AF /* SurveyQuestionView.swift */,
09D09E0A296E837F009F88AF /* QuestionPickerView.swift */,
);
path = SurveyQuestion;
sourceTree = "<group>";
Expand Down Expand Up @@ -1921,6 +1924,7 @@
09495FCD291109450036BDFB /* CGFloat+Extensions.swift in Sources */,
09CE773328E2ED2300EAA9EE /* KoinApplication.swift in Sources */,
0982A7E329222EFF00FC1976 /* RouteCoordinator.swift in Sources */,
09D09E0B296E837F009F88AF /* QuestionPickerView.swift in Sources */,
09495F7828FFF2D50036BDFB /* ViewId+SurveySelection.swift in Sources */,
0964B1CC2940530200946FA1 /* UITestHelper.swift in Sources */,
09495F2A28EC43760036BDFB /* ViewId+SurveyLoading.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct SurveyDetailView: View {
.lineLimit(3)
.padding(.top, .mediumPadding)
.foregroundColor(.white)
.font(.boldLarge)
.font(.boldLargeTitle)
.accessibility(.surveyDetail(.titleText))
Text(survey.description_)
.lineLimit(.max)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// QuestionPickerView.swift
// Survey
//
// Created by Bliss on 11/1/23.
// Copyright © 2023 Nimble. All rights reserved.
//

import SwiftUI

struct QuestionPickerView: View {

@State private var selectedInput = ""

let ids: [String]

var body: some View {
Picker(String(describing: Self.self), selection: $selectedInput) {
ForEach(ids, id: \.self) { id in
let font = selectedInput == id ? Font.boldLarge : Font.regularLarge
Text(id)
.font(font)
.foregroundColor(Color.white)
if id != ids.last {
Divider()
.overlay(Color.white)
.frame(width: 215.0, height: 1.0)
}
}
}
.pickerStyle(.wheel)
.padding(20.0)
.onChange(of: selectedInput) {
print($0)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ struct SurveyQuestionView: View {
.padding(.top, .largePadding)
.accessibility(.surveyQuestion(.detailText))
Text("How are you?")
.font(.boldLarge)
.font(.boldLargeTitle)
.foregroundColor(.white)
.padding(.top, .tinyPadding)
.accessibility(.surveyQuestion(.titleText))
Spacer()
QuestionPickerView(ids: ["A", "B", "C"])
Spacer()
}
.frame(maxWidth: .infinity, alignment: .leading)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct AccountView: View {
var profileSection: some View {
HStack(alignment: .firstTextBaseline) {
Text((account?.name).string)
.font(.boldLarge)
.font(.boldLargeTitle)
.lineLimit(1)
.accessibility(.account(.profileText))
Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct SurveyHeaderView: View {
.accessibility(.surveySelection(.headerDateText))
HStack {
Text(surveyHeader.todayText())
.font(.boldLarge)
.font(.boldLargeTitle)
.accessibility(.surveySelection(.headerTitleText))
Spacer()
Button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ extension Font {
/// Weight: 800, Size: 17.0
static let boldBody: Font = .neuzei(.bold)

/// Weight: 400, Size: 20.0
static let boldLarge: Font = .neuzei(.bold, size: 20.0)

/// Weight: 800, Size: 28.0
static let boldTitle: Font = .neuzei(.bold, size: 28.0)

/// Weight: 800, Size: 34.0
static let boldLarge: Font = .neuzei(.bold, size: 34.0)
static let boldLargeTitle: Font = .neuzei(.bold, size: 34.0)

private static func neuzei(_ weigth: Neuzei = .regular, size: CGFloat = 17.0) -> Font {
return Font.custom(weigth.name, size: size)
Expand Down

0 comments on commit 0f3642e

Please sign in to comment.