implementation 'com.android.support:appcompat-v7:26.1.0'
<?xml version="1.0" encoding="utf-8"?>
<font-family
xmlns:app="http://schemas.android.com/apk/res-auto">
<font
app:fontStyle="normal"
app:fontWeight="400"
app:font="@font/atma_regular"/>
<font
app:fontStyle="normal"
app:fontWeight="100"
app:font="@font/atma_light"/>
</font-family>
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.addInterceptor(new Interceptor() {
@Override
public Response intercept(@NonNull Chain chain) throws IOException {
Request original = chain.request();
String token = ""; // Get token from prefs
if (!TextUtils.isEmpty(token)) {
Request.Builder requestBuilder = original.newBuilder()
.addHeader("Token", token);
Request request = requestBuilder.build();
return chain.proceed(request);
} else {
return chain.proceed(original);
}
}
});