java类android.widget.AdapterViewAnimator的实例源码

AttrDescView_widget_AdapterViewAnimator_inoutAnimation.java 文件源码 项目:itsnat_droid 阅读 19 收藏 0 点赞 0 评论 0
@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();
}
QuizFragment.java 文件源码 项目:android-topeka 阅读 25 收藏 0 点赞 0 评论 0
@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);
}
QuizFragment.java 文件源码 项目:ToutStade 阅读 26 收藏 0 点赞 0 评论 0
@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);
}
AdapterViewProtocols.java 文件源码 项目:android-test-kit 阅读 27 收藏 0 点赞 0 评论 0
@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);
  }
}


问题


面经


文章

微信
公众号

扫码关注公众号