Automatically close dialog when login is successful and notify user by toast

This commit is contained in:
inorichi
2015-11-11 19:15:56 +01:00
parent 089b5d3326
commit 985c5c09a7
6 changed files with 50 additions and 31 deletions

View File

@@ -24,7 +24,7 @@ public class RxPager {
public Observable<Integer> pages() {
return requests
.concatMap(targetPage -> targetPage <= requestedCount ?
Observable.<Integer>never() :
Observable.<Integer>empty() :
Observable.range(requestedCount, targetPage - requestedCount))
.startWith(Observable.range(0, initialPageCount))
.doOnNext(it -> requestedCount = it + 1);

View File

@@ -0,0 +1,24 @@
package eu.kanade.mangafeed.util;
import android.content.Context;
import android.widget.Toast;
public class ToastUtil {
public static void showShort(Context context, int resourceId) {
Toast.makeText(context, resourceId, Toast.LENGTH_SHORT).show();
}
public static void showLong(Context context, int resourceId) {
Toast.makeText(context, resourceId, Toast.LENGTH_LONG).show();
}
public static void showShort(Context context, String message) {
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}
public static void showLong(Context context, String message) {
Toast.makeText(context, message, Toast.LENGTH_LONG).show();
}
}