summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/graphics
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-01-04 15:35:22 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-01-08 13:53:44 -0800
commit228153d92ae68c82efd3fcad4ad3df6af7fc24a2 (patch)
treef5b51dd0d43fee9de5b204f12244a860221dd9a4 /src/com/android/launcher3/graphics
parent07b1d670f21745525c4a6df1cf8c2172ad9bdec2 (diff)
downloadandroid_packages_apps_Trebuchet-228153d92ae68c82efd3fcad4ad3df6af7fc24a2.tar.gz
android_packages_apps_Trebuchet-228153d92ae68c82efd3fcad4ad3df6af7fc24a2.tar.bz2
android_packages_apps_Trebuchet-228153d92ae68c82efd3fcad4ad3df6af7fc24a2.zip
Updating landscape layout for launcher/quickstep
> Hotseat is tied to navbar (on left in seascape) > Search box shows up in Overview (clicking it would crash for now) > All-apps is no longer fullscreen in landscape > Recents cards are appropriately scaled down > Hotseat is visible in Overview Bug: 70179916 Change-Id: I53149eaeac9557e8a01021b7e2d139f3d6ceef37
Diffstat (limited to 'src/com/android/launcher3/graphics')
-rw-r--r--src/com/android/launcher3/graphics/NinePatchDrawHelper.java31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/com/android/launcher3/graphics/NinePatchDrawHelper.java b/src/com/android/launcher3/graphics/NinePatchDrawHelper.java
index 6df1ecb98..fc209260a 100644
--- a/src/com/android/launcher3/graphics/NinePatchDrawHelper.java
+++ b/src/com/android/launcher3/graphics/NinePatchDrawHelper.java
@@ -35,16 +35,43 @@ public class NinePatchDrawHelper {
private final RectF mDst = new RectF();
public final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ /**
+ * Draws the bitmap split into three parts horizontally, with the middle part having width
+ * as {@link #EXTENSION_PX} in the center of the bitmap.
+ */
public void draw(Bitmap bitmap, Canvas canvas, float left, float top, float right) {
- int width = bitmap.getWidth();
int height = bitmap.getHeight();
mSrc.top = 0;
mSrc.bottom = height;
-
mDst.top = top;
mDst.bottom = top + height;
+ draw3Patch(bitmap, canvas, left, right);
+ }
+
+
+ /**
+ * Draws the bitmap split horizontally into 3 parts (same as {@link #draw}) and split
+ * vertically into two parts, bottom part of size {@link #EXTENSION_PX} / 2 which is
+ * stretched vertically.
+ */
+ public void drawVerticallyStretched(Bitmap bitmap, Canvas canvas, float left, float top,
+ float right, float bottom) {
+ draw(bitmap, canvas, left, top, right);
+
+ // Draw bottom stretched region.
+ int height = bitmap.getHeight();
+ mSrc.top = height - EXTENSION_PX / 4;
+ mSrc.bottom = height;
+ mDst.top = top + height;
+ mDst.bottom = bottom;
+ draw3Patch(bitmap, canvas, left, right);
+ }
+
+
+ private void draw3Patch(Bitmap bitmap, Canvas canvas, float left, float right) {
+ int width = bitmap.getWidth();
int halfWidth = width / 2;
// Draw left edge