fix requestLayout() improperly called warning in AccountActivity (#1507)

main
Konrad Pozniak 5 years ago committed by GitHub
parent 89eb1e2987
commit e776488a1b
  1. 7
      app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt

@ -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.
accountAppBarLayout.addOnOffsetChangedListener(object : AppBarLayout.OnOffsetChangedListener {
var priorOffset = 0
@AttrRes
var priorAttribute = R.attr.account_toolbar_icon_tint_uncollapsed
override fun onOffsetChanged(appBarLayout: AppBarLayout, verticalOffset: Int) {
if(verticalOffset == priorOffset) {
return
}
priorOffset = verticalOffset
@AttrRes val attribute = if (titleVisibleHeight + verticalOffset < 0) {
supportActionBar?.setDisplayShowTitleEnabled(true)

Loading…
Cancel
Save