2017-02-17 52 views
0

我試圖製作一個android FAB動畫工具欄。我使用這個例子https://github.com/vpaliyX/FAB-Toolbar-Example來檢查它是如何工作的,但我注意到一件奇怪的事情。克隆示例中的AnimatorSet類看起來很好,但是當我試圖在我的項目中打開它時,我已經得到了這個。這是執行還是進口問題?AnimatorSet class 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

您的IDE正在反編譯框架類('android.animation.AnimatorSet')。真正的實現在運行時鏈接(例如,[7.1.1的版本](https://github.com/android/platform_frameworks_base/blob/android-7.1.1_r22/core/java/android/animation/AnimatorSet.java) )。 – CommonsWare

+0

那麼它在這種情況下是否正確?奇怪的是,在一個項目中,它反編譯課程,但在其他項目中沒有。 – Expiredmind

+0

「有什麼奇怪的是,在一個項目中反編譯類,但在另一個項目中」 - 您可能沒有從SDK Manager中下載所有Android版本的源代碼。 – CommonsWare

回答

0

如果您希望查看android框架類的來源,那麼您需要從SDK管理器中下載它們。 打開SDK管理器,找「Android的源代碼x」,其中x是您正在開發並下載的Android版本。