Skip to content

Commit a2c8b4c

Browse files
committed
Shuffle with Android-centric packages (ReactiveX#65)
This change introduces new, Android centric packages including * rx.android.content for android.content related classes * rx.android.view for android.view related classes * rx.android.widget for android.widget related classes * rx.android.util for package agnostic classes Then it moves existing classes based on their Android counterparts. Although one of the goal is to reduce the number of publics, this change still does nothing but class move. More changes will follow.
1 parent 769917c commit a2c8b4c

File tree

48 files changed

+99
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+99
-102
lines changed

rxandroid/src/main/java/rx/android/observables/AndroidObservable.java renamed to rxandroid/src/main/java/rx/android/AndroidObservable.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.observables;
14+
package rx.android;
1515

1616
import android.app.Activity;
1717
import android.app.Fragment;
@@ -24,11 +24,12 @@
2424
import android.view.View;
2525

2626
import rx.Observable;
27-
import rx.android.operators.OperatorBroadcastRegister;
28-
import rx.android.operators.OperatorConditionalBinding;
29-
import rx.android.operators.OperatorLocalBroadcastRegister;
30-
import rx.android.operators.OperatorSharedPreferenceChange;
31-
import rx.android.operators.OperatorViewDetachedFromWindowFirst;
27+
import rx.android.content.OperatorBroadcastRegister;
28+
import rx.android.content.OperatorConditionalBinding;
29+
import rx.android.content.OperatorLocalBroadcastRegister;
30+
import rx.android.content.OperatorSharedPreferenceChange;
31+
import rx.android.util.Assertions;
32+
import rx.android.view.OperatorViewDetachedFromWindowFirst;
3233
import rx.functions.Func1;
3334

3435
import static rx.android.schedulers.AndroidSchedulers.mainThread;

rxandroid/src/main/java/rx/android/subscriptions/AndroidSubscriptions.java renamed to rxandroid/src/main/java/rx/android/AndroidSubscriptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.subscriptions;
14+
package rx.android;
1515

1616
import rx.Scheduler.Worker;
1717
import rx.Subscription;

rxandroid/src/main/java/rx/android/operators/OperatorBroadcastRegister.java renamed to rxandroid/src/main/java/rx/android/content/OperatorBroadcastRegister.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.content;
1515

1616
import android.content.BroadcastReceiver;
1717
import android.content.Context;

rxandroid/src/main/java/rx/android/operators/OperatorConditionalBinding.java renamed to rxandroid/src/main/java/rx/android/content/OperatorConditionalBinding.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.content;
1515

1616
import rx.Observable;
1717
import rx.Subscriber;
@@ -98,7 +98,8 @@ private void log(String message) {
9898
}
9999

100100
/* Visible for testing */
101-
R getBoundRef() {
101+
/* XXX: Should be back to public */
102+
public R getBoundRef() {
102103
return boundRef;
103104
}
104105
}

rxandroid/src/main/java/rx/android/operators/OperatorLocalBroadcastRegister.java renamed to rxandroid/src/main/java/rx/android/content/OperatorLocalBroadcastRegister.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.content;
1515

1616
import android.content.BroadcastReceiver;
1717
import android.content.Context;

rxandroid/src/main/java/rx/android/operators/OperatorSharedPreferenceChange.java renamed to rxandroid/src/main/java/rx/android/content/OperatorSharedPreferenceChange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.content;
1515

1616
import android.content.SharedPreferences;
1717
import rx.Observable;

rxandroid/src/main/java/rx/android/observables/Assertions.java renamed to rxandroid/src/main/java/rx/android/util/Assertions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.observables;
14+
package rx.android.util;
1515

1616
import android.os.Looper;
1717

rxandroid/src/main/java/rx/android/events/OnCheckedChangeEvent.java renamed to rxandroid/src/main/java/rx/android/view/OnCheckedChangeEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.events;
14+
package rx.android.view;
1515

1616
import android.widget.CompoundButton;
1717

rxandroid/src/main/java/rx/android/events/OnClickEvent.java renamed to rxandroid/src/main/java/rx/android/view/OnClickEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.events;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/operators/OperatorViewClick.java renamed to rxandroid/src/main/java/rx/android/view/OperatorViewClick.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717
import rx.Observable;
1818
import rx.Subscriber;
1919
import rx.Subscription;
20-
import rx.android.events.OnClickEvent;
21-
import rx.android.observables.Assertions;
22-
import rx.android.subscriptions.AndroidSubscriptions;
20+
import rx.android.util.Assertions;
21+
import rx.android.AndroidSubscriptions;
2322
import rx.functions.Action0;
2423

2524
import java.util.ArrayList;

rxandroid/src/main/java/rx/android/operators/OperatorViewDetachedFromWindowFirst.java renamed to rxandroid/src/main/java/rx/android/view/OperatorViewDetachedFromWindowFirst.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

@@ -20,7 +20,7 @@
2020
import rx.Subscription;
2121

2222
/**
23-
* An internal class that is used from #{@link rx.android.observables.AndroidObservable#bindView}.
23+
* An internal class that is used from #{@link rx.android.AndroidObservable#bindView}.
2424
* This emits an event when the given #{@code View} is detached from the window for the first time.
2525
*/
2626
public class OperatorViewDetachedFromWindowFirst implements Observable.OnSubscribe<View> {

rxandroid/src/main/java/rx/android/functions/ViewAction1.java renamed to rxandroid/src/main/java/rx/android/view/ViewAction1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActionSetActivated.java renamed to rxandroid/src/main/java/rx/android/view/ViewActionSetActivated.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActionSetClickable.java renamed to rxandroid/src/main/java/rx/android/view/ViewActionSetClickable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActionSetEnabled.java renamed to rxandroid/src/main/java/rx/android/view/ViewActionSetEnabled.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActionSetFocusable.java renamed to rxandroid/src/main/java/rx/android/view/ViewActionSetFocusable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActionSetSelected.java renamed to rxandroid/src/main/java/rx/android/view/ViewActionSetSelected.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActionSetVisibility.java renamed to rxandroid/src/main/java/rx/android/view/ViewActionSetVisibility.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/functions/ViewActions.java renamed to rxandroid/src/main/java/rx/android/view/ViewActions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.functions;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717

rxandroid/src/main/java/rx/android/observables/ViewObservable.java renamed to rxandroid/src/main/java/rx/android/view/ViewObservable.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.observables;
14+
package rx.android.view;
1515

1616
import android.view.View;
1717
import android.widget.AbsListView;
@@ -20,16 +20,13 @@
2020
import android.widget.TextView;
2121

2222
import rx.Observable;
23-
import rx.android.events.OnCheckedChangeEvent;
24-
import rx.android.events.OnClickEvent;
25-
import rx.android.events.OnItemClickEvent;
26-
import rx.android.events.OnListViewScrollEvent;
27-
import rx.android.events.OnTextChangeEvent;
28-
import rx.android.operators.OperatorAdapterViewOnItemClick;
29-
import rx.android.operators.OperatorCompoundButtonInput;
30-
import rx.android.operators.OnSubscribeListViewScroll;
31-
import rx.android.operators.OperatorTextViewInput;
32-
import rx.android.operators.OperatorViewClick;
23+
import rx.android.widget.OnItemClickEvent;
24+
import rx.android.widget.OnListViewScrollEvent;
25+
import rx.android.widget.OperatorAdapterViewOnItemClick;
26+
import rx.android.widget.OperatorCompoundButtonInput;
27+
import rx.android.widget.OnSubscribeListViewScroll;
28+
import rx.android.widget.OperatorTextViewInput;
29+
import rx.android.widget.OnTextChangeEvent;
3330

3431
public class ViewObservable {
3532

@@ -65,7 +62,7 @@ public static Observable<OnItemClickEvent> itemClicks(final AdapterView<?> adapt
6562
* Returns an observable that emits all the scroll events from the provided ListView.
6663
* Note that this will replace any listeners previously set through
6764
* {@link android.widget.AbsListView#setOnScrollListener(android.widget.AbsListView.OnScrollListener)} unless those
68-
* were set by this method or {@link rx.android.operators.OnSubscribeListViewScroll}.
65+
* were set by this method or {@link rx.android.widget.OnSubscribeListViewScroll}.
6966
*/
7067
public static Observable<OnListViewScrollEvent> listScrollEvents(final AbsListView listView) {
7168
return Observable.create(new OnSubscribeListViewScroll(listView));

rxandroid/src/main/java/rx/android/events/OnItemClickEvent.java renamed to rxandroid/src/main/java/rx/android/widget/OnItemClickEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.events;
14+
package rx.android.widget;
1515

1616
import android.view.View;
1717
import android.widget.Adapter;

rxandroid/src/main/java/rx/android/events/OnListViewScrollEvent.java renamed to rxandroid/src/main/java/rx/android/widget/OnListViewScrollEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package rx.android.events;
15+
package rx.android.widget;
1616

1717
import android.widget.AbsListView;
1818

rxandroid/src/main/java/rx/android/operators/OnSubscribeListViewScroll.java renamed to rxandroid/src/main/java/rx/android/widget/OnSubscribeListViewScroll.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
* limitations under the License.
1313
*/
1414

15-
package rx.android.operators;
15+
package rx.android.widget;
1616

1717
import android.widget.AbsListView;
1818
import android.widget.AdapterView;
1919
import rx.Observable;
2020
import rx.Subscriber;
21-
import rx.android.events.OnListViewScrollEvent;
22-
import rx.android.observables.Assertions;
23-
import rx.android.subscriptions.AndroidSubscriptions;
21+
import rx.android.util.Assertions;
22+
import rx.android.AndroidSubscriptions;
2423
import rx.functions.Action0;
2524

2625
import java.util.ArrayList;

rxandroid/src/main/java/rx/android/events/OnTextChangeEvent.java renamed to rxandroid/src/main/java/rx/android/widget/OnTextChangeEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.events;
14+
package rx.android.widget;
1515

1616
import android.text.SpannableString;
1717
import android.widget.TextView;

rxandroid/src/main/java/rx/android/operators/OperatorAdapterViewOnItemClick.java renamed to rxandroid/src/main/java/rx/android/widget/OperatorAdapterViewOnItemClick.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.widget;
1515

1616
import android.view.View;
1717
import android.widget.AbsListView;
@@ -25,9 +25,8 @@
2525
import rx.Observable;
2626
import rx.Subscriber;
2727
import rx.Subscription;
28-
import rx.android.events.OnItemClickEvent;
29-
import rx.android.observables.Assertions;
30-
import rx.android.subscriptions.AndroidSubscriptions;
28+
import rx.android.util.Assertions;
29+
import rx.android.AndroidSubscriptions;
3130
import rx.functions.Action0;
3231

3332
public class OperatorAdapterViewOnItemClick implements Observable.OnSubscribe<OnItemClickEvent> {

rxandroid/src/main/java/rx/android/operators/OperatorCompoundButtonInput.java renamed to rxandroid/src/main/java/rx/android/widget/OperatorCompoundButtonInput.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.widget;
1515

1616
import android.view.View;
1717
import android.widget.CompoundButton;
1818
import rx.Observable;
1919
import rx.Subscriber;
2020
import rx.Subscription;
21-
import rx.android.events.OnCheckedChangeEvent;
22-
import rx.android.observables.Assertions;
23-
import rx.android.subscriptions.AndroidSubscriptions;
21+
import rx.android.view.OnCheckedChangeEvent;
22+
import rx.android.util.Assertions;
23+
import rx.android.AndroidSubscriptions;
2424
import rx.functions.Action0;
2525

2626
import java.util.ArrayList;

rxandroid/src/main/java/rx/android/operators/OperatorTextViewInput.java renamed to rxandroid/src/main/java/rx/android/widget/OperatorTextViewInput.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.operators;
14+
package rx.android.widget;
1515

1616
import rx.Observable;
1717
import rx.Subscriber;
1818
import rx.Subscription;
19-
import rx.android.events.OnTextChangeEvent;
20-
import rx.android.observables.Assertions;
21-
import rx.android.subscriptions.AndroidSubscriptions;
19+
import rx.android.util.Assertions;
20+
import rx.android.AndroidSubscriptions;
2221
import rx.functions.Action0;
2322
import android.text.Editable;
2423
import android.text.TextWatcher;

rxandroid/src/test/java/rx/android/observables/AndroidObservableTest.java renamed to rxandroid/src/test/java/rx/android/AndroidObservableTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package rx.android.observables;
14+
package rx.android;
1515

1616
import static org.mockito.Mockito.verify;
1717

@@ -25,6 +25,7 @@
2525
import org.robolectric.annotation.Config;
2626
import rx.Observable;
2727
import rx.Observer;
28+
import rx.android.AndroidObservable;
2829
import rx.observers.TestObserver;
2930

3031
import android.app.Activity;

0 commit comments

Comments
 (0)