Compare commits

...

11 Commits

Author SHA1 Message Date
4cc399d120 Android #83 2023-09-27 00:57:24 +00:00
75180bdc9d Merge pull request #11602 from t895/case-fix
android: Content install lowercase fix
2023-09-26 14:07:12 -04:00
195d0a93b5 Merge pull request #11599 from lat9nq/aud-bknd-fix
settings_setting: Read audio engine
2023-09-26 01:01:20 -04:00
3491ba4a06 android: Use a different string for the content install dialog 2023-09-26 00:26:46 -04:00
5326ea63e5 android: Fix case bug for installing game content
The C++ side never made the filename lowercase when checking the extension. This just passes the pre-prepared extension to have it checked.
2023-09-26 00:25:20 -04:00
9335cf8857 settings_setting: Read audio engine
This was mysteriously missing, likely from when I ported Citra fixes
semi-recently.
2023-09-25 22:20:24 -04:00
4e855be38b Merge pull request #11594 from t895/rotation-fix
android: Prevent nav bar shade from laying out across screen
2023-09-25 20:57:33 -04:00
69ba29e518 Merge pull request #11597 from t895/drawer-fix
android: Navigation drawer lock mode fix
2023-09-25 20:57:06 -04:00
3d03e8b806 android: Prevent click ripple from appearing on loading card 2023-09-25 18:33:21 -04:00
ff9d8dd0b3 android: Remove bottom attribute from navigation view
Using the "bottom" attribute would break the navigation view and prevent things like rounded corners and lock modes from being applied properly.
2023-09-25 18:31:23 -04:00
38b939b2e9 android: Prevent nav bar shade from laying out across screen 2023-09-25 18:10:58 -04:00
9 changed files with 41 additions and 15 deletions

View File

@ -1,3 +1,11 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
End of merge log. You can find the original README.md below the break.
-----
<!-- <!--
SPDX-FileCopyrightText: 2018 yuzu Emulator Project SPDX-FileCopyrightText: 2018 yuzu Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later SPDX-License-Identifier: GPL-2.0-or-later

View File

@ -247,7 +247,12 @@ object NativeLibrary {
external fun setAppDirectory(directory: String) external fun setAppDirectory(directory: String)
external fun installFileToNand(filename: String): Int /**
* Installs a nsp or xci file to nand
* @param filename String representation of file uri
* @param extension Lowercase string representation of file extension without "."
*/
external fun installFileToNand(filename: String, extension: String): Int
external fun initializeGpuDriver( external fun initializeGpuDriver(
hookLibDir: String?, hookLibDir: String?,

View File

@ -181,12 +181,14 @@ class SettingsActivity : AppCompatActivity() {
private fun setInsets() { private fun setInsets() {
ViewCompat.setOnApplyWindowInsetsListener( ViewCompat.setOnApplyWindowInsetsListener(
binding.navigationBarShade binding.navigationBarShade
) { view: View, windowInsets: WindowInsetsCompat -> ) { _: View, windowInsets: WindowInsetsCompat ->
val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
val mlpShade = view.layoutParams as MarginLayoutParams // The only situation where we care to have a nav bar shade is when it's at the bottom
mlpShade.height = barInsets.bottom // of the screen where scrolling list elements can go behind it.
view.layoutParams = mlpShade val mlpNavShade = binding.navigationBarShade.layoutParams as MarginLayoutParams
mlpNavShade.height = barInsets.bottom
binding.navigationBarShade.layoutParams = mlpNavShade
windowInsets windowInsets
} }

View File

@ -515,7 +515,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
if (documents.isNotEmpty()) { if (documents.isNotEmpty()) {
IndeterminateProgressDialogFragment.newInstance( IndeterminateProgressDialogFragment.newInstance(
this@MainActivity, this@MainActivity,
R.string.install_game_content R.string.installing_game_content
) { ) {
var installSuccess = 0 var installSuccess = 0
var installOverwrite = 0 var installOverwrite = 0
@ -523,7 +523,12 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
var errorExtension = 0 var errorExtension = 0
var errorOther = 0 var errorOther = 0
documents.forEach { documents.forEach {
when (NativeLibrary.installFileToNand(it.toString())) { when (
NativeLibrary.installFileToNand(
it.toString(),
FileUtil.getExtension(it)
)
) {
NativeLibrary.InstallFileToNandResult.Success -> { NativeLibrary.InstallFileToNandResult.Success -> {
installSuccess += 1 installSuccess += 1
} }

View File

@ -102,7 +102,7 @@ public:
m_native_window = native_window; m_native_window = native_window;
} }
int InstallFileToNand(std::string filename) { int InstallFileToNand(std::string filename, std::string file_extension) {
jconst copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest, jconst copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest,
std::size_t block_size) { std::size_t block_size) {
if (src == nullptr || dest == nullptr) { if (src == nullptr || dest == nullptr) {
@ -134,12 +134,12 @@ public:
m_system.GetFileSystemController().CreateFactories(*m_vfs); m_system.GetFileSystemController().CreateFactories(*m_vfs);
[[maybe_unused]] std::shared_ptr<FileSys::NSP> nsp; [[maybe_unused]] std::shared_ptr<FileSys::NSP> nsp;
if (filename.ends_with("nsp")) { if (file_extension == "nsp") {
nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read));
if (nsp->IsExtractedType()) { if (nsp->IsExtractedType()) {
return InstallError; return InstallError;
} }
} else if (filename.ends_with("xci")) { } else if (file_extension == "xci") {
jconst xci = jconst xci =
std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read));
nsp = xci->GetSecurePartitionNSP(); nsp = xci->GetSecurePartitionNSP();
@ -607,8 +607,10 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, jobject
} }
int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance,
[[maybe_unused]] jstring j_file) { jstring j_file,
return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file)); jstring j_file_extension) {
return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file),
GetJString(env, j_file_extension));
} }
void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz, void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz,

View File

@ -22,7 +22,7 @@
<View <View
android:id="@+id/navigation_bar_shade" android:id="@+id/navigation_bar_shade"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="1px" android:layout_height="1px"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:clickable="false" android:clickable="false"

View File

@ -32,7 +32,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:focusable="false"> android:focusable="false"
android:clickable="false">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/loading_layout" android:id="@+id/loading_layout"
@ -155,7 +156,7 @@
android:id="@+id/in_game_menu" android:id="@+id/in_game_menu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="start|bottom" android:layout_gravity="start"
app:headerLayout="@layout/header_in_game" app:headerLayout="@layout/header_in_game"
app:menu="@menu/menu_in_game" app:menu="@menu/menu_in_game"
tools:visibility="gone" /> tools:visibility="gone" />

View File

@ -107,6 +107,7 @@
<string name="share_log_missing">No log file found</string> <string name="share_log_missing">No log file found</string>
<string name="install_game_content">Install game content</string> <string name="install_game_content">Install game content</string>
<string name="install_game_content_description">Install game updates or DLC</string> <string name="install_game_content_description">Install game updates or DLC</string>
<string name="installing_game_content">Installing content…</string>
<string name="install_game_content_failure">Error installing file(s) to NAND</string> <string name="install_game_content_failure">Error installing file(s) to NAND</string>
<string name="install_game_content_failure_description">Please ensure content(s) are valid and that the prod.keys file is installed.</string> <string name="install_game_content_failure_description">Please ensure content(s) are valid and that the prod.keys file is installed.</string>
<string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts.</string> <string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts.</string>

View File

@ -187,6 +187,8 @@ public:
this->SetValue(input == "true"); this->SetValue(input == "true");
} else if constexpr (std::is_same_v<Type, float>) { } else if constexpr (std::is_same_v<Type, float>) {
this->SetValue(std::stof(input)); this->SetValue(std::stof(input));
} else if constexpr (std::is_same_v<Type, AudioEngine>) {
this->SetValue(ToEnum<AudioEngine>(input));
} else { } else {
this->SetValue(static_cast<Type>(std::stoll(input))); this->SetValue(static_cast<Type>(std::stoll(input)));
} }