Skip to content

Commit

Permalink
Fixed video item layout
Browse files Browse the repository at this point in the history
  • Loading branch information
smedic committed Apr 19, 2017
1 parent d5b581a commit bfc1371
Showing 1 changed file with 74 additions and 69 deletions.
143 changes: 74 additions & 69 deletions app/src/main/res/layout/video_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,83 +9,88 @@
cardview:cardElevation="2dp"
cardview:cardUseCompatPadding="true">

<LinearLayout
android:id="@+id/row_item"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="?android:attr/selectableItemBackground"
android:orientation="horizontal"
android:weightSum="100"
android:paddingBottom="4dp"
android:paddingTop="4dp">
android:layout_height="wrap_content">

<FrameLayout
android:id="@+id/image_frame_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40">
<LinearLayout
android:id="@+id/row_item"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="?android:attr/selectableItemBackground"
android:orientation="horizontal"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:weightSum="100">

<ImageView
android:id="@+id/video_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/image_frame_layout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40">

<TextView
android:id="@+id/video_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="12dp"
android:layout_marginRight="12dp"
android:background="@android:color/black"
android:textColor="@android:color/white"
android:textSize="13sp"
android:textStyle="bold" />
</FrameLayout>
<ImageView
android:id="@+id/video_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60">
<TextView
android:id="@+id/video_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="12dp"
android:layout_marginRight="12dp"
android:background="@android:color/black"
android:textColor="@android:color/white"
android:textSize="13sp"
android:textStyle="bold" />
</FrameLayout>

<TextView
android:id="@+id/video_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="3"
android:textSize="16sp" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60">

<TextView
android:id="@+id/views_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:maxLines="1"
android:textSize="14sp" />
<TextView
android:id="@+id/video_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="3"
android:textSize="16sp" />

<CheckBox
android:id="@+id/favoriteButton"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/favorite_button_selector"
android:button="@null" />
<TextView
android:id="@+id/views_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:maxLines="1"
android:textSize="14sp" />

<ImageView
android:id="@+id/shareButton"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentBottom="true"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@id/favoriteButton"
android:layout_toStartOf="@id/favoriteButton"
android:background="@drawable/share_button_selector" />
<CheckBox
android:id="@+id/favoriteButton"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/favorite_button_selector"
android:button="@null" />

</RelativeLayout>
</LinearLayout>
<ImageView
android:id="@+id/shareButton"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentBottom="true"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@id/favoriteButton"
android:layout_toStartOf="@id/favoriteButton"
android:background="@drawable/share_button_selector" />

</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>

0 comments on commit bfc1371

Please sign in to comment.