Code example for WeakHashMap

Methods: get, put

0
    private AnimatorProxy(AnimatorProxyImpl impl) {
        mImpl = impl;
    } 
 
    public static AnimatorProxy create(View view) {
        AnimatorProxy proxy = PROXIES.get(view);
        boolean needsAnimationProxy = (Build.VERSION.SDK_INT < 11);
 
        // If the view's animation proxy has been overridden from somewhere else, we need to 
        // create a new AnimatorProxy for the view. 
        if (proxy == null || (needsAnimationProxy && proxy.mImpl != view.getAnimation())) {
            AnimatorProxyImpl impl = (needsAnimationProxy ? new AnimatorProxyPreHC(view) :
                                                            new AnimatorProxyPostHC(view));
 
            proxy = new AnimatorProxy(impl);
            PROXIES.put(view, proxy);
        } 
 
        return proxy;
    }