Search in sources :

Example 91 with NonNull

use of android.support.annotation.NonNull in project facebook-android-sdk by facebook.

the class DeviceAuthDialog method onCreateDialog.

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    dialog = new Dialog(getActivity(), R.style.com_facebook_auth_dialog);
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = initializeContentView(DeviceRequestsHelper.isAvailable() && !this.isRetry);
    dialog.setContentView(view);
    return dialog;
}
Also used : Dialog(android.app.Dialog) AlertDialog(android.app.AlertDialog) LayoutInflater(android.view.LayoutInflater) View(android.view.View) TextView(android.widget.TextView) NonNull(android.support.annotation.NonNull)

Example 92 with NonNull

use of android.support.annotation.NonNull in project FirebaseUI-Android by firebase.

the class GoogleApiClientTaskHelper method getConnectedGoogleApiClient.

public Task<GoogleApiClient> getConnectedGoogleApiClient() {
    final TaskCompletionSource<GoogleApiClient> source = new TaskCompletionSource<>();
    if (!mConnectTaskRef.compareAndSet(null, source)) {
        // mConnectTaskRef Task was not null, return Task
        return mConnectTaskRef.get().getTask();
    }
    final GoogleApiClient client = mBuilder.addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {

        @Override
        public void onConnected(@Nullable Bundle bundle) {
            source.setResult(mClientRef.get());
            if (mClientRef.get() != null) {
                mClientRef.get().unregisterConnectionCallbacks(this);
            }
        }

        @Override
        public void onConnectionSuspended(int i) {
        }
    }).addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {

        @Override
        public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
            source.setException(new IOException("Failed to connect GoogleApiClient: " + connectionResult.getErrorMessage()));
            if (mClientRef.get() != null) {
                mClientRef.get().unregisterConnectionFailedListener(this);
            }
        }
    }).build();
    mClientRef.set(client);
    client.connect();
    return source.getTask();
}
Also used : TaskCompletionSource(com.google.android.gms.tasks.TaskCompletionSource) GoogleApiClient(com.google.android.gms.common.api.GoogleApiClient) Bundle(android.os.Bundle) NonNull(android.support.annotation.NonNull) ConnectionResult(com.google.android.gms.common.ConnectionResult) IOException(java.io.IOException)

Example 93 with NonNull

use of android.support.annotation.NonNull in project RecyclerViewItemAnimators by gabrielemariotti.

the class ScaleInAnimatorAdapter method getAnimators.

@NonNull
@Override
public Animator[] getAnimators(@NonNull View view) {
    ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, SCALE_X, mScaleFrom, 1f);
    ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, SCALE_Y, mScaleFrom, 1f);
    return new ObjectAnimator[] { scaleX, scaleY };
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) NonNull(android.support.annotation.NonNull)

Example 94 with NonNull

use of android.support.annotation.NonNull in project RecyclerViewItemAnimators by gabrielemariotti.

the class AnimatorUtil method concatAnimators.

/**
     * Merges given Animators into one array.
     */
@NonNull
public static Animator[] concatAnimators(@NonNull final Animator[] animators, @NonNull final Animator alphaAnimator) {
    Animator[] allAnimators = new Animator[animators.length + 1];
    int i = 0;
    for (Animator animator : animators) {
        allAnimators[i] = animator;
        ++i;
    }
    allAnimators[allAnimators.length - 1] = alphaAnimator;
    return allAnimators;
}
Also used : Animator(android.animation.Animator) NonNull(android.support.annotation.NonNull)

Example 95 with NonNull

use of android.support.annotation.NonNull in project RecyclerViewItemAnimators by gabrielemariotti.

the class ViewAnimator method onSaveInstanceState.

/**
     * Returns a Parcelable object containing the AnimationAdapter's current dynamic state.
     */
@NonNull
public Parcelable onSaveInstanceState() {
    Bundle bundle = new Bundle();
    bundle.putInt(SAVEDINSTANCESTATE_FIRSTANIMATEDPOSITION, mFirstAnimatedPosition);
    bundle.putInt(SAVEDINSTANCESTATE_LASTANIMATEDPOSITION, mLastAnimatedPosition);
    bundle.putBoolean(SAVEDINSTANCESTATE_SHOULDANIMATE, mShouldAnimate);
    return bundle;
}
Also used : Bundle(android.os.Bundle) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)747 View (android.view.View)94 TextView (android.widget.TextView)90 ArrayList (java.util.ArrayList)83 Intent (android.content.Intent)53 ContentValues (android.content.ContentValues)46 Bundle (android.os.Bundle)46 Test (org.junit.Test)45 AlertDialog (android.support.v7.app.AlertDialog)41 Cursor (android.database.Cursor)38 List (java.util.List)34 IOException (java.io.IOException)32 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)31 LayoutInflater (android.view.LayoutInflater)29 RecyclerView (android.support.v7.widget.RecyclerView)28 ImageView (android.widget.ImageView)28 File (java.io.File)28 DialogAction (com.afollestad.materialdialogs.DialogAction)25 HashMap (java.util.HashMap)25 Bitmap (android.graphics.Bitmap)24