Skip to content

Commit

Permalink
UI bug fix and doc update. (#169)
Browse files Browse the repository at this point in the history
* 🐛

[Fix]
- item file name overlay in single choice mode.

* ✏️

update doc.
  • Loading branch information
rosuH committed Feb 13, 2022
1 parent d903492 commit d779f18
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ Well, it doesn't have a name like Rocky, Cosmos or Fish. Android File Picker, li
| ![](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) |

## Version Compatibility
It depends on your targetAPI.

Support Android 11 and all versions below.
- `targetAPI <= 28`, no problem at all ;)
- `targetAPI == 29`, please enable `requestLegacyExternalStorage` feature for your project : D
- `targetAPI == 29`
- 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.)

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

Gradle:
Expand Down
8 changes: 7 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
| ![](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) |

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

- `targetAPI <= 28`,完全没有问题 ;)
- `targetAPI == 29`,请为您的项目启用 `requestLegacyExternalStorage` 特性:D
- `targetAPI == 29`
- 当运行于 Android 11以及以上的平台时,仅可以读取媒体文件(图片、音视频),除此均无法访问(比如PDF文档、apk 二进制文件等)

请参看 issue: [All About Scope Storage. ](https://github.com/rosuH/AndroidFilePicker/issues/146)
## 下载使用

1. 在你的项目中添加依赖
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package me.rosuh.filepicker.adapter

import androidx.collection.ArraySet
import androidx.recyclerview.widget.RecyclerView
import android.os.Build
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.collection.ArraySet
import androidx.recyclerview.widget.RecyclerView
import me.rosuh.filepicker.FilePickerActivity
import me.rosuh.filepicker.R
import me.rosuh.filepicker.bean.FileBean
Expand Down Expand Up @@ -111,6 +112,20 @@ class FileListAdapter(
private val ivIcon = itemView.findViewById<ImageView>(R.id.iv_icon_list_file_picker)!!
private val radioButton = itemView.findViewById<RadioButton>(R.id.rb_list_file_picker)!!

init {
val rightId = if (config.singleChoice) {
R.id.rb_list_file_picker
} else {
R.id.cb_list_file_picker
}
val params = tvFileName.layoutParams as RelativeLayout.LayoutParams
params.addRule(RelativeLayout.LEFT_OF, rightId)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
params.addRule(RelativeLayout.START_OF, rightId)
}
tvFileName.layoutParams = params
}

fun check(isCheck: Boolean) {
if (config.singleChoice) {
radioButton.isChecked = isCheck
Expand Down

0 comments on commit d779f18

Please sign in to comment.