Search in sources :

Example 11 with CallSuper

use of androidx.annotation.CallSuper in project BottomNavigation by Ashok-Varma.

the class BottomNavigationTab method initialise.

@CallSuper
public void initialise(boolean setActiveColor) {
    iconView.setSelected(false);
    if (isInActiveIconSet) {
        StateListDrawable states = new StateListDrawable();
        states.addState(new int[] { android.R.attr.state_selected }, mCompactIcon);
        states.addState(new int[] { -android.R.attr.state_selected }, mCompactInActiveIcon);
        states.addState(new int[] {}, mCompactInActiveIcon);
        iconView.setImageDrawable(states);
    } else {
        if (setActiveColor) {
            DrawableCompat.setTintList(mCompactIcon, new ColorStateList(new int[][] { // 1
            new int[] { android.R.attr.state_selected }, // 2
            new int[] { -android.R.attr.state_selected }, new int[] {} }, new int[] { // 1
            mActiveColor, // 2
            mInActiveColor, // 3
            mInActiveColor }));
        } else {
            DrawableCompat.setTintList(mCompactIcon, new ColorStateList(new int[][] { // 1
            new int[] { android.R.attr.state_selected }, // 2
            new int[] { -android.R.attr.state_selected }, new int[] {} }, new int[] { // 1
            mBackgroundColor, // 2
            mInActiveColor, // 3
            mInActiveColor }));
        }
        iconView.setImageDrawable(mCompactIcon);
    }
    if (isNoTitleMode) {
        labelView.setVisibility(GONE);
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) iconContainerView.getLayoutParams();
        layoutParams.gravity = Gravity.CENTER;
        setNoTitleIconContainerParams(layoutParams);
        iconContainerView.setLayoutParams(layoutParams);
        FrameLayout.LayoutParams iconLayoutParams = (FrameLayout.LayoutParams) iconView.getLayoutParams();
        setNoTitleIconParams(iconLayoutParams);
        iconView.setLayoutParams(iconLayoutParams);
    }
}
Also used : FrameLayout(android.widget.FrameLayout) ColorStateList(android.content.res.ColorStateList) StateListDrawable(android.graphics.drawable.StateListDrawable) CallSuper(androidx.annotation.CallSuper)

Example 12 with CallSuper

use of androidx.annotation.CallSuper in project android-oss by kickstarter.

the class BaseBottomSheetDialogFragment method onCreateView.

/**
 * Called when a fragment instantiates its user interface view, between `onCreate` and `onActivityCreated`.
 * Can return null for non-graphical fragments.
 */
@CallSuper
@Override
@Nullable
public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) {
    final View view = super.onCreateView(inflater, container, savedInstanceState);
    Timber.d("onCreateView %s", this.toString());
    this.lifecycle.onNext(FragmentEvent.CREATE_VIEW);
    return view;
}
Also used : View(android.view.View) CallSuper(androidx.annotation.CallSuper) Nullable(androidx.annotation.Nullable)

Example 13 with CallSuper

use of androidx.annotation.CallSuper in project android-oss by kickstarter.

the class BaseBottomSheetDialogFragment method onResume.

@CallSuper
@Override
public void onResume() {
    super.onResume();
    Timber.d("onResume %s", this.toString());
    this.lifecycle.onNext(FragmentEvent.RESUME);
    assignViewModel(null);
    if (this.viewModel != null) {
        this.viewModel.onResume(this);
        final FragmentActivity activity = getActivity();
        if (activity != null) {
            activity.registerReceiver(this.optimizelyReadyReceiver, new IntentFilter(ExperimentsClientTypeKt.EXPERIMENTS_CLIENT_READY));
        }
    }
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity) IntentFilter(android.content.IntentFilter) CallSuper(androidx.annotation.CallSuper)

Example 14 with CallSuper

use of androidx.annotation.CallSuper in project android-oss by kickstarter.

the class BaseBottomSheetDialogFragment method onPause.

@CallSuper
@Override
public void onPause() {
    this.lifecycle.onNext(FragmentEvent.PAUSE);
    super.onPause();
    Timber.d("onPause %s", this.toString());
    if (this.viewModel != null) {
        this.viewModel.onPause();
        final FragmentActivity activity = getActivity();
        if (activity != null) {
            activity.unregisterReceiver(this.optimizelyReadyReceiver);
        }
    }
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity) CallSuper(androidx.annotation.CallSuper)

Example 15 with CallSuper

use of androidx.annotation.CallSuper in project android-oss by kickstarter.

the class BaseFragment method onCreateView.

/**
 * Called when a fragment instantiates its user interface view, between `onCreate` and `onActivityCreated`.
 * Can return null for non-graphical fragments.
 */
@CallSuper
@Override
@Nullable
public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) {
    final View view = super.onCreateView(inflater, container, savedInstanceState);
    Timber.d("onCreateView %s", this.toString());
    this.lifecycle.onNext(FragmentEvent.CREATE_VIEW);
    return view;
}
Also used : View(android.view.View) CallSuper(androidx.annotation.CallSuper) Nullable(androidx.annotation.Nullable)

Aggregations

CallSuper (androidx.annotation.CallSuper)45 BasePreferenceController (com.android.settings.core.BasePreferenceController)8 PreferenceControllerMixin (com.android.settings.core.PreferenceControllerMixin)8 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)8 ArrayList (java.util.ArrayList)8 Bundle (android.os.Bundle)6 Nullable (androidx.annotation.Nullable)6 View (android.view.View)4 TextView (android.widget.TextView)4 FragmentActivity (androidx.fragment.app.FragmentActivity)4 BaseRegistrationViewModel (org.thoughtcrime.securesms.registration.viewmodel.BaseRegistrationViewModel)4 SuppressLint (android.annotation.SuppressLint)3 TypedArray (android.content.res.TypedArray)3 SearchIndexableRaw (com.android.settingslib.search.SearchIndexableRaw)3 Intent (android.content.Intent)2 IntentFilter (android.content.IntentFilter)2 Resources (android.content.res.Resources)2 Paint (android.graphics.Paint)2 InputType (android.text.InputType)2 EditorInfo (android.view.inputmethod.EditorInfo)2