简体   繁体   中英

Show a sub item on the recycler view after click on an item in the recycler view

I'm working in a android application i want to show a sub item's in the recycler view witch it included in the navigation drawer after a click in one of the item's

here's a part of my code who handle the click event` class AdapterViewHolder extends RecyclerView.ViewHolder { ImageView row_icon; TextView row_text;

    public AdapterViewHolder(View itemView) {
        super(itemView);

        row_icon = (ImageView) itemView.findViewById(R.id.row_icon);
        row_text = (TextView) itemView.findViewById(R.id.row_text);

        row_text.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
    }
}`

通过单击项目,只需在该项目下面添加新项目并通知适配器,您将获得新项目(您可以自定义该项目以使其看起来像子项目)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM