Skip to content

Commit d779f18

Browse files
authored
UI bug fix and doc update. (#169)
* 🐛 [Fix] - item file name overlay in single choice mode. * ✏️ update doc.
1 parent d903492 commit d779f18

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ Well, it doesn't have a name like Rocky, Cosmos or Fish. Android File Picker, li
2727
| ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/default_theme.png) | ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/reply_theme.png) | ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/crane_theme.png) | ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/shrine_theme.png) |
2828

2929
## Version Compatibility
30+
It depends on your targetAPI.
3031

31-
Support Android 11 and all versions below.
32+
- `targetAPI <= 28`, no problem at all ;)
33+
- `targetAPI == 29`, please enable `requestLegacyExternalStorage` feature for your project : D
34+
- `targetAPI == 29`
35+
- When running on Android 11 and above, only media files (images, audio and video) can be read, but nothing else can be accessed (e.g. PDF documents, apk binary files, etc.)
3236

37+
Please check out this issue: [All About Scope Storage. ](https://github.com/rosuH/AndroidFilePicker/issues/146)
3338
## Download
3439

3540
Gradle:

README_CN.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@
2828
| ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/default_theme.png) | ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/reply_theme.png) | ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/crane_theme.png) | ![](https://raw.githubusercontent.com/rosuH/AndroidFilePicker/master/images/shrine_theme.png) |
2929

3030
## 版本兼容性
31-
支持 Android 11 及其以下所有版本。
31+
这取决于您的 targetAPI :
3232

33+
- `targetAPI <= 28`,完全没有问题 ;)
34+
- `targetAPI == 29`,请为您的项目启用 `requestLegacyExternalStorage` 特性:D
35+
- `targetAPI == 29`
36+
- 当运行于 Android 11以及以上的平台时,仅可以读取媒体文件(图片、音视频),除此均无法访问(比如PDF文档、apk 二进制文件等)
37+
38+
请参看 issue: [All About Scope Storage. ](https://github.com/rosuH/AndroidFilePicker/issues/146)
3339
## 下载使用
3440

3541
1. 在你的项目中添加依赖

filepicker/src/main/java/me/rosuh/filepicker/adapter/FileListAdapter.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package me.rosuh.filepicker.adapter
22

3-
import androidx.collection.ArraySet
4-
import androidx.recyclerview.widget.RecyclerView
3+
import android.os.Build
54
import android.view.LayoutInflater
65
import android.view.View
76
import android.view.ViewGroup
87
import android.widget.*
8+
import androidx.collection.ArraySet
9+
import androidx.recyclerview.widget.RecyclerView
910
import me.rosuh.filepicker.FilePickerActivity
1011
import me.rosuh.filepicker.R
1112
import me.rosuh.filepicker.bean.FileBean
@@ -111,6 +112,20 @@ class FileListAdapter(
111112
private val ivIcon = itemView.findViewById<ImageView>(R.id.iv_icon_list_file_picker)!!
112113
private val radioButton = itemView.findViewById<RadioButton>(R.id.rb_list_file_picker)!!
113114

115+
init {
116+
val rightId = if (config.singleChoice) {
117+
R.id.rb_list_file_picker
118+
} else {
119+
R.id.cb_list_file_picker
120+
}
121+
val params = tvFileName.layoutParams as RelativeLayout.LayoutParams
122+
params.addRule(RelativeLayout.LEFT_OF, rightId)
123+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
124+
params.addRule(RelativeLayout.START_OF, rightId)
125+
}
126+
tvFileName.layoutParams = params
127+
}
128+
114129
fun check(isCheck: Boolean) {
115130
if (config.singleChoice) {
116131
radioButton.isChecked = isCheck

0 commit comments

Comments
 (0)