类androidx.annotation.CallSuper源码实例Demo

下面列出了怎么用androidx.annotation.CallSuper的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: AndroidNavigation   文件: AwesomeFragment.java
@CallSuper
protected void onStatusBarTranslucentChanged(boolean translucent) {
    AwesomeToolbar toolbar = getAwesomeToolbar();
    if (toolbar != null) {
        if (translucent) {
            appendStatusBarPadding(toolbar);
        } else {
            removeStatusBarPadding(toolbar);
        }
    }

    if (getView() != null) {
        fixKeyboardBugAtKitkat(getView(), translucent);
    }

    List<AwesomeFragment> children = getChildFragmentsAtAddedList();
    for (int i = 0, size = children.size(); i < size; i++) {
        AwesomeFragment child = children.get(i);
        child.onStatusBarTranslucentChanged(translucent);
    }
}
 
源代码2 项目: MediaSDK   文件: MediaCodecVideoRenderer.java
/**
 * Called when an output buffer is successfully processed.
 *
 * @param presentationTimeUs The timestamp associated with the output buffer.
 */
@CallSuper
@Override
protected void onProcessedOutputBuffer(long presentationTimeUs) {
  buffersInCodecCount--;
  while (pendingOutputStreamOffsetCount != 0
      && presentationTimeUs >= pendingOutputStreamSwitchTimesUs[0]) {
    outputStreamOffsetUs = pendingOutputStreamOffsetsUs[0];
    pendingOutputStreamOffsetCount--;
    System.arraycopy(
        pendingOutputStreamOffsetsUs,
        /* srcPos= */ 1,
        pendingOutputStreamOffsetsUs,
        /* destPos= */ 0,
        pendingOutputStreamOffsetCount);
    System.arraycopy(
        pendingOutputStreamSwitchTimesUs,
        /* srcPos= */ 1,
        pendingOutputStreamSwitchTimesUs,
        /* destPos= */ 0,
        pendingOutputStreamOffsetCount);
    clearRenderedFirstFrame();
  }
}
 
源代码3 项目: MediaSDK   文件: SimpleDecoderVideoRenderer.java
/**
 * Flushes the decoder.
 *
 * @throws ExoPlaybackException If an error occurs reinitializing a decoder.
 */
@CallSuper
protected void flushDecoder() throws ExoPlaybackException {
  waitingForKeys = false;
  buffersInCodecCount = 0;
  if (decoderReinitializationState != REINITIALIZATION_STATE_NONE) {
    releaseDecoder();
    maybeInitDecoder();
  } else {
    inputBuffer = null;
    if (outputBuffer != null) {
      outputBuffer.release();
      outputBuffer = null;
    }
    decoder.flush();
    decoderReceivedBuffers = false;
  }
}
 
源代码4 项目: leafpicrevived   文件: MainActivity.java
@CallSuper
@Override
public void updateUiElements() {
    super.updateUiElements();
    //TODO: MUST BE FIXED
    toolbar.setPopupTheme(getPopupToolbarStyle());
    toolbar.setBackgroundColor(getPrimaryColor());

    /**** SWIPE TO REFRESH ****/

    setStatusBarColor();
    setNavBarColor();

    fab.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
    fab.setVisibility(Hawk.get(getString(R.string.preference_show_fab), false) ? View.VISIBLE : View.GONE);
    mainLayout.setBackgroundColor(getBackgroundColor());

    setScrollViewColor(navigationDrawerView);
    setAllScrollbarsColor();

    navigationDrawerView.setTheme(getPrimaryColor(), getBackgroundColor(), getTextColor(), getIconColor());

    // TODO Calvin: This performs a NO-OP. Find out what this is used for
    setRecentApp(getString(R.string.app_name));
}
 
源代码5 项目: leafpicrevived   文件: PaletteActivity.java
@CallSuper
@Override
public void updateUiElements() {
    super.updateUiElements();

    toolbar.setBackgroundColor(getPrimaryColor());
    toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });

    setStatusBarColor();
    setNavBarColor();
    setRecentApp(getString(R.string.palette));

    findViewById(R.id.palette_background).setBackgroundColor(getBackgroundColor());
    ((CardView) findViewById(R.id.palette_colors_card)).setCardBackgroundColor(getCardBackgroundColor());
    ((CardView) findViewById(R.id.palette_image_card)).setCardBackgroundColor(getCardBackgroundColor());
    ((TextView) findViewById(R.id.palette_image_title)).setTextColor(getTextColor());
    ((TextView) findViewById(R.id.palette_image_caption)).setTextColor(getSubTextColor());
}
 
源代码6 项目: easyble-x   文件: AbstractScanner.java
@CallSuper
@Override
public void stopScan(boolean quietly) {
    mainHandler.removeCallbacks(stopScanRunnable);
    int size = proxyBluetoothProfiles.size();
    for (int i = 0; i < size; i++) {
        try {
            bluetoothAdapter.closeProfileProxy(proxyBluetoothProfiles.keyAt(i), proxyBluetoothProfiles.valueAt(i));
        } catch (Exception ignore) {
        }
    }
    proxyBluetoothProfiles.clear();
    if (isBtEnabled()) {
        performStopScan();
    }
    if (getType() != ScannerType.CLASSIC) {
        synchronized (this) {
            if (isScanning) {
                isScanning = false;
                if (!quietly) {
                    handleScanCallback(false, null, false, -1, "");
                }
            }
        }
    }
}
 
源代码7 项目: FairEmail   文件: RoomDatabase.java
/**
 * Called by {@link Room} when it is initialized.
 *
 * @param configuration The database configuration.
 */
@CallSuper
public void init(@NonNull DatabaseConfiguration configuration) {
    mOpenHelper = createOpenHelper(configuration);
    if (mOpenHelper instanceof SQLiteCopyOpenHelper) {
        SQLiteCopyOpenHelper copyOpenHelper = (SQLiteCopyOpenHelper) mOpenHelper;
        copyOpenHelper.setDatabaseConfiguration(configuration);
    }
    boolean wal = false;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        wal = configuration.journalMode == JournalMode.WRITE_AHEAD_LOGGING;
        mOpenHelper.setWriteAheadLoggingEnabled(wal);
    }
    mCallbacks = configuration.callbacks;
    mQueryExecutor = configuration.queryExecutor;
    mTransactionExecutor = new TransactionExecutor(configuration.transactionExecutor);
    mAllowMainThreadQueries = configuration.allowMainThreadQueries;
    mWriteAheadLoggingEnabled = wal;
    if (configuration.multiInstanceInvalidation) {
        mInvalidationTracker.startMultiInstanceInvalidation(configuration.context,
                configuration.name);
    }
}
 
源代码8 项目: mollyim-android   文件: AudioOutputAdapter.java
@CallSuper
void bind(@NonNull WebRtcAudioOutput audioOutput, @Nullable WebRtcAudioOutput selected) {
  textView.setText(audioOutput.getLabelRes());
  textView.setCompoundDrawablesRelativeWithIntrinsicBounds(audioOutput.getIconRes(), 0, 0, 0);

  radioButton.setOnCheckedChangeListener(null);
  radioButton.setChecked(audioOutput == selected);
  radioButton.setOnCheckedChangeListener(this);
}
 
源代码9 项目: SAI   文件: SelectableAdapter.java
@CallSuper
@Override
public void onViewRecycled(@NonNull ViewHolder holder) {
    int adapterPosition = holder.getAdapterPosition();
    if (adapterPosition == RecyclerView.NO_POSITION)
        return;

    //onViewRecycled calls seem to be batched after onBindViewHolder calls, that will lead to clearing an actually required key without this check
    if (mRecycler.findViewHolderForAdapterPosition(adapterPosition) == null) {
        Key key = mPositionToKey.remove(adapterPosition);
        if (key != null)
            mKeyToPosition.remove(key);
    }
}
 
源代码10 项目: MediaSDK   文件: MatroskaExtractor.java
@CallSuper
@Override
public void seek(long position, long timeUs) {
  clusterTimecodeUs = C.TIME_UNSET;
  blockState = BLOCK_STATE_START;
  reader.reset();
  varintReader.reset();
  resetWriteSampleData();
  for (int i = 0; i < tracks.size(); i++) {
    tracks.valueAt(i).reset();
  }
}
 
