Skip to content

Commit

Permalink
Removed premium badge from stickers
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Sep 12, 2023
1 parent ebf5140 commit dd92c47
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 62 deletions.
15 changes: 0 additions & 15 deletions Telegram/Controls/Drawers/StickerDrawer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,6 @@
FrameSize="64,64"
DecodeFrameType="Logical"
Ready="Player_Ready" />

<Border HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Background="{StaticResource PremiumObliqueGradientBrush}"
CornerRadius="10"
Width="20"
Height="20"
Margin="-2,0,-2,-2">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#FFFFFF"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="16"
Text="&#xE9BE;" />
</Border>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
Expand Down
15 changes: 0 additions & 15 deletions Telegram/Controls/Drawers/StickerDrawer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Collections.Generic;
using System.Linq;
using Telegram.Common;
using Telegram.Controls.Media;
using Telegram.Streams;
using Telegram.Td.Api;
using Telegram.ViewModels.Drawers;
Expand Down Expand Up @@ -280,20 +279,6 @@ private void UpdateContainerContent(Sticker sticker, Grid content)
return;
}

if (content.Children.Count > 1 && content.Children[1] is Border panel && panel.Child is TextBlock premium)
{
if (sticker.FullType is StickerFullTypeRegular regular && regular.PremiumAnimation != null && ViewModel.ClientService.IsPremiumAvailable)
{
premium.Text = ViewModel.ClientService.IsPremium ? Icons.Premium16 : Icons.LockClosed16;
panel.HorizontalAlignment = ViewModel.ClientService.IsPremium ? HorizontalAlignment.Right : HorizontalAlignment.Center;
panel.Visibility = Visibility.Visible;
}
else
{
panel.Visibility = Visibility.Collapsed;
}
}

var animation = content.Children[0] as AnimatedImage;
animation.Source = new DelayedFileSource(ViewModel.ClientService, file);

Expand Down
17 changes: 0 additions & 17 deletions Telegram/Views/Popups/StickersPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,6 @@
LimitFps="True"
DecodeFrameType="Logical"
Ready="Player_Ready" />

<Border x:Load="True"
x:Name="PremiumBadge"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Background="{StaticResource PremiumObliqueGradientBrush}"
CornerRadius="10"
Width="20"
Height="20"
Margin="-2,0,-2,-2">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="#FFFFFF"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="16"
Text="&#xE9BE;" />
</Border>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
Expand Down
15 changes: 0 additions & 15 deletions Telegram/Views/Popups/StickersPopup.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Threading.Tasks;
using Telegram.Common;
using Telegram.Controls;
using Telegram.Controls.Media;
using Telegram.Converters;
using Telegram.Navigation;
using Telegram.Streams;
Expand Down Expand Up @@ -160,20 +159,6 @@ private void OnContainerContentChanging(ListViewBase sender, ContainerContentCha
var content = args.ItemContainer.ContentTemplateRoot as Grid;
var sticker = args.Item as ViewModels.Drawers.StickerViewModel;

if (content.Children.Count > 1 && content.Children[1] is Border panel && panel.Child is TextBlock premium)
{
if (sticker.FullType is StickerFullTypeRegular regular && regular.PremiumAnimation != null && ViewModel.ClientService.IsPremiumAvailable)
{
premium.Text = ViewModel.ClientService.IsPremium ? Icons.Premium16 : Icons.LockClosed16;
panel.HorizontalAlignment = ViewModel.ClientService.IsPremium ? HorizontalAlignment.Right : HorizontalAlignment.Center;
panel.Visibility = Visibility.Visible;
}
else
{
panel.Visibility = Visibility.Collapsed;
}
}

var file = sticker.StickerValue;
if (file == null)
{
Expand Down

0 comments on commit dd92c47

Please sign in to comment.