0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-25 12:45:12 +00:00

very small UI improvement (show log save location)

This commit is contained in:
cl-ement05 2021-05-28 23:02:13 +02:00
parent 1ea32c75ff
commit b9820468c6
2 changed files with 4 additions and 3 deletions

View file

@ -38,14 +38,15 @@ class LogFragment : BindingFragment<FragmentLogBinding>() {
val hour = calendar.get(Calendar.HOUR_OF_DAY)
val minute = calendar.get(Calendar.MINUTE)
val second = calendar.get(Calendar.SECOND)
val savePath = requireActivity().getExternalFilesDir("logs")?.path + "/$year$month${day}_$hour$minute$second.log"
val log =
File(requireActivity().getExternalFilesDir("logs")?.path + "/$year$month${day}_$hour$minute$second.log")
File(savePath)
FileWriter(log).apply {
append(logs)
flush()
close()
}
Toast.makeText(requireActivity(), R.string.logs_saved, Toast.LENGTH_SHORT).show()
Toast.makeText(requireActivity(), getString(R.string.logs_saved, savePath), Toast.LENGTH_SHORT).show()
} catch (e: IOException) {
Toast.makeText(requireActivity(), R.string.logs_not_saved, Toast.LENGTH_SHORT)
.show()

View file

@ -73,7 +73,7 @@
<!-- Logs -->
<string name="logs_not_saved">Could not save logs</string>
<string name="logs_saved">Successfully saved logs</string>
<string name="logs_saved">Successfully saved logs to %1$s</string>
<!-- Dialogs -->
<string name="advanced">Details</string>