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
private class HttpInterceptor implements Interceptor { | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
Request request = chain.request(); | |
//Build new request | |
Request.Builder builder = request.newBuilder(); | |
builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |
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
fun Transition.sharedElementsInOverlay(container: ViewGroup, start: View, end: View): Transition = | |
addListener(object : Transition.TransitionListener { | |
val endParent = end.parent as ViewGroup | |
val endOriginalPosition = endParent.indexOfChild(end) | |
override fun onTransitionStart(transition: Transition) { | |
start.visibility = View.GONE | |
container.overlay.add(start) | |
container.overlay.add(end) | |
} |