diff --git a/document-picker/src/main/java/com/mobilejazz/coltrane/ui/DocumentBrowserActivity.java b/document-picker/src/main/java/com/mobilejazz/coltrane/ui/DocumentBrowserActivity.java index 507b311..b29338e 100644 --- a/document-picker/src/main/java/com/mobilejazz/coltrane/ui/DocumentBrowserActivity.java +++ b/document-picker/src/main/java/com/mobilejazz/coltrane/ui/DocumentBrowserActivity.java @@ -327,7 +327,7 @@ public List loadInBackground() { } @Override - public void onLoadFinished(Loader> loader, List data) { + public void onLoadFinished(Loader> loader, final List data) { mDrawerAdapter.clear(); mDrawerAdapter.addAll(data); populateRootIndices(); @@ -335,12 +335,16 @@ public void onLoadFinished(Loader> loader, List data) { mHandler.post(new Runnable() { @Override public void run() { - if (mSavedInstanceState == null) { - selectItem(0); + if (data.size() > 0) { + if (mSavedInstanceState == null) { + selectItem(0); + } else { + int selected = mSavedInstanceState.getInt(SELECTED_ITEM); + mCurrentDocumentId = mSavedInstanceState.getString(PATH); + selectItem(selected); + } } else { - int selected = mSavedInstanceState.getInt(SELECTED_ITEM); - mCurrentDocumentId = mSavedInstanceState.getString(PATH); - selectItem(selected); + mNavigationAdapter.setHeader(getString(R.string.no_provider)); } } }); diff --git a/document-picker/src/main/res/values/strings.xml b/document-picker/src/main/res/values/strings.xml index 2bb05b9..bc96a21 100644 --- a/document-picker/src/main/res/values/strings.xml +++ b/document-picker/src/main/res/values/strings.xml @@ -3,4 +3,5 @@ Open from Open Provider Selection Close Provider Selection + No Provider Available diff --git a/document-picker/src/main/res/values/styles.xml b/document-picker/src/main/res/values/styles.xml index fd27416..69312a3 100644 --- a/document-picker/src/main/res/values/styles.xml +++ b/document-picker/src/main/res/values/styles.xml @@ -17,6 +17,9 @@ 5dp 20dp ?android:attr/textColorHighlightInverse + + marquee + true