Open shofiulla-iota opened 4 years ago
You might like to try retrieving the name of the final directory in DIRECTORY_SCREENSHOTS
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_SCREENSHOTS).name.toLowerCase(Locale.getDefault())
but I think that's only available in Android Q?
Perhaps if the detection of the screenshot directory path could be an optional parameter to the delegate class?
I can only see one place that MediaStore.Images.Media.EXTERNAL_CONTENT_URI is used in the android source code, and that is to signal that the user is taking a screenshot. Have you encountered anywhere that this URI is used that does not involve taking a screenshot? You might get away with not having a "screenshot" substring test at all.
@pcholt 1 and 2 I put that code in library for additional checking.
3
That's URI for general image content in Android. When we observe the changes in EXTERNAL_CONTENT_URI
. It could be any image content. So we don't know which URI is coming from taking a screenshot.
I don't have VIVO device to test this problem but I think it might be file path doesn't include "screenshot"
If you still have this problem. You can fork my repo and change the condition in
ScreenshotDetectionDelegate.isScreenshotPath(path: String?)
But I still keep this open issue until I get some VIVO device.