Loading packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +1 −35 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome"; final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome"; final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome"; final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome"; final public static String EXTRA_FROM_APP_THUMBNAIL = "recents.animatingWithThumbnail"; final public static String EXTRA_FROM_APP_THUMBNAIL = "recents.animatingWithThumbnail"; final public static String EXTRA_FROM_APP_FULL_SCREENSHOT = "recents.thumbnail"; final public static String EXTRA_FROM_TASK_ID = "recents.activeTaskId"; final public static String EXTRA_FROM_TASK_ID = "recents.activeTaskId"; final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab"; final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab"; final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey"; final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey"; Loading @@ -74,7 +73,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta final static String sRecentsPackage = "com.android.systemui"; final static String sRecentsPackage = "com.android.systemui"; final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity"; final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity"; static Bitmap sLastScreenshot; static RecentsComponent.Callbacks sRecentsComponentCallbacks; static RecentsComponent.Callbacks sRecentsComponentCallbacks; Context mContext; Context mContext; Loading Loading @@ -256,7 +254,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) { // Reload the header bar layout // Reload the header bar layout reloadHeaderBarLayout(); reloadHeaderBarLayout(); sLastScreenshot = null; } } /** Prepares the header bar layout. */ /** Prepares the header bar layout. */ Loading Loading @@ -394,20 +391,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta */ */ ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask, ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) { boolean isTopTaskHome) { if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { // Recycle the last screenshot consumeLastScreenshot(); // Take the full screenshot sLastScreenshot = mSystemServicesProxy.takeAppScreenshot(); if (sLastScreenshot != null) { mStartAnimationTriggered = false; return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_app_enter, R.anim.recents_from_app_exit, mHandler, this); } } // Update the destination rect // Update the destination rect Task toTask = new Task(); Task toTask = new Task(); TaskViewTransform toTransform = getThumbnailTransitionTransform(topTask.id, isTopTaskHome, TaskViewTransform toTransform = getThumbnailTransitionTransform(topTask.id, isTopTaskHome, Loading Loading @@ -493,11 +476,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta // Try starting with a thumbnail transition // Try starting with a thumbnail transition ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome); ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome); if (opts != null) { if (opts != null) { if (sLastScreenshot != null) { startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_FULL_SCREENSHOT); } else { startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL); startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL); } } else { } else { // Fall through below to the non-thumbnail transition // Fall through below to the non-thumbnail transition useThumbnailTransition = false; useThumbnailTransition = false; Loading Loading @@ -561,19 +540,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta } } } } /** Returns the last screenshot taken, this will be called by the RecentsActivity. */ public static Bitmap getLastScreenshot() { return sLastScreenshot; } /** Recycles the last screenshot taken, this will be called by the RecentsActivity. */ public static void consumeLastScreenshot() { if (sLastScreenshot != null) { sLastScreenshot.recycle(); sLastScreenshot = null; } } /** Sets the RecentsComponent callbacks. */ /** Sets the RecentsComponent callbacks. */ public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) { public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) { sRecentsComponentCallbacks = cb; sRecentsComponentCallbacks = cb; Loading packages/SystemUI/src/com/android/systemui/recents/Constants.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -25,8 +25,6 @@ public class Constants { public static final boolean Verbose = false; public static final boolean Verbose = false; public static class App { public static class App { // Enables the screenshot app->Recents transition public static final boolean EnableScreenshotAppTransition = false; // Enables debug drawing for the transition thumbnail // Enables debug drawing for the transition thumbnail public static final boolean EnableTransitionThumbnailDebugMode = false; public static final boolean EnableTransitionThumbnailDebugMode = false; // Enables the filtering of tasks according to their grouping // Enables the filtering of tasks according to their grouping Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -189,8 +189,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView AlternateRecentsComponent.EXTRA_FROM_HOME, false); AlternateRecentsComponent.EXTRA_FROM_HOME, false); mConfig.launchedFromAppWithThumbnail = launchIntent.getBooleanExtra( mConfig.launchedFromAppWithThumbnail = launchIntent.getBooleanExtra( AlternateRecentsComponent.EXTRA_FROM_APP_THUMBNAIL, false); AlternateRecentsComponent.EXTRA_FROM_APP_THUMBNAIL, false); mConfig.launchedFromAppWithScreenshot = launchIntent.getBooleanExtra( AlternateRecentsComponent.EXTRA_FROM_APP_FULL_SCREENSHOT, false); mConfig.launchedToTaskId = launchIntent.getIntExtra( mConfig.launchedToTaskId = launchIntent.getIntExtra( AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1); AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1); mConfig.launchedWithAltTab = launchIntent.getBooleanExtra( mConfig.launchedWithAltTab = launchIntent.getBooleanExtra( Loading packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -307,7 +307,6 @@ public class RecentsConfiguration { launchedWithAltTab = false; launchedWithAltTab = false; launchedWithNoRecentTasks = false; launchedWithNoRecentTasks = false; launchedFromAppWithThumbnail = false; launchedFromAppWithThumbnail = false; launchedFromAppWithScreenshot = false; launchedFromHome = false; launchedFromHome = false; launchedToTaskId = -1; launchedToTaskId = -1; } } Loading packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java +3 −93 Original line number Original line Diff line number Diff line Loading @@ -17,12 +17,10 @@ package com.android.systemui.recents.views; package com.android.systemui.recents.views; import android.animation.ObjectAnimator; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.graphics.Outline; import android.graphics.Outline; import android.graphics.Rect; import android.graphics.Rect; import android.view.View; import android.view.View; import android.view.ViewOutlineProvider; import android.view.ViewOutlineProvider; import com.android.systemui.recents.RecentsConfiguration; import com.android.systemui.recents.RecentsConfiguration; /* An outline provider that has a clip and outline that can be animated. */ /* An outline provider that has a clip and outline that can be animated. */ Loading @@ -31,35 +29,27 @@ public class AnimateableViewBounds extends ViewOutlineProvider { RecentsConfiguration mConfig; RecentsConfiguration mConfig; TaskView mSourceView; TaskView mSourceView; Rect mTmpRect = new Rect(); Rect mClipRect = new Rect(); Rect mClipRect = new Rect(); Rect mClipBounds = new Rect(); Rect mClipBounds = new Rect(); Rect mOutlineClipRect = new Rect(); int mCornerRadius; int mCornerRadius; float mAlpha = 1f; float mAlpha = 1f; final float mMinAlpha = 0.25f; final float mMinAlpha = 0.25f; ObjectAnimator mClipTopAnimator; ObjectAnimator mClipRightAnimator; ObjectAnimator mClipBottomAnimator; ObjectAnimator mClipBottomAnimator; public AnimateableViewBounds(TaskView source, int cornerRadius) { public AnimateableViewBounds(TaskView source, int cornerRadius) { mConfig = RecentsConfiguration.getInstance(); mConfig = RecentsConfiguration.getInstance(); mSourceView = source; mSourceView = source; mCornerRadius = cornerRadius; mCornerRadius = cornerRadius; setClipTop(getClipTop()); setClipRight(getClipRight()); setClipBottom(getClipBottom()); setClipBottom(getClipBottom()); setOutlineClipBottom(getOutlineClipBottom()); } } @Override @Override public void getOutline(View view, Outline outline) { public void getOutline(View view, Outline outline) { outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha)); outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha)); outline.setRoundRect(Math.max(mClipRect.left, mOutlineClipRect.left), outline.setRoundRect(mClipRect.left, mClipRect.top, Math.max(mClipRect.top, mOutlineClipRect.top), mSourceView.getWidth() - mClipRect.right, mSourceView.getWidth() - Math.max(mClipRect.right, mOutlineClipRect.right), mSourceView.getHeight() - mClipRect.bottom, mSourceView.getHeight() - Math.max(mClipRect.bottom, mOutlineClipRect.bottom), mCornerRadius); mCornerRadius); } } Loading @@ -71,73 +61,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider { } } } } /** Animates the top clip. */ void animateClipTop(int top, int duration, ValueAnimator.AnimatorUpdateListener updateListener) { if (mClipTopAnimator != null) { mClipTopAnimator.removeAllListeners(); mClipTopAnimator.cancel(); } mClipTopAnimator = ObjectAnimator.ofInt(this, "clipTop", top); mClipTopAnimator.setDuration(duration); mClipTopAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator); if (updateListener != null) { mClipTopAnimator.addUpdateListener(updateListener); } mClipTopAnimator.start(); } /** Sets the top clip. */ public void setClipTop(int top) { if (top != mClipRect.top) { mClipRect.top = top; mSourceView.invalidateOutline(); updateClipBounds(); } } /** Returns the top clip. */ public int getClipTop() { return mClipRect.top; } /** Animates the right clip. */ void animateClipRight(int right, int duration) { if (mClipRightAnimator != null) { mClipRightAnimator.removeAllListeners(); mClipRightAnimator.cancel(); } mClipRightAnimator = ObjectAnimator.ofInt(this, "clipRight", right); mClipRightAnimator.setDuration(duration); mClipRightAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator); mClipRightAnimator.start(); } /** Sets the right clip. */ public void setClipRight(int right) { if (right != mClipRect.right) { mClipRect.right = right; mSourceView.invalidateOutline(); updateClipBounds(); } } /** Returns the right clip. */ public int getClipRight() { return mClipRect.right; } /** Animates the bottom clip. */ void animateClipBottom(int bottom, int duration) { if (mClipBottomAnimator != null) { mClipBottomAnimator.removeAllListeners(); mClipBottomAnimator.cancel(); } mClipBottomAnimator = ObjectAnimator.ofInt(this, "clipBottom", bottom); mClipBottomAnimator.setDuration(duration); mClipBottomAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator); mClipBottomAnimator.start(); } /** Sets the bottom clip. */ /** Sets the bottom clip. */ public void setClipBottom(int bottom) { public void setClipBottom(int bottom) { if (bottom != mClipRect.bottom) { if (bottom != mClipRect.bottom) { Loading @@ -156,19 +79,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider { return mClipRect.bottom; return mClipRect.bottom; } } /** Sets the outline bottom clip. */ public void setOutlineClipBottom(int bottom) { if (bottom != mOutlineClipRect.bottom) { mOutlineClipRect.bottom = bottom; mSourceView.invalidateOutline(); } } /** Gets the outline bottom clip. */ public int getOutlineClipBottom() { return mOutlineClipRect.bottom; } private void updateClipBounds() { private void updateClipBounds() { mClipBounds.set(mClipRect.left, mClipRect.top, mClipBounds.set(mClipRect.left, mClipRect.top, mSourceView.getWidth() - mClipRect.right, mSourceView.getWidth() - mClipRect.right, Loading Loading
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +1 −35 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome"; final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome"; final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome"; final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome"; final public static String EXTRA_FROM_APP_THUMBNAIL = "recents.animatingWithThumbnail"; final public static String EXTRA_FROM_APP_THUMBNAIL = "recents.animatingWithThumbnail"; final public static String EXTRA_FROM_APP_FULL_SCREENSHOT = "recents.thumbnail"; final public static String EXTRA_FROM_TASK_ID = "recents.activeTaskId"; final public static String EXTRA_FROM_TASK_ID = "recents.activeTaskId"; final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab"; final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab"; final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey"; final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey"; Loading @@ -74,7 +73,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta final static String sRecentsPackage = "com.android.systemui"; final static String sRecentsPackage = "com.android.systemui"; final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity"; final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity"; static Bitmap sLastScreenshot; static RecentsComponent.Callbacks sRecentsComponentCallbacks; static RecentsComponent.Callbacks sRecentsComponentCallbacks; Context mContext; Context mContext; Loading Loading @@ -256,7 +254,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) { // Reload the header bar layout // Reload the header bar layout reloadHeaderBarLayout(); reloadHeaderBarLayout(); sLastScreenshot = null; } } /** Prepares the header bar layout. */ /** Prepares the header bar layout. */ Loading Loading @@ -394,20 +391,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta */ */ ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask, ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) { boolean isTopTaskHome) { if (Constants.DebugFlags.App.EnableScreenshotAppTransition) { // Recycle the last screenshot consumeLastScreenshot(); // Take the full screenshot sLastScreenshot = mSystemServicesProxy.takeAppScreenshot(); if (sLastScreenshot != null) { mStartAnimationTriggered = false; return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_app_enter, R.anim.recents_from_app_exit, mHandler, this); } } // Update the destination rect // Update the destination rect Task toTask = new Task(); Task toTask = new Task(); TaskViewTransform toTransform = getThumbnailTransitionTransform(topTask.id, isTopTaskHome, TaskViewTransform toTransform = getThumbnailTransitionTransform(topTask.id, isTopTaskHome, Loading Loading @@ -493,11 +476,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta // Try starting with a thumbnail transition // Try starting with a thumbnail transition ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome); ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome); if (opts != null) { if (opts != null) { if (sLastScreenshot != null) { startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_FULL_SCREENSHOT); } else { startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL); startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL); } } else { } else { // Fall through below to the non-thumbnail transition // Fall through below to the non-thumbnail transition useThumbnailTransition = false; useThumbnailTransition = false; Loading Loading @@ -561,19 +540,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta } } } } /** Returns the last screenshot taken, this will be called by the RecentsActivity. */ public static Bitmap getLastScreenshot() { return sLastScreenshot; } /** Recycles the last screenshot taken, this will be called by the RecentsActivity. */ public static void consumeLastScreenshot() { if (sLastScreenshot != null) { sLastScreenshot.recycle(); sLastScreenshot = null; } } /** Sets the RecentsComponent callbacks. */ /** Sets the RecentsComponent callbacks. */ public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) { public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) { sRecentsComponentCallbacks = cb; sRecentsComponentCallbacks = cb; Loading
packages/SystemUI/src/com/android/systemui/recents/Constants.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -25,8 +25,6 @@ public class Constants { public static final boolean Verbose = false; public static final boolean Verbose = false; public static class App { public static class App { // Enables the screenshot app->Recents transition public static final boolean EnableScreenshotAppTransition = false; // Enables debug drawing for the transition thumbnail // Enables debug drawing for the transition thumbnail public static final boolean EnableTransitionThumbnailDebugMode = false; public static final boolean EnableTransitionThumbnailDebugMode = false; // Enables the filtering of tasks according to their grouping // Enables the filtering of tasks according to their grouping Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +0 −2 Original line number Original line Diff line number Diff line Loading @@ -189,8 +189,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView AlternateRecentsComponent.EXTRA_FROM_HOME, false); AlternateRecentsComponent.EXTRA_FROM_HOME, false); mConfig.launchedFromAppWithThumbnail = launchIntent.getBooleanExtra( mConfig.launchedFromAppWithThumbnail = launchIntent.getBooleanExtra( AlternateRecentsComponent.EXTRA_FROM_APP_THUMBNAIL, false); AlternateRecentsComponent.EXTRA_FROM_APP_THUMBNAIL, false); mConfig.launchedFromAppWithScreenshot = launchIntent.getBooleanExtra( AlternateRecentsComponent.EXTRA_FROM_APP_FULL_SCREENSHOT, false); mConfig.launchedToTaskId = launchIntent.getIntExtra( mConfig.launchedToTaskId = launchIntent.getIntExtra( AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1); AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1); mConfig.launchedWithAltTab = launchIntent.getBooleanExtra( mConfig.launchedWithAltTab = launchIntent.getBooleanExtra( Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -307,7 +307,6 @@ public class RecentsConfiguration { launchedWithAltTab = false; launchedWithAltTab = false; launchedWithNoRecentTasks = false; launchedWithNoRecentTasks = false; launchedFromAppWithThumbnail = false; launchedFromAppWithThumbnail = false; launchedFromAppWithScreenshot = false; launchedFromHome = false; launchedFromHome = false; launchedToTaskId = -1; launchedToTaskId = -1; } } Loading
packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java +3 −93 Original line number Original line Diff line number Diff line Loading @@ -17,12 +17,10 @@ package com.android.systemui.recents.views; package com.android.systemui.recents.views; import android.animation.ObjectAnimator; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.graphics.Outline; import android.graphics.Outline; import android.graphics.Rect; import android.graphics.Rect; import android.view.View; import android.view.View; import android.view.ViewOutlineProvider; import android.view.ViewOutlineProvider; import com.android.systemui.recents.RecentsConfiguration; import com.android.systemui.recents.RecentsConfiguration; /* An outline provider that has a clip and outline that can be animated. */ /* An outline provider that has a clip and outline that can be animated. */ Loading @@ -31,35 +29,27 @@ public class AnimateableViewBounds extends ViewOutlineProvider { RecentsConfiguration mConfig; RecentsConfiguration mConfig; TaskView mSourceView; TaskView mSourceView; Rect mTmpRect = new Rect(); Rect mClipRect = new Rect(); Rect mClipRect = new Rect(); Rect mClipBounds = new Rect(); Rect mClipBounds = new Rect(); Rect mOutlineClipRect = new Rect(); int mCornerRadius; int mCornerRadius; float mAlpha = 1f; float mAlpha = 1f; final float mMinAlpha = 0.25f; final float mMinAlpha = 0.25f; ObjectAnimator mClipTopAnimator; ObjectAnimator mClipRightAnimator; ObjectAnimator mClipBottomAnimator; ObjectAnimator mClipBottomAnimator; public AnimateableViewBounds(TaskView source, int cornerRadius) { public AnimateableViewBounds(TaskView source, int cornerRadius) { mConfig = RecentsConfiguration.getInstance(); mConfig = RecentsConfiguration.getInstance(); mSourceView = source; mSourceView = source; mCornerRadius = cornerRadius; mCornerRadius = cornerRadius; setClipTop(getClipTop()); setClipRight(getClipRight()); setClipBottom(getClipBottom()); setClipBottom(getClipBottom()); setOutlineClipBottom(getOutlineClipBottom()); } } @Override @Override public void getOutline(View view, Outline outline) { public void getOutline(View view, Outline outline) { outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha)); outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha)); outline.setRoundRect(Math.max(mClipRect.left, mOutlineClipRect.left), outline.setRoundRect(mClipRect.left, mClipRect.top, Math.max(mClipRect.top, mOutlineClipRect.top), mSourceView.getWidth() - mClipRect.right, mSourceView.getWidth() - Math.max(mClipRect.right, mOutlineClipRect.right), mSourceView.getHeight() - mClipRect.bottom, mSourceView.getHeight() - Math.max(mClipRect.bottom, mOutlineClipRect.bottom), mCornerRadius); mCornerRadius); } } Loading @@ -71,73 +61,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider { } } } } /** Animates the top clip. */ void animateClipTop(int top, int duration, ValueAnimator.AnimatorUpdateListener updateListener) { if (mClipTopAnimator != null) { mClipTopAnimator.removeAllListeners(); mClipTopAnimator.cancel(); } mClipTopAnimator = ObjectAnimator.ofInt(this, "clipTop", top); mClipTopAnimator.setDuration(duration); mClipTopAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator); if (updateListener != null) { mClipTopAnimator.addUpdateListener(updateListener); } mClipTopAnimator.start(); } /** Sets the top clip. */ public void setClipTop(int top) { if (top != mClipRect.top) { mClipRect.top = top; mSourceView.invalidateOutline(); updateClipBounds(); } } /** Returns the top clip. */ public int getClipTop() { return mClipRect.top; } /** Animates the right clip. */ void animateClipRight(int right, int duration) { if (mClipRightAnimator != null) { mClipRightAnimator.removeAllListeners(); mClipRightAnimator.cancel(); } mClipRightAnimator = ObjectAnimator.ofInt(this, "clipRight", right); mClipRightAnimator.setDuration(duration); mClipRightAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator); mClipRightAnimator.start(); } /** Sets the right clip. */ public void setClipRight(int right) { if (right != mClipRect.right) { mClipRect.right = right; mSourceView.invalidateOutline(); updateClipBounds(); } } /** Returns the right clip. */ public int getClipRight() { return mClipRect.right; } /** Animates the bottom clip. */ void animateClipBottom(int bottom, int duration) { if (mClipBottomAnimator != null) { mClipBottomAnimator.removeAllListeners(); mClipBottomAnimator.cancel(); } mClipBottomAnimator = ObjectAnimator.ofInt(this, "clipBottom", bottom); mClipBottomAnimator.setDuration(duration); mClipBottomAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator); mClipBottomAnimator.start(); } /** Sets the bottom clip. */ /** Sets the bottom clip. */ public void setClipBottom(int bottom) { public void setClipBottom(int bottom) { if (bottom != mClipRect.bottom) { if (bottom != mClipRect.bottom) { Loading @@ -156,19 +79,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider { return mClipRect.bottom; return mClipRect.bottom; } } /** Sets the outline bottom clip. */ public void setOutlineClipBottom(int bottom) { if (bottom != mOutlineClipRect.bottom) { mOutlineClipRect.bottom = bottom; mSourceView.invalidateOutline(); } } /** Gets the outline bottom clip. */ public int getOutlineClipBottom() { return mOutlineClipRect.bottom; } private void updateClipBounds() { private void updateClipBounds() { mClipBounds.set(mClipRect.left, mClipRect.top, mClipBounds.set(mClipRect.left, mClipRect.top, mSourceView.getWidth() - mClipRect.right, mSourceView.getWidth() - mClipRect.right, Loading