title: Scaling Button Animation in Jetpack Compose
body: <p>I want to build this awesome button animation pressed from the AirBnB App with Jetpack Compose
  <img src="https://i.stack.imgur.com/QsY0m.gif" alt="1" /></p>
  <p>Unfortunately, the Animation/Transition API was changed recently and there's almost no documentation for it. Can someone help me get the right approach to implement this button press animation?</p>
  <p><strong>Edit</strong>
  Based on @Amirhosein answer I have developed a button that looks almost exactly like the Airbnb example</p>
  <p>Code:</p>
  <pre><code>@Composable
  fun AnimatedButton() {
      val boxHeight = animatedFloat(initVal = 50f)
      val relBoxWidth = animatedFloat(initVal = 1.0f)
      val fontSize = animatedFloat(initVal = 16f)
  
      fun animateDimensions() {
          boxHeight.animateTo(45f)
          relBoxWidth.animateTo(0.95f)
         // fontSize.animateTo(14f)
      }
  
      fun reverseAnimation() {
          boxHeight.animateTo(50f)
          relBoxWidth.animateTo(1.0f)
          //fontSize.animateTo(16f)
      }
  
          Box(
          modifier = Modifier
              .height(boxHeight.value.dp)
              .fillMaxWidth(fraction = relBoxWidth.value)
  
              .clip(RoundedCornerShape(8.dp))
              .background(Color.Black)
              .clickable { }
              .pressIndicatorGestureFilter(
                  onStart = {
                      animateDimensions()
                  },
                  onStop = {
                      reverseAnimation()
                  },
                  onCancel = {
                      reverseAnimation()
                  }
              ),
          contentAlignment = Alignment.Center
      ) {
          Text(text = &quot;Explore Airbnb&quot;, fontSize = fontSize.value.sp, color = Color.White)
      }
  }
  
  </code></pre>
  <p>Video:</p>
  <p><img src="https://i.stack.imgur.com/CZmtS.gif" alt="2" /></p>
  <p>Unfortunately, I cannot figure out how to animate the text correctly as It looks very bad currently</p>