Skip to content

Instantly share code, notes, and snippets.

View akshay2211's full-sized avatar
Working from home

Akshay Sharma akshay2211

Working from home
View GitHub Profile
* Created by akshay on 28/8/17.
public class TokenAuthenticator implements Authenticator {
private final Context c;
public TokenAuthenticator(Context c) {
this.c = c;
alex-shpak /
Last active March 29, 2023 21:06
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
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
ChathuraHettiarachchi / MotionLayoutTry.kt
Last active May 7, 2024 14:36
This is a sample implementation of AirBnB search bar transition on Android usin Jetpack Compose MotionLayout, MotionScene with DSL. You need to replace the images on `destinations` to work this. FInd the video link
package com.chootadev.composetryout
import androidx.annotation.DrawableRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.keyframes
import androidx.compose.animation.core.tween