Skip to content

Commit

Permalink
Added multiple file select
Browse files Browse the repository at this point in the history
Added the ability to allow for multiple file selection on android filechooser
  • Loading branch information
Guhan-SenSam authored and akshayaurora committed Jun 2, 2021
1 parent c773bcd commit d6672e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plyer/platforms/android/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class AndroidFileChooser(FileChooser):

# default selection value
selection = None

# select multiple files
multiple = False

# mime types
mime_type = {
Expand Down Expand Up @@ -140,6 +143,10 @@ def _open_file(self, **kwargs):
file_intent.addCategory(
Intent.CATEGORY_OPENABLE
)

# use putExtra to allow multiple file selection
if self.multiple:
file_intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, True)

# start a new activity from PythonActivity
# which creates a filechooser via intent
Expand Down

0 comments on commit d6672e4

Please sign in to comment.