Merge pull request #14945 from unknownbrackets/ui-scroll-memory

UI: Keep scroll position on async load
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-09-28 16:55:06 +02:00
commit e384ad90fc
5 files changed
+22 -25

No files matched your search

+2 -5
View File
@@ -1007,7 +1007,7 @@ void MainScreen::CreateViews() {
Button *focusButton = nullptr;
if (hasStorageAccess) {
scrollAllGames_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT), true);
scrollAllGames_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
scrollAllGames_->SetTag("MainScreenAllGames");
ScrollView *scrollHomebrew = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
scrollHomebrew->SetTag("MainScreenHomebrew");
@@ -1026,7 +1026,7 @@ void MainScreen::CreateViews() {
tabHolder_->AddTab(mm->T("Games"), scrollAllGames_);
tabHolder_->AddTab(mm->T("Homebrew & Demos"), scrollHomebrew);
scrollAllGames_->ScrollTo(g_Config.fGameListScrollPosition);
scrollAllGames_->RememberPosition(&g_Config.fGameListScrollPosition);
tabAllGames->OnChoice.Handle(this, &MainScreen::OnGameSelectedInstant);
tabHomebrew->OnChoice.Handle(this, &MainScreen::OnGameSelectedInstant);
@@ -1248,9 +1248,6 @@ void MainScreen::update() {
RecreateViews();
lastVertical_ = vertical;
}
if (scrollAllGames_) {
g_Config.fGameListScrollPosition = scrollAllGames_->GetScrollPosition();
}
}
bool MainScreen::UseVerticalLayout() const {