список не пустой -> список пустой -> список не пустойпропал.
@Dao
abstract class ItemDao {
@Transaction
public void replaceItems(List<Item> items) {
clearTable();
insert(items);
}
@Insert
protected abstract void insert(List<Item> items);
@Query("DELETE FROM Item")
protected abstract void clearTable();
}
Single<Long> createTag(String tag) {
// creating tag, returning long id
}
Single<List<Long>> createTags(List<String> tags) {
return Observable.fromIterable(tags)
.flatMap(this::createTag)
.toList();
}
Completable attachTagsToUser(List<String> tags, User user) {
return createTags(tags)
.flatMapCompletable(tagIds -> /* do what you want, here the ids */);
}
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/images"
android:layout_width="wrap_content"
android:layout_height="360dp"
>
</android.support.v7.widget.RecyclerView>
</Relativelayout>
RelativeLayout.LayoutParams lp =
new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 500);
recyclerView.setLayoutParams(lp);