Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget Education #1040

Merged
merged 28 commits into from
Feb 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
154beeb
Introduce AddWidgetView screen
jaceklyp Jan 14, 2022
1cdbb58
Add new copy
jaceklyp Jan 17, 2022
20783c2
Add Home Message Cell to the Home screen
jaceklyp Jan 24, 2022
ae746c3
Rename AddWidget to WidgetEducation
jaceklyp Jan 25, 2022
16b30b6
Fix theme issue affecting navigation bars and other system components…
jaceklyp Jan 25, 2022
99afb19
Remove unused copies
jaceklyp Jan 25, 2022
db65a0f
Open WidgetEducation in modal with navigation bar
jaceklyp Jan 25, 2022
f00313f
Add pixels
jaceklyp Jan 25, 2022
5114567
Make HomeMessageView compliant with iOS 14
jaceklyp Jan 25, 2022
6bcce3d
Remove unused code and empty lines
jaceklyp Jan 25, 2022
8b78a1b
Remove unsued code around the old home message
jaceklyp Jan 25, 2022
da5cff5
Remove todos, empty lines and warnings
jaceklyp Jan 25, 2022
c6a3f18
Turn literal into const
jaceklyp Jan 25, 2022
9d4f729
Add widget education as variant to the manager
jaceklyp Jan 26, 2022
8a8d944
Drop the suffix for WidgetEducationHomeMessageViewModel
jaceklyp Jan 26, 2022
36cf233
Pass the VariantManager to the Storage and change the logic when to d…
jaceklyp Jan 26, 2022
0b0f643
Fix issue for image not showing on WidgetEducationView
jaceklyp Jan 26, 2022
a54a406
Fix issue with image alignment
jaceklyp Jan 26, 2022
ec5f567
Do not show WidgetEducation feature in settings if it shouldn't be shown
jaceklyp Jan 26, 2022
49150f1
Do not show widget education if app has been open from widget
jaceklyp Jan 26, 2022
c7cf136
Merge branch 'develop' into feature/jacek/widgets-education
jaceklyp Jan 26, 2022
bbbae81
Design adjustments
jaceklyp Jan 28, 2022
1b4d7a1
Import translations
jaceklyp Jan 28, 2022
3f83c43
Fix tests
jaceklyp Jan 28, 2022
74be981
Merge branch 'develop' into feature/jacek/widgets-education
jaceklyp Jan 31, 2022
5ac220b
Use lets instead of vars
jaceklyp Feb 2, 2022
59fedfc
Stop allocating weight for voice search
jaceklyp Feb 2, 2022
e4b535a
Make the action closure the last thing so it can benefit from closure…
jaceklyp Feb 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make HomeMessageView compliant with iOS 14
  • Loading branch information
jaceklyp committed Jan 25, 2022
commit 511456714da62222ad5730b06cfcf08d7d263567
63 changes: 32 additions & 31 deletions DuckDuckGo/HomeMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,43 @@ struct HomeMessageView: View {
var viewModel: HomeMessageViewModel
jaceklyp marked this conversation as resolved.
Show resolved Hide resolved

var body: some View {
if #available(iOS 15.0, *) {
VStack(spacing: Const.Spacing.titleAndSubtitle) {
HStack(alignment: .top) {
Spacer()
VStack {
topText
image
title
}.offset(x: Const.Size.closeButtonWidth / 2, y: 0)
.layoutPriority(1)
Spacer()
closeButton
}

VStack(spacing: Const.Spacing.subtitleAndButtons) {
subtitle
HStack {
buttons
}
}
VStack(spacing: Const.Spacing.titleAndSubtitle) {
HStack(alignment: .top) {
Spacer()
VStack {
topText
image
title
}
.offset(x: Const.Size.closeButtonWidth / 2, y: 0)
.layoutPriority(1)
Spacer()
closeButton
}

VStack(spacing: Const.Spacing.subtitleAndButtons) {
subtitle
HStack {
buttons
}
.multilineTextAlignment(.center)
.padding()
.background(Color.background)
.background(in: RoundedRectangle(cornerRadius: Const.Radius.corner))
.clipped()
.shadow(color: Color.shadow, radius: Const.Radius.shadow, x: 0, y: Const.Offset.shadowVertical)
} else {
// Fallback on earlier versions
}
}
.multilineTextAlignment(.center)
.padding()
.background(RoundedRectangle(cornerRadius: Const.Radius.corner)
.fill(Color.background)
.shadow(color: Color.shadow,
radius: Const.Radius.shadow,
x: 0,
y: Const.Offset.shadowVertical))
}

private var closeButton: some View {
Button(action: { viewModel.onDidClose() }, label: { Image.dismiss })
.layoutPriority(2)
.offset(x: Const.Offset.closeButton, y: -Const.Offset.closeButton)
Button(action: { viewModel.onDidClose() },
label: { Image.dismiss })
.layoutPriority(2)
.offset(x: Const.Offset.closeButton,
y: -Const.Offset.closeButton)
}

private var topText: some View {
Expand Down