Tweaking styles for AllApps and widgets spaces. (Bug 10843502)
- Fixing various issues with Search bar showing when it shouldn't be. Change-Id: I2a553ad93e3422666a883b90a1ff97625bf05831
This commit is contained in:
@@ -18,6 +18,9 @@ package com.android.launcher3;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Region;
|
||||
import android.graphics.Region.Op;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.TextView;
|
||||
@@ -99,4 +102,27 @@ public class PagedViewIcon extends TextView {
|
||||
setAlpha(1f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// If text is transparent, don't draw any shadow
|
||||
if (getCurrentTextColor() == getResources().getColor(android.R.color.transparent)) {
|
||||
getPaint().clearShadowLayer();
|
||||
super.draw(canvas);
|
||||
return;
|
||||
}
|
||||
|
||||
// We enhance the shadow by drawing the shadow twice
|
||||
getPaint().setShadowLayer(BubbleTextView.SHADOW_LARGE_RADIUS, 0.0f,
|
||||
BubbleTextView.SHADOW_Y_OFFSET, BubbleTextView.SHADOW_LARGE_COLOUR);
|
||||
super.draw(canvas);
|
||||
canvas.save(Canvas.CLIP_SAVE_FLAG);
|
||||
canvas.clipRect(getScrollX(), getScrollY() + getExtendedPaddingTop(),
|
||||
getScrollX() + getWidth(),
|
||||
getScrollY() + getHeight(), Region.Op.INTERSECT);
|
||||
getPaint().setShadowLayer(BubbleTextView.SHADOW_SMALL_RADIUS, 0.0f, 0.0f,
|
||||
BubbleTextView.SHADOW_SMALL_COLOUR);
|
||||
super.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user