Java 类android.widget.AdapterViewAnimator 实例源码

项目:itsnat_droid    文件:AttrDescView_widget_AdapterViewAnimator_inoutAnimation.java   
@Override
public void setAttribute(View view, DOMAttr attr, AttrLayoutContext attrCtx)
{
    ObjectAnimator animator = (ObjectAnimator) getAnimator(attr.getResourceDesc(), attrCtx.getXMLInflaterContext());

    AdapterViewAnimator adapterViewAnimator = (AdapterViewAnimator)view;

    String value = attr.getName();
    if ("inAnimation".equals(value))
    {
        if (animator == null) animator = getDefaultInAnimation();
        adapterViewAnimator.setInAnimation(animator);
    }
    else if ("outAnimation".equals(value))
    {
        if (animator == null) animator = getDefaultOutAnimation();
        adapterViewAnimator.setOutAnimation(animator);
    }
    else throw MiscUtil.internalError();
}
项目:android-topeka    文件:QuizFragment.java   
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mQuizView = (AdapterViewAnimator) view.findViewById(R.id.quiz_view);
    decideOnViewToDisplay();
    setQuizViewAnimations();
    final AvatarView avatar = (AvatarView) view.findViewById(R.id.avatar);
    setAvatarDrawable(avatar);
    initProgressToolbar(view);
    super.onViewCreated(view, savedInstanceState);
}
项目:ToutStade    文件:QuizFragment.java   
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mQuizView = (AdapterViewAnimator) view.findViewById(R.id.quiz_view);
    decideOnViewToDisplay();
    mQuizView.setInAnimation(getActivity(), R.animator.slide_in_bottom);
    mQuizView.setOutAnimation(getActivity(), R.animator.slide_out_top);
    final AvatarView avatar = (AvatarView) view.findViewById(R.id.avatar);
    setAvatarDrawable(avatar);
    initProgressToolbar(view);
    super.onViewCreated(view, savedInstanceState);
}
项目:android-test-kit    文件:AdapterViewProtocols.java   
@Override
public void makeDataRenderedWithinAdapterView(
    AdapterView<? extends Adapter> adapterView, AdaptedData data) {
  checkArgument(data.opaqueToken instanceof Integer, "Not my data: %s", data);
  int position = ((Integer) data.opaqueToken).intValue();

  boolean moved = false;
  // set selection should always work, we can give a little better experience if per subtype
  // though.
  if (Build.VERSION.SDK_INT > 7) {
    if (adapterView instanceof AbsListView) {
      if (Build.VERSION.SDK_INT > 10) {
        ((AbsListView) adapterView).smoothScrollToPositionFromTop(position,
            adapterView.getPaddingTop(), 0);
      } else {
        ((AbsListView) adapterView).smoothScrollToPosition(position);
      }
      moved = true;
    }
    if (Build.VERSION.SDK_INT > 10) {
      if (adapterView instanceof AdapterViewAnimator) {
        if (adapterView instanceof AdapterViewFlipper) {
          ((AdapterViewFlipper) adapterView).stopFlipping();
        }
        ((AdapterViewAnimator) adapterView).setDisplayedChild(position);
        moved = true;
      }
    }
  }
  if (!moved) {
    adapterView.setSelection(position);
  }
}