Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open files with "Show in Amaze" option #4069

Open
wants to merge 4 commits into
base: release/4.0
Choose a base branch
from

Conversation

seelchen
Copy link
Contributor

@seelchen seelchen commented Feb 3, 2024

Description

When users open an arbitrary file, there is now an option "Show in Amaze". Amaze then tries to find the path of the file and navigate to it.

show-in-amaze.mp4

Issue tracker

Fixes #2714

Automatic tests

  • Added test cases

Manual tests

  • Done

Devices:

  • Pixel 7 emulator running Android 13
  • HTC U11 life running Android 10

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

@seelchen
Copy link
Contributor Author

seelchen commented Feb 3, 2024

This issue was more complicated than I thought. I tried my best, but I am not very satisfied with my implementation.

This PR adds an intent filter for all ACTION_VIEW intents. I could not find a way to restrict it to intents which show files that are on the filesystem, so the "Show in Amaze" option could also be shown for intents that want to view something else than files.

To resolve the URI from the intents I added a new function which tries to find the file path using the ContentProvider. I think that this only works if the URI was constructed with the default ContentProvider. In the other cases, the function tries to guess the path using the URI path, but this only works if the file path is in the URI. When I tested this, the files downloaded from Chrome for example could not be found because the URI only contained the file ID.

@seelchen seelchen marked this pull request as ready for review February 4, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "show in folder" for opening arbitrary files
1 participant