Android Question Android 5.0 Lollipop problems...

ilan

Expert
Licensed User
hi

i have bought me a Nexus Phone with Android 5.0, some customer claimed that my app doesn't show labels after he has upgraded his phone to android 5.0, so i needed to get also an nexus to check this issues and its true

not all labels are visible... see picture please...

if someone has any idea how i can fix that i would be very glad :)


scr1.png


scr2.png



Regards, ilan
 

corwin42

Expert
Licensed User
I think this has to do with the new Elevation property of views. Buttons have a higher elevation as other views in material themes so they are always displayed on top of other items.

I think Erel opened a bug for this but I think they won't fix it. Maybe they will declare View.bringToFront as deprecated or something like this.

A possibility will be to use ViewCompat.setElevation() (API 7+) method or View.setElevation (API 21+) to put the labels in front of buttons.

For making your app compatible again a first solution would be to set a holo theme.
 

corwin42

Expert
Licensed User
can you tell me where i need to put the viewcompat.setelevation...? and what will it exactly do? thanx
The Elevation of a view is how high the view will "float" above the underlying surface. So this is mainly to create 3D effects. Depending on the elevation of a view it will float above or below other views. This property is new with material design themes. There will be libraries for all this material design features, soon.
 

ilan

Expert
Licensed User
so this is the reason why not all my views are in the right position after upgrading to android 5.0 right?

EDIT: so after set this line in manifest:
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") will it solve also the position issue??
 

corwin42

Expert
Licensed User
so this is the reason why not all my views are in the right position after upgrading to android 5.0 right?

EDIT: so after set this line in manifest:
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") will it solve also the position issue??
Postion should be no problem even without this line.

Two main things change if a material theme is used:
- All button texts are uppercase ("BUTTONTEXT" instead of "Buttontext"
- Buttons are always displayed in front of other views.
 

Chris Williams

Member
Licensed User
I just updated my phone to 5.0.1...my app worked when it was 4.4.2. Now it does not reapond to my media button click event (when screen is locked). Is there a different way to check if screen is locked and/or determine if volume media button is pressed in 5.0.1? Also the contact manager seems to invert the phone type and number (thats an easy workaround)
 
Top