mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	refactore some more lambda functions
This commit is contained in:
		| @@ -124,20 +124,12 @@ public abstract class BaseListInfoFragment<I extends ListInfo> extends BaseListF | ||||
|         currentWorker = loadResult(forceLoad) | ||||
|                 .subscribeOn(Schedulers.io()) | ||||
|                 .observeOn(AndroidSchedulers.mainThread()) | ||||
|                 .subscribe(new Consumer<I>() { | ||||
|                     @Override | ||||
|                     public void accept(@NonNull I result) throws Exception { | ||||
|                         isLoading.set(false); | ||||
|                         currentInfo = result; | ||||
|                         currentNextItemsUrl = result.next_streams_url; | ||||
|                         handleResult(result); | ||||
|                     } | ||||
|                 }, new Consumer<Throwable>() { | ||||
|                     @Override | ||||
|                     public void accept(@NonNull Throwable throwable) throws Exception { | ||||
|                         onError(throwable); | ||||
|                     } | ||||
|                 }); | ||||
|                 .subscribe((@NonNull I result) -> { | ||||
|                     isLoading.set(false); | ||||
|                     currentInfo = result; | ||||
|                     currentNextItemsUrl = result.next_streams_url; | ||||
|                     handleResult(result); | ||||
|                 }, (@NonNull Throwable throwable) -> onError(throwable)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -153,18 +145,12 @@ public abstract class BaseListInfoFragment<I extends ListInfo> extends BaseListF | ||||
|         currentWorker = loadMoreItemsLogic() | ||||
|                 .subscribeOn(Schedulers.io()) | ||||
|                 .observeOn(AndroidSchedulers.mainThread()) | ||||
|                 .subscribe(new Consumer<ListExtractor.NextItemsResult>() { | ||||
|                     @Override | ||||
|                     public void accept(@io.reactivex.annotations.NonNull ListExtractor.NextItemsResult nextItemsResult) throws Exception { | ||||
|                         isLoading.set(false); | ||||
|                         handleNextItems(nextItemsResult); | ||||
|                     } | ||||
|                 }, new Consumer<Throwable>() { | ||||
|                     @Override | ||||
|                     public void accept(@io.reactivex.annotations.NonNull Throwable throwable) throws Exception { | ||||
|                         isLoading.set(false); | ||||
|                         onError(throwable); | ||||
|                     } | ||||
|                 .subscribe((@io.reactivex.annotations.NonNull ListExtractor.NextItemsResult nextItemsResult) -> { | ||||
|                     isLoading.set(false); | ||||
|                     handleNextItems(nextItemsResult); | ||||
|                 }, (@io.reactivex.annotations.NonNull Throwable throwable) -> { | ||||
|                     isLoading.set(false); | ||||
|                     onError(throwable); | ||||
|                 }); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Christian Schabesberger
					Christian Schabesberger