I updated my app for Android 4.0 to make it more futureproof,
after the update, i started to get reports from SE-users that their edittext and textviews are all blurry, the FONT is blurry (which makes me think that this is a SE-problem).
Even if i change the font, it is still blurry.
Does anyone know a solution or have experience the same?
Can't show you any screenshots of this...
Regards.
This is a styling issue.
I had my edit text inherit the Holo theme which caused the text to blur on pre ICS devices, this may be pre HoneyComb, but I haven't been able to check.
values/styles.xml
<!-- Base style for the edit text, api dependant -->
<style name="Widget.EditBase" parent="#android:style/Widget.EditText"></style>
values-v11/styles.xml
<!-- Base Style for the edit text -->
<style name="Widget.EditBase" parent="#android:style/Widget.Holo.EditText"></style>
This fixed it instantly for me - v11 being HoneyComb 3.0 which should be fine as the Holo theme is available from then onwards.
Can't explain why, but assuming it must be with the Widget.Holo.EditText style pointing to the wrong resource pre ICS/HC.
Hope this helps.
Cheers,
Chris
I had this same issue affecting different phones. What my problem was is that my custom theme was using a parent theme from ICS which wasn't available on older phones. My solution was to have a values-v11/themes.xml for ICS devices and values/themes.xml for older android phones.
Related
(1) I am confused with the themes in android.
For example android:Theme.Material.Light and Theme.AppCompat.Light.
Also Holo light and dark themes.
I don't understand when to use what. Can someone explain me the differences of these android themes?
Need a good explanation about these themes so that I can understand how this works in my style.xml.
(2) why there are prefixed and non prefixed attributes in style tags.
<item name="colorPrimary">#3F51B5</item>
<item name="android:colorPrimary">#3F51B5</item>
when to use prefix?
Can someone explain this?
The important thing to note about these themes is that not every version of Android will support them. Thus, you may want to use different themes depending on which version of Android your application gets installed on. Derek Banas had a great video on styles and themes:
https://www.youtube.com/watch?v=W3xHIN15hP8
I'm not the most knowledgeable about styles, but I'll give it a shot. I believe that "android:colorPrimary" is used when you are overriding an attribute in an already defined style. I'm not the most knowledgeable about styles so I will lead you to the documentation page that I found that seems to cover this topic fairly well:
http://developer.android.com/guide/topics/ui/themes.html
Here are some references for further reading
https://plus.google.com/+AndroidDevelopers/posts/JXHKyhsWHAH
https://plus.google.com/+AndroidDevelopers/posts/AV2ooBWY1iy
I've searched for a solution, but haven't found one yet.
I'm currently in the process of creating an Android app and my team wants to keep the experience of our app the same across the recent Android versions. We're using the Support v7 library, so most of the Material Design elements can be used in our app, but we're kinda struggling to find a replacement for the tinted status bar. We've got a nice bar on Lollipop, but Kitkat is stuck with the ugly black bar and we'd really like to change that.
We were thinking about a translucent bar for pre-Lollipop devices, but we're not sure on how to approach that. I've tried copying the styles.xml to a new folder, values-v19, and adding
<item name="android:windowTranslucentStatus">true</item>
<item name="android:fitsSystemWindows">true</item>
to the styles, but this is also applied to my phone running Android 5.0.2, strangely enough.
Do you happen to know how to fix this or another method to create a similar effect? I'm new to Android, so detailed explanations will be appreciated.
Try adding
<item name="android:windowTranslucentStatus">false</item>
<item name="android:fitsSystemWindows">false</item>
to either values/styles.xml or values-v21/styles.xml.
When you define a style for a certain API level it will be applied not only to that version, but also to all higher versions, unless explicitly specified otherwise.
After setting SeekBar with Holo style, I got warning that it's not supported pre-Holo APIs.
If I leave it this way, will this crash the app or pull pre-Holo style anyway? It does not crash on the emulator and I don't have 2.3.3 device.
The reason for asking his is odd behaviour. I tried to manually set style for Holo and pre-Holo using res/values-v11/ directories and placing styles.xml in each and setting the style of SeekBar to style="#style/settings_seekbar" .
Style for API 11+ looked like this
<style name="settings_seekbar">
<item name="android:seekBarStyle">#android:style/Widget.Holo.SeekBar</item>
</style>
and style for APIs older than 11 looked like this
<style name="settings_seekbar">
<item name="android:seekBarStyle">#android:style/Widget.SeekBar</item>
</style>
So it looked like this would work. But on either device with Android 4.0+, I don't see Holo's theme, but the old thick-yellow theme.
If this is the proper way of settings styles (in case the first solution will crash a device), where did I make a mistake thus Holo theme never appeared on newer devices?
It seems we can safely use a theme from the upper SDK because I found no indicators that it will ever crash the app.
If the theme does not exist, Android will use the appropriate lower-level theme.
The error we can see on the image is just a warning that UI will not look the same in the SDKs which do not support this theme.
I created my own style which I use as theme for my app. It's based on android default holo light with some modification. As main color I use everywhere #android:color/holo_blue_light It worked ok with older versions of Android but when I got Android 4.2.2 device I noticed that it's possible to change the theme in device settings to ex. Mint. Then part of my app interface is in mint color (the things I didn't changed in default holo light theme) and part is in holo_blue_light.
The question is how to modify my style, instead of using #android:color/holo_blue_light to have main theme color (which in some cases will be blue light but in some cases ex. mint) (what label to use to get main theme color?).
Thanks for help.
Yar this links may helpful for you change your theme color and even to change actionbar follow
I have a strange problem with android resources. I have app created on Android 2.2 (android:minSdkVersion="8"). The application works fine.
When I installed app on for example Android 4.0, the application works fine, however at first run some resources are changed.
For example, I have drawable color named primary_color which refers to #FFFFFF html color. After installation, the system renders black color instead of white. In some cases #android:color/white renders black color.
Force closing app and restart app solving this problem.
Please help me to solve this issue.
This is caused by a bug in Android versions 4.0 to 4.1.3, I have been testing a similar problem with drawables turning to black only on devices with these versions, it is not present in devices with android version > 4.2.
I'm sure you noticed in your own research but it does not seem to be documented properly and there is no official solution but I can provide a few workarounds:
1) Turn off hardware acceleration, I used a different solution for my problem but this has been known to resolve some issues with images in the above mentioned Android versions. If you want hardware acceleration on for your application you can disable it for the problem activity by adding this to the activity declaration in your manifest.
<activity
android:name="activityName"
android:hardwareAccelerated="false"/>
2) For a solution specific to your example try setting the color to #android:color/transparent, this resolved my issue where I needed a background drawable to remain white.
3) Refer here: http://code.google.com/p/android/issues/detail?id=34619 to see a similar, documented bug and some of those solutions may work for your issue as well.
HTH
I came across the exact same problem!
I had this on colors.xml
<resources>
<color name="white">#ffffffff</color>
</resources>
And on styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">#color/white</item>
</style>
The problem was that when using fragment(which contains a ListView) inside an activity the ListView shows white color as background(which is what I need) at first run but at second run the ListView background was black. The problem only existed on Android 4.0(I did not test on 4.1) but worked fine on Android 4.3, 4.4, 5 etc.
Turns out only white color had the problem, when colors other than white was used there was no black background issue!
So as I wanted a white background and I did not want to have overdraw of having multiple background so setting white as the windowBackground on styles.xml was important but at the same time it causes black background issues!
So as solution, I created another color which is not completely white but its white
<resources>
<color name="fakewhite">#fffefefe</color>
</resources>
And on styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">#color/fakewhite</item>
</style>
Hence, in short color #ffffffff gets converted to #00000000 for Views like ListView and I also notice this behaviour on ScrollView.
This may not be a perfect solution but it worked for me!