Skip to content

Commit

Permalink
feature: Native symbol animations (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
onl1ner authored Apr 21, 2024
1 parent d0c7f61 commit a3e2da5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 48 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ jobs:
env:
CODESIGN_ID: ${{ secrets.CODESIGN_ID }}
run: |
codesign -s "$CODESIGN_ID" -f --timestamp -o runtime "$RUNNER_TEMP/mupl.xcarchive/Products/Applications/mupl.app/Contents/Frameworks/Lottie.framework"
codesign -s "$CODESIGN_ID" -f --timestamp -o runtime "$RUNNER_TEMP/mupl.xcarchive/Products/Applications/mupl.app"
codesign -s "$CODESIGN_ID" -f --strict --timestamp -o runtime "$RUNNER_TEMP/mupl.xcarchive/Products/Applications/mupl.app"
- name: Create DMG
env:
Expand Down
29 changes: 0 additions & 29 deletions mupl.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
082683ED2B84B1B3007108E9 /* ShuffleMode + Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082683EC2B84B1B3007108E9 /* ShuffleMode + Toggle.swift */; };
082683EF2B84B1FA007108E9 /* RepeatMode + Next.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082683EE2B84B1FA007108E9 /* RepeatMode + Next.swift */; };
082683F32B872C9D007108E9 /* MusicPlayerAudio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082683F22B872C9D007108E9 /* MusicPlayerAudio.swift */; };
082683F62B8796D6007108E9 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 082683F52B8796D6007108E9 /* Lottie */; };
082683FC2B87985E007108E9 /* soundwave.json in Resources */ = {isa = PBXBuildFile; fileRef = 082683FB2B87985E007108E9 /* soundwave.json */; };
08415CCC2B321B4100764CD6 /* Sidebar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08415CCB2B321B4100764CD6 /* Sidebar.swift */; };
08415CD02B321C9800764CD6 /* CGFloat + LayoutSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08415CCF2B321C9800764CD6 /* CGFloat + LayoutSize.swift */; };
08415CD42B32225600764CD6 /* SidebarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08415CD32B32225600764CD6 /* SidebarItem.swift */; };
Expand Down Expand Up @@ -133,7 +131,6 @@
082683EC2B84B1B3007108E9 /* ShuffleMode + Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ShuffleMode + Toggle.swift"; sourceTree = "<group>"; };
082683EE2B84B1FA007108E9 /* RepeatMode + Next.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RepeatMode + Next.swift"; sourceTree = "<group>"; };
082683F22B872C9D007108E9 /* MusicPlayerAudio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicPlayerAudio.swift; sourceTree = "<group>"; };
082683FB2B87985E007108E9 /* soundwave.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = soundwave.json; sourceTree = "<group>"; };
08415CCB2B321B4100764CD6 /* Sidebar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sidebar.swift; sourceTree = "<group>"; };
08415CCF2B321C9800764CD6 /* CGFloat + LayoutSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGFloat + LayoutSize.swift"; sourceTree = "<group>"; };
08415CD32B32225600764CD6 /* SidebarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarItem.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -255,7 +252,6 @@
buildActionMask = 2147483647;
files = (
0856A4F92B4B2F3D0073ACE7 /* SDWebImageSwiftUI in Frameworks */,
082683F62B8796D6007108E9 /* Lottie in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -288,14 +284,6 @@
path = MusicKit;
sourceTree = "<group>";
};
082683F72B8796DE007108E9 /* Animations */ = {
isa = PBXGroup;
children = (
082683FB2B87985E007108E9 /* soundwave.json */,
);
path = Animations;
sourceTree = "<group>";
};
08415CC62B321B1E00764CD6 /* Supporting Files */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -459,7 +447,6 @@
08B77F482B20F9D3004B6D8D /* Assets.xcassets */,
08B77F4D2B20F9D3004B6D8D /* mupl.entitlements */,
08F4232C2B45D29F005158F2 /* Mocks */,
082683F72B8796DE007108E9 /* Animations */,
08B77F4A2B20F9D3004B6D8D /* Preview Content */,
);
path = Resources;
Expand Down Expand Up @@ -1109,7 +1096,6 @@
name = mupl;
packageProductDependencies = (
0856A4F82B4B2F3D0073ACE7 /* SDWebImageSwiftUI */,
082683F52B8796D6007108E9 /* Lottie */,
);
productName = mupl;
productReference = 08B77F412B20F9D2004B6D8D /* mupl.app */;
Expand Down Expand Up @@ -1141,7 +1127,6 @@
mainGroup = 08B77F382B20F9D2004B6D8D;
packageReferences = (
0856A4F72B4B2F3D0073ACE7 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */,
082683F42B8796D6007108E9 /* XCRemoteSwiftPackageReference "lottie-spm" */,
);
productRefGroup = 08B77F422B20F9D2004B6D8D /* Products */;
projectDirPath = "";
Expand All @@ -1159,7 +1144,6 @@
files = (
08B77F4C2B20F9D3004B6D8D /* Preview Assets.xcassets in Resources */,
08F423342B45D885005158F2 /* network-mock-example-list.json in Resources */,
082683FC2B87985E007108E9 /* soundwave.json in Resources */,
08B77F492B20F9D3004B6D8D /* Assets.xcassets in Resources */,
08F423302B45D2DB005158F2 /* network-mock-example-object.json in Resources */,
);
Expand Down Expand Up @@ -1497,14 +1481,6 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
082683F42B8796D6007108E9 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/airbnb/lottie-spm";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.4.1;
};
};
0856A4F72B4B2F3D0073ACE7 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SDWebImage/SDWebImageSwiftUI.git";
Expand All @@ -1516,11 +1492,6 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
082683F52B8796D6007108E9 /* Lottie */ = {
isa = XCSwiftPackageProductDependency;
package = 082683F42B8796D6007108E9 /* XCRemoteSwiftPackageReference "lottie-spm" */;
productName = Lottie;
};
0856A4F82B4B2F3D0073ACE7 /* SDWebImageSwiftUI */ = {
isa = XCSwiftPackageProductDependency;
package = 0856A4F72B4B2F3D0073ACE7 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ struct GroupedSongItemStyle: SongItemStyle {
.foregroundStyle(Color.pinkAccent)
} else {
if context.isCurrent {
LottieView(animation: .named("soundwave"))
.playbackMode(
context.isCurrentlyPlaying ? .playing(.fromProgress(0.0, toProgress: 1.0, loopMode: .loop)) : .paused(at: .progress(0.0))
Image(systemName: "waveform")
.font(.system(size: 14.0))
.foregroundStyle(Color.pinkAccent)
.symbolEffect(
.variableColor.iterative.dimInactiveLayers,
options: .repeating,
isActive: context.isCurrentlyPlaying
)
.animationSpeed(0.5)
} else {
Text("\(self.position)")
.foregroundStyle(Color.secondaryText)
Expand Down
12 changes: 7 additions & 5 deletions mupl/Common/Components/SongItem/Styles/PlainSongItemStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import SwiftUI
import MusicKit
import Lottie

struct PlainSongItemStyle: SongItemStyle {
func content(for song: Song, context: SongItemContext) -> some View {
Expand All @@ -32,11 +31,14 @@ struct PlainSongItemStyle: SongItemStyle {
Color.black
.opacity(0.4)

LottieView(animation: .named("soundwave"))
.playbackMode(
context.isCurrentlyPlaying ? .playing(.fromProgress(0.0, toProgress: 1.0, loopMode: .loop)) : .paused(at: .progress(0.0))
Image(systemName: "waveform")
.font(.system(size: 14.0))
.foregroundStyle(Color.white)
.symbolEffect(
.variableColor.iterative.dimInactiveLayers,
options: .repeating,
isActive: context.isCurrentlyPlaying
)
.frame(width: 16.0, height: 16.0)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion mupl/Supporting Files/Resources/Animations/soundwave.json

This file was deleted.

8 changes: 1 addition & 7 deletions mupl/Supporting Files/Resources/mupl.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<false/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>

0 comments on commit a3e2da5

Please sign in to comment.