Android Open Source - android-movies-demo Sliding List View






From Project

Back to project page android-movies-demo.

License

The source code is released under:

MIT License

If you think the Android project android-movies-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.idunnolol.moviesdemo.view;
// w w  w.  ja v  a  2  s .  c o  m
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ListView;

import com.idunnolol.moviesdemo.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Allows SlidingPairViews to operate without having to layout constantly
 */
public class SlidingListView extends ListView {

  public SlidingListView(Context context) {
    super(context);
  }

  public SlidingListView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public SlidingListView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
  }

  // For performance reasons, we want to set the slide directly on the views instead of
  // setting the slide in the adapter and notifying that the dataset changed.
  public void setSlide(float slide) {
    if (getWidth() == 0) {
      return;
    }

    for (SlidingPairView child : getAllSlidingPairViewChildren()) {
      child.setSlide(slide);
    }
  }

  public void setUseHardwareLayers(boolean useHardwareLayers) {
    for (SlidingPairView child : getAllSlidingPairViewChildren()) {
      child.setUseHardwareLayers(useHardwareLayers);
    }
  }

  private List<SlidingPairView> getAllSlidingPairViewChildren() {
    List<SlidingPairView> children = new ArrayList<SlidingPairView>();
    int childCount = getChildCount();
    for (int a = 0; a < childCount; a++) {
      View view = getChildAt(a).findViewById(R.id.sliding_pair);
      if (view != null) {
        children.add((SlidingPairView) view);
      }
    }
    return children;
  }

}




Java Source Code List

com.idunnolol.moviesdemo.data.Movie.java
com.idunnolol.moviesdemo.ui.AboutDialogFragment.java
com.idunnolol.moviesdemo.ui.MoviesActivity.java
com.idunnolol.moviesdemo.ui.MoviesApplication.java
com.idunnolol.moviesdemo.util.BitmapCache.java
com.idunnolol.moviesdemo.util.FontCache.java
com.idunnolol.moviesdemo.util.ResourceUtils.java
com.idunnolol.moviesdemo.view.CenteringRelativeLayout.java
com.idunnolol.moviesdemo.view.DecorFrameLayout.java
com.idunnolol.moviesdemo.view.MovieRowView.java
com.idunnolol.moviesdemo.view.SlidingListView.java
com.idunnolol.moviesdemo.view.SlidingPairView.java
com.idunnolol.moviesdemo.view.SlidingRevealViewGroup.java
com.idunnolol.moviesdemo.view.ViewPager.java
com.idunnolol.moviesdemo.widget.MovieAdapter.java