org.telegram.ui.Components.RadialProgressView Java Examples
The following examples show how to use
org.telegram.ui.Components.RadialProgressView.
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: LocationLoadingCell.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
public LocationLoadingCell(Context context) { super(context); progressBar = new RadialProgressView(context); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); imageView = new ImageView(context); imageView.setImageResource(R.drawable.location_empty); imageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogEmptyImage), PorterDuff.Mode.MULTIPLY)); addView(imageView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 0, 0, 0, 24)); textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_dialogEmptyText)); textView.setGravity(Gravity.CENTER); textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 17); textView.setText(LocaleController.getString("NoPlacesFound", R.string.NoPlacesFound)); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 0, 34, 0, 0)); }
Example #2
Source File: LocationLoadingCell.java From Telegram with GNU General Public License v2.0 | 6 votes |
public LocationLoadingCell(Context context) { super(context); progressBar = new RadialProgressView(context); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); imageView = new ImageView(context); imageView.setImageResource(R.drawable.location_empty); imageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogEmptyImage), PorterDuff.Mode.MULTIPLY)); addView(imageView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 0, 0, 0, 24)); textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_dialogEmptyText)); textView.setGravity(Gravity.CENTER); textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 17); textView.setText(LocaleController.getString("NoPlacesFound", R.string.NoPlacesFound)); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 0, 34, 0, 0)); }
Example #3
Source File: ChatLoadingCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public ChatLoadingCell(Context context) { super(context); frameLayout = new FrameLayout(context); frameLayout.setBackgroundResource(R.drawable.system_loader); frameLayout.getBackground().setColorFilter(Theme.colorFilter); addView(frameLayout, LayoutHelper.createFrame(36, 36, Gravity.CENTER)); progressBar = new RadialProgressView(context); progressBar.setSize(AndroidUtilities.dp(28)); progressBar.setProgressColor(Theme.getColor(Theme.key_chat_serviceText)); frameLayout.addView(progressBar, LayoutHelper.createFrame(32, 32, Gravity.CENTER)); }
Example #4
Source File: CancelAccountDeletionActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
public PhoneView(Context context) { super(context); setOrientation(VERTICAL); FrameLayout frameLayout = new FrameLayout(context); addView(frameLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 200)); progressBar = new RadialProgressView(context); frameLayout.addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #5
Source File: PeopleNearbyActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
public HeaderCellProgress(Context context) { super(context); setClipChildren(false); progressView = new RadialProgressView(context); progressView.setSize(AndroidUtilities.dp(14)); progressView.setStrokeWidth(2); progressView.setAlpha(0.0f); progressView.setProgressColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueHeader)); addView(progressView, LayoutHelper.createFrame(50, 40, Gravity.TOP | (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT), LocaleController.isRTL ? 2 : 0, 3, LocaleController.isRTL ? 0 : 2, 0)); }
Example #6
Source File: LegendSignatureView.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public LegendSignatureView(Context context) { super(context); setPadding(AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8)); content = new LinearLayout(getContext()); content.setOrientation(LinearLayout.VERTICAL); time = new TextView(context); time.setTextSize(14); time.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); hourTime = new TextView(context); hourTime.setTextSize(14); hourTime.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); chevron = new ImageView(context); chevron.setImageResource(R.drawable.ic_chevron_right_black_18dp); progressView = new RadialProgressView(context); progressView.setSize(AndroidUtilities.dp(12)); progressView.setStrokeWidth(AndroidUtilities.dp(0.5f)); progressView.setVisibility(View.GONE); addView(content, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.NO_GRAVITY, 0, 22, 0, 0)); addView(time, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, 4, 0, 4, 0)); addView(hourTime, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.END, 4, 0, 4, 0)); addView(chevron, LayoutHelper.createFrame(18, 18, Gravity.END | Gravity.TOP, 0, 2, 0, 0)); addView(progressView, LayoutHelper.createFrame(18, 18, Gravity.END | Gravity.TOP, 0, 2, 0, 0)); recolor(); }
Example #7
Source File: ChatLoadingCell.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public ChatLoadingCell(Context context) { super(context); frameLayout = new FrameLayout(context); frameLayout.setBackgroundResource(R.drawable.system_loader); frameLayout.getBackground().setColorFilter(Theme.colorFilter); addView(frameLayout, LayoutHelper.createFrame(36, 36, Gravity.CENTER)); progressBar = new RadialProgressView(context); progressBar.setSize(AndroidUtilities.dp(28)); progressBar.setProgressColor(Theme.getColor(Theme.key_chat_serviceText)); frameLayout.addView(progressBar, LayoutHelper.createFrame(32, 32, Gravity.CENTER)); }
Example #8
Source File: LoadingCell.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public LoadingCell(Context context, int size, int h) { super(context); height = h; progressBar = new RadialProgressView(context); progressBar.setSize(size); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #9
Source File: CancelAccountDeletionActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public PhoneView(Context context) { super(context); setOrientation(VERTICAL); FrameLayout frameLayout = new FrameLayout(context); addView(frameLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 200)); progressBar = new RadialProgressView(context); frameLayout.addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #10
Source File: CancelAccountDeletionActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public PhoneView(Context context) { super(context); setOrientation(VERTICAL); FrameLayout frameLayout = new FrameLayout(context); addView(frameLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 200)); progressBar = new RadialProgressView(context); frameLayout.addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #11
Source File: PeopleNearbyActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public HeaderCellProgress(Context context) { super(context); setClipChildren(false); progressView = new RadialProgressView(context); progressView.setSize(AndroidUtilities.dp(14)); progressView.setStrokeWidth(2); progressView.setAlpha(0.0f); progressView.setProgressColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueHeader)); addView(progressView, LayoutHelper.createFrame(50, 40, Gravity.TOP | (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT), LocaleController.isRTL ? 2 : 0, 3, LocaleController.isRTL ? 0 : 2, 0)); }
Example #12
Source File: LocationLoadingCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public LocationLoadingCell(Context context) { super(context); progressBar = new RadialProgressView(context); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText3)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setText(LocaleController.getString("NoResult", R.string.NoResult)); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #13
Source File: LoadingCell.java From Telegram with GNU General Public License v2.0 | 5 votes |
public LoadingCell(Context context, int size, int h) { super(context); height = h; progressBar = new RadialProgressView(context); progressBar.setSize(size); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #14
Source File: CancelAccountDeletionActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public PhoneView(Context context) { super(context); setOrientation(VERTICAL); FrameLayout frameLayout = new FrameLayout(context); addView(frameLayout, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 200)); progressBar = new RadialProgressView(context); frameLayout.addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #15
Source File: ChatLoadingCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public ChatLoadingCell(Context context) { super(context); frameLayout = new FrameLayout(context); frameLayout.setBackgroundResource(R.drawable.system_loader); frameLayout.getBackground().setColorFilter(Theme.colorFilter); addView(frameLayout, LayoutHelper.createFrame(36, 36, Gravity.CENTER)); progressBar = new RadialProgressView(context); progressBar.setSize(AndroidUtilities.dp(28)); progressBar.setProgressColor(Theme.getColor(Theme.key_chat_serviceText)); frameLayout.addView(progressBar, LayoutHelper.createFrame(32, 32, Gravity.CENTER)); }
Example #16
Source File: LocationLoadingCell.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public LocationLoadingCell(Context context) { super(context); progressBar = new RadialProgressView(context); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText3)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setText(LocaleController.getString("NoResult", R.string.NoResult)); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #17
Source File: ChatLoadingCell.java From Telegram with GNU General Public License v2.0 | 5 votes |
public ChatLoadingCell(Context context) { super(context); frameLayout = new FrameLayout(context); frameLayout.setBackgroundResource(R.drawable.system_loader); frameLayout.getBackground().setColorFilter(Theme.colorFilter); addView(frameLayout, LayoutHelper.createFrame(36, 36, Gravity.CENTER)); progressBar = new RadialProgressView(context); progressBar.setSize(AndroidUtilities.dp(28)); progressBar.setProgressColor(Theme.getColor(Theme.key_chat_serviceText)); frameLayout.addView(progressBar, LayoutHelper.createFrame(32, 32, Gravity.CENTER)); }
Example #18
Source File: LegendSignatureView.java From Telegram with GNU General Public License v2.0 | 5 votes |
public LegendSignatureView(Context context) { super(context); setPadding(AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8)); content = new LinearLayout(getContext()); content.setOrientation(LinearLayout.VERTICAL); time = new TextView(context); time.setTextSize(14); time.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); hourTime = new TextView(context); hourTime.setTextSize(14); hourTime.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); chevron = new ImageView(context); chevron.setImageResource(R.drawable.ic_chevron_right_black_18dp); progressView = new RadialProgressView(context); progressView.setSize(AndroidUtilities.dp(12)); progressView.setStrokeWidth(AndroidUtilities.dp(0.5f)); progressView.setVisibility(View.GONE); addView(content, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.NO_GRAVITY, 0, 22, 0, 0)); addView(time, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, 4, 0, 4, 0)); addView(hourTime, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.END, 4, 0, 4, 0)); addView(chevron, LayoutHelper.createFrame(18, 18, Gravity.END | Gravity.TOP, 0, 2, 0, 0)); addView(progressView, LayoutHelper.createFrame(18, 18, Gravity.END | Gravity.TOP, 0, 2, 0, 0)); recolor(); }
Example #19
Source File: StickerSetCell.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
public StickerSetCell(Context context, int option) { super(context); this.option = option; textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity(LayoutHelper.getAbsoluteGravityStart()); addView(textView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, 71, 9, 46, 0)); valueTextView = new TextView(context); valueTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText2)); valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); valueTextView.setLines(1); valueTextView.setMaxLines(1); valueTextView.setSingleLine(true); valueTextView.setGravity(LayoutHelper.getAbsoluteGravityStart()); addView(valueTextView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, 71, 32, 46, 0)); imageView = new BackupImageView(context); imageView.setAspectFit(true); imageView.setLayerNum(1); addView(imageView, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 13, 9, LocaleController.isRTL ? 13 : 0, 0)); if (option == 2) { progressView = new RadialProgressView(getContext()); progressView.setProgressColor(Theme.getColor(Theme.key_dialogProgressCircle)); progressView.setSize(AndroidUtilities.dp(30)); addView(progressView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 12, 5, LocaleController.isRTL ? 12 : 0, 0)); } else if (option != 0) { optionsButton = new ImageView(context); optionsButton.setFocusable(false); optionsButton.setScaleType(ImageView.ScaleType.CENTER); optionsButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_stickers_menuSelector))); if (option == 1) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_stickers_menu), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.msg_actions); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL)); reorderButton = new ImageView(context); reorderButton.setAlpha(0f); reorderButton.setVisibility(GONE); reorderButton.setScaleType(ImageView.ScaleType.CENTER); reorderButton.setImageResource(R.drawable.list_reorder); reorderButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_stickers_menu), PorterDuff.Mode.MULTIPLY)); addView(reorderButton, LayoutHelper.createFrameRelatively(58, 58, Gravity.END)); checkBox = new CheckBox2(context, 21); checkBox.setColor(null, Theme.key_windowBackgroundWhite, Theme.key_checkboxCheck); checkBox.setDrawUnchecked(false); checkBox.setDrawBackgroundAsArc(3); addView(checkBox, LayoutHelper.createFrameRelatively(24, 24, Gravity.START, 34, 30, 0, 0)); } else if (option == 3) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_featuredStickers_addedIcon), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.sticker_added); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP, (LocaleController.isRTL ? 10 : 0), 9, (LocaleController.isRTL ? 0 : 10), 0)); } } }
Example #20
Source File: StickerSetCell.java From Telegram with GNU General Public License v2.0 | 4 votes |
public StickerSetCell(Context context, int option) { super(context); this.option = option; textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity(LayoutHelper.getAbsoluteGravityStart()); addView(textView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, 71, 9, 46, 0)); valueTextView = new TextView(context); valueTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText2)); valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); valueTextView.setLines(1); valueTextView.setMaxLines(1); valueTextView.setSingleLine(true); valueTextView.setGravity(LayoutHelper.getAbsoluteGravityStart()); addView(valueTextView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START, 71, 32, 46, 0)); imageView = new BackupImageView(context); imageView.setAspectFit(true); imageView.setLayerNum(1); addView(imageView, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 13, 9, LocaleController.isRTL ? 13 : 0, 0)); if (option == 2) { progressView = new RadialProgressView(getContext()); progressView.setProgressColor(Theme.getColor(Theme.key_dialogProgressCircle)); progressView.setSize(AndroidUtilities.dp(30)); addView(progressView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 12, 5, LocaleController.isRTL ? 12 : 0, 0)); } else if (option != 0) { optionsButton = new ImageView(context); optionsButton.setFocusable(false); optionsButton.setScaleType(ImageView.ScaleType.CENTER); optionsButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_stickers_menuSelector))); if (option == 1) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_stickers_menu), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.msg_actions); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL)); reorderButton = new ImageView(context); reorderButton.setAlpha(0f); reorderButton.setVisibility(GONE); reorderButton.setScaleType(ImageView.ScaleType.CENTER); reorderButton.setImageResource(R.drawable.list_reorder); reorderButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_stickers_menu), PorterDuff.Mode.MULTIPLY)); addView(reorderButton, LayoutHelper.createFrameRelatively(58, 58, Gravity.END)); checkBox = new CheckBox2(context, 21); checkBox.setColor(null, Theme.key_windowBackgroundWhite, Theme.key_checkboxCheck); checkBox.setDrawUnchecked(false); checkBox.setDrawBackgroundAsArc(3); addView(checkBox, LayoutHelper.createFrameRelatively(24, 24, Gravity.START, 34, 30, 0, 0)); } else if (option == 3) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_featuredStickers_addedIcon), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.sticker_added); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP, (LocaleController.isRTL ? 10 : 0), 9, (LocaleController.isRTL ? 0 : 10), 0)); } } }
Example #21
Source File: LoadingCell.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
public LoadingCell(Context context) { super(context); progressBar = new RadialProgressView(context); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #22
Source File: StickerSetCell.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
public StickerSetCell(Context context, int option) { super(context); textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, LocaleController.isRTL ? 40 : 71, 10, LocaleController.isRTL ? 71 : 40, 0)); valueTextView = new TextView(context); valueTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText2)); valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); valueTextView.setLines(1); valueTextView.setMaxLines(1); valueTextView.setSingleLine(true); valueTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, LocaleController.isRTL ? 40 : 71, 35, LocaleController.isRTL ? 71 : 40, 0)); imageView = new BackupImageView(context); imageView.setAspectFit(true); addView(imageView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 12, 8, LocaleController.isRTL ? 12 : 0, 0)); if (option == 2) { progressView = new RadialProgressView(getContext()); progressView.setProgressColor(Theme.getColor(Theme.key_dialogProgressCircle)); progressView.setSize(AndroidUtilities.dp(30)); addView(progressView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 12, 8, LocaleController.isRTL ? 12 : 0, 0)); } else if (option != 0) { optionsButton = new ImageView(context); optionsButton.setFocusable(false); optionsButton.setScaleType(ImageView.ScaleType.CENTER); optionsButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_stickers_menuSelector))); if (option == 1) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_stickers_menu), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.msg_actions); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP)); } else if (option == 3) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_featuredStickers_addedIcon), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.sticker_added); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP, (LocaleController.isRTL ? 10 : 0), 12, (LocaleController.isRTL ? 0 : 10), 0)); } } }
Example #23
Source File: LoadingCell.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
public LoadingCell(Context context) { super(context); progressBar = new RadialProgressView(context); addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER)); }
Example #24
Source File: StickerSetCell.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
public StickerSetCell(Context context, int option) { super(context); textView = new TextView(context); textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText)); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, LocaleController.isRTL ? 40 : 71, 10, LocaleController.isRTL ? 71 : 40, 0)); valueTextView = new TextView(context); valueTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText2)); valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); valueTextView.setLines(1); valueTextView.setMaxLines(1); valueTextView.setSingleLine(true); valueTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT); addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, LocaleController.isRTL ? 40 : 71, 35, LocaleController.isRTL ? 71 : 40, 0)); imageView = new BackupImageView(context); imageView.setAspectFit(true); addView(imageView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 12, 8, LocaleController.isRTL ? 12 : 0, 0)); if (option == 2) { progressView = new RadialProgressView(getContext()); progressView.setProgressColor(Theme.getColor(Theme.key_dialogProgressCircle)); progressView.setSize(AndroidUtilities.dp(30)); addView(progressView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 12, 8, LocaleController.isRTL ? 12 : 0, 0)); } else if (option != 0) { optionsButton = new ImageView(context); optionsButton.setFocusable(false); optionsButton.setScaleType(ImageView.ScaleType.CENTER); optionsButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_stickers_menuSelector))); if (option == 1) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_stickers_menu), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.msg_actions); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP)); } else if (option == 3) { optionsButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_featuredStickers_addedIcon), PorterDuff.Mode.MULTIPLY)); optionsButton.setImageResource(R.drawable.sticker_added); addView(optionsButton, LayoutHelper.createFrame(40, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP, (LocaleController.isRTL ? 10 : 0), 12, (LocaleController.isRTL ? 0 : 10), 0)); } } }