Example usage for android.widget AdapterView getTop

List of usage examples for android.widget AdapterView getTop

Introduction

In this page you can find the example usage for android.widget AdapterView getTop.

Prototype

@ViewDebug.CapturedViewProperty
public final int getTop() 

Source Link

Document

Top position of this view relative to its parent.

Usage

From source file:org.hedgewars.hedgeroid.Downloader.DownloadListFragment.java

public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
    DownloadPackage task = (DownloadPackage) arg0.getAdapter().getItem(position);
    /*//from  ww w.j a  va  2s .co  m
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    Fragment prev = getFragmentManager().findFragmentByTag("dialog");
            
    //remove any old dialogs
    if(prev != null) ft.remove(prev);
    ft.addToBackStack(null);
            
    //create a new dialog based on this task
            
    DialogFragment newFragment = DownloadDialogFragment.newInstance(task);
            
    //show it
    newFragment.show(ft, "dialog");
     */
    targetView = arg1;

    //determine state
    int min = arg0.getTop();
    int max = arg0.getBottom();
    int top = targetView.getTop();

    previousXCoord = top;
    for (OnItemMovementListener listener : listeners) {
        listener.onNewItemSelected(task, top, min, max, targetView.getHeight() * 2);
    }
}