Search in sources :

Example 21 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by AOSPA.

the class View method onVisibilityAggregated.

/**
     * Called when the user-visibility of this View is potentially affected by a change
     * to this view itself, an ancestor view or the window this view is attached to.
     *
     * @param isVisible true if this view and all of its ancestors are {@link #VISIBLE}
     *                  and this view's window is also visible
     */
@CallSuper
public void onVisibilityAggregated(boolean isVisible) {
    if (isVisible && mAttachInfo != null) {
        initialAwakenScrollBars();
    }
    final Drawable dr = mBackground;
    if (dr != null && isVisible != dr.isVisible()) {
        dr.setVisible(isVisible, false);
    }
    final Drawable fg = mForegroundInfo != null ? mForegroundInfo.mDrawable : null;
    if (fg != null && isVisible != fg.isVisible()) {
        fg.setVisible(isVisible, false);
    }
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) ScrollBarDrawable(android.widget.ScrollBarDrawable) CallSuper(android.annotation.CallSuper)

Example 22 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by AOSPA.

the class Activity method onPostResume.

/**
     * Called when activity resume is complete (after {@link #onResume} has
     * been called). Applications will generally not implement this method;
     * it is intended for system classes to do final setup after application
     * resume code has run.
     *
     * <p><em>Derived classes must call through to the super class's
     * implementation of this method.  If they do not, an exception will be
     * thrown.</em></p>
     *
     * @see #onResume
     */
@CallSuper
protected void onPostResume() {
    final Window win = getWindow();
    if (win != null)
        win.makeActive();
    if (mActionBar != null)
        mActionBar.setShowHideAnimationEnabled(true);
    mCalled = true;
}
Also used : PhoneWindow(com.android.internal.policy.PhoneWindow) Window(android.view.Window) CallSuper(android.annotation.CallSuper)

Example 23 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by AOSPA.

the class Fragment method onCreate.

/**
     * Called to do initial creation of a fragment.  This is called after
     * {@link #onAttach(Activity)} and before
     * {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}, but is not called if the fragment
     * instance is retained across Activity re-creation (see {@link #setRetainInstance(boolean)}).
     *
     * <p>Note that this can be called while the fragment's activity is
     * still in the process of being created.  As such, you can not rely
     * on things like the activity's content view hierarchy being initialized
     * at this point.  If you want to do work once the activity itself is
     * created, see {@link #onActivityCreated(Bundle)}.
     *
     * <p>If your app's <code>targetSdkVersion</code> is {@link android.os.Build.VERSION_CODES#M}
     * or lower, child fragments being restored from the savedInstanceState are restored after
     * <code>onCreate</code> returns. When targeting {@link android.os.Build.VERSION_CODES#N} or
     * above and running on an N or newer platform version
     * they are restored by <code>Fragment.onCreate</code>.</p>
     *
     * @param savedInstanceState If the fragment is being re-created from
     * a previous saved state, this is the state.
     */
@CallSuper
public void onCreate(@Nullable Bundle savedInstanceState) {
    mCalled = true;
    final Context context = getContext();
    final int version = context != null ? context.getApplicationInfo().targetSdkVersion : 0;
    if (version >= Build.VERSION_CODES.N) {
        restoreChildFragmentState(savedInstanceState, true);
        if (mChildFragmentManager != null && !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
            mChildFragmentManager.dispatchCreate();
        }
    }
}
Also used : Context(android.content.Context) CallSuper(android.annotation.CallSuper)

Example 24 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by AOSPA.

the class Fragment method onInflate.

/**
     * Called when a fragment is being created as part of a view layout
     * inflation, typically from setting the content view of an activity.  This
     * may be called immediately after the fragment is created from a <fragment>
     * tag in a layout file.  Note this is <em>before</em> the fragment's
     * {@link #onAttach(Activity)} has been called; all you should do here is
     * parse the attributes and save them away.
     *
     * <p>This is called every time the fragment is inflated, even if it is
     * being inflated into a new instance with saved state.  It typically makes
     * sense to re-parse the parameters each time, to allow them to change with
     * different configurations.</p>
     *
     * <p>Here is a typical implementation of a fragment that can take parameters
     * both through attributes supplied here as well from {@link #getArguments()}:</p>
     *
     * {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentArguments.java
     *      fragment}
     *
     * <p>Note that parsing the XML attributes uses a "styleable" resource.  The
     * declaration for the styleable used here is:</p>
     *
     * {@sample development/samples/ApiDemos/res/values/attrs.xml fragment_arguments}
     * 
     * <p>The fragment can then be declared within its activity's content layout
     * through a tag like this:</p>
     *
     * {@sample development/samples/ApiDemos/res/layout/fragment_arguments.xml from_attributes}
     *
     * <p>This fragment can also be created dynamically from arguments given
     * at runtime in the arguments Bundle; here is an example of doing so at
     * creation of the containing activity:</p>
     *
     * {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentArguments.java
     *      create}
     *
     * @param context The Context that is inflating this fragment.
     * @param attrs The attributes at the tag where the fragment is
     * being created.
     * @param savedInstanceState If the fragment is being re-created from
     * a previous saved state, this is the state.
     */
