List picking entire android page

Asked

Viewed 26 times

0

People of mine listview is coming out, I need her to take only parts, I’m terrible at layout android and the expectation is totally different from the reality kkkk

I need you to stay like this:

inserir a descrição da imagem aqui

And this way:

inserir a descrição da imagem aqui

If you can fix the list a only part of the screen would help. Then it is difficult to do the layout of the card.

The XML of activity is like this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#F9F9F9" >

<include
    android:id="@+id/toolbar_actionbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    layout="@layout/toolbar_default" />

<RelativeLayout
    android:id="@+id/lytContato"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/toolbar_actionbar"
    android:padding="7dp" >

    <ImageView
        android:id="@+id/imgLogoRestaurante"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_marginTop="29dp"
        android:src="@drawable/ic_cart_lyt"
        android:layout_centerHorizontal="true" />

    <TextView
        android:id="@+id/nmRestaurante"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:text="Nome da Empresa"
        android:textAlignment="center"
        android:textColor="@color/apptheme_color"
        android:textSize="25sp"
        android:layout_below="@+id/imgLogoRestaurante"
        android:layout_centerHorizontal="true" />

    <RatingBar
        android:id="@+id/ratingBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:progressBackgroundTint="@color/background"
        android:progressTint="@color/primary_color"
        android:stepSize="0.5"
        android:layout_below="@+id/nmRestaurante"
        android:layout_centerHorizontal="true"
        android:isIndicator="true" />
</RelativeLayout>
<LinearLayout
    android:id="@+id/lytComentarios"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:orientation="vertical" >
<ListView
    android:id="@+id/lisComentarios"
    style="@style/listViewStyle"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
</LinearLayout>

<LinearLayout
    android:id="@+id/lytEmptyComentarios"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imgChapeu"
        android:layout_width="150dp"
        android:layout_gravity="center"
        android:layout_height="150dp"
        android:src="@drawable/ic_fab_star" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:text="Não existem comentarios para esta empresa."
        android:textColor="#999999"
        android:textAlignment="gravity"/>
</LinearLayout>
</RelativeLayout>

And here’s my card item XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="20dp"
    android:paddingLeft="16dp">

<TextView
    android:textColor="@color/primary_text"
    android:id="@+id/nmCliente"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp"
    android:paddingRight="16dp"
    android:textSize="16sp" />

<RatingBar
    android:id="@+id/ratingBar"
    style="?android:attr/ratingBarStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="25dp"
    android:layout_alignLeft="@+id/nmCliente"
    android:layout_below="@+id/observacaoAvaliacao"
    android:max="5"
    android:numStars="5"
    android:progressBackgroundTint="#A79896"
    android:progressTint="@color/accent_color"
    android:stepSize="0.5" />


<TextView
    android:textColor="@color/ampm_text_color"
    android:id="@+id/observacaoAvaliacao"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp"
    android:paddingRight="16dp"
    android:textSize="16sp" />

  • add to listview android:layout_below="@+id/toolbar_actionbar" and see how it looks

  • That’s it solved, now I need the layout of the card, I’m not getting at all

  • You want the list to be below the card?

  • I don’t want cards from the same list as the first picture.

  • The location of the text, stars and name, and the border

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.