use of android.graphics.Outline in project android_frameworks_base by AOSPA.
the class ViewGroup_Delegate method drawChild.
/**
* Overrides the original drawChild call in ViewGroup to draw the shadow.
*/
@LayoutlibDelegate
static /*package*/
boolean drawChild(ViewGroup thisVG, Canvas canvas, View child, long drawingTime) {
if (child.getZ() > thisVG.getZ()) {
// The background's bounds are set lazily. Make sure they are set correctly so that
// the outline obtained is correct.
child.setBackgroundBounds();
ViewOutlineProvider outlineProvider = child.getOutlineProvider();
Outline outline = child.mAttachInfo.mTmpOutline;
outlineProvider.getOutline(child, outline);
if (outline.mPath != null || (outline.mRect != null && !outline.mRect.isEmpty())) {
int restoreTo = transformCanvas(thisVG, canvas, child);
drawShadow(thisVG, canvas, child, outline);
canvas.restoreToCount(restoreTo);
}
}
return thisVG.drawChild_Original(canvas, child, drawingTime);
}
use of android.graphics.Outline in project android_frameworks_base by AOSPA.
the class View method rebuildOutline.
/**
* Internal version of {@link #invalidateOutline()} which invalidates the
* outline without invalidating the view itself. This is intended to be called from
* within methods in the View class itself which are the result of the view being
* invalidated already. For example, when we are drawing the background of a View,
* we invalidate the outline in case it changed in the meantime, but we do not
* need to invalidate the view because we're already drawing the background as part
* of drawing the view in response to an earlier invalidation of the view.
*/
private void rebuildOutline() {
// Unattached views ignore this signal, and outline is recomputed in onAttachedToWindow()
if (mAttachInfo == null)
return;
if (mOutlineProvider == null) {
// no provider, remove outline
mRenderNode.setOutline(null);
} else {
final Outline outline = mAttachInfo.mTmpOutline;
outline.setEmpty();
outline.setAlpha(1.0f);
mOutlineProvider.getOutline(this, outline);
mRenderNode.setOutline(outline);
}
}
use of android.graphics.Outline in project android_frameworks_base by ResurrectionRemix.
the class ViewGroup_Delegate method drawChild.
/**
* Overrides the original drawChild call in ViewGroup to draw the shadow.
*/
@LayoutlibDelegate
static /*package*/
boolean drawChild(ViewGroup thisVG, Canvas canvas, View child, long drawingTime) {
if (child.getZ() > thisVG.getZ()) {
// The background's bounds are set lazily. Make sure they are set correctly so that
// the outline obtained is correct.
child.setBackgroundBounds();
ViewOutlineProvider outlineProvider = child.getOutlineProvider();
Outline outline = child.mAttachInfo.mTmpOutline;
outlineProvider.getOutline(child, outline);
if (outline.mPath != null || (outline.mRect != null && !outline.mRect.isEmpty())) {
int restoreTo = transformCanvas(thisVG, canvas, child);
drawShadow(thisVG, canvas, child, outline);
canvas.restoreToCount(restoreTo);
}
}
return thisVG.drawChild_Original(canvas, child, drawingTime);
}
use of android.graphics.Outline in project android_frameworks_base by ResurrectionRemix.
the class View method rebuildOutline.
/**
* Internal version of {@link #invalidateOutline()} which invalidates the
* outline without invalidating the view itself. This is intended to be called from
* within methods in the View class itself which are the result of the view being
* invalidated already. For example, when we are drawing the background of a View,
* we invalidate the outline in case it changed in the meantime, but we do not
* need to invalidate the view because we're already drawing the background as part
* of drawing the view in response to an earlier invalidation of the view.
*/
private void rebuildOutline() {
// Unattached views ignore this signal, and outline is recomputed in onAttachedToWindow()
if (mAttachInfo == null)
return;
if (mOutlineProvider == null) {
// no provider, remove outline
mRenderNode.setOutline(null);
} else {
final Outline outline = mAttachInfo.mTmpOutline;
outline.setEmpty();
outline.setAlpha(1.0f);
mOutlineProvider.getOutline(this, outline);
mRenderNode.setOutline(outline);
}
}
use of android.graphics.Outline in project android_frameworks_base by ResurrectionRemix.
the class TaskView method onFinishInflate.
@Override
protected void onFinishInflate() {
// Bind the views
mHeaderView = (TaskViewHeader) findViewById(R.id.task_view_bar);
mThumbnailView = (TaskViewThumbnail) findViewById(R.id.task_view_thumbnail);
mThumbnailView.updateClipToTaskBar(mHeaderView);
mActionButtonView = findViewById(R.id.lock_to_app_fab);
mActionButtonView.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
// Set the outline to match the FAB background
outline.setOval(0, 0, mActionButtonView.getWidth(), mActionButtonView.getHeight());
outline.setAlpha(0.35f);
}
});
mActionButtonView.setOnClickListener(this);
mActionButtonTranslationZ = mActionButtonView.getTranslationZ();
}
Aggregations