Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3692464
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:15:55+00:00 2026-05-19T04:15:55+00:00

I wanted to create a layout like the CyanogenMod call log in that there

  • 0

I wanted to create a layout like the CyanogenMod call log in that there is a list item with a couple of views and a clickable button on the right which gets focus separately (screenshot). Instead, I get this mess.

Here’s my code:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="4dip"
    >

    <DontPressWithParentImageView android:id="@+id/play_icon"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:paddingLeft="14dip"
        android:paddingRight="14dip"
        android:layout_alignParentRight="true"
        android:gravity="center_vertical"
        android:src="@drawable/sym_play"
        android:background="@drawable/play_background"
        />

    <View android:id="@+id/divider"
        android:layout_width="1px"
        android:layout_height="fill_parent"
        android:layout_marginTop="5dip"
        android:layout_marginBottom="5dip"
        android:layout_toLeftOf="@id/play_icon"
        android:layout_marginLeft="2dip"
        android:background="@drawable/divider_vertical_dark"
        />

    <TextView android:id="@+id/file_info"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="8dip"
        android:layout_marginTop="-10dip"
        android:layout_marginLeft="10dip"
        android:layout_alignWithParentIfMissing="true"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textStyle="bold"
        />

    <TextView android:id="@+id/file_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_above="@id/file_info"
        android:layout_alignWithParentIfMissing="true"
        android:layout_marginBottom="-10dip"
        android:layout_marginLeft="4dip"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:gravity="center_vertical"
        />
</RelativeLayout>

For reference, the code I started with is here and here, and the source to DontPressWithParentImageView is here (but as you can see from my screenshot, that part is working).

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:15:56+00:00Added an answer on May 19, 2026 at 4:15 am

    Solved by using two LinearLayouts instead of a RelativeLayout:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="4dip"
        >
    
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            >
    
            <TextView android:id="@+id/file_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="4dip"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:singleLine="true"
                android:ellipsize="marquee"
                android:gravity="center_vertical"
                />
    
            <TextView android:id="@+id/file_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginBottom="6dip"
                android:singleLine="true"
                android:ellipsize="marquee"
                android:textAppearance="?android:attr/textAppearanceSmall"
                />
        </LinearLayout>
    
        <View android:id="@+id/divider"
            android:layout_width="1px"
            android:layout_height="fill_parent"
            android:layout_marginTop="5dip"
            android:layout_marginBottom="5dip"
            android:layout_marginLeft="2dip"
            android:background="@drawable/divider_vertical_dark"
            />
    
        <DontPressWithParentImageView
            android:id="@+id/play_icon"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:paddingLeft="10dip"
            android:paddingRight="10dip"
            android:gravity="center_vertical"
            android:src="@drawable/sym_play"
            android:background="@drawable/play_background"
            />
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a design for a list that looks like (and mostly
I wanted to create my own Python exception class, like this: class MyException(BaseException): def
Is there a good way to create a form in VB6 that can easily
I wanted to create a little macro to simulate for(auto item : container) in
If I wanted to create a commercial web-project (like e.g. facebook) with a Java
I am trying to create a table view which has a layout like what
I wanted to create Custom Dialog like the following image which can be called
I wanted to create this kind of output var s1 = [['Sony',7],['Samsung',5],['LG',8]]; so that
Let's say I woke up today and wanted to create a clone of StackOverflow.com,
When I created the project I'm trying to deploy I selected that I wanted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.