Merge remote-tracking branch 'refs/remotes/origin/woka_dev'
Conflicts: WOKA/Authentication/Base.lproj/AuthenticationSB.storyboard
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -43,6 +43,7 @@ class UserDetailsRegisterVC : UIViewController{
|
||||
if self.isMovingFromParent {
|
||||
// Back button was pressed
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
self.navigationController?.popToViewController(of: EmailVC.self, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ let appDelegate = UIApplication.shared.delegate as! AppDelegate
|
||||
|
||||
@main
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
var window: UIWindow?
|
||||
var deviceOrientation = UIInterfaceOrientationMask.portrait
|
||||
|
||||
@@ -12,6 +12,7 @@ class ShopProductsVC: UIViewController {
|
||||
@IBOutlet weak var subCategoryCV: UICollectionView!
|
||||
@IBOutlet weak var productCV: UICollectionView!
|
||||
@IBOutlet weak var spinnerView: UIActivityIndicatorView!
|
||||
@IBOutlet weak var noDataStack: UIStackView!
|
||||
|
||||
var vm = ShopProductsVM()
|
||||
|
||||
@@ -53,6 +54,9 @@ class ShopProductsVC: UIViewController {
|
||||
self.navigationController?.setColor(color: .black)
|
||||
}
|
||||
|
||||
@IBAction func retryBtnTapped(_ sender: UIButton) {
|
||||
vm.getCategory()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - CollectionView Delegate
|
||||
|
||||
@@ -142,6 +142,32 @@
|
||||
</collectionViewFlowLayout>
|
||||
<cells/>
|
||||
</collectionView>
|
||||
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="fZ1-nH-ZAg">
|
||||
<rect key="frame" x="113.66666666666669" y="318" width="166" height="241"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SupportGirlImage" translatesAutoresizingMaskIntoConstraints="NO" id="Ri6-KR-VYL">
|
||||
<rect key="frame" x="0.0" y="0.0" width="166" height="166"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Data Found!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mTY-wM-gmw" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="176" width="166" height="24"/>
|
||||
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
|
||||
<color key="textColor" name="TextDarkBlue"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a9p-0d-Xbb">
|
||||
<rect key="frame" x="0.0" y="210" width="166" height="31"/>
|
||||
<color key="tintColor" name="TextDarkBlue"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="plain" title="Retry?">
|
||||
<fontDescription key="titleFontDescription" name="Exo2-Bold" family="Exo 2" pointSize="14"/>
|
||||
</buttonConfiguration>
|
||||
<connections>
|
||||
<action selector="retryBtnTapped:" destination="kU5-IV-9fW" eventType="touchUpInside" id="66A-Oc-nwA"/>
|
||||
<action selector="retryBtnTapped:" destination="50W-Kn-pPe" eventType="touchUpInside" id="Sfk-Hg-Axg"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="EEU-2F-lPA"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
@@ -149,6 +175,7 @@
|
||||
<constraint firstItem="03T-HE-97c" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="CpK-v3-Qcu"/>
|
||||
<constraint firstItem="Q7V-p9-fqq" firstAttribute="top" secondItem="qrc-nF-3bM" secondAttribute="bottom" id="HWr-qX-XVw"/>
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="bottom" secondItem="Q7V-p9-fqq" secondAttribute="bottom" id="PNe-VO-dMU"/>
|
||||
<constraint firstItem="fZ1-nH-ZAg" firstAttribute="centerY" secondItem="EEU-2F-lPA" secondAttribute="centerY" id="Sel-0y-Uha"/>
|
||||
<constraint firstItem="Fdg-SY-oNd" firstAttribute="top" secondItem="EEU-2F-lPA" secondAttribute="top" id="SpN-9a-czs"/>
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="Fdg-SY-oNd" secondAttribute="trailing" id="W91-7B-A8x"/>
|
||||
<constraint firstItem="Q7V-p9-fqq" firstAttribute="centerX" secondItem="EEU-2F-lPA" secondAttribute="centerX" id="dxD-a5-NbF"/>
|
||||
@@ -158,6 +185,7 @@
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="qrc-nF-3bM" secondAttribute="trailing" id="jAR-uY-cKV"/>
|
||||
<constraint firstItem="qrc-nF-3bM" firstAttribute="top" secondItem="ibd-Ky-5QZ" secondAttribute="bottom" constant="15" id="jFK-oJ-8HO"/>
|
||||
<constraint firstItem="Fdg-SY-oNd" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="q1i-Vc-6Pq"/>
|
||||
<constraint firstItem="fZ1-nH-ZAg" firstAttribute="centerX" secondItem="EEU-2F-lPA" secondAttribute="centerX" id="ss4-2Y-yT0"/>
|
||||
<constraint firstItem="03T-HE-97c" firstAttribute="trailing" secondItem="EEU-2F-lPA" secondAttribute="trailing" id="ttW-dy-Pb4"/>
|
||||
<constraint firstItem="EEU-2F-lPA" firstAttribute="trailing" secondItem="ibd-Ky-5QZ" secondAttribute="trailing" id="uiq-HX-kWV"/>
|
||||
<constraint firstItem="qrc-nF-3bM" firstAttribute="leading" secondItem="EEU-2F-lPA" secondAttribute="leading" id="uux-x1-sEU"/>
|
||||
@@ -165,6 +193,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="noDataStack" destination="fZ1-nH-ZAg" id="f96-BI-pgI"/>
|
||||
<outlet property="productCV" destination="qrc-nF-3bM" id="0dx-wj-O2z"/>
|
||||
<outlet property="spinnerView" destination="Q7V-p9-fqq" id="34Z-yw-ohr"/>
|
||||
<outlet property="subCategoryCV" destination="ibd-Ky-5QZ" id="0j8-y0-HeP"/>
|
||||
|
||||
@@ -78,14 +78,14 @@ class ShopProductsVM{
|
||||
Error
|
||||
*/
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: data.message ?? K.ConstantString.unRecognised, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getCategory()
|
||||
}
|
||||
}
|
||||
self.vc.toast(msg: data.message ?? K.ConstantString.unRecognised, time: 1.5)
|
||||
self.vc.noDataStack.isHidden = false
|
||||
case 1:
|
||||
Utilities.dismissProgressHUD()
|
||||
guard let data = data.data?.result else{return}
|
||||
guard let data = data.data?.result else{
|
||||
self.vc.noDataStack.isHidden = false
|
||||
return
|
||||
}
|
||||
self.subCategoryData.append(ShopSubCategoryDM.ResultData(id: -1, categoryMasterID: 0, subCategoryName: " All ", subCategoryThumbnail: ""))
|
||||
self.subCategoryData.append(contentsOf: data)
|
||||
self.selectedSubCategory = -1
|
||||
@@ -94,6 +94,7 @@ class ShopProductsVM{
|
||||
Utilities.startProgressHUD()
|
||||
self.getShopProducts(subCategoryID: subCatID)
|
||||
}
|
||||
self.vc.noDataStack.isHidden = true
|
||||
default:
|
||||
Utilities.dismissProgressHUD()
|
||||
break
|
||||
@@ -104,11 +105,8 @@ class ShopProductsVM{
|
||||
return
|
||||
}
|
||||
Utilities.dismissProgressHUD()
|
||||
Utilities.alertWithBtnCompletion(title: "Error", msgBody: error.localizedDescription, okBtnStr: "Retry?", vc: self.vc) { isDone in
|
||||
if isDone{
|
||||
self.getCategory()
|
||||
}
|
||||
}
|
||||
self.vc.toast(msg: error.localizedDescription, time: 1.5)
|
||||
self.vc.noDataStack.isHidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,17 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate{
|
||||
override var shouldAutorotate: Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
override var prefersStatusBarHidden: Bool {
|
||||
if #available(iOS 16.0, *) {
|
||||
// Code for iOS 16.0 and above
|
||||
return false
|
||||
} else {
|
||||
// Fallback code for earlier iOS versions
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
@@ -45,25 +56,32 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate{
|
||||
self.delegate = self
|
||||
vm.vc = self
|
||||
vm.initView()
|
||||
// rotateView(to: .pi / 2) // Example: 90 degrees rotation
|
||||
//bring back button to the front
|
||||
self.view.bringSubviewToFront(backButton)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||
}
|
||||
|
||||
// func rotateView(to angle: CGFloat) {
|
||||
// // Apply rotation to the view's transform
|
||||
// view.transform = CGAffineTransform(rotationAngle: angle)
|
||||
// }
|
||||
|
||||
// for ios 15 and below
|
||||
func rotateView(to angle: CGFloat) {
|
||||
// Apply rotation to the view's transform
|
||||
view.transform = CGAffineTransform(rotationAngle: angle)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
appDelegate.deviceOrientation = .landscapeRight
|
||||
let value = UIInterfaceOrientation.landscapeRight.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
|
||||
if #available(iOS 16.0, *) {
|
||||
// Code for iOS 15.0 and above
|
||||
print("Running on iOS 15.0 or later")
|
||||
appDelegate.deviceOrientation = .landscapeRight
|
||||
let value = UIInterfaceOrientation.landscapeRight.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
} else {
|
||||
// Fallback code for earlier iOS versions
|
||||
rotateView(to: .pi / 2) // Example: 90 degrees rotation
|
||||
print("Running on a version earlier than iOS 15.0")
|
||||
}
|
||||
|
||||
//Disable Picture in Picture
|
||||
playerView.allowsPictureInPicturePlayback = false
|
||||
@@ -388,11 +406,19 @@ extension PlayerVC {
|
||||
|
||||
func playerViewControllerDidDismissFullScreen(_ controller: JWPlayerViewController) {
|
||||
print("playerViewControllerDidDismissFullScreen")
|
||||
appDelegate.deviceOrientation = .portrait
|
||||
vm.updateClicks()
|
||||
let value = UIInterfaceOrientation.portrait.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
|
||||
if #available(iOS 16.0, *) {
|
||||
// Code for iOS 16.0 and above
|
||||
appDelegate.deviceOrientation = .portrait
|
||||
let value = UIInterfaceOrientation.portrait.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
} else {
|
||||
// Fallback code for earlier iOS versions
|
||||
self.dismiss(animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ class ThemeOneVC: UIViewController {
|
||||
// PersistentStorage.shared.deleteData()
|
||||
// PersistentStorage.shared.retrieveData()
|
||||
vm.setupAvPlayer()
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
@@ -101,9 +100,13 @@ class ThemeOneVC: UIViewController {
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
vm.shouldAnimate = true
|
||||
K.GVar.topView = .theme1
|
||||
vm.moveLiveTVView()
|
||||
|
||||
vm.shouldAnimate = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
|
||||
guard let self else{return}
|
||||
vm.moveLiveTVView()
|
||||
}
|
||||
if let player = vm.avPlayer{
|
||||
player.play()
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ class UserNotificationVC: UIViewController {
|
||||
|
||||
@IBAction func retryBtnTapped(_ sender: UIButton) {
|
||||
PersistentStorage.shared.addOthersCount()
|
||||
Utilities.startProgressHUD()
|
||||
vm.getUserNotification()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,12 +117,19 @@ class PlayerVM{
|
||||
if vc.contentType == .liveStream{
|
||||
self.vc.dismissTapped?()
|
||||
}
|
||||
appDelegate.deviceOrientation = .portrait
|
||||
updateClicks()
|
||||
|
||||
if #available(iOS 16.0, *) {
|
||||
// Code for iOS 15.0 and above
|
||||
appDelegate.deviceOrientation = .portrait
|
||||
let value = UIInterfaceOrientation.portrait.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
} else {
|
||||
// Fallback code for earlier iOS versions
|
||||
self.vc.dismiss(animated: true)
|
||||
}
|
||||
|
||||
let value = UIInterfaceOrientation.portrait.rawValue
|
||||
UIDevice.current.setValue(value, forKey: "orientation")
|
||||
UIViewController.attemptRotationToDeviceOrientation()
|
||||
}
|
||||
|
||||
func updateClicks(){
|
||||
|
||||
@@ -338,12 +338,15 @@ class ThemeOneVM{
|
||||
}
|
||||
|
||||
func moveLiveTVView() {
|
||||
|
||||
guard shouldAnimate else {
|
||||
self.centerLiveTVViewHorizontally()
|
||||
return
|
||||
} // Stop animating if shouldAnimate is false
|
||||
}
|
||||
|
||||
// Stop animating if shouldAnimate is false
|
||||
guard let vc = self.vc else { return } // Ensure the view controller is available
|
||||
UIView.animate(withDuration: 6, delay: 0, options: [.allowUserInteraction], animations: { [weak self] in
|
||||
UIView.animate(withDuration: 8, delay: 0, options: [.allowUserInteraction], animations: { [weak self] in
|
||||
guard let self = self else { return }
|
||||
let margin: CGFloat = 30
|
||||
let screenWidth = vc.view.frame.width
|
||||
@@ -473,12 +476,14 @@ class ThemeOneVM{
|
||||
}
|
||||
|
||||
func tapped(){
|
||||
Timer.scheduledTimer(withTimeInterval: 0.2, repeats: false) { _ in
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in
|
||||
guard let self else{return}
|
||||
isMovingRight = false
|
||||
self.avPlayer.play()
|
||||
self.moveLiveTVView()
|
||||
self.vc.liveTvPlayer.layoutIfNeeded()
|
||||
}
|
||||
print("Sadasd")
|
||||
print("Player Will Exit")
|
||||
}
|
||||
|
||||
func startLiveStream(){
|
||||
|
||||
Reference in New Issue
Block a user