Search in sources :

Example 1 with DrawerActionCell

use of org.telegram.ui.Cells.DrawerActionCell in project Telegram-FOSS by Telegram-FOSS-Team.

the class DrawerLayoutAdapter method onCreateViewHolder.

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    switch(viewType) {
        case 0:
            view = profileCell = new DrawerProfileCell(mContext);
            break;
        case 2:
            view = new DividerCell(mContext);
            break;
        case 3:
            view = new DrawerActionCell(mContext);
            break;
        case 4:
            view = new DrawerUserCell(mContext);
            break;
        case 5:
            view = new DrawerAddCell(mContext);
            break;
        case 1:
        default:
            view = new EmptyCell(mContext, AndroidUtilities.dp(8));
            break;
    }
    view.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    return new RecyclerListView.Holder(view);
}
Also used : DrawerActionCell(org.telegram.ui.Cells.DrawerActionCell) DrawerAddCell(org.telegram.ui.Cells.DrawerAddCell) EmptyCell(org.telegram.ui.Cells.EmptyCell) DrawerUserCell(org.telegram.ui.Cells.DrawerUserCell) RecyclerView(androidx.recyclerview.widget.RecyclerView) DrawerProfileCell(org.telegram.ui.Cells.DrawerProfileCell) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) DividerCell(org.telegram.ui.Cells.DividerCell)

Aggregations

View (android.view.View)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 DividerCell (org.telegram.ui.Cells.DividerCell)1 DrawerActionCell (org.telegram.ui.Cells.DrawerActionCell)1 DrawerAddCell (org.telegram.ui.Cells.DrawerAddCell)1 DrawerProfileCell (org.telegram.ui.Cells.DrawerProfileCell)1 DrawerUserCell (org.telegram.ui.Cells.DrawerUserCell)1 EmptyCell (org.telegram.ui.Cells.EmptyCell)1 RecyclerListView (org.telegram.ui.Components.RecyclerListView)1