From 91acfc28305e896f6b75af795ee79a77b55cd2bb Mon Sep 17 00:00:00 2001 From: Makhnev Petr <51853996+i582@users.noreply.github.com> Date: Thu, 30 Jun 2022 15:24:41 +0300 Subject: [PATCH] Add a small section to Working with Icons and Images article describing animated icons (#799) * added a small section to Working with Icons and Images article describing animated icons --- topics/intro/content_updates.md | 1 + .../work_with_icons_and_images.md | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/topics/intro/content_updates.md b/topics/intro/content_updates.md index f591b99f3..074bed962 100644 --- a/topics/intro/content_updates.md +++ b/topics/intro/content_updates.md @@ -27,6 +27,7 @@ Minor Changes and Additions : - Add a small section to [](php_open_api.md#utility-classes) describing `PhpFilePathUtils` utility class. - Add mention of the way to programmatically open an autocomplete popup to [](code_completion.md). +- Add a small section to [](work_with_icons_and_images.md) describing animated icons. ### May-22 diff --git a/topics/reference_guide/work_with_icons_and_images.md b/topics/reference_guide/work_with_icons_and_images.md index 6e121d232..9df6aeb72 100644 --- a/topics/reference_guide/work_with_icons_and_images.md +++ b/topics/reference_guide/work_with_icons_and_images.md @@ -156,3 +156,25 @@ Here are examples of toolWindowStructure.png icon representations: | Darcula | toolWindowStructure_dark.png | ![Tool Window Structure, dark](toolWindowStructure_dark.png) | | Default + Retina | toolWindowStructure@2x.png | ![Tool Window Structure, retina](toolWindowStructure@2x.png) | | Darcula + Retina | toolWindowStructure@2x_dark.png | ![Tool Window Structure, retina, dark](toolWindowStructure@2x_dark.png) | + +## Animated Icons + +Animated icons are a way to show that plugin is now performing some long-time action. +For example, when plugin is loading some data. + +Any animated icon is a set of frames that loop with some delay. + +To create a new animated icon, use the +[`AnimatedIcon`](upsource:///platform/platform-impl/src/com/intellij/ui/AnimatedIcon.java). + +If you want to create an icon where frames follow each other with the same delay, use a constructor that accepts a delay and icons: + +```java +AnimatedIcon icon = new AnimatedIcon(500, AllIcons.Ide.Macro.Recording_1, AllIcons.Ide.Macro.Recording_2); +``` + +To create an icon from frames with different delays, use `AnimatedIcon.Frame`. +Each frame represents an icon, and a delay until the next frame. + +If you want to show somewhere that there is a long process, you can use the predefined `AnimatedIcon.Default` loader icon. +This icon has a larger `AnimatedIcon.Big` version.