Tag: android-5.0-lollipop

Error while trying to create circular reveal: IllegalStateException: cannot start this animation on a detached view

So, I’m experimenting trying to create a circular reveal on API level 21 on a TextView but I keep getting this error. At first I thought it had something to do with the lifecycle of the fragment I was attempting it but then I just tried the same thing in an activity and it still […]

CardView goes on top of FrameLayout, but declared first

I have simple FrameLayout with support CardView as first item, and TextView as second, so TextView must be on top of inflated view. This works on pre-Lolipop but on 21+ card takes toppest place in layout, why that’s so and how to fix this? Same thing with RelativeLayout. Layout: <?xml version=”1.0″ encoding=”utf-8″?> <FrameLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” […]

Override Android-L CardView state_pressed for Older versions of Android

In the latest Android SDK we now have the new CardView, I have replaced my old CustomCardView with the new version, but when running with this on older versions of Android I see that the state_pressed & state_focused are ugly squares which show up above the CardView… does anyone know how I could emulate the […]

Set ripple effect on Image View

Got the following Image View: <ImageView android:id=”@+id/header” android:layout_width=”match_parent” android:layout_height=”match_parent” android:fitsSystemWindows=”true” android:scaleType=”centerCrop” app:layout_collapseMode=”parallax” android:clickable=”true” android:focusable=”true” android:background=”?android:attr/selectableItemBackground”/> Ripple works great if I don’t set a bitmap to the image view. But once I set a bitmap like this, ripple effect is gone: ImageView iv=((ImageView)rootView.findViewById(R.id.header)); iv.setImageBitmap(myBitmap); This is my ripple.xml: <ripple xmlns:android=”http://schemas.android.com/apk/res/android” android:color=”?android:colorControlHighlight”> <item android:id=”@android:id/mask”> <shape android:shape=”oval”> <solid […]

appcompat-v7:21.0.0 not working with google play service 6.1+

I’m updating my app to bring material theme support(my app uses Google Play Services) When I sync my project, this showed up: …\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\6.1.11\res\values\wallet_colors.xml Error:Attribute “showText” has already been defined My gradle dependencies: compile ‘com.android.support:appcompat-v7:21.0.0’ compile ‘com.google.android.gms:play-services:6.1.11’ // the latest version of play-services is 6.1.11 If I exclude appcompat-v7 then the project compiles without errors. Did […]

Cannot create an emulator with Android L (API 20)

I have updated to ADT 23 and SDK manager with Android L (API 20 L preview), but I am not getting the “Android L” in the target list. Done restarting the Eclipse many times. doesn’t work. Some one please tell me what I am doing wrong.

Styling the popup menu in Android 5.0

I’m making my app ready for Android 5.0, I’m using the latest compatibility library, here is what my style looks like. <resources> <style name=”AppTheme” parent=”Theme.AppCompat.Light.DarkActionBar”> <item name=”colorPrimary”>@color/theme_accent</item> <item name=”colorAccent”>@color/theme_accent_secondary</item> </style> <style name=”AppThemeDark” parent=”Theme.AppCompat”> <item name=”colorPrimary”>@color/theme_accent</item> <item name=”colorAccent”>@color/theme_accent_secondary</item> </style> </resources> (The ActionBar color is being set programmatically.) Now, I want the overflow/popup menu to have the […]

Android L is ignoring shapes as drawable background

I’m testing Android L Preview on my Nexus 5. I’ve got problem with my app. I’ve got some TextViews with background set: android:background=”@drawable/rounded_textview” And “rounded_textview” is just shape. It is working great below <=API19. <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle” android:padding=”3dp”> <solid android:color=”#999999″/> <corners android:bottomRightRadius=”2dp” android:bottomLeftRadius=”2dp” android:topLeftRadius=”2dp” android:topRightRadius=”2dp”/> </shape> On Android L Developer Preview background […]

android:windowNoTitle will not hide actionbar with appcompat-v7 21.0.0

I updated appcompat-v7 to lollipop version(21.0.0) then I can’t hide ActionBar with following style that worked before. <style name=”AppTheme.NoActionBar”> <item name=”android:windowActionBar”>false</item> <item name=”android:windowNoTitle”>true</item> </style> I set it to specific activity. <activity android:name=”.NoActionBarActivity” android:theme=”@style/AppTheme.NoActionBar”/> When I use appcompat-v7 20.0.0 version, actionbar will be hidden as it is intended. How can I hide actionbar with custom style […]

android lollipop scrollview edge effect color

In my app i change the overscroll glow effect color like this: int glowDrawableId = contexto.getResources().getIdentifier(“overscroll_glow”, “drawable”, “android”); Drawable androidGlow = contexto.getResources().getDrawable(glowDrawableId); assert androidGlow != null; androidGlow.setColorFilter(getResources().getColor(R.color.MyColor), PorterDuff.Mode.SRC_ATOP); But when i updated to lollipop this code crashes. I get following error code: FATAL EXCEPTION: main Process: com.myproject.myapp, PID: 954 android.content.res.Resources$NotFoundException: Resource ID #0x0 at android.content.res.Resources.getValue(Resources.java:1233) […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.