I am useing the following xml to syle my showcaseview, but for some reason the button is darker then the original image, any idea?
<style name="ShowcaseButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">20dp</item>
<item name="android:textColor">#000000</item>
<item name="android:background">#drawable/continueknop</item>
</style>
<style name="CustomShowcaseTheme" parent="ShowcaseView">
<item name="sv_backgroundColor">#AA010101</item>
<item name="sv_showcaseColor">#color/actionbar</item>
<item name="sv_buttonText">Continue</item>
<item name="sv_titleTextAppearance">#style/CustomTitle</item>
<item name="sv_detailTextAppearance">#style/Customdesc</item>
</style>
<style name="CustomTitle" parent="TextAppearance.ShowcaseView.Title">
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="Customdesc" parent="TextAppearance.ShowcaseView.Title">
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">18sp</item>
</style>
Related
I have seen similar questions but possible solutions (this was the last one that I tried) don't work. The problem is that I can not set the text as bold nor change its size, it always appears non-bold and of the same size.
I need to display #+id/contactName as bold.
<TextView
android:id="#+id/contactName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:ellipsize="end"
android:maxLines="1"
android:overScrollMode="never"
android:paddingEnd="4dp"
android:textAppearance="#style/contactListTextPrimary"
tools:ignore="RtlSymmetry"
tools:text="Contact title" />
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">16sp</item>
</style>
The code above does not make the text bold, it always stays as it was before. Below is the complete styles.xml file.
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="windowActionModeOverlay">true</item>
<item name="preferenceTheme">#style/PreferenceThemeOverlay</item>
<item name="android:listDivider">#drawable/list_divider</item>
<item name="colorPrimaryDark">#color/color_status_bar</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:textColorHint">#color/grey</item>
<item name="android:tint">#FFFFFF</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="PreferenceThemeOverlay">
<item name="preferenceScreenStyle">#style/Preference.PreferenceScreen</item>
<item name="preferenceFragmentStyle">#style/PreferenceFragment</item>
<item name="preferenceCategoryStyle">#style/Preference.Category</item>
<item name="preferenceStyle">#style/Preference</item>
<item name="preferenceInformationStyle">#style/Preference.Information</item>
<item name="checkBoxPreferenceStyle">#style/Preference.CheckBoxPreference</item>
<item name="switchPreferenceCompatStyle">#style/Preference.SwitchPreferenceCompat</item>
<item name="dialogPreferenceStyle">#style/Preference.DialogPreference</item>
<item name="editTextPreferenceStyle">#style/Preference.DialogPreference.EditTextPreference
</item>
<item name="preferenceFragmentListStyle">#style/PreferenceFragmentList</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">#drawable/splash_screen</item>
</style>
<style name="LicensesTheme" parent="Theme.AppCompat.Light"></style>
<style name="searchTextHighlight">
<item name="android:textColor">#color/colorAccent</item>
<item name="android:textStyle">bold</item>
</style>
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="textPrimarySmall" parent="#android:style/TextAppearance.Small">
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="textPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="textPrimaryLarge" parent="#android:style/TextAppearance.Large">
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="textSecondary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:textColorSecondary</item>
</style>
<style name="textSecondarySmall" parent="#android:style/TextAppearance.Small">
<item name="android:textColor">?android:textColorSecondary</item>
</style>
<style name="sectionTitleStyle" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">#color/colorAccent</item>
<item name="android:textAllCaps">true</item>
<item name="android:fontFeatureSettings">smcp</item>
<item name="android:layout_marginBottom">#dimen/activity_padding</item>
<item name="android:layout_marginTop">#dimen/activity_padding</item>
</style>
<style name="textMetaBubble">
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textSize">14sp</item>
</style>
<style name="ProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:minHeight">12dip</item>
<item name="background">#color/colorChipBackground</item>
</style>
<style name="ToolbarSubtitleAppearance" parent="#style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textSize">12sp</item>
</style>
<style name="ToolbarTitleAppearance" parent="#style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">15sp</item>
</style>
<style name="roundImageView" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">50%</item>
</style>
<style name="forwardToSheetDialog" parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="bottomSheetStyle">#style/forwardToBottomSheet</item>
</style>
<style name="forwardToBottomSheet" parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="backgroundTint">#null</item>
<item name="shapeAppearanceOverlay">#style/forwardToAppearanceBottomSheetDialog</item>
</style>
<style name="forwardToAppearanceBottomSheetDialog" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopRight">16dp</item>
<item name="cornerSizeTopLeft">16dp</item>
<item name="cornerSizeBottomRight">0dp</item>
<item name="cornerSizeBottomLeft">0dp</item>
</style>
</resources>
You say that the contactListTextPrimary style is
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">16sp</item>
</style>
but in the full styles file you have just
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
Make them match according to the longer version and you should see a bold font.
We are using material components 1.0.0 and wanted to alter the style of MaterialButton across the app. We created our own styles extending the ones from components library. Right now we have something like:
<resources>
<style name="MyApp.Button" parent="Widget.MaterialComponents.Button">
<item name="android:minHeight">#dimen/action_button_min_height</item>
<item name="android:minWidth">#dimen/action_button_min_width</item>
<item name="android:fontFamily">#fonts/customFont</item>
<item name="android:singleLine">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
</style>
<style name="MyApp.Button.Unelevated" parent="Widget.MaterialComponents.Button.UnelevatedButton">
<item name="android:minHeight">#dimen/action_button_min_height</item>
<item name="android:minWidth">#dimen/action_button_min_width</item>
<item name="android:fontFamily">#fonts/customFont</item>
<item name="android:singleLine">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
</style>
<style name="MyApp.Button.Text" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:minHeight">#dimen/action_button_min_height</item>
<item name="android:minWidth">#dimen/action_button_min_width</item>
<item name="android:fontFamily">#fonts/customFont</item>
<item name="android:singleLine">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
</style>
<style name="MyApp.Button.Outlined" parent="Widget.MaterialComponents.Button.OutlinedButton">
<item name="android:minHeight">#dimen/action_button_min_height</item>
<item name="android:minWidth">#dimen/action_button_min_width</item>
<item name="android:fontFamily">#fonts/customFont</item>
<item name="android:singleLine">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
</style>
</resources>
Is there a way to avoid defining same values for every style?
Since you are using different parent styles you can only semplify some attributes, but not all.
For example you can define:
<style name="MyButtonTextAppearance" parent="#style/TextAppearance.MaterialComponents.Button>
<item name="fontFamily">.....</item>
<item name="android:fontFamily">...</item>
<item name="android:textStyle">...</item>
<item name="android:textAllCaps">...</item>
<item name="android:textSize">...</item>
<item name="android:letterSpacing">...</item>
</style>
And in your styles you can remove the same attributes using:
<style name="MyApp.Button" parent="Widget.MaterialComponents.Button">
....
<item name="android:textAppearance">#style/MyButtonTextAppearance</item>
</style>
so i downloaded a zip file from http://jgilfelt.github.io/android-actionbarstylegenerator/ after i had done all my custom styling , and i added the various drawables files in their respective folders. But for some reason ,when i run my app, the styles on the actionBar hasnt changed. Also i did target this custom styling in my androidManifestFile, that is i did android:theme="#style/Theme.Snapshare" . bellow is my styles.xml file in my values folder.
<resources>
<style name="Theme.Snapshare" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_snapshare
</item>
<item name="android:popupMenuStyle">#style/PopupMenu.Snapshare</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Snapshare</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.Snapshare</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.Snapshare</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.Snapshare</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_snapshare</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_snapshare
</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Snapshare
</item>
<item name="android:editTextBackground">#drawable/apptheme_edit_text_holo_light</item>
</style>
<style name="ActionBar.Solid.Snapshare" parent="#android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">#drawable/ab_solid_snapshare</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_snapshare</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_snapshare</item>
<item name="android:progressBarStyle">#style/ProgressBar.Snapshare</item>
</style>
<style name="ActionBar.Transparent.Snapshare" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/ab_transparent_snapshare</item>
<item name="android:progressBarStyle">#style/ProgressBar.Snapshare</item>
</style>
<style name="PopupMenu.Snapshare" parent="#android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_snapshare</item>
</style>
<style name="DropDownListView.Snapshare"
parent="#android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_snapshare</item>
</style>
<style name="ActionBarTabStyle.Snapshare"
parent="#android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_snapshare</item>
</style>
<style name="DropDownNav.Snapshare" parent="#android:style/Widget.Holo.Light.Spinner">
<item name="android:background">#drawable/spinner_background_ab_snapshare</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_snapshare</item>
<item name="android:dropDownSelector">#drawable/selectable_background_snapshare</item>
</style>
<style name="ProgressBar.Snapshare"
parent="#android:style/Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_snapshare</item>
</style>
<style name="ActionButton.CloseMode.Snapshare"
parent="#android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_snapshare</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Snapshare.Widget" parent="#android:style/Theme.Holo">
<item name="android:popupMenuStyle">#style/PopupMenu.Snapshare</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Snapshare</item>
</style>
<style name="AuthBackground">
<item name="android:background">#drawable/background_fill</item>
</style>
<style name="AuthBackgroundImage">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_alignParentBottom">true</item>
<item name="android:layout_alignParentRight">true</item>
<item name="android:background">#drawable/background</item>
<item name="android:scaleType">fitStart</item>
<item name="android:contentDescription">#string/content_desc_background</item>
</style>
<style name="AuthTitle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">60sp</item>
<item name="android:layout_alignParentTop">true</item>
<item name="android:layout_centerHorizontal">true</item>
<item name="android:textColor">#android:color/white</item>
<item name="android:textStyle">bold</item>
<item name="android:layout_marginTop">78dp</item>
<item name="android:text">#string/app_name</item>
</style>
<style name="AuthSubTitle" parent="AuthTitle">
<item name="android:layout_below">#+id/title</item>
<item name="android:textSize">13sp</item>
<item name="android:text">#string/subtitle</item>
<item name="android:layout_marginTop">0dp</item>
<item name="android:layout_alignParentTop">false</item>
</style>
<style name="AuthFieldContainer">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_below">#id/subtitle</item>
<item name="android:orientation">vertical</item>
<item name="android:layout_marginTop">#dimen/login_vertical_margin</item>
<item name="android:layout_marginLeft">#dimen/activity_horizontal_margin</item>
<item name="android:layout_marginRight">#dimen/activity_horizontal_margin</item>
<item name="android:paddingLeft">#dimen/login_horizontal_padding</item>
<item name="android:paddingRight">#dimen/login_horizontal_padding</item>
<item name="android:paddingTop">#dimen/login_vertical_margin</item>
<item name="android:paddingBottom">#dimen/login_vertical_margin</item>
<item name="android:background">#android:color/white</item>
</style>
<style name="AuthEditText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColorHint">#color/light_gray</item>
<item name="android:textSize">17sp</item>
<item name="android:ems">10</item>
</style>
<style name="AuthButton">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:background">#drawable/button_custom</item>
<item name="android:layout_marginLeft">#dimen/activity_horizontal_margin</item>
<item name="android:layout_marginRight">#dimen/activity_horizontal_margin</item>
<item name="android:textSize">13sp</item>
<item name="android:textColor">#color/text_color</item>
</style>
</resources>
also my MainActivity is extending ActionBarActivity, that is
public class MainActivity extends ActionBarActivity implements ActionBar.TabListener {
public static final String TAG = MainActivity.class.getSimpleName();
My action bare menu items have back text in Android 5.0. I am trying to change it to white but the style for android:actionMenuTextColor seems to be ignored and the text appears black
How can I change the menu item text color to white?
Here is my styles.xml i do not have a theme.xml
<style name="Theme.Red" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarItemBackground">#drawable/selectable_background_red</item>
<item name="popupMenuStyle">#style/PopupMenu.Red</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Red</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.Red</item>
<item name="actionDropDownStyle">#style/DropDownNav.Red</item>
<item name="actionBarStyle">#style/ActionBar.Solid.Red</item>
<item name="actionModeBackground">#drawable/cab_background_top_red</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_red</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Red</item>
<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">#style/Theme.Red.Widget</item>
<item name="android:editTextBackground">#drawable/red_edit_text_holo_light</item>
<item name="android:textColorHighlight">#99e84e40</item>
<item name="android:textSelectHandleLeft">#drawable/red_text_select_handle_left</item>
<item name="android:textSelectHandleRight">#drawable/red_text_select_handle_right</item>
<item name="android:textSelectHandle">#drawable/red_text_select_handle_middle</item>
<item name="android:autoCompleteTextViewStyle">#style/AutoCompleteTextViewred</item>
<item name="android:listChoiceIndicatorMultiple">#drawable/red_btn_check_holo_light</item>
<item name="android:listChoiceIndicatorSingle">#drawable/red_btn_radio_holo_light</item>
<item name="android:buttonStyle">#style/Buttonred</item>
<item name="android:imageButtonStyle">#style/ImageButtonred</item>
<item name="android:dropDownSpinnerStyle">#style/Spinnerred</item>
<item name="android:progressBarStyleHorizontal">#style/ProgressBarred</item>
<item name="android:seekBarStyle">#style/SeekBarred</item>
<item name="android:ratingBarStyle">#style/RatingBarred</item>
<item name="android:ratingBarStyleIndicator">#style/RatingBarBigred</item>
<item name="android:ratingBarStyleSmall">#style/RatingBarSmallred</item>
<item name="android:buttonStyleToggle">#style/Togglered</item>
<item name="android:listChoiceBackgroundIndicator">#drawable/red_list_selector_holo_light</item>
<item name="android:activatedBackgroundIndicator">#drawable/red_activated_background_holo_light</item>
<item name="android:fastScrollThumbDrawable">#drawable/red_fastscroll_thumb_holo</item>
<item name="android:actionMenuTextColor">#color/white</item>
</style>
<style name="myCustomMenuTextApearance" parent="#android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">#android:color/primary_text_dark</item>
</style>
<style name="ActionBar.Solid.Red" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">#drawable/ab_solid_red</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_red</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_red</item>
<item name="progressBarStyle">#style/ProgressBar.Red</item>
</style>
<style name="ActionBar.Transparent.Red" parent="#style/Widget.AppCompat.ActionBar">
<item name="background">#drawable/ab_transparent_red</item>
<item name="progressBarStyle">#style/ProgressBar.Red</item>
</style>
<style name="PopupMenu.Red" parent="#style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_red</item>
</style>
<style name="DropDownListView.Red" parent="#style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_red</item>
</style>
<style name="ActionBarTabStyle.Red" parent="#style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_red</item>
</style>
<style name="DropDownNav.Red" parent="#style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_red</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_red</item>
<item name="android:dropDownSelector">#drawable/selectable_background_red</item>
</style>
<style name="ProgressBar.Red" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_red</item>
</style>
<style name="ActionButton.CloseMode.Red" parent="#style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_red</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Red.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu.Red</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Red</item>
</style>
<style name="AutoCompleteTextViewred" parent="android:Widget.Holo.Light.AutoCompleteTextView">
<item name="android:dropDownSelector">#drawable/red_list_selector_holo_light</item>
<item name="android:background">#drawable/red_edit_text_holo_light</item>
</style>
<style name="Buttonred" parent="android:Widget.Holo.Light.Button">
<item name="android:background">#drawable/red_btn_default_holo_light</item>
</style>
<style name="ImageButtonred" parent="android:Widget.Holo.Light.ImageButton">
<item name="android:background">#drawable/red_btn_default_holo_light</item>
</style>
<style name="Spinnerred" parent="android:Widget.Holo.Light.Spinner">
<item name="android:background">#drawable/red_spinner_background_holo_light</item>
<item name="android:dropDownSelector">#drawable/red_list_selector_holo_light</item>
</style>
<style name="Tabred">
<item name="android:gravity">center_horizontal</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:background">#drawable/red_tab_indicator_holo</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_weight">1</item>
<item name="android:minWidth">80dip</item>
</style>
<style name="TabTextred">
<item name="android:textColor">#000000</item>
<item name="android:textSize">12sp</item>
<item name="android:textStyle">bold</item>
<!-- v14 <item name="android:textAllCaps">true</item> -->
<item name="android:ellipsize">marquee</item>
<item name="android:maxLines">2</item>
<item name="android:maxWidth">180dip</item>
</style>
<style name="ProgressBarred" parent="android:Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/red_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_progress_indeterminate_horizontal_holo_light</item>
</style>
<style name="SeekBarred" parent="android:Widget.Holo.Light.SeekBar">
<item name="android:progressDrawable">#drawable/red_scrubber_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_scrubber_progress_horizontal_holo_light</item>
<item name="android:thumb">#drawable/red_scrubber_control_selector_holo_light</item>
</style>
<style name="RatingBarred" parent="android:Widget.Holo.Light.RatingBar">
<item name="android:progressDrawable">#drawable/red_ratingbar_full_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_ratingbar_full_holo_light</item>
</style>
<style name="RatingBarBigred" parent="android:Widget.Holo.Light.RatingBar.Indicator">
<item name="android:progressDrawable">#drawable/red_ratingbar_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_ratingbar_holo_light</item>
</style>
<style name="RatingBarSmallred" parent="android:Widget.Holo.Light.RatingBar.Small">
<item name="android:progressDrawable">#drawable/red_ratingbar_small_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_ratingbar_small_holo_light</item>
</style>
<style name="Togglered" parent="android:Widget.Holo.Light.Button.Toggle">
<item name="android:background">#drawable/red_btn_toggle_holo_light</item>
</style>
Try to add to your values-v21:
<item name="android:actionBarPopupTheme">#style/Theme.Red.Widget</item>
I'm developing an android app.
I'm using ZXING fragment open source barcode scanning.
I have an option to manually input the barcode. So when the user press the manual input button I open a dialog with edit text. Before the dialog appears I pause the camera and scanning.
This causes the device to hang, the top bar multiples it self adding it self more and more times until it fills the display. The only way to get out of this situation is to restart the device.
This bug only reproduce in Nexus 5
How can I debug this in DDMS?
I'm clueless :P Any ideas?!
This is how the device looks when this happens and you must restart the device:
Here are my Theme and Styles files as asked by #Apoorv
themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="MybusinessTheme"
parent="#style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">#style/MybusinessActionBar</item>
<item name="android:actionMenuTextColor">#color/white</item>
<item name="android:homeAsUpIndicator">#drawable/ic_home_up</item>
<item name="android:actionOverflowButtonStyle">#style/MybusinessButtonOverFlow</item>
<!-- Remove the shadow of the actionbar -->
<item name="android:windowContentOverlay">#null</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">#style/MybusinessActionBar</item>
<item name="actionMenuTextColor">#color/white</item>
<item name="homeAsUpIndicator">#drawable/ic_home_up</item>
<item name="actionOverflowButtonStyle">#style/MybusinessButtonOverFlow</item>
<!-- For app launching -->
<item name="android:windowBackground">#color/wrntr_purple</item>
</style>
<!-- ActionBar styles -->
<style name="MybusinessActionBar"
parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="android:background">#color/wrntr_purple</item>
<item name="android:titleTextStyle">#style/WarrenteerActionBarTitleText</item>
<!-- Support library compatibility -->
<item name="background">#color/wrntr_purple</item>
<item name="titleTextStyle">#style/WarrenteerActionBarTitleText</item>
</style>
<!-- Over flow button style -->
<style name="MybusinessButtonOverFlow"
parent="#style/Widget.AppCompat.Light.ActionButton.Overflow">
<item name="android:src">#drawable/ic_action_overflow</item>
</style>
<!-- ActionBar title text -->
<style name="WarrenteerActionBarTitleText"
parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
</style>
<style name="MybusinessTheme.Wallpaper"
parent="MybusinessTheme">
</style>
</resources>
styles.xml
<resources>
<style name="ActivityBase">
<item name="android:background">#color/white</item>
</style>
<style name="NextButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_alignParentBottom">true</item>
<item name="android:layout_alignParentLeft">true</item>
<item name="android:textSize">#dimen/medium_text</item>
<item name="android:textColor">#drawable/next_button_text_color</item>
<item name="android:gravity">center</item>
<item name="android:layout_marginLeft">20dp</item>
<item name="android:layout_marginBottom">20dp</item>
<item name="android:padding">5dp</item>
<item name="android:background">#drawable/next_button_selector</item>
</style>
<style name="PreviousButton" parent="NextButton">
<item name="android:layout_alignParentLeft">false</item>
<item name="android:layout_alignParentRight">true</item>
<item name="android:layout_marginRight">20dp</item>
</style>
<style name="DescriptionText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_below">#id/welcomeText</item>
<item name="android:textSize">#dimen/medium_text</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
</style>
<style name="NormalButton">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">10dp</item>
<item name="android:layout_margin">10dp</item>
<item name="android:textColor">#color/white</item>
<item name="android:background">#drawable/button_selector</item>
<item name="android:gravity">center</item>
</style>
<style name="NormalBoldButton">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">10dp</item>
<item name="android:layout_margin">10dp</item>
<item name="android:textColor">#color/white</item>
<item name="android:background">#drawable/button_selector</item>
<item name="android:textStyle">bold</item>
<item name="android:gravity">center</item>
</style>
<style name="LightButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">10dp</item>
<item name="android:layout_margin">10dp</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
<item name="android:background">#drawable/light_button_selector</item>
<item name="android:gravity">center</item>
</style>
<style name="TitleText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">#dimen/xx_large_text</item>
</style>
<style name="WizardProgressNumber">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/white</item>
<item name="android:paddingBottom">4dp</item>
<item name="android:paddingTop">7dp</item>
<item name="android:paddingRight">9dp</item>
<item name="android:paddingLeft">9dp</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center</item>
<item name="android:layout_marginLeft">6dp</item>
<item name="android:background">#drawable/white_circle</item>
</style>
<style name="WizardProgressViewDefault">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">5dp</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:layout_marginTop">#dimen/add_other_device_space</item>
<item name="android:layout_marginBottom">#dimen/add_other_device_space</item>
</style>
<style name="NavigationDrawer">
<item name="android:layout_width">240dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_gravity">start</item>
<item name="android:choiceMode">singleChoice</item>
<item name="android:divider">#color/mybiz_light_gray</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:background">#android:color/white</item>
</style>
<style name="HomeMenuItem">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/gray_turquoise_selector</item>
<item name="android:textSize">#dimen/medium_text</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center_vertical</item>
<item name="android:layout_margin">10dp</item>
<item name="android:paddingTop">3dp</item>
<item name="android:drawablePadding">10dp</item>
</style>
<style name="ProductListItem">
<item name="android:layout_alignParentRight">true</item>
<item name="android:layout_marginRight">15dp</item>
</style>
<style name="ObjectSeekBar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">10dp</item>
<item name="android:layout_marginTop">12dp</item>
<item name="android:layout_marginLeft">5dp</item>
<item name="android:layout_marginRight">5dp</item>
<item name="android:padding">0dp</item>
<item name="android:thumb">#null</item>
<item name="android:progressDrawable">#drawable/days_left_progress</item>
</style>
<style name="ObjectBoldSmallText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">#dimen/small_text</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:layout_gravity">right</item>
<item name="android:textStyle">bold</item>
</style>
<style name="ObjectSmallText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">#dimen/small_text</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:layout_gravity">right</item>
</style>
<style name="ObjectMediumText" parent="ProductListItem">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">#dimen/medium_text</item>
<item name="android:textColor">#color/mybiz_purple</item>
<item name="android:layout_gravity">right</item>
</style>
<style name="ObjectMediumLargeText" parent="ProductListItem">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">#dimen/medium_large_text</item>
<item name="android:textColor">#color/mybiz_purple</item>
<item name="android:layout_gravity">right</item>
</style>
<style name="ObjectLargeText" parent="ProductListItem">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">#dimen/large_text</item>
<item name="android:textColor">#color/mybiz_purple</item>
<item name="android:layout_gravity">right</item>
</style>
<style name="HorizontalLineGray">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:layout_marginTop">5dp</item>
<item name="android:background">#color/mybiz_gray</item>
</style>
<style name="HorizontalLineLightGray">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">0.5dp</item>
<item name="android:layout_marginTop">5dp</item>
<item name="android:background">#color/mybiz_light_gray</item>
</style>
<style name="buttonWhiteBorder">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">right</item>
<item name="android:textColor">#drawable/button_text_color_selector_white</item>
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">20dp</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:background">#drawable/button_selector_white_transparent</item>
</style>
<style name="ManualInputButton" parent="buttonWhiteBorder">
<item name="android:layout_marginTop">#dimen/add_other_device_space</item>
<item name="android:layout_alignParentLeft">true</item>
<item name="android:layout_marginLeft">15dp</item>
</style>
<style name="ButtonTurquoiseBorder">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#drawable/button_text_color_selector_turquoise</item>
<item name="android:background">#drawable/button_selector_turquoise_transparent</item>
</style>
<style name="EditBoldTextLabel" parent="ObjectBoldSmallText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">right</item>
<item name="android:layout_marginRight">20dp</item>
<item name="android:layout_marginTop">25dp</item>
</style>
<style name="EditTextLabel" parent="ObjectSmallText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">right</item>
<item name="android:layout_marginRight">20dp</item>
<item name="android:layout_marginTop">25dp</item>
</style>
<style name="EditTextManualInputLabel" parent="EditBoldTextLabel">
<item name="android:textColor">#color/white</item>
</style>
<style name="EditTextNormal">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginRight">20dp</item>
<item name="android:layout_marginLeft">20dp</item>
<item name="android:imeOptions">actionNext</item>
<item name="android:singleLine">true</item>
</style>
<style name="EditTextManualInput" parent="EditTextNormal">
<item name="android:textColorHint">#color/mybiz_light_gray</item>
<item name="android:textColor">#color/white</item>
<item name="android:background">#drawable/edit_text_white_selector</item>
</style>
<style name="LargeTextTitle" parent="ObjectLargeText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
<item name="android:layout_marginTop">25dp</item>
</style>
<style name="MediumTextTitle" parent="ObjectMediumText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#color/mybiz_dark_gray</item>
<item name="android:layout_marginTop">25dp</item>
</style>
</resources>
OK we had the same problem - Nexus 5 only, but with ZBar lib instead of ZXing.
The issue was resolved by switching from a SurfaceView to a TextureView - however this resulted in slower frame rates.
Through testing we found that our issue was caused by leaving the screen, bringing up the keyboard and going back - our solution was setting android:windowSoftInputMode to AdjustPan in the manifest.
Hope this helps!