I hereby claim:
- I am aballano on github.
- I am shyish (https://keybase.io/shyish) on keybase.
- I have a public key whose fingerprint is 7A8E 75FD 9052 EDC5 1477 A839 53E8 B507 F7EF 6CE4
To claim this, I am signing this object:
| import android.content.Context; | |
| import android.support.v4.view.ViewPager; | |
| import android.util.AttributeSet; | |
| import android.view.Gravity; | |
| import android.view.MotionEvent; | |
| import android.view.View; | |
| /** | |
| * Created by Shyish on 11/10/2015. | |
| */ |
I hereby claim:
To claim this, I am signing this object:
| import android.support.v7.widget.RecyclerView; | |
| import android.view.View; | |
| import rx.Observable; | |
| import rx.Subscriber; | |
| import rx.android.MainThreadSubscription; | |
| import static rx.android.MainThreadSubscription.verifyMainThread; | |
| final class RecyclerViewItemLongClickOnSubscribe implements Observable.OnSubscribe<Integer> { |
| @RunWith(AndroidJUnit4.class) | |
| public final class RxSnackbarTest { | |
| @Rule public final ActivityTestRule<RxSnackbarTestActivity> activityRule = | |
| new ActivityTestRule<>(RxSnackbarTestActivity.class); | |
| private Snackbar view; | |
| @Before public void setUp() { | |
| RxSnackbarTestActivity activity = activityRule.getActivity(); | |
| view = activity.snackbar; |
| public static Observable<Integer> itemLongClick(RecyclerView view) { | |
| return Observable.create(new RecyclerViewItemLongClickOnSubscribe(view)); | |
| } |
| @Override public Observable<Integer> bindRecyclerViewLongClickToObservable() { | |
| return RxRecycler.itemLongClick(recyclerView)); | |
| } |
| public void onDeleteChatAt(int id) { | |
| interactor.deleteChat(id) | |
| .subscribe(() -> view.removeChat(id), logError()) | |
| } |
| @Override public Observable showDeleteFailedWithRetry() { | |
| Snackbar snackbar = Snackbar.make(rootView, "Can't delete chat", Snackbar.LENGTH_LONG); | |
| Observable<Integer> observable = RxSnackbar.actionClicked(snackbar, "Retry")); | |
| snackbar.show(); | |
| return observable; | |
| } |
| public void onDeleteChatAt(int id) { | |
| interactor.deleteChat(id) | |
| .retryWhen(errors -> view.showDeleteFailedWithRetry()) | |
| .subscribe(() -> view.removeChat(id), logError()) | |
| } |
| public void onDeleteChatAt(int id) { | |
| interactor.deleteChat(id) | |
| .retryWhen(errors -> errors.flatMap(error -> view.showDeleteFailedWithRetry())) | |
| .subscribe(() -> view.removeChat(id), logError()) | |
| } |