Skip to content

Instantly share code, notes, and snippets.

@DanFlor
DanFlor / OauthRefreshAuthenticator.kt
Created May 24, 2018 15:19
A delegate drive OAuth Authenticator, for use with OkHttp3 clients.
package com.obidan.api
import com.obidan.api.delegate.OauthRefreshAuthenticatorDelegate
import okhttp3.Authenticator
import okhttp3.Request
import okhttp3.Response
import okhttp3.Route
import timber.log.Timber
class OauthRefreshAuthenticator(
@DanFlor
DanFlor / BasicAuthInterceptor.kt
Created May 1, 2018 17:12
OkHttp Basic Auth Interceptor
package com.obidan.api
import okhttp3.Credentials
import okhttp3.Interceptor
import okhttp3.Response
/**
* BasicAuthInterceptor.kt
*
* A simple OkHttp Interceptor to rewrite the authorization header.
@DanFlor
DanFlor / BadgeDrawable.kt
Last active March 23, 2018 14:21
This is a drawable which is added as part of a multilayer drawable to provide a numeric badge layer.
package com.obidan.badgedrawable
import android.content.Context
import android.graphics.*
import android.graphics.drawable.Drawable
import android.support.v4.content.ContextCompat
import com.obidan.badgedrawable.R
/**