mirror of
https://github.com/moparisthebest/k-9
synced 2024-08-13 17:03:48 -04:00
34 lines
1.0 KiB
Java
34 lines
1.0 KiB
Java
|
package com.fsck.k9.view;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.os.Parcelable;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.widget.ListView;
|
||
|
|
||
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
||
|
|
||
|
|
||
|
public class K9PullToRefreshListView extends PullToRefreshListView {
|
||
|
|
||
|
public K9PullToRefreshListView(Context context, AttributeSet attrs) {
|
||
|
super(context, attrs);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected ListView createListView(Context context, AttributeSet attrs) {
|
||
|
return new ListView(context, attrs) {
|
||
|
@Override
|
||
|
public void onRestoreInstanceState(Parcelable state) {
|
||
|
super.onRestoreInstanceState(state);
|
||
|
|
||
|
/*
|
||
|
* Force the list view to apply the restored state instantly instead of
|
||
|
* asynchronously, so potential data changes (which in turn cause an internal
|
||
|
* position save/restore) don't overwrite our saved position.
|
||
|
*/
|
||
|
layoutChildren();
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|