• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Drawables.Drawable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: setBackground

	public static void setBackground(View view, Drawable background) {
        if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.JellyBean)
        {
			SDK16.setBackground(view, background);
		} else {
			view.SetBackgroundDrawable(background);
		}
	}
开发者ID:skywolf888,项目名称:Android-PullToRefresh.Net,代码行数:8,代码来源:ViewCompat.cs


示例17: FromColorAndDrawable

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


示例18: onLoadingDrawableSet

 protected override void onLoadingDrawableSet(Drawable imageDrawable)
 {
     if (null != imageDrawable)
     {
         mRotationPivotX = (int)Math.Round(imageDrawable.IntrinsicWidth / 2f);
         mRotationPivotY = (int)Math.Round(imageDrawable.IntrinsicHeight / 2f);
     }
 }
开发者ID:skywolf888,项目名称:Android-PullToRefresh.Net,代码行数:8,代码来源:RotateLoadingLayout.cs


示例19: PrepareBackgroundManager

		private void PrepareBackgroundManager ()
		{
			BackgroundManager backgroundManager = BackgroundManager.GetInstance (this.Activity);
			backgroundManager.Attach (this.Activity.Window);
			mBackgroundTarget = new PicassoBackgroundManagerTarget (backgroundManager);
			mDefaultBackground = Resources.GetDrawable (Resource.Drawable.default_background);
			mMetrics = new DisplayMetrics ();
			this.Activity.WindowManager.DefaultDisplay.GetMetrics (mMetrics);
		}
开发者ID:WalterVale,项目名称:monodroid-samples,代码行数:9,代码来源:MainFragment.cs


示例20: setLoadingDrawable

	//@Override
	public void setLoadingDrawable(Drawable drawable) {
        //for (LoadingLayout layout : mLoadingLayouts) {
        //    layout.setLoadingDrawable(drawable);
        //}
        foreach (var layout in mLoadingLayouts)
        {
            layout.setLoadingDrawable(drawable);
        }
	}
开发者ID:hmxbanz,项目名称:Android-PullToRefresh.Net,代码行数:10,代码来源:LoadingLayoutProxy.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Hardware.Camera类代码示例发布时间:2022-05-24
下一篇:
C# Graphics.RectF类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap