Java Code Examples for org.telegram.ui.Cells.SharedAudioCell#setChecked()
The following examples show how to use
org.telegram.ui.Cells.SharedAudioCell#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: ChatAttachAlertAudioLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private void onItemClick(View view) { if (!(view instanceof SharedAudioCell)) { return; } SharedAudioCell audioCell = (SharedAudioCell) view; MediaController.AudioEntry audioEntry = (MediaController.AudioEntry) audioCell.getTag(); boolean add; if (selectedAudios.indexOfKey(audioEntry.id) >= 0) { selectedAudios.remove(audioEntry.id); audioCell.setChecked(false, true); add = false; } else { if (maxSelectedFiles >= 0 && selectedAudios.size() >= maxSelectedFiles) { showErrorBox(LocaleController.formatString("PassportUploadMaxReached", R.string.PassportUploadMaxReached, LocaleController.formatPluralString("Files", maxSelectedFiles))); return; } selectedAudios.put(audioEntry.id, audioEntry); audioCell.setChecked(true, true); add = true; } parentAlert.updateCountButton(add ? 1 : 2); }
Example 2
Source File: ChatAttachAlertAudioLayout.java From Telegram with GNU General Public License v2.0 | 6 votes |
private void onItemClick(View view) { if (!(view instanceof SharedAudioCell)) { return; } SharedAudioCell audioCell = (SharedAudioCell) view; MediaController.AudioEntry audioEntry = (MediaController.AudioEntry) audioCell.getTag(); boolean add; if (selectedAudios.indexOfKey(audioEntry.id) >= 0) { selectedAudios.remove(audioEntry.id); audioCell.setChecked(false, true); add = false; } else { if (maxSelectedFiles >= 0 && selectedAudios.size() >= maxSelectedFiles) { showErrorBox(LocaleController.formatString("PassportUploadMaxReached", R.string.PassportUploadMaxReached, LocaleController.formatPluralString("Files", maxSelectedFiles))); return; } selectedAudios.put(audioEntry.id, audioEntry); audioCell.setChecked(true, true); add = true; } parentAlert.updateCountButton(add ? 1 : 2); }
Example 3
Source File: ChatAttachAlertAudioLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder.getItemViewType() == 0) { position--; MediaController.AudioEntry audioEntry = audioEntries.get(position); SharedAudioCell audioCell = (SharedAudioCell) holder.itemView; audioCell.setTag(audioEntry); audioCell.setMessageObject(audioEntry.messageObject, position != audioEntries.size() - 1); audioCell.setChecked(selectedAudios.indexOfKey(audioEntry.id) >= 0, false); } }
Example 4
Source File: ChatAttachAlertAudioLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder.getItemViewType() == 0) { position--; MediaController.AudioEntry audioEntry = searchResult.get(position); SharedAudioCell audioCell = (SharedAudioCell) holder.itemView; audioCell.setTag(audioEntry); audioCell.setMessageObject(audioEntry.messageObject, position != searchResult.size() - 1); audioCell.setChecked(selectedAudios.indexOfKey(audioEntry.id) >= 0, false); } }
Example 5
Source File: ChatAttachAlertAudioLayout.java From Telegram with GNU General Public License v2.0 | 5 votes |
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder.getItemViewType() == 0) { position--; MediaController.AudioEntry audioEntry = audioEntries.get(position); SharedAudioCell audioCell = (SharedAudioCell) holder.itemView; audioCell.setTag(audioEntry); audioCell.setMessageObject(audioEntry.messageObject, position != audioEntries.size() - 1); audioCell.setChecked(selectedAudios.indexOfKey(audioEntry.id) >= 0, false); } }
Example 6
Source File: ChatAttachAlertAudioLayout.java From Telegram with GNU General Public License v2.0 | 5 votes |
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder.getItemViewType() == 0) { position--; MediaController.AudioEntry audioEntry = searchResult.get(position); SharedAudioCell audioCell = (SharedAudioCell) holder.itemView; audioCell.setTag(audioEntry); audioCell.setMessageObject(audioEntry.messageObject, position != searchResult.size() - 1); audioCell.setChecked(selectedAudios.indexOfKey(audioEntry.id) >= 0, false); } }