From 50afe0cbb30683f7bc44b499289bb2808b9d3cdd Mon Sep 17 00:00:00 2001 From: Mark Wei Date: Thu, 8 Dec 2016 01:59:40 -0800 Subject: [PATCH] Separate stream+operators from subscription. Summary: Fix for http://codereview.cc/D2152#inline-8379 Reviewers: O6 Material Motion Android platform reviewers, O2 Material Motion, featherless Reviewed By: O6 Material Motion Android platform reviewers, O2 Material Motion, featherless Subscribers: featherless Tags: #material_motion Differential Revision: http://codereview.cc/D2167 --- .../material/motion/streams/sample/MainActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sample/src/main/java/com/google/android/material/motion/streams/sample/MainActivity.java b/sample/src/main/java/com/google/android/material/motion/streams/sample/MainActivity.java index 1b602b0..6d13561 100644 --- a/sample/src/main/java/com/google/android/material/motion/streams/sample/MainActivity.java +++ b/sample/src/main/java/com/google/android/material/motion/streams/sample/MainActivity.java @@ -77,7 +77,7 @@ public void unsubscribe() { } }); - final Subscription subscription = observable + MotionObservable stream = observable .filter(new MotionObservable.Predicate() { @Override @@ -92,7 +92,9 @@ public CharSequence transform(String value) { return italicizeAndCapitalize(value); } }) - .write(text, TEXT_PROPERTY) + .write(text, TEXT_PROPERTY); + + final Subscription subscription = stream .subscribe(new MotionObserver() { @Override