Methods Summary |
---|
public void | addView(android.view.View child, int index, ViewGroup.LayoutParams params){@inheritDoc}
if (getChildCount() >= 2) {
throw new IllegalStateException("Can't add more than 2 views to a ViewSwitcher");
}
super.addView(child, index, params);
|
public android.view.View | getNextView()Returns the next view to be displayed.
int which = mWhichChild == 0 ? 1 : 0;
return getChildAt(which);
|
private android.view.View | obtainView()
View child = mFactory.makeView();
LayoutParams lp = (LayoutParams) child.getLayoutParams();
if (lp == null) {
lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}
addView(child, lp);
return child;
|
public void | onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
super.onInitializeAccessibilityEvent(event);
event.setClassName(ViewSwitcher.class.getName());
|
public void | onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(ViewSwitcher.class.getName());
|
public void | reset()Reset the ViewSwitcher to hide all of the existing views and to make it
think that the first time animation has not yet played.
mFirstTime = true;
View v;
v = getChildAt(0);
if (v != null) {
v.setVisibility(View.GONE);
}
v = getChildAt(1);
if (v != null) {
v.setVisibility(View.GONE);
}
|
public void | setFactory(android.widget.ViewSwitcher$ViewFactory factory)Sets the factory used to create the two views between which the
ViewSwitcher will flip. Instead of using a factory, you can call
{@link #addView(android.view.View, int, android.view.ViewGroup.LayoutParams)}
twice.
mFactory = factory;
obtainView();
obtainView();
|