Example usage for android.widget ViewAnimator indexOfChild

List of usage examples for android.widget ViewAnimator indexOfChild

Introduction

In this page you can find the example usage for android.widget ViewAnimator indexOfChild.

Prototype

public int indexOfChild(View child) 

Source Link

Document

Returns the position in the group of the specified child view.

Usage

From source file:org.amahi.anywhere.util.ViewDirector.java

public void show(int viewId) {
    ViewAnimator animator = (ViewAnimator) findView(animatorId);
    View view = findView(viewId);

    if (animator.getDisplayedChild() != animator.indexOfChild(view)) {
        animator.setDisplayedChild(animator.indexOfChild(view));
    }/*from w w  w  .  j a v  a 2 s .co m*/
}

From source file:org.hawkular.client.android.util.ViewDirector.java

@UiThread
public void show(@IdRes int viewId) {
    ViewAnimator animator = (ViewAnimator) sceneView.findViewById(animatorId);
    View view = sceneView.findViewById(viewId);

    if (animator.getDisplayedChild() != animator.indexOfChild(view)) {
        animator.setDisplayedChild(animator.indexOfChild(view));
    }/*  w w w  .java 2 s. c  o  m*/
}

From source file:org.libreoffice.impressremote.fragment.ComputerConnectionFragment.java

private void setCurrentView(int aViewId) {
    ViewAnimator aViewAnimator = getViewAnimator();
    View aView = getView().findViewById(aViewId);

    aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aView));
}

From source file:org.libreoffice.impressremote.fragment.ComputersFragment.java

private void setCurrentView(int aViewId) {
    ViewAnimator aViewAnimator = (ViewAnimator) getView().findViewById(R.id.view_animator);
    View aView = getView().findViewById(aViewId);

    if (aViewId == aViewAnimator.getCurrentView().getId()) {
        return;//from   ww  w  .  j a  v  a2  s.  c o m
    }

    aViewAnimator.setDisplayedChild(aViewAnimator.indexOfChild(aView));
}