Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Hossein Shahdoost hshahdoost

💭
I may be slow to respond.
View GitHub Profile
@Aesthetikx
Aesthetikx / retrofit_callback_testing.java
Last active Apr 4, 2020
Testing Retrofit Callback style APIs with Robolectric and CountdownLatches
View retrofit_callback_testing.java
// WidgetApi.java
public interface WidgetApi {
@GET("/widget/{:id}")
void getWidget(@Path("id") int id, Callback<Widget> callback);
}
// MockRetrofitClient.java
public class MockRetrofitClient implements Client {
private int statusCode = 200;
@JMPergar
JMPergar / FlipPageViewTransformer.java
Last active Nov 7, 2019
Flip animation for ViewPager
View FlipPageViewTransformer.java
import android.support.v4.view.ViewPager;
import android.view.View;
public class FlipPageViewTransformer implements ViewPager.PageTransformer {
@Override
public void transformPage(View page, float position) {
float percentage = 1 - Math.abs(position);
page.setCameraDistance(12000);
setVisibility(page, position);
setTranslation(page);