Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我可以在recyclerview项目中使用cardflip效果吗?_Android_Android Recyclerview_Flip - Fatal编程技术网

Android 我可以在recyclerview项目中使用cardflip效果吗?

Android 我可以在recyclerview项目中使用cardflip效果吗?,android,android-recyclerview,flip,Android,Android Recyclerview,Flip,我想在recyclerview的每个项目中使用卡片翻转效果() 我有三种观点 项目名称: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/container" android:layout_width="match_parent" androi

我想在recyclerview的每个项目中使用卡片翻转效果()

我有三种观点

项目名称:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
而视窗持有人是:

public ViewHolder(View v, AdaptadorCancionesActual mAdapter) {
        super(v);
        this.mAdapter = mAdapter;
        frameLayout = (RelativeLayout) v.findViewById(R.id.container);
        txtCancion = (TextView) frameLayout.findViewById(R.id.txtTitulo);
        txtArtista = (TextView) frameLayout.findViewById(R.id.txtArtista);
        txtAlbum = (TextView) frameLayout.findViewById(R.id.txtAlbum);
        txtFin = (TextView) frameLayout.findViewById(R.id.txtDuracion);
        imgReproduciendo = (ImageView) frameLayout.findViewById(R.id.imgReproduciendo);
        v.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int position = getLayoutPosition();
        Datos.getMusicSrv().setSong(position);
        Datos.getMusicSrv().playSong();
        mAdapter.flipCard();
        //mAdapter.notifyDataSetChanged();
    }
我有两个问题。。。 首先,我可以在recyclerView项中使用此效果? 如果是的话。。。为什么文本视图为空

@Override
public AdaptadorCancionesActual.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_cancion, parent, false);
    actividad.getFragmentManager().beginTransaction().add(R.id.container, new CardFrontFragment()).commit();
    ViewHolder vh = new ViewHolder(v, this);
    return vh;
}
public ViewHolder(View v, AdaptadorCancionesActual mAdapter) {
        super(v);
        this.mAdapter = mAdapter;
        frameLayout = (RelativeLayout) v.findViewById(R.id.container);
        txtCancion = (TextView) frameLayout.findViewById(R.id.txtTitulo);
        txtArtista = (TextView) frameLayout.findViewById(R.id.txtArtista);
        txtAlbum = (TextView) frameLayout.findViewById(R.id.txtAlbum);
        txtFin = (TextView) frameLayout.findViewById(R.id.txtDuracion);
        imgReproduciendo = (ImageView) frameLayout.findViewById(R.id.imgReproduciendo);
        v.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int position = getLayoutPosition();
        Datos.getMusicSrv().setSong(position);
        Datos.getMusicSrv().playSong();
        mAdapter.flipCard();
        //mAdapter.notifyDataSetChanged();
    }