GitXplorerGitXplorer
o

RxDataBinding

public
15 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
87940dc4c11740f6c86a2bc28b5200d1ccf388df

removed circleci

ooldergod committed 8 years ago
Unverified
d43394e32407fbf14b42e989dae4e9bd39e1a241

travis slack ntf

ooldergod committed 8 years ago
Unverified
b4e11ec3f571033e14b1b29d1baec6148d348b8f

updated pom username without accent

ooldergod committed 8 years ago
Unverified
74a31a18b79ad5a824412cb4f73bd3960469aa7e

Added badge to readme

ooldergod committed 8 years ago
Unverified
6e3115fba0ebf4d7993a9988537ed4a5d0861eb6

Prepare next development version.

ooldergod committed 8 years ago
Unverified
058ef1a9c0e17deb17a91fcaa768b9caf70750c4

Prepare for first release: 2.0.0.

ooldergod committed 8 years ago

README

The README file for this repository.

RxDataBinding

RxJava2 binding APIs for Android's Data Binding Library. As of 2.0.0, RxDataBinding provides some RxJava2 wrapper for all android.databinding.Observable* which allow callbacks.

Usage

ObservableBoolean bool = new ObservableBoolean();
RxObservableBoolean.propertyChanges(bool)
  .subscribe(someBoolean -> log.d(TAG, "Do something with someBoolean"));

Download

compile 'com.benoitquenaudon:rxdatabinding:2.0.0'

Development

The code is heavily inspired on RxBinding, hence the many similarities.

Weak references should not be used. RxJava's subscription graph allows for proper garbage collections of reference-holding objects provided the caller unsubscribes.

Naming conventions of classes and their packages should provide unambiguous information on where functionality can be found. Helpers for platform classes can be found in packages of the same name but prefixed with com.benoitquenaudon.rxdatabinding. instead of android. and classes of the same name but prefixed with Rx. For example, android.databinding.ObservableBoolean bindings are in com.benoitquenaudon.rxdatabinding.databinding.RxObservableBoolean.

Observable factory method names is the plural of the verb (e.g., click --> clicks). The verb should be in the present tense, regardless of the platform's use (e.g., changed -> change`).

If the listener callback provides more than one parameter of useful data, a factory method overload named in the singular and suffixed with "Events" is included. This overload emits wrapper objects containing all the additional information about the event. The name of the wrapper object is the concatenation of the view simple name, the verb (with optional adverb prefix), and "Event". These classes are in the public API.

Events for listeners with multiple methods should share an abstract base class. The naming follows the same rules as a normal event class but without the qualifying prefix. The constructor should be package-private to prevent subclasses other than those defined for the listener methods. This class should be in the public API.

License

Copyright (C) 2017 Benoît Quenaudon

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.