Add blurred background to info panel

This commit is contained in:
Stephen Byatt 2021-06-23 00:12:47 +10:00
parent a8aefd186f
commit 77e6777b91
6 changed files with 33 additions and 7 deletions

View File

@ -11,7 +11,7 @@ import SwiftUI
class AudioViewController: UIViewController {
var height : CGFloat = 400
var height : CGFloat = 420
override func viewDidLoad() {

View File

@ -18,16 +18,35 @@ class InfoTabBarViewController: UITabBarController, UIGestureRecognizerDelegate
var tabBarHeight : CGFloat = 0
// override func viewWillAppear(_ animated: Bool) {
// tabBar.standardAppearance.backgroundColor = .clear
// tabBar.standardAppearance.backgroundImage = UIImage()
// tabBar.standardAppearance.backgroundEffect = .none
// tabBar.barTintColor = .clear
// for view in tabBar.subviews {
// print(view.description)
//// if view.description.contains("_UIBarBackground") {
////
//// view.removeFromSuperview()
//// }
// }
//
// }
//
override func viewDidLoad() {
super.viewDidLoad()
mediaInfoController = MediaInfoViewController()
audioViewController = AudioViewController()
subtitleViewController = SubtitlesViewController()
viewControllers = [mediaInfoController!, audioViewController!, subtitleViewController!]
tabBarHeight = tabBar.frame.size.height
viewControllers = [mediaInfoController!, audioViewController!, subtitleViewController!]
tabBar.standardAppearance.backgroundColor = .clear
tabBar.standardAppearance.backgroundImage = UIImage()
tabBar.standardAppearance.backgroundEffect = .none
tabBar.barTintColor = .clear
}

View File

@ -109,7 +109,7 @@ struct MediaInfoView: View {
}
.padding(.leading, 350)
.padding(.trailing, 200)
.padding(.trailing, 125)
}
else {
EmptyView()

View File

@ -11,7 +11,7 @@ import SwiftUI
class SubtitlesViewController: UIViewController {
var height : CGFloat = 400
var height : CGFloat = 420
override func viewDidLoad() {

View File

@ -83,7 +83,6 @@
<containerView opaque="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lie-K8-LNT">
<rect key="frame" x="88" y="57" width="1744" height="635"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="backgroundColor" red="0.10195661340000001" green="0.1019650772" blue="0.1060298011" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<segue destination="odZ-Ww-zvF" kind="embed" identifier="infoView" id="i7y-hI-hVh"/>
</connections>

View File

@ -124,6 +124,14 @@ class VideoPlayerViewController: UIViewController, VideoPlayerSettingsDelegate,
infoViewContainer.center = infoPanelHiddenPoint
infoViewContainer.layer.cornerRadius = 40
let blurEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
blurEffectView.frame = infoViewContainer.bounds
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
blurEffectView.layer.cornerRadius = 40
blurEffectView.clipsToBounds = true
infoViewContainer.addSubview(blurEffectView)
infoViewContainer.sendSubviewToBack(blurEffectView)
transportBarView.layer.cornerRadius = CGFloat(5)
setupGestures()