ExportedProperty ( )源码实例Demo

android.view.ViewDebug#ExportedProperty ( )源码实例Demo

下面列出了android.view.ViewDebug#ExportedProperty ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: weex   文件: ViewDescriptor.java
private static String mapFlagsToStringUsingAnnotation(
    int value,
    @Nullable ViewDebug.ExportedProperty annotation) {
  if (!canFlagsBeMappedToString(annotation)) {
    throw new IllegalStateException("Cannot map using this annotation");
  }

  StringBuilder stringBuilder = null;
  boolean atLeastOneFlag = false;

  for (ViewDebug.FlagToString flagToString : annotation.flagMapping()) {
    if (flagToString.outputIf() == ((value & flagToString.mask()) == flagToString.equals())) {
      if (stringBuilder == null) {
        stringBuilder = new StringBuilder();
      }

      if (atLeastOneFlag) {
        stringBuilder.append(" | ");
      }

      stringBuilder.append(flagToString.name());
      atLeastOneFlag = true;
    }
  }

  if (atLeastOneFlag) {
    return stringBuilder.toString();
  } else {
    return NONE_MAPPING;
  }
}
 
源代码2 项目: stetho   文件: ViewDescriptor.java
private void getStyleFromValue(
    View element,
    String name,
    Object value,
    @Nullable ViewDebug.ExportedProperty annotation,
    StyleAccumulator styles) {

  if (name.equals(ID_NAME)) {
    getIdStyle(element, styles);
  } else if (value instanceof Integer) {
    getStyleFromInteger(name, (Integer) value, annotation, styles);
  } else if (value instanceof Float) {
    styles.store(name, String.valueOf(value), ((Float) value) == 0.0f);
  } else if (value instanceof Boolean) {
    styles.store(name, String.valueOf(value), false);
  } else if (value instanceof Short) {
    styles.store(name, String.valueOf(value), ((Short) value) == 0);
  } else if (value instanceof Long) {
    styles.store(name, String.valueOf(value), ((Long) value) == 0);
  } else if (value instanceof Double) {
    styles.store(name, String.valueOf(value), ((Double) value) == 0.0d);
  } else if (value instanceof Byte) {
    styles.store(name, String.valueOf(value), ((Byte) value) == 0);
  } else if (value instanceof Character) {
    styles.store(name, String.valueOf(value), ((Character) value) == Character.MIN_VALUE);
  } else if (value instanceof CharSequence) {
    styles.store(name, String.valueOf(value), ((CharSequence) value).length() == 0);
  } else {
    getStylesFromObject(element, name, value, annotation, styles);
  }
}
 
源代码3 项目: ResourceInspector   文件: RIViewDescriptor.java
public MethodBackedCSSProperty(
        Method method,
        String cssName,
        @Nullable ViewDebug.ExportedProperty annotation) {
    super(cssName, annotation);
    mMethod = method;
    mMethod.setAccessible(true);
}
 
源代码4 项目: stetho   文件: ViewDescriptor.java
private static String mapFlagsToStringUsingAnnotation(
    int value,
    @Nullable ViewDebug.ExportedProperty annotation) {
  if (!canFlagsBeMappedToString(annotation)) {
    throw new IllegalStateException("Cannot map using this annotation");
  }

  StringBuilder stringBuilder = null;
  boolean atLeastOneFlag = false;

  for (ViewDebug.FlagToString flagToString : annotation.flagMapping()) {
    if (flagToString.outputIf() == ((value & flagToString.mask()) == flagToString.equals())) {
      if (stringBuilder == null) {
        stringBuilder = new StringBuilder();
      }

      if (atLeastOneFlag) {
        stringBuilder.append(" | ");
      }

      stringBuilder.append(flagToString.name());
      atLeastOneFlag = true;
    }
  }

  if (atLeastOneFlag) {
    return stringBuilder.toString();
  } else {
    return NONE_MAPPING;
  }
}
 
源代码5 项目: weex   文件: ViewDescriptor.java
public MethodBackedCSSProperty(
    Method method,
    String cssName,
    @Nullable ViewDebug.ExportedProperty annotation) {
  super(cssName, annotation);
  mMethod = method;
  mMethod.setAccessible(true);
}
 
源代码6 项目: weex   文件: IntegerFormatter.java
@Override
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public String format(Integer integer, @Nullable ViewDebug.ExportedProperty annotation) {
  if (annotation != null && annotation.formatToHexString()) {
    return "0x" + Integer.toHexString(integer);
  }

  return super.format(integer, annotation);
}
 
源代码7 项目: android_9.0.0_r45   文件: WebView.java
/**
 * Gets the height of the HTML content.
 *
 * @return the height of the HTML content
 */
@ViewDebug.ExportedProperty(category = "webview")
public int getContentHeight() {
    checkThread();
    return mProvider.getContentHeight();
}
 
