2017-02-17 3 views
0

J'ai essayé de créer une barre d'outils d'animation Android. J'utilisais cet exemple https://github.com/vpaliyX/FAB-Toolbar-Example pour vérifier comment cela fonctionne, mais je remarque une chose étrange. La classe AnimatorSet dans l'exemple cloné semble très bien mais quand j'essaie de l'ouvrir dans mon projet, j'ai ceci. C'est le problème de la mise en œuvre ou de l'importation?Classe AnimatorSet return RuntimeException ("Stub!")

package android.animation; 

import android.animation.Animator; 
import android.animation.TimeInterpolator; 
import java.util.ArrayList; 
import java.util.Collection; 
import java.util.List; 

public final class AnimatorSet extends Animator { 
    public AnimatorSet() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void playTogether(Animator... items) { 
     throw new RuntimeException("Stub!"); 
    } 

    public void playTogether(Collection<Animator> items) { 
     throw new RuntimeException("Stub!"); 
    } 

    public void playSequentially(Animator... items) { 
     throw new RuntimeException("Stub!"); 
    } 

    public void playSequentially(List<Animator> items) { 
     throw new RuntimeException("Stub!"); 
    } 

    public ArrayList<Animator> getChildAnimations() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void setTarget(Object target) { 
     throw new RuntimeException("Stub!"); 
    } 

    public void setInterpolator(TimeInterpolator interpolator) { 
     throw new RuntimeException("Stub!"); 
    } 

    public TimeInterpolator getInterpolator() { 
     throw new RuntimeException("Stub!"); 
    } 

    public AnimatorSet.Builder play(Animator anim) { 
     throw new RuntimeException("Stub!"); 
    } 

    public void cancel() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void end() { 
     throw new RuntimeException("Stub!"); 
    } 

    public boolean isRunning() { 
     throw new RuntimeException("Stub!"); 
    } 

    public boolean isStarted() { 
     throw new RuntimeException("Stub!"); 
    } 

    public long getStartDelay() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void setStartDelay(long startDelay) { 
     throw new RuntimeException("Stub!"); 
    } 

    public long getDuration() { 
     throw new RuntimeException("Stub!"); 
    } 

    public AnimatorSet setDuration(long duration) { 
     throw new RuntimeException("Stub!"); 
    } 

    public void setupStartValues() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void setupEndValues() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void pause() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void resume() { 
     throw new RuntimeException("Stub!"); 
    } 

    public void start() { 
     throw new RuntimeException("Stub!"); 
    } 

    public AnimatorSet clone() { 
     throw new RuntimeException("Stub!"); 
    } 

    public String toString() { 
     throw new RuntimeException("Stub!"); 
    } 

    public long getTotalDuration() { 
     throw new RuntimeException("Stub!"); 
    } 

    public class Builder { 
     Builder() { 
      throw new RuntimeException("Stub!"); 
     } 

     public AnimatorSet.Builder with(Animator anim) { 
      throw new RuntimeException("Stub!"); 
     } 

     public AnimatorSet.Builder before(Animator anim) { 
      throw new RuntimeException("Stub!"); 
     } 

     public AnimatorSet.Builder after(Animator anim) { 
      throw new RuntimeException("Stub!"); 
     } 

     public AnimatorSet.Builder after(long delay) { 
      throw new RuntimeException("Stub!"); 
     } 
    } 
} 
+0

Votre IDE décompile une classe de structure ('android.animation.AnimatorSet'). L'implémentation réelle est liée au moment de l'exécution (par exemple, la version [7.1.1] (https://github.com/android/platform_frameworks_base/blob/android-7.1.1_r22/core/java/android/animation/AnimatorSet.java)). – CommonsWare

+0

Donc, c'est correct dans ce cas? Ce qui est bizarre, c'est que dans un projet il décompile la classe mais dans l'autre pas. – Expiredmind

+0

"C'est bizarre, dans un projet de décompiler une classe mais pas dans l'autre" - vous n'avez peut-être pas téléchargé le code source de toutes les versions d'Android à partir de votre SDK Manager. – CommonsWare

Répondre

0

Si vous souhaitez voir les sources des classes d'infrastructure android, vous devez les télécharger depuis le gestionnaire SDK. Ouvrez le gestionnaire SDK, recherchez "sources pour Android x" où x est la version android que vous développez et téléchargez.