Skip to content

Commit

Permalink
Better TabView + MusicPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Aug 9, 2020
1 parent 9e05aff commit 9f3fa8a
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 30 deletions.
8 changes: 4 additions & 4 deletions ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 080532020;
CURRENT_PROJECT_VERSION = 080612020;
DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\"";
DEVELOPMENT_TEAM = Z6P74P6T99;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1417,7 +1417,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 080532020;
CURRENT_PROJECT_VERSION = 080612020;
DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\"";
DEVELOPMENT_TEAM = Z6P74P6T99;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1449,7 +1449,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 080532020;
CURRENT_PROJECT_VERSION = 080612020;
DEVELOPMENT_TEAM = Z6P74P6T99;
INFOPLIST_FILE = Widgets/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand Down Expand Up @@ -1480,7 +1480,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 080532020;
CURRENT_PROJECT_VERSION = 080612020;
DEVELOPMENT_TEAM = Z6P74P6T99;
INFOPLIST_FILE = Widgets/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand Down
8 changes: 0 additions & 8 deletions ACHNBrowserUI/ACHNBrowserUI/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,5 @@ struct ACHelperApp: App {
in: UIBundle,
compatibleWith: nil)
UITableView.appearance().tableFooterView = UIView()

UITabBar.appearance().unselectedItemTintColor = UIColor(named: "TabLabel",
in: UIBundle,
compatibleWith: nil)
UITabBar.appearance().isTranslucent = true
UITabBar.appearance().barTintColor = UIColor(named: "ACTabBarTint",
in: UIBundle,
compatibleWith: nil)
}
}
1 change: 0 additions & 1 deletion ACHNBrowserUI/ACHNBrowserUI/views/home/TabbarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct TabbarView: View {
.tag(UIState.Tab.collection)

}
.accentColor(.white)

