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

[BUG] Plus button not show while allowAddFolder(true) set in older Android device. #116

Open
eyesblue opened this issue Jan 1, 2020 · 3 comments

Comments

@eyesblue
Copy link

eyesblue commented Jan 1, 2020

Hi, thanks for your great project, it really simple and easy to use.

I like show a directory chooser and allow user create new directory in my app, I modify and test the example code in Xiao Mi A1(Android 9, API level28), it work well, then I create emulator for Android 4.4(API level 19 with Google APIs) and Android 4.1(API level 16 with Google APIs), it not show the plus button in the older version no matter internal or external storage, is the API not support older version?

this is my code:

StorageChooser chooser = new StorageChooser.Builder()
.withActivity(StorageManageActivity.this)
.withFragmentManager(getFragmentManager())
.withMemoryBar(true)
.allowCustomPath(true)
.allowAddFolder(true)
.setType(StorageChooser.DIRECTORY_CHOOSER) // For pickup folder.
.withContent(c)
.build();

 chooser.show();

chooser.setOnSelectListener(new StorageChooser.OnSelectListener() {
@OverRide
public void onSelect(String path) {
Toast.makeText(StorageManageActivity.this, path, Toast.LENGTH_LONG).show();
Log.e("SELECTED_PATH", path);
}
});


Screenshot_20200101-074138
The Screenshot of Xiao Mi A1, API level 28

Screenshot_1577835640
The Screenshot of Emulator, API level 16 and 19

Smartphone :

  • Device:
  1. Xiao Mi A1(Android 9, API level28), work fine.
  2. Android studio Emulator: 4.4(API level 19 with Google APIs), x86 image.
  3. Android studio Emulator: 4.1(API level 16 with Google APIs), x86 image.
@codekidX
Copy link
Owner

Unfortunately creating directories in external storage requires SAF permission which is not implemented, sorry for not mentioning in the README file that this is not possible.

@stavBodik
Copy link

stavBodik commented Oct 13, 2020

The real UI bug is that the plus icon is vector drawable and this need to be added in order for it to work

android { compileSdkVersion 29 defaultConfig { vectorDrawables.useSupportLibrary = true }

The SAF permissions is another, other related problem . . .

@stavBodik
Copy link

@codekidX

Unfortunately creating directories in external storage requires SAF permission which is not implemented, sorry for not mentioning in the README file that this is not possible.

Any way you are right, creating new folder is allowed only in this path : context.getExternalFilesDir(null).getAbsolutePath()

/emulated/0/Android/data/

Even if we add the API 10 request for : android:requestLegacyExternalStorage="true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants