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.
Related
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>
I'm developing an app that must work for multiple device screens, so, I separated the drawable and layout folders properly: large-land, large-port, sw720dp and so on.
For devices like Nexus, from Google, I'm having a problem with its menu, that is in OS, not physical, like in others devices.
So, layouts that works well in devices like SIII does not work on Nexus, it seems like shrunken, because I lost a litte of its height.
Discussing with friends, we thought in set its layout programatically, but in a screen with various elements, it's bad to keep. Is there a way to organize this layout and drawable using the android's structure, like I did for others resolutions and sizes?
Thanks in advance.
for the nexus 7 from Asus it will use the drawables in folder drawable-xhdpi so put the drawables there ... and for icons use 48x48 size so they will look the same size as an actionbar icon ...
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
I have an app, which provides a switchable set of night mode (red) controls using a custom Theme. The controls are in the Shared Preferences view. I have copied and colored all of the necessary images for my controls from Android git sources' hdpi and mdpi folders. The red theme works perfectly fine on the 160 dpi screen (480x800 Android 3.2), but on the 240 dpi one (480x854 Android 2.1) custom check boxes and radios are invisible, they do not occupy any space on the line with label either. Though the drop down list control on a simple linear view seems to be shown perfectly fine. The only difference I can see is that the later one has .9.png images.
What is wrong and how to fix that?
HURRAY! Found the solution by an accident. I have added a hidden checkbox item to one of the first views of my application, and all of the styled checkboxes magically appeared as they should be in every other view! I believe it's a bug in the 2.1 version of Android. I saw something like that mentioned once while googling for the problem here. It might be irrelevant though.
I followed the icon design guidelines from android and so I have icon in different size:
drawable-hdpi (96x96)
drawable-hdpi (72x72)
drawable-ldpi (36x36)
drawable-mdpi (48x48)
But on the Samsung Galaxy Tab the icon gets a weird purple/pink-ish border. The Game 'Angry Birds' seems to have the same problem. Facebook was able to change it to blue. So what is this border and how can I remove it?
Screenshot
I've observed that the Tab picks some background color to use to frame your icon, even if the icon is rendered with a transparent background: the calendar has a dark frame, gmail has the same pinkish/purple color as Angry Birds, and my icons which have transparent backgrounds/no borders on the Nexus 1 have weird blue colors. In fact, ALL of the icons on the Tab have a background and border. I've had to conclude there is no way to get rid of it, and there is currently no published algorithm as to how it picks the color.
This answer from
user
#int ermedi_8
to question
Can Icon Border Be Eliminated In Android App?
seems to work on my Samsung device: I don't know whether it works on other brands. Of course it only helps for your own apps where you can put code into AndroidManifest.xml.
Quote:-
Though it is old, maybe it still helps someone:
Thanks to #deloreyk hint about TouchWiz i found this site where Josh Barton suggests to add a meta tag to your AndroidManifest.xml
<meta-data
android:name="com.samsung.android.icon_container.has_icon_container"
android:value="true"/>