Code example for WeakReference

Methods: get

0
        return mAlpha;
    } 
    public void setAlpha(float alpha) {
        if (mAlpha != alpha) {
            mAlpha = alpha;
            View view = mView.get();
            if (view != null) {
                view.invalidate();
            } 
        } 
    } 
    public float getScaleX() { 
        return mScaleX;
    } 
    public void setScaleX(float scaleX) {
        if (mScaleX != scaleX) {
            prepareForUpdate(); 
            mScaleX = scaleX;
            invalidateAfterUpdate(); 
        } 
    }