Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**SelfDocumented*/
- private fun showTopTagsButtons() {
- fragment_word_wrapper_tags.visible()
- fragment_word_btn_tags_show.invisible()
- fragment_word_btn_tags_remove.invisible()
- fragment_word_wrapper_tags.requestLayout()
- fragment_word_wrapper_tags.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
- fragment_word_wrapper_tags.post {
- val height = fragment_word_wrapper_tags.measuredHeight
- fragment_word_wrapper_tags.layoutParams.height = 0
- val appearAnimator = ValueAnimator.ofInt(0, height)
- appearAnimator.duration = 250
- appearAnimator.interpolator = DecelerateInterpolator()
- appearAnimator.addUpdateListener {
- binding.fragmentWordWrapperTags.layoutParams.height = it.animatedValue as Int
- binding.fragmentWordWrapperTags.requestLayout()
- }
- appearAnimator.doOnEnd {
- fragment_word_btn_tags_show.visible()
- fragment_word_btn_tags_remove.visible()
- binding.fragmentWordWrapperTags.requestLayout()
- fragment_word_btn_tags_show.translationX = fragment_word_btn_tags_show.width.unaryMinus().toFloat()
- fragment_word_btn_tags_show.simpleTranslationXAnimation(0f, 500)
- fragment_word_btn_tags_remove.translationX = (fragment_word_btn_tags_remove.width.toFloat())
- fragment_word_btn_tags_remove.simpleTranslationXAnimation(0f, 500)
- }
- appearAnimator.start()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment