This file contains hidden or 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
| import android.widget.ArrayAdapter | |
| import android.widget.AutoCompleteTextView | |
| import androidx.annotation.LayoutRes | |
| import androidx.databinding.BindingAdapter | |
| @BindingAdapter("dropDownItems", "dropDownItemLayout", "dropDownItemsIncludeEmpty", requireAll = false) | |
| fun AutoCompleteTextView.setItems(items: Array<String>?, @LayoutRes layout: Int?, includeEmpty: Boolean?) = | |
| setAdapter( | |
| ArrayAdapter( | |
| context, |
This file contains hidden or 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.mainstreetcode.teammate.util; | |
| import android.animation.AnimatorSet; | |
| import android.animation.ObjectAnimator; | |
| import android.support.annotation.DrawableRes; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.annotation.StringRes; | |
| import android.support.constraint.ConstraintLayout; | |
| import android.support.constraint.ConstraintSet; |
This file contains hidden or 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 AndroidWorkerInjection { | |
| public static void inject(Worker worker) { | |
| checkNotNull(worker, "worker"); | |
| Object application = worker.getApplicationContext(); | |
| if (!(application instanceof HasWorkerInjector)) { | |
| throw new RuntimeException( | |
| String.format( | |
| "%s does not implement %s", | |
| application.getClass().getCanonicalName(), |
This file contains hidden or 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 hidden or 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 AccountAuthenticator extends AbstractAccountAuthenticator { | |
| private final Context context; | |
| @Inject @ClientId String clientId; | |
| @Inject @ClientSecret String clientSecret; | |
| @Inject ApiService apiService; | |
| public AccountAuthenticator(Context context) { | |
| super(context); |