Android L ripple touch effect on shape?

Try that one: ripple.xml <?xml version=”1.0″ encoding=”utf-8″?> <ripple android:color=”@color/COLOR_WHILE_PRESSING” xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/background”></item> </ripple> background.xml <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <solid android:color=”@color/BACKGROUND_COLOR” /> <corners android:radius=”6dp” /> </shape> Or maybe this post will help you: Android L FAB Button shadow I explained there, how to implement the new FAB button, I also used the outline for that.

Android v21 Theme.Appcompat color accent is ignored, no padding on dialogs

About the accent color. You are using a AppCompat theme so you should remove Android from the namespace inside your theme. <style name=”AppTheme_Light” parent=”Theme.AppCompat.Light.DarkActionBar”> <item name=”colorPrimary”>@color/abc1</item> <item name=”colorPrimaryDark”>@color/abc2</item> <item name=”colorAccent”>@color/abc3</item> </style> About the dialog. AppCompat doesn’t support it (as I know). You can try to use this style in your values-v21 folder: <style name=”Theme” parent=”FrameworkRoot.Theme”> … Read more

Android SystemUI glitches in Lollipop

Setting android:hardwareAccelerated=”false” is a kind of extreme solution, as graphical performance is likely to be very bad. If you can pinpoint the view that is misbehaving and causing this issue, a better fix would be to switch it to software rendering instead, via setLayerType(), e.g. view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); Funny thing is, I haven’t experienced any rendering … Read more

Heads-up Notification – Android Lollipop

According to Notifications, you are required to set a vibrate or ringtone to make Heads-up work. However, here’s a quick hack that doesn’t require VIBRATE permission to produce a head-up notification: notificationBuilder.setPriority(Notification.PRIORITY_HIGH); if (Build.VERSION.SDK_INT >= 21) notificationBuilder.setVibrate(new long[0]); EDIT: Don’t abuse heads-up notification. See here for when to use heads-up notification: MAX: For critical and … Read more

Change status bar color with AppCompat ActionBarActivity

I’m not sure I understand the problem. I you want to change the status bar color programmatically (and provided the device has Android 5.0) then you can use Window.setStatusBarColor(). It shouldn’t make a difference whether the activity is derived from Activity or ActionBarActivity. Just try doing: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); … Read more

How to create ripple effect in simple layout

Set these properties on your layout (if your layout has the default white/light background): android:clickable=”true” android:focusable=”true” android:background=”?attr/selectableItemBackground” You don’t need a custom drawable in this case. However, if your layout has a black/dark background, you’d have to create your own ripple drawable like this one: <?xml version=”1.0″ encoding=”utf-8″?> <!– An white rectangle ripple. –> <ripple … Read more