Skip to content

Commit

Permalink
Use ViewAction1 in ViewAction.setText and setTextResource.
Browse files Browse the repository at this point in the history
Hamid Palo committed Nov 25, 2014
1 parent 9677ba7 commit 4299ccc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rxandroid/src/main/java/rx/android/view/ViewActions.java
Original file line number Diff line number Diff line change
@@ -116,23 +116,23 @@ public static Action1<? super Boolean> setVisibility(View view, int visibilityOn
/**
* Set the text of a {@link TextView} based on values emitted by an Observable.
*/
public static Action1<? super CharSequence> setText(final TextView textView) {
return new Action1<CharSequence>() {
public static Action1<? super CharSequence> setText(TextView textView) {
return new ViewAction1<TextView, CharSequence>(textView) {
@Override
public void call(CharSequence charSequence) {
textView.setText(charSequence);
public void call(TextView view, CharSequence text) {
view.setText(text);
}
};
}

/**
* Set the text of a {@link TextView} based on values emitted by an Observable.
*/
public static Action1<? super Integer> setTextResource(final TextView textView) {
return new Action1<Integer>() {
public static Action1<? super Integer> setTextResource(TextView textView) {
return new ViewAction1<TextView, Integer>(textView) {
@Override
public void call(Integer integer) {
textView.setText(integer);
public void call(TextView view, Integer resId) {
view.setText(resId);
}
};
}

0 comments on commit 4299ccc

Please sign in to comment.