Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android L ViewAnimationUtils not found?

I've been testing the Android L SDK, and trying to get to know the new Material design and view animations.

Specifically I want to try to get the Reveal Effect working properly, but the class is missing.

http://developer.android.com/preview/material/animations.html#reveal

The specific line that fails me is

ValueAnimator anim =
ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);

The ViewAnimationUtils class is missing - or am I missing some dependencies?

EDIT: For targetSDK, minSDK and compileSDK, I have these settings in my build.gradle file.

compileSdkVersion 'android-L'
buildToolsVersion '20.0.0'
defaultConfig {
    minSdkVersion 'L'
    targetSdkVersion 'L'
    versionCode 1
    versionName '1.0'
}
like image 821
hnilsen Avatar asked Jun 26 '14 23:06

hnilsen


1 Answers

Just compile against L and add the following.

import android.view.ViewAnimationUtils;

As I commented above this looks like a bug in the Android studio release. Android Studio reports the error, but the app still runs.

like image 63
Robert Karl Avatar answered Sep 21 '22 03:09

Robert Karl