forked from len0rd/rockbox
Eliminate skin updates in between activities
1) Adds way to pop activity without refreshing the skin at the same time. Activities are sometimes popped in immediate succession, or one activity is popped before another one is pushed right away. This can lead to the UI appearing glitchy, due to an activity only appearing for a split-second, which is especially noticeable with complex skins that change the dimensions of the UI viewport depending on the current activity To fix this, prevent superfluous skin updates * when switching between: - WPS and browser - WPS and Playlist Catalogue - WPS and playlist - WPS and Settings/System/Plugins * when accessing Track Info or when displaying bookmarks using the context menu on the WPS * when switching from QuickScreen to Shortcuts Menu 2) The playlist viewer activity was pushed & popped redundantly by playlist_view. ---- NB: Behavior has remained unchanged in all instances of the code where pop_current_activity() has been replaced by pop_current_activity(ACTIVITY_REFRESH_NOW). Change-Id: I56b517b8c9dba823a9fed3a3f558d7469dcea9fd
This commit is contained in:
parent
90d1ac0448
commit
dfd9c10589
18 changed files with 119 additions and 32 deletions
|
|
@ -276,7 +276,14 @@ static int browser(void* param)
|
|||
|
||||
browse_context_init(&browse, filter, 0, NULL, NOICON, folder, NULL);
|
||||
ret_val = rockbox_browse(&browse);
|
||||
pop_current_activity();
|
||||
|
||||
if (ret_val == GO_TO_WPS
|
||||
|| ret_val == GO_TO_PREVIOUS_MUSIC
|
||||
|| ret_val == GO_TO_PLUGIN)
|
||||
pop_current_activity(ACTIVITY_REFRESH_DEFERRED);
|
||||
else
|
||||
pop_current_activity(ACTIVITY_REFRESH_NOW);
|
||||
|
||||
switch ((intptr_t)param)
|
||||
{
|
||||
case GO_TO_FILEBROWSER:
|
||||
|
|
@ -336,7 +343,23 @@ static int wpsscrn(void* param)
|
|||
{
|
||||
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
|
||||
}
|
||||
pop_current_activity();
|
||||
|
||||
if (ret_val == GO_TO_PLAYLIST_VIEWER
|
||||
|| ret_val == GO_TO_PLUGIN
|
||||
|| ret_val == GO_TO_WPS
|
||||
|| ret_val == GO_TO_PREVIOUS_MUSIC
|
||||
|| ret_val == GO_TO_PREVIOUS_BROWSER
|
||||
|| (ret_val == GO_TO_PREVIOUS
|
||||
&& (last_screen == GO_TO_MAINMENU /* Settings */
|
||||
|| last_screen == GO_TO_BROWSEPLUGINS
|
||||
|| last_screen == GO_TO_SYSTEM_SCREEN
|
||||
|| last_screen == GO_TO_PLAYLISTS_SCREEN)))
|
||||
{
|
||||
pop_current_activity(ACTIVITY_REFRESH_DEFERRED);
|
||||
}
|
||||
else
|
||||
pop_current_activity(ACTIVITY_REFRESH_NOW);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
#if CONFIG_TUNER
|
||||
|
|
@ -370,10 +393,14 @@ static int playlist_view_catalog(void * param)
|
|||
(void)param;
|
||||
push_current_activity(ACTIVITY_PLAYLISTBROWSER);
|
||||
bool item_was_selected = catalog_view_playlists();
|
||||
pop_current_activity();
|
||||
|
||||
if (item_was_selected)
|
||||
{
|
||||
pop_current_activity(ACTIVITY_REFRESH_DEFERRED);
|
||||
return GO_TO_WPS;
|
||||
return GO_TO_PREVIOUS;
|
||||
}
|
||||
pop_current_activity(ACTIVITY_REFRESH_NOW);
|
||||
return GO_TO_ROOT;
|
||||
}
|
||||
|
||||
static int playlist_view(void * param)
|
||||
|
|
@ -381,9 +408,7 @@ static int playlist_view(void * param)
|
|||
(void)param;
|
||||
int val;
|
||||
|
||||
push_current_activity(ACTIVITY_PLAYLISTVIEWER);
|
||||
val = playlist_viewer();
|
||||
pop_current_activity();
|
||||
switch (val)
|
||||
{
|
||||
case PLAYLIST_VIEWER_MAINMENU:
|
||||
|
|
@ -682,7 +707,15 @@ static inline int load_screen(int screen)
|
|||
ret_val = items[screen].function(items[screen].param);
|
||||
|
||||
if (activity != ACTIVITY_UNKNOWN)
|
||||
pop_current_activity();
|
||||
{
|
||||
if (ret_val == GO_TO_WPS
|
||||
|| ret_val == GO_TO_PREVIOUS_MUSIC)
|
||||
{
|
||||
pop_current_activity(ACTIVITY_REFRESH_DEFERRED);
|
||||
}
|
||||
else
|
||||
pop_current_activity(ACTIVITY_REFRESH_NOW);
|
||||
}
|
||||
|
||||
last_screen = screen;
|
||||
if (ret_val == GO_TO_PREVIOUS)
|
||||
|
|
@ -708,7 +741,7 @@ static int load_context_screen(int selection)
|
|||
|
||||
if (context_menu)
|
||||
retval = do_menu(context_menu, NULL, NULL, false);
|
||||
pop_current_activity();
|
||||
pop_current_activity(ACTIVITY_REFRESH_NOW);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue