diff --git a/packages/DocumentsUI/res/drawable/cabinet.png b/packages/DocumentsUI/res/drawable/cabinet.png deleted file mode 100644 index da440239cd0f4..0000000000000 Binary files a/packages/DocumentsUI/res/drawable/cabinet.png and /dev/null differ diff --git a/packages/DocumentsUI/res/drawable/cabinet.xml b/packages/DocumentsUI/res/drawable/cabinet.xml new file mode 100644 index 0000000000000..843ffc74e593b --- /dev/null +++ b/packages/DocumentsUI/res/drawable/cabinet.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/DocumentsUI/res/drawable/hourglass.xml b/packages/DocumentsUI/res/drawable/hourglass.xml new file mode 100644 index 0000000000000..9b8d0e2946bad --- /dev/null +++ b/packages/DocumentsUI/res/drawable/hourglass.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java index 1e3da6b1ac8a4..70bee3cd3c6e0 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java @@ -100,7 +100,6 @@ import com.android.documentsui.model.DocumentStack; import com.android.documentsui.model.RootInfo; import com.android.documentsui.services.FileOperationService; import com.android.documentsui.services.FileOperations; - import com.google.common.collect.Lists; import java.util.ArrayList; @@ -854,27 +853,28 @@ public class DirectoryFragment extends Fragment implements DocumentsAdapter.Envi } private void showEmptyDirectory() { - showEmptyView(R.string.empty); + showEmptyView(R.string.empty, R.drawable.cabinet); } private void showNoResults(RootInfo root) { CharSequence msg = getContext().getResources().getText(R.string.no_results); - showEmptyView(String.format(String.valueOf(msg), root.title)); + showEmptyView(String.format(String.valueOf(msg), root.title), R.drawable.cabinet); } - // Shows an error indicating documents couldn't be queried. private void showQueryError() { - showEmptyView(R.string.query_error); + showEmptyView(R.string.query_error, R.drawable.hourglass); } - private void showEmptyView(@StringRes int id) { - showEmptyView(getContext().getResources().getText(id)); + private void showEmptyView(@StringRes int id, int drawable) { + showEmptyView(getContext().getResources().getText(id), drawable); } - private void showEmptyView(CharSequence msg) { + private void showEmptyView(CharSequence msg, int drawable) { View content = mEmptyView.findViewById(R.id.content); TextView msgView = (TextView) mEmptyView.findViewById(R.id.message); + ImageView imageView = (ImageView) mEmptyView.findViewById(R.id.artwork); msgView.setText(msg); + imageView.setImageResource(drawable); content.animate().cancel(); // cancel any ongoing animations