- ReactiveX home website: http://reactivex.io/
- The first 20 minutes of this talk: https://www.youtube.com/watch?v=fLZqgc4pI4s&feature=youtu.be
- Grokking RxJava: blog.danlew.net/2014/09/15/grokking-rxjava-part-1/
- Learning RxJava (for Android) by example: https://www.youtube.com/watch?v=k3D0cWyNno4
- Functional Reactive Programming with RxSwift: https://realm.io/news/slug-max-alexander-functional-reactive-rxswift/
- Fragmented Podcast episodes 3 & 4: http://fragmentedpodcast.com/episodes/3/ http://fragmentedpodcast.com/episodes/4/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v4.widget.DrawerLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/drawer_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DisposeBagProvider.swift | |
import RxSwift | |
import UIKit | |
/* | |
// Just make a class conform to it like this: | |
class MyClass : DisposeBagProvider { | |
} | |
// And then just use that "disposeBag" variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ControllerAware Protocol | |
// Shows how to have view controller instances which implement | |
// a specific protocol have it's method called on viewDidLoad. | |
import UIKit | |
protocol ControllerAware { | |
func onViewDidLoad() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Constrained View Controller extension which display a "No Internet Connection" message when reachability is lost. | |
// This implementation depends on ReachabilitySwift (https://github.com/ashleymills/Reachability.swift). | |
// It can easily enough be adapted to other frameworks. | |
// Assumes you have a localized string with the key "warning.no_internet_connection" in one of your .strings files. | |
// Call startMonitoringReachability() in viewWillAppear and stopMonitoringReachability() in viewDidDisappear | |
import ReachabilitySwift | |
protocol ReachabilityAware { | |
func startMonitoringReachability() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform :ios, '9.0' | |
use_frameworks! | |
$rxVersion = '~> 2.2.0' | |
target 'MyProject' do | |
pod 'RxSwift', $rxVersion | |
pod 'RxCocoa', $rxVersion | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd ../.. | |
date=$1 #Format: 2015-01-15 | |
root_branch=$2 #Format: origin/branchName e.g. origin/release/1_6 | |
DRY_RUN=$3 | |
numberDeleted=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public float getCpuTemp() { | |
Process p; | |
try { | |
p = Runtime.getRuntime().exec("cat sys/class/thermal/thermal_zone0/temp"); | |
p.waitFor(); | |
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); | |
String line = reader.readLine(); | |
float temp = Float.parseFloat(line) / 1000.0f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view.showLoadingIndicator(); | |
loadFromServer() | |
.compose(applySchedulers()) | |
.subscribe(data -> { | |
view.hideLoadingIndicator(); | |
view.showData(); | |
}, throwable -> { | |
view.hideLoadingIndicator(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This works in 1.1.0-beta1 but breaks in 1.1.0-beta2. | |
textView3 is always constrained to textView1, even when the barrier should clearly be at the guideline --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<TextView |
OlderNewer