android.view.View.getLabelFor()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中android.view.View.getLabelFor()方法的一些代码示例,展示了View.getLabelFor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.getLabelFor()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:getLabelFor

View.getLabelFor介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

@TargetApi(JELLY_BEAN_MR1)
public S hasLabelFor(int id) {
 isNotNull();
 int actualId = actual.getLabelFor();
 assertThat(actualId) //
   .overridingErrorMessage("Expected to have label for ID <%s> but was <%s>", id, actualId) //
   .isEqualTo(id);
 return myself;
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static int getLabelFor(View view) {
  return view.getLabelFor();
}

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(JELLY_BEAN_MR1)
public S hasLabelFor(int id) {
 isNotNull();
 int actualId = actual.getLabelFor();
 assertThat(actualId) //
   .overridingErrorMessage("Expected to have label for ID <%s> but was <%s>", id, actualId) //
   .isEqualTo(id);
 return myself;
}

代码示例来源:origin: com.google.android.apps.common.testing.accessibility.framework/accessibility-test-framework

private static View lookForLabelForViewInViewAndChildren(View view, View childToSkip,
  int idToFind) {
 if (view.getLabelFor() == idToFind) {
  return view;
 }
 if (!(view instanceof ViewGroup)) {
  return null;
 }
 ViewGroup viewGroup = (ViewGroup) view;
 for (int i = 0; i < viewGroup.getChildCount(); ++i) {
  View child = viewGroup.getChildAt(i);
  if (!child.equals(childToSkip)) {
   View labelingView = lookForLabelForViewInViewAndChildren(child, null, idToFind);
   if (labelingView != null) {
    return labelingView;
   }
  }
 }
 return null;
}

代码示例来源:origin: jbruchanov/AnUitor

data.put("LabelFor", IdsHelper.getNameForId(v.getLabelFor()));
data.put("LayerDirection", translator.layoutDirection(v.getLayoutDirection()));
data.put("Display:", String.valueOf(v.getDisplay()));

相关文章

微信公众号

最新文章

更多

View类方法