반응형
https://developer.android.com/develop/ui/views/appwidgets/overview
- Layout considerations
It's tempting to lay out your widgets according to the dimensions of the placement grid of a device that you develop with. This can be a useful initial approximation, but keep the following points in mind:
- Planning your widget resizing strategy across "size buckets" rather than variable grid dimensions gives you the most reliable results.
- The number, size, and spacing of cells can vary widely from device to device. Hence, it is very important that your widget is flexible and can accommodate more or less space than anticipated.
- As the user resizes a widget, the system responds with a dp size range in which your widget can redraw itself.
- Starting in Android 12, you can provide more refined size attributes and more flexible layouts. This includes:
- Specifying widget size constraints. For example, you can specify the target size for your widget—in grid cells—as well as the maximum possible size.
- Providing responsive layouts, which change depending on the size of the widget.
- Providing exact-size layouts, which let the launcher respond with size options for portrait and landscape mode, for phones, or with four sizes for foldables.
- Using updated guidance and new APIs to determine proper sizes for your widget.
반응형
'Android' 카테고리의 다른 글
Single Live Event란 + 사용방법 (0) | 2023.06.12 |
---|---|
Android Compose에서 dimens.xml 리소스 사용하는 방법 (0) | 2023.06.10 |
Android Compose에서 LiveData 대신 State, Flow 써야하는 이유 (0) | 2023.05.26 |
Android 잠금화면 lockscreen 만드는 방법 (0) | 2023.05.20 |
Android MutableData와 LiveData의 차이점 (0) | 2023.05.19 |
댓글