Skip to content

Commit 4299ccc

Browse files
author
Hamid Palo
committed
Use ViewAction1 in ViewAction.setText and setTextResource.
1 parent 9677ba7 commit 4299ccc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

rxandroid/src/main/java/rx/android/view/ViewActions.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,23 @@ public static Action1<? super Boolean> setVisibility(View view, int visibilityOn
116116
/**
117117
* Set the text of a {@link TextView} based on values emitted by an Observable.
118118
*/
119-
public static Action1<? super CharSequence> setText(final TextView textView) {
120-
return new Action1<CharSequence>() {
119+
public static Action1<? super CharSequence> setText(TextView textView) {
120+
return new ViewAction1<TextView, CharSequence>(textView) {
121121
@Override
122-
public void call(CharSequence charSequence) {
123-
textView.setText(charSequence);
122+
public void call(TextView view, CharSequence text) {
123+
view.setText(text);
124124
}
125125
};
126126
}
127127

128128
/**
129129
* Set the text of a {@link TextView} based on values emitted by an Observable.
130130
*/
131-
public static Action1<? super Integer> setTextResource(final TextView textView) {
132-
return new Action1<Integer>() {
131+
public static Action1<? super Integer> setTextResource(TextView textView) {
132+
return new ViewAction1<TextView, Integer>(textView) {
133133
@Override
134-
public void call(Integer integer) {
135-
textView.setText(integer);
134+
public void call(TextView view, Integer resId) {
135+
view.setText(resId);
136136
}
137137
};
138138
}

0 commit comments

Comments
 (0)