简体   繁体   English

他们怎么做到的? 动画抽屉旋转可能吗?

[英]How do they do this? animated drawer rotation possible?

How do they do this? 他们怎么做到的? animated drawer rotation possible? 动画抽屉旋转可能吗?

In the screenshots below, touching the 'Touch' circle at the bottom causes that circle to rotate around itself, and then 4 new navigation buttons come out that take me to other screens/activities in the app. 在下面的屏幕截图中,触摸底部的“触摸”圆圈会导致该圆圈绕自身旋转,然后出现4个新的导航按钮,这些按钮会将我带到应用程序中的其他屏幕/活动。 I really want to have this in my app.. 我真的很想在我的应用程序中使用它。

Is it a sliding drawer or some other strategy? 是滑动抽屉还是其他策略? BTW I am targeting android version 2.1 顺便说一句我瞄准了Android 2.1版

开始

中间

下一个

然后

西恩

结束

It looks as if it's mainly a animation that rotates an image. 看起来好像主要是旋转图像的动画。 Once the animation has finished, the buttons are activated. 动画完成后,将激活按钮。

ImageView discsAndButtons = (ImageView) findViewById(R.id.discsAndButtons);

Animation anim = new RotateAnimation(0.0f, 90.0f, 0.0f, 480.0f);
anim.setDuration(600);
anim.setFillAfter(true);
anim.setAnimationListener(this);

discsAndButtons.setAnimation(anim);

...

void onAnimationEnd(Animation animation) {
   ViewGroup buttonLayer = (ViewGroup) findViewById(R.id.buttonLayer);
   buttonLayer.setVisibility(View.VISIBLE);
}

Visually, the buttons are part of the image. 在视觉上,按钮是图像的一部分。 But the effective buttons are probably on a separate layer above the image and only made visible after the animation has finished (except for the TOUCH button). 但是有效按钮可能位于图像上方的单独图层上,并且仅在动画结束后才可见(“ 触摸”按钮除外)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM