Guest User

Untitled

a guest
Jan 6th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. /**SelfDocumented*/
  2. private fun showTopTagsButtons() {
  3. fragment_word_wrapper_tags.visible()
  4. fragment_word_btn_tags_show.invisible()
  5. fragment_word_btn_tags_remove.invisible()
  6.  
  7. fragment_word_wrapper_tags.requestLayout()
  8. fragment_word_wrapper_tags.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
  9.  
  10. fragment_word_wrapper_tags.post {
  11. val height = fragment_word_wrapper_tags.measuredHeight
  12.  
  13. fragment_word_wrapper_tags.layoutParams.height = 0
  14.  
  15. val appearAnimator = ValueAnimator.ofInt(0, height)
  16. appearAnimator.duration = 250
  17. appearAnimator.interpolator = DecelerateInterpolator()
  18. appearAnimator.addUpdateListener {
  19. binding.fragmentWordWrapperTags.layoutParams.height = it.animatedValue as Int
  20. binding.fragmentWordWrapperTags.requestLayout()
  21. }
  22.  
  23. appearAnimator.doOnEnd {
  24. fragment_word_btn_tags_show.visible()
  25. fragment_word_btn_tags_remove.visible()
  26. binding.fragmentWordWrapperTags.requestLayout()
  27.  
  28. fragment_word_btn_tags_show.translationX = fragment_word_btn_tags_show.width.unaryMinus().toFloat()
  29. fragment_word_btn_tags_show.simpleTranslationXAnimation(0f, 500)
  30.  
  31. fragment_word_btn_tags_remove.translationX = (fragment_word_btn_tags_remove.width.toFloat())
  32. fragment_word_btn_tags_remove.simpleTranslationXAnimation(0f, 500)
  33. }
  34.  
  35. appearAnimator.start()
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment