Skip to content
Browse files

Fixed "disappearing footers" bug for CsSnapshotListFragment

If you swipe the CsSnapshotListFragment too far off screen then get it to reload (e.g. starting from CsSnapshotListFragment, go all the way to CsAccountsFragment and then back), though the snapshot items are all reloaded correctly, the footers do not get shown.  You can get them to re-display by shifting orientation or existing and restarting the app, but not by pausing and resuming it.

Changed the setListAdapter-related code to always null-and-set even when we are re-using a previously set adapter, which seems to make the list recognize the set footers and display them.

CsVmListFragment should have the exact same problem, but since it is the middle screen right now, there doesn't seem to be a case where we can swipe far off enough to get multi-list to unload it.  Made the same fix to CsVmListFragment anyways just in case.

--
CsSnapshotListFragment/CsSnapshotListFragment
- fixed disappearing footer bug

README
- updated Cumulus 1.2 APK build number
  • Loading branch information...
1 parent 56079f2 commit 7f61557c399e8058320729ad6e338ad54ce07b6b @creationline committed Feb 23, 2012
View
11 CloudStackAndroidClient/src/com/creationline/cloudstack/ui/CsSnapshotListFragment.java
@@ -327,8 +327,17 @@ public ResourceCursorAdapter setupListAdapter(final int listLoaderId) {
//set-up the loader & adapter for populating this list
getLoaderManager().initLoader(listLoaderId, null, this);
listAdapter = new CsSnapshotListAdapter(getActivity().getApplicationContext(), R.layout.cssnapshotlistitem, null, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
- setListAdapter(listAdapter);
}
+ //we want to null-and-set the listAdapter explicitly regardless of whether we are
+ //creating from scratch or re-setting an existing adapter b/c if we don't do this,
+ //the list seems to lose track of the display of the footers (the list seems to
+ //recognize the footers as existing, the footer ids exist in the layout, but are
+ //not shown on screen after the list view is reloaded after being swiped too
+ //far off-screen (current guess is that being swiped off the multi-list screen
+ //results in a state that is not quite paused (destroys ui-level elements),
+ //but not quite destroyed either (adapter, non-ui part of footer, layout)))
+ setListAdapter(null);
+ setListAdapter(listAdapter);
return listAdapter;
}
View
11 CloudStackAndroidClient/src/com/creationline/cloudstack/ui/CsVmListFragment.java
@@ -326,8 +326,17 @@ public ResourceCursorAdapter setupListAdapter(final int listLoaderId) {
//set-up the loader & adapter for populating this list
getLoaderManager().initLoader(listLoaderId, null, this);
listAdapter = new CsVmListAdapter(getActivity().getApplicationContext(), R.layout.csvmlistitem, null, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
- setListAdapter(listAdapter);
}
+ //we want to null-and-set the listAdapter explicitly regardless of whether we are
+ //creating from scratch or re-setting an existing adapter b/c if we don't do this,
+ //the list seems to lose track of the display of the footers (the list seems to
+ //recognize the footers as existing, the footer ids exist in the layout, but are
+ //not shown on screen after the list view is reloaded after being swiped too
+ //far off-screen (current guess is that being swiped off the multi-list screen
+ //results in a state that is not quite paused (destroys ui-level elements),
+ //but not quite destroyed either (adapter, non-ui part of footer, layout)))
+ setListAdapter(null);
+ setListAdapter(listAdapter);
return listAdapter;
}
View
4 CloudStackAndroidClient/src/com/creationline/cloudstack/utils/Revision.java
@@ -27,8 +27,8 @@
///hand for end-user display purposes. This file is sync-ed to bzr.
public class Revision {
- public static final int REVISION_NO = 140;
- public static final String REVISION_ID = "tzuhan@creationline.com-20120222071513-wbb653173p2r7j6q";
+ public static final int REVISION_NO = 141;
+ public static final String REVISION_ID = "tzuhan@creationline.com-20120222072142-j0gys7a5zvq9luzf";
@Override
public String toString() {
View
2 README
@@ -28,7 +28,7 @@ Please note that since integration is via the Zabbix API, Zabbix server version
How can I install it?
---------------------
The quickest way to just get a working app is to download the pre-built CloudStackAndroidClient.apk file and install it directly on your Android device. Note that to install apps directly from the APK file, your �gSettings->Application Settings->Unknown Sources�h setting must be enabled. You can transfer the APK file via an SD card, using a service like Dropbox to transfer it wirelessly, or even email it to yourself.
-The lastest pre-built APK is version 1.2 (141).
+The lastest pre-built APK is version 1.2 (142).
What Android phones can I use it on?

0 comments on commit 7f61557

Please sign in to comment.
Something went wrong with that request. Please try again.