fix requestLayout() improperly called warning in AccountActivity (#1507)
This commit is contained in:
parent
8f92274e0b
commit
c35f744a17
1 changed files with 7 additions and 0 deletions
|
@ -236,11 +236,18 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
|
|
||||||
// Add a listener to change the toolbar icon color when it enters/exits its collapsed state.
|
// Add a listener to change the toolbar icon color when it enters/exits its collapsed state.
|
||||||
accountAppBarLayout.addOnOffsetChangedListener(object : AppBarLayout.OnOffsetChangedListener {
|
accountAppBarLayout.addOnOffsetChangedListener(object : AppBarLayout.OnOffsetChangedListener {
|
||||||
|
var priorOffset = 0
|
||||||
|
|
||||||
@AttrRes
|
@AttrRes
|
||||||
var priorAttribute = R.attr.account_toolbar_icon_tint_uncollapsed
|
var priorAttribute = R.attr.account_toolbar_icon_tint_uncollapsed
|
||||||
|
|
||||||
override fun onOffsetChanged(appBarLayout: AppBarLayout, verticalOffset: Int) {
|
override fun onOffsetChanged(appBarLayout: AppBarLayout, verticalOffset: Int) {
|
||||||
|
|
||||||
|
if(verticalOffset == priorOffset) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
priorOffset = verticalOffset
|
||||||
|
|
||||||
@AttrRes val attribute = if (titleVisibleHeight + verticalOffset < 0) {
|
@AttrRes val attribute = if (titleVisibleHeight + verticalOffset < 0) {
|
||||||
supportActionBar?.setDisplayShowTitleEnabled(true)
|
supportActionBar?.setDisplayShowTitleEnabled(true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue