Set Dialog theme to parent Theme in Android - android

I'm creating a custom Holo theme in which I want to customize Dialog look and feel.
What is the attribute for Dialog?
<style name="MyHolo" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="*********">#style/MyDialogStyle</item>
....
</style>
<style name="MyDialogStyle" parent="android:style/Theme.Dialog">
<item name="android:textColor">#223523</item>
...
</style>
and in Manifest:
<activity android:theme="#style/MyHolo">
ps where can I find all the attributes? I dont see a single place for all of them.

Check this out! https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/themes.xml
<style name="Theme.Holo.Light" parent="Theme.Light">
<item name="colorForeground">#android:color/bright_foreground_holo_light</item>
<item name="colorForegroundInverse">#android:color/bright_foreground_inverse_holo_light</item>
<item name="colorBackground">#android:color/background_holo_light</item>
<item name="colorBackgroundCacheHint">#android:drawable/background_cache_hint_selector_holo_light</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
<item name="colorPressedHighlight">#color/holo_blue_light</item>
<item name="colorLongPressedHighlight">#color/holo_blue_bright</item>
<item name="colorFocusedHighlight">#color/holo_blue_dark</item>
<item name="colorMultiSelectHighlight">#color/holo_green_light</item>
<item name="colorActivatedHighlight">#color/holo_blue_dark</item>
<!-- Text styles -->
<item name="textAppearance">#android:style/TextAppearance.Holo.Light</item>
<item name="textAppearanceInverse">#android:style/TextAppearance.Holo.Light.Inverse</item>
<item name="textColorPrimary">#android:color/primary_text_holo_light</item>
<item name="textColorSecondary">#android:color/secondary_text_holo_light</item>
<item name="textColorTertiary">#android:color/tertiary_text_holo_light</item>
<item name="textColorPrimaryInverse">#android:color/primary_text_holo_dark</item>
<item name="textColorSecondaryInverse">#android:color/secondary_text_holo_dark</item>
<item name="textColorTertiaryInverse">#android:color/tertiary_text_holo_dark</item>
<item name="textColorPrimaryDisableOnly">#android:color/primary_text_disable_only_holo_light</item>
<item name="textColorPrimaryInverseDisableOnly">#android:color/primary_text_disable_only_holo_dark</item>
<item name="textColorPrimaryNoDisable">#android:color/primary_text_nodisable_holo_light</item>
<item name="textColorSecondaryNoDisable">#android:color/secondary_text_nodisable_holo_light</item>
<item name="textColorPrimaryInverseNoDisable">#android:color/primary_text_nodisable_holo_dark</item>
<item name="textColorSecondaryInverseNoDisable">#android:color/secondary_text_nodisable_holo_dark</item>
<item name="textColorHint">#android:color/hint_foreground_holo_light</item>
<item name="textColorHintInverse">#android:color/hint_foreground_holo_dark</item>
<item name="textColorSearchUrl">#android:color/search_url_text_holo</item>
<item name="textColorHighlight">#android:color/highlighted_text_holo_light</item>
<item name="textColorHighlightInverse">#android:color/highlighted_text_holo_dark</item>
<item name="textColorLink">#android:color/holo_blue_light</item>
<item name="textColorLinkInverse">#android:color/holo_blue_light</item>
<item name="textColorAlertDialogListItem">#android:color/primary_text_holo_light</item>
<item name="textAppearanceLarge">#android:style/TextAppearance.Holo.Light.Large</item>
<item name="textAppearanceMedium">#android:style/TextAppearance.Holo.Light.Medium</item>
<item name="textAppearanceSmall">#android:style/TextAppearance.Holo.Light.Small</item>
<item name="textAppearanceLargeInverse">#android:style/TextAppearance.Holo.Light.Large.Inverse</item>
<item name="textAppearanceMediumInverse">#android:style/TextAppearance.Holo.Light.Medium.Inverse</item>
<item name="textAppearanceSmallInverse">#android:style/TextAppearance.Holo.Light.Small.Inverse</item>
<item name="textAppearanceSearchResultTitle">#android:style/TextAppearance.Holo.Light.SearchResult.Title</item>
<item name="textAppearanceSearchResultSubtitle">#android:style/TextAppearance.Holo.Light.SearchResult.Subtitle</item>
<item name="textAppearanceButton">#android:style/TextAppearance.Holo.Light.Widget.Button</item>
<item name="editTextColor">?android:attr/textColorPrimary</item>
<item name="editTextBackground">#android:drawable/edit_text_holo_light</item>
<item name="candidatesTextStyleSpans">#android:string/candidates_style</item>
<item name="textCheckMark">#android:drawable/indicator_check_mark_light</item>
<item name="textCheckMarkInverse">#android:drawable/indicator_check_mark_dark</item>
<item name="textAppearanceLargePopupMenu">#android:style/TextAppearance.Holo.Light.Widget.PopupMenu.Large</item>
<item name="textAppearanceSmallPopupMenu">#android:style/TextAppearance.Holo.Light.Widget.PopupMenu.Small</item>
<!-- Button styles -->
<item name="buttonStyle">#android:style/Widget.Holo.Light.Button</item>
<item name="buttonStyleSmall">#android:style/Widget.Holo.Light.Button.Small</item>
<item name="buttonStyleInset">#android:style/Widget.Holo.Light.Button.Inset</item>
<item name="buttonStyleToggle">#android:style/Widget.Holo.Light.Button.Toggle</item>
<item name="switchStyle">#android:style/Widget.Holo.Light.CompoundButton.Switch</item>
<item name="selectableItemBackground">#android:drawable/item_background_holo_light</item>
<item name="borderlessButtonStyle">#android:style/Widget.Holo.Light.Button.Borderless</item>
<item name="homeAsUpIndicator">#android:drawable/ic_ab_back_holo_light</item>
<!-- List attributes -->
<item name="listPreferredItemHeight">64dip</item>
<item name="listPreferredItemHeightSmall">48dip</item>
<item name="listPreferredItemHeightLarge">80dip</item>
<item name="dropdownListPreferredItemHeight">?android:attr/listPreferredItemHeightSmall</item>
<item name="textAppearanceListItemSmall">?android:attr/textAppearanceMedium</item>
<item name="listPreferredItemPaddingLeft">8dip</item>
<item name="listPreferredItemPaddingRight">8dip</item>
<!-- #hide -->
<item name="searchResultListItemHeight">58dip</item>
<item name="listDivider">#drawable/list_divider_holo_light</item>
<item name="listSeparatorTextViewStyle">#android:style/Widget.Holo.Light.TextView.ListSeparator</item>
<item name="listChoiceIndicatorSingle">#android:drawable/btn_radio_holo_light</item>
<item name="listChoiceIndicatorMultiple">#android:drawable/btn_check_holo_light</item>
<item name="listChoiceBackgroundIndicator">#android:drawable/list_selector_holo_light</item>
<item name="activatedBackgroundIndicator">#android:drawable/activated_background_holo_light</item>
<item name="expandableListPreferredItemPaddingLeft">40dip</item>
<item name="expandableListPreferredChildPaddingLeft">?android:attr/expandableListPreferredItemPaddingLeft</item>
<item name="expandableListPreferredItemIndicatorLeft">3dip</item>
<item name="expandableListPreferredItemIndicatorRight">0dip</item>
<item name="expandableListPreferredChildIndicatorLeft">?android:attr/expandableListPreferredItemIndicatorLeft</item>
<item name="expandableListPreferredChildIndicatorRight">?android:attr/expandableListPreferredItemIndicatorRight</item>
<item name="listDividerAlertDialog">#android:drawable/list_divider_holo_light</item>
<!-- Gallery attributes -->
<item name="galleryItemBackground">#android:drawable/gallery_item_background</item>
<!-- Window attributes -->
<item name="windowFrame">#null</item>
<item name="windowNoTitle">false</item>
<item name="windowFullscreen">false</item>
<item name="windowIsFloating">false</item>
<item name="android:windowContentOverlay">#android:drawable/ab_solid_shadow_holo</item>
<item name="windowShowWallpaper">false</item>
<item name="windowTitleStyle">#android:style/WindowTitle.Holo</item>
<item name="windowTitleSize">25dip</item>
<item name="windowTitleBackgroundStyle">#android:style/WindowTitleBackground.Holo</item>
<item name="android:windowAnimationStyle">#android:style/Animation.Holo.Activity</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustUnspecified</item>
<item name="windowActionBar">true</item>
<item name="windowActionModeOverlay">false</item>
<!-- Dialog attributes -->
<item name="alertDialogStyle">#android:style/AlertDialog.Holo.Light</item>
<item name="dialogTheme">#android:style/Theme.Holo.Light.Dialog</item>
<item name="dialogTitleIconsDecorLayout">#layout/dialog_title_icons_holo</item>
<item name="dialogCustomTitleDecorLayout">#layout/dialog_custom_title_holo</item>
<item name="dialogTitleDecorLayout">#layout/dialog_title_holo</item>
<item name="alertDialogCenterButtons">false</item>
<item name="alertDialogTheme">#android:style/Theme.Holo.Light.Dialog.Alert</item>
<item name="alertDialogIcon">#android:drawable/ic_dialog_alert_holo_light</item>
<item name="toastFrameBackground">#android:drawable/toast_frame_holo</item>
<!-- Panel attributes -->
<item name="panelBackground">#android:drawable/menu_hardkey_panel_holo_light</item>
<item name="panelFullBackground">#android:drawable/menu_background_fill_parent_width</item>
<!-- These three attributes do not seems to be used by the framework. Declared public though -->
<item name="panelColorBackground">#000</item>
<item name="panelColorForeground">?android:attr/textColorPrimary</item>
<item name="panelTextAppearance">?android:attr/textAppearance</item>
<item name="panelMenuIsCompact">true</item>
<item name="panelMenuListWidth">250dip</item>
<item name="panelMenuListTheme">#android:style/Theme.Holo.Light.CompactMenu</item>
<!-- Scrollbar attributes -->
<item name="scrollbarFadeDuration">250</item>
<item name="scrollbarDefaultDelayBeforeFade">300</item>
<item name="scrollbarSize">10dip</item>
<item name="scrollbarThumbHorizontal">#android:drawable/scrollbar_handle_holo_light</item>
<item name="scrollbarThumbVertical">#android:drawable/scrollbar_handle_holo_light</item>
<item name="scrollbarTrackHorizontal">#null</item>
<item name="scrollbarTrackVertical">#null</item>
<!-- Text selection handle attributes -->
<item name="textSelectHandleLeft">#android:drawable/text_select_handle_left</item>
<item name="textSelectHandleRight">#android:drawable/text_select_handle_right</item>
<item name="textSelectHandle">#android:drawable/text_select_handle_middle</item>
<item name="textSelectHandleWindowStyle">#android:style/Widget.Holo.TextSelectHandle</item>
<item name="textSuggestionsWindowStyle">#android:style/Widget.Holo.Light.TextSuggestionsPopupWindow</item>
<item name="textCursorDrawable">#android:drawable/text_cursor_holo_light</item>
<!-- Widget styles -->
<item name="absListViewStyle">#android:style/Widget.Holo.Light.AbsListView</item>
<item name="autoCompleteTextViewStyle">#android:style/Widget.Holo.Light.AutoCompleteTextView</item>
<item name="checkboxStyle">#android:style/Widget.Holo.Light.CompoundButton.CheckBox</item>
<item name="dropDownListViewStyle">#android:style/Widget.Holo.ListView.DropDown</item>
<item name="editTextStyle">#android:style/Widget.Holo.Light.EditText</item>
<item name="expandableListViewStyle">#android:style/Widget.Holo.Light.ExpandableListView</item>
<item name="expandableListViewWhiteStyle">#android:style/Widget.Holo.Light.ExpandableListView.White</item>
<item name="galleryStyle">#android:style/Widget.Holo.Light.Gallery</item>
<item name="gestureOverlayViewStyle">#android:style/Widget.Holo.Light.GestureOverlayView</item>
<item name="gridViewStyle">#android:style/Widget.Holo.Light.GridView</item>
<item name="imageButtonStyle">#android:style/Widget.Holo.Light.ImageButton</item>
<item name="imageWellStyle">#android:style/Widget.Holo.Light.ImageWell</item>
<item name="listViewStyle">#android:style/Widget.Holo.Light.ListView</item>
<item name="listViewWhiteStyle">#android:style/Widget.Holo.Light.ListView.White</item>
<item name="popupWindowStyle">#android:style/Widget.Holo.Light.PopupWindow</item>
<item name="progressBarStyle">#android:style/Widget.Holo.Light.ProgressBar</item>
<item name="progressBarStyleHorizontal">#android:style/Widget.Holo.Light.ProgressBar.Horizontal</item>
<item name="progressBarStyleSmall">#android:style/Widget.Holo.Light.ProgressBar.Small</item>
<item name="progressBarStyleSmallTitle">#android:style/Widget.Holo.Light.ProgressBar.Small.Title</item>
<item name="progressBarStyleLarge">#android:style/Widget.Holo.Light.ProgressBar.Large</item>
<item name="progressBarStyleInverse">#android:style/Widget.Holo.Light.ProgressBar.Inverse</item>
<item name="progressBarStyleSmallInverse">#android:style/Widget.Holo.Light.ProgressBar.Small.Inverse</item>
<item name="progressBarStyleLargeInverse">#android:style/Widget.Holo.Light.ProgressBar.Large.Inverse</item>
<item name="seekBarStyle">#android:style/Widget.Holo.Light.SeekBar</item>
<item name="ratingBarStyle">#android:style/Widget.Holo.Light.RatingBar</item>
<item name="ratingBarStyleIndicator">#android:style/Widget.Holo.Light.RatingBar.Indicator</item>
<item name="ratingBarStyleSmall">#android:style/Widget.Holo.Light.RatingBar.Small</item>
<item name="radioButtonStyle">#android:style/Widget.Holo.Light.CompoundButton.RadioButton</item>
<item name="scrollViewStyle">#android:style/Widget.Holo.Light.ScrollView</item>
<item name="horizontalScrollViewStyle">#android:style/Widget.Holo.Light.HorizontalScrollView</item>
<item name="spinnerStyle">?android:attr/dropDownSpinnerStyle</item>
<item name="dropDownSpinnerStyle">#android:style/Widget.Holo.Light.Spinner.DropDown</item>
<item name="starStyle">#android:style/Widget.Holo.Light.CompoundButton.Star</item>
<item name="tabWidgetStyle">#android:style/Widget.Holo.Light.TabWidget</item>
<item name="textViewStyle">#android:style/Widget.Holo.Light.TextView</item>
<item name="errorMessageBackground">#android:drawable/popup_inline_error_holo_light</item>
<item name="errorMessageAboveBackground">#android:drawable/popup_inline_error_above_holo_light</item>
<item name="webTextViewStyle">#android:style/Widget.Holo.Light.WebTextView</item>
<item name="webViewStyle">#android:style/Widget.Holo.Light.WebView</item>
<item name="dropDownItemStyle">#android:style/Widget.Holo.Light.DropDownItem</item>
<item name="spinnerDropDownItemStyle">#android:style/Widget.Holo.Light.DropDownItem.Spinner</item>
<item name="spinnerItemStyle">#android:style/Widget.Holo.TextView.SpinnerItem</item>
<item name="dropDownHintAppearance">#android:style/TextAppearance.Holo.Widget.DropDownHint</item>
<item name="keyboardViewStyle">#android:style/Widget.Holo.KeyboardView</item>
<item name="quickContactBadgeStyleWindowSmall">#android:style/Widget.Holo.QuickContactBadge.WindowSmall</item>
<item name="quickContactBadgeStyleWindowMedium">#android:style/Widget.Holo.QuickContactBadge.WindowMedium</item>
<item name="quickContactBadgeStyleWindowLarge">#android:style/Widget.Holo.QuickContactBadge.WindowLarge</item>
<item name="quickContactBadgeStyleSmallWindowSmall">#android:style/Widget.Holo.QuickContactBadgeSmall.WindowSmall</item>
<item name="quickContactBadgeStyleSmallWindowMedium">#android:style/Widget.Holo.QuickContactBadgeSmall.WindowMedium</item>
<item name="quickContactBadgeStyleSmallWindowLarge">#android:style/Widget.Holo.QuickContactBadgeSmall.WindowLarge</item>
<item name="listPopupWindowStyle">#android:style/Widget.Holo.Light.ListPopupWindow</item>
<item name="popupMenuStyle">#android:style/Widget.Holo.Light.PopupMenu</item>
<item name="stackViewStyle">#android:style/Widget.Holo.StackView</item>
<item name="activityChooserViewStyle">#android:style/Widget.Holo.Light.ActivityChooserView</item>
<!-- Preference styles -->
<item name="preferenceScreenStyle">#android:style/Preference.Holo.PreferenceScreen</item>
<item name="preferenceFragmentStyle">#style/PreferenceFragment.Holo</item>
<item name="preferenceCategoryStyle">#android:style/Preference.Holo.Category</item>
<item name="preferenceStyle">#android:style/Preference.Holo</item>
<item name="preferenceInformationStyle">#android:style/Preference.Holo.Information</item>
<item name="checkBoxPreferenceStyle">#android:style/Preference.Holo.CheckBoxPreference</item>
<item name="switchPreferenceStyle">#android:style/Preference.Holo.SwitchPreference</item>
<item name="yesNoPreferenceStyle">#android:style/Preference.Holo.DialogPreference.YesNoPreference</item>
<item name="dialogPreferenceStyle">#android:style/Preference.Holo.DialogPreference</item>
<item name="editTextPreferenceStyle">#android:style/Preference.Holo.DialogPreference.EditTextPreference</item>
<item name="ringtonePreferenceStyle">#android:style/Preference.Holo.RingtonePreference</item>
<item name="preferenceLayoutChild">#android:layout/preference_child_holo</item>
<item name="detailsElementBackground">#android:drawable/panel_bg_holo_light</item>
<!-- Search widget styles -->
<item name="searchWidgetCorpusItemBackground">#android:color/search_widget_corpus_item_background</item>
<!-- Action bar styles -->
<item name="actionDropDownStyle">#android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar</item>
<item name="actionButtonStyle">#android:style/Widget.Holo.Light.ActionButton</item>
<item name="actionOverflowButtonStyle">#android:style/Widget.Holo.Light.ActionButton.Overflow</item>
<item name="actionModeBackground">#android:drawable/cab_background_top_holo_light</item>
<item name="actionModeSplitBackground">#android:drawable/cab_background_bottom_holo_light</item>
<item name="actionModeCloseDrawable">#android:drawable/ic_cab_done_holo_light</item>
<item name="actionBarTabStyle">#style/Widget.Holo.Light.ActionBar.TabView</item>
<item name="actionBarTabBarStyle">#style/Widget.Holo.Light.ActionBar.TabBar</item>
<item name="actionBarTabTextStyle">#style/Widget.Holo.Light.ActionBar.TabText</item>
<item name="actionModeStyle">#style/Widget.Holo.Light.ActionMode</item>
<item name="actionModeCloseButtonStyle">#style/Widget.Holo.Light.ActionButton.CloseMode</item>
<item name="android:actionBarStyle">#android:style/Widget.Holo.Light.ActionBar.Solid</item>
<item name="actionBarSize">#dimen/action_bar_default_height</item>
<item name="actionModePopupWindowStyle">#android:style/Widget.Holo.Light.PopupWindow.ActionMode</item>
<item name="actionBarWidgetTheme">#null</item>
<item name="actionModeCutDrawable">#android:drawable/ic_menu_cut_holo_light</item>
<item name="actionModeCopyDrawable">#android:drawable/ic_menu_copy_holo_light</item>
<item name="actionModePasteDrawable">#android:drawable/ic_menu_paste_holo_light</item>
<item name="actionModeSelectAllDrawable">#android:drawable/ic_menu_selectall_holo_light</item>
<item name="actionModeShareDrawable">#android:drawable/ic_menu_share_holo_light</item>
<item name="actionModeFindDrawable">#android:drawable/ic_menu_find_holo_light</item>
<item name="actionModeWebSearchDrawable">#android:drawable/ic_menu_search_holo_light</item>
<item name="dividerVertical">?android:attr/listDivider</item>
<item name="dividerHorizontal">?android:attr/listDivider</item>
<item name="buttonBarStyle">#android:style/Holo.Light.ButtonBar</item>
<item name="buttonBarButtonStyle">?android:attr/borderlessButtonStyle</item>
<item name="segmentedButtonStyle">#android:style/Holo.Light.SegmentedButton</item>
<!-- SearchView attributes -->
<item name="searchDropdownBackground">#android:drawable/search_dropdown_light</item>
<item name="searchDialogTheme">#style/Theme.Holo.Light.SearchBar</item>
<!-- NumberPicker attributes and styles-->
<item name="numberPickerUpButtonStyle">#style/Widget.Holo.Light.ImageButton.NumberPickerUpButton</item>
<item name="numberPickerDownButtonStyle">#style/Widget.Holo.Light.ImageButton.NumberPickerDownButton</item>
<item name="numberPickerInputTextStyle">#style/Widget.Holo.Light.EditText.NumberPickerInputText</item>
<item name="numberPickerStyle">#style/Widget.Holo.Light.NumberPicker</item>
<!-- CalendarView style-->
<item name="calendarViewStyle">#style/Widget.Holo.Light.CalendarView</item>
<!-- TimePicker style -->
<item name="timePickerStyle">#style/Widget.Holo.Light.TimePicker</item>
<!-- DatePicker style -->
<item name="datePickerStyle">#style/Widget.Holo.Light.DatePicker</item>
<item name="fastScrollThumbDrawable">#android:drawable/fastscroll_thumb_holo</item>
<item name="fastScrollPreviewBackgroundLeft">#android:drawable/fastscroll_label_left_holo_light</item>
<item name="fastScrollPreviewBackgroundRight">#android:drawable/fastscroll_label_right_holo_light</item>
<item name="fastScrollTrackDrawable">#android:drawable/fastscroll_track_holo_light</item>
<item name="fastScrollOverlayPosition">atThumb</item>
</style>

Related

Overriding Style XML for Component

im using Material IO and i want to Change the Text-Color of my Menu.
<resources>
...
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
...
<item name="android:textColorPrimary">#color/colorText</item>
</style>
...
<resources>
Does exactly that. But it changes every Text Color. But i just want to Change the Color of my Menu-Text.
So i tried to change only that:
<style name="ActionBarTheme" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textColor">#color/colorMenuText</item> //android.view
<item name="android:textColorPrimary">#color/colorMenuText</item>
<item name="android:actionMenuTextAppearance">#color/colorWhite</item>
<item name="android:background">#color/colorAccent</item>
<item name="popupTheme">#style/ActionBarPopupTheme</item>
<!-- backward compatibility -->
<item name="background">#color/colorAccent</item>
</style>
by writing some Thing like This.
I can change the Menu-Background this way, but i cant change the Menu-Text-Color this way. I tried everything i found on Stackoverflow but i couldnt fix this issue.
Whole Styles.xml
<resources>
<style name="ActionBarTheme" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textColor">#color/colorMenuText</item> //android.view
<item name="android:textColorPrimary">#color/colorMenuText</item>
<item name="android:actionMenuTextAppearance">#color/colorWhite</item>
<item name="android:background">#color/colorAccent</item>
<item name="popupTheme">#style/ActionBarPopupTheme</item>
<!-- backward compatibility -->
<item name="background">#color/colorAccent</item>
</style>
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:colorAccent">#0000FF</item>
</style>
<style name="ActionBarPopupTheme">
<item name="android:textColor">#color/colorMenuText</item>
<item name="android:background">#color/colorMenuBackground</item>
</style>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- MENU -->
<item name="android:actionBarStyle">#style/ActionBarTheme</item>
<item name="actionBarStyle">#style/ActionBarTheme</item>
<!-- DIALOG -->
<item name="md_color_title">#color/colorPrimary</item>
<item name="md_color_content">#color/colorPrimaryDark</item>
<item name="md_color_button_text">#color/colorAccent</item>
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorTest2</item>
<item name="colorPrimaryDark">#color/colorTest3</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:actionMenuTextColor">#color/colorMenuText</item>
<item name="android:textColor">#color/colorWhite</item>
<item name="color">#color/colorTest4</item>
<item name="colorSecondary">#FF0000</item>
<item name="android:colorBackground">#color/colorBackground</item>
<item name="colorError">#color/colorError</item>
<item name="colorPrimaryVariant">#color/colorAccent</item>
<item name="colorSecondaryVariant">#color/colorTest</item>
<item name="colorSurface">#313131</item>
<item name="colorOnPrimary">#00BCD4</item>
<item name="colorOnSecondary">#00BCD4</item>
<item name="colorOnBackground">#673AB7</item>
<item name="colorOnError">#2196F3</item>
<item name="colorOnSurface">#color/colorOnAccent</item> <!-- placeholder farbe -->
<item name="scrimBackground">#E607FF</item>
<item name="android:editTextColor">#color/colorText</item>
<item name="android:textColorPrimary">#color/colorText</item>
<item name="android:textColorSecondary">#color/colorText</item>
<item name="android:textColorTertiary">#color/colorText</item>
<item name="android:textColorPrimaryInverse">#color/colorText</item>
<item name="android:textColorSecondaryInverse">#color/colorText</item>
<item name="android:textColorTertiaryInverse">#color/colorText</item>
</style>
<style name="MyTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyTheme.ActionBarStyle</item>
</style>
<style name="MyTheme.ActionBarStyle" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="MyTheme.ActionBar.TitleTextStyle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/colorMenuText</item>
</style>
<style name="Theme.MyApp" parent="Theme.AppCompat">
<!-- DIALOG -->
<item name="md_color_title">#color/colorPrimary</item>
<item name="md_color_content">#color/colorPrimaryDark</item>
<item name="md_color_button_text">#color/colorAccent</item>
<!-- Original AppCompat attributes. -->
<item name="colorPrimary">#color/colorTest4</item>
<item name="colorSecondary">#color/colorTest5</item>
<item name="android:colorBackground">#color/colorBackground</item>
<item name="colorError">#color/colorError</item>
<!-- New MaterialComponents attributes. -->
<item name="colorPrimaryVariant">#color/colorAccent</item>
<item name="colorSecondaryVariant">#color/colorTest</item>
<item name="colorSurface">#313131</item>
<item name="colorOnPrimary">#9C27B0</item>
<item name="colorOnSecondary">#00BCD4</item>
<item name="colorOnBackground">#673AB7</item>
<item name="colorOnError">#2196F3</item>
<item name="colorOnSurface">#E91E63</item>
<item name="scrimBackground">#FFC107</item>
<item name="textAppearanceHeadline1">#style/TextAppearance.MaterialComponents.Headline1</item>
<item name="textAppearanceHeadline2">#style/TextAppearance.MaterialComponents.Headline2</item>
<item name="textAppearanceHeadline3">#style/TextAppearance.MaterialComponents.Headline3</item>
<item name="textAppearanceHeadline4">#style/TextAppearance.MaterialComponents.Headline4</item>
<item name="textAppearanceHeadline5">#style/TextAppearance.MaterialComponents.Headline5</item>
<item name="textAppearanceHeadline6">#style/TextAppearance.MaterialComponents.Headline6</item>
<item name="textAppearanceSubtitle1">#style/TextAppearance.MaterialComponents.Subtitle1</item>
<item name="textAppearanceSubtitle2">#style/TextAppearance.MaterialComponents.Subtitle2</item>
<item name="textAppearanceBody1">#style/TextAppearance.MaterialComponents.Body1</item>
<item name="textAppearanceBody2">#style/TextAppearance.MaterialComponents.Body2</item>
<item name="textAppearanceCaption">#style/TextAppearance.MaterialComponents.Caption</item>
<item name="textAppearanceButton">#style/TextAppearance.MaterialComponents.Button</item>
<item name="textAppearanceOverline">#style/TextAppearance.MaterialComponents.Overline</item>
</style>
</resources>
I tried this minimum sample of your code and it gives me the desired behavior
I think there is a conflict with your styles
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="actionBarTheme">#style/ActionBarTheme</item>
</style>
<style name="ActionBarTheme" parent="#style/ThemeOverlay.MaterialComponents.ActionBar">
<item name="android:textColorPrimary">#ffffff</item>//for title text color
<item name="colorPrimary">#D81B60</item>// for toolbar background
<item name="popupTheme">#style/ActionBarPopupTheme</item>
</style>
<style name="ActionBarPopupTheme">
<item name="android:textColor">#304FFE</item> // for option menu text color
</style>

Incorrect dialog style on old android versions

I have so style for alert dialogs:
<style name="Theme.Paper" parent="Theme.AppCompat.Light.NoActionBar">
<!-- customize the color palette -->
<item name="colorPrimary">#color/primary</item>
<item name="colorPrimaryDark">#color/primary_dark</item>
<item name="colorAccent">#color/accent</item>
<item name="android:alertDialogStyle">#style/Theme.Paper.AlertDialogStyle</item>
<item name="android:alertDialogTheme">#style/Theme.Paper.AlertDialog</item>
</style>
<style name="Theme.Paper.Toolbar" parent="Theme.Paper">
<item name="android:textColorPrimary">#color/white</item>
<item name="android:textColorSecondary">#color/white</item>
</style>
<style name="Theme.Paper.AlertDialogStyle" parent="android:Theme.Black">
<item name="android:fullDark">#color/white</item>
<item name="android:topDark">#color/white</item>
<item name="android:centerDark">#color/white</item>
<item name="android:bottomDark">#color/white</item>
<item name="android:fullBright">#color/white</item>
<item name="android:centerBright">#color/white</item>
<item name="android:bottomBright">#color/white</item>
<item name="android:bottomMedium">#color/white</item>
<item name="android:centerMedium">#color/white</item>
</style>
<style name="Theme.Paper.AlertDialog.Title">
<item name="android:maxLines">2</item>
<item name="android:scrollHorizontally">true</item>
</style>
<style name="Theme.Paper.AlertDialog.TextAppearanceMedium">
<!-- Set text size and color of message here -->
<item name="android:textSize">16sp</item>
<item name="android:textColor">#color/black_54</item>
</style>
<style name="Theme.Paper.AlertDialog.TextAppearanceLarge">
<!-- Set text size and color of title -->
<item name="android:textSize">20sp</item>
<item name="android:textColor">#color/black_87</item>
</style>
<style name="Theme.Paper.AlertDialog" parent="android:Theme.Black">
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowTitleStyle">#style/Theme.Paper.AlertDialog.Title</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowMinWidthMajor">#android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">#android:dimen/dialog_min_width_minor</item>
<item name="android:windowIsFloating">true</item>
<item name="android:textAppearanceMedium">#style/Theme.Paper.AlertDialog.TextAppearanceMedium</item>
<item name="android:textAppearanceLarge">#style/Theme.Paper.AlertDialog.TextAppearanceLarge</item>
<item name="android:buttonBarStyle">#style/Theme.Paper.AlertDialog.ButtonBar</item>
<item name="android:buttonBarButtonStyle">#style/Theme.Paper.FlatButton</item>
</style>
<style name="Theme.Paper.FlatButton">
<!-- Set background drawable and text size of the buttons here -->
<item name="android:background">#drawable/bg_dialog_button</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">#color/primary</item>
<item name="android:layout_height">36dp</item>
<item name="android:maxHeight">36dp</item>
<item name="android:minHeight">36dp</item>
<item name="android:minWidth">64dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
<item name="android:layout_marginLeft">4dp</item>
<item name="android:layout_marginRight">4dp</item>
</style>
<style name="Theme.Paper.AlertDialog.ButtonBar">
<!-- Define a background for the button bar and a divider between the buttons here -->
<item name="android:divider">#android:color/transparent</item>
<item name="android:dividerPadding">0dp</item>
<item name="android:showDividers">none</item>
<item name="android:background">#color/white</item>
<item name="android:layout_height">48dp</item>
<item name="android:gravity">center_vertical|right</item>
</style>
It looks normal on Android 4.x, but on Android 2.x devices I get just white dialog window with buttons (all text is white with default sizes)
How I can fix it?
P.S. Please, help me! I cannot publish my app because of this only...

styling actionBar in android studio 1.0

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();

How to change actionbar menu item text color in Android 5.0

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>

DDMS Debugging: Android app (I'm developing) causes device (ONLY Nexus 5) to hang and must restart when using ZXING and Dialog

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!

Categories

Resources