lucky1928
lucky1928

Reputation: 8905

How to animate button in android with flip effect?

I want to animate a button in android just like flip a board, one side is black and another side is green.

I can see some answer just like a rotate effect but it's not like a flip effect. I don't want to do such simple take with OpenGL.

Below shake.xml doesn't work for me:

<?xml version="1.0" encoding="utf-8"?>
    <rotate xmlns:android="http://schemas.android.com/apk/res/android"
        android:duration="100"
        android:fromDegrees="-5"
        android:pivotX="50%"
        android:pivotY="50%"
        android:repeatCount="10"
        android:repeatMode="reverse"
        android:toDegrees="5" />

Upvotes: 2

Views: 302

Answers (1)

caowenhua
caowenhua

Reputation: 169

You can use like view.animate()...(here set your animation).setDuration(100).start(); But it need api larger than 13.

Upvotes: 1

Related Questions