maks / MGit

A Git client for Android.
https://manichord.com/projects/mgit.html
GNU General Public License v3.0
1.21k stars 166 forks source link

Utilize `com.android.documentsui` as file picker. #717

Open RokeJulianLockhart opened 1 month ago

RokeJulianLockhart commented 1 month ago

Is your feature request related to a problem?

Currently, it's custom:

Screenshot_20240724-114025

This prevents it accessing https://developer.android.com/training/data-storage/shared/documents-files, whereas utilizing the native FP would.

Describe the solution you'd like

Utilize the native FP.

Describe alternatives you've considered

Unfortunately, this feature cannot be implemented by 3rd-party applications, if https://github.com/zhanghai/MaterialFiles/issues/1215#issuecomment-2083180116 applies to all virtual folders (rather than merely system-provided, sensitive ones, like Bug Reports).

Additional context

maks commented 1 month ago

Just to clarify, are you requesting this for specifying the location of a local git repo or to select files to add to a existing local repo?

RokeJulianLockhart commented 1 month ago

https://github.com/maks/MGit/issues/717#issuecomment-2248971890

@maks, both - wherever there is a file picker. That is, of course, unless you require the ability to add something custom to its GUI.

maks commented 1 month ago

@RokeJulianLockhart ok thanks for clarifying. Unfortunately for the local repo location, that won't be possible because JGit, the underlying git library used in MGit requires actual file handles to the selected repo directory, which is not available by using the Intent based file chooser API that you referenced, as that will only return a uri for the selected file or directory tree.