Android Open Source - fileEx List View Compat






From Project

Back to project page fileEx.

License

The source code is released under:

Apache License

If you think the Android project fileEx 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 android.howard.exp.views;
//www  .  j  a v  a 2 s .  co m
import android.content.Context;
import android.howard.exp.bean.RootItemBean;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ListView;

public class ListViewCompat extends ListView {

  private static final String TAG = "ListViewCompat";

  private SlideView mFocusedItemView;

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

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

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

  public void shrinkListItem(int position) {
    View item = getChildAt(position);

    if (item != null) {
      try {
        ((SlideView) item).shrink();
      } catch (ClassCastException e) {
        e.printStackTrace();
      }
    }
  }

  @Override
  public boolean onTouchEvent(MotionEvent event) {
    switch (event.getAction()) {
    case MotionEvent.ACTION_DOWN: {
      int x = (int) event.getX();
      int y = (int) event.getY();
      int position = pointToPosition(x, y);
      Log.e(TAG, "postion=" + position);
      if (position != INVALID_POSITION) {
        RootItemBean data = (RootItemBean) getItemAtPosition(position);
        Log.i("howard",data+"");
        mFocusedItemView = data.getSlideView();
        Log.e(TAG, "FocusedItemView=" + mFocusedItemView);
      }
    }
    default:
      break;
    }

    if (mFocusedItemView != null) {
      mFocusedItemView.onRequireTouchEvent(event);
    }

    return super.onTouchEvent(event);
  }

}




Java Source Code List

android.howard.exp.adapter.ImageCache.java
android.howard.exp.adapter.ImageReaderTask.java
android.howard.exp.adapter.NaviAdapter.java
android.howard.exp.adapter.ViedioReaderTask.java
android.howard.exp.bean.RootItemBean.java
android.howard.exp.fragment.BaseFragment.java
android.howard.exp.fragment.MenuDrawer.java
android.howard.exp.fragment.RootPage.java
android.howard.exp.fragment.TextReader.java
android.howard.exp.utils.TextFileReader.java
android.howard.exp.views.FlectImageView.java
android.howard.exp.views.ListViewCompat.java
android.howard.exp.views.SlideView.java
com.bpok.fileex.FileExApp.java