android.support.annotation.Nullable Java Examples

The following examples show how to use android.support.annotation.Nullable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecyclerViewActivity.java    From QRefreshLayout with MIT License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recyclerview);
    setTitle("RecyclerView示例");
    recyclerView = findViewById(R.id.recyclerView);
    qRefreshLayout = findViewById(R.id.refreshLayout);
    qRefreshLayout.setOnRefreshListener(this);
    qRefreshLayout.setOnLoadListener(this);
    qRefreshLayout.setRefreshing(true);
    qRefreshLayout.setIsCanSecondFloor(true);
    ImageView imageView = new ImageView(this);
    imageView.setImageResource(R.drawable.img_test);
    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
    qRefreshLayout.setSecondFloorView(imageView);

    adapter = new RecyclerAdapter();
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
}
 
Example #2
Source File: X8MainReturnTimeTextView.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public X8MainReturnTimeTextView(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    TypedArray typedArray = getContext().obtainStyledAttributes(attrs, R.styleable.X8MainReturnTimeTextView, 0, 0);
    this.photoWidth = typedArray.getDimension(R.styleable.X8MainReturnTimeTextView_width, 0.0f);
    this.fontSize = typedArray.getDimension(R.styleable.X8MainReturnTimeTextView_fontSize, 0.0f);
    typedArray.recycle();
    this.mPaint = new Paint();
    this.mPaint.setColor(getResources().getColor(R.color.x8_main_return_time_bg));
    this.mPaint.setStyle(Style.FILL);
    this.mPaint.setAntiAlias(true);
    this.mPaintStrock = new Paint();
    this.mPaintStrock.setColor(getResources().getColor(R.color.black_70));
    this.mPaintStrock.setStrokeWidth(1.0f);
    this.mPaintStrock.setStyle(Style.STROKE);
    this.mPaintStrock.setAntiAlias(true);
    this.mPaint.setAntiAlias(true);
    this.mPaintText = new Paint();
    this.mPaintText.setTextSize(this.fontSize);
    this.mPaintText.setColor(getResources().getColor(R.color.black_70));
    this.mPaintText.setAntiAlias(false);
}
 
Example #3
Source File: Format.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public static Format createTextSampleFormat(
    @Nullable String id,
    String sampleMimeType,
    @C.SelectionFlags int selectionFlags,
    @Nullable String language,
    @Nullable DrmInitData drmInitData) {
  return createTextSampleFormat(
      id,
      sampleMimeType,
      /* codecs= */ null,
      /* bitrate= */ NO_VALUE,
      selectionFlags,
      language,
      NO_VALUE,
      drmInitData,
      OFFSET_SAMPLE_RELATIVE,
      Collections.emptyList());
}
 
Example #4
Source File: KeDouFragment.java    From v9porn with MIT License 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    unbinder = ButterKnife.bind(this, view);
    contentView.setOnRefreshListener(this);
    recyclerViewKeDou.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerViewKeDou.setAdapter(keDouAdapter);

    helper = new LoadViewHelper(recyclerViewKeDou);
    helper.setListener(() -> loadData(false));

    keDouAdapter.setOnItemClickListener((adapter, view1, position) -> {
        KeDouModel keDouModel = (KeDouModel) adapter.getItem(position);
        if (keDouModel == null) {
            return;
        }
        Intent intent = new Intent(context, KeDouPlayActivity.class);
        intent.putExtra(Keys.KEY_INTENT_KEDOUWO_ITEM, keDouModel);
        startActivityWithAnimation(intent);
    });
    keDouAdapter.setOnLoadMoreListener(() -> loadData(false), recyclerViewKeDou);
    AppUtils.setColorSchemeColors(context, contentView);
}
 
Example #5
Source File: VideoFragment.java    From YCScrollPager with Apache License 2.0 6 votes vote down vote up
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    videoPlayer = view.findViewById(R.id.video_player);
    VideoPlayerController controller = new VideoPlayerController(getActivity());
    videoPlayer.setUp(url,null);
    videoPlayer.setPlayerType(ConstantKeys.IjkPlayerType.TYPE_IJK);
    videoPlayer.setController(controller);
    ImageUtils.loadImgByPicasso(getActivity(),image,
            R.drawable.image_default,controller.imageView());
    //不从上一次位置播放,也就是每次从0播放
    videoPlayer.continueFromLastPosition(false);
    videoPlayer.postDelayed(new Runnable() {
        @Override
        public void run() {
            videoPlayer.start();
        }
    },50);
}
 
