- added api for fetching the episode as per the selected category
- made the category collection cells dynamic - handled the category selection will call the episode api - solved activity indicator view at the splash start-up - handled the app lifecycle for live tv app going in foreground and background - handled play pause while the live tv view apperas and disappears - Made the likes and favourites dynamic on episode screen
This commit is contained in:
@@ -14,6 +14,25 @@ class SplashVM{
|
||||
weak var vc : SplashVC!
|
||||
var player: AVAudioPlayer?
|
||||
|
||||
func initView(){
|
||||
vc.activityIndicator.hidesWhenStopped = true
|
||||
let color1 = #colorLiteral(red: 0.144693464, green: 0.1426281333, blue: 0.6686832905, alpha: 1)
|
||||
let color2 = #colorLiteral(red: 0.4862745098, green: 0.1960784314, blue: 0.7019607843, alpha: 1)
|
||||
vc.hindiBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
|
||||
vc.englishBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
|
||||
vc.hindiBtn.roundCorner()
|
||||
vc.englishBtn.roundCorner()
|
||||
selectTheme()
|
||||
|
||||
// check if user has selected the default language
|
||||
if let language = AuthFunc.shareInstance.getDefaultLanguage(){
|
||||
AuthFunc.shareInstance.languageSelected = language
|
||||
}else{
|
||||
AuthFunc.shareInstance.setDefaultLanguage(language: .english)
|
||||
}
|
||||
}
|
||||
|
||||
// Play initial sound
|
||||
func playSplashSound() {
|
||||
guard let path = Bundle.main.path(forResource: K.StaticFilesString.wokaSplashSound, ofType:"m4a") else {
|
||||
return }
|
||||
@@ -28,24 +47,6 @@ class SplashVM{
|
||||
}
|
||||
}
|
||||
|
||||
func initView(){
|
||||
let color1 = #colorLiteral(red: 0.144693464, green: 0.1426281333, blue: 0.6686832905, alpha: 1)
|
||||
let color2 = #colorLiteral(red: 0.4862745098, green: 0.1960784314, blue: 0.7019607843, alpha: 1)
|
||||
vc.hindiBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
|
||||
vc.englishBtn.applyGradient(colors: [color1, color2], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0, y: 0.8))
|
||||
vc.hindiBtn.roundCorner()
|
||||
vc.englishBtn.roundCorner()
|
||||
selectTheme()
|
||||
vc.activityIndicator.stopAnimating()
|
||||
|
||||
// check if user has selected the default language
|
||||
if let language = AuthFunc.shareInstance.getDefaultLanguage(){
|
||||
AuthFunc.shareInstance.languageSelected = language
|
||||
}else{
|
||||
AuthFunc.shareInstance.setDefaultLanguage(language: .english)
|
||||
}
|
||||
}
|
||||
|
||||
func selectTheme(){
|
||||
let theme = UserDefaults.standard.string(forKey: K.UserDefaultsStruct.themeDefault)
|
||||
if theme != nil{
|
||||
@@ -55,6 +56,8 @@ class SplashVM{
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Get the user data if loginned
|
||||
|
||||
func getUserData(){
|
||||
if AuthFunc.shareInstance.getUserType() == 3{
|
||||
//setusertype
|
||||
@@ -98,6 +101,7 @@ class SplashVM{
|
||||
}
|
||||
}
|
||||
|
||||
// handling activity indicator
|
||||
func startStopIndicator(start : Bool , hide : Bool = false){
|
||||
if hide{
|
||||
vc.activityIndicator.stopAnimating()
|
||||
|
||||
Reference in New Issue
Block a user