[FL-1908] New animation update scheme (#737)
* Assets: update desktop animation frame rate and cleanup. * Power: update ViewPort only if changed. * Gui: tie IconAnimation with View, new update event generation scheme. Desktop: update IconAnimation usage. Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
@@ -12,6 +12,11 @@ void view_free(View* view) {
|
||||
free(view);
|
||||
}
|
||||
|
||||
void view_tie_icon_animation(View* view, IconAnimation* icon_animation) {
|
||||
furi_assert(view);
|
||||
icon_animation_set_update_callback(icon_animation, view_icon_animation_callback, view);
|
||||
}
|
||||
|
||||
void view_set_draw_callback(View* view, ViewDrawCallback callback) {
|
||||
furi_assert(view);
|
||||
furi_assert(view->draw_callback == NULL);
|
||||
@@ -120,6 +125,14 @@ void view_commit_model(View* view, bool update) {
|
||||
}
|
||||
}
|
||||
|
||||
void view_icon_animation_callback(IconAnimation* instance, void* context) {
|
||||
furi_assert(context);
|
||||
View* view = context;
|
||||
if(view->update_callback) {
|
||||
view->update_callback(view, view->update_callback_context);
|
||||
}
|
||||
}
|
||||
|
||||
void view_unlock_model(View* view) {
|
||||
furi_assert(view);
|
||||
if(view->model_type == ViewModelTypeLocking) {
|
||||
|
Reference in New Issue
Block a user