From: jabarros Date: Thu, 22 Jan 2015 12:14:57 +0000 (+0100) Subject: Fixed. Some message dissapear from list view as 'loading' and 'nothing in here...' X-Git-Tag: oc-android-1.7.0_signed~16^2~8 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/18b45ff589c537735f95573fe627f72e7c8a643a?hp=--cc Fixed. Some message dissapear from list view as 'loading' and 'nothing in here...' --- 18b45ff589c537735f95573fe627f72e7c8a643a diff --git a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 3b5429f4..02f4103d 100644 --- a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -76,12 +76,18 @@ implements OnItemClickListener, OnEnforceableRefreshListener { } public void setFooterView(View footer) { - // TODO find solution imageView.addFooterView(footer, null, false); imageView.invalidate(); } + public void removeFooterView(View footer) { + imageView.removeFooterView(footer); + imageView.invalidate(); + } + public int getFooterViewCount() { + return imageView.getFooterViewCount(); + } protected void switchImageView(){ imageView.setNumColumns(GridView.AUTO_FIT); diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index 4b3d6f85..fa144b8a 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -29,6 +29,7 @@ import android.view.ContextMenu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.TextView; @@ -438,6 +439,17 @@ public class OCFileListFragment extends ExtendedListFragment { } else if (folders > 1) { output = output + folders.toString() + " " + getResources().getString(R.string.file_list_folders); } + + // Fix for showing or not to show the footerView + if (folders == 0 && files == 0) { // If no files or folders, remove footerView for allowing + // to show the emptyList message + removeFooterView(mFooterView); + } else { // set a new footerView if there is not one for showing the number or files/folders + if (getFooterViewCount()== 0) { + ((ViewGroup)mFooterView.getParent()).removeView(mFooterView); + setFooterView(mFooterView); + } + } return output; }