Example #1
0
 internal NinePatchState(android.graphics.drawable.NinePatchDrawable.NinePatchState
                         state)
 {
     mNinePatch = new android.graphics.NinePatch(state.mNinePatch);
     // Note we don't copy the padding because it is immutable.
     mPadding = state.mPadding;
     mDither  = state.mDither;
     mChangingConfigurations = state.mChangingConfigurations;
     mTargetDensity          = state.mTargetDensity;
 }
Example #2
0
 public override android.graphics.drawable.Drawable mutate()
 {
     if (!mMutated && base.mutate() == this)
     {
         mNinePatchState = new android.graphics.drawable.NinePatchDrawable.NinePatchState(
             mNinePatchState);
         mNinePatch = mNinePatchState.mNinePatch;
         mMutated   = true;
     }
     return(this);
 }
Example #3
0
        internal void setNinePatchState(android.graphics.drawable.NinePatchDrawable.NinePatchState
                                        state, android.content.res.Resources res)
        {
            mNinePatchState = state;
            mNinePatch      = state.mNinePatch;
            mPadding        = state.mPadding;
            mTargetDensity  = res != null?res.getDisplayMetrics().densityDpi : state.mTargetDensity;

            //noinspection PointlessBooleanExpression
            if (state.mDither != DEFAULT_DITHER)
            {
                // avoid calling the setter unless we need to, since it does a
                // lazy allocation of a paint
                setDither(state.mDither);
            }
            if (mNinePatch != null)
            {
                computeBitmapSize();
            }
        }
Example #4
0
		internal void setNinePatchState(android.graphics.drawable.NinePatchDrawable.NinePatchState
			 state, android.content.res.Resources res)
		{
			mNinePatchState = state;
			mNinePatch = state.mNinePatch;
			mPadding = state.mPadding;
			mTargetDensity = res != null ? res.getDisplayMetrics().densityDpi : state.mTargetDensity;
			//noinspection PointlessBooleanExpression
			if (state.mDither != DEFAULT_DITHER)
			{
				// avoid calling the setter unless we need to, since it does a
				// lazy allocation of a paint
				setDither(state.mDither);
			}
			if (mNinePatch != null)
			{
				computeBitmapSize();
			}
		}
Example #5
0
		public override android.graphics.drawable.Drawable mutate()
		{
			if (!mMutated && base.mutate() == this)
			{
				mNinePatchState = new android.graphics.drawable.NinePatchDrawable.NinePatchState(
					mNinePatchState);
				mNinePatch = mNinePatchState.mNinePatch;
				mMutated = true;
			}
			return this;
		}
Example #6
0
 internal NinePatchDrawable(android.graphics.drawable.NinePatchDrawable.NinePatchState
                            state, android.content.res.Resources res)
 {
     setNinePatchState(state, res);
 }