当前位置: 首页>>代码示例>>C#>>正文


C# Drawables.Drawable类代码示例

本文整理汇总了C#中Android.Graphics.Drawables.Drawable的典型用法代码示例。如果您正苦于以下问题:C# Drawable类的具体用法?C# Drawable怎么用?C# Drawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Drawable类属于Android.Graphics.Drawables命名空间,在下文中一共展示了Drawable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BezelImageView

	    public BezelImageView(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle)
		{
			// Attribute initialization
	        var a = context.ObtainStyledAttributes(attrs, Resource.Styleable.BezelImageView, defStyle, 0);
	
	        mMaskDrawable = a.GetDrawable(Resource.Styleable.BezelImageView_maskDrawable);
	        if (mMaskDrawable == null) {
	            mMaskDrawable = Resources.GetDrawable(Resource.Drawable.bezel_mask);
	        }
	        mMaskDrawable.Callback = this;
	
	        mBorderDrawable = a.GetDrawable(Resource.Styleable.BezelImageView_borderDrawable);
	        if (mBorderDrawable == null) {
	            mBorderDrawable = Resources.GetDrawable(Resource.Drawable.bezel_border);
	        }
	        mBorderDrawable.Callback = this;
	
	        a.Recycle();
	
	        // Other initialization
	        mMaskedPaint = new Paint();
	        mMaskedPaint.SetXfermode(new PorterDuffXfermode(PorterDuff.Mode.SrcAtop));
	
	        mCopyPaint = new Paint();
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:25,代码来源:BezelImageView.cs

示例2: InitializeFields

 private void InitializeFields()
 {
     _errorDrawable = Resources.GetDrawable (Android.Resource.Drawable.StatNotifyError);
     _nameCandidate = FindViewById<EditText> (Resource.Id.name_candidate);
     _emailCandidate = FindViewById<EditText> (Resource.Id.email_candidate);
     _next = FindViewById<Button> (Resource.Id.next);
 }
开发者ID:bernardo-bruning,项目名称:AnalysiSkill,代码行数:7,代码来源:CadasterCandidateActivity.cs

示例3: MyItemizedOverlay

 public MyItemizedOverlay(Context context, Drawable drawable)
     //http://mono-for-android.1047100.n5.nabble.com/BoundCenterBottom-and-BoundCenter-on-ItemizedOverlay-return-Drawable-with-wrong-bounds-td5082774.html
     : base(/*BoundCenterBottom(*/drawable/*)*/) 
 {
     this.context = context;
     Populate();
 }
开发者ID:Cheesebaron,项目名称:MonoDroid.SimpleOverlayItem,代码行数:7,代码来源:MyItemizedOverlay.cs

示例4: InitDraggableDot

 private void InitDraggableDot()
 {
     mWhiteDot = Resources.GetDrawable(Resource.Drawable.white_dot);
     mRedDot = Resources.GetDrawable(Resource.Drawable.red_dot);
     mGreenDot = Resources.GetDrawable(Resource.Drawable.green_dot);
     mTranslucentDot = Resources.GetDrawable(Resource.Drawable.translucent_dot);
 }
开发者ID:Cheesebaron,项目名称:MonoDroid.DragArea,代码行数:7,代码来源:DraggableDot.cs

示例5: DividerItemDecoration

 public DividerItemDecoration (Context context, int orientation)
 {
     var a = context.ObtainStyledAttributes (Attrs);
     divider = a.GetDrawable (0);
     a.Recycle();
     Orientation = orientation;
 }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:7,代码来源:DividerItemDecoration.cs

示例6: Init

        private void Init(Context context)
        {
            _activity = context as MainActivity;
            // set some styles
            SetHintTextColor(Color.LightGray);
            // The image we defined for the clear button
            imgClearButton = ResourcesCompat.GetDrawable(context.Resources, Resource.Drawable.clear, null);
            SetOnTouchListener(new CustomOnTouchListener());
            FocusChange += (s, e) =>
            {
                if (e.HasFocus)
                {
                    if (CrossCurrentActivity.Current.Activity is MainActivity)
                    {
                        (CrossCurrentActivity.Current.Activity as MainActivity).CloseDrawer();
                    }
                }
            };

            TextChanged += (s, e) =>
            {
                if (Text.Length > 0)
                {
                    ShowClearButton();
                }
                else
                {
                    HideClearButton();
                }
            };
        }
开发者ID:ThePublicBikeGang,项目名称:EasyBike,代码行数:31,代码来源:ClearableAutoCompleteTextView.cs

示例7: GetObject

 public static Drawable GetObject(IntPtr instance)
 {
     if(Application.platform != RuntimePlatform.Android) return null;
     Drawable result = new Drawable();
     result._instance = instance;
     return result;
 }
开发者ID:trexug,项目名称:ouya-unity-plugin,代码行数:7,代码来源:Drawable.cs

示例8: OnCreate

		async protected  override  void OnCreate(Bundle bundle)
		{
			
			this.Window.AddFlags(WindowManagerFlags.Fullscreen);
			base.OnCreate(bundle);
			var metrics = Resources.DisplayMetrics;
			widthInDp = ((int)metrics.WidthPixels);
			heightInDp = ((int)metrics.HeightPixels);
			Configuration.setWidthPixel (widthInDp);
			Configuration.setHeigthPixel (heightInDp);
			vm = this.ViewModel as LOViewModel;

			int tam = Configuration.getWidth (80);
			bm_user = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap(getBitmapFromAsset ("icons/nouser.png"), tam,tam, true)
				,tam,tam);

			bmLike = Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth (43), Configuration.getWidth (35), true);

			drBack = new BitmapDrawable(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondocondiagonalm.png"), 640, 1136, true));


			await ini();
			//LoadPagesDataSource ();

			SetContentView (mainLayout);
		} 
