View可见性状态invisible和有什么区别gone?
我想扩展/折叠我的recyclerView的项目,以显示更多信息.我想实现SlideExpandableListView的相同效果.
基本上在我的viewHolder中我有一个不可见的视图,我想做一个平滑的展开/折叠动画,而不是只将可见性设置为VISIBLE/GONE.我一次只需要一个项目进行扩展,如果有一个高程来显示该项目已被选中,那将会很酷.
它与新Android最近通话记录列表的效果相同.选项"CALL BACK"和"DETAILS"仅在选择项目时可见.

expand android android-layout recycler-adapter android-recyclerview
我设法做了我的cardViewAdapter,但我阻止扩大我的卡.我恢复了这个响应的代码(这里的类名是CardsAnimationHelper:)来做动画,但它是叠加的.
我解决了上面的问题,但如果在我的cardView上我同时显示10个元素的50个列表.如果我扩展第一个,数字11,21,31,41也将扩展.你有诀窍吗?
我反思过,这对我来说毫无意义.就在我的OnClick方法之前,我显示了一个textview,其中文本是位置.但是当我点击id是正确的,这意味着当我点击它时会检测到几张牌上的点击.我想我的OnClickListener中的视图可能有问题
我的CardView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="2dp"
app:cardElevation="2dp">
<!-- Les CardView possèdent des attributs supplémentaires dont
- cardBackgroundColor
- cardElevation pour l'élévation (donc aussi l'ombre)
- cardCornerRadius pour arrondir les angles
-->
<android.support.design.widget.CoordinatorLayout 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">
<!-- Les CardView agissent comme des FrameLayout,
pour avoir une organisation verticale nous devons
donc rajouter un LinearLayout -->
<TextView
android:id="@+id/text_cards" …Run Code Online (Sandbox Code Playgroud)