i'm trying put view in android application has image, 2 text views within linear layout, , image. styled list view 'cell', , let me wonder best way create android standard list item component is. style guide android specific when talking how these components should look, there aren't many development guidelines on reproducing components consistently.
for example, i'm trying recreate cell:
is there standard layout these cells? if not, best way handle cell layout?
currently issue i'm having doing kind of thing:
<linearlayout> <imageview/> <linearlayout> <textview/> <textview/> </linearlayout> <imageview/> </linearlayout>
never shows second image view.
suggestions? either on specific situation or on standard layouts?
update
i got view working. linearlayout
weights suggested. in end work had 2 imageview
s weight of 1, , internal linearlayout
weight of 0.
sorry if long question on beginner topic - leaving more general part of question - standard layout standard components. (maybe candidate stack overflow's new documentation section.)
google didn't go through , make standard layouts many of these material design specs.
here's layout based on spec started:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="88dp"> <imageview android:id="@+id/image_view" android:layout_width="40dp" android:layout_height="40dp" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparenttop="true" android:layout_centervertical="true" android:layout_marginleft="16dp" android:layout_marginstart="16dp" android:layout_margintop="20dp" tools:src="@drawable/ic_error_white_24dp"/> <textview android:id="@+id/text_view1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_alignparenttop="true" android:layout_marginleft="72dp" android:layout_marginstart="72dp" android:layout_marginright="56dp" android:layout_marginend="56dp" android:layout_margintop="16dp" android:maxlines="1" android:textsize="16sp" android:textcolor="?android:attr/textcolorprimary" tools:text="this title line"/> <textview android:id="@+id/text_view2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_below="@+id/text_view1" android:layout_marginleft="72dp" android:layout_marginstart="72dp" android:layout_marginright="56dp" android:layout_marginend="56dp" android:maxlines="1" android:textsize="14sp" android:textcolor="?android:attr/textcolorsecondary" tools:text="this second line"/> <textview android:id="@+id/text_view3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_below="@+id/text_view2" android:layout_marginleft="72dp" android:layout_marginstart="72dp" android:layout_marginright="56dp" android:layout_marginend="56dp" android:maxlines="1" android:textsize="14sp" android:textcolor="?android:attr/textcolorsecondary" tools:text="this third line"/> <imageview android:id="@+id/image_view_2" android:layout_width="24dp" android:layout_height="24dp" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_alignparenttop="true" android:layout_marginright="16dp" android:layout_marginend="16dp" android:layout_margintop="20dp" tools:src="@drawable/ic_error_white_24dp"/> </relativelayout>
note didn't use dimension values , text styles; can go through , do. on right track.
Comments
Post a Comment