Skip to content

Commit

Permalink
Album Image View animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomMPheijffer committed Dec 4, 2018
1 parent 5f38a9b commit e8abef2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Shuffle Plus Play/Shuffle Plus Play.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.tyler.shuffleplayplus;
PRODUCT_BUNDLE_IDENTIFIER = com.thompheijffer.shuffleplayplus;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -388,7 +388,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.tyler.shuffleplayplus;
PRODUCT_BUNDLE_IDENTIFIER = com.thompheijffer.shuffleplayplus;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,14 @@ extension NowPlayingViewController {
createObservers()
sender.pulsate()
musicPlayer.play()

DispatchQueue.main.async {
UIView.animate(withDuration: 0.5) {
self.albumImageView.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
}
}


}

@objc func pauseButtonTapped(_ sender: UIButton) {
Expand All @@ -294,6 +302,14 @@ extension NowPlayingViewController {
setNowPlayingInfo()
sender.pulsate()
musicPlayer.pause()

DispatchQueue.main.async {
UIView.animate(withDuration: 0.5) {
self.albumImageView.transform = .identity
}
}


}

@objc func previousButtonTapped(_ sender: UIButton) {
Expand Down Expand Up @@ -395,19 +411,7 @@ extension NowPlayingViewController {

@objc func genreButtonTapped(_ notification: Notification) {
guard let genre = notification.userInfo?["genre"] as? String else { fatalError("Can't get the genre") }
print("")
print("")
print("")
print("")
print("")
print("")
print(genre)
print("")
print("")
print("")
print("")
print("")
print("")

DispatchQueue.global().async {
MPMediaLibrary.requestAuthorization { (status) in
if status == .authorized{
Expand All @@ -420,6 +424,14 @@ extension NowPlayingViewController {

setNowPlayingInfo()

DispatchQueue.main.async {
self.animateTransitionIfNeeded(state: self.nextState, duration: 1.5)
UIView.animate(withDuration: 0.5) {
self.albumImageView.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
}
}


}

func playGenre(genre: String) {
Expand Down

0 comments on commit e8abef2

Please sign in to comment.