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

Feature/#30 swipe to right refactor #32

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ final class SwipeRightToStopNoticeView: UIView {
return lottieView
}()

private lazy var tapAnimationView: LottieAnimationView = {
let lottieView = LottieAnimationView(name: Constant.LottieAnimationName.tap)
lottieView.loopMode = .playOnce
lottieView.isHidden = true
return lottieView
}()

private lazy var cellImageView: UIImageView = {
let imageView = UIImageView(image: UIImage(named: Constant.AssetImageName.swipeCellRightToStop))
imageView.contentMode = .scaleAspectFit
Expand Down Expand Up @@ -62,13 +55,10 @@ final class SwipeRightToStopNoticeView: UIView {
extension SwipeRightToStopNoticeView {
func playAnimation() {
swipeAnimationView.play { [weak self] _ in
self?.tapAnimationView.isHidden = false
self?.tapAnimationView.play { _ in
UIView.animate(withDuration: 0.75) {
self?.alpha = .zero
} completion: { _ in
self?.isHidden = true
}
UIView.animate(withDuration: 0.75) {
self?.alpha = .zero
} completion: { _ in
self?.isHidden = true
}
}
}
Expand All @@ -90,7 +80,6 @@ private extension SwipeRightToStopNoticeView {
addSubview(backgroundView)
addSubview(cellImageView)
addSubview(swipeAnimationView)
addSubview(tapAnimationView)
addSubview(noticeLabel)

backgroundView.translatesAutoresizingMaskIntoConstraints = false
Expand All @@ -111,12 +100,6 @@ private extension SwipeRightToStopNoticeView {
swipeAnimationView.centerXAnchor.constraint(equalTo: centerXAnchor, constant: 20).isActive = true
swipeAnimationView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: 40).isActive = true

tapAnimationView.translatesAutoresizingMaskIntoConstraints = false
tapAnimationView.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.3).isActive = true
tapAnimationView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.3).isActive = true
tapAnimationView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 10).isActive = true
tapAnimationView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: 20).isActive = true

noticeLabel.translatesAutoresizingMaskIntoConstraints = false
noticeLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
noticeLabel.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class TimerTableViewDelegate: NSObject, UITableViewDelegate {
resetAction.backgroundColor = .systemBackground

let config = UISwipeActionsConfiguration(actions: [resetAction])
config.performsFirstActionWithFullSwipe = false
config.performsFirstActionWithFullSwipe = true
return config
}

Expand Down
1 change: 0 additions & 1 deletion Multimer/Multimer/Presentation/Support/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ enum Constant {

enum LottieAnimationName {
static let swipeRightToStopTimer = "swipe-right-to-stop-timer"
static let tap = "tap"
}

enum UserDefaultsKey {
Expand Down