@CallSuper
public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {
    onInflate(attrs, savedInstanceState);
    mCalled = true;
    TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.Fragment);
    mEnterTransition = loadTransition(context, a, mEnterTransition, null, com.android.internal.R.styleable.Fragment_fragmentEnterTransition);
    mReturnTransition = loadTransition(context, a, mReturnTransition, USE_DEFAULT_TRANSITION, com.android.internal.R.styleable.Fragment_fragmentReturnTransition);
    mExitTransition = loadTransition(context, a, mExitTransition, null, com.android.internal.R.styleable.Fragment_fragmentExitTransition);
    mReenterTransition = loadTransition(context, a, mReenterTransition, USE_DEFAULT_TRANSITION, com.android.internal.R.styleable.Fragment_fragmentReenterTransition);
    mSharedElementEnterTransition = loadTransition(context, a, mSharedElementEnterTransition, null, com.android.internal.R.styleable.Fragment_fragmentSharedElementEnterTransition);
    mSharedElementReturnTransition = loadTransition(context, a, mSharedElementReturnTransition, USE_DEFAULT_TRANSITION, com.android.internal.R.styleable.Fragment_fragmentSharedElementReturnTransition);
    if (mAllowEnterTransitionOverlap == null) {
        mAllowEnterTransitionOverlap = a.getBoolean(com.android.internal.R.styleable.Fragment_fragmentAllowEnterTransitionOverlap, true);
    }
    if (mAllowReturnTransitionOverlap == null) {
        mAllowReturnTransitionOverlap = a.getBoolean(com.android.internal.R.styleable.Fragment_fragmentAllowReturnTransitionOverlap, true);
    }
    a.recycle();
    final Activity hostActivity = mHost == null ? null : mHost.getActivity();
    if (hostActivity != null) {
        mCalled = false;
        onInflate(hostActivity, attrs, savedInstanceState);
    }
}
Also used : TypedArray(android.content.res.TypedArray) CallSuper(android.annotation.CallSuper)

Example 25 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by AOSPA.

the class NumberPicker method drawableStateChanged.

@CallSuper
@Override
protected void drawableStateChanged() {
    super.drawableStateChanged();
    final Drawable selectionDivider = mSelectionDivider;
    if (selectionDivider != null && selectionDivider.isStateful() && selectionDivider.setState(getDrawableState())) {
        invalidateDrawable(selectionDivider);
    }
}
Also used : Drawable(android.graphics.drawable.Drawable) CallSuper(android.annotation.CallSuper)

Aggregations

CallSuper (android.annotation.CallSuper)89 IBinder (android.os.IBinder)20 View (android.view.View)15 TextView (android.widget.TextView)15 Point (android.graphics.Point)13 Drawable (android.graphics.drawable.Drawable)13 Context (android.content.Context)10 ImageView (android.widget.ImageView)10 ListView (android.widget.ListView)10 Paint (android.graphics.Paint)8 ColorDrawable (android.graphics.drawable.ColorDrawable)8 InputMethodManager (android.view.inputmethod.InputMethodManager)8 ScrollBarDrawable (android.widget.ScrollBarDrawable)8 MainThread (android.annotation.MainThread)5 TypedArray (android.content.res.TypedArray)5 Uri (android.net.Uri)5 Parcelable (android.os.Parcelable)5 DocumentsContract.buildDocumentUri (android.provider.DocumentsContract.buildDocumentUri)5 DocumentsContract.buildTreeDocumentUri (android.provider.DocumentsContract.buildTreeDocumentUri)5 DocumentsContract.isTreeUri (android.provider.DocumentsContract.isTreeUri)5