if viewModel.showPlayerView {
PlayerView()
Expand Down
14 changes: 13 additions & 1 deletion ACHNBrowserUI/ACHNBrowserUI/views/musicPlayer/PlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ import SwiftUI
import Backend
import UI

struct VisualEffectView: UIViewRepresentable {

var effect: UIVisualEffect?
func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView {
let view = UIVisualEffectView()
view.isUserInteractionEnabled = false
return view
}

func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { uiView.effect = effect }
}

struct PlayerView: View {
@EnvironmentObject private var playerManager: MusicPlayerManager
@EnvironmentObject private var items: Items
Expand Down Expand Up @@ -42,7 +54,7 @@ struct PlayerView: View {
}
}
.frame(height: playerMode.height())
.background(Color.acTabBarTint)
.background(VisualEffectView(effect: UIBlurEffect(style: .systemChromeMaterial)))
.padding(.bottom, 48)
.gesture(DragGesture()
.onEnded { value in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ struct PlayerViewExpanded: View {
}) {
Image(systemName: "chevron.compact.down")
.font(Font.title.weight(.bold))
.foregroundColor(.white)
.foregroundColor(.acText)
.matchedGeometryEffect(id: "chevron", in: namespace)
}
.padding(.top, 16)
.matchedGeometryEffect(id: "chevron", in: namespace)


HStack {
Expand Down Expand Up @@ -61,7 +61,7 @@ struct PlayerViewExpanded: View {
Text(name)
.font(.headline)
.fontWeight(.bold)
.foregroundColor(.white)
.foregroundColor(.acText)
.matchedGeometryEffect(id: name, in: namespace)
Text("K.K Slider")
.font(.headline)
Expand Down Expand Up @@ -107,8 +107,8 @@ struct PlayerViewExpanded: View {
Image(systemName: "backward.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.white)
.frame(width: playerButtonSize, height: playerButtonSize)
.foregroundColor(.acText)
}
.matchedGeometryEffect(id: "back", in: namespace)

Expand All @@ -118,8 +118,8 @@ struct PlayerViewExpanded: View {
Image(systemName: playerManager.isPlaying ? "pause.fill" : "play.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.white)
.frame(width: playerButtonSize, height: playerButtonSize)
.foregroundColor(.acText)
}
.matchedGeometryEffect(id: "play", in: namespace)

Expand All @@ -129,8 +129,8 @@ struct PlayerViewExpanded: View {
Image(systemName: "forward.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.white)
.frame(width: playerButtonSize, height: playerButtonSize)
.foregroundColor(.acText)
}
.matchedGeometryEffect(id: "next", in: namespace)

Expand All @@ -149,8 +149,8 @@ struct PlayerViewExpanded: View {
Image(systemName: "music.note.list")
.resizable()
.aspectRatio(contentMode: .fit)
.foregroundColor(.white)
.frame(width: playerButtonSize, height: playerButtonSize)
.foregroundColor(.acText)
}
.matchedGeometryEffect(id: "list", in: namespace)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ struct PlayerViewMusicList: View {
HStack {
ItemImage(path: item.finalImage, size: 50)
Text(item.localizedName)
.foregroundColor(.white)
.foregroundColor(.acText)
}
}

}.listRowBackground(Color.acTabBarTint)
}.listRowBackground(Color.acBackground)
}
.animation(.easeInOut)
.transition(.slide)
}.padding()
}
.padding()
.background(Color.acBackground)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct PlayerViewSmall: View {
Text(name)
.font(.headline)
.fontWeight(.bold)
.foregroundColor(.white)
.foregroundColor(.acText)
.matchedGeometryEffect(id: name, in: namespace)
} else {
ProgressView()
Expand All @@ -58,7 +58,7 @@ struct PlayerViewSmall: View {
}) {
Image(systemName: "backward.fill")
.imageScale(.large)
.foregroundColor(.white)
.foregroundColor(.acText)
}
.padding(.trailing, 8)
.matchedGeometryEffect(id: "back", in: namespace)
Expand All @@ -68,7 +68,7 @@ struct PlayerViewSmall: View {
}) {
Image(systemName: playerManager.isPlaying ? "pause.fill" : "play.fill")
.imageScale(.large)
.foregroundColor(.white)
.foregroundColor(.acText)
}
.padding(.trailing, 8)
.matchedGeometryEffect(id: "play", in: namespace)
Expand All @@ -78,7 +78,7 @@ struct PlayerViewSmall: View {
}) {
Image(systemName: "forward.fill")
.imageScale(.large)
.foregroundColor(.white)
.foregroundColor(.acText)
}
.padding(.trailing, 8)
.matchedGeometryEffect(id: "next", in: namespace)
Expand All @@ -90,7 +90,7 @@ struct PlayerViewSmall: View {
Image(systemName: "chevron.up")
.imageScale(.large)
.rotationEffect(.degrees(playerMode != .playerSmall ? -180 : 0))
.foregroundColor(.white)
.foregroundColor(.acText)
}
.padding(.trailing, 12)
.matchedGeometryEffect(id: "chevron", in: namespace)
Expand All @@ -104,7 +104,7 @@ struct PlayerViewSmall: View {
}) {
Image(systemName: "music.note.list")
.imageScale(.large)
.foregroundColor(.white)
.foregroundColor(.acText)
}
.padding(.trailing, 12)
.matchedGeometryEffect(id: "list", in: namespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ public class Items: ObservableObject {
}
}
}
objc_sync_enter(self.villagersLikeCache)
self.villagersLikeCache[villager] = results
objc_sync_exit(self.villagersLikeCache)
return resolve(.success(results))
}
}.eraseToAnyPublisher()
Expand Down
4 changes: 4 additions & 0 deletions ACHNBrowserUI/Packages/UI/Sources/UI/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ extension Color {
Color("ACBackground", bundle: Bundle.module)
}

public static var acDynamicForeground: Color {
Color("ACDynamicForeground", bundle: Bundle.module)
}

public static var acSecondaryBackground: Color {
Color("ACSecondaryBackground", bundle: Bundle.module)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

0 comments on commit 9f3fa8a

Please sign in to comment.