Java Code Examples for org.telegram.messenger.MediaController#AudioEntry
The following examples show how to use
org.telegram.messenger.MediaController#AudioEntry .
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: AudioCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public void setAudio(MediaController.AudioEntry entry, boolean divider, boolean checked) { audioEntry = entry; titleTextView.setText(audioEntry.title); genreTextView.setText(audioEntry.genre); authorTextView.setText(audioEntry.author); timeTextView.setText(String.format("%d:%02d", audioEntry.duration / 60, audioEntry.duration % 60)); setPlayDrawable(MediaController.getInstance().isPlayingMessage(audioEntry.messageObject) && !MediaController.getInstance().isMessagePaused()); needDivider = divider; setWillNotDraw(!divider); checkBox.setChecked(checked, false); }
Example 4
Source File: AudioCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public void setAudio(MediaController.AudioEntry entry, boolean divider, boolean checked) { audioEntry = entry; titleTextView.setText(audioEntry.title); genreTextView.setText(audioEntry.genre); authorTextView.setText(audioEntry.author); timeTextView.setText(String.format("%d:%02d", audioEntry.duration / 60, audioEntry.duration % 60)); setPlayDrawable(MediaController.getInstance().isPlayingMessage(audioEntry.messageObject) && !MediaController.getInstance().isMessagePaused()); needDivider = divider; setWillNotDraw(!divider); checkBox.setChecked(checked, false); }
Example 5
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 6
Source File: ChatAttachAlertAudioLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private void updateSearchResults(final ArrayList<MediaController.AudioEntry> result, String query, final int searchId) { AndroidUtilities.runOnUIThread(() -> { if (searchId != lastSearchId) { return; } if (searchId != -1 && listView.getAdapter() != searchAdapter) { listView.setAdapter(searchAdapter); } if (listView.getAdapter() == searchAdapter) { emptySubtitleTextView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("NoAudioFoundInfo", R.string.NoAudioFoundInfo, query))); } searchResult = result; notifyDataSetChanged(); }); }
Example 7
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 8
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 9
Source File: ChatAttachAlertAudioLayout.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void updateSearchResults(final ArrayList<MediaController.AudioEntry> result, String query, final int searchId) { AndroidUtilities.runOnUIThread(() -> { if (searchId != lastSearchId) { return; } if (searchId != -1 && listView.getAdapter() != searchAdapter) { listView.setAdapter(searchAdapter); } if (listView.getAdapter() == searchAdapter) { emptySubtitleTextView.setText(AndroidUtilities.replaceTags(LocaleController.formatString("NoAudioFoundInfo", R.string.NoAudioFoundInfo, query))); } searchResult = result; notifyDataSetChanged(); }); }
Example 10
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); } }
Example 11
Source File: AudioSelectActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { MediaController.AudioEntry audioEntry = audioEntries.get(position); ((AudioCell) holder.itemView).setAudio(audioEntries.get(position), position != audioEntries.size() - 1, selectedAudios.indexOfKey(audioEntry.id) >= 0); }
Example 12
Source File: AudioCell.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
public MediaController.AudioEntry getAudioEntry() { return audioEntry; }
Example 13
Source File: AudioSelectActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { MediaController.AudioEntry audioEntry = audioEntries.get(position); ((AudioCell) holder.itemView).setAudio(audioEntries.get(position), position != audioEntries.size() - 1, selectedAudios.indexOfKey(audioEntry.id) >= 0); }
Example 14
Source File: AudioCell.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
public MediaController.AudioEntry getAudioEntry() { return audioEntry; }