Pigcasso / Appchooser
Licence: apache-2.0
自定义打开指定文件的应用选择器。
Stars: ✭ 87
Programming Languages
java
68154 projects - #9 most used programming language
Projects that are alternatives of or similar to Appchooser
React Native Modal Dropdown
A react-native dropdown/picker/selector component for both Android & iOS.
Stars: ✭ 1,103 (+1167.82%)
Mutual labels: picker
React Native Bubble Select
An easy-to-use customizable bubble animation picker, similar to the Apple Music genre selection
Stars: ✭ 78 (-10.34%)
Mutual labels: picker
Android Dial Picker
A custom rotating dial like picker for android
Stars: ✭ 56 (-35.63%)
Mutual labels: picker
Picker
Picker - A CameraX based WhatsApp Style Image-Video Picker
Stars: ✭ 69 (-20.69%)
Mutual labels: picker
React Colorful
🎨 A tiny (2,5 KB) color picker component for React and Preact apps
Stars: ✭ 951 (+993.1%)
Mutual labels: picker
Tcpickerview
Picker view popup with multiply rows selection written in Swift
Stars: ✭ 84 (-3.45%)
Mutual labels: picker
Datetimepicker
This is a custom android holo datepicker timepicker
Stars: ✭ 56 (-35.63%)
Mutual labels: picker
Material Ui Color Picker
<ColorInput> component for material-ui
Stars: ✭ 74 (-14.94%)
Mutual labels: picker
Pickadate.js
The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
Stars: ✭ 7,753 (+8811.49%)
Mutual labels: picker
React Native Picker Select
🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
Stars: ✭ 1,229 (+1312.64%)
Mutual labels: picker
Webfontpicker
A bookmarklet that previews Google Fonts on a live website
Stars: ✭ 31 (-64.37%)
Mutual labels: picker
Mkcolorpicker
ColorPicker is a fantastic color picker 🎨 written in Swift. Developers can use our color picker as is or they can customize it with all the available features
Stars: ✭ 59 (-32.18%)
Mutual labels: picker
Rc Datetime Picker
React component for datetime picker by Moment.js
Stars: ✭ 85 (-2.3%)
Mutual labels: picker
Magnetic
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲
Stars: ✭ 1,252 (+1339.08%)
Mutual labels: picker
Circularpicker
CircularPicker is helpful for creating a controller aimed to manage any calculated parameter.
Stars: ✭ 73 (-16.09%)
Mutual labels: picker
AppChooser
描述
自定义打开指定文件的应用选择器。
起因
我司主营企业版云存储服务,在一段时间里经常有用户反馈点击某个文件会自动跳转到手机系统自带APP(大多是音乐播放器)的问题。结果发现是手机厂商Rom修改了底层逻辑导致的,为了绕过这个bug,只能在应用内自己实现选择器。
下载
效果图
依赖
implementation 'com.github.Pigcasso:AppChooser:Tag'
4.0.1 特性
- 修复 Android 10 不能打开APK文件的 bug
4.0.0 特性
- 移除 RxJava
2.0.1 特性
- 修复没有能打开文件的应用时显示空列表的bug
2.0.0 特性
- 重构项目,提高可扩展性
- 支持Intent.ACTION_SEND分享文本
- 允许Intent.ACTION_SEND过滤组件
1.2.0 特性
- 修复弹出应用选择器后旋转屏幕不能使用选择的打开方式打开文件的bug。
1.1.0 特性
- 允许屏蔽掉指定的 Component 作为选择项(详情请查看----使用方法)。
1.0.6 特性
把我写的另外两个库:common-1.0.9
, mvp-1.0.7
引入 appchooser
中。
已知问题
写这个库其实是工作需要,我在这篇文章 中提到过写这个库的初衷。我负责的这个项目的 compileSdkVersion 还是 23,也就是说没有引入 Android N 的新特性。关于 compileSdkVersion
、minSdkVersion
、targetSdkVersion
的区别可以看下这篇文章如何选择 compileSdkVersion, minSdkVersion 和 targetSdkVersion。在 Android N 中引入了一个新特性:应用间共享文件禁用 file://URI。也就是说不能再像以前那样:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File("文件绝对路径")), "文件的MimeType");
context.startActivity(intent);
大家可以看看这篇文章:Android7.0须知--应用间共享文件(FileProvider)。目前我司的软件还是使用targetSdkVersion = 19
。
1.0.5 特性
修复bug:如果设置某个Activity为某类型文件的默认打开方式,然后将这个Activity所属的App卸载,再次点击这种类型的文件会导致App闪退。
使用方法
打开文件
在Activity或Fragment中:
private void showFile(FileInfo file) {
AppChooser.from(this)
.file(new File(file.getAbsolutePath()))
.excluded(excluded)
.requestCode(REQUEST_CODE_OPEN_FILE)
.load();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// 处理返回结果
if (requestCode == REQUEST_CODE_OPEN_FILE) {
Log.d(TAG, "onActivityResult: " + requestCode + "," + resultCode + "," + data);
}
}
分享文本
在Activity
或Fragment
中:
public void onShareClick(View view) {
EditText editText = (EditText) findViewById(R.id.edit_text);
if (editText != null) {
CharSequence shareContent = editText.getText();
AppChooser
.from(this)
.text(shareContent.toString())
.excluded(mComponentNames)
.load();
}
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].