Loading core/res/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -242,7 +242,7 @@ <dimen name="notification_subtext_size">12dp</dimen> <!-- Lockscreen target insets --> <item type="dimen" name="lockscreen_target_inset">25dp</item> <item type="dimen" name="lockscreen_target_inset">30dp</item> <!-- Keyguard dimensions --> <!-- TEMP --> Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java +30 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,16 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources.NotFoundException; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuffXfermode; import android.graphics.PorterDuff.Mode; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Xfermode; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; Loading Loading @@ -338,7 +347,8 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri if (fSource != null) { File fPath = new File(fSource); if (fPath.exists()) { front = new BitmapDrawable(res, BitmapFactory.decodeFile(fSource)); front = new BitmapDrawable(res, getRoundedCornerBitmap(BitmapFactory.decodeFile(fSource))); tmpInset = tmpInset + 5; } } } else if (in.hasExtra(GlowPadView.ICON_RESOURCE)) { Loading Loading @@ -402,6 +412,25 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri } } public static Bitmap getRoundedCornerBitmap(Bitmap bitmap) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = 24; paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } void doTransition(View view, float to) { if (mAnim != null) { mAnim.cancel(); Loading Loading
core/res/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -242,7 +242,7 @@ <dimen name="notification_subtext_size">12dp</dimen> <!-- Lockscreen target insets --> <item type="dimen" name="lockscreen_target_inset">25dp</item> <item type="dimen" name="lockscreen_target_inset">30dp</item> <!-- Keyguard dimensions --> <!-- TEMP --> Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java +30 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,16 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources.NotFoundException; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuffXfermode; import android.graphics.PorterDuff.Mode; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Xfermode; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; Loading Loading @@ -338,7 +347,8 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri if (fSource != null) { File fPath = new File(fSource); if (fPath.exists()) { front = new BitmapDrawable(res, BitmapFactory.decodeFile(fSource)); front = new BitmapDrawable(res, getRoundedCornerBitmap(BitmapFactory.decodeFile(fSource))); tmpInset = tmpInset + 5; } } } else if (in.hasExtra(GlowPadView.ICON_RESOURCE)) { Loading Loading @@ -402,6 +412,25 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri } } public static Bitmap getRoundedCornerBitmap(Bitmap bitmap) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = 24; paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; } void doTransition(View view, float to) { if (mAnim != null) { mAnim.cancel(); Loading