Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.os.Build;
import android.util.Log;
import android.view.View;
import android.widget.AbsListView;

public class Main {
    public static boolean canChildScrollUp(View view) {
        if (view instanceof AbsListView) {
            AbsListView absListView = (AbsListView) view;
            Log.d("debug", absListView.getChildAt(0).getTop() + "v2top");
            return absListView.getChildCount() > 0 && (absListView.getFirstVisiblePosition() > 0
                    || absListView.getChildAt(0).getTop() < absListView.getPaddingTop());
        }
        if (Build.VERSION.SDK_INT < 14) {
            return view.getScrollY() > 0;
        } else {
            return view.canScrollVertically(-1);
        }
    }
}