Im trying to change the size of the item text of my navigation view in android studio but every time it appears the same. I have tried creating an style like the following:
<style name="ItemStyle">
<item name="android:textSize">20dp</item>
<item name="android:textStyle">bold</item>
</style>
or
<style name="ItemStyle">
<item name="android:textSize">20sp</item>
<item name="android:textStyle">bold</item>
</style>
or
<style name="ItemStyle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textSize">20dp</item>
<item name="android:textStyle">bold</item>
</style>
but none of these seem to work this is my navigation view code
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_gravity="start"
android:layout_height="match_parent"
app:theme="#style/ItemStyle"
android:id="#+id/navigationView"
app:menu="#menu/nav_menu"
app:headerLayout="#layout/nav_header"
>
also here is my nav_menu code
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
>
<item
android:id="#+id/nav_home"
android:icon="#drawable/homeicon"
android:title="Home" />
<item
android:id="#+id/nav_invite"
android:icon="#drawable/invite"
android:title="Invite friends" />
<item
android:id="#+id/nav_history"
android:icon="#drawable/history"
android:title="Ride history" />
<item
android:id="#+id/nav_payment"
android:icon="#drawable/payment"
android:title="Payment" />
<item
android:id="#+id/nav_help"
android:icon="#drawable/help"
android:title="Help" />
<item
android:id="#+id/nav_settings"
android:icon="#drawable/settings"
android:title="Settings" />
<item
android:id="#+id/nav_driver"
android:icon="#drawable/drive"
android:title="Drive" />
</menu>
I would appreciate if someone can help find out whats wrong with it. Thanks
You can also try the textAppearance
Your style:
<style name="MyDesign" parent="Base.TextAppearance.AppCompat">
<item name="android:textSize">26sp</item>
<item name="android:textStyle">bold</item>
</style>
Implementation:
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_gravity="start"
android:layout_height="match_parent"
app:itemTextAppearance="#style/MyDesign"
android:id="#+id/navigationView"
app:menu="#menu/nav_menu"
app:headerLayout="#layout/nav_header"
>
Related
I am using BottomNavigationView but observing a strange issue.
When used with the theme "Theme.AppCompat.Light.DarkActionBar", Text and Icon Resize animation works fine on each item when clicked.
But When used with theme "Theme.MaterialComponents.Light.DarkActionBar",
it's not working, No Resize animation happening.
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottomNav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#212121"
app:itemIconTint="#color/nav_item_color_state"
app:itemTextColor="#color/nav_item_color_state"
app:menu="#menu/bottom_menu_main"/>
nav_item_color_state.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="#+id/action_nav_feed"
android:icon="#android:drawable/ic_input_add"
android:checked="true"
android:title="List"/>
<item
android:id="#+id/action_nav_info"
android:icon="#android:drawable/ic_notification_overlay"
android:title="Info"/>
<item
android:id="#+id/action_nav_profile"
android:icon="#android:drawable/ic_delete"
android:title="Profile"/>
</menu>
style.xml
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
<!-- Theme.AppCompat.Light.DarkActionBar -->
Try using the properties app:itemTextAppearanceActive and app:itemTextAppearanceInactive
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottomNav"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#212121"
app:itemIconTint="#color/nav_item_color_state"
app:itemTextAppearanceActive="#style/BottomNavigationView.Active"
app:itemTextAppearanceInactive="#style/BottomNavigationView"
app:itemTextColor="#color/nav_item_color_state"
app:menu="#menu/bottom_menu_main"/>
In styles.xml
<style name="BottomNavigationView"
parent="#style/TextAppearance.AppCompat.Caption">
<item name="android:textSize">10sp</item>
</style>
<style name="BottomNavigationView.Active"
parent="#style/TextAppearance.AppCompat.Caption">
<item name="android:textSize">15sp</item>
</style>
There's no need to set theme for this View, these styles will do the thing.
I am using an image button on ListView which shows a popup menu when clicked.
But the problem is that items are not visible.
This is how menu looks.I can see white text on menu in this image but on mobile screen it is invisible.
This is styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:colorBackground">#color/colorPrimary</item>
<item name="android:textColorPrimary">#android:color/black</item>
<item name="android:textColorSecondary">#fcfcfc</item>
<item name="android:actionMenuTextColor">#color/black</item>
</style>
<style name="itemTextStyle.AppTheme" parent="#android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">#android:color/black</item>
<item name="android:colorBackground">#color/colorPrimary</item>
</style>
<!-- LoginCreateText -->
<style name="LoginCreateText">
<item name="android:textSize">#dimen/login_buttons_text_size</item>
<item name="android:textColor">#android:color/white</item>
<item name="android:layout_margin">2dp</item>
</style>
<!-- LoginCreateTextButton -->
<style name="LoginCreateTextButton">
<item name="android:textSize">#dimen/login_buttons_text_size</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#android:color/white</item>
<item name="android:layout_margin">2dp</item>
<item name="android:clickable">true</item>
</style>
<style name="HintText">
<item name="android:textSize">0dp</item>
</style>
<style name="FAB">
<item name="android:layout_margin">0dp</item>
<item name="fabSize">normal</item>
<item name="rippleColor">#android:color/white</item>
<item name="backgroundTint">#color/colorAccent</item>
</style>
<style name="ListItemText">
<item name="android:textColor">#color/light_black</item>
<item name="android:textSize">#dimen/list_item_text_size</item>
<item name="android:layout_margin">2dp</item>
</style>
</resources>
This is themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.Button.Login" parent="android:Widget.Button">
<item name="android:paddingLeft">18dp</item>
<item name="android:paddingRight">16dp</item>
<item name="android:textSize">#dimen/login_buttons_text_size</item>
<item name="android:layout_gravity">center</item>
<item name="android:background">#color/colorPrimary</item>
</style>
<style name="Toolbar" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="android:itemTextAppearance">#style/itemTextStyle.AppTheme</item>
<item name="android:background">#color/colorPrimary</item>
<item name="android:textColorPrimary">#android:color/white</item>
</style>
<style name="CustomTheme.Dialog" parent="Theme.AppCompat.Light.Dialog"/>
</resources>
This is the menu which I am trying to display.
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
app:popupTheme="#style/itemTextStyle.AppTheme">
<item
android:id="#+id/action_edit"
android:title="#string/action_edit" />
<item
android:id="#+id/action_delete"
android:title="#string/action_delete"/>
<item
android:id="#+id/action_assign"
android:title="#string/action_assign"
android:checkable="true"/>
<item
android:id="#+id/action_mark"
android:title="#string/action_mark"
android:enabled="false"/>
</menu>
This is layout file for Quiz Fragment.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/rl_fragment_quiz_lists"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey"
app:popupTheme="#style/itemTextStyle.AppTheme"
tools:context=".ui.fragments.QuizFragment">
<include layout="#layout/single_active_list" />
<ListView
android:id="#+id/list_view_active_lists"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none" />
<android.support.design.widget.FloatingActionButton xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/fab"
style="#style/FAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:onClick="showAddQuizDialog"
android:src="#drawable/ic_add_quiz"
app:borderWidth="0dp"
app:elevation="6dp"
app:pressedTranslationZ="12dp">
<!--app:rippleColor="#android:color/white" /> -->
</android.support.design.widget.FloatingActionButton>
</RelativeLayout>
This is the layout file of the activity in which this fragment is displayed.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey"
android:orientation="vertical">
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="#style/Toolbar" />
<android.support.design.widget.TabLayout
android:id="#+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/Toolbar" />
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
I have tried many solutions that were asked before ( all were about toolbar menu) but none worked for me.
I defined a new style in styles.xml
<style name="itemTextStyle.AppTheme" parent="#android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">#android:color/black</item>
<item name="android:colorBackground">#color/colorPrimary</item>
and included it in AppTheme which didn't work.then I included it in toolbar style, menu layout, QuizFragment layout but items were still invisible.How to change the background color or item color of menu to fix this, any one will work.
Try this
style.xml
<style name="CustomActionBarTheme" parent="#style/Theme.AppCompat">
<item name="android:actionOverflowButtonStyle">#style/OverflowButton</item>
<item name="actionOverflowButtonStyle">#style/OverflowButton</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:dropDownListViewStyle">#style/PopupMenuListView</item>
<item name="dropDownListViewStyle">#style/PopupMenuListView</item>
<item name="actionOverflowMenuStyle">#style/OverflowMenu</item>
<item name="actionBarDivider">#null</item>
<!-- OverFlow Menu Text Color -->
<item name="android:textColor">#color/black</item>
</style>
<!-- OverFlow menu Styles -->
<style name="PopupMenuListView" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:divider">#color/black</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:background">#color/white</item>
</style>
<style name="OverflowMenu" parent="Widget.AppCompat.PopupMenu.Overflow">
<!-- Required for pre-Lollipop. -->
<item name="overlapAnchor">false</item>
<!-- Required for Lollipop. -->
<item name="android:overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">4.0dip</item>
</style>
and define theme for Activity in AndroidManifest.xml
<activity
android:name=".YourActivityName"
android:theme="#style/CustomActionBarTheme"/>
I am using only two themes files (for dark, and day)
Theme.MaterialComponents.DayNight.NoActionBar.Bridge
inside them, I have only items of the same name for both day and night, but in different colors. Found (after experimenting)...that this line is a game-changer in my case (same problem as yours) for title and menu to be white, while at the same time text on popup menu is black
<item name="android:textColorSecondary">#android:color/white</item>
here is the whole file, I used only this, and trying to not hard code anything.
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Ch+++itche+++++" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
<!-- Primary brand color. -->
<item name="android:textColorSecondary">#android:color/white</item>
<item name="colorPrimary">#color/primaryColor</item>
<item name="colorPrimaryVariant">#color/primaryDarkColor</item>
<item name="colorOnPrimary">#color/primaryLightColor</item>
<item name="colorOnSurface">#color/primaryColorWhiteDay</item>
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
That is all,
Happy coding,
Nenad
I am stuck in my own code. I can't find where to set the color of the "Title" text, in the navigationDrawer, to the defualt gray.
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:background="#000"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_gravity="start"
app:headerLayout="#layout/header"
app:itemTextColor="your color"
app:menu="#menu/drawer" />
app:itemTextColor="your color" only changes each item, like Import, Gallery etc. But how to change the Communicate textColor with the line above?
Picture 2 (dark blue) is what it looks like in my project. I managed to "somewhere" set the color to white in my project.
Can you find my problem? Currently my "Title" text is white..
nav_header_main.xml
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="#dimen/nav_header_vertical_spacing"
android:src="#android:drawable/sym_def_app_icon"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/nav_header_vertical_spacing"
android:textColor="#color/whiteGray"
android:text="#string/app_name"
/>
</LinearLayout>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
>
<include
layout="#layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:background="#color/nav_drawer_background"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="#menu/activity_main_drawer"
app:headerLayout="#layout/nav_header_main"
app:itemTextColor="#color/nav_drawer_text" />
<android.support.design.widget.NavigationView
android:id="#+id/nav_right_view"
android:background="#color/nav_drawer_background"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:fitsSystemWindows="true"
app:menu="#menu/activity_main_right_drawer"
app:itemTextColor="#color/nav_drawer_text" />
</android.support.v4.widget.DrawerLayout>
app_bar_main.xml
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="#style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
/>
values/style.xml
<style name="WelcomeDialogTitle">
<item name="android:gravity">center_horizontal</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowBackground">#color/darkblue</item>
<item name="colorPrimary">#color/transparent</item>
<item name="colorPrimaryDark">#color/darkblue</item>
<item name="colorAccent">#color/darkblue</item>
</style>
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="colorPrimary">#color/transparent</item>
<item name="colorPrimaryDark">#color/transparent</item>
<item name="colorAccent">#color/transparent</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style>
<style name="CustomTheme" parent="#android:style/Theme.Black">
<item name="android:listViewStyle">#style/CustomListView</item>
<item name="android:textViewStyle">#style/CustomTextView</item>
</style>
<style name="CustomListView" parent="#android:style/Widget.ListView">
<item name="android:textColor">#000000</item>
<item name="android:fastScrollEnabled">true</item>
</style>
<style name="CustomTextView" parent="#android:style/Widget.TextView">
<item name="android:textColor">#000000</item>
<item name="android:textSize">17sp</item>
<item name="android:padding">1dp</item>
</style>
<style name="TitleTextStyleLarge">
<item name="android:gravity">left|center</item>
<item name="android:shadowColor">#color/white</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textColor">#color/white</item>
<item name="android:textSize">18sp</item>
</style>
<style name="TitleTextStyle">
<item name="android:gravity">left|center</item>
<item name="android:textSize">18sp</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_marginLeft">5dp</item>
<item name="android:layout_weight">1</item>
<!-- <item name="android:shadowColor">#color/white</item> -->
<item name="android:textColor">#color/white</item>
</style>
<style name="BarTitleStyle">
<item name="android:background">#drawable/bg_list_topbar</item>
<item name="android:layout_height">33dp</item>
<!-- <item name="android:shadowColor">#color/white</item> -->
<item name="android:layout_width">fill_parent</item>
</style>
<style name="BarTitleProgressStyle">
<item name="android:background">#drawable/bg_list_topbar</item>
<item name="android:layout_height">27dp</item>
<item name="android:layout_width">27dp</item>
<item name="android:layout_marginBottom">1dp</item>
<item name="android:layout_marginRight">5dp</item>
<item name="android:layout_marginTop">1dp</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
</resources>
My activity theme
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
>
<meta-data
drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="#+id/nav_search"
android:title="#string/LabelSearchTabTitle" />
<item
android:id="#+id/nav_wiki"
android:title="#string/LabelTitleWikiBook" />
<item
android:id="#+id/nav_forum"
android:title="#string/LabelTitleForum"
/>
<item
android:id="#+id/nav_history"
android:title="#string/LabelHistory"
/>
<item
android:id="#+id/nav_favs"
android:title="#string/LabelFavourites"
/>
</group>
<item android:title="#string/LabelTitleSupportPages">
<menu>
<item
android:id="#+id/nav_options"
android:title="#string/LabelTitleSettings" />
<item
android:id="#+id/nav_qa"
android:title="#string/LabelTitleAbout" />
<item
android:id="#+id/nav_facebook"
android:title="#string/LabelTitleFB" />
</menu>
</item>
</menu>
Try :
<item name="android:textColorSecondary">#eeeeee</item>
Edit :
Replace :
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
With This :
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:textColorSecondary">#eeeeee</item>
</style>
Edit 2 :
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
// change header color
<item name="android:textColorSecondary">#eeeeee</item>
// change separator color
<item name="android:listDivider">#ff000000</item>
</style>
You can make a custom layout for your Drawer items and include the custom layout in NavigationView.. Like this
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<include
layout="#layout/sidedrawer"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</android.support.design.widget.NavigationView>
sidedrawer is your custom layout and you can provide it any style or color you want.. hope it will help you
I am using the toolbar with navigation view for side menu
I also have 2 action menu items of which one denotes a numeric value and other is an image.
I need to reduce the spacing between those 2 menuitems and also change the color of the item text.
This is my activity XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay"
app:titleTextAppearance="#style/AppTheme.Toolbar.Title">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
This is theme file
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
<!-- Customize color of navigation drawer icon and back arrow -->
<item name="colorControlNormal">#android:color/black</item>
<item name="android:actionButtonStyle">#style/ActionButtonStyle</item>
<item name="android:actionMenuTextColor">#android:color/black</item>
</style>
<style name="AppTheme.Toolbar.Title" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<!-- Set proper title size -->
<item name="android:textSize">#dimen/abc_text_size_title_material_toolbar</item>
<!-- Set title color -->
<item name="android:textColor">#android:color/black</item>
</style>
<style name="ActionButtonStyle" parent="#android:style/Widget.Holo.Light.ActionButton">
<item name="android:minWidth">0dip</item>
<item name="android:paddingLeft">0dip</item>
<item name="android:paddingRight">0dip</item>
</style>
This is the menu file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="#+id/lollyMenu"
android:icon="#drawable/jar"
android:orderInCategory="101"
android:title=""
app:showAsAction="always" />
<item
android:id="#+id/Amt"
android:orderInCategory="100"
android:title="0"
app:showAsAction="always" />
</menu>
You can try negative margin and textColor:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="#+id/lollyMenu"
android:icon="#drawable/jar"
android:orderInCategory="101"
android:title=""
app:showAsAction="always" />
<item
android:id="#+id/Amt"
android:orderInCategory="100"
android:title="0"
android:textColor="#fff"
app:showAsAction="always"
android:layout_marginRight="-10dp" />
</menu>
I'm using AndroidImageSlider (https://github.com/daimajia/AndroidImageSlider) in my app but I cant apply custom design in the page indicator. I'm using Eclipse, I download the proyect and add as a library
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="#+id/viewFlipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:background="#color/azul_us"
android:orientation="vertical" >
<com.daimajia.slider.library.SliderLayout
android:id="#+id/slider"
android:layout_width="match_parent"
android:layout_height="200dp" />
<com.daimajia.slider.library.Indicators.PagerIndicator
android:id="#+id/custom_indicator"
style="#style/AndroidImageSlider_Magnifier_Oval_Black" />
</LinearLayout>
<style name="AndroidImageSlider_Magnifier_Oval_Black">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">right</item>
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingRight">2dp</item>
<item name="shape">rect</item>
<item name="padding_left">3dp</item>
<item name="padding_right">3dp</item>
<item name="padding_top">4dp</item>
<item name="padding_bottom">4dp</item>
<item name="selected_color">#7ac943</item>
<item name="unselected_color">#33000000</item>
<item name="selected_width">8dp</item>
<item name="selected_height">8dp</item>
<item name="unselected_width">6dp</item>
<item name="unselected_height">6dp</item>
</style>
Thanks!!!!!
I forgot add this line
slider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));