storage-chooser

½éÉÜ£º

Ò»¸öÎļþÓëĿ¼µÄÑ¡ÔñÆ÷£¬Ö§³ÖÔÚÑ¡Ôñ½çÃæ´´½¨Ä¿Â¼¡£

ÔËÐÐЧ¹û£º

ʹÓÃ˵Ã÷£º

ÔÚroot  build.gradle ÖÐÌí¼Ó£º

allprojects {
	repositories {
		maven { url "https://jitpack.io" }
	}
}

ÔÚappµÄbuild.gradleÖÐÌí¼Ó£º

com.github.codekidX:storage-chooser:1.0.34

¼òµ¥Ó÷¨

// ~
// Initialize Builder
StorageChooser chooser = new StorageChooser.Builder()
.withActivity(MainActivity.this)
.withFragmentManager(getSupportFragmentManager())
.withMemoryBar(true) 
.build();
// Show dialog whenever you want by
chooser.show();
// get path that the user has chosen
chooser.setOnSelectListener(new StorageChooser.OnSelectListener() {
    @Override
    public void onSelect(String path) {
        Log.e("SELECTED_PATH", path);
    }
});

Ñ¡ÔñĿ¼

// --- ADD ---
.allowCustomPath(true)
.setType(StorageChooser.DIRECTORY_CHOOSER)

Ñ¡ÔñÎļþ

// --- ADD ---
.allowCustomPath(true)
.setType(StorageChooser.FILE_PICKER)
已下载
0