Blankj / Blankj/AndroidUtilCode
barutils
- Dominant language
- Java
- Stars
- 33.6k
- Forks
- 10.6k
- PR merge metrics
- No merged PRs in 30d
Description
测试机手机:oppo Reno Ace
系统版本: android 11
场景:用户角色变化 viewpager切换fragment之后这句话:在第四个tab没有效果 。切换之前第四个tab同样写法有效果(onresume延迟执行也没有效果)_BarUtils.addMarginTopEqualStatusBarHeight(binding.rlTitle)_ 需要加上 setlayoutparams
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) binding.rlTitle1.getLayoutParams();
layoutParams.setMargins(layoutParams.leftMargin,
layoutParams.topMargin + BarUtils.getStatusBarHeight(),
layoutParams.rightMargin,
layoutParams.bottomMargin);
binding.rlTitle1.setLayoutParams(layoutParams);加上这句话就有效果了,
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the BarUtils.addMarginTopEqualStatusBarHeight entry point and reproduce the reported behavior on Android 11 with an Oppo Reno Ace after switching the user role and ViewPager fragment. Compare that behavior with the explicit MarginLayoutParams and setLayoutParams workaround shown in the issue. Done means the utility applies the expected top margin in the fourth tab without requiring the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100