Don't show empty list message until cursor finishes loading.

Also forceably hid the "update all" button in the update tab.
This is because on my crapy LG Tracphone android-10 device, it is slow
enough that I can see that button appear and then disappear.
This commit is contained in:
Peter Serwylo 2015-04-12 10:48:02 +10:00
parent 8b7a9f215c
commit 0174b4ca00
2 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,11 @@ abstract public class AppListAdapter extends CursorAdapter {
init(context);
}
@Override
public boolean isEmpty() {
return mDataValid && super.isEmpty();
}
public AppListAdapter(Context context, Cursor c, boolean autoRequery) {
super(context, c, autoRequery);
init(context);

View File

@ -139,6 +139,7 @@ public class CanUpdateAppsFragment extends AppListFragment {
mUpdateAllButton.setText(R.string.update_all);
mUpdateAllButton.setCompoundDrawablesWithIntrinsicBounds(
getResources().getDrawable(R.drawable.ic_menu_refresh), null, null, null);
mUpdateAllButton.setVisibility(View.GONE);
linearLayout.addView(mUpdateAllButton, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));