Search in sources :

Example 1 with GroupCreateSectionCell

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

the class GroupCreateDividerItemDecoration method onDraw.

@Override
public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
    int width = parent.getWidth();
    int top;
    int childCount = parent.getChildCount() - (single ? 0 : 1);
    for (int i = 0; i < childCount; i++) {
        View child = parent.getChildAt(i);
        View nextChild = i < childCount - 1 ? parent.getChildAt(i + 1) : null;
        int position = parent.getChildAdapterPosition(child);
        if (position < skipRows || child instanceof GroupCreateSectionCell || nextChild instanceof GroupCreateSectionCell) {
            continue;
        }
        top = child.getBottom();
        canvas.drawLine(LocaleController.isRTL ? 0 : AndroidUtilities.dp(72), top, width - (LocaleController.isRTL ? AndroidUtilities.dp(72) : 0), top, Theme.dividerPaint);
    }
}
Also used : GroupCreateSectionCell(org.telegram.ui.Cells.GroupCreateSectionCell) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Aggregations

View (android.view.View)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 GroupCreateSectionCell (org.telegram.ui.Cells.GroupCreateSectionCell)1