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


C# android.getIntrinsicHeight方法代码示例

本文整理汇总了C#中android.getIntrinsicHeight方法的典型用法代码示例。如果您正苦于以下问题:C# android.getIntrinsicHeight方法的具体用法?C# android.getIntrinsicHeight怎么用?C# android.getIntrinsicHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android的用法示例。


在下文中一共展示了android.getIntrinsicHeight方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: setDividerDrawable

		/// <summary>Set a drawable to be used as a divider between items.</summary>
		/// <remarks>Set a drawable to be used as a divider between items.</remarks>
		/// <param name="divider">Drawable that will divide each item.</param>
		/// <seealso cref="setShowDividers(int)">setShowDividers(int)</seealso>
		public virtual void setDividerDrawable(android.graphics.drawable.Drawable divider
			)
		{
			if (divider == mDivider)
			{
				return;
			}
			mDivider = divider;
			if (divider != null)
			{
				mDividerWidth = divider.getIntrinsicWidth();
				mDividerHeight = divider.getIntrinsicHeight();
			}
			else
			{
				mDividerWidth = 0;
				mDividerHeight = 0;
			}
			setWillNotDraw(divider == null);
			requestLayout();
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:25,代码来源:LinearLayout.cs

示例2: setThumbPos

		/// <param name="gap">
		/// If set to
		/// <see cref="int.MinValue">int.MinValue</see>
		/// , this will be ignored and
		/// </param>
		private void setThumbPos(int w, android.graphics.drawable.Drawable thumb, float scale
			, int gap)
		{
			int available = w - mPaddingLeft - mPaddingRight;
			int thumbWidth = thumb.getIntrinsicWidth();
			int thumbHeight = thumb.getIntrinsicHeight();
			available -= thumbWidth;
			// The extra space for the thumb to move on the track
			available += mThumbOffset * 2;
			int thumbPos = (int)(scale * available);
			int topBound;
			int bottomBound;
			if (gap == int.MinValue)
			{
				android.graphics.Rect oldBounds = thumb.getBounds();
				topBound = oldBounds.top;
				bottomBound = oldBounds.bottom;
			}
			else
			{
				topBound = gap;
				bottomBound = gap + thumbHeight;
			}
			// Canvas will be translated, so 0,0 is where we start drawing
			thumb.setBounds(thumbPos, topBound, thumbPos + thumbWidth, bottomBound);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:31,代码来源:AbsSeekBar.cs

示例3: setThumb

		/// <summary>Sets the thumb that will be drawn at the end of the progress meter within the SeekBar.
		/// 	</summary>
		/// <remarks>
		/// Sets the thumb that will be drawn at the end of the progress meter within the SeekBar.
		/// <p>
		/// If the thumb is a valid drawable (i.e. not null), half its width will be
		/// used as the new thumb offset (@see #setThumbOffset(int)).
		/// </remarks>
		/// <param name="thumb">Drawable representing the thumb</param>
		public virtual void setThumb(android.graphics.drawable.Drawable thumb)
		{
			bool needUpdate;
			// This way, calling setThumb again with the same bitmap will result in
			// it recalcuating mThumbOffset (if for example it the bounds of the
			// drawable changed)
			if (mThumb != null && thumb != mThumb)
			{
				mThumb.setCallback(null);
				needUpdate = true;
			}
			else
			{
				needUpdate = false;
			}
			if (thumb != null)
			{
				thumb.setCallback(this);
				// Assuming the thumb drawable is symmetric, set the thumb offset
				// such that the thumb will hang halfway off either edge of the
				// progress bar.
				mThumbOffset = thumb.getIntrinsicWidth() / 2;
				// If we're updating get the new states
				if (needUpdate && (thumb.getIntrinsicWidth() != mThumb.getIntrinsicWidth() || thumb
					.getIntrinsicHeight() != mThumb.getIntrinsicHeight()))
				{
					requestLayout();
				}
			}
			mThumb = thumb;
			invalidate();
			if (needUpdate)
			{
				updateThumbPos(getWidth(), getHeight());
				if (thumb.isStateful())
				{
					// Note that if the states are different this won't work.
					// For now, let's consider that an app bug.
					int[] state = getDrawableState();
					thumb.setState(state);
				}
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:52,代码来源:AbsSeekBar.cs

示例4: setCheckMarkDrawable

		/// <summary>Set the checkmark to a given Drawable.</summary>
		/// <remarks>
		/// Set the checkmark to a given Drawable. This will be drawn when
		/// <see cref="isChecked()">isChecked()</see>
		/// is true.
		/// </remarks>
		/// <param name="d">The Drawable to use for the checkmark.</param>
		public virtual void setCheckMarkDrawable(android.graphics.drawable.Drawable d)
		{
			if (mCheckMarkDrawable != null)
			{
				mCheckMarkDrawable.setCallback(null);
				unscheduleDrawable(mCheckMarkDrawable);
			}
			mNeedRequestlayout = (d != mCheckMarkDrawable);
			if (d != null)
			{
				d.setCallback(this);
				d.setVisible(getVisibility() == VISIBLE, false);
				d.setState(CHECKED_STATE_SET);
				setMinHeight(d.getIntrinsicHeight());
				mCheckMarkWidth = d.getIntrinsicWidth();
				d.setState(getDrawableState());
			}
			else
			{
				mCheckMarkWidth = 0;
			}
			mCheckMarkDrawable = d;
			// Do padding resolution. This will call setPadding() and do a requestLayout() if needed.
			resolvePadding();
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:32,代码来源:CheckedTextView.cs

示例5: setIcon

		public void setIcon(android.graphics.drawable.Drawable icon)
		{
			mIcon = icon;
			if (icon != null)
			{
				icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
				// Set the compound drawables
				setCompoundDrawables(null, icon, null, null);
				// When there is an icon, make sure the text is at the bottom
				setGravity(android.view.Gravity.BOTTOM | android.view.Gravity.CENTER_HORIZONTAL);
				requestLayout();
			}
			else
			{
				setCompoundDrawables(null, null, null, null);
				// When there is no icon, make sure the text is centered vertically
				setGravity(android.view.Gravity.CENTER_VERTICAL | android.view.Gravity.CENTER_HORIZONTAL
					);
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:20,代码来源:IconMenuItemView.cs

示例6: addDrawable

			/// <summary>Adds a Drawable to the list of available mipmap Drawables.</summary>
			/// <remarks>
			/// Adds a Drawable to the list of available mipmap Drawables. This list can be retrieved
			/// using
			/// <see cref="DrawableContainerState.getChildren()">DrawableContainerState.getChildren()
			/// 	</see>
			/// and this method
			/// ensures that it is always sorted by increasing
			/// <see cref="Drawable.getIntrinsicHeight()">Drawable.getIntrinsicHeight()</see>
			/// .
			/// </remarks>
			/// <param name="drawable">The Drawable that will be added to children list</param>
			public void addDrawable(android.graphics.drawable.Drawable drawable)
			{
				// Insert drawable in last position, correctly resetting cached values and
				// especially mComputedConstantSize
				int pos = addChild(drawable);
				// Bubble sort the last drawable to restore the sort by intrinsic height
				int drawableHeight = drawable.getIntrinsicHeight();
				while (pos > 0)
				{
					android.graphics.drawable.Drawable previousDrawable = mDrawables[pos - 1];
					int previousIntrinsicHeight = previousDrawable.getIntrinsicHeight();
					if (drawableHeight < previousIntrinsicHeight)
					{
						mDrawables[pos] = previousDrawable;
						mMipmapHeights[pos] = previousIntrinsicHeight;
						mDrawables[pos - 1] = drawable;
						mMipmapHeights[pos - 1] = drawableHeight;
						pos--;
					}
					else
					{
						break;
					}
				}
			}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:37,代码来源:MipmapDrawable.cs

示例7: useThumbDrawable

		private void useThumbDrawable(android.content.Context context, android.graphics.drawable.Drawable
			 drawable)
		{
			mThumbDrawable = drawable;
			if (drawable is android.graphics.drawable.NinePatchDrawable)
			{
				mThumbW = context.getResources().getDimensionPixelSize([email protected]
					fastscroll_thumb_width);
				mThumbH = context.getResources().getDimensionPixelSize([email protected]
					fastscroll_thumb_height);
			}
			else
			{
				mThumbW = drawable.getIntrinsicWidth();
				mThumbH = drawable.getIntrinsicHeight();
			}
			mChangedBounds = true;
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:18,代码来源:FastScroller.cs

示例8: updateDrawable

		private void updateDrawable(android.graphics.drawable.Drawable d)
		{
			if (mDrawable != null)
			{
				mDrawable.setCallback(null);
				unscheduleDrawable(mDrawable);
			}
			mDrawable = d;
			if (d != null)
			{
				d.setCallback(this);
				if (d.isStateful())
				{
					d.setState(getDrawableState());
				}
				d.setLevel(mLevel);
				mDrawableWidth = d.getIntrinsicWidth();
				mDrawableHeight = d.getIntrinsicHeight();
				applyColorMod();
				configureBounds();
			}
			else
			{
				mDrawableWidth = mDrawableHeight = -1;
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:26,代码来源:ImageView.cs


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