0
基本上我有像一门功课的提醒应用程序如何把火力地堡RecyclerView另一RecyclerView内
用户可以插入的对象列表,并在每个学科的家庭作业
列表我知道它最糟糕的实践中,我不能把recyclerview内另一个
,但我需要在我的应用程序对象不能算作+其他事情
我插入它火力数据库successfuly这样
是subject_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/simple_round"
android:padding="10dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Subject: "/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="2dp"
android:weightSum="6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Teacher:"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recyclerview_illness_item_list">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
,这是homework_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/simple_round"
android:padding="10dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:padding="2dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="title:"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="description:"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="deadline:"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
和只有一个recyclerview我那样做
adapter = new FirebaseRecyclerAdapter<Test, TestViewHolder>(Test.class, R.layout.test_main_body_item, TestViewHolder.class, reference.child("subjects/98794656")) {
@Override
protected void populateViewHolder(TestViewHolder viewHolder, Test model, int position) {
viewHolder.title.setText(model.getTitle());
viewHolder.description.setText(model.getDescription());
}
};
那么我该如何做一个回收者视图内幕另一个recyclerview?
感谢
它不是这样,是的,我引用了一个不存在的错误节点。问题是我有2个列表,其中1个用于主题,另一个用于每个主题的家庭作品,我可以创建主题列表,当任何人被点击时,其作业将被列出,我目前正在使用下面的添加视图来解决它点击一个。 –
好的。我将在桌面上回来 –