A super file picker framework.

Overview

一款超强的文件选择框架。A super file picker framework.

功能:

  • 文件选择
  • 支持多种类型文件选择
  • 支持多个文件同时选择

如何添加

Gradle添加:

1.在Project的build.gradle中添加仓库地址

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

2.在Module目录下的build.gradle中添加依赖

dependencies {
    implementation 'com.github.ITxiaoguang:FilePicker:xxx'
}

使用方法:

    private void filePicker() {
        String[] zips = {"zip", "rar"};
	String[] doc = {"doc", "docx"};
	String[] ppt = {"ppt", "pptx"};
	String[] pdf = {"pdf"};
	String[] txt = {"txt"};
	String[] apk = {"apk"};
	String[] xls = {"xls", "xlsx"};
	String[] music = {"m3u", "m4a", "m4b", "m4p", "ogg", "wma", "wmv", "ogg", "rmvb", "mp2", "mp3", "aac", "awb", "amr", "mka"};
	FilePickerBuilder.getInstance()
		.setMaxCount(9)// 最多选择
		// .setSelectedFiles(docPaths)// 已选择
		// .setActivityTheme(R.style.DarkTheme2)// 主题
		.enableCameraSupport(false)// 支持摄像头
		.showPic(true)// 显示图片tab栏
		.showVideo(true)// 显示视频tab栏
		.enableDocSupport(false)// 显示文档tab栏
		.addFileSupport("Word", doc, R.drawable.ic_file_word)// tab栏描述;类型;tab栏下item的图标
		.addFileSupport("压缩包", zips, R.drawable.ic_file_zip)
		.addFileSupport("PDF", pdf, R.drawable.ic_file_pdf)
		.addFileSupport("Txt文本", txt, R.drawable.ic_file_txt)
		.addFileSupport("PPT", ppt, R.drawable.ic_file_ppt)
		.addFileSupport("安装包", apk, R.drawable.ic_file_zip)
		.addFileSupport("Excel表格", xls, R.drawable.ic_file_excel)
		.addFileSupport("音乐", music, R.drawable.ic_file_music)
		.setActivityTitle("请选择文件")// 标题
		.sortDocumentsBy(SortingTypes.name)// 
		.withOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)// 
		.pickFile(this, REQUEST_CODE_FILE);// 回调
    }
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
	super.onActivityResult(requestCode, resultCode, data);
	if (resultCode == Activity.RESULT_OK) {
	    if (requestCode == REQUEST_CODE_FILE) {//选择文件类型回调
		ArrayList<String> filePaths = data.getStringArrayListExtra(FilePickerConst.KEY_SELECTED_DOCS);
		Toast.makeText(this, filePaths.toString(), Toast.LENGTH_SHORT).show();
	    }
	}
    }
You might also like...
Pix is a Whatsapp image picker replica. with this, you can integrate an image picker just like WhatsApp.
Pix is a Whatsapp image picker replica. with this, you can integrate an image picker just like WhatsApp.

Pix (WhatsApp Style Image and Video Picker) Pix is a WhatsApp image picker replica. with this you can integrate a image picker just like WhatsApp. Upc

Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.
Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.

1. Add dependency dependencies { implementation 'com.hbb20:android-country-picker:X.Y.Z' } For latest version, 2. Decide your use-case

Facebook-Styled-Image-Picker - Facebook Styled Image Picker

Facebook-Styled-Image-Picker Facebook Styled Gallery Files picker. One or multip

Picker-kt - Media picker library powered by Jetpack Compose
Picker-kt - Media picker library powered by Jetpack Compose

ANDROID LIBRARY PickerKT A media picker library for Android apps powered by Jetp

A simple file/ directory picker dialog for android
A simple file/ directory picker dialog for android

FileListerDialog FileListerDialog helps you to list and pick file/directory. Library is built for Android Getting Started Installing To use this libra

A file/directory-picker for android. Implemented as a library project.
A file/directory-picker for android. Implemented as a library project.

Note: avoid using as SD-card file picker on Kitkat+ In Kitkat or above, use Android's built-in file-picker instead. Google has restricted the ability

File Picker for KMP project. Works for Android/JVM/Web.

