element-android
element-android copied to clipboard
replace android:gravity for backward compatibility
Type of change
- [ ] Feature
- [x] Bugfix
- [ ] Technical
- [ ] Other :
Content
Hello,
I found an issue induced by android:gravity
in https://github.com/vector-im/element-android/blob/81897a179e4cbd836c97f86a207d14c84ff85151/vector/src/main/res/drawable/poll_option_checked.xml#L13
This attribute can only be used in layer-list starting from API Level 23. Therefore the padding of the icon is wrong.
This issue can be reproduced when I participate a vote in the chat. You can see the tick is full of the icon at API Level 22.
API Level 31
API Level 22
To fix this issue, I use android:top
, android:bottom
, android:left
and android:right
. 2dp is set by considering the 16dp width and height of tick mark and 20dp width and height of the whole icon. The issue have gone on my side.
Hope the above information is useful
Tested devices
- [ ] Physical
- [ ] Emulator
- OS version(s):
Checklist
- [x ] Changes has been tested on an Android device or Android emulator with API 21
- [x ] UI change has been tested on both light and dark themes
- [x ] Accessibility has been taken into account. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#accessibility
- [x ] Pull request is based on the develop branch
- [x ] Pull request includes a new file under ./changelog.d. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog
- [x ] Pull request includes screenshots or videos if containing UI changes
- [x ] Pull request includes a sign off
- [x ] You've made a self review of your PR
- [x ] If you have modified the screen flow, or added new screens to the application, you have updated the test UiAllScreensSanityTest.allScreensTest()