Add shadow to badges

- Add static method to ShadowGenerator to generate a
  circle Bitmap with a shadow.
- Move setColorScale() from DragView to Themes, and
  use it to apply color to the shadowed Bitmap.

Bug: 35744066
Change-Id: I8d1da528bbf94dc83851f0b4016361ed9f8d5349
This commit is contained in:
Tony Wickham
2017-02-27 13:30:20 -08:00
committed by Tony
parent cf18c3c2d1
commit 6c82867a7e
6 changed files with 74 additions and 14 deletions

View File

@@ -42,6 +42,7 @@ import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.util.Themes;
import com.android.launcher3.util.Thunk;
/**
@@ -142,8 +143,8 @@ public abstract class ButtonDropTarget extends TextView
mCurrentFilter = new ColorMatrix();
}
DragView.setColorScale(getTextColor(), mSrcFilter);
DragView.setColorScale(targetColor, mDstFilter);
Themes.setColorScaleOnMatrix(getTextColor(), mSrcFilter);
Themes.setColorScaleOnMatrix(targetColor, mDstFilter);
ValueAnimator anim1 = ValueAnimator.ofObject(
new FloatArrayEvaluator(mCurrentFilter.getArray()),
mSrcFilter.getArray(), mDstFilter.getArray());