Merge pull request #850 from da-kid/master

Fixed pull2refresh bugs
This commit is contained in:
Dominik Schürmann 2014-09-14 00:08:12 +02:00
commit 6156600e42
3 changed files with 33 additions and 29 deletions

View File

@ -641,7 +641,6 @@ public class KeychainIntentService extends IntentService implements Progressable
sendErrorToHandler(e);
}
} else if (ACTION_DOWNLOAD_AND_IMPORT_KEYS.equals(action) || ACTION_IMPORT_KEYBASE_KEYS.equals(action)) {
try {
ArrayList<ImportKeysListEntry> entries = data.getParcelableArrayList(DOWNLOAD_KEY_LIST);
// this downloads the keys and places them into the ImportKeysListEntry entries
@ -649,6 +648,7 @@ public class KeychainIntentService extends IntentService implements Progressable
ArrayList<ParcelableKeyRing> keyRings = new ArrayList<ParcelableKeyRing>(entries.size());
for (ImportKeysListEntry entry : entries) {
try {
Keyserver server;
if (entry.getOrigin() == null) {
server = new HkpKeyserver(keyServer);
@ -671,6 +671,9 @@ public class KeychainIntentService extends IntentService implements Progressable
// save key bytes in entry object for doing the
// actual import afterwards
keyRings.add(new ParcelableKeyRing(downloadedKeyBytes, entry.getFingerprintHex()));
} catch (Exception e) {
sendErrorToHandler(e);
}
}
Intent importIntent = new Intent(this, KeychainIntentService.class);
@ -686,9 +689,6 @@ public class KeychainIntentService extends IntentService implements Progressable
onHandleIntent(importIntent);
// result is handled in ACTION_IMPORT_KEYRING
} catch (Exception e) {
sendErrorToHandler(e);
}
} else if (ACTION_CERTIFY_KEYRING.equals(action)) {
try {

View File

@ -82,7 +82,7 @@ import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
*/
public class KeyListFragment extends LoaderFragment
implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener,
LoaderManager.LoaderCallbacks<Cursor>, NoScrollableSwipeRefreshLayout.OnRefreshListener {
LoaderManager.LoaderCallbacks<Cursor>, ListAwareSwipeRefreshLayout.OnRefreshListener {
private KeyListAdapter mAdapter;
private StickyListHeadersListView mStickyList;

View File

@ -70,9 +70,13 @@ public class ListAwareSwipeRefreshLayout extends NoScrollableSwipeRefreshLayout
return (mIsLocked || (
mStickyListHeadersListView.getWrappedList().getChildCount() > 0
&& (mStickyListHeadersListView.getTop() > 0
|| mStickyListHeadersListView.getFirstVisiblePosition() > 0
))
&&
(
mStickyListHeadersListView.getWrappedList().getChildAt(0).getTop() < 0
||
mStickyListHeadersListView.getFirstVisiblePosition() > 0
)
)
);
}
}