Coloquei a classe ViewHolder como uma classe interna do Adapter e funcionou, agora o porque disso eu não sei!!
Em sexta-feira, 6 de março de 2015 19:25:19 UTC-3, Everton Machado escreveu:
-- Em sexta-feira, 6 de março de 2015 19:25:19 UTC-3, Everton Machado escreveu:
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 xmlns:android="http://schemas.android.com/apk/res/android "xmlns:card_view="http://schemas.android.com/apk/res- "auto 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"> <LinearLayoutandroid:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="8dp"><LinearLayoutandroid:orientation="vertical"android:layout_width="0dp"android:layout_weight="0.9"android:layout_height="wrap_content" android:layout_marginLeft="3dp"> <TextViewandroid: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"/><TextViewandroid: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><CheckBoxandroid: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"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android "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.






0 comentários:
Postar um comentário