mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added mode animations to loading screen from different stats.
This commit is contained in:
parent
ba99706e75
commit
89dc18aaea
9 changed files with 34 additions and 3 deletions
BIN
Telegram/Resources/animations/stats_boosts.tgs
Normal file
BIN
Telegram/Resources/animations/stats_boosts.tgs
Normal file
Binary file not shown.
BIN
Telegram/Resources/animations/stats_earn.tgs
Normal file
BIN
Telegram/Resources/animations/stats_earn.tgs
Normal file
Binary file not shown.
|
@ -5179,6 +5179,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
"lng_stats_loading" = "Loading stats...";
|
"lng_stats_loading" = "Loading stats...";
|
||||||
"lng_stats_loading_subtext" = "Please wait a few moments while we generate your stats.";
|
"lng_stats_loading_subtext" = "Please wait a few moments while we generate your stats.";
|
||||||
|
"lng_stats_boosts_loading" = "Loading boosts list...";
|
||||||
|
"lng_stats_boosts_loading_subtext" = "Please wait a few moments while we generate your stats.";
|
||||||
|
"lng_stats_earn_loading" = "Loading rewards info...";
|
||||||
|
"lng_stats_earn_loading_subtext" = "Please wait a few moments while we generate your stats.";
|
||||||
|
|
||||||
"lng_chart_title_member_count" = "Growth";
|
"lng_chart_title_member_count" = "Growth";
|
||||||
"lng_chart_title_join" = "Followers";
|
"lng_chart_title_join" = "Followers";
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
<file alias="ttl.tgs">../../animations/ttl.tgs</file>
|
<file alias="ttl.tgs">../../animations/ttl.tgs</file>
|
||||||
<file alias="discussion.tgs">../../animations/discussion.tgs</file>
|
<file alias="discussion.tgs">../../animations/discussion.tgs</file>
|
||||||
<file alias="stats.tgs">../../animations/stats.tgs</file>
|
<file alias="stats.tgs">../../animations/stats.tgs</file>
|
||||||
|
<file alias="stats_boosts.tgs">../../animations/stats_boosts.tgs</file>
|
||||||
|
<file alias="stats_earn.tgs">../../animations/stats_earn.tgs</file>
|
||||||
<file alias="voice_ttl_idle.tgs">../../animations/voice_ttl_idle.tgs</file>
|
<file alias="voice_ttl_idle.tgs">../../animations/voice_ttl_idle.tgs</file>
|
||||||
<file alias="voice_ttl_start.tgs">../../animations/voice_ttl_start.tgs</file>
|
<file alias="voice_ttl_start.tgs">../../animations/voice_ttl_start.tgs</file>
|
||||||
<file alias="palette.tgs">../../animations/palette.tgs</file>
|
<file alias="palette.tgs">../../animations/palette.tgs</file>
|
||||||
|
|
|
@ -87,6 +87,7 @@ void InnerWidget::load() {
|
||||||
|
|
||||||
Info::Statistics::FillLoading(
|
Info::Statistics::FillLoading(
|
||||||
this,
|
this,
|
||||||
|
Info::Statistics::LoadingType::Earn,
|
||||||
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
||||||
_showFinished.events());
|
_showFinished.events());
|
||||||
|
|
||||||
|
|
|
@ -273,6 +273,7 @@ void InnerWidget::load() {
|
||||||
|
|
||||||
Info::Statistics::FillLoading(
|
Info::Statistics::FillLoading(
|
||||||
this,
|
this,
|
||||||
|
Info::Statistics::LoadingType::Boosts,
|
||||||
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
||||||
_showFinished.events());
|
_showFinished.events());
|
||||||
|
|
||||||
|
|
|
@ -287,6 +287,7 @@ void InnerWidget::load() {
|
||||||
|
|
||||||
Info::Statistics::FillLoading(
|
Info::Statistics::FillLoading(
|
||||||
this,
|
this,
|
||||||
|
Info::Statistics::LoadingType::Earn,
|
||||||
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
||||||
_showFinished.events());
|
_showFinished.events());
|
||||||
|
|
||||||
|
|
|
@ -560,6 +560,7 @@ void FillOverview(
|
||||||
|
|
||||||
void FillLoading(
|
void FillLoading(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
LoadingType type,
|
||||||
rpl::producer<bool> toggleOn,
|
rpl::producer<bool> toggleOn,
|
||||||
rpl::producer<> showFinished) {
|
rpl::producer<> showFinished) {
|
||||||
const auto emptyWrap = container->add(
|
const auto emptyWrap = container->add(
|
||||||
|
@ -569,9 +570,14 @@ void FillLoading(
|
||||||
emptyWrap->toggleOn(std::move(toggleOn), anim::type::instant);
|
emptyWrap->toggleOn(std::move(toggleOn), anim::type::instant);
|
||||||
|
|
||||||
const auto content = emptyWrap->entity();
|
const auto content = emptyWrap->entity();
|
||||||
|
const auto iconName = (type == LoadingType::Boosts)
|
||||||
|
? u"stats_boosts"_q
|
||||||
|
: (type == LoadingType::Earn)
|
||||||
|
? u"stats_earn"_q
|
||||||
|
: u"stats"_q;
|
||||||
auto icon = ::Settings::CreateLottieIcon(
|
auto icon = ::Settings::CreateLottieIcon(
|
||||||
content,
|
content,
|
||||||
{ .name = u"stats"_q, .sizeOverride = Size(st::changePhoneIconSize) },
|
{ .name = iconName, .sizeOverride = Size(st::changePhoneIconSize) },
|
||||||
st::settingsBlockedListIconPadding);
|
st::settingsBlockedListIconPadding);
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -586,7 +592,11 @@ void FillLoading(
|
||||||
content,
|
content,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
content,
|
content,
|
||||||
tr::lng_stats_loading(),
|
(type == LoadingType::Boosts)
|
||||||
|
? tr::lng_stats_boosts_loading()
|
||||||
|
: (type == LoadingType::Earn)
|
||||||
|
? tr::lng_stats_earn_loading()
|
||||||
|
: tr::lng_stats_loading(),
|
||||||
st::changePhoneTitle)),
|
st::changePhoneTitle)),
|
||||||
st::changePhoneTitlePadding + st::boxRowPadding);
|
st::changePhoneTitlePadding + st::boxRowPadding);
|
||||||
|
|
||||||
|
@ -595,7 +605,11 @@ void FillLoading(
|
||||||
content,
|
content,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
content,
|
content,
|
||||||
tr::lng_stats_loading_subtext(),
|
(type == LoadingType::Boosts)
|
||||||
|
? tr::lng_stats_boosts_loading_subtext()
|
||||||
|
: (type == LoadingType::Earn)
|
||||||
|
? tr::lng_stats_earn_loading_subtext()
|
||||||
|
: tr::lng_stats_loading_subtext(),
|
||||||
st::statisticsLoadingSubtext)),
|
st::statisticsLoadingSubtext)),
|
||||||
st::changePhoneDescriptionPadding + st::boxRowPadding);
|
st::changePhoneDescriptionPadding + st::boxRowPadding);
|
||||||
|
|
||||||
|
@ -626,6 +640,7 @@ void InnerWidget::load() {
|
||||||
|
|
||||||
FillLoading(
|
FillLoading(
|
||||||
inner,
|
inner,
|
||||||
|
Info::Statistics::LoadingType::Statistic,
|
||||||
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
_loaded.events_starting_with(false) | rpl::map(!rpl::mappers::_1),
|
||||||
_showFinished.events());
|
_showFinished.events());
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,15 @@ namespace Info::Statistics {
|
||||||
class Memento;
|
class Memento;
|
||||||
class MessagePreview;
|
class MessagePreview;
|
||||||
|
|
||||||
|
enum class LoadingType {
|
||||||
|
Statistic,
|
||||||
|
Boosts,
|
||||||
|
Earn,
|
||||||
|
};
|
||||||
|
|
||||||
void FillLoading(
|
void FillLoading(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
LoadingType type,
|
||||||
rpl::producer<bool> toggleOn,
|
rpl::producer<bool> toggleOn,
|
||||||
rpl::producer<> showFinished);
|
rpl::producer<> showFinished);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue