mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 15:07:30 +01:00
Automatically close dialog when login is successful and notify user by toast
This commit is contained in:
@@ -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);
|
||||
|
||||
24
app/src/main/java/eu/kanade/mangafeed/util/ToastUtil.java
Normal file
24
app/src/main/java/eu/kanade/mangafeed/util/ToastUtil.java
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user