androidx.annotation.CallSuper Java Examples

The following examples show how to use androidx.annotation.CallSuper. 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: AbstractScanner.java    From easyble-x with Apache License 2.0 6 votes vote down vote up
@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, "");
                }
            }
        }
    }
}
 
Example #2
Source File: MediaCodecVideoRenderer.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
  }
}
 
Example #3
Source File: MainActivity.java    From leafpicrevived with GNU General Public License v3.0 6 votes vote down vote up
@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));
}
 
Example #4
Source File: AwesomeFragment.java    From AndroidNavigation with MIT License 6 votes vote down vote up
@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);
    }
}
 
Example #5
Source File: RoomDatabase.java    From FairEmail with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #6
Source File: SimpleDecoderVideoRenderer.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
  }
}
 
Example #7
Source File: PaletteActivity.java    From leafpicrevived with GNU General Public License v3.0 6 votes vote down vote up
@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());
}
 
Example #8
Source File: BasePreferenceActivity.java    From CommonUtils with Apache License 2.0 5 votes vote down vote up
@Override
@CallSuper
protected void onStart() {
    super.onStart();

    if (billingHelper == null && FossUtils.hasGoogleBilling()) {
        billingHelper = new PreferencesBillingHelper(this, "donation.lemonade",
                "donation.coffee",
                "donation.hamburger",
                "donation.pizza",
                "donation.sushi",
                "donation.champagne");
        billingHelper.onStart(this);
    }
}
 
Example #9
Source File: DynamicRecyclerViewNested.java    From dynamic-support with Apache License 2.0 5 votes vote down vote up
@CallSuper
@Override
protected void onCreateRecyclerView(@NonNull RecyclerView recyclerView) {
    super.onCreateRecyclerView(recyclerView);

    ViewCompat.setNestedScrollingEnabled(recyclerView, false);
}
 
Example #10
Source File: AbsBaseFragment.java    From call_manage with MIT License 5 votes vote down vote up
@Override
@CallSuper
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    ButterKnife.bind(this, getView());
    onFragmentReady();
}
 
Example #11
Source File: AnalyticsApplication.java    From CommonUtils with Apache License 2.0 5 votes vote down vote up
@Override
@CallSuper
public void onCreate() {
    super.onCreate();

    String uuid = Prefs.getString(CommonPK.ANALYTICS_USER_ID, null);
    if (uuid == null) {
        uuid = UUID.randomUUID().toString();
        Prefs.putString(CommonPK.ANALYTICS_USER_ID, uuid);
    }

    if (FossUtils.hasFirebaseCrashlytics()) {
        if (Prefs.getBoolean(CommonPK.CRASH_REPORT_ENABLED)) {
            FirebaseCrashlytics.getInstance().setUserId(uuid);
            CRASHLYTICS_ENABLED = true;
        } else {
            CRASHLYTICS_ENABLED = false;
        }
    } else {
        Prefs.putBoolean(CommonPK.CRASH_REPORT_ENABLED, false);
    }

    if (FossUtils.hasFirebaseAnalytics()) {
        ANALYTICS = FirebaseAnalytics.getInstance(this);
        if (Prefs.getBoolean(CommonPK.TRACKING_ENABLED)) {
            ANALYTICS.setUserId(uuid);
            ANALYTICS.setAnalyticsCollectionEnabled(true);
        } else {
            ANALYTICS.setAnalyticsCollectionEnabled(false);
            ANALYTICS = null;
        }
    } else {
        Prefs.putBoolean(CommonPK.TRACKING_ENABLED, false);
    }
}
 
Example #12
Source File: BasePreferenceActivity.java    From CommonUtils with Apache License 2.0 5 votes vote down vote up
@CallSuper
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
    if (item.getItemId() == android.R.id.home) {
        onBackPressed();
        return true;
    }

    return super.onOptionsItemSelected(item);
}
 
Example #13
Source File: BaseTranscoder.java    From GIFCompressor with Apache License 2.0 5 votes vote down vote up
/**
 * Wraps the start operation on the encoder.
 * @param format output format
 * @param encoder encoder
 */
@CallSuper
protected void onStartEncoder(@NonNull MediaFormat format, @NonNull MediaCodec encoder) {
    encoder.start();
    mEncoderStarted = true;
    mEncoderBuffers = new MediaCodecBuffers(encoder);
}
 
Example #14
Source File: BasePreferenceActivity.java    From CommonUtils with Apache License 2.0 5 votes vote down vote up
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_base_preference);

    ActionBar bar = getSupportActionBar();
    if (bar != null) bar.setDisplayHomeAsUpEnabled(true);

    showMainFragment();
}
 
Example #15
Source File: UpdaterFragment.java    From Aria2App with GNU General Public License v3.0 5 votes vote down vote up
@Override
@CallSuper
public void onAttach(@NonNull Context context) {
    if (context instanceof UpdaterActivity) {
        UpdaterActivity activity = (UpdaterActivity) context;
        this.framework = activity.getFramework();
        this.provider = activity.attachReceiver(this, this);
    }

    super.onAttach(context);
}
 
Example #16
Source File: AudioOutputAdapter.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example #17
Source File: MediatorLiveData.java    From FairEmail with GNU General Public License v3.0 5 votes vote down vote up
@CallSuper
@Override
protected void onActive() {
    for (Map.Entry<LiveData<?>, Source<?>> source : mSources) {
        source.getValue().plug();
    }
}
 
Example #18
Source File: MediatorLiveData.java    From FairEmail with GNU General Public License v3.0 5 votes vote down vote up
@CallSuper
@Override
protected void onInactive() {
    for (Map.Entry<LiveData<?>, Source<?>> source : mSources) {
        source.getValue().unplug();
    }
}
 
Example #19
Source File: BaseTranscoder.java    From GIFCompressor with Apache License 2.0 5 votes vote down vote up
/**
 * Called when the encoder has defined its actual output format.
 * @param format format
 */
@CallSuper
@SuppressWarnings("WeakerAccess")
protected void onEncoderOutputFormatChanged(@NonNull MediaCodec encoder, @NonNull MediaFormat format) {
    if (mActualOutputFormat != null) {
        throw new RuntimeException("Audio output format changed twice.");
    }
    mActualOutputFormat = format;
    mDataSink.setFormat(mActualOutputFormat);
}
 
Example #20
Source File: BaseMvpActivity.java    From WanAndroid with Apache License 2.0 5 votes vote down vote up
@Override
@CallSuper
protected void initData() {
    if(mPresenter != null){
        mPresenter.subscribeEvent();
    }
}
 
Example #21
Source File: TaskPreference.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
@CallSuper
@Override
protected void onPostExecute(Object o) {
    mApplication.removeGlobalStuff(this);
    if (null != mPreference) {
        mPreference.onTaskEnd();
    }
}
 
Example #22
Source File: BaseActivityPresenter.java    From WanAndroid with Apache License 2.0 5 votes vote down vote up
@Override
@CallSuper
public void subscribeEvent() {
    addSubscriber(
            RxBus.getInstance().toObservable(NetWorkChangeEvent.class)
                    .subscribe(netWorkChangeEvent -> mView.showTipsView(netWorkChangeEvent.isConnection()))
    );

    addSubscriber(RxBus.getInstance().toObservable(ReLoadEvent.class)
            .subscribe(reLoadEvent -> mView.reLoad()));
}
 
Example #23
Source File: SplashScreen.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
@CallSuper
@Override
public void updateUiElements() {
    super.updateUiElements();
    ((ProgressBar) findViewById(R.id.progress_splash)).getIndeterminateDrawable().setColorFilter(getPrimaryColor(), PorterDuff.Mode.SRC_ATOP);
    findViewById(com.alienpants.leafpicrevived.R.id.Splah_Bg).setBackgroundColor(getBackgroundColor());
}
 
Example #24
Source File: AddDownloadActivity.java    From Aria2App with GNU General Public License v3.0 5 votes vote down vote up
@Override
@CallSuper
protected final void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    startedForResult = getIntent().getBooleanExtra("startedForResult", false);
    startedForEdit = getIntent().getIntExtra("startedForEdit", -1);
    if (startedForEdit >= 0) startedForResult = true;
    onCreate(savedInstanceState, (AddDownloadBundle) getIntent().getSerializableExtra("edit"));
}
 
Example #25
Source File: SecurityActivity.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
@CallSuper
@Override
public void updateUiElements() {
    super.updateUiElements();
    setRecentApp(getString(R.string.security));
    toolbar.setBackgroundColor(getPrimaryColor());

    setSwitchColor(getAccentColor(), swActiveSecurity, swApplySecurityHidden, swApplySecurityDelete, swFingerPrint);
    toggleEnabledChild(swActiveSecurity.isChecked());

    setStatusBarColor();
    setNavBarColor();

    llroot.setBackgroundColor(getBackgroundColor());
    ((CardView) findViewById(com.alienpants.leafpicrevived.R.id.security_dialog_card)).setCardBackgroundColor(getCardBackgroundColor());

    /** ICONS **/
    int color = getIconColor();
    ((ThemedIcon) findViewById(com.alienpants.leafpicrevived.R.id.active_security_icon)).setColor(color);
    ((ThemedIcon) findViewById(com.alienpants.leafpicrevived.R.id.security_body_apply_hidden_icon)).setColor(color);
    ((ThemedIcon) findViewById(com.alienpants.leafpicrevived.R.id.security_body_apply_delete_icon)).setColor(color);
    ((ThemedIcon) findViewById(com.alienpants.leafpicrevived.R.id.active_security_fingerprint_icon)).setColor(color);

    /** TEXTVIEWS **/
    color = getTextColor();
    ((TextView) findViewById(com.alienpants.leafpicrevived.R.id.active_security_item_title)).setTextColor(color);
    ((TextView) findViewById(com.alienpants.leafpicrevived.R.id.security_body_apply_on)).setTextColor(color);
    ((TextView) findViewById(com.alienpants.leafpicrevived.R.id.security_body_apply_hidden_title)).setTextColor(color);
    ((TextView) findViewById(com.alienpants.leafpicrevived.R.id.security_body_apply_delete_title)).setTextColor(color);
    ((TextView) findViewById(com.alienpants.leafpicrevived.R.id.active_security_fingerprint_item_title)).setTextColor(color);

}
 
Example #26
Source File: AboutActivity.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
@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());
}
 
Example #27
Source File: BaseMvpFragment.java    From WanAndroid with Apache License 2.0 5 votes vote down vote up
@Override
@CallSuper
protected void loadData() {
    if(mPresenter != null){
        mPresenter.subscribeEvent();
    }
}
 
Example #28
Source File: TabView.java    From AndroidNavigation with MIT License 5 votes vote down vote up
@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();
    }
}
 
Example #29
Source File: MediatorLiveData.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@CallSuper
@Override
protected void onInactive() {
    for (Map.Entry<LiveData<?>, Source<?>> source : mSources) {
        source.getValue().unplug();
    }
}
 
Example #30
Source File: MediatorLiveData.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@CallSuper
@Override
protected void onActive() {
    for (Map.Entry<LiveData<?>, Source<?>> source : mSources) {
        source.getValue().plug();
    }
}