Skip to content

Commit 8e5f364

Browse files
committed
Removed unused code
1 parent 6a9b48f commit 8e5f364

File tree

2 files changed

+0
-67
lines changed

2 files changed

+0
-67
lines changed

Telegram/Common/PlaceholderHelper.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -282,26 +282,5 @@ public static ImageSource GetWebPFrame(string path, double maxWidth = 512)
282282

283283
return null;
284284
}
285-
286-
public static ImageSource GetLottieFrame(string path, int frame, int width, int height, bool webp = true)
287-
{
288-
// Frame size affects disk cache, so we always use 256.
289-
var animation = LottieAnimation.LoadFromFile(path, width, height, false, null);
290-
if (animation == null)
291-
{
292-
if (webp)
293-
{
294-
return GetWebPFrame(path, width);
295-
}
296-
297-
return null;
298-
}
299-
300-
var bitmap = new WriteableBitmap(width, height);
301-
animation.RenderSync(bitmap.PixelBuffer, frame);
302-
animation.Dispose();
303-
304-
return bitmap;
305-
}
306285
}
307286
}

Telegram/Views/Supergroups/SupergroupEditStickerSetPage.xaml.cs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// Distributed under the GNU General Public License v3.0. (See accompanying
55
// file LICENSE or copy at https://www.gnu.org/licenses/gpl-3.0.txt)
66
//
7-
using System.Linq;
87
using System.Threading.Tasks;
98
using Telegram.Common;
109
using Telegram.Controls;
@@ -73,51 +72,6 @@ private void OnContainerContentChanging(ListViewBase sender, ContainerContentCha
7372
args.Handled = true;
7473
}
7574

76-
private void Grid_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
77-
{
78-
var content = sender as Grid;
79-
var stickerSet = args.NewValue as StickerSetInfo;
80-
81-
var title = content.Children[1] as TextBlock;
82-
var subtitle = content.Children[2] as TextBlock;
83-
var photo = content.Children[0] as Image;
84-
85-
if (stickerSet == null)
86-
{
87-
title.Text = Strings.ChooseStickerSetNotFound;
88-
subtitle.Text = Strings.ChooseStickerSetNotFoundInfo;
89-
photo.Source = null;
90-
return;
91-
}
92-
93-
title.Text = stickerSet.Title;
94-
subtitle.Text = Locale.Declension(Strings.R.Stickers, stickerSet.Size);
95-
96-
var cover = stickerSet.Thumbnail ?? stickerSet.Covers.FirstOrDefault()?.Thumbnail;
97-
if (cover == null)
98-
{
99-
return;
100-
}
101-
102-
var file = cover.File;
103-
if (file.Local.IsDownloadingCompleted)
104-
{
105-
if (cover.Format is ThumbnailFormatTgs)
106-
{
107-
photo.Source = PlaceholderHelper.GetLottieFrame(file.Local.Path, 0, 48, 48);
108-
}
109-
else if (cover.Format is ThumbnailFormatWebp)
110-
{
111-
photo.Source = PlaceholderHelper.GetWebPFrame(file.Local.Path, 48);
112-
}
113-
}
114-
else if (file.Local.CanBeDownloaded && !file.Local.IsDownloadingActive)
115-
{
116-
photo.Source = null;
117-
ViewModel.ClientService.DownloadFile(file.Id, 1);
118-
}
119-
}
120-
12175
#endregion
12276

12377
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)

0 commit comments

Comments
 (0)