Search in sources :

Example 26 with ViewOutlineProvider

use of android.view.ViewOutlineProvider in project android_frameworks_base by ResurrectionRemix.

the class TaskCardView method setAsScreenShotView.

private void setAsScreenShotView(Bitmap screenshot, ImageView screenshotView) {
    LayoutParams lp = (LayoutParams) screenshotView.getLayoutParams();
    lp.width = LayoutParams.MATCH_PARENT;
    lp.height = LayoutParams.MATCH_PARENT;
    screenshotView.setLayoutParams(lp);
    screenshotView.setClipToOutline(true);
    screenshotView.setOutlineProvider(new ViewOutlineProvider() {

        @Override
        public void getOutline(View view, Outline outline) {
            outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), mCornerRadius);
        }
    });
    screenshotView.setImageBitmap(screenshot);
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 27 with ViewOutlineProvider

use of android.view.ViewOutlineProvider 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();
}
Also used : Outline(android.graphics.Outline) ViewOutlineProvider(android.view.ViewOutlineProvider) View(android.view.View) TextView(android.widget.TextView)

Aggregations

View (android.view.View)27 ViewOutlineProvider (android.view.ViewOutlineProvider)27 Outline (android.graphics.Outline)26 TextView (android.widget.TextView)16 TargetApi (android.annotation.TargetApi)8 ImageView (android.widget.ImageView)7 ColorDrawable (android.graphics.drawable.ColorDrawable)4 Animator (android.animation.Animator)3 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)3 AnimatorSet (android.animation.AnimatorSet)3 ObjectAnimator (android.animation.ObjectAnimator)3 ColorStateList (android.content.res.ColorStateList)3 Rect (android.graphics.Rect)3 Drawable (android.graphics.drawable.Drawable)3 RippleDrawable (android.graphics.drawable.RippleDrawable)3 ViewGroup (android.view.ViewGroup)3 Interpolator (android.view.animation.Interpolator)3 StateListDrawable (android.graphics.drawable.StateListDrawable)2 AdapterView (android.widget.AdapterView)2 PropertyValuesHolder (android.animation.PropertyValuesHolder)1