use of android.annotation.CallSuper in project android_frameworks_base by DirtyUnicorns.
the class View method onAttachedToWindow.
/**
* This is called when the view is attached to a window. At this point it
* has a Surface and will start drawing. Note that this function is
* guaranteed to be called before {@link #onDraw(android.graphics.Canvas)},
* however it may be called any time before the first onDraw -- including
* before or after {@link #onMeasure(int, int)}.
*
* @see #onDetachedFromWindow()
*/
@CallSuper
protected void onAttachedToWindow() {
if ((mPrivateFlags & PFLAG_REQUEST_TRANSPARENT_REGIONS) != 0) {
mParent.requestTransparentRegion(this);
}
mPrivateFlags3 &= ~PFLAG3_IS_LAID_OUT;
jumpDrawablesToCurrentState();
resetSubtreeAccessibilityStateChanged();
// rebuild, since Outline not maintained while View is detached
rebuildOutline();
if (isFocused()) {
InputMethodManager imm = InputMethodManager.peekInstance();
if (imm != null) {
imm.focusIn(this);
}
}
}
use of android.annotation.CallSuper in project android_frameworks_base by DirtyUnicorns.
the class View method encodeProperties.
/** {@hide} */
@CallSuper
protected void encodeProperties(@NonNull ViewHierarchyEncoder stream) {
Object resolveId = ViewDebug.resolveId(getContext(), mID);
if (resolveId instanceof String) {
stream.addProperty("id", (String) resolveId);
} else {
stream.addProperty("id", mID);
}
stream.addProperty("misc:transformation.alpha", mTransformationInfo != null ? mTransformationInfo.mAlpha : 0);
stream.addProperty("misc:transitionName", getTransitionName());
// layout
stream.addProperty("layout:left", mLeft);
stream.addProperty("layout:right", mRight);
stream.addProperty("layout:top", mTop);
stream.addProperty("layout:bottom", mBottom);
stream.addProperty("layout:width", getWidth());
stream.addProperty("layout:height", getHeight());
stream.addProperty("layout:layoutDirection", getLayoutDirection());
stream.addProperty("layout:layoutRtl", isLayoutRtl());
stream.addProperty("layout:hasTransientState", hasTransientState());
stream.addProperty("layout:baseline", getBaseline());
// layout params
ViewGroup.LayoutParams layoutParams = getLayoutParams();
if (layoutParams != null) {
stream.addPropertyKey("layoutParams");
layoutParams.encode(stream);
}
// scrolling
stream.addProperty("scrolling:scrollX", mScrollX);
stream.addProperty("scrolling:scrollY", mScrollY);
// padding
stream.addProperty("padding:paddingLeft", mPaddingLeft);
stream.addProperty("padding:paddingRight", mPaddingRight);
stream.addProperty("padding:paddingTop", mPaddingTop);
stream.addProperty("padding:paddingBottom", mPaddingBottom);
stream.addProperty("padding:userPaddingRight", mUserPaddingRight);
stream.addProperty("padding:userPaddingLeft", mUserPaddingLeft);
stream.addProperty("padding:userPaddingBottom", mUserPaddingBottom);
stream.addProperty("padding:userPaddingStart", mUserPaddingStart);
stream.addProperty("padding:userPaddingEnd", mUserPaddingEnd);
// measurement
stream.addProperty("measurement:minHeight", mMinHeight);
stream.addProperty("measurement:minWidth", mMinWidth);
stream.addProperty("measurement:measuredWidth", mMeasuredWidth);
stream.addProperty("measurement:measuredHeight", mMeasuredHeight);
// drawing
stream.addProperty("drawing:elevation", getElevation());
stream.addProperty("drawing:translationX", getTranslationX());
stream.addProperty("drawing:translationY", getTranslationY());
stream.addProperty("drawing:translationZ", getTranslationZ());
stream.addProperty("drawing:rotation", getRotation());
stream.addProperty("drawing:rotationX", getRotationX());
stream.addProperty("drawing:rotationY", getRotationY());
stream.addProperty("drawing:scaleX", getScaleX());
stream.addProperty("drawing:scaleY", getScaleY());
stream.addProperty("drawing:pivotX", getPivotX());
stream.addProperty("drawing:pivotY", getPivotY());
stream.addProperty("drawing:opaque", isOpaque());
stream.addProperty("drawing:alpha", getAlpha());
stream.addProperty("drawing:transitionAlpha", getTransitionAlpha());
stream.addProperty("drawing:shadow", hasShadow());
stream.addProperty("drawing:solidColor", getSolidColor());
stream.addProperty("drawing:layerType", mLayerType);
stream.addProperty("drawing:willNotDraw", willNotDraw());
stream.addProperty("drawing:hardwareAccelerated", isHardwareAccelerated());
stream.addProperty("drawing:willNotCacheDrawing", willNotCacheDrawing());
stream.addProperty("drawing:drawingCacheEnabled", isDrawingCacheEnabled());
stream.addProperty("drawing:overlappingRendering", hasOverlappingRendering());
// focus
stream.addProperty("focus:hasFocus", hasFocus());
stream.addProperty("focus:isFocused", isFocused());
stream.addProperty("focus:isFocusable", isFocusable());
stream.addProperty("focus:isFocusableInTouchMode", isFocusableInTouchMode());
stream.addProperty("misc:clickable", isClickable());
stream.addProperty("misc:pressed", isPressed());
stream.addProperty("misc:selected", isSelected());
stream.addProperty("misc:touchMode", isInTouchMode());
stream.addProperty("misc:hovered", isHovered());
stream.addProperty("misc:activated", isActivated());
stream.addProperty("misc:visibility", getVisibility());
stream.addProperty("misc:fitsSystemWindows", getFitsSystemWindows());
stream.addProperty("misc:filterTouchesWhenObscured", getFilterTouchesWhenObscured());
stream.addProperty("misc:enabled", isEnabled());
stream.addProperty("misc:soundEffectsEnabled", isSoundEffectsEnabled());
stream.addProperty("misc:hapticFeedbackEnabled", isHapticFeedbackEnabled());
// theme attributes
Resources.Theme theme = getContext().getTheme();
if (theme != null) {
stream.addPropertyKey("theme");
theme.encode(stream);
}
// view attribute information
int n = mAttributes != null ? mAttributes.length : 0;
stream.addProperty("meta:__attrCount__", n / 2);
for (int i = 0; i < n; i += 2) {
stream.addProperty("meta:__attr__" + mAttributes[i], mAttributes[i + 1]);
}
stream.addProperty("misc:scrollBarStyle", getScrollBarStyle());
// text
stream.addProperty("text:textDirection", getTextDirection());
stream.addProperty("text:textAlignment", getTextAlignment());
// accessibility
CharSequence contentDescription = getContentDescription();
stream.addProperty("accessibility:contentDescription", contentDescription == null ? "" : contentDescription.toString());
stream.addProperty("accessibility:labelFor", getLabelFor());
stream.addProperty("accessibility:importantForAccessibility", getImportantForAccessibility());
}
use of android.annotation.CallSuper in project android_frameworks_base by DirtyUnicorns.
the class DialogPreference method onBindDialogView.
/**
* Binds views in the content View of the dialog to data.
* <p>
* Make sure to call through to the superclass implementation.
*
* @param view The content View of the dialog, if it is custom.
*/
@CallSuper
protected void onBindDialogView(View view) {
View dialogMessageView = view.findViewById(com.android.internal.R.id.message);
if (dialogMessageView != null) {
final CharSequence message = getDialogMessage();
int newVisibility = View.GONE;
if (!TextUtils.isEmpty(message)) {
if (dialogMessageView instanceof TextView) {
((TextView) dialogMessageView).setText(message);
}
newVisibility = View.VISIBLE;
}
if (dialogMessageView.getVisibility() != newVisibility) {
dialogMessageView.setVisibility(newVisibility);
}
}
}
use of android.annotation.CallSuper in project android_frameworks_base by DirtyUnicorns.
the class AndroidKeyStoreCipherSpiBase method resetWhilePreservingInitState.
/**
* Resets this cipher while preserving the initialized state. This must be equivalent to
* rolling back the cipher's state to just after the most recent {@code engineInit} completed
* successfully.
*
* <p>Subclasses storing additional post-init state should override this method, reset the
* additional state, and then chain to superclass.
*/
@CallSuper
protected void resetWhilePreservingInitState() {
IBinder operationToken = mOperationToken;
if (operationToken != null) {
mKeyStore.abort(operationToken);
}
mOperationToken = null;
mOperationHandle = 0;
mMainDataStreamer = null;
mAdditionalAuthenticationDataStreamer = null;
mAdditionalAuthenticationDataStreamerClosed = false;
mCachedException = null;
}
use of android.annotation.CallSuper in project android_frameworks_base by DirtyUnicorns.
the class AndroidKeyStoreCipherSpiBase method resetAll.
/**
* Resets this cipher to its pristine pre-init state. This must be equivalent to obtaining a new
* cipher instance.
*
* <p>Subclasses storing additional state should override this method, reset the additional
* state, and then chain to superclass.
*/
@CallSuper
protected void resetAll() {
IBinder operationToken = mOperationToken;
if (operationToken != null) {
mKeyStore.abort(operationToken);
}
mEncrypting = false;
mKeymasterPurposeOverride = -1;
mKey = null;
mRng = null;
mOperationToken = null;
mOperationHandle = 0;
mMainDataStreamer = null;
mAdditionalAuthenticationDataStreamer = null;
mAdditionalAuthenticationDataStreamerClosed = false;
mCachedException = null;
}
Aggregations