android.widget.AdapterViewAnimator Java Examples

The following examples show how to use android.widget.AdapterViewAnimator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QuizFragment.java    From android-topeka with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #2
Source File: AdapterViewProtocols.java    From android-test with Apache License 2.0 5 votes vote down vote up
@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);
  }
}
 
Example #3
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static BaseDSL.ViewClassResult adapterViewAnimator() {
  return BaseDSL.v(AdapterViewAnimator.class);
}
 
Example #4
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void adapterViewAnimator(Anvil.Renderable r) {
  return BaseDSL.v(AdapterViewAnimator.class, r);
}
 
Example #5
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static BaseDSL.ViewClassResult adapterViewAnimator() {
  return BaseDSL.v(AdapterViewAnimator.class);
}
 
Example #6
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void adapterViewAnimator(Anvil.Renderable r) {
  return BaseDSL.v(AdapterViewAnimator.class, r);
}