android: does ScrollView has different default backgrounds for different API level? - android

I have a ScrollView with some children inside.
For API 23, the ScrollView has a white background. But for API 22 and below, the background is gray. I didn't set background in xml or code. All remaining default. Activity and fragment also have default background in layout xml. Activity theme is Theme.Holo.Light.NoActionBar by default, and Theme.Material.Light.NoActionBar for v21.
I saw this on:
samsung note 5 with 6.0.0: white
android emulator Nexus 6P with 6.0.0: white
samsung s6 with 5.1.1: gray
android emulator Nexus 6P with 5.1.1: gray
Xiaomi 4 LTE with 4.4.4: gray
android emulator Nexus 6P with 4.4.4: gray
based on the above test, I guess the background related to API levels.
If I set background to white in xml, for API 22 and below, I can see white background.
Any ideas?

If you haven't provided an explicit color, it might take the color from the default theme of the device. It doesn't depend on the API level, but the device theme.
Therefore, its also possible that you might see different colors for the same API level on two different devices.
Hence, if you want to be consistent across all devices, its always recommended to set the color you want explicitly.

Try this in your styles for the same background in different android API:
<item name="android:windowBackground">#color/background</item>

Related

Disable Samsung Hacks on Standard Android Styles and Themes

Samsung seems to be overriding default android styles and themes (they've been doing this for years). Doing simple things like putting a SeekBar in your layout:
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content" />
works fine on every other device, except Samsung. On a Samsung device the SeekBar thumb is not centered vertically, it's moved up above the SeekBar's center line.
The SeekBar isn't the only example of standard UI not working correctly on Samsung devices. It's a general problem across many of the standard components.
How can I disable Samsung's hacks on the Android standard styles / themes in my app?

Android 4.3 (api 18) application name/icon position display change?

Moi - working on my app I added an emulator for api 18 to go along with 17 and 16. FYI, I am emulating an N7.
All is well and consistent for 16 and 17. However, wtf with 18. My application title and its icon seem to be put in a layout slightly larger. This is noticable as the default application background overlays the light blue border I've tried to compare to screen captures and as best I can tell the placement of the icon and application title text are identical but the background extends an extra 4 or 5 pixels.
Has anyone else had this issue? TIA
To try to make things a bit more obvious I changed the application base theme to Holo.Light. On API 17, the application background color only shows behind the icon and the app name text. However, on API 18 the background covers a rectangular area the height of the title/action bar and slightly wider than the icon and title. My only styling (to this point) is
<style name="AppBaseTheme" parent="android:Theme.Holo">
<item name="android:background">#FF000024</item>
</style>
The desired behavior is that API 18 Holo (dark) looks the same as API 17 and 16.
API 17 Light API 17 Dark API 18 Dark API 18 Light
More info: I've used the android debug tools to verify that the actual layout element sizes are identical on api 16/17/18/19. However, API 18 and 19 have this issue with the background in the lanuncer icon area (android:id/home).

List is not properly shown with Motorola Razor XT910 (android 2.3)

I have developed a UI for android 2.3. The UI contains a list, and some icons on bottom of the screen.
I have used #android:style/Theme.Holo.Light in <application/> tag.
I have tested this app on Samsung galaxy nexus (android 2.3) and galaxy nexus (android 4.0). It works very well.
But when I run this app on Motorola Razor XT910 (android 2.3), if the list contains only few elements, i.e. it does not cover the entire screen area (i.e. screen area above the bottom icons), the empty part appears in grey color. I have also used the background tag for layout set as white color. The UI on Moto looks like this:
Please suggest me how to make this grey area as white background. I have tried alot but couldn't find the solution.
Thank you.
Instead of making its height as wrap_content add the below attribute to your list view.
The problem is android:overScrollFooter. Motorola has a default one set and it causes sadness. To get rid of it, set android:overScrollFooter="#null" in your ListView.
I too faced the same problem in Motorola Devices
Defy MB526 OS 2.3.4
Droidx OS 2.3.4
This problem occurs on motorola devices using android 2.3. The simplest fix is to set the listview height to wrap_content. More on the issue here.. Moto Listview
Set background color of your main Layout as White.It will work fine

Android - Different colors in different devices

I'm developing an application for Android, and the colors of drawables changes when I'm testing the app on Samsung Galaxy S2, and when I test the application on Samsung Galaxy Europe or on emulator, appears the real colors of the drawable. For exemple, the gradient white and black, is different on Samsung S2.
Why this happening?? Can I do something on application to show the real colors on Samsung S2?
By default when we use transparent images in our app mostly the transparent part will show its parent.
For example if we use transparent images for menus in android.
then by default the theme of the device/background will be the parent view for this image.
According to me better to change the image and try.

Android Black Theme vs White Theme

Is there a performance impact, especially with regard to battery performance, if we switch from the default black theme of android to white or another colour?
If the screen is LCD white light consumes less power than the black.
What Chimmy said, plus for AMOLED displays black uses less power as far as I know. The Nexus One is AMOLED and Samsung Galaxy S is Super AMOLED.

Categories

Resources