Java Code Examples for org.telegram.ui.Cells.DrawerProfileCell

The following examples show how to use org.telegram.ui.Cells.DrawerProfileCell. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            DrawerProfileCell profileCell = (DrawerProfileCell) holder.itemView;
            profileCell.setUser(MessagesController.getInstance(UserConfig.selectedAccount).getUser(UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId()), accountsShown);
            break;
        }
        case 3: {
            DrawerActionCell drawerActionCell = (DrawerActionCell) holder.itemView;
            position -= 2;
            if (accountsShown) {
                position -= getAccountRowsCount();
            }
            items.get(position).bind(drawerActionCell);
            drawerActionCell.setPadding(0, 0, 0, 0);
            break;
        }
        case 4: {
            DrawerUserCell drawerUserCell = (DrawerUserCell) holder.itemView;
            drawerUserCell.setAccount(accountNumbers.get(position - 2));
            break;
        }
    }
}
 
Example 2
Source Project: Telegram   Source File: DrawerLayoutAdapter.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            DrawerProfileCell profileCell = (DrawerProfileCell) holder.itemView;
            profileCell.setUser(MessagesController.getInstance(UserConfig.selectedAccount).getUser(UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId()), accountsShown);
            break;
        }
        case 3: {
            DrawerActionCell drawerActionCell = (DrawerActionCell) holder.itemView;
            position -= 2;
            if (accountsShown) {
                position -= getAccountRowsCount();
            }
            items.get(position).bind(drawerActionCell);
            drawerActionCell.setPadding(0, 0, 0, 0);
            break;
        }
        case 4: {
            DrawerUserCell drawerUserCell = (DrawerUserCell) holder.itemView;
            drawerUserCell.setAccount(accountNumbers.get(position - 2));
            break;
        }
    }
}
 
Example 3
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position)
{
    switch (holder.getItemViewType())
    {
        case 0:
        {
            ((DrawerProfileCell) holder.itemView).setUser(MessagesController.getInstance(UserConfig.selectedAccount).
                    getUser(UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId()), accountsShowed);
            holder.itemView.setBackgroundColor(Theme.getColor(Theme.key_avatar_backgroundActionBarBlue));
            break;
        }
        case 3:
        {
            position -= 2;
            if (accountsShowed)
            {
                position -= getAccountRowsCount();
            }
            DrawerActionCell drawerActionCell = (DrawerActionCell) holder.itemView;
            items.get(position).bind(drawerActionCell);
            drawerActionCell.setPadding(0, 0, 0, 0);
            break;
        }
        case 4:
        {
            DrawerUserCell drawerUserCell = (DrawerUserCell) holder.itemView;
            drawerUserCell.setAccount(accountNumbers.get(position - 2));
            break;
        }
    }
}
 
Example 4
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position)
{
    switch (holder.getItemViewType())
    {
        case 0:
        {
            ((DrawerProfileCell) holder.itemView).setUser(MessagesController.getInstance(UserConfig.selectedAccount).
                    getUser(UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId()), accountsShowed);
            holder.itemView.setBackgroundColor(Theme.getColor(Theme.key_avatar_backgroundActionBarBlue));
            break;
        }
        case 3:
        {
            position -= 2;
            if (accountsShowed)
            {
                position -= getAccountRowsCount();
            }
            DrawerActionCell drawerActionCell = (DrawerActionCell) holder.itemView;
            items.get(position).bind(drawerActionCell);
            drawerActionCell.setPadding(0, 0, 0, 0);
            break;
        }
        case 4:
        {
            DrawerUserCell drawerUserCell = (DrawerUserCell) holder.itemView;
            drawerUserCell.setAccount(accountNumbers.get(position - 2));
            break;
        }
    }
}