i recently updated the appcombat library to integrate the material design.
But there is an issue with the style "Theme.AppCompat.Light.DarkActionBar", because if i use this style and let my TextView like:
android:textAppearance="?android:attr/textAppearanceSmall
the whole text appears invisible (or just white) on a white background
If a use the "Theme.AppCompat.Light" theme, everything is working fine.
This issue i have only on Devices running android 2.3.*
Samples: (Don't have enough reputation to post images, so you need to click)
DarkActionBar:
Light:
Any suggestions guys? Anyone tried the new appcombat library with Gingerbread?
Obviously i found out that i need to use material text appeareance, for instance:
android:textAppearance="#style/TextAppearance.AppCompat.Body1"
See also:
http://www.google.com/design/spec/style/typography.html#typography-roboto-noto
Related
I am in a fairly serious predicament. I have built my entire app using ?attr/colorPrimary to pick the color for background shapes, as I have devised a way to dynamically change the theme and color. This works perfectly on 5.0, but on all 4.x devices, ?attr/colorPrimary crashes the app. Why does Android studio not alert developers to this incompatibility?
Is there a support version of ?attr/colorPrimary?
colorPrimary is already part of AppCompat as of version 21 and works back to API 7. Your problem is instead with your theming code.
I believe it was added after Android Lollipop - API 21.
At least this link shows that it was added between API 20 and 21:
https://developer.android.com/sdk/api_diff/21/changes/android.R.attr.html
attr/colorPrimary just point to colorPrimary defined in current theme.
I'm not sure how you implemented your theme.. But you can create your own attr... This option is good only if you support several themes.
If you have a single theme, I believe you can replace it by a color.
API 21:
Material design style
Notifications are drawn with dark text atop white (or very light)
backgrounds to match the new material design widgets. Make sure that
all your notifications look right with the new color scheme. If your
notifications look wrong, fix them:
Use setColor() to set an accent color in a circle behind your icon
image. Update or remove assets that involve color. The system ignores
all non-alpha channels in action icons and in the main notification
icon. You should assume that these icons will be alpha-only. The
system draws notification icons in white and action icons in dark
gray.
The problem is a glitch in Android code. See this, it is not the exact same but the reason is.
In case anyone out there has this problem, I want to explain my workaround.
Remove all instances of "?attr/color(Primary, Dark, or Accent)" and attempt to mimic the effect in each individual element in each individual activity. This is not a full work around, but for me it works. Google really needs to resolve this issue. If you know a better work around, please let me know and I will accept it as the better answer as long as it works.
Is it possible to use normal holo theme when using appcompat.v7.actionbar instead of themes.appcompat.light? Because when I do everything just looks poor quality resource or graphics wise. The actionbar seems quite messy as well after I used appcompat theme. Thank you
Looks like you want to use a lib project HoloEverywhere
I can't seem to find any documentation on changing the color of the header for each in app the multitask view. As you can see in the image below, all the headers are default white ( I know they are webpages, but just using the image to show what I want to be changing).
I just created a plugin called "HeaderColor" for cordova (only for Android devices) that does what you want. I hope it helps you.
Installation:
cordova plugin add cordova-plugin-headercolor
Usage:
window.plugins.headerColor.tint("#becb29");
Result:
Github:
https://github.com/tomloprod/cordova-plugin-headercolor
If I'm not mistaken (as I may very well be), you can find the instructions from r0adkll's aswer. It basically means that you use this line
Activity.setTaskDescription(new ActivityManager.TaskDescription(label, icon, color));
and because this is Android 5.0 feature (right?) I don't think anyone has created a plugin for this yet. Creating plugins isn't luckily all that hard and there are great tutorials on Cordova documentation. I might also find some time to make this on weekend..
You can find an answer in this question
Android Lollipop recents/multitasking header styling, text always black
But I think that the best way to do this is implementing the Material Design style in your app. For example, using
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
with the support library v21 or
<style name="AppTheme" parent="android:Theme.Material">
for Android 5.0, the header will have the color defined by the atribute
<item name=”colorPrimary”>#color/my_awesome_color</item>
in your style file.
Take a look at this blog post
http://android-developers.blogspot.com.br/2014/10/appcompat-v21-material-design-for-pre.html
for more information about how to implement Material design with the support library in your app.
I'm using Theme.Sherlock.Light theme for my application and I'm creating a DialogFragment with an underlying AlertDialog. It works just fine on Android 3.x and 4.x, but on Android 2.x I see dark text on dark background, which is hardly readable. Am I doing something wrong and do I need to force light background by creating a custom style? Thanks in advance.
I found solution here:
builder.setInverseBackgroundForced(true)
Also, as I see here, Jake Warton suggests fix it by the same way and he doesn't know any better solution because of AlertDialogs implementation.
I am trying to more or less copy a PSD that has older controls in it with also using the ActionBar in ICS they like the old style that has the actual box instead of the underline. how would i be able to keep the holo theme and revert a control to the old styles?
Just wanted to show you how i made this happen as quick fix..
http://www.androidworks.com/changing-the-android-edittext-ui-widget
This covers the bases on how to style in depth .. and basically i built my own 9.png files..