Skip to content

Commit

Permalink
#1005 Added theme color
Browse files Browse the repository at this point in the history
Ashish Awasthi committed Sep 28, 2019
1 parent fe943e0 commit 7443d19
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions iOSLoader/DDIndicator.swift
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ private var stage: Int = 0

class DDIndicator: UIView {
var timer: Timer?
var loaderColor: UIColor = .gray

override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = UIColor.clear
@@ -48,13 +50,13 @@ class DDIndicator: UIView {
let max: Int = 16
let cycle: Int = currentStage % max
if cycle < max / 4 {
return loadingThemeColor
return loaderColor
}
else if cycle < max / 4 * 2 {
return loadingThemeColor
return loaderColor
}
else if cycle < max / 4 * 3 {
return loadingThemeColor
return loaderColor
}
else {
return UIColor(red: 239.0 / 255.0, green: 91.0 / 255.0, blue: 148.0 / 255.0, alpha: CGFloat(alpha))
5 changes: 3 additions & 2 deletions iOSLoader/LoadingView.swift
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

import UIKit

let loadingThemeColor: UIColor = .gray

typealias SVProgressHUDDismissCompletion = () ->Void

public enum UILoadingViewMaskType: Int {
@@ -42,7 +42,7 @@ public class LoadingView: UIView {
var foreGroundColor: UIColor?
var backGroundColor: UIColor?
var messageTxt: String = ""

var loadingThemeColor: UIColor = .gray
// Declare class instance property
static let sharedInstance = LoadingView(frame: UIScreen.main.bounds)

@@ -220,6 +220,7 @@ public class LoadingView: UIView {
var rect: CGRect = bounds
rect.size = sizeOfActivity
ddIndicatorView = DDIndicator(frame: rect)
ddIndicatorView?.loaderColor = loadingThemeColor
}
return ddIndicatorView!
}

0 comments on commit 7443d19

Please sign in to comment.