Example #6
Source File: Id3Decoder.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static @Nullable UrlLinkFrame decodeWxxxFrame(ParsableByteArray id3Data, int frameSize)
    throws UnsupportedEncodingException {
  if (frameSize < 1) {
    // Frame is malformed.
    return null;
  }

  int encoding = id3Data.readUnsignedByte();
  String charset = getCharsetName(encoding);

  byte[] data = new byte[frameSize - 1];
  id3Data.readBytes(data, 0, frameSize - 1);

  int descriptionEndIndex = indexOfEos(data, 0, encoding);
  String description = new String(data, 0, descriptionEndIndex, charset);

  int urlStartIndex = descriptionEndIndex + delimiterLength(encoding);
  int urlEndIndex = indexOfZeroByte(data, urlStartIndex);
  String url = decodeStringIfValid(data, urlStartIndex, urlEndIndex, "ISO-8859-1");

  return new UrlLinkFrame("WXXX", description, url);
}
 
Example #7
Source File: Downloader.java    From Android-VMLib with Apache License 2.0 6 votes vote down vote up
/**
 * Download file of given url.
 *
 * @param url              the url
 * @param filePath         the file path to save file
 * @param fileName         the file name of downloaded file
 * @param downloadListener the download state callback
 */
@RequiresPermission(allOf = {ACCESS_WIFI_STATE, INTERNET, ACCESS_NETWORK_STATE, WRITE_EXTERNAL_STORAGE})
public void download(@NonNull String url, @NonNull String filePath, @Nullable String fileName, @Nullable DownloadListener downloadListener) {
    this.downloadListener = downloadListener;
    this.url = url;
    this.filePath = filePath;
    if (fileName == null) L.w("The parameter 'fileName' was null, timestamp will be used.");
    this.fileName = fileName == null ? String.valueOf(System.currentTimeMillis()) : fileName;

    if (!NetworkUtils.isConnected()) {
        notifyDownloadError(ERROR_CODE_NETWORK_UNAVAILABLE);
    } else {
        if (onlyWifi) {
            checkWifiAvailable();
        } else {
            doDownload();
        }
    }
}
 
Example #8
Source File: LicenseActivity.java    From SoloPi with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_license);

    HeadControlPanel panel = (HeadControlPanel) findViewById(R.id.license_head);
    panel.setBackIconClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
    panel.setMiddleTitle(getString(R.string.activity__license));

    final WebView licenseText = (WebView) findViewById(R.id.license_text);
    licenseText.loadUrl(NOTICE_HTML);
}
 
Example #9
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static @Nullable TextInformationFrame parseIndexAndCountAttribute(
    int type, String attributeName, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, /* description= */ null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #10
Source File: HlsMediaPlaylist.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param url See {@link #url}.
 * @param initializationSegment See {@link #initializationSegment}.
 * @param title See {@link #title}.
 * @param durationUs See {@link #durationUs}.
 * @param relativeDiscontinuitySequence See {@link #relativeDiscontinuitySequence}.
 * @param relativeStartTimeUs See {@link #relativeStartTimeUs}.
 * @param fullSegmentEncryptionKeyUri See {@link #fullSegmentEncryptionKeyUri}.
 * @param encryptionIV See {@link #encryptionIV}.
 * @param byterangeOffset See {@link #byterangeOffset}.
 * @param byterangeLength See {@link #byterangeLength}.
 * @param hasGapTag See {@link #hasGapTag}.
 */
public Segment(
    String url,
    @Nullable Segment initializationSegment,
    String title,
    long durationUs,
    int relativeDiscontinuitySequence,
    long relativeStartTimeUs,
    @Nullable String fullSegmentEncryptionKeyUri,
    @Nullable String encryptionIV,
    long byterangeOffset,
    long byterangeLength,
    boolean hasGapTag) {
  this.url = url;
  this.initializationSegment = initializationSegment;
  this.title = title;
  this.durationUs = durationUs;
  this.relativeDiscontinuitySequence = relativeDiscontinuitySequence;
  this.relativeStartTimeUs = relativeStartTimeUs;
  this.fullSegmentEncryptionKeyUri = fullSegmentEncryptionKeyUri;
  this.encryptionIV = encryptionIV;
  this.byterangeOffset = byterangeOffset;
  this.byterangeLength = byterangeLength;
  this.hasGapTag = hasGapTag;
}
 
Example #11
Source File: VectorUtils.java    From zom-android-matrix with Apache License 2.0 6 votes vote down vote up
/**
 * Provide a display name for a calling room
 *
 * @param context the application context.
 * @param session the room session.
 * @param room    the room.
 * @return the calling room display name.
 */
@Nullable
public static void getCallingRoomDisplayName(Context context,
                                             final MXSession session,
                                             final Room room,
                                             final ApiCallback<String> callback) {
    if ((null == context) || (null == session) || (null == room)) {
        callback.onSuccess(null);
    } else if (room.getNumberOfJoinedMembers() == 2) {
        room.getJoinedMembersAsync(new SimpleApiCallback<List<RoomMember>>(callback) {
            @Override
            public void onSuccess(List<RoomMember> members) {
                if (TextUtils.equals(members.get(0).getUserId(), session.getMyUserId())) {
                    callback.onSuccess(room.getState().getMemberName(members.get(1).getUserId()));
                } else {
                    callback.onSuccess(room.getState().getMemberName(members.get(0).getUserId()));
                }
            }
        });
    } else {
        callback.onSuccess(room.getRoomDisplayName(context));
    }
}
 
Example #12
Source File: SingleLiveEvent.java    From Android-VMLib with Apache License 2.0 5 votes vote down vote up
@MainThread
@Override
public void setValue(@Nullable T t) {
    if (single) {
        mPending.set(true);
    }
    super.setValue(t);
}
 
Example #13
Source File: PsshAtomUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds a PSSH atom for the given system id, containing the given key ids and data.
 *
 * @param systemId The system id of the scheme.
 * @param keyIds The key ids for a version 1 PSSH atom, or null for a version 0 PSSH atom.
 * @param data The scheme specific data.
 * @return The PSSH atom.
 */
@SuppressWarnings("ParameterNotNullable")
public static byte[] buildPsshAtom(
    UUID systemId, @Nullable UUID[] keyIds, @Nullable byte[] data) {
  int dataLength = data != null ? data.length : 0;
  int psshBoxLength = Atom.FULL_HEADER_SIZE + 16 /* SystemId */ + 4 /* DataSize */ + dataLength;
  if (keyIds != null) {
    psshBoxLength += 4 /* KID_count */ + (keyIds.length * 16) /* KIDs */;
  }
  ByteBuffer psshBox = ByteBuffer.allocate(psshBoxLength);
  psshBox.putInt(psshBoxLength);
  psshBox.putInt(Atom.TYPE_pssh);
  psshBox.putInt(keyIds != null ? 0x01000000 : 0 /* version=(buildV1Atom ? 1 : 0), flags=0 */);
  psshBox.putLong(systemId.getMostSignificantBits());
  psshBox.putLong(systemId.getLeastSignificantBits());
  if (keyIds != null) {
    psshBox.putInt(keyIds.length);
    for (UUID keyId : keyIds) {
      psshBox.putLong(keyId.getMostSignificantBits());
      psshBox.putLong(keyId.getLeastSignificantBits());
    }
  }
  if (data != null && data.length != 0) {
    psshBox.putInt(data.length);
    psshBox.put(data);
  } // Else the last 4 bytes are a 0 DataSize.
  return psshBox.array();
}
 
Example #14
Source File: SubsamplingScaleImageView.java    From pdfview-android with Apache License 2.0 5 votes vote down vote up
/**
 * Convert source coordinate to view coordinate.
 * @param sx source X coordinate.
 * @param sy source Y coordinate.
 * @param vTarget target object for result. The same instance is also returned.
 * @return view coordinates. This is the same instance passed to the vTarget param.
 */
@Nullable
public final PointF sourceToViewCoord(float sx, float sy, @NonNull PointF vTarget) {
    if (vTranslate == null) {
        return null;
    }
    vTarget.set(sourceToViewX(sx), sourceToViewY(sy));
    return vTarget;
}
 
Example #15
Source File: OkView.java    From SmartLoadingView with MIT License 5 votes vote down vote up
public OkView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    paint = new Paint();
    paint.setAntiAlias(true);
    paint.setStyle(Paint.Style.FILL);


    okPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    okPaint.setStrokeWidth(5);
    okPaint.setStyle(Paint.Style.STROKE);
    okPaint.setStrokeCap(Paint.Cap.ROUND);


}
 
Example #16
Source File: DashUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Loads initialization data for the {@code representation} and optionally index data then returns
 * a {@link ChunkExtractorWrapper} which contains the output.
 *
 * @param dataSource The source from which the data should be loaded.
 * @param trackType The type of the representation. Typically one of the {@link
 *     com.google.android.exoplayer2.C} {@code TRACK_TYPE_*} constants.
 * @param representation The representation which initialization chunk belongs to.
 * @param loadIndex Whether to load index data too.
 * @return A {@link ChunkExtractorWrapper} for the {@code representation}, or null if no
 *     initialization or (if requested) index data exists.
 * @throws IOException Thrown when there is an error while loading.
 * @throws InterruptedException Thrown if the thread was interrupted.
 */
private static @Nullable ChunkExtractorWrapper loadInitializationData(
    DataSource dataSource, int trackType, Representation representation, boolean loadIndex)
    throws IOException, InterruptedException {
  RangedUri initializationUri = representation.getInitializationUri();
  if (initializationUri == null) {
    return null;
  }
  ChunkExtractorWrapper extractorWrapper = newWrappedExtractor(trackType, representation.format);
  RangedUri requestUri;
  if (loadIndex) {
    RangedUri indexUri = representation.getIndexUri();
    if (indexUri == null) {
      return null;
    }
    // It's common for initialization and index data to be stored adjacently. Attempt to merge
    // the two requests together to request both at once.
    requestUri = initializationUri.attemptMerge(indexUri, representation.baseUrl);
    if (requestUri == null) {
      loadInitializationData(dataSource, representation, extractorWrapper, initializationUri);
      requestUri = indexUri;
    }
  } else {
    requestUri = initializationUri;
  }
  loadInitializationData(dataSource, representation, extractorWrapper, requestUri);
  return extractorWrapper;
}
 
Example #17
Source File: FragmentActivity.java    From SmartRefreshHorizontal with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mFragmentClazz = getIntent().getStringExtra(EXTRA_FRAGMENT);
    FrameLayout frameLayout = new FrameLayout(this);
    frameLayout.setId(widget_frame);
    setContentView(frameLayout);
    replaceFragment();
}
 
Example #18
Source File: ColorInfo.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs the ColorInfo.
 *
 * @param colorSpace The color space of the video.
 * @param colorRange The color range of the video.
 * @param colorTransfer The color transfer characteristics of the video.
 * @param hdrStaticInfo HdrStaticInfo as defined in CTA-861.3, or null if none specified.
 */
public ColorInfo(
    @C.ColorSpace int colorSpace,
    @C.ColorRange int colorRange,
    @C.ColorTransfer int colorTransfer,
    @Nullable byte[] hdrStaticInfo) {
  this.colorSpace = colorSpace;
  this.colorRange = colorRange;
  this.colorTransfer = colorTransfer;
  this.hdrStaticInfo = hdrStaticInfo;
}
 
Example #19
Source File: ConcatenatingMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes a {@link MediaSource} from the playlist and executes a custom action on completion.
 *
 * <p>Note: If you want to move the instance, it's preferable to use {@link #moveMediaSource(int,
 * int)} instead.
 *
 * @param index The index at which the media source will be removed. This index must be in the
 *     range of 0 &lt;= index &lt; {@link #getSize()}.
 * @param actionOnCompletion A {@link Runnable} which is executed immediately after the media
 *     source has been removed from the playlist.
 */
public final synchronized void removeMediaSource(
    int index, @Nullable Runnable actionOnCompletion) {
  mediaSourcesPublic.remove(index);
  if (player != null) {
    player
        .createMessage(this)
        .setType(MSG_REMOVE)
        .setPayload(new MessageData<Void>(index, null, actionOnCompletion))
        .send();
  } else if (actionOnCompletion != null) {
    actionOnCompletion.run();
  }
}
 
Example #20
Source File: LoopingMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void prepareSourceInternal(
    ExoPlayer player,
    boolean isTopLevelSource,
    @Nullable TransferListener mediaTransferListener) {
  super.prepareSourceInternal(player, isTopLevelSource, mediaTransferListener);
  prepareChildSource(/* id= */ null, childSource);
}
 
Example #21
Source File: FileDataSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/** @param listener An optional listener. */
public FileDataSource(@Nullable TransferListener listener) {
  super(/* isNetwork= */ false);
  if (listener != null) {
    addTransferListener(listener);
  }
}
 
Example #22
Source File: DoorActivity.java    From tysq-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (NetCache.isEmpty()) {
        DataSourceActivity.startActivity(this);
    } else {
        DataSourceChangeUtils.initHtml();
        LaunchActivity.startActivity(this);
    }

    finish();

}
 
Example #23
Source File: DefaultTrackSelector.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(@Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  SelectionOverride other = (SelectionOverride) obj;
  return groupIndex == other.groupIndex && Arrays.equals(tracks, other.tracks);
}
 
Example #24
Source File: LifeCycleCompatFragment.java    From scene with Apache License 2.0 5 votes vote down vote up
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if (this.mSceneContainerLifecycleCallback != null) {
        this.mSceneContainerLifecycleCallback.onActivityCreated(getActivity(), savedInstanceState);
    } else {
        removeSelfWhenNavigationSceneUtilityIsNotInvoked();
    }
}
 
Example #25
Source File: ScrollFlowLayout.java    From FlowHelper with Apache License 2.0 5 votes vote down vote up
public ScrollFlowLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    mScreenWidth = getResources().getDisplayMetrics().widthPixels;
    mScreenHeight = getResources().getDisplayMetrics().heightPixels;
    mScroller = new Scroller(context);
    mMaximumVelocity = ViewConfiguration.get(context).getScaledMaximumFlingVelocity();
    mMinimumVelocity = ViewConfiguration.get(context).getScaledMinimumFlingVelocity();

}
 
Example #26
Source File: AnimatorFactory.java    From scene with Apache License 2.0 5 votes vote down vote up
public AnimatorFactory(@NonNull T target, @NonNull Property<T, F> property,
                       @NonNull TypeEvaluator<F> typeEvaluator, @NonNull F startValue, @NonNull F endValue,
                       @Nullable TimeInterpolator interpolator) {
    this.mTarget = target;
    this.mTypeEvaluator = typeEvaluator;
    this.mProperty = property;
    this.mStartValue = startValue;
    this.mEndValue = endValue;
    this.mInterpolator = interpolator;
}
 
Example #27
Source File: WeatherFragment.java    From OpenWeatherPlus-Android with Apache License 2.0 5 votes vote down vote up
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    if (getArguments() != null) {
        isEn = ContentUtil.APP_SETTING_LANG.equals("en") || ContentUtil.APP_SETTING_LANG.equals("sys") && ContentUtil.SYS_LANG.equals("en");
        location = getArguments().getString(PARAM);
        initObserver();
        initView(view);
        initData(location);
    }
}
 
Example #28
Source File: ExampleActivity.java    From FastWaiMai with MIT License 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //取消ActionBar
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    Latte.getConfigurator().withActivity(this);
}
 
Example #29
Source File: EventMessage.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean equals(@Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  EventMessage other = (EventMessage) obj;
  return presentationTimeUs == other.presentationTimeUs && durationMs == other.durationMs
      && id == other.id && Util.areEqual(schemeIdUri, other.schemeIdUri)
      && Util.areEqual(value, other.value) && Arrays.equals(messageData, other.messageData);
}
 
Example #30
Source File: FlacExtractor.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Peeks ID3 tag data (if present) at the beginning of the input.
 *
 * @return The first ID3 tag decoded into a {@link Metadata} object. May be null if ID3 tag is not
 *     present in the input.
 */
@Nullable
private Metadata peekId3Data(ExtractorInput input) throws IOException, InterruptedException {
  input.resetPeekPosition();
  Id3Decoder.FramePredicate id3FramePredicate =
      isId3MetadataDisabled ? Id3Decoder.NO_FRAMES_PREDICATE : null;
  return id3Peeker.peekId3Data(input, id3FramePredicate);
}