From dc48acc9b9661dbc0f824dd95f2ccdacaf028f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 4 Aug 2023 22:32:25 +0200 Subject: [PATCH] MainScreen on Android TV: Add a button to enter a path by text. See issue #16865 for why this is important on some crippled Android devices. --- UI/MainScreen.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index e5fe6b71fe..b4a699465d 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -776,6 +776,15 @@ void GameBrowser::Refresh() { if (System_GetPropertyBool(SYSPROP_HAS_FOLDER_BROWSER)) { topBar->Add(new Choice(mm->T("Browse"), ImageID("I_FOLDER_OPEN"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::BrowseClick); } + if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_TV) { + topBar->Add(new Choice(mm->T("Enter Path"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Add([=](UI::EventParams &) { + auto mm = GetI18NCategory(I18NCat::MAINMENU); + System_InputBoxGetString(mm->T("Enter Path"), path_.GetPath().ToString(), [=](const char *responseString, int responseValue) { + this->SetPath(Path(responseString)); + }); + return UI::EVENT_DONE; + }); + } #endif } else { topBar->Add(new Spacer(new LinearLayoutParams(FILL_PARENT, 64.0f, 1.0f)));