現在、CardViews を使用するアプリを開発しようとしていますが、それらを拡張可能にしたいと考えています。つまり、誰かが CardView を押すと、展開して詳細を表示する必要があります。どうすればこれを行うことができますか?
これが私がやろうとしていることの視覚的な説明です。強調表示された CardView を押すと、拡大してより多くの情報を表示し、別のプレスで縮小できるようにします。これを行う方法がわかりません。インターネットを検索しても、まだ答えがありません。
最善の解決策は、Expandable Layout を使用して CardView 内に追加することです。
<com.kyo.expandablelayout.ExpandableLayout
android:id="@+id/expandlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp" >
<ImageView
android:id="@+id/imageview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/parent" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/child"
app:canExpand="true" />
</com.kyo.expandable.ExpandableLayout>