RatingBar deforms my layout in Android 2.3 - android

This is how an item of my ListView in my app looks in Android 4.4 (real device):
And this is how the same activity in the same app looks in Android 2.3 (real device, too):
As you can see, I am using a custom layout for the rating bar, which deforms the activity in Android 2.3 with this horrible vertical bars. Can someone tell me why is this happening?

Set correct android:minHeight and android:maxHeight values for your stars style. This happens because of different parent styles on different platforms.

Related

selectableItemBackground shows black borders in pre lollipop devices

It seems that selectableItemBackground is broken all over my app for pre Lollipop devices. Not sure if this is a broke in a support library update. All widgets like Buttons, CardViews, RadioButtons, etc that show a selected state are showing this strange black borders when being pressed
radio button
cards in recyclerview
And it happens in more scenarios like the back arrow of the Toolbar that shows by default. Note that API >= 21 devices shows the nice ripple effect in all the scenarios mentioned above.
I am using support lib v23.4.0 (I have already tried to downgrade to v23.3.0, v23.2.1 and v23.2.0 with the same results). My theme inherits from Theme.AppCompat.Light.NoActionBar and it does not set a custom drawable for selectableItemBackground. I looked at the source code and I was able to determine that the theme inherits from Base.V7.Theme.AppCompat.Light whose selectableItemBackground is set to #drawable/abc_item_background_holo_light state list drawable which in turn uses
#drawable/abc_list_selector_background_transition_holo_light to set the #drawable/abc_list_pressed_holo_light as its drawable for the pressed state. The 9-patch image (drawable-hdpi-v4/abc_list_pressed_holo.light.9.png) shows this black borders, which seems to be the ones showing in the app.
I am seeing this behaviour in both an emulator and device (Samsung Galaxy S4) running API 19 (Android 4.4.2)
Any help would be appreciated

Does elevation not work within Android Home Screen Widgets?

Tried all sorts of different ways to do this but not matter what view I apply an elevation to (such as android:elevation="10dp") it does not render correctly on a Home Screen Widget.
Is this a known limitation, that home screen widgets do not support elevation. I am running this on an Android L device so its should not be a compatibility issue.
If this is impossible I figure I could use 9-patch or layer-list drawable to achieve a similar but not as good effect.
I've played with all widgets I have on my phone (both with Nova Launcher and Nexus 5 stock launcher, which is Google) and none of them have this feature, even Google apps (excluding Google Now!).
I've added app:elevation="10dp" on my widget and I think that it is not possible to have this feature on Widget directly, without playing with code and fantasy.
If you really want a widget that include elevation design, just "copy" the style of Google Now widget.
I suppose that they have a transparent layout (the black parts on image) wich contains another layout (grey) with elevation and grid filled with CardView with elevation too.
Let me know if you want an example code.

How to get the new Android progress view that is in 4.0?

I have just tried implementing a ProgressBar with the following two styles:
?android:attr/progressBarStyleLarge
?android:attr/progressBarStyleSmall
However, they are the old, vanilla progress spinners that Android has always had. See below:
I'm looking for the progress bar that comes with the 4.+ theme. It's the one that has one progress indicator rotating clockwise, and a semi-transparent indicator running counterclockwise at a slower pace. The heads then intersect at 5 points (star formation) across the circle, like the image below.
How do I get this ProgressBar in my app?
You should define a custom theme, then have it inherit from Theme.Holo in API level 11+, and from Theme for all others (or their light variants). To do so, see Select a theme based on platform version.
That way the progressBarStyleLarge attribute will be mapped to the new resource (progress_large_holo) in devices that support it. This will also change all other resources though (such as backgrounds for EditText, &c).

Android 3.2 Strange view issues

I'm new to Android development, and was testing my application in the 3.2 simulator to ensure that everything scales correctly on a tablet. The view consists of a ListView in a TabBar, and I am experiencing strange issues with misalignment of the UI (See link). This is not present on any other OS version (2.1 - 4.0) on any of the phone screen sizes.
The ListView items consist of a custom layout that uses a LinearLayout with a background drawable and two textviews for the title and subtitle.
XML Render (10.1in WXGA Tab):
Has anybody got any ideas?
EDIT:
Fixed the issue. I had disabled rotation on my TabBar views in my manifest, by removing this line of code in the XML the list renders as desired. Thanks for all those who contributed.
you can choose to load different layouts,values,and other resources as per device,locale simply changing the folders name by adding specific values,in your case use something like layout-hdpi ,layout-xhdpi

How to handle the fact that Dialog background in Theme.Light are black on pre-ICS sdk and white on ICS

In my application, I use some dialogs to display information.
The theme of my application is Theme.Light since 2 years, and these dialogs have always been black since the beginning.
Now with ICS, it seems that Google just changed his mind and turned these dialogs into white:
See the screenshot of my Moto Xoom and my Galaxy Nexus:
What is the best practice to handle that true fragmentation?
I have been thinking about creating different layout: layout-v14 but I will soon become crazy, if I have to create layout-v15,v-16, etc for the future?
Or is there a way to tell "lower than v14" and "higher than v14"?
layout-v14 apply to v14 and higher, so if any different style will appear in future you able to add layout-vXX to support this. And all versions between v14 and vXX will apply v14 layout.

Categories

Resources