Android Question Android 5.0 Lollipop problems...

ilan

Expert
Licensed User
Longtime 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
 

ilan

Expert
Licensed User
Longtime User
thank you very very very very very very very very very very very very... much (did i allready mentioned "very"?) :)

i will try it when i get home ..
 
Upvote 0

corwin42

Expert
Licensed User
Longtime 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.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
ok thanx corwin for your detailed answer...

i will set the holo theme in manifest.
can you tell me where i need to put the viewcompat.setelevation...? and what will it exactly do? thanx
 
Upvote 0

corwin42

Expert
Licensed User
Longtime 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.
 
Upvote 0

ilan

Expert
Licensed User
Longtime 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??
 
Upvote 0

corwin42

Expert
Licensed User
Longtime 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.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
wow thanx it worked, and it fixed for me also the location of the views (i dont know why) but now views are in the right position and labels are visiable

thank you!!! :)
 
Upvote 0

Chris Williams

Member
Licensed User
Longtime 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)
 
Upvote 0
Top