开发者ID:aocsa,项目名称:eduticnow.droid,代码行数:26,代码来源:LOView.cs

示例9: onLoadingDrawableSet

        //@Override
        protected override void onLoadingDrawableSet(Drawable imageDrawable)
        {
            if (null != imageDrawable)
            {

                int dHeight = imageDrawable.IntrinsicHeight;
                int dWidth = imageDrawable.IntrinsicWidth;

                /**
                 * We need to set the width/height of the ImageView so that it is
                 * square with each side the size of the largest drawable dimension.
                 * This is so that it doesn't clip when rotated.
                 */
                ViewGroup.LayoutParams lp = mHeaderImage.LayoutParameters;
                lp.Width = lp.Height = Math.Max(dHeight, dWidth);
                mHeaderImage.RequestLayout();

                /**
                 * We now rotate the Drawable so that is at the correct rotation,
                 * and is centered.
                 */

                mHeaderImage.SetScaleType(ImageView.ScaleType.Matrix);
                Matrix matrix = new Matrix();
                matrix.PostTranslate((lp.Width - dWidth) / 2f, (lp.Height - dHeight) / 2f);
                matrix.PostRotate(getDrawableRotationAngle(), lp.Width / 2f, lp.Height / 2f);
                mHeaderImage.ImageMatrix = matrix;

            }
        }
开发者ID:skywolf888,项目名称:Android-PullToRefresh.Net,代码行数:31,代码来源:FlipLoadingLayout.cs

示例10: GestureRecognizerView

		public GestureRecognizerView (Context context)
            : base(context, null, 0)
		{
			_icon = context.Resources.GetDrawable (Resource.Drawable.ic_launcher);
			_icon.SetBounds (0, 0, _icon.IntrinsicWidth, _icon.IntrinsicHeight);
			_scaleDetector = new ScaleGestureDetector (context, new MyScaleListener (this));
		}
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:7,代码来源:GestureRecognizerView.cs

示例11: FFBitmapDrawable

		public FFBitmapDrawable(Resources res, Bitmap bitmap, Drawable placeholder, float fadingTime, bool fadeEnabled)
			: base(res, bitmap)
		{
			_placeholder = placeholder;
			_fadingTime = fadingTime;
			_animating = fadeEnabled;
			_startTimeMillis = SystemClock.UptimeMillis();
		}
开发者ID:Sohojoe,项目名称:FFImageLoading,代码行数:8,代码来源:FFBitmapDrawable.cs

示例12: ShadowItemDecoration

        public ShadowItemDecoration (Context context)
        {
            shadow = context.Resources.GetDrawable (Resource.Drawable.DropShadowVertical);
            reverseShadow = context.Resources.GetDrawable (Resource.Drawable.DropShadowVerticalReverse);

            topShadowHeightInPixels = topShadowHeightInDps.DpsToPxls (context);
            bottomShadowHeightInPixels = bottomShadowHeightInDps.DpsToPxls (context);
        }
开发者ID:VDBBjorn,项目名称:toggl_mobile,代码行数:8,代码来源:ShadowItemDecoration.cs

示例13: ProgressViewHolder

        public ProgressViewHolder(View view, Color moduleColor, float displayDensity)
            : base(view)
        {
            shapeLevelColor = GetDrawable(view, Resource.Drawable.rectangle_level1);
            shapeModuleColor = CreateRect(moduleColor, displayDensity);

            ImageViewStatus = view.FindViewById<ImageView>(Resource.Id.ivStatus);
        }
开发者ID:Thepagedot,项目名称:IRMGARD,代码行数:8,代码来源:ProgressAdapter.cs

示例14: SetDefaultSelector

 public void SetDefaultSelector(Drawable d)
 {
     _defaultBackground = d;
     if (!_stacked)
     {
         SetStacked(false, true);
     }
 }
开发者ID:devxiaruwei,项目名称:MaterialDialogs,代码行数:8,代码来源:MDButton.cs

示例15: FromColorResAndDrawable

		public static HeaderDesign FromColorResAndDrawable(int colorRes, Drawable drawable)
		{
			return new HeaderDesign
			{
				ColorRes = colorRes,
				Drawable = drawable
			};
		}
开发者ID:Julien-Mialon,项目名称:MaterialViewPager.Xamarin,代码行数:8,代码来源:HeaderDesign.cs


注:本文中的Android.Graphics.Drawables.Drawable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。