Skip to content

Commit 4c8e423

Browse files
committed
Set gone views visible before animation start
1 parent d3e0eca commit 4c8e423

File tree

1 file changed

+10
-82
lines changed

1 file changed

+10
-82
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/toolbar/AztecToolbar.kt

Lines changed: 10 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -564,19 +564,6 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
564564

565565
buttonScaleInHtml = AnimationUtils.loadAnimation(context, R.anim.scale_in)
566566
buttonScaleInHtml.startOffset = DELAY_ANIM_IN_BUTTON_5
567-
buttonScaleInHtml.setAnimationListener(
568-
object : Animation.AnimationListener {
569-
override fun onAnimationEnd(animation: Animation) {
570-
}
571-
572-
override fun onAnimationRepeat(animation: Animation) {
573-
}
574-
575-
override fun onAnimationStart(animation: Animation) {
576-
buttonHtml.visibility = View.VISIBLE
577-
}
578-
}
579-
)
580567

581568
buttonScaleOutHtml = AnimationUtils.loadAnimation(context, R.anim.scale_out)
582569
buttonScaleOutHtml.setAnimationListener(
@@ -595,19 +582,6 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
595582

596583
buttonScaleInLink = AnimationUtils.loadAnimation(context, R.anim.scale_in)
597584
buttonScaleInLink.startOffset = DELAY_ANIM_IN_BUTTON_0
598-
buttonScaleInLink.setAnimationListener(
599-
object : Animation.AnimationListener {
600-
override fun onAnimationEnd(animation: Animation) {
601-
}
602-
603-
override fun onAnimationRepeat(animation: Animation) {
604-
}
605-
606-
override fun onAnimationStart(animation: Animation) {
607-
buttonLink.visibility = View.VISIBLE
608-
}
609-
}
610-
)
611585

612586
buttonScaleOutLink = AnimationUtils.loadAnimation(context, R.anim.scale_out)
613587
buttonScaleOutLink.setAnimationListener(
@@ -626,19 +600,6 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
626600

627601
buttonScaleInRule = AnimationUtils.loadAnimation(context, R.anim.scale_in)
628602
buttonScaleInRule.startOffset = DELAY_ANIM_IN_BUTTON_3
629-
buttonScaleInRule.setAnimationListener(
630-
object : Animation.AnimationListener {
631-
override fun onAnimationEnd(animation: Animation) {
632-
}
633-
634-
override fun onAnimationRepeat(animation: Animation) {
635-
}
636-
637-
override fun onAnimationStart(animation: Animation) {
638-
buttonRule.visibility = View.VISIBLE
639-
}
640-
}
641-
)
642603

643604
buttonScaleOutRule = AnimationUtils.loadAnimation(context, R.anim.scale_out)
644605
buttonScaleOutRule.setAnimationListener(
@@ -657,19 +618,6 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
657618

658619
buttonScaleInMore = AnimationUtils.loadAnimation(context, R.anim.scale_in)
659620
buttonScaleInMore.startOffset = DELAY_ANIM_IN_BUTTON_4
660-
buttonScaleInMore.setAnimationListener(
661-
object : Animation.AnimationListener {
662-
override fun onAnimationEnd(animation: Animation) {
663-
}
664-
665-
override fun onAnimationRepeat(animation: Animation) {
666-
}
667-
668-
override fun onAnimationStart(animation: Animation) {
669-
buttonMore.visibility = View.VISIBLE
670-
}
671-
}
672-
)
673621

674622
buttonScaleOutMore = AnimationUtils.loadAnimation(context, R.anim.scale_out)
675623
buttonScaleOutMore.setAnimationListener(
@@ -688,19 +636,6 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
688636

689637
buttonScaleInStrikethrough = AnimationUtils.loadAnimation(context, R.anim.scale_in)
690638
buttonScaleInStrikethrough.startOffset = DELAY_ANIM_IN_BUTTON_2
691-
buttonScaleInStrikethrough.setAnimationListener(
692-
object : Animation.AnimationListener {
693-
override fun onAnimationEnd(animation: Animation) {
694-
}
695-
696-
override fun onAnimationRepeat(animation: Animation) {
697-
}
698-
699-
override fun onAnimationStart(animation: Animation) {
700-
buttonStrikethrough.visibility = View.VISIBLE
701-
}
702-
}
703-
)
704639

705640
buttonScaleOutStrikethrough = AnimationUtils.loadAnimation(context, R.anim.scale_out)
706641
buttonScaleOutStrikethrough.setAnimationListener(
@@ -719,19 +654,6 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
719654

720655
buttonScaleInUnderline = AnimationUtils.loadAnimation(context, R.anim.scale_in)
721656
buttonScaleInUnderline.startOffset = DELAY_ANIM_IN_BUTTON_1
722-
buttonScaleInUnderline.setAnimationListener(
723-
object : Animation.AnimationListener {
724-
override fun onAnimationEnd(animation: Animation) {
725-
}
726-
727-
override fun onAnimationRepeat(animation: Animation) {
728-
}
729-
730-
override fun onAnimationStart(animation: Animation) {
731-
buttonUnderline.visibility = View.VISIBLE
732-
}
733-
}
734-
)
735657

736658
buttonScaleOutUnderline = AnimationUtils.loadAnimation(context, R.anim.scale_out)
737659
buttonScaleOutUnderline.setAnimationListener(
@@ -752,8 +674,8 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
752674
ellipsisSpinLeft.setAnimationListener(
753675
object : Animation.AnimationListener {
754676
override fun onAnimationEnd(animation: Animation) {
755-
buttonEllipsisExpand.visibility = View.VISIBLE
756677
buttonEllipsisCollapse.visibility = View.GONE
678+
buttonEllipsisExpand.visibility = View.VISIBLE
757679
}
758680

759681
override fun onAnimationRepeat(animation: Animation) {
@@ -774,19 +696,25 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
774696
ellipsisSpinRight.setAnimationListener(
775697
object : Animation.AnimationListener {
776698
override fun onAnimationEnd(animation: Animation) {
777-
buttonEllipsisExpand.visibility = View.GONE
778699
buttonEllipsisCollapse.visibility = View.VISIBLE
700+
buttonEllipsisExpand.visibility = View.GONE
779701
}
780702

781703
override fun onAnimationRepeat(animation: Animation) {
782704
}
783705

784706
override fun onAnimationStart(animation: Animation) {
707+
buttonLink.visibility = View.VISIBLE
785708
buttonLink.startAnimation(buttonScaleInLink)
709+
buttonUnderline.visibility = View.VISIBLE
786710
buttonUnderline.startAnimation(buttonScaleInUnderline)
711+
buttonStrikethrough.visibility = View.VISIBLE
787712
buttonStrikethrough.startAnimation(buttonScaleInStrikethrough)
713+
buttonRule.visibility = View.VISIBLE
788714
buttonRule.startAnimation(buttonScaleInRule)
715+
buttonMore.visibility = View.VISIBLE
789716
buttonMore.startAnimation(buttonScaleInMore)
717+
buttonHtml.visibility = View.VISIBLE
790718
buttonHtml.startAnimation(buttonScaleInHtml)
791719
}
792720
}
@@ -854,8 +782,8 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
854782
// TODO: Uncomment when Page Break is to be added back as a feature.
855783
// buttonPage.visibility = View.GONE
856784
buttonHtml.visibility = View.GONE
857-
buttonEllipsisExpand.visibility = View.VISIBLE
858785
buttonEllipsisCollapse.visibility = View.GONE
786+
buttonEllipsisExpand.visibility = View.VISIBLE
859787
}
860788

861789
private fun showExpandedToolbar() {
@@ -867,8 +795,8 @@ class AztecToolbar : FrameLayout, OnMenuItemClickListener {
867795
// TODO: Uncomment when Page Break is to be added back as a feature.
868796
// buttonPage.visibility = View.VISIBLE
869797
buttonHtml.visibility = View.VISIBLE
870-
buttonEllipsisExpand.visibility = View.GONE
871798
buttonEllipsisCollapse.visibility = View.VISIBLE
799+
buttonEllipsisExpand.visibility = View.GONE
872800
}
873801

874802
private fun toggleHtmlMode(isHtmlMode: Boolean) {

0 commit comments

Comments
 (0)