Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rxjava-android: parameterize OperatorViewClick by concrete view type #1038

Merged
merged 1 commit into from
Apr 16, 2014

Conversation

Yarikx
Copy link
Contributor

@Yarikx Yarikx commented Apr 15, 2014

Parameterize OperatorViewClick observable to actual View type.
So actual view with it native type can be used.

So instead of

Observable<View> imageClicks = ViewObservable.clicks(imageView, false);
        //...
        imageClicks.subscribe(new Action1<View>() {
            @Override
            public void call(View view) {
                ImageView imageView = (ImageView) view;
                imageView.setImageBitmap(bitmap);
            }
        });

you can use

        Observable<ImageView> imageClicks = ViewObservable.clicks(imageView, false);
        //...
        imageClicks.subscribe(new Action1<ImageView>() {
            @Override
            public void call(ImageView view) {
                view.setImageBitmap(bitmap);
            }
        });

@benjchristensen
Copy link
Member

/cc @mttkay for review as it is for Android.

@mttkay
Copy link
Contributor

mttkay commented Apr 16, 2014

Looks good to me.

benjchristensen added a commit that referenced this pull request Apr 16, 2014
rxjava-android: parameterize OperatorViewClick by concrete view type
@benjchristensen benjchristensen merged commit 62cdfa4 into ReactiveX:master Apr 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants