Assigned
Status Update
Comments
na...@vinted.com <na...@vinted.com> #2
I face with the same problem. I have different pageMargin in landscape and portrait and when viewpager is scrolled for the more than first position, after rotating device it is shifted.
I beleive the problem is inside onSizeChanged that is called after onConfigurationChanged, it has following code:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
w always not equals oldw when changing orientation, so recomputeScrollPosition is called, but whit the same values for margin and oldMargin.
This should be fixed.
I beleive the problem is inside onSizeChanged that is called after onConfigurationChanged, it has following code:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
w always not equals oldw when changing orientation, so recomputeScrollPosition is called, but whit the same values for margin and oldMargin.
This should be fixed.
Description
I am using Appium for the automation tests, however, I am facing an issue with the custom `androidx.appcompat.widget.Toolbar` view where I am setting the menu items with the itemId (`Menu.add(..., itemId = ..., ...)`) as an example below.
```
(subMenuItem ?: menu).add(
groupId = Menu.NONE,
itemId =
order = Menu.NONE,
title = item.title
)
```
where:
`menu = toolbar.menu`
and
```
subMenuItem = menu.addSubMenu(
groupId = Menu.NONE,
itemId = R.id.my_toolbar_submenu_item,
order = Menu.NONE,
title = null
)
```
The problem is that when the subMenu doesn't exist (no three dots menu option action - the single right action) it works as expected and the itemId is presented as an ID in the view hierarchy, however, when the subMenu exists (popup after the three dots are pressed) itemId doesn't present anything and the view with the ID doesn't exists. With that in mind, Appium fails to identify items, since they have completely the same ID. I know itemId should not present the view id, but why then it work okay when subMenu doesn't exist and the itemId presents the view ID?
A similar issue was tracked years ago here but closed without any notice: