use of androidx.annotation.CheckResult in project react-native-navigation by wix.
the class Options method mergeWith.
@CheckResult
public Options mergeWith(final Options other) {
Options result = copy();
result.topBar.mergeWith(other.topBar);
result.topTabs.mergeWith(other.topTabs);
result.topTabOptions.mergeWith(other.topTabOptions);
result.bottomTabOptions.mergeWith(other.bottomTabOptions);
result.bottomTabsOptions.mergeWith(other.bottomTabsOptions);
result.fabOptions.mergeWith(other.fabOptions);
result.animations.mergeWith(other.animations);
result.sideMenuRootOptions.mergeWith(other.sideMenuRootOptions);
result.modal.mergeWith(other.modal);
result.navigationBar.mergeWith(other.navigationBar);
result.statusBar.mergeWith(other.statusBar);
result.layout.mergeWith(other.layout);
result.hardwareBack.mergeWith(other.hardwareBack);
return result;
}
use of androidx.annotation.CheckResult in project ExoPlayer by google.
the class ExoPlayerImplInternal method handlePositionDiscontinuity.
@CheckResult
private PlaybackInfo handlePositionDiscontinuity(MediaPeriodId mediaPeriodId, long positionUs, long requestedContentPositionUs, long discontinuityStartPositionUs, boolean reportDiscontinuity, @DiscontinuityReason int discontinuityReason) {
deliverPendingMessageAtStartPositionRequired = deliverPendingMessageAtStartPositionRequired || positionUs != playbackInfo.positionUs || !mediaPeriodId.equals(playbackInfo.periodId);
resetPendingPauseAtEndOfPeriod();
TrackGroupArray trackGroupArray = playbackInfo.trackGroups;
TrackSelectorResult trackSelectorResult = playbackInfo.trackSelectorResult;
List<Metadata> staticMetadata = playbackInfo.staticMetadata;
if (mediaSourceList.isPrepared()) {
@Nullable MediaPeriodHolder playingPeriodHolder = queue.getPlayingPeriod();
trackGroupArray = playingPeriodHolder == null ? TrackGroupArray.EMPTY : playingPeriodHolder.getTrackGroups();
trackSelectorResult = playingPeriodHolder == null ? emptyTrackSelectorResult : playingPeriodHolder.getTrackSelectorResult();
staticMetadata = extractMetadataFromTrackSelectionArray(trackSelectorResult.selections);
// Ensure the media period queue requested content position matches the new playback info.
if (playingPeriodHolder != null && playingPeriodHolder.info.requestedContentPositionUs != requestedContentPositionUs) {
playingPeriodHolder.info = playingPeriodHolder.info.copyWithRequestedContentPositionUs(requestedContentPositionUs);
}
} else if (!mediaPeriodId.equals(playbackInfo.periodId)) {
// Reset previously kept track info if unprepared and the period changes.
trackGroupArray = TrackGroupArray.EMPTY;
trackSelectorResult = emptyTrackSelectorResult;
staticMetadata = ImmutableList.of();
}
if (reportDiscontinuity) {
playbackInfoUpdate.setPositionDiscontinuity(discontinuityReason);
}
return playbackInfo.copyWithNewPosition(mediaPeriodId, positionUs, requestedContentPositionUs, discontinuityStartPositionUs, getTotalBufferedDurationUs(), trackGroupArray, trackSelectorResult, staticMetadata);
}
use of androidx.annotation.CheckResult in project Rocket by mozilla-tw.
the class RequestOptions method optionalTransform.
/**
* Applies the given {@link Transformation} for
* {@link Bitmap Bitmaps} to the default types ({@link Bitmap},
* {@link android.graphics.drawable.BitmapDrawable}, and ignores unknown types.
*
* <p>This will override previous calls to {@link #dontTransform()}.
*
* @param transformation Any {@link Transformation} for {@link Bitmap}s.
* @see #transform(Transformation)
* @see #transform(Class, Transformation)
*/
// Guaranteed to modify the current object by the isAutoCloneEnabledCheck.
@SuppressWarnings("CheckResult")
@CheckResult
public RequestOptions optionalTransform(Transformation<Bitmap> transformation) {
if (isAutoCloneEnabled) {
return clone().optionalTransform(transformation);
}
optionalTransform(Bitmap.class, transformation);
// TODO: remove BitmapDrawable decoder and this transformation.
optionalTransform(BitmapDrawable.class, new BitmapDrawableTransformation(transformation));
return selfOrThrowIfLocked();
}
Aggregations