类android.widget.AbsSpinner源码实例Demo

下面列出了怎么用android.widget.AbsSpinner的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: AndroidRipper   文件: SimpleNoValuesExtractor.java
/**
 * Set Count of the Widget
 * 
 * @param v
 *            Widget
 * @param wd
 *            WidgetDescription instance
 */
@SuppressWarnings("rawtypes")
public static void setCount(View v, WidgetDescription w) {
	// For lists, the count is set to the number of rows in the list
	// (inactive rows - e.g. separators - count as well)
	if (v instanceof AdapterView) {
		w.setCount(((AdapterView) v).getCount());
		return;
	}

	// For Spinners, the count is set to the number of options
	if (v instanceof AbsSpinner) {
		w.setCount(((AbsSpinner) v).getCount());
		return;
	}

	// For the tab layout host, the count is set to the number of tabs
	if (v instanceof TabHost) {
		w.setCount(((TabHost) v).getTabWidget().getTabCount());
		return;
	}

	// For grids, the count is set to the number of icons, for RadioGroups
	// it's set to the number of RadioButtons
	if (v instanceof ViewGroup) {
		w.setCount(((ViewGroup) v).getChildCount());
		return;
	}

	// For progress bars, seek bars and rating bars, the count is set to the
	// maximum value allowed
	if (v instanceof ProgressBar) {
		w.setCount(((ProgressBar) v).getMax());
		return;
	}
}
 
源代码2 项目: AndroidRipper   文件: SimpleExtractor.java
/**
 * Set Count of the Widget
 * 
 * @param v
 *            Widget
 * @param wd
 *            WidgetDescription instance
 */
@SuppressWarnings("rawtypes")
public static void setCount(View v, WidgetDescription w) {
	// For lists, the count is set to the number of rows in the list
	// (inactive rows - e.g. separators - count as well)
	if (v instanceof AdapterView) {
		w.setCount(((AdapterView) v).getCount());
		return;
	}

	// For Spinners, the count is set to the number of options
	if (v instanceof AbsSpinner) {
		w.setCount(((AbsSpinner) v).getCount());
		return;
	}

	// For the tab layout host, the count is set to the number of tabs
	if (v instanceof TabHost) {
		w.setCount(((TabHost) v).getTabWidget().getTabCount());
		return;
	}

	// For grids, the count is set to the number of icons, for RadioGroups
	// it's set to the number of RadioButtons
	if (v instanceof ViewGroup) {
		w.setCount(((ViewGroup) v).getChildCount());
		return;
	}

	// For progress bars, seek bars and rating bars, the count is set to the
	// maximum value allowed
	if (v instanceof ProgressBar) {
		w.setCount(((ProgressBar) v).getMax());
		return;
	}
}
 
源代码3 项目: AndroidRipper   文件: ReflectionExtractor.java
/**
 * Set Count of the Widget
 * 
 * @param v
 *            Widget
 * @param w
 *            WidgetDescription instance
 */
@SuppressWarnings("rawtypes")
public static void setCount(View v, WidgetDescription w) {
	// For lists, the count is set to the number of rows in the list
	// (inactive rows - e.g. separators - count as well)
	if (v instanceof AdapterView) {
		w.setCount(((AdapterView) v).getCount());
		return;
	}

	// For Spinners, the count is set to the number of options
	if (v instanceof AbsSpinner) {
		w.setCount(((AbsSpinner) v).getCount());
		return;
	}

	// For the tab layout host, the count is set to the number of tabs
	if (v instanceof TabHost) {
		w.setCount(((TabHost) v).getTabWidget().getTabCount());
		return;
	}

	// For grids, the count is set to the number of icons, for RadioGroups
	// it's set to the number of RadioButtons
	if (v instanceof ViewGroup) {
		w.setCount(((ViewGroup) v).getChildCount());
		return;
	}

	// For progress bars, seek bars and rating bars, the count is set to the
	// maximum value allowed
	if (v instanceof ProgressBar) {
		w.setCount(((ProgressBar) v).getMax());
		return;
	}
}
 
源代码4 项目: anvil   文件: DSL.java
public static BaseDSL.ViewClassResult absSpinner() {
  return BaseDSL.v(AbsSpinner.class);
}
 
源代码5 项目: anvil   文件: DSL.java
public static Void absSpinner(Anvil.Renderable r) {
  return BaseDSL.v(AbsSpinner.class, r);
}
 
源代码6 项目: anvil   文件: DSL.java
public static BaseDSL.ViewClassResult absSpinner() {
  return BaseDSL.v(AbsSpinner.class);
}
 
源代码7 项目: anvil   文件: DSL.java
public static Void absSpinner(Anvil.Renderable r) {
  return BaseDSL.v(AbsSpinner.class, r);
}
 
源代码8 项目: aedict   文件: AndroidTester.java
public void assertItem(final int spinnerId, final int position) {
	final AbsSpinner view = (AbsSpinner) get(spinnerId);
	assertEquals("Incorrect item selected: expected " + position + " but got " + view.getSelectedItemPosition(), position, view.getSelectedItemPosition());
}
 
源代码9 项目: butterknife   文件: OnItemSelectedTest.java
@OnItemSelected(2) void selectAbsSpinner(AbsSpinner view) {
  last = view;
}
 
源代码10 项目: butterknife   文件: OnItemSelectedTest.java
@OnItemSelected(value = 2, callback = NOTHING_SELECTED)
void clearAbsSpinner(AbsSpinner view) {
  last = view;
}
 
源代码11 项目: butterknife   文件: OnItemClickTest.java
@OnItemClick(2) void itemClickAbsSpinner(AbsSpinner view) {
    last = view;
}
 
源代码12 项目: butterknife   文件: OnItemLongClickTest.java
@OnItemLongClick(2) boolean itemLongClickAbsSpinner(AbsSpinner view) {
    last = view;
    return true;
}
 
源代码13 项目: assertj-android   文件: AbsSpinnerAssert.java
public AbsSpinnerAssert(AbsSpinner actual) {
  super(actual, AbsSpinnerAssert.class);
}
 
源代码14 项目: aedict   文件: AndroidTester.java
/**
 * Sets given item.
 * 
 * @param spinnerId
 *            the spinner id
 * @param position
 *            the item position.
 */
public void setItem(final int spinnerId, final int position) {
	final AbsSpinner view = (AbsSpinner) get(spinnerId);
	view.setSelection(position);
}
 
 类所在包
 类方法
 同包方法