actionTab text in lowerCase [duplicate] - android

Hello I am using the Sherlock library to achieve the ActionBarTabs in Android but there is some weird issue that text appear in the Tabs are all caps. I dont want to make all caps to captital. How can I achive this ?
I tried this but this is not working
values-v14.xml
<style name="TariffPlansTheme" parent="Theme.Sherlock">
<item name="actionMenuTextAppearance">#style/MyMenuTextAppearance</item>
<item name="android:actionMenuTextAppearance">#style/MyMenuTextAppearance</item>
</style>
<style name="MyMenuTextAppearance" parent="TextAppearance.Sherlock.Widget.ActionBar.Menu">
<item name="android:textAllCaps">false</item>
</style>
AndroidManifest.xml
<activity
android:name="TariffPlansActivity"
android:label="#string/title_activity_tariff_plans"
android:screenOrientation="portrait"
android:theme="#style/TariffPlansTheme">
</activity>
Thanks in advance.

This solved my issue. I was using wrong parent style Menu instead of Tab
<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light" />
<style name="TariffPlansTheme" parent="Theme.Sherlock">
<item name="actionBarTabTextStyle">#style/My.TabText.Style</item>
<item name="android:actionBarTabTextStyle">#style/My.TabText.Style</item>
</style>
<style name="My.TabText.Style" parent="#style/Widget.Sherlock.ActionBar.TabText">
<item name="android:textAllCaps">false</item>
</style>
</resources>

Related

Styling the android action bar?

I'm trying to style the action bar inside my app using the code below.
<resources>
<!-- the theme applied to the application or activity -->
<style name="myTheme" parent="#style/Theme.AppCompat">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="actionBarStyle">#style/MyActionBar</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textSize">24sp</item>
</style>
simply put the font should be bigger.. but nope.
Any ideas as to why?
Thanks.
Possibly your theme is not applied to activity. Set it in manifest:
<activity
android:name=".YourActivty"
android:theme="#style/myTheme" />
UPDATE 1
You should change action bar text size in such way (changing titleTextStyle):
<style name="Theme.YourTheme" parent="android:style/Theme">
<item name="android:actionBarStyle">#style/Theme.YourTheme.Styled.ActionBar</item>
</style>
<style name="Theme.YourTheme.Styled.ActionBar">
<item name="android:titleTextStyle">#style/Theme.Viadeo.Styled.YourTheme.TitleTextStyle</item>
</style>
<style name="Theme.YourTheme.Styled.ActionBar.TitleTextStyle" parent="#android:style/Widget.TextView">
<item name="android:textSize">24sp</item>
</style>

Text appear all caps in Action Bar Tabs in Sherlock

Hello I am using the Sherlock library to achieve the ActionBarTabs in Android but there is some weird issue that text appear in the Tabs are all caps. I dont want to make all caps to captital. How can I achive this ?
I tried this but this is not working
values-v14.xml
<style name="TariffPlansTheme" parent="Theme.Sherlock">
<item name="actionMenuTextAppearance">#style/MyMenuTextAppearance</item>
<item name="android:actionMenuTextAppearance">#style/MyMenuTextAppearance</item>
</style>
<style name="MyMenuTextAppearance" parent="TextAppearance.Sherlock.Widget.ActionBar.Menu">
<item name="android:textAllCaps">false</item>
</style>
AndroidManifest.xml
<activity
android:name="TariffPlansActivity"
android:label="#string/title_activity_tariff_plans"
android:screenOrientation="portrait"
android:theme="#style/TariffPlansTheme">
</activity>
Thanks in advance.
This solved my issue. I was using wrong parent style Menu instead of Tab
<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light" />
<style name="TariffPlansTheme" parent="Theme.Sherlock">
<item name="actionBarTabTextStyle">#style/My.TabText.Style</item>
<item name="android:actionBarTabTextStyle">#style/My.TabText.Style</item>
</style>
<style name="My.TabText.Style" parent="#style/Widget.Sherlock.ActionBar.TabText">
<item name="android:textAllCaps">false</item>
</style>
</resources>

Android: Add a style to the actionbar on one activity

I want to add a style from styles.xml
<style name="BlueActionBar" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:background">#color/blue</item>
<item name="android:textColor">#FFFFFF</item>
</style>
to my Actionbar but just on the Activity BlueActivity (which is still blank). How to do that? I'm stuck :'(
edit:
Why does adding
android:actionBarStyle="#style/BlueActionBar"
to BlueActivity in the Manifest not work?
themes.xml:
<style name="Theme.Project.Activity1" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarStyle">#style/Widget.Project.Activity1.ActionBar</item>
<item name="android:actionBarStyle">#style/Widget.Project.Activity1.ActionBar</item>
</style>
AndroidManifest.xml:
<activity android:name="com.example.Activity1"
android:theme="#style/Theme.Project.Activity1"
/>

AndroidManifest.xml and style

<activity android:name=".activity.MyHomePage" android:theme="#style/AppTheme.Light" android:label="New Tasks"/>
I have that Activity in my AndroidManifest.xml file. How do I set style on that android:label. I would like to set textsize and textcolor.
<style name="AppTheme.Light" parent="#android:style/Theme.Holo.Light">
<item name="android:windowBackground">#drawable/background</item>
<item name="android:actionBarStyle">#style/ActionBarTextSize</item>
<item name="android:windowTitleSize">14pt</item>
</style>
OR
<style name="ActionBarTextSize" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:textSize">14pt</item>
</style>
Are you talking about creating a custom window title style? If so, check this out: http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/

How do I apply a style to all buttons of an Android application

I have a style applied to my whole application:
AndroidManifest.xml:
<application android:theme="#style/ApplicationStyle" android:icon="#drawable/icon" android:label="#string/app_name">
And in my styles.xml:
<style name="ApplicationStyle" parent="android:Theme">
<item name="android:button">#style/CKButton</item>
</style>
<style name="CKButton" parent="android:style/Widget.Button">
<item name="android:textSize">19sp</item>
<item name="android:layout_margin">0dip</item>
<item name="android:background">#ff0000</item>
</style>
But the style doesn't get applied.
I'm sorry if I just used the false name in the ApplicationStyle - Item, but I have no clue where to look for the object names and simply assumed, that android:button applies to all buttons.
For Android styles, you reference the preset attributes that Android has laid out in R.attr. In this case, it looks like you want to to reference android:buttonStyle. I think this would work:
<style name="ApplicationStyle" parent="android:Theme">
<item name="android:buttonStyle">#style/CKButton</item>
</style>
For Material components theme it would be like this:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="materialButtonStyle">#style/AppTheme.Button</item>
</style>

Categories

Resources