LuckSiege / LuckSiege/PictureSelector
图片列表 item 宽高动态设置而不是默认的200
- Dominant language
- Java
- Stars
- 13.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Current use version?
#### 当前使用的版本是多少?
```
api 27 - 32
```
## Will this problem occur in demo?
#### Demo能否复现这问题?
```
可以
```
## Describe the problem or provide an error log?
#### 描述问题或提供错误log?
```
现在图片列表单张图片宽高默认为200,有的设备,例如平板上显示的时候会很模糊,
是否可以根据设备尺寸动态设置呢?
我给出的方案为:
`val wm = mContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
if(width == 0){
width = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
val size = Point()
wm.defaultDisplay.getSize(size)
size.x /4
} else {
wm.defaultDisplay.width / 4
}
}`
这里的 4 表示单行显示的图片个数
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Android image-list item sizing entry point and review how the default width and height of 200 are applied. Check the proposed screen-width calculation across API 27–32 and tablet-sized devices, using the demo to verify the result. Done means image dimensions adapt to the screen and the configured four items per row without becoming blurry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100