源代码11 项目: SAI   文件: SelectableAdapter.java
@CallSuper
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
    Key key = getKeyForPosition(position);
    mKeyToPosition.put(key, position);
    mPositionToKey.put(position, key);
}
 
源代码12 项目: MediaSDK   文件: CompositeMediaSource.java
@Override
@CallSuper
public void maybeThrowSourceInfoRefreshError() throws IOException {
  for (MediaSourceAndListener childSource : childSources.values()) {
    childSource.mediaSource.maybeThrowSourceInfoRefreshError();
  }
}
 
源代码13 项目: MediaSDK   文件: CompositeMediaSource.java
@Override
@CallSuper
protected void enableInternal() {
  for (MediaSourceAndListener childSource : childSources.values()) {
    childSource.mediaSource.enable(childSource.caller);
  }
}
 
源代码14 项目: MediaSDK   文件: CompositeMediaSource.java
@Override
@CallSuper
protected void disableInternal() {
  for (MediaSourceAndListener childSource : childSources.values()) {
    childSource.mediaSource.disable(childSource.caller);
  }
}
 
源代码15 项目: MediaSDK   文件: CompositeMediaSource.java
@Override
@CallSuper
protected void releaseSourceInternal() {
  for (MediaSourceAndListener childSource : childSources.values()) {
    childSource.mediaSource.releaseSource(childSource.caller);
    childSource.mediaSource.removeEventListener(childSource.eventListener);
  }
  childSources.clear();
}
 
源代码16 项目: MediaSDK   文件: SimpleDecoder.java
@CallSuper
@Override
public void release() {
  synchronized (lock) {
    released = true;
    lock.notify();
  }
  try {
    decodeThread.join();
  } catch (InterruptedException e) {
    Thread.currentThread().interrupt();
  }
}
 
@CallSuper
@Override
public void onAnimationRepeated(Animator animation) {
    super.onAnimationRepeated(animation);

    if(mAnimatorListenerAdapter != null) {
        mAnimatorListenerAdapter.onAnimationRepeated(animation);
    }
}
 
源代码18 项目: MediaSDK   文件: BaseAudioProcessor.java
@CallSuper
@Override
public ByteBuffer getOutput() {
  ByteBuffer outputBuffer = this.outputBuffer;
  this.outputBuffer = EMPTY_BUFFER;
  return outputBuffer;
}
 
源代码19 项目: MediaSDK   文件: MediaCodecVideoRenderer.java
@CallSuper
@Override
protected void releaseCodec() {
  try {
    super.releaseCodec();
  } finally {
    buffersInCodecCount = 0;
  }
}
 
源代码20 项目: MediaSDK   文件: MediaCodecVideoRenderer.java
@CallSuper
@Override
protected boolean flushOrReleaseCodec() {
  try {
    return super.flushOrReleaseCodec();
  } finally {
    buffersInCodecCount = 0;
  }
}
 
源代码21 项目: HaoReader   文件: PageAnimation.java
@CallSuper
public void init(int w, int h, PageView view, OnPageChangeListener listener) {
    mViewWidth = w;
    mViewHeight = h;

    mView = view;
    mListener = listener;

    mScroller = new Scroller(mView.getContext(), new FastOutLinearInInterpolator());
}
 
源代码22 项目: MediaSDK   文件: SimpleDecoderVideoRenderer.java
/**
 * Called when a new format is read from the upstream source.
 *
 * @param formatHolder A {@link FormatHolder} that holds the new {@link Format}.
 * @throws ExoPlaybackException If an error occurs (re-)initializing the decoder.
 */
@CallSuper
@SuppressWarnings("unchecked")
protected void onInputFormatChanged(FormatHolder formatHolder) throws ExoPlaybackException {
  waitingForFirstSampleInFormat = true;
  Format newFormat = Assertions.checkNotNull(formatHolder.format);
  if (formatHolder.includesDrmSession) {
    setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
  } else {
    sourceDrmSession =
        getUpdatedSourceDrmSession(inputFormat, newFormat, drmSessionManager, sourceDrmSession);
  }
  inputFormat = newFormat;

  if (sourceDrmSession != decoderDrmSession) {
    if (decoderReceivedBuffers) {
      // Signal end of stream and wait for any final output buffers before re-initialization.
      decoderReinitializationState = REINITIALIZATION_STATE_SIGNAL_END_OF_STREAM;
    } else {
      // There aren't any final output buffers, so release the decoder immediately.
      releaseDecoder();
      maybeInitDecoder();
    }
  }

  eventDispatcher.inputFormatChanged(inputFormat);
}
 
源代码23 项目: arcusandroid   文件: BaseCareController.java
@CallSuper @Override protected void onSubsystemLoaded(ModelAddedEvent event) {
    SubsystemModel careSubsystem = getModel();
    if (careSubsystem == null) {
        return;
    }

    CareBehaviorTemplateProvider.instance().setSubsystemAddress(careSubsystem.getAddress());
    CareBehaviorsProvider.instance().setSubsystemAddress(careSubsystem.getAddress());
    super.onSubsystemLoaded(event);
}
 
@CallSuper
@Override
public void onAnimationStarted(Animator animation) {
    super.onAnimationStarted(animation);

    if(mAnimatorListenerAdapter != null) {
        mAnimatorListenerAdapter.onAnimationStarted(animation);
    }
}
 
源代码25 项目: call_manage   文件: AbsAppBarActivity.java
@Override
@CallSuper
protected void onStart() {
    super.onStart();
    ButterKnife.bind(this);

    // Set text
    mTextTitle.setText(getTitle());
    setSupportActionBar(mToolbar);
    getSupportActionBar().setTitle("");
}
 
源代码26 项目: android_9.0.0_r45   文件: MediatorLiveData.java
@CallSuper
@Override
protected void onActive() {
    for (Map.Entry<LiveData<?>, Source<?>> source : mSources) {
        source.getValue().plug();
    }
}
 
源代码27 项目: android_9.0.0_r45   文件: MediatorLiveData.java
@CallSuper
@Override
protected void onInactive() {
    for (Map.Entry<LiveData<?>, Source<?>> source : mSources) {
        source.getValue().unplug();
    }
}
 
源代码28 项目: AndroidNavigation   文件: TabView.java
@CallSuper
public void initialise() {
    iconView.setSelected(false);
    if (icon != null && unselectedIcon != null) {
        StateListDrawable states = new StateListDrawable();
        states.addState(new int[]{android.R.attr.state_selected},
                icon);
        states.addState(new int[]{-android.R.attr.state_selected},
                unselectedIcon);
        states.addState(new int[]{},
                unselectedIcon);
        iconView.setImageDrawable(states);
    } else if (icon != null) {
        DrawableCompat.setTintList(icon, new ColorStateList(
                new int[][]{
                        new int[]{android.R.attr.state_selected}, //1
                        new int[]{-android.R.attr.state_selected}, //2
                        new int[]{}
                },
                new int[]{
                        selectedColor, //1
                        unselectedColor, //2
                        unselectedColor //3
                }
        ));
        iconView.setImageDrawable(icon);
    }

    if (badgeText != null) {
        showTextBadge(badgeText);
    }

    if (showDotBadge) {
        showDotBadge();
    }
}
 
源代码29 项目: WanAndroid   文件: BaseMvpFragment.java
@Override
@CallSuper
protected void loadData() {
    if(mPresenter != null){
        mPresenter.subscribeEvent();
    }
}
 
源代码30 项目: leafpicrevived   文件: AboutActivity.java
@CallSuper
@Override
public void updateUiElements() {
    super.updateUiElements();
    toolbar.setBackgroundColor(getPrimaryColor());
    toolbar.setNavigationIcon(getToolbarIcon(GoogleMaterial.Icon.gmd_arrow_back));
    toolbar.setNavigationOnClickListener(v -> onBackPressed());

    setScrollViewColor(aboutScrollView);
    setStatusBarColor();
    setNavBarColor();

    specialThanksPatryk.setLinkTextColor(getAccentColor());
}