org.telegram.ui.Cells.DrawerProfileCell Java Examples

The following examples show how to use org.telegram.ui.Cells.DrawerProfileCell. 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
Source File: DrawerLayoutAdapter.java    From Telegram-FOSS with 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 #2
Source File: DrawerLayoutAdapter.java    From Telegram with 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
Source File: DrawerLayoutAdapter.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@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
Source File: DrawerLayoutAdapter.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@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;
        }
    }
}