I have a question about Material Design.

Asked 2 years ago, Updated 2 years ago, 23 views

Hello.

https://material.google.com/motion/transforming-material.html#

What I want to implement is correctangle transforming in this part.

This is the Symmetric transformation part.

I want to implement something that naturally expands when I click on a widget.

I wonder if basic support is available in the design support library or if it needs to be implemented.

android

2022-09-22 13:38

1 Answers

Expanding both width and height at the same time can be implemented simply using the ScaleAnimation class. Test by putting the code below in the click listener of a specific view.

ScaleAnimation scaleAnimation = new ScaleAnimation(1f, 2f, 1f, 2f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setDuration(300);
scaleAnimation.setFillAfter(true);
view.startAnimation(scaleAnimation);

ScaleAnimation


2022-09-22 13:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.