Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9a78643 authored by Daniel Lehmann's avatar Daniel Lehmann
Browse files

Shortened the animation duration

Bug:5982894
Change-Id: Iae36b379d08a0e7a140953b77711b822f66d4965
parent 8b4cef3c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public abstract class PinnedHeaderListAdapter extends CompositeCursorAdapter
        this.mPinnedPartitionHeadersEnabled = flag;
    }

    @Override
    public int getPinnedHeaderCount() {
        if (mPinnedPartitionHeadersEnabled) {
            return getPartitionCount();
@@ -65,6 +66,7 @@ public abstract class PinnedHeaderListAdapter extends CompositeCursorAdapter
     * The default implementation creates the same type of view as a normal
     * partition header.
     */
    @Override
    public View getPinnedHeaderView(int partition, View convertView, ViewGroup parent) {
        if (hasHeader(partition)) {
            View view = null;
@@ -87,6 +89,7 @@ public abstract class PinnedHeaderListAdapter extends CompositeCursorAdapter
        }
    }

    @Override
    public void configurePinnedHeaders(PinnedHeaderListView listView) {
        if (!mPinnedPartitionHeadersEnabled) {
            return;
@@ -161,6 +164,7 @@ public abstract class PinnedHeaderListAdapter extends CompositeCursorAdapter
        }
    }

    @Override
    public int getScrollPositionForHeader(int viewIndex) {
        return getPositionForPartition(viewIndex);
    }
+5 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class PinnedHeaderListView extends AutoScrollListView
    private static final int BOTTOM = 1;
    private static final int FADING = 2;

    private static final int DEFAULT_ANIMATION_DURATION = 100;
    private static final int DEFAULT_ANIMATION_DURATION = 20;

    private static final class PinnedHeader {
        View view;
@@ -149,6 +149,7 @@ public class PinnedHeaderListView extends AutoScrollListView
        super.setOnItemSelectedListener(this);
    }

    @Override
    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
            int totalItemCount) {
        if (mAdapter != null) {
@@ -187,6 +188,7 @@ public class PinnedHeaderListView extends AutoScrollListView
        return mSize > 0 ? 0 : super.getTopFadingEdgeStrength();
    }

    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
        mScrollState = scrollState;
        if (mOnScrollListener != null) {
@@ -198,13 +200,13 @@ public class PinnedHeaderListView extends AutoScrollListView
     * Ensures that the selected item is positioned below the top-pinned headers
     * and above the bottom-pinned ones.
     */
    @Override
    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
        int height = getHeight();

        int windowTop = 0;
        int windowBottom = height;

        int prevHeaderBottom = 0;
        for (int i = 0; i < mSize; i++) {
            PinnedHeader header = mHeaders[i];
            if (header.visible) {
@@ -231,6 +233,7 @@ public class PinnedHeaderListView extends AutoScrollListView
        }
    }

    @Override
    public void onNothingSelected(AdapterView<?> parent) {
        if (mOnItemSelectedListener != null) {
            mOnItemSelectedListener.onNothingSelected(parent);