Align an icon with the Toolbar icon - Android Material Design -



Align an icon with the Toolbar icon - Android Material Design -

in new material design (using appcompat), trying align action icons drawer icon of new toolbar. like:

i think looking in metrics correctly...

touch target size

the problem can't align it, because after left padding of 16px, icons should start, icon has "padding" (icon material github), like:

maybe silly not know missing. how can take business relationship padding within image align it? have same problem aligning radio buttons or checkbox action bar icon.

i tried piece of code:

<relativelayout android:id="@+id/image_button" android:layout_width="72dp" android:layout_height="wrap_content"> <imageview android:layout_width="32dp" android:layout_height="48dp" android:layout_marginleft="16dp" android:layout_marginstart="16dp" android:src="@drawable/ic_label_grey600_48dp" /> </relativelayout>

but not align me (like in first screenshot posted). here looks align:

and looks likes taking in business relationship more 72px , 16px of padding.

update

ok, allow me show guys more examples , code. imaging list item has radio button label text.

<radiobutton style="?android:textappearancemedium" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_marginleft="16dp" android:paddingleft="32dp" android:singleline="true"/>

result:

i don't see rule set marginleft , paddingleft right values without using custom button radio button (and knowing dimensions of button) ... <-- bad alternative because color button taken fro accentcolor (new stuff of material).

it looks new gmail app facing alignment issues (see when select mail, 1 not aligned anymore mail service title):

the problem can't align it, because after left padding of 16px, icons should start, icon has "padding" (icon material github)

yes, icon must have padding , varies depending on screen resolution icon displayed. padding different screen density: mdpi        4px * 1.0 = 4px hdpi         4px * 1.5 = 6px xhdpi       4px * 2.0 = 8px xxhdpi     4px * 3.0 = 12px xxxhdpi   4px * 4.0 = 16px padding included in icon drawable , shouldn't remove it.

http://www.google.com/design/spec/style/icons.html#icons-system-icons

android android-layout android-actionbar material-design android-icons

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -