Created
November 24, 2015 05:32
-
-
Save amyu/c49265e82876a8c8d2f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v7.widget.CardView | |
android:id="@+id/card_view" | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:card_view="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="4dp" | |
android:layout_marginLeft="8dp" | |
android:layout_marginRight="8dp" | |
android:layout_marginTop="4dp" | |
android:clickable="true" | |
android:focusable="true" | |
android:foreground="?android:attr/selectableItemBackground" | |
card_view:cardCornerRadius="4dp"> | |
<RelativeLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/item_list_thumbnail_image" | |
android:layout_width="match_parent" | |
android:layout_height="160dp" | |
android:layout_toLeftOf="@+id/item_list_action_area" | |
android:layout_toStartOf="@+id/item_list_action_area" | |
android:scaleType="centerCrop" | |
android:src="@drawable/image_url_empty"/> | |
<RelativeLayout | |
android:id="@+id/item_list_media_area" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_below="@+id/item_list_thumbnail_image"> | |
<TextView | |
android:id="@+id/item_list_title_text" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="4dp" | |
android:layout_marginLeft="12dp" | |
android:layout_marginRight="12dp" | |
android:layout_marginTop="8dp" | |
android:lines="1" | |
android:maxLines="1" | |
android:textSize="17sp" | |
android:textStyle="bold" | |
tools:text="title" | |
/> | |
<TextView | |
android:id="@+id/item_list_sitename_text" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_alignParentRight="true" | |
android:layout_below="@id/item_list_title_text" | |
android:layout_marginEnd="8dp" | |
android:layout_marginStart="8dp" | |
android:lines="1" | |
android:maxLines="1" | |
tools:text="sitename" | |
/> | |
<TextView | |
android:id="@+id/item_list_date_text" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_alignParentRight="true" | |
android:layout_below="@+id/item_list_sitename_text" | |
android:layout_marginBottom="4dp" | |
android:layout_marginEnd="8dp" | |
android:layout_marginStart="8dp" | |
android:layout_marginTop="4dp" | |
android:lines="1" | |
android:maxLines="1" | |
android:text="2015-11-10" | |
/> | |
</RelativeLayout> | |
<RelativeLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:padding="6dp" | |
android:layout_alignParentRight="true" | |
android:layout_above="@+id/item_list_media_area" | |
android:layout_alignParentTop="true" | |
android:id="@+id/item_list_action_area"> | |
<ImageButton | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:src="@drawable/ic_menu_favorite" | |
android:background="@drawable/select_default_bg" | |
android:id="@+id/item_list_favorite_btn"/> | |
<ImageButton | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:id="@+id/item_list_read_later_btn" | |
android:src="@drawable/ic_menu_drafts" | |
android:background="@drawable/select_default_bg" | |
android:layout_centerVertical="true"/> | |
<ImageButton | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:id="@+id/item_list_share_btn" | |
android:background="@drawable/select_default_bg" | |
android:src="@android:drawable/ic_menu_share" | |
android:layout_alignParentBottom="true" | |
/> | |
</RelativeLayout> | |
<!--<LinearLayout | |
android:id="@+id/item_list_action_area" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_above="@+id/item_list_media_area" | |
android:layout_alignParentRight="true" | |
android:layout_alignParentTop="true" | |
android:orientation="vertical" | |
android:padding="6dp"> | |
<ImageButton | |
android:id="@+id/item_list_favorite_btn" | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:background="@drawable/select_default_bg" | |
android:src="@drawable/ic_menu_favorite"/> | |
<Space | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_weight="1"/> | |
<ImageButton | |
android:id="@+id/item_list_read_later_btn" | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:background="@drawable/select_default_bg" | |
android:src="@drawable/ic_menu_drafts"/> | |
<Space | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:layout_weight="1"/> | |
<ImageButton | |
android:id="@+id/item_list_share_btn" | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:background="@drawable/select_default_bg" | |
android:src="@android:drawable/ic_menu_share" | |
/> | |
</LinearLayout>--> | |
</RelativeLayout> | |
</android.support.v7.widget.CardView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RelativeLayoutの高さ系のバグに起因する子要素への影響っぽい.
https://code.google.com/p/android/issues/detail?id=59368
にあるように独自クラスにするか,FrameLayoutにして