Note that there are some explanatory texts on larger screens.

plurals
  1. POmatch_parent and does not fill as expected - Android / XML
    primarykey
    data
    text
    <p>I have a YoutubeThumbnail/ImageView inside a listView which I'd like to have fill/stretch to the edge of the screen:</p> <pre><code> &lt;com.example.project.ui.widget.VideosListView android:id="@+id/videosListView" android:adjustViewBounds="true" android:scaleType="fitXY" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>and </p> <pre><code> &lt;com.example.project.ui.widget.UrlImageView android:id="@+id/userVideoThumbImageView" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:background="@android:color/black" android:scaleType="fitXY" android:clickable="false" android:contentDescription="YouTube video thumbnail" android:focusable="false" android:focusableInTouchMode="false" android:gravity="center" android:src="@drawable/ic_launcher" /&gt; </code></pre> <p>Currently it doesn't seem to do so, and on some devices, the thumbnails look TINY. </p> <h2>Screenshots from HTC Butterfly:</h2> <p><img src="https://i.stack.imgur.com/7ZMaF.png" alt="enter image description here"></p> <h2>Screenshot from Galaxy S2:</h2> <p><img src="https://i.stack.imgur.com/jkREi.png" alt="enter image description here"></p> <p>I'm not sure exactly what I've done wrong - any input is appreciated. </p> <h2>home.xml:</h2> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;LinearLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; &lt;ListView android:id="@+id/left_drawer" android:layout_width="120dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="@color/darkgrey" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:autoLink="web" android:textStyle="bold" /&gt; &lt;RelativeLayout android:id="@+id/rl" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#AAFFFFFF" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;com.example.project.ui.widget.VideosListView android:id="@+id/videosListView" android:adjustViewBounds="true" android:scaleType="fitXY" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="horizontal" &gt; &lt;RelativeLayout android:layout_width="50dip" android:layout_height="50dip" android:layout_alignParentBottom="true" &gt; &lt;ImageButton android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="left" android:background="@color/darkgrey" android:scaleType="centerCrop" android:src="@drawable/home_up_btn" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="50dip" android:layout_alignParentBottom="true" &gt; &lt;android.support.v4.view.ViewPager android:id="@+id/view_pager" android:layout_width="wrap_content" android:layout_height="match_parent" /&gt; &lt;ImageButton android:layout_width="30dip" android:layout_height="30dip" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="15dp" android:focusable="false" android:src="@drawable/scroll_lt_arrow" /&gt; &lt;ImageButton android:layout_width="30dip" android:layout_height="30dip" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="15dp" android:focusable="false" android:src="@drawable/scroll_rt_arrow" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; &lt;/android.support.v4.widget.DrawerLayout&gt; </code></pre> <h2>list_item_user_video.xml:</h2> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;com.example.project.ui.widget.UrlImageView android:id="@+id/userVideoThumbImageView" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:background="@android:color/black" android:scaleType="fitXY" android:clickable="false" android:contentDescription="YouTube video thumbnail" android:focusable="false" android:focusableInTouchMode="false" android:gravity="center" android:src="@drawable/ic_launcher" /&gt; &lt;View android:layout_width="match_parent" android:layout_height="2dp" android:visibility="invisible" /&gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/userVideoTitleTextView" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="5dip" android:text="Video Title Not Found" android:textColor="@android:color/black" android:textSize="20sp" /&gt; &lt;Button android:id="@+id/fav_up_btn1" android:layout_width="27dp" android:layout_height="27dp" android:layout_alignParentRight="true" android:background="@drawable/fav_up_btn1" android:clickable="false" android:focusable="false" android:focusableInTouchMode="false" android:gravity="right" android:paddingRight="5dp" android:paddingTop="5dp" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/userVideouploaderTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="5dip" android:textColor="@color/verylightgrey" android:textSize="16sp" /&gt; &lt;TextView android:id="@+id/userVideoviewsTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/userVideouploaderTextView" android:textColor="@android:color/black" android:textSize="16sp" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <h2>JAVA:</h2> <pre><code>private VideosListView listView; listView = (VideosListView) findViewById(R.id.videosListView); listView.setOnVideoClickListener(this); private void populateListWithVideos(Message msg) { Library lib = (Library) msg.getData().get( GetYouTubeUserVideosTask.LIBRARY); listView.setVideos(lib.getVideos()); } </code></pre> <h2>Edit:</h2> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;com.idg.omv.ui.widget.UrlImageView android:id="@+id/userVideoThumbImageView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:adjustViewBounds="false" android:background="@android:color/black" android:clickable="false" android:contentDescription="YouTube video thumbnail" android:focusable="false" android:focusableInTouchMode="false" android:scaleType="fitXY" android:src="@drawable/ic_launcher" /&gt; &lt;View android:layout_width="match_parent" android:layout_height="2dp" android:visibility="invisible" /&gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/userVideoTitleTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="5dip" android:text="Video Title Not Found" android:textColor="@android:color/black" android:textSize="20sp" /&gt; &lt;Button android:id="@+id/fav_up_btn1" android:layout_width="27dp" android:layout_height="27dp" android:layout_alignParentRight="true" android:background="@drawable/fav_up_btn1" android:clickable="false" android:focusable="false" android:focusableInTouchMode="false" android:gravity="right" android:paddingRight="5dp" android:paddingTop="5dp" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/userVideouploaderTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="5dip" android:textColor="@color/verylightgrey" android:textSize="16sp" /&gt; &lt;TextView android:id="@+id/userVideoviewsTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/userVideouploaderTextView" android:textColor="@android:color/black" android:textSize="16sp" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <h2>Screenshot after Edit:</h2> <p><img src="https://i.stack.imgur.com/9qIzg.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload