首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RippleDrawable的源代码在哪里?(Android L)

RippleDrawable的源代码在哪里?(Android L)
EN

Stack Overflow用户
提问于 2014-09-27 14:28:21
回答 1查看 596关注 0票数 1

我正在寻找RippleDrawable的源代码,这里提到了https://developer.android.com/preview/material/animations.html#touch

事实上,它必须退出,因为它在Android中用于纹章动画。

但是,也许是我的错,我找不到它.

谢谢你的帮助。

这就是我发现的解压缩android.jar:-(()

代码语言:javascript
复制
public class RippleDrawable extends LayerDrawable
{
public RippleDrawable(Drawable content, Drawable mask)
{
super((Drawable[])null); throw new RuntimeException("Stub!"); } 
public void setAlpha(int alpha) { throw new RuntimeException("Stub!"); } 
public void setColorFilter(ColorFilter cf) { throw new RuntimeException("Stub!"); } 
public int getOpacity() { throw new RuntimeException("Stub!"); } 
protected boolean onStateChange(int[] stateSet) { throw new RuntimeException("Stub!"); } 
protected void onBoundsChange(Rect bounds) { throw new RuntimeException("Stub!"); } 
public boolean setVisible(boolean visible, boolean restart) { throw new RuntimeException("Stub!"); } 
public boolean isStateful() { throw new RuntimeException("Stub!"); } 
public void setColor(ColorStateList color) { throw new RuntimeException("Stub!"); } 
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs,   Resources.Theme theme) throws XmlPullParserException, IOException { throw new   RuntimeException("Stub!"); } 
public boolean setDrawableByLayerId(int id, Drawable drawable) { throw new RuntimeException("Stub!"); } 
public void setPaddingMode(int mode) { throw new RuntimeException("Stub!"); } 
public void applyTheme(Resources.Theme t) { throw new RuntimeException("Stub!"); } 
public boolean canApplyTheme() { throw new RuntimeException("Stub!"); } 
public void setHotspot(float x, float y) { throw new RuntimeException("Stub!"); } 
public void setHotspotBounds(int left, int top, int right, int bottom) { throw new RuntimeException("Stub!"); } 
public void draw(Canvas canvas) { throw new RuntimeException("Stub!"); } 
public Rect getDirtyBounds() { throw new RuntimeException("Stub!"); } 
public Drawable.ConstantState getConstantState() { throw new RuntimeException("Stub!");        }

}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-27 15:20:15

要理解这是如何工作的,您需要在头脑中分离构建和运行环境。

为了构建您的程序,您只需要根据Android的定义构建。谷歌发布的android.jar只包含定义API的存根。例如,API库中有许多用"@hide“注释标记的公共方法。这些方法根本没有被放入android.jar中。另外,正如您已经注意到的,大多数方法的主体只是抛出运行时异常。

android.jar文件不是应用程序的一部分。在运行时,您的应用程序绑定到一个真正的Android库,安装在手机上。它包括各种API方法的实际实现。

运行时可用的代码可以在AOSP项目中找到。

不幸的是,谷歌还没有放弃L代码。除非从启用L的设备中提取android库,然后重新编译,否则就无法看到RippleDrawable的代码。

令人扫兴!

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26075662

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档