源代码8 项目: stetho   文件: ViewDescriptor.java
public ViewCSSProperty(String cssName, @Nullable ViewDebug.ExportedProperty annotation) {
  mCSSName = cssName;
  mAnnotation = annotation;
}
 
源代码9 项目: ZrcListView   文件: ZrcAbsListView.java
@ViewDebug.ExportedProperty(category = "drawing")
public int getCacheColorHint() {
	return mCacheColorHint;
}
 
源代码10 项目: ZrcListView   文件: ZrcAbsListView.java
@ViewDebug.ExportedProperty
public boolean isSmoothScrollbarEnabled() {
	return mSmoothScrollbarEnabled;
}
 
@Override
@ViewDebug.ExportedProperty
public boolean isChecked() {
    return this.mChecked;
}
 
源代码12 项目: AndroidStudyDemo   文件: ZrcAbsListView.java
@ViewDebug.ExportedProperty
public boolean isScrollingCacheEnabled() {
    return mScrollingCacheEnabled;
}
 
源代码13 项目: android_9.0.0_r45   文件: WebView.java
/**
 * Gets the URL for the current page. This is not always the same as the URL
 * passed to WebViewClient.onPageStarted because although the load for
 * that URL has begun, the current page may not have changed.
 *
 * @return the URL for the current page
 */
@ViewDebug.ExportedProperty(category = "webview")
public String getUrl() {
    checkThread();
    return mProvider.getUrl();
}
 
源代码14 项目: Lay-s   文件: PLAAbsListView.java
/**
 * Indicates whether the children's drawing cache is used during a scroll.
 * By default, the drawing cache is enabled but this will consume more memory.
 *
 * @return true if the scrolling cache is enabled, false otherwise
 *
 * @see #setScrollingCacheEnabled(boolean)
 * @see View#setDrawingCacheEnabled(boolean)
 */
@ViewDebug.ExportedProperty
public boolean isScrollingCacheEnabled() {
    return mScrollingCacheEnabled;
}
 
源代码15 项目: zhangshangwuda   文件: IcsProgressBar.java
/**
 * <p>Return the upper limit of this progress bar's range.</p>
 *
 * @return a positive integer
 *
 * @see #setMax(int)
 * @see #getProgress()
 * @see #getSecondaryProgress()
 */
@ViewDebug.ExportedProperty(category = "progress")
public synchronized int getMax() {
    return mMax;
}
 
源代码16 项目: EverMemo   文件: PLA_ListView.java
/**
 * @return True to recycle the views used to measure this ListView in
 *         UNSPECIFIED/AT_MOST modes, false otherwise.
 * @hide
 */
@ViewDebug.ExportedProperty(category = "list")
protected boolean recycleOnMeasure() {
	return true;
}
 
/**
 * <p>Get the progress bar's current level of progress. Return 0 when the
 * progress bar is in indeterminate mode.</p>
 *
 * @return the current progress, between 0 and {@link #getMax()}
 *
 * @see #setIndeterminate(boolean)
 * @see #isIndeterminate()
 * @see #setProgress(int)
 * @see #setMax(int)
 * @see #getMax()
 */
@ViewDebug.ExportedProperty(category = "progress")
public synchronized int getProgress() {
    return mIndeterminate ? 0 : mProgress;
}
 
源代码18 项目: SimplifyReader   文件: PLAListView.java
/**
 * @return True to recycle the views used to measure this ListView in
 *         UNSPECIFIED/AT_MOST modes, false otherwise.
 * @hide
 */
@ViewDebug.ExportedProperty(category = "list")
protected boolean recycleOnMeasure() {
    return true;
}
 
/**
 * <p>Get the progress bar's current level of secondary progress. Return 0 when the
 * progress bar is in indeterminate mode.</p>
 *
 * @return the current secondary progress, between 0 and {@link #getMax()}
 *
 * @see #setIndeterminate(boolean)
 * @see #isIndeterminate()
 * @see #setSecondaryProgress(int)
 * @see #setMax(int)
 * @see #getMax()
 */
@ViewDebug.ExportedProperty(category = "progress")
public synchronized int getSecondaryProgress() {
    return mIndeterminate ? 0 : mSecondaryProgress;
}
 
源代码20 项目: recent-images   文件: TwoWayAbsListView.java
/**
 * Returns the current state of the fast scroll feature.
 *
 * @return True if smooth scrollbar is enabled is enabled, false otherwise.
 *
 * @see #setSmoothScrollbarEnabled(boolean)
 */
@ViewDebug.ExportedProperty
public boolean isSmoothScrollbarEnabled() {
	return mSmoothScrollbarEnabled;
}
 
源代码评论
动弹
沙发等你来抢
 方法所在类