This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": [{ | |
"_type": "subscriptions", | |
"_links": { | |
"cancel": "\/api\/v0\/subscription\/09c48cb8-28c3-4763-a128-85b253bc25ec\/cancel" | |
}, | |
"id": "1", | |
"title": "30 drinks", | |
"country": "DK", | |
"is_active": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cards": { | |
"items": [ | |
{ | |
"_type": "drinks-account-info-items", | |
"_links": { | |
"self": "/api/v0/drinks-account/deposit-info", | |
"subscribe": "/api/v0/plans/10/subscribe", | |
"promotion_check": "/api/v0/plans/10/promotion-check" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Night wheel | |
Time to rethink tickets endpoint? Adding night wheel, offers. Member benefits are hardcoded | |
Same items for every attempt? | |
Do we show "nothing" in prize list? | |
Lottie - not suitable for dynamic animations | |
GET | |
/me/nightwheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class LoadingState<out T>(val throwable: Throwable? = null, | |
val loading: Boolean = false, | |
val dataModel: T? = null, | |
val cachedData: CachedData<T>? = null) { | |
val isFailed: Boolean | |
get() = throwable != null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KeyboardWatcher { | |
private static final Logger LOG = new Logger(KeyboardWatcher.class); | |
private final View rootView; | |
private final ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener; | |
private int lastHeightDifference; | |
private final List<KeyboardListener> keyboardListeners = new ArrayList<>(); | |
public KeyboardWatcher(View rootView) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<merge xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<!--is a relativelayout--> | |
<LinearLayout | |
android:id="@+id/field_container" | |
android:layout_width="@dimen/onboarding_login_fields_container_width" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KeyboardPlacementHelper { | |
/** | |
* Set up a keyboardlistener that will move an anchorview up or down to stay above the keyboard when it shows | |
* @param rootView the parent, screen filling view | |
* @param anchorView the view to be kept above the keyboard | |
* @return | |
*/ | |
public static KeyboardWatcher.KeyboardListener keyboardListener(Context context, View rootView, View anchorView) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tnovoselec | |
import kotlinx.coroutines.experimental.CommonPool | |
import kotlinx.coroutines.experimental.async | |
import kotlinx.coroutines.experimental.delay | |
import kotlinx.coroutines.experimental.runBlocking | |
object TwoImagesProblem { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomViewPager extends ViewPager{ | |
private boolean isPagingEnabled = true; | |
public CustomViewPager(Context context){ | |
super(context); | |
setScroller(); | |
} | |
public CustomViewPager(Context context, AttributeSet attrs) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Playground { | |
Observable<DiscussionPost> getPost(String commentId) { // this is your Api interface | |
return Observable.just(new DiscussionPost()); | |
} | |
Observable<List<DiscussionPost>> getPosts() { | |
return getPost("root").flatMap(new Func1<DiscussionPost, Observable<DiscussionPost>>() { | |
@Override |
NewerOlder