mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
All Apps transition with gradient and scrim.
The transition is behind a feature flag and turned off by default. Change-Id: I155840ba82b5a573d874376797db5f739a52d706
This commit is contained in:
@@ -28,6 +28,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
@@ -645,4 +646,28 @@ public final class Utilities {
|
||||
hashSet.add(elem);
|
||||
return hashSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return creates a new alpha mask bitmap out of an existing bitmap
|
||||
*/
|
||||
public static Bitmap convertToAlphaMask(Bitmap b, float applyAlpha) {
|
||||
Bitmap a = Bitmap.createBitmap(b.getWidth(), b.getHeight(), Bitmap.Config.ALPHA_8);
|
||||
Canvas c = new Canvas(a);
|
||||
Paint paint = new Paint();
|
||||
paint.setAlpha((int) (255f * applyAlpha));
|
||||
c.drawBitmap(b, 0f, 0f, paint);
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new white 1x1 bitmap with ALPHA_8
|
||||
*/
|
||||
public static Bitmap createOnePixBitmap() {
|
||||
Bitmap a = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
|
||||
Canvas c = new Canvas(a);
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(Color.WHITE);
|
||||
c.drawPaint(paint);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user