Search in sources :

Example 6 with CheckResult

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;
}
Also used : LayoutOptions(com.reactnativenavigation.options.layout.LayoutOptions) CheckResult(androidx.annotation.CheckResult)

Example 7 with CheckResult

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);
}
Also used : TrackSelectorResult(com.google.android.exoplayer2.trackselection.TrackSelectorResult) TrackGroupArray(com.google.android.exoplayer2.source.TrackGroupArray) Metadata(com.google.android.exoplayer2.metadata.Metadata) Nullable(androidx.annotation.Nullable) CheckResult(androidx.annotation.CheckResult)

Example 8 with CheckResult

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();
}
Also used : BitmapDrawableTransformation(com.bumptech.glide.load.resource.bitmap.BitmapDrawableTransformation) CheckResult(androidx.annotation.CheckResult)

Aggregations

CheckResult (androidx.annotation.CheckResult)8 LayoutOptions (com.reactnativenavigation.options.layout.LayoutOptions)2 SuppressLint (android.annotation.SuppressLint)1 PendingIntent (android.app.PendingIntent)1 ActivityNotFoundException (android.content.ActivityNotFoundException)1 Intent (android.content.Intent)1 Drawable (android.graphics.drawable.Drawable)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 Toast (android.widget.Toast)1 Nullable (androidx.annotation.Nullable)1 Options (com.bumptech.glide.load.Options)1 BitmapDrawableTransformation (com.bumptech.glide.load.resource.bitmap.BitmapDrawableTransformation)1 Metadata (com.google.android.exoplayer2.metadata.Metadata)1 TrackGroupArray (com.google.android.exoplayer2.source.TrackGroupArray)1 TrackSelectorResult (com.google.android.exoplayer2.trackselection.TrackSelectorResult)1 JSONArray (org.json.JSONArray)1