Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio XML does not recognize objectAnimator

Tags:

I have been trying to animate a transition between two fragments. I had originally placed them a property animations in xml (and that didn't really work), then changed it to objectAnimator. For some reason Android Studio is not recognizing the objectAnimator tag.

here is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.example.nick.randomapplication" >      <application         android:allowBackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name"         android:theme="@style/Theme.Base.AppCompat.Light" >         <activity             android:name=".MainActivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                     <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>  </manifest> 

my build.Gradle:

apply plugin: 'com.android.application'  android {     compileSdkVersion 20     buildToolsVersion "20.0.0"      defaultConfig {         applicationId "com.example.nick.randomapplication"         minSdkVersion 19         targetSdkVersion 20         versionCode 1         versionName "1.0"     }     buildTypes {         release {             runProguard false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     compile fileTree(dir: 'libs', include: ['*.jar'])     compile "com.android.support:appcompat-v7:20.0.+" } 

and the xml file:

<?xml version="1.0" encoding="utf-8"?> <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"> </objectAnimator> 

Thank you for taking your time to look at this. I'm not sure what to do anymore.

like image 968
FutureProg Avatar asked Aug 04 '14 23:08

FutureProg


People also ask

What is Property animation?

A property animation changes a property's (a field in an object) value over a specified length of time. To animate something, you specify the object property that you want to animate, such as an object's position on the screen, how long you want to animate it for, and what values you want to animate between.

Which of the following options helps you to hold a time value pair for animation in Android?

Which of the following options helps you to hold a time value pair for animation in Android? ValueAnimator provides a timing engine for running animation which calculates the animated values and set them on the target objects.

What are the two different types of view animation property animation and tween animation?

There are two types of animations that you can do with the view animation framework: Tween animation: Creates an animation by performing a series of transformations on a single image with an Animation. Frame animation: or creates an animation by showing a sequence of images in order with an AnimationDrawable .


1 Answers

I think you have placed the xml file in a wrong folder.

valueAnimator objectAnimator and animatorSet resources should be in the folder res/animator, not in res/anim.

please visit android developer for more information. http://developer.android.com/guide/topics/resources/animation-resource.html

like image 163
justqb Avatar answered Oct 20 '22 10:10

justqb