diff options
author | PabloG02 <tioo23000@gmail.com> | 2023-06-03 14:15:15 +0200 |
---|---|---|
committer | PabloG02 <tioo23000@gmail.com> | 2023-06-04 20:52:12 +0200 |
commit | 8713c442e9e5408f8d8a4e937e2c8e5c9c335430 (patch) | |
tree | 0485f42e1fe8fb815526c319dbc58eafafb4538b | |
parent | android: add option to install firmware (diff) | |
download | yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.tar yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.tar.gz yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.tar.bz2 yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.tar.lz yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.tar.xz yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.tar.zst yuzu-8713c442e9e5408f8d8a4e937e2c8e5c9c335430.zip |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt index cc4b0157b..0bdbabe79 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt @@ -115,6 +115,11 @@ class HomeSettingsFragment : Fragment() { R.drawable.ic_firmware ) { mainActivity.getFirmware.launch(arrayOf("application/zip")) }, HomeSetting( + R.string.share_log, + R.string.share_log_description, + R.drawable.ic_log + ) { shareLog() }, + HomeSetting( R.string.about, R.string.about_description, R.drawable.ic_info_outline @@ -268,6 +273,24 @@ class HomeSettingsFragment : Fragment() { .show() } + private fun shareLog() { + val file = DocumentFile.fromSingleUri( + mainActivity, DocumentsContract.buildDocumentUri( + DocumentProvider.AUTHORITY, + "${DocumentProvider.ROOT_ID}/log/yuzu_log.txt" + ) + )!! + if (file.exists()) { + val intent = Intent(Intent.ACTION_SEND) + .setDataAndType(file.uri, FileUtil.TEXT_PLAIN) + .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) + .putExtra(Intent.EXTRA_STREAM, file.uri) + startActivity(Intent.createChooser(intent, "Share log")) + } else { + Toast.makeText(requireContext(), getText(R.string.share_log_missing), Toast.LENGTH_SHORT).show() + } + } + private fun setInsets() = ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat -> val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) diff --git a/src/android/app/src/main/res/drawable/ic_log.xml b/src/android/app/src/main/res/drawable/ic_log.xml new file mode 100644 index 000000000..f55b9ad85 --- /dev/null +++ b/src/android/app/src/main/res/drawable/ic_log.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="960" + android:viewportHeight="960" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M360,720L600,720Q617,720 628.5,708.5Q640,697 640,680Q640,663 628.5,651.5Q617,640 600,640L360,640Q343,640 331.5,651.5Q320,663 320,680Q320,697 331.5,708.5Q343,720 360,720ZM360,560L600,560Q617,560 628.5,548.5Q640,537 640,520Q640,503 628.5,491.5Q617,480 600,480L360,480Q343,480 331.5,491.5Q320,503 320,520Q320,537 331.5,548.5Q343,560 360,560ZM240,880Q207,880 183.5,856.5Q160,833 160,800L160,160Q160,127 183.5,103.5Q207,80 240,80L527,80Q543,80 557.5,86Q572,92 583,103L777,297Q788,308 794,322.5Q800,337 800,353L800,800Q800,833 776.5,856.5Q753,880 720,880L240,880ZM520,320L520,160L240,160Q240,160 240,160Q240,160 240,160L240,800Q240,800 240,800Q240,800 240,800L720,800Q720,800 720,800Q720,800 720,800L720,360L560,360Q543,360 531.5,348.5Q520,337 520,320ZM240,160L240,160L240,320Q240,337 240,348.5Q240,360 240,360L240,360L240,160L240,320Q240,337 240,348.5Q240,360 240,360L240,360L240,800Q240,800 240,800Q240,800 240,800L240,800Q240,800 240,800Q240,800 240,800L240,160Q240,160 240,160Q240,160 240,160Z"/> +</vector> diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 4b3bfcf9d..5d42be5e6 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -102,6 +102,9 @@ <string name="firmware_installed_success">Firmware installed successfully</string> <string name="firmware_installed_failure">Firmware installation failed.</string> <string name="firmware_installed_failure_description">Check that the ZIP contains a firmware.</string> + <string name="share_log">Share log</string> + <string name="share_log_description">Share the log file</string> + <string name="share_log_missing">No log file found</string> <!-- About screen strings --> <string name="gaia_is_not_real">Gaia isn\'t real</string> |