Java Code Examples for org.telegram.ui.ActionBar.Theme#createCircleDrawableWithIcon()
The following examples show how to use
org.telegram.ui.ActionBar.Theme#createCircleDrawableWithIcon() .
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: SharedDocumentCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public void setTextAndValueAndTypeAndThumb(String text, String value, String type, String thumb, int resId) { nameTextView.setText(text); dateTextView.setText(value); if (type != null) { extTextView.setVisibility(VISIBLE); extTextView.setText(type); } else { extTextView.setVisibility(INVISIBLE); } if (resId == 0) { placeholderImageView.setImageResource(getThumbForNameOrMime(text, type)); placeholderImageView.setVisibility(VISIBLE); } else { placeholderImageView.setVisibility(INVISIBLE); } if (thumb != null || resId != 0) { if (thumb != null) { thumbImageView.setImage(thumb, "40_40", null); } else { Drawable drawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(40), resId); Theme.setCombinedDrawableColor(drawable, Theme.getColor(Theme.key_files_folderIconBackground), false); Theme.setCombinedDrawableColor(drawable, Theme.getColor(Theme.key_files_folderIcon), true); thumbImageView.setImageDrawable(drawable); } thumbImageView.setVisibility(VISIBLE); } else { thumbImageView.setImageBitmap(null); thumbImageView.setVisibility(INVISIBLE); } }
Example 2
Source File: RadialProgress.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public void setCheckBackground(boolean withRound, boolean animated) { if (checkDrawable == null) { checkDrawable = new CheckDrawable(); checkBackgroundDrawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(48), checkDrawable, 0); } Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhoto), false); Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhotoIcon), true); if (currentDrawable != checkBackgroundDrawable) { setBackground(checkBackgroundDrawable, withRound, animated); checkDrawable.resetProgress(animated); } }
Example 3
Source File: SharedDocumentCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public void setTextAndValueAndTypeAndThumb(String text, String value, String type, String thumb, int resId) { nameTextView.setText(text); dateTextView.setText(value); if (type != null) { extTextView.setVisibility(VISIBLE); extTextView.setText(type); } else { extTextView.setVisibility(INVISIBLE); } if (resId == 0) { placeholderImageView.setImageResource(getThumbForNameOrMime(text, type)); placeholderImageView.setVisibility(VISIBLE); } else { placeholderImageView.setVisibility(INVISIBLE); } if (thumb != null || resId != 0) { if (thumb != null) { thumbImageView.setImage(thumb, "40_40", null); } else { Drawable drawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(40), resId); Theme.setCombinedDrawableColor(drawable, Theme.getColor(Theme.key_files_folderIconBackground), false); Theme.setCombinedDrawableColor(drawable, Theme.getColor(Theme.key_files_folderIcon), true); thumbImageView.setImageDrawable(drawable); } thumbImageView.setVisibility(VISIBLE); } else { thumbImageView.setImageBitmap(null); thumbImageView.setVisibility(INVISIBLE); } }
Example 4
Source File: RadialProgress.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public void setCheckBackground(boolean withRound, boolean animated) { if (checkDrawable == null) { checkDrawable = new CheckDrawable(); checkBackgroundDrawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(48), checkDrawable, 0); } Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhoto), false); Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhotoIcon), true); if (currentDrawable != checkBackgroundDrawable) { setBackground(checkBackgroundDrawable, withRound, animated); checkDrawable.resetProgress(animated); } }
Example 5
Source File: RadialProgress.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public void setCheckBackground(boolean withRound, boolean animated) { if (checkDrawable == null) { checkDrawable = new CheckDrawable(); checkBackgroundDrawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(48), checkDrawable, 0); } Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhoto), false); Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhotoIcon), true); if (currentDrawable != checkBackgroundDrawable) { setBackground(checkBackgroundDrawable, withRound, animated); checkDrawable.resetProgress(animated); } }
Example 6
Source File: RadialProgress.java From Telegram with GNU General Public License v2.0 | 5 votes |
public void setCheckBackground(boolean withRound, boolean animated) { if (checkDrawable == null) { checkDrawable = new CheckDrawable(); checkBackgroundDrawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(48), checkDrawable, 0); } Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhoto), false); Theme.setCombinedDrawableColor(checkBackgroundDrawable, Theme.getColor(Theme.key_chat_mediaLoaderPhotoIcon), true); if (currentDrawable != checkBackgroundDrawable) { setBackground(checkBackgroundDrawable, withRound, animated); checkDrawable.resetProgress(animated); } }
Example 7
Source File: SharedDocumentCell.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
public void setTextAndValueAndTypeAndThumb(String text, String value, String type, String thumb, int resId, boolean divider) { nameTextView.setText(text); dateTextView.setText(value); if (type != null) { extTextView.setVisibility(VISIBLE); extTextView.setText(type.toLowerCase()); } else { extTextView.setVisibility(INVISIBLE); } needDivider = divider; if (resId == 0) { placeholderImageView.setImageResource(AndroidUtilities.getThumbForNameOrMime(text, type, false)); placeholderImageView.setVisibility(VISIBLE); } else { placeholderImageView.setVisibility(INVISIBLE); } if (thumb != null || resId != 0) { if (thumb != null) { thumbImageView.setImage(thumb, "42_42", null); } else { Drawable drawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(42), resId); String iconKey; String backKey; if (resId == R.drawable.files_storage) { backKey = Theme.key_chat_attachLocationBackground; iconKey = Theme.key_chat_attachLocationIcon; } else if (resId == R.drawable.files_gallery) { backKey = Theme.key_chat_attachContactBackground; iconKey = Theme.key_chat_attachContactIcon; } else if (resId == R.drawable.files_music) { backKey = Theme.key_chat_attachAudioBackground; iconKey = Theme.key_chat_attachAudioIcon; } else if (resId == R.drawable.files_internal) { backKey = Theme.key_chat_attachGalleryBackground; iconKey = Theme.key_chat_attachGalleryIcon; } else { backKey = Theme.key_files_folderIconBackground; iconKey = Theme.key_files_folderIcon; } Theme.setCombinedDrawableColor(drawable, Theme.getColor(backKey), false); Theme.setCombinedDrawableColor(drawable, Theme.getColor(iconKey), true); thumbImageView.setImageDrawable(drawable); } thumbImageView.setVisibility(VISIBLE); } else { extTextView.setAlpha(1.0f); placeholderImageView.setAlpha(1.0f); thumbImageView.setImageBitmap(null); thumbImageView.setVisibility(INVISIBLE); } setWillNotDraw(!needDivider); }
Example 8
Source File: SharedDocumentCell.java From Telegram with GNU General Public License v2.0 | 4 votes |
public void setTextAndValueAndTypeAndThumb(String text, String value, String type, String thumb, int resId, boolean divider) { nameTextView.setText(text); dateTextView.setText(value); if (type != null) { extTextView.setVisibility(VISIBLE); extTextView.setText(type.toLowerCase()); } else { extTextView.setVisibility(INVISIBLE); } needDivider = divider; if (resId == 0) { placeholderImageView.setImageResource(AndroidUtilities.getThumbForNameOrMime(text, type, false)); placeholderImageView.setVisibility(VISIBLE); } else { placeholderImageView.setVisibility(INVISIBLE); } if (thumb != null || resId != 0) { if (thumb != null) { thumbImageView.setImage(thumb, "42_42", null); } else { Drawable drawable = Theme.createCircleDrawableWithIcon(AndroidUtilities.dp(42), resId); String iconKey; String backKey; if (resId == R.drawable.files_storage) { backKey = Theme.key_chat_attachLocationBackground; iconKey = Theme.key_chat_attachLocationIcon; } else if (resId == R.drawable.files_gallery) { backKey = Theme.key_chat_attachContactBackground; iconKey = Theme.key_chat_attachContactIcon; } else if (resId == R.drawable.files_music) { backKey = Theme.key_chat_attachAudioBackground; iconKey = Theme.key_chat_attachAudioIcon; } else if (resId == R.drawable.files_internal) { backKey = Theme.key_chat_attachGalleryBackground; iconKey = Theme.key_chat_attachGalleryIcon; } else { backKey = Theme.key_files_folderIconBackground; iconKey = Theme.key_files_folderIcon; } Theme.setCombinedDrawableColor(drawable, Theme.getColor(backKey), false); Theme.setCombinedDrawableColor(drawable, Theme.getColor(iconKey), true); thumbImageView.setImageDrawable(drawable); } thumbImageView.setVisibility(VISIBLE); } else { extTextView.setAlpha(1.0f); placeholderImageView.setAlpha(1.0f); thumbImageView.setImageBitmap(null); thumbImageView.setVisibility(INVISIBLE); } setWillNotDraw(!needDivider); }