Skip to content

Commit

Permalink
Merge pull request #1161 from hyperskill/hotfix/1.68.1
Browse files Browse the repository at this point in the history
Hotfix 1.68.1
  • Loading branch information
ivan-magda authored Aug 21, 2024
2 parents cfc8353 + b7fb80a commit 0e90ef8
Show file tree
Hide file tree
Showing 13 changed files with 236 additions and 32 deletions.
4 changes: 2 additions & 2 deletions iosHyperskillApp/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleVersion</key>
<string>555</string>
<string>556</string>
<key>CFBundleShortVersionString</key>
<string>1.68</string>
<string>1.68.1</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleExecutable</key>
Expand Down
30 changes: 21 additions & 9 deletions iosHyperskillApp/iosHyperskillApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
2C45E7C52A0FEE7A00DFF32D /* StarRatingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C45E7C42A0FEE7A00DFF32D /* StarRatingView.swift */; };
2C4605B12ABD75FC003C17E9 /* View+ScrollBounceBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4605B02ABD75FC003C17E9 /* View+ScrollBounceBehavior.swift */; };
2C4623A12B999CAF002BDDBB /* PaywallHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4623A02B999CAF002BDDBB /* PaywallHostingController.swift */; };
2C4677952C75E7CA000EB2EE /* PulseEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4677942C75E7CA000EB2EE /* PulseEffect.swift */; };
2C46D0632807E4C100B3636E /* TextFieldWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C46D0622807E4C100B3636E /* TextFieldWrapper.swift */; };
2C48232B2AC172600047999B /* LaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C48232A2AC172600047999B /* LaunchTests.swift */; };
2C4823322AC1768A0047999B /* LaunchPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4823312AC1768A0047999B /* LaunchPerformanceTests.swift */; };
Expand Down Expand Up @@ -976,6 +977,7 @@
2C45E7C42A0FEE7A00DFF32D /* StarRatingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StarRatingView.swift; sourceTree = "<group>"; };
2C4605B02ABD75FC003C17E9 /* View+ScrollBounceBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+ScrollBounceBehavior.swift"; sourceTree = "<group>"; };
2C4623A02B999CAF002BDDBB /* PaywallHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaywallHostingController.swift; sourceTree = "<group>"; };
2C4677942C75E7CA000EB2EE /* PulseEffect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PulseEffect.swift; sourceTree = "<group>"; };
2C46D0622807E4C100B3636E /* TextFieldWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldWrapper.swift; sourceTree = "<group>"; };
2C4823262AC172600047999B /* iosHyperskillAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iosHyperskillAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2C48232A2AC172600047999B /* LaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2380,6 +2382,15 @@
path = Header;
sourceTree = "<group>";
};
2C4677962C75E7D7000EB2EE /* Effects */ = {
isa = PBXGroup;
children = (
2C4677942C75E7CA000EB2EE /* PulseEffect.swift */,
2CAF254B2AB9C2E500595582 /* ShineEffect.swift */,
);
path = Effects;
sourceTree = "<group>";
};
2C46D0612807E4A600B3636E /* Wrappers */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3533,13 +3544,13 @@
2C1B71042B6CB7D9003FD4A1 /* OffsetObservingScrollView.swift */,
E9C3506E2886D0600080D277 /* OpenURLInsideAppButton.swift */,
E9101712283296F3002E70F5 /* RadioButton.swift */,
2CAF254B2AB9C2E500595582 /* ShineEffect.swift */,
E996D41129221F6200A47498 /* ShowMoreButton.swift */,
2C45E7C42A0FEE7A00DFF32D /* StarRatingView.swift */,
2C8E66D8287896CF00D3928D /* TabNavigationLazyView.swift */,
2C58DE2A2803DEE2002A2774 /* VerticalCenteredScrollView.swift */,
2CC95C0C2A4EBB7D0036C73E /* Avatars */,
2C05AC5B2A0ED7480039C7EF /* BadgeView */,
2C4677962C75E7D7000EB2EE /* Effects */,
2C3E656E2A127E6100BC8DC0 /* Gradients */,
2CBC97CE2A555BD00078E445 /* Hypercoins */,
2CF87DA029B717E20092FF83 /* Introspect */,
Expand Down Expand Up @@ -5230,6 +5241,7 @@
2C67709B2AEBDF5200E832AC /* StepQuizFillBlanksSelectOptionsOutputProtocol.swift in Sources */,
2C198E032AEA869300DCD35A /* StepQuizFillBlanksSelectOptionsCollectionViewCell.swift in Sources */,
2C919E3527EEFF110022A2F2 /* Queue.swift in Sources */,
2C4677952C75E7CA000EB2EE /* PulseEffect.swift in Sources */,
2CC7833E295DAE3E00A867CD /* WelcomeFeatureStateKsExtensions.swift in Sources */,
2C45E7C52A0FEE7A00DFF32D /* StarRatingView.swift in Sources */,
2C9AA3F22C245C5700F5170E /* WelcomeQuestionnaireItemType+ImageResource.swift in Sources */,
Expand Down Expand Up @@ -5657,7 +5669,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
GENERATE_INFOPLIST_FILE = NO;
Expand All @@ -5678,7 +5690,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = iosHyperskillAppUITests/Info.plist;
Expand All @@ -5699,7 +5711,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = iosHyperskillAppTests/Info.plist;
Expand All @@ -5720,7 +5732,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = iosHyperskillAppTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -5741,7 +5753,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
Expand Down Expand Up @@ -5770,7 +5782,7 @@
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/NotificationServiceExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEVELOPMENT_TEAM = UJ4KC2QN7B;
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand Down Expand Up @@ -5916,7 +5928,7 @@
CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\"";
DEVELOPMENT_TEAM = UJ4KC2QN7B;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -5952,7 +5964,7 @@
CODE_SIGN_ENTITLEMENTS = iosHyperskillApp/iosHyperskillApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 555;
CURRENT_PROJECT_VERSION = 556;
DEVELOPMENT_ASSET_PATHS = "\"iosHyperskillApp/Preview Content\"";
DEVELOPMENT_TEAM = UJ4KC2QN7B;
ENABLE_PREVIEWS = YES;
Expand Down
4 changes: 2 additions & 2 deletions iosHyperskillApp/iosHyperskillApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.68</string>
<string>1.68.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>555</string>
<string>556</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>FirebaseMessagingAutoInitEnabled</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ struct StepQuizActionButton: View {
var systemImageNameForState: ((State) -> String?)?

let isShineEffectActive: Bool
let isPulseEffectActive: Bool

var onTap: () -> Void

Expand All @@ -18,11 +19,16 @@ struct StepQuizActionButton: View {
}

var body: some View {
let buttonStyle = RoundedRectangleButtonStyle(
style: state.style,
overlayImage: overlayImage
)

Button(
titleForState?(state) ?? state.title,
action: onTap
)
.buttonStyle(RoundedRectangleButtonStyle(style: state.style, overlayImage: overlayImage))
.buttonStyle(buttonStyle)
.overlay(
ProgressView()
.opacity(state.isLoading ? 1 : 0)
Expand All @@ -31,6 +37,11 @@ struct StepQuizActionButton: View {
alignment: .init(horizontal: .leading, vertical: .center)
)
.shineEffect(isActive: isShineEffectActive && !state.isDisabled)
.pulseEffect(
shape: RoundedRectangle(cornerRadius: buttonStyle.cornerRadius),
scaleAmount: .small,
isActive: isPulseEffectActive && !state.isDisabled
)
.disabled(state.isDisabled)
}

Expand Down Expand Up @@ -75,19 +86,26 @@ struct StepQuizActionButton: View {
}
}

#if DEBUG
struct StepQuizActionButton_Previews: PreviewProvider {
static var previews: some View {
Group {
VStack {
ForEach(StepQuizActionButton.State.allCases, id: \.self) { state in
StepQuizActionButton(state: state, isShineEffectActive: false, onTap: {})
StepQuizActionButton(
state: state,
isShineEffectActive: false,
isPulseEffectActive: false,
onTap: {}
)
}

StepQuizActionButton(
state: .normal,
titleForState: { _ in "Run solution" },
systemImageNameForState: { _ in "play" },
isShineEffectActive: true,
isPulseEffectActive: true,
onTap: {}
)
}
Expand All @@ -96,3 +114,4 @@ struct StepQuizActionButton_Previews: PreviewProvider {
.padding()
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct StepQuizActionButtons: View {
StepQuizActionButton(
state: continueButton.isLoading ? .correctLoading : .correct,
isShineEffectActive: false,
isPulseEffectActive: false,
onTap: continueButton.action
)
}
Expand All @@ -32,6 +33,7 @@ struct StepQuizActionButtons: View {
titleForState: primaryButton.titleForState,
systemImageNameForState: primaryButton.systemImageNameForState,
isShineEffectActive: primaryButton.isShineEffectActive,
isPulseEffectActive: primaryButton.isPulseEffectActive,
onTap: primaryButton.action
)
}
Expand All @@ -58,6 +60,7 @@ struct StepQuizActionButtons: View {
var systemImageNameForState: ((StepQuizActionButton.State) -> String?)?

var isShineEffectActive = false
var isPulseEffectActive = false

let action: () -> Void
}
Expand All @@ -69,16 +72,23 @@ extension StepQuizActionButtons {
static func submit(
state: StepQuizActionButton.State,
isShineEffectActive: Bool = false,
isPulseEffectActive: Bool = false,
action: @escaping () -> Void
) -> StepQuizActionButtons {
StepQuizActionButtons(
primaryButton: .init(state: state, isShineEffectActive: isShineEffectActive, action: action)
primaryButton: .init(
state: state,
isShineEffectActive: isShineEffectActive,
isPulseEffectActive: isPulseEffectActive,
action: action
)
)
}

static func runSolution(
state: StepQuizActionButton.State,
isShineEffectActive: Bool,
isPulseEffectActive: Bool,
action: @escaping () -> Void
) -> StepQuizActionButtons {
StepQuizActionButtons(
Expand All @@ -87,6 +97,7 @@ extension StepQuizActionButtons {
titleForState: StepQuizActionButtonCodeQuizDelegate.getTitle(for:),
systemImageNameForState: StepQuizActionButtonCodeQuizDelegate.getSystemImageName(for:),
isShineEffectActive: isShineEffectActive,
isPulseEffectActive: isPulseEffectActive,
action: action
)
)
Expand Down Expand Up @@ -143,9 +154,19 @@ extension StepQuizActionButtons {
struct StepQuizActionButtons_Previews: PreviewProvider {
static var previews: some View {
VStack {
StepQuizActionButtons.submit(state: .default, isShineEffectActive: false, action: {})
StepQuizActionButtons.submit(
state: .default,
isShineEffectActive: false,
isPulseEffectActive: false,
action: {}
)

StepQuizActionButtons.runSolution(state: .default, isShineEffectActive: true, action: {})
StepQuizActionButtons.runSolution(
state: .default,
isShineEffectActive: true,
isPulseEffectActive: true,
action: {}
)

StepQuizActionButtons.retry {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct StepQuizView: View {
@EnvironmentObject private var panModalPresenter: PanModalPresenter

@State private var scrollPosition: ScrollPosition?
@State private var isActionButtonShineEffectActive = false
@State private var isActionButtonAnimationEffectActive = false

var body: some View {
UIViewControllerEventsWrapper(
Expand Down Expand Up @@ -248,14 +248,16 @@ struct StepQuizView: View {
if quizType.isCodeRelated {
StepQuizActionButtons.runSolution(
state: .init(submissionStatus: submissionStatus),
isShineEffectActive: isActionButtonShineEffectActive,
isShineEffectActive: isActionButtonAnimationEffectActive,
isPulseEffectActive: isActionButtonAnimationEffectActive,
action: viewModel.doMainQuizAction
)
.disabled(!StepQuizResolver.shared.isQuizEnabled(state: attemptLoadedState))
} else {
StepQuizActionButtons.submit(
state: .init(submissionStatus: submissionStatus),
isShineEffectActive: isActionButtonShineEffectActive,
isShineEffectActive: isActionButtonAnimationEffectActive,
isPulseEffectActive: isActionButtonAnimationEffectActive,
action: viewModel.doMainQuizAction
)
.disabled(!StepQuizResolver.shared.isQuizEnabled(state: attemptLoadedState))
Expand Down Expand Up @@ -320,9 +322,9 @@ private extension StepQuizView {
"StepQuizView :: did receive unexpected StepQuizCodeBlanksViewAction: \(stepQuizCodeBlanksViewAction)"
)
case .highlightCallToActionButton:
isActionButtonShineEffectActive = true
isActionButtonAnimationEffectActive = true
case .unhighlightCallToActionButton:
isActionButtonShineEffectActive = false
isActionButtonAnimationEffectActive = false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extension StepQuizCodeBlanksOptionView {
static let insets = LayoutInsets(horizontal: 12, vertical: LayoutInsets.smallInset)
static let minWidth: CGFloat = 48
static let minHeight: CGFloat = 40
static let cornerRadius: CGFloat = 8
}
}

Expand All @@ -21,7 +22,8 @@ struct StepQuizCodeBlanksOptionView: View {
.frame(minWidth: Appearance.minWidth, minHeight: Appearance.minHeight)
.background(Color(ColorPalette.background))
.addBorder(
color: isActive ? StepQuizCodeBlanksAppearance.activeBorderColor : .border
color: isActive ? StepQuizCodeBlanksAppearance.activeBorderColor : .border,
cornerRadius: Appearance.cornerRadius
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI
struct StepQuizCodeBlanksSuggestionsView: View {
let suggestions: [Suggestion]

let isShineEffectActive: Bool
let isAnimationEffectActive: Bool

let onSuggestionTap: (Suggestion) -> Void

Expand All @@ -26,9 +26,15 @@ struct StepQuizCodeBlanksSuggestionsView: View {
isActive: true
)
.shineEffect(
isActive: isShineEffectActive,
isActive: isAnimationEffectActive,
foregroundColor: Color(ColorPalette.primary)
)
.pulseEffect(
shape: RoundedRectangle(
cornerRadius: StepQuizCodeBlanksOptionView.Appearance.cornerRadius
),
isActive: isAnimationEffectActive
)
}
)
.buttonStyle(BounceButtonStyle())
Expand All @@ -45,7 +51,7 @@ struct StepQuizCodeBlanksSuggestionsView: View {
suggestions: [
Suggestion.ConstantString(text: "Hello world")
],
isShineEffectActive: true,
isAnimationEffectActive: true,
onSuggestionTap: { _ in }
)
}
Expand Down
Loading

0 comments on commit 0e90ef8

Please sign in to comment.