Skip to content

Instantly share code, notes, and snippets.

View trupizzza's full-sized avatar

Dmitry Zhgun trupizzza

  • IT Frog
  • Russia, Saint-Petersburg
View GitHub Profile
@msangel
msangel / ApiModule.java
Last active October 10, 2022 14:45 — forked from koesie10/ApiModule.java
Retrofit 1 error handling behaviour in Retrofit 2.3.0
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
@julianfalcionelli
julianfalcionelli / RxErrorHandlingCallAdapterFactory.java
Last active June 21, 2022 08:55
Rx Error Handling for Retrofit2
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.Single;
import io.reactivex.SingleSource;
import io.reactivex.annotations.NonNull;
@evant
evant / SnapTopLinearLayoutManager.java
Created July 16, 2015 19:33
Force item to top instead of just on screen when smooth scrolling with RecyclerView
public class SnapTopLinearLayoutManager extends LinearLayoutManager {
public SnapTopLinearLayoutManager(Context context) {
super(context);
}
public SnapTopLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}