Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TabLayout style cannot resolve @dimen/tab_max_width after moving to Android Design Support v23

After moving to Android Design Support v23.0.0, Android Studio is failing to build a project that was building fine with Android Design Support v22.2.1:

No resource found that matches the given name (at 'tabMaxWidth' with value '@dimen/tab_max_width').

What's going on?

like image 214
straya Avatar asked Aug 20 '15 04:08

straya


1 Answers

In a nutshell: you probably just need to prepend 'design_' to such values.

Glad you asked, handsome. v23.0.0 has changed a bunch of values, here's the old ones from v22.2.1:

<color name="error_color">#FFDD2C00</color>
<color name="fab_stroke_end_inner_color">#0A000000</color>
<color name="fab_stroke_end_outer_color">#0F000000</color>
<color name="fab_stroke_top_inner_color">#1AFFFFFF</color>
<color name="fab_stroke_top_outer_color">#2EFFFFFF</color>
<color name="shadow_end_color">@android:color/transparent</color>
<color name="shadow_mid_color">#14000000</color>
<color name="shadow_start_color">#44000000</color>
<color name="snackbar_background_color">#323232</color>
<dimen name="appbar_elevation">4dp</dimen>
<dimen name="fab_border_width">0.5dp</dimen>
<dimen name="fab_content_size">24dp</dimen>
<dimen name="fab_elevation">8dp</dimen>
<dimen name="fab_size_mini">40dp</dimen>
<dimen name="fab_size_normal">56dp</dimen>
<dimen name="fab_translation_z_pressed">6dp</dimen>
<dimen name="navigation_elevation">12dp</dimen>
<dimen name="navigation_icon_padding">32dp</dimen>
<dimen name="navigation_icon_size">24dp</dimen>
<dimen name="navigation_max_width">320dp</dimen>
<dimen name="navigation_padding_bottom">8dp</dimen>
<dimen name="navigation_padding_top_default">0dp</dimen>
<dimen name="navigation_separator_vertical_padding">8dp</dimen>
<dimen name="snackbar_action_inline_max_width">128dp</dimen>
<dimen name="snackbar_background_corner_radius">0dp</dimen>
<dimen name="snackbar_elevation">2dp</dimen>
<dimen name="snackbar_extra_spacing_horizontal">0dp</dimen>
<dimen name="snackbar_max_width">-1px</dimen>
<dimen name="snackbar_min_width">-1px</dimen>
<dimen name="snackbar_padding_horizontal">12dp</dimen>
<dimen name="snackbar_padding_vertical">14dp</dimen>
<dimen name="snackbar_padding_vertical_2lines">24dp</dimen>
<dimen name="snackbar_text_size">14sp</dimen>
<dimen name="tab_max_width">264dp</dimen>
<dimen name="tab_min_width">72dp</dimen>
<integer name="snackbar_text_max_lines">2</integer>

and now the new ones from v23.0.0:

<color name="design_fab_shadow_end_color">@android:color/transparent</color>
<color name="design_fab_shadow_mid_color">#14000000</color>
<color name="design_fab_shadow_start_color">#44000000</color>
<color name="design_fab_stroke_end_inner_color">#0A000000</color>
<color name="design_fab_stroke_end_outer_color">#0F000000</color>
<color name="design_fab_stroke_top_inner_color">#1AFFFFFF</color>
<color name="design_fab_stroke_top_outer_color">#2EFFFFFF</color>
<color name="design_snackbar_background_color">#323232</color>
<color name="design_textinput_error_color">#FFDD2C00</color>
<dimen name="design_appbar_elevation">4dp</dimen>
<dimen name="design_fab_border_width">0.5dp</dimen>
<dimen name="design_fab_content_size">24dp</dimen>
<dimen name="design_fab_elevation">6dp</dimen>
<dimen name="design_fab_size_mini">40dp</dimen>
<dimen name="design_fab_size_normal">56dp</dimen>
<dimen name="design_fab_translation_z_pressed">6dp</dimen>
<dimen name="design_navigation_elevation">16dp</dimen>
<dimen name="design_navigation_icon_padding">32dp</dimen>
<dimen name="design_navigation_icon_size">24dp</dimen>
<dimen name="design_navigation_max_width">320dp</dimen>
<dimen name="design_navigation_padding_bottom">8dp</dimen>
<dimen name="design_navigation_padding_top_default">0dp</dimen>
<dimen name="design_navigation_separator_vertical_padding">8dp</dimen>
<dimen name="design_snackbar_action_inline_max_width">128dp</dimen>
<dimen name="design_snackbar_background_corner_radius">0dp</dimen>
<dimen name="design_snackbar_elevation">6dp</dimen>
<dimen name="design_snackbar_extra_spacing_horizontal">0dp</dimen>
<dimen name="design_snackbar_max_width">-1px</dimen>
<dimen name="design_snackbar_min_width">-1px</dimen>
<dimen name="design_snackbar_padding_horizontal">12dp</dimen>
<dimen name="design_snackbar_padding_vertical">14dp</dimen>
<dimen name="design_snackbar_padding_vertical_2lines">24dp</dimen>
<dimen name="design_snackbar_text_size">14sp</dimen>
<dimen name="design_tab_max_width">264dp</dimen>
<dimen name="design_tab_min_width">72dp</dimen>
<integer name="design_snackbar_text_max_lines">2</integer>
like image 181
straya Avatar answered Nov 04 '22 02:11

straya