fixed audio books ad loading

This commit is contained in:
2024-10-15 15:25:48 +05:30
parent ba08ad1565
commit 4e9b23c093
5 changed files with 74 additions and 62 deletions

View File

@@ -17,7 +17,6 @@ class AudioBookHomeVM{
var headerData : ListenAudioListingDM.AudioDatum?
// var indexToLoad = 0
var pageNo = 0
var maxHeaderHeight = 0.0
@@ -37,8 +36,6 @@ class AudioBookHomeVM{
startShimmer()
setupCell()
getShowListing()
checkAds()
}
func checkAds(){
@@ -233,6 +230,8 @@ class AudioBookHomeVM{
}else{
self.vc.loadMoreBtn.isHidden = false
}
checkAds()
default:
break
}

View File

@@ -1076,7 +1076,7 @@
<rect key="frame" x="0.0" y="121" width="430" height="723"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="45l-57-MA3">
<rect key="frame" x="0.0" y="0.0" width="430" height="1385"/>
<rect key="frame" x="0.0" y="0.0" width="430" height="1381"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="vZT-j7-NyY">
<rect key="frame" x="0.0" y="10" width="430" height="261"/>
@@ -1212,38 +1212,32 @@
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<view key="backgroundView" hidden="YES" alpha="0.59999999999999998" contentMode="scaleToFill" id="ygH-wj-cLk">
<rect key="frame" x="0.0" y="0.0" width="430" height="230"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<cells/>
</collectionView>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="jE2-WP-tD4">
<rect key="frame" x="0.0" y="823" width="430" height="261"/>
<rect key="frame" x="0.0" y="823" width="430" height="257"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YGM-QR-sbm">
<rect key="frame" x="0.0" y="0.0" width="430" height="31"/>
<rect key="frame" x="0.0" y="0.0" width="430" height="27"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KARAOKE" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JBX-qP-uJM" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="0.0" width="410" height="31"/>
<rect key="frame" x="10" y="0.0" width="410" height="27"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MNq-YB-EUG" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="100" height="31"/>
<rect key="frame" x="0.0" y="0.0" width="100" height="27"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="bma-Om-NPP"/>
</constraints>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="12"/>
<color key="tintColor" name="ImageDarkBlue"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="VIEW ALL">
<fontDescription key="titleFontDescription" name="Exo2-Bold" family="Exo 2" pointSize="14"/>
</buttonConfiguration>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="VIEW ALL"/>
<connections>
<action selector="viewAllBtnTapped:" destination="55l-Gk-Npk" eventType="touchUpInside" id="pAS-gT-xTU"/>
</connections>
@@ -1252,7 +1246,7 @@
<edgeInsets key="layoutMargins" top="0.0" left="10" bottom="0.0" right="10"/>
</stackView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Grz-ok-w2U">
<rect key="frame" x="0.0" y="31" width="430" height="230"/>
<rect key="frame" x="0.0" y="27" width="430" height="230"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="230" id="cJI-sp-1u2"/>
@@ -1268,7 +1262,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Cgp-Ok-Imj">
<rect key="frame" x="0.0" y="1094" width="430" height="261"/>
<rect key="frame" x="0.0" y="1090" width="430" height="261"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="V6u-Uf-Yc7">
<rect key="frame" x="0.0" y="0.0" width="430" height="31"/>
@@ -1314,7 +1308,7 @@
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="F2F-sK-9oY">
<rect key="frame" x="0.0" y="1365" width="430" height="20"/>
<rect key="frame" x="0.0" y="1361" width="430" height="20"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="Jsj-FP-k6f"/>
@@ -1343,8 +1337,46 @@
<constraint firstAttribute="height" id="2WA-Xw-Yxf"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="n3b-MP-wOW">
<rect key="frame" x="0.0" y="126" width="430" height="708"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zVG-vD-Pa9" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="10" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5PD-9x-fXz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="246" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LMU-lo-nNz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="482" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<edgeInsets key="layoutMargins" top="10" left="15" bottom="10" right="15"/>
</stackView>
<view hidden="YES" alpha="0.5" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M51-ug-MsN">
<rect key="frame" x="0.0" y="116" width="430" height="733"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="Dau-7f-0vb" userLabel="GuestLoginStack">
<rect key="frame" x="20" y="346.66666666666669" width="390" height="214.66666666666669"/>
<rect key="frame" x="20" y="375.33333333333331" width="390" height="214.66666666666669"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="1Ae-HV-40N">
<rect key="frame" x="15" y="15" width="360" height="41"/>
@@ -1399,7 +1431,7 @@
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" alignment="center" spacing="40" translatesAutoresizingMaskIntoConstraints="NO" id="hzv-re-WXq">
<rect key="frame" x="15" y="144.66666666666663" width="360" height="50"/>
<rect key="frame" x="15" y="144.66666666666669" width="360" height="50"/>
<subviews>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gWo-Sn-XnS" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="110" y="0.0" width="140" height="50"/>
@@ -1440,71 +1472,41 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="n3b-MP-wOW">
<rect key="frame" x="0.0" y="126" width="430" height="708"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zVG-vD-Pa9" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="10" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5PD-9x-fXz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="246" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LMU-lo-nNz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="482" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<edgeInsets key="layoutMargins" top="10" left="15" bottom="10" right="15"/>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="fPD-rO-ZgU"/>
<color key="backgroundColor" red="0.82745098039215681" green="0.93725490196078431" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Dau-7f-0vb" firstAttribute="centerY" secondItem="fPD-rO-ZgU" secondAttribute="centerY" id="0rW-IM-pWT"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="a7Y-B6-f0Q" secondAttribute="trailing" constant="15" id="1TC-Nf-fdz"/>
<constraint firstItem="jbL-QO-JJl" firstAttribute="leading" secondItem="5ML-g4-686" secondAttribute="trailing" constant="15" id="5bI-AA-E64"/>
<constraint firstItem="Rrg-6L-VMo" firstAttribute="top" secondItem="n3b-MP-wOW" secondAttribute="bottom" constant="10" id="ACM-Nd-PMA"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="Rrg-6L-VMo" secondAttribute="trailing" id="CkS-3X-HNC"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="E1C-E8-97R"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="M51-ug-MsN" secondAttribute="bottom" id="FxG-pW-clx"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="trailing" secondItem="fPD-rO-ZgU" secondAttribute="trailing" id="I4g-uI-OU6"/>
<constraint firstItem="fTK-nk-bN9" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="KDZ-vt-s13"/>
<constraint firstItem="a7Y-B6-f0Q" firstAttribute="top" secondItem="fPD-rO-ZgU" secondAttribute="top" constant="10" id="L4o-KM-D1O"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="bottom" secondItem="a7Y-B6-f0Q" secondAttribute="bottom" constant="7" id="Lur-Ax-w8w"/>
<constraint firstItem="Dau-7f-0vb" firstAttribute="leading" secondItem="23B-pX-ODs" secondAttribute="leading" constant="20" id="M71-ET-eJZ"/>
<constraint firstItem="M51-ug-MsN" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" id="M90-cE-9uB"/>
<constraint firstItem="5ML-g4-686" firstAttribute="leading" secondItem="23B-pX-ODs" secondAttribute="leading" constant="5" id="Na5-Wr-DSa"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" constant="5" id="Pp9-XV-Tip"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="M51-ug-MsN" secondAttribute="trailing" id="Qtg-qs-3M9"/>
<constraint firstItem="M51-ug-MsN" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="RCG-aS-L2h"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="Rrg-6L-VMo" secondAttribute="bottom" constant="5" id="VRV-bg-TtW"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="SyC-Qw-kzE" secondAttribute="trailing" id="Wl8-mF-eC2"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="fTK-nk-bN9" secondAttribute="trailing" id="XRW-xO-sGx"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="top" secondItem="23B-pX-ODs" secondAttribute="top" id="Y0G-Ua-UcP"/>
<constraint firstItem="QHo-nZ-miK" firstAttribute="centerX" secondItem="fPD-rO-ZgU" secondAttribute="centerX" id="ZkK-bD-6Ys"/>
<constraint firstItem="5ML-g4-686" firstAttribute="centerY" secondItem="a7Y-B6-f0Q" secondAttribute="centerY" id="aC4-mQ-heC"/>
<constraint firstAttribute="trailing" secondItem="Dau-7f-0vb" secondAttribute="trailing" constant="20" id="ejF-GB-Yna"/>
<constraint firstItem="Dau-7f-0vb" firstAttribute="leading" secondItem="M51-ug-MsN" secondAttribute="leading" constant="20" id="g72-uy-cRi"/>
<constraint firstItem="Rrg-6L-VMo" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="gLf-nH-NyK"/>
<constraint firstItem="jbL-QO-JJl" firstAttribute="centerY" secondItem="5ML-g4-686" secondAttribute="centerY" constant="-1" id="h8B-5o-mja"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="iba-8r-UBq"/>
<constraint firstItem="QHo-nZ-miK" firstAttribute="centerY" secondItem="fPD-rO-ZgU" secondAttribute="centerY" id="npC-Cx-MHl"/>
<constraint firstItem="Dau-7f-0vb" firstAttribute="centerY" secondItem="M51-ug-MsN" secondAttribute="centerY" id="s65-78-SlP"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="sWG-F2-NbZ"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="cxl-Av-gEU" secondAttribute="trailing" id="usz-Hi-BR2"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="fTK-nk-bN9" secondAttribute="bottom" constant="-20" id="vmC-a4-Yy3"/>
<constraint firstItem="Dau-7f-0vb" firstAttribute="trailing" secondItem="M51-ug-MsN" secondAttribute="trailing" constant="-20" id="wLO-C9-3f8"/>
<constraint firstItem="Rrg-6L-VMo" firstAttribute="top" secondItem="SyC-Qw-kzE" secondAttribute="bottom" id="ws3-JU-UqR"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" constant="10" id="xGm-9v-fwc"/>
</constraints>
@@ -1522,7 +1524,7 @@
<outlet property="gamesStack" destination="Cgp-Ok-Imj" id="63D-lB-0lW"/>
<outlet property="gradientView" destination="cxl-Av-gEU" id="Sag-vq-nKu"/>
<outlet property="guestLoginStack" destination="Dau-7f-0vb" id="aC3-i3-TRK"/>
<outlet property="guestLoginView" destination="ygH-wj-cLk" id="XFr-0L-L0a"/>
<outlet property="guestLoginView" destination="M51-ug-MsN" id="dob-fE-3ed"/>
<outlet property="karaokeCV" destination="Grz-ok-w2U" id="vAr-XE-2Ne"/>
<outlet property="karaokeStack" destination="jE2-WP-tD4" id="azr-yq-sDA"/>
<outlet property="karaokeViewBtn" destination="MNq-YB-EUG" id="nhX-tu-YWQ"/>
@@ -1628,10 +1630,10 @@
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGreenColor">
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemMintColor">
<color red="0.0" green="0.78039215689999997" blue="0.74509803919999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.7803921568627451" blue="0.74509803921568629" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -23,6 +23,7 @@ class UserNotificationVC: UIViewController {
vm.initView()
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
tableView.indicatorStyle = .white
}
override func viewWillAppear(_ animated: Bool) {

View File

@@ -375,6 +375,14 @@ class WebSeriesSeasonVM{
}
Utilities.dismissProgressHUD()
vc.toast(msg: error.localizedDescription , time: 2)
self.vc.loadMoreActivityIndicator.stopAnimating()
self.vc.loadMoreActivityIndicator.hidesWhenStopped = true
//if its not page 0 then for sure user must be loading next page and got error
if pageNo != 0{
vc.loadMoreBtn.isHidden = true
}
}
}
}