Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,16 @@ private HashMap<String, HashMap<String, Integer>> getStatusMap(ConnectJobRecord
return statusMap;
}


/**
* This was added to re-calculate the correct height of a fragment in ViewPager2. This is required as ViewPager2
* has bug currently due to which it's not calculating the height of it's different fragment correctly.
* When found some other solution for this ViewPager2 bug, we can remove this but make sure to QA
* by pressing sync button while in different fragments.
*/
@Override
public void onResume() {
super.onResume();
binding.getRoot().requestLayout();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jignesh-dimagi can you proide a technical description of the root cause in the PR description along with how this fixes this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shubham1g5 There seems some issue with ViewPager2 in calculating the dynamic height after the data are reloaded, it requires some kind of recalculation, may be this is the one way to do that. This works here but not sure if this is the best way.

Copy link
Contributor

@shubham1g5 shubham1g5 Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, can we add a code comment here for this, for someone looking at this code to know this is due to a viewpager 2 bug and if we remove it what exactly should we be testing to make sure the removal is safe.

}
}