KFilePicker File Picker for KMP project. Works for Android/JVM/Web. Setup Add Jitpack maven { url

A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffolding when apk is a unity il2cpp game. Write code on a apk file elegantly.

FakerAndroid (FakerAndroid.jar or FakerAndroid-AS) A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffold

[Android Library] Get easy access to device information super fast, real quick
[Android Library] Get easy access to device information super fast, real quick

DeviceInfo-Sample Simple, single class wrapper to get device information from an android device. This library provides an easy way to access all the d

Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.
Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.

KataSuperHeroes in Kotlin We are here to practice UI Testing. We are going to use Espresso to interact with the Application UI. We are going to use Ko

super simple library to manage http requests.

HttpAgent super simple library to manage http requests. Gradle dependencies { implementation 'com.studioidan.httpagent:httpagent:1.0.16@aar' } No

[] Super fast and easy way to create header for Android RecyclerView

DEPRECATED I created this library back in the day when I thought RecyclerView was all new and difficult. Writing an adapter that could inflate multipl

A super fast build tool for Android, an alternative to Instant Run
A super fast build tool for Android, an alternative to Instant Run

Freeline Freeline is a super fast build tool for Android and an alternative to Instant Run. Caching reusable class files and resource indices, it enab

Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.
Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.

KataSuperHeroes in Kotlin We are here to practice UI Testing. We are going to use Espresso to interact with the Application UI. We are going to use Ko

:iphone: [Android Library] Get device information in a super easy way.
:iphone: [Android Library] Get device information in a super easy way.

EasyDeviceInfo Android library to get device information in a super easy way. The library is built for simplicity and approachability. It not only eli

StaticLog - super lightweight static logging for Kotlin, Java and Android
StaticLog - super lightweight static logging for Kotlin, Java and Android

StaticLog StaticLog is a super lightweight logging library implemented in pure Kotlin (https://kotlinlang.org). It is designed to be used in Kotlin, J

a super textview for android
a super textview for android

SuperTextView 重磅推出SuperTextView2.x版本,属性参数相比1.x有些变化,1.x的用户升级2.x的时候请注意 1、功能描述 SuperTextView是一个功能强大的View,可以满足日常大部分布局样式,开发者可已自行组合属性配置出属于自己风格的样式!可能描述起来没有概念

Learn about your favorite Marvel characters, super heroes, villains and watch videos from official Marvel youtube channel.
Learn about your favorite Marvel characters, super heroes, villains and watch videos from official Marvel youtube channel.

Marvel Super Heroes Android App 📱 Learn about your favorite Marvel characters, super heroes, villains and watch videos from official Marvel youtube c

Super Heroes Kata implemented using Jetpack Compose and Screenshot Testing.
Super Heroes Kata implemented using Jetpack Compose and Screenshot Testing.

KataSuperHeroes with Jetpack Compose We are here to learn about Jetpack Compose. We are going to use Jetpack Compose Testing Tools to interact with th

Comments
  • 大佬 请教个问题

    大佬 请教个问题

    val intent = Intent(Intent.ACTION_GET_CONTENT) intent.setType("/") intent.addCategory(Intent.CATEGORY_OPENABLE) this.startActivityForResult( Intent.createChooser(intent, "选择文件"), FilePickerConst.REQUEST_CODE_ALL_TYPE

    opened by 756230883 6
Releases(1.0.2)
Owner
多年IM开发经验总结出的项目demo,欢迎使用。
null
Media Picker is an Android Libary that lets you to select multiple images or video

Media Picker Please let me know if your application go to production via this link Media Picker is an Android Libary that lets you to select multiple

Abdullah Alhazmy 264 Nov 10, 2022
Image Picker for Android 🤖

Android Image Picker No config yet highly configurable image picker for Android Screenshot Click to see how image picker looks… Download Add this to y

Esa Firman 1k Jan 7, 2023
Wheel Picker With Kotlin

WheelPicker Including in your project Gradle Add below codes to your project build.gradle file. buildscript { repositories { mavenCentral(

Clapp Studio 8 Jan 16, 2022
Built the ccp code on compose. Country Code Picker is an android library which provides an easy way to search and select country or international phone code.

Built the ccp code on compose. Country Code Picker is an android library which provides an easy way to search and select country or international phone code.

utku glsvn 7 Oct 23, 2022
Simple, Powerful and Beautiful Android Image/Video/Audio Picker 😎

Simple, Powerful and Beautiful Android Image/Video/Audio Picker ?? Features ?? No need check storage permission ?? Single and multiple selection Suppo

Majid Arabi 34 Jan 2, 2023
Block picker is Android app to help Minecraft player choose blocks for their build.

Block Picker Ever trying to make a build in Minecraft and you just can't find the perfect color palette? Block Picker will help jumpstart your creativ

Ramim Alam 2 May 8, 2022
AndroidFilePicker - android library which will help you to pick any type of media file in your application

AndroidFilePicker is android library which will help you to pick any type of media file in your application. No need to manage any kind of extra permission or result method override. Just create library class instance and use it or also modify ui as your requirement.

null 4 Sep 12, 2022
Unicorn File Picker is a library designed to package a powerful file selector for android.

A simple, documented, and contribution-friendly File Picker for Android.

Abhishek Tiwari 62 Dec 5, 2022
A lightweight super-fast wireless file sharing application built on WiFi Peer-to-Peer technology.

ZipBolt ZipBolt is a file-sharing platform that allows digital devices to share files at incredible speeds using WiFi Peer-to-Peer technology. ZipBolt

Prosper Ekwerike 9 Sep 22, 2022
A program that converts an SGF-file to an animated GIF a la Hayauchi Super Igo style.

sgf2gif A program that converts an SGF-file to an animated GIF. The animated GIF is highly inspired by the classic game Hayauchi Super Igo for NES. Us

null 12 Jul 6, 2022