Java Code Examples for org.telegram.ui.Cells.TextCheckCell#setChecked()

The following examples show how to use org.telegram.ui.Cells.TextCheckCell#setChecked() . 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: ProxyListActivity.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder)
{
    int viewType = holder.getItemViewType();
    if (viewType == 3)
    {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        int position = holder.getAdapterPosition();
        if (position == useProxyRow)
        {
            checkCell.setChecked(useProxySettings);
        }
        else if (position == callsRow)
        {
            checkCell.setChecked(useProxyForCalls);
        }
    }
}
 
Example 2
Source File: ProxyListActivity.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder)
{
    int viewType = holder.getItemViewType();
    if (viewType == 3)
    {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        int position = holder.getAdapterPosition();
        if (position == useProxyRow)
        {
            checkCell.setChecked(useProxySettings);
        }
        else if (position == callsRow)
        {
            checkCell.setChecked(useProxyForCalls);
        }
    }
}
 
Example 3
Source File: DataSettingsActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    int viewType = holder.getItemViewType();
    if (viewType == 3) {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        int position = holder.getAdapterPosition();
        if (position == enableCacheStreamRow) {
            checkCell.setChecked(SharedConfig.saveStreamMedia);
        } else if (position == enableStreamRow) {
            checkCell.setChecked(SharedConfig.streamMedia);
        } else if (position == enableAllStreamRow) {
            checkCell.setChecked(SharedConfig.streamAllVideo);
        } else if (position == enableMkvRow) {
            checkCell.setChecked(SharedConfig.streamMkv);
        } else if (position == autoplayGifsRow) {
            checkCell.setChecked(SharedConfig.autoplayGifs);
        } else if (position == autoplayVideoRow) {
            checkCell.setChecked(SharedConfig.autoplayVideo);
        }
    }
}
 
Example 4
Source File: DataSettingsActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    int viewType = holder.getItemViewType();
    if (viewType == 3) {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        int position = holder.getAdapterPosition();
        if (position == enableCacheStreamRow) {
            checkCell.setChecked(SharedConfig.saveStreamMedia);
        } else if (position == enableStreamRow) {
            checkCell.setChecked(SharedConfig.streamMedia);
        } else if (position == enableAllStreamRow) {
            checkCell.setChecked(SharedConfig.streamAllVideo);
        } else if (position == enableMkvRow) {
            checkCell.setChecked(SharedConfig.streamMkv);
        } else if (position == autoplayGifsRow) {
            checkCell.setChecked(SharedConfig.autoplayGifs);
        } else if (position == autoplayVideoRow) {
            checkCell.setChecked(SharedConfig.autoplayVideo);
        }
    }
}
 
Example 5
Source File: ProxyListActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position, @NonNull List payloads) {
    if (holder.getItemViewType() == 3 && payloads.contains(PAYLOAD_CHECKED_CHANGED)) {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        if (position == useProxyRow) {
            checkCell.setChecked(useProxySettings);
        } else if (position == callsRow) {
            checkCell.setChecked(useProxyForCalls);
        }
    } else {
        super.onBindViewHolder(holder, position, payloads);
    }
}
 
Example 6
Source File: ProxyListActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    int viewType = holder.getItemViewType();
    if (viewType == 3) {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        int position = holder.getAdapterPosition();
        if (position == useProxyRow) {
            checkCell.setChecked(useProxySettings);
        } else if (position == callsRow) {
            checkCell.setChecked(useProxyForCalls);
        }
    }
}
 
Example 7
Source File: ProxyListActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position, @NonNull List payloads) {
    if (holder.getItemViewType() == 3 && payloads.contains(PAYLOAD_CHECKED_CHANGED)) {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        if (position == useProxyRow) {
            checkCell.setChecked(useProxySettings);
        } else if (position == callsRow) {
            checkCell.setChecked(useProxyForCalls);
        }
    } else {
        super.onBindViewHolder(holder, position, payloads);
    }
}
 
Example 8
Source File: ProxyListActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) {
    int viewType = holder.getItemViewType();
    if (viewType == 3) {
        TextCheckCell checkCell = (TextCheckCell) holder.itemView;
        int position = holder.getAdapterPosition();
        if (position == useProxyRow) {
            checkCell.setChecked(useProxySettings);
        } else if (position == callsRow) {
            checkCell.setChecked(useProxyForCalls);
        }
    }
}