Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] RecyclerView com CardView - item da lista não esta clicavel

Olá Everton tudo bem?

Tenha cuidado em não ficar duplicando threads pois essa duvida é a mesma que a do post anterior.

Basicamente vc cria o onClick da sua View no seu adapter e ainda pode criar um Listener pra parada ficar mais interessante.

Espero que esse link lhe ajude.

Boa sorte. 


2015-03-06 19:25 GMT-03:00 Everton Machado <evertonrm89@gmail.com>:
Boa Noite, criei uma lista com Recyclerview e cardview, a lista cria normalmente mas não esta clicavel, alguem sabe a configuração para habilitar?? no ViewHolder só coloquei um Toast no onClick, segue o codigo dos layout

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    android:id="@+id/card_view"
    android:layout_margin="4dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    card_view:cardCornerRadius="4dp">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="8dp">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="0dp"
            android:layout_weight="0.9"
            android:layout_height="wrap_content"
            android:layout_marginLeft="3dp">

            <TextView
                android:id="@+id/cliente_lista_item_nome"
                android:textSize="20sp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:maxLength="30"
                android:text="Nome"/>

            <TextView
                android:id="@+id/cliente_lista_item_contato"
                android:textSize="15sp"
                android:textStyle="italic"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Telefone"/>

        </LinearLayout>

        <CheckBox
            android:layout_width="0dp"
            android:layout_weight="0.1"
            android:layout_height="wrap_content"
            android:id="@+id/checkBox"
            android:button="@drawable/favoritefile"
            android:layout_gravity="center"
            android:layout_marginLeft="5dp"
            android:focusable="false"
            android:focusableInTouchMode="false"/>

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


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/cliente_lista_recycler"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

</RelativeLayout>

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rudson Lima ( live-O ) Desenvolvedor Android
Contato +55 85 87050560 - Fortaleza-ce
Social facebook | google+ | linkedin

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário