Skip to content

Commit

Permalink
Making sure Travis CI will succeed
Browse files Browse the repository at this point in the history
  • Loading branch information
kobim committed Jul 7, 2015
1 parent de41adb commit fefb87c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
28 changes: 15 additions & 13 deletions Demos/TinderLike/TinderLike/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
controller = SLPagingViewSwift(items: items, controllers: controllers, showPageControl: false)

controller.pagingViewMoving = ({ subviews in
for lbl in (subviews as! [UIImageView]) {
var c : UIColor!

switch (lbl.frame.origin.x) {
case 145:
c = orange
case 46 ... 144:
c = self.gradient(Double(lbl.frame.origin.x), topX: Double(46), bottomX: Double(144), initC: orange, goal: gray)
case 146 ... 244:
c = self.gradient(Double(lbl.frame.origin.x), topX: Double(146), bottomX: Double(244), initC: gray, goal: orange)
default:
c = gray
if let imageViews = subviews as? [UIImageView] {
for imgView in imageViews {
var c = gray
let originX = Double(imgView.frame.origin.x)

if (originX > 45 && originX < 145) {
c = self.gradient(originX, topX: 46, bottomX: 144, initC: orange, goal: gray)
}
else if (originX > 145 && originX < 245) {
c = self.gradient(originX, topX: 146, bottomX: 244, initC: gray, goal: orange)
}
else if(originX == 145){
c = orange
}
imgView.tintColor = c
}
lbl.tintColor = c
}
})

Expand Down
30 changes: 16 additions & 14 deletions Demos/TwitterLike/TwitterLike/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITableViewDelegate, UITa
controller.tintPageControlColor = UIColor(white: 0.799, alpha: 1.0)
controller.pagingViewMovingRedefine = ({ scrollView, subviews in
var i = 0
var xOffset = scrollView.contentOffset.x
for lbl in (subviews as! [UILabel]) {
var alpha = CGFloat(0)

if(lbl.frame.origin.x > 45 && lbl.frame.origin.x < 145) {
alpha = 1.0 - (xOffset - (CGFloat(i)*320.0)) / 320.0
}
else if (lbl.frame.origin.x > 145 && lbl.frame.origin.x < 245) {
alpha = (xOffset - (CGFloat(i)*320.0)) / 320.0 + 1.0
}
else if(lbl.frame.origin.x == 145){
alpha = 1.0
let xOffset = scrollView.contentOffset.x
if let lbls = subviews as? [UILabel] {
for lbl in lbls {
var alpha : CGFloat = 0

if(lbl.frame.origin.x > 45 && lbl.frame.origin.x < 145) {
alpha = 1.0 - (xOffset - (CGFloat(i)*320.0)) / 320.0
}
else if (lbl.frame.origin.x > 145 && lbl.frame.origin.x < 245) {
alpha = (xOffset - (CGFloat(i)*320.0)) / 320.0 + 1.0
}
else if(lbl.frame.origin.x == 145){
alpha = 1.0
}
lbl.alpha = alpha
i++
}
lbl.alpha = CGFloat(alpha)
i++
}
})

Expand Down

0 comments on commit fefb87c

Please sign in to comment.