@Override public void onAnimationEnd(Animator animation) { // Clean up view.getOverlay().clear(); } });
@Override void removeHighlight(View view) { for (ColorDrawable drawable : mHighlightDrawables) { view.getOverlay().remove(drawable); } }
@NonNull private static ViewOverlay getViewOverlay(boolean useParentOverlay, @NonNull View view) { return useParentOverlay ? ((ViewGroup) view.getParent()).getOverlay() : view.getOverlay(); }
@Override public void onAnimationEnd(Animator animation) { // clean up view.setWillNotDraw(false); view.getOverlay().clear(); ((ViewGroup) view.getParent()).setClipChildren(true); startText.recycle(); endText.recycle(); } });
@Override public void onAnimationEnd(Animator animation) { // Clean up view.getOverlay().clear(); if (!fromFab) { view.setTranslationX(0); view.setTranslationY(0); view.setTranslationZ(0); view.measure( makeMeasureSpec(endBounds.width(), View.MeasureSpec.EXACTLY), makeMeasureSpec(endBounds.height(), View.MeasureSpec.EXACTLY)); view.layout(endBounds.left, endBounds.top, endBounds.right, endBounds.bottom); } } });
@Override public void onAnimationEnd(Animator animation) { ViewOverlay overlay = useParentOverlay ? ((ViewGroup) view.getParent()).getOverlay() : view.getOverlay(); overlay.remove(startDrawable); if (mFadeBehavior == FADE_BEHAVIOR_REVEAL) { overlay.remove(endDrawable); } } });
@Override void highlightView(View view, Rect bounds, int mainColor) { mMainHighlightDrawable.setColor(mainColor); if (bounds.isEmpty()) { mMainHighlightDrawable.setBounds(0, 0, view.getWidth(), view.getHeight()); } else { mMainHighlightDrawable.setBounds(bounds); } int total = mHighlightDrawables.length; for (int i = 0; i < total; i++) { HighlightDrawable drawable = mHighlightDrawables[i]; drawable.highlightView(view); view.getOverlay().add(drawable); } }
fabColor.setBounds(0, 0, dialogBounds.width(), dialogBounds.height()); if (!fromFab) fabColor.setAlpha(0); view.getOverlay().add(fabColor); iconTop + fabIcon.getIntrinsicHeight()); if (!fromFab) fabIcon.setAlpha(0); view.getOverlay().add(fabIcon);
((ViewGroup) view.getParent()).getOverlay() : view.getOverlay(); if (mFadeBehavior == FADE_BEHAVIOR_REVEAL) { overlay.add(endDrawable);
run.start.right + dx, run.start.bottom + dy); view.getOverlay().add(drawable);
fabColor.setBounds(0, 0, dialogBounds.width(), dialogBounds.height()); if (!fromFab) fabColor.setAlpha(0); view.getOverlay().add(fabColor); iconTop + fabIcon.getIntrinsicHeight()); if (!fromFab) fabIcon.setAlpha(0); view.getOverlay().add(fabIcon); dialogView = new BitmapDrawable(view.getResources(), viewBitmap); dialogView.setBounds(0, 0, dialogBounds.width(), dialogBounds.height()); view.getOverlay().add(dialogView);
@Override public void setVisible(boolean visible) { if (this.visible != visible) { if (visible) { parent.getOverlay().add(this); } else { parent.getOverlay().remove(this); } this.visible = visible; } } }
@Override public void run() { int dimen = (int) view.getContext().getResources() .getDimension(R.dimen.twenty_four_dp) * 2; int left = view.getWidth() / 2 - dimen / 2; int top = view.getHeight() / 2 - dimen / 2; playOverlay.setBounds(left, top, left + dimen, top + dimen); view.getOverlay().add(playOverlay); } });
@Override public void run() { view.getOverlay().clear(); } });
@Override public void run() { imageView.getOverlay().remove(selectorOverlay); } });
@Override public void run() { card.getOverlay().clear(); } });
@Override public void run() { imageView.getOverlay().remove(selectorOverlay); selectorOverlay.setBounds(0, 0, imageView.getWidth(), imageView.getHeight()); imageView.getOverlay().add(selectorOverlay); } });
@Override public void onAnimationEnd(Animator animation) { // Clean up view.getOverlay().clear(); } });
@Override public void run() { card.getOverlay().clear(); if (selectorOverlay != null) { int width = card.getWidth(), height = card.getHeight(); int start = (width - height) / 2; //noinspection SuspiciousNameCombination selectorOverlay.setBounds(start, 0, start + height, height); colorDrawable1.setBounds(0, 0, start, height); colorDrawable2.setBounds(start + height, 0, width, height); card.getOverlay().add(selectorOverlay); card.getOverlay().add(colorDrawable1); card.getOverlay().add(colorDrawable2); } } });
public void setTargets(final SciChartSurface targetSurface, final View viewToDrawOn) { // dispose previous subscription if (this.token != null) { try { this.token.close(); } catch (Exception e) { SciChartDebugLogger.instance().handleException(e); } finally { this.token = null; } } // remove overlay from previous view if (this.viewToDrawOn != null) { this.viewToDrawOn.getOverlay().remove(this); } this.viewToDrawOn = viewToDrawOn; if (targetSurface != null && viewToDrawOn != null) { // attach overlay to new view this.viewToDrawOn.getOverlay().add(this); // subscribe on target surface RenderedMessage final IEventAggregator eventAggregator = targetSurface.getServices().getService(IEventAggregator.class); this.token = eventAggregator.subscribe(RenderedMessage.class, new Action1<RenderedMessage>() { @Override public void execute(RenderedMessage arg) { update(targetSurface); viewToDrawOn.postInvalidate(); } }); } }