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;
}
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();
}
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 };
}
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;
}
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;
}
Aggregations