gzu-liyujiang / gzu-liyujiang/AndroidPicker

TimeMode设置为None时,DatimeWheelLayout显示内容无法居中

Open
#333 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

```
AndroidView(
modifier = Modifier
.fillMaxWidth()
.height(222.dp),
factory = {
val view = DatimeWheelLayout(it)

view.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)

view.setDateMode(DateMode.YEAR_MONTH_DAY)
view.setTimeMode(TimeMode.NONE)
view.setDateFormatter(UnitDateFormatter())
view.setRange(DatimeEntity.now(), DatimeEntity.monthOnFuture(3))
view
},
)
```

我打算只选择年月日,按照代码设置之后,显示的内容无法撑满宽度,如果不设置TimeMode,就会显示时、分,请问如何解决呢?版本4.1.11
![image](https://user-images.githubusercontent.com/24470901/221764407-bca3c86c-b174-4bd5-90b8-1d4056f92de7.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue from the provided AndroidView setup using DatimeWheelLayout, DateMode.YEAR_MONTH_DAY, and TimeMode.NONE. Start at DatimeWheelLayout's date/time mode and layout-sizing logic, then verify that date-only content is centered and uses the available width without showing hour or minute columns.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.