summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/AdapterViewAnimator.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-09-23 16:40:28 -0700
committerWinson Chung <winsonc@google.com>2010-09-24 17:00:30 -0700
commit3ec9a45c36d3ca5ffbc6e85bbeb497b065e14155 (patch)
treecefe7f8198b857a8d6edd038f3abdfc2c4247f10 /core/java/android/widget/AdapterViewAnimator.java
parent8cb9e9c5c71dabba826545b3d1fa0cd675f95100 (diff)
downloadframeworks_base-3ec9a45c36d3ca5ffbc6e85bbeb497b065e14155.zip
frameworks_base-3ec9a45c36d3ca5ffbc6e85bbeb497b065e14155.tar.gz
frameworks_base-3ec9a45c36d3ca5ffbc6e85bbeb497b065e14155.tar.bz2
Re-architecting RemoteViewsAdapter internals due to new constraints.
- Respecting the AdapterView/Adapter contract using FrameLayout notification to update individual items - Initial changes to allow for keeping (currently bitmap only) memory in check when loading numerous RemoteViews - Fixing issue with leaking activities due to extra service connection references - Fixing issue with multiple RemoteViewsAdapters being set on the same AdapterView - Fixing small issue with StackView sometimes requesting indices out of bounds - Removing background loading, reverting to previous message-queuing method (seems to be performant now) Change-Id: I42313767aa791dfe35c247c97ae5d64389e6bb4c
Diffstat (limited to 'core/java/android/widget/AdapterViewAnimator.java')
-rw-r--r--core/java/android/widget/AdapterViewAnimator.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java
index c08adb2..f245933 100644
--- a/core/java/android/widget/AdapterViewAnimator.java
+++ b/core/java/android/widget/AdapterViewAnimator.java
@@ -389,7 +389,7 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
int newWindowStartUnbounded = childIndex - mActiveOffset;
int newWindowEndUnbounded = newWindowStartUnbounded + mNumActiveViews - 1;
int newWindowStart = Math.max(0, newWindowStartUnbounded);
- int newWindowEnd = Math.min(mAdapter.getCount(), newWindowEndUnbounded);
+ int newWindowEnd = Math.min(mAdapter.getCount() - 1, newWindowEndUnbounded);
// This section clears out any items that are in our mActiveViews list
// but are outside the effective bounds of our window (this is becomes an issue
@@ -592,18 +592,18 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
*/
private SavedState(Parcel in) {
super(in);
- whichChild = in.readInt();
+ this.whichChild = in.readInt();
}
@Override
public void writeToParcel(Parcel out, int flags) {
super.writeToParcel(out, flags);
- out.writeInt(whichChild);
+ out.writeInt(this.whichChild);
}
@Override
public String toString() {
- return "AdapterViewAnimator.SavedState{ whichChild = " + whichChild + " }";
+ return "AdapterViewAnimator.SavedState{ whichChild = " + this.whichChild + " }";
}
public static final Parcelable.Creator<SavedState> CREATOR
@@ -781,10 +781,13 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
public void setRemoteViewsAdapter(Intent intent) {
// Ensure that we don't already have a RemoteViewsAdapter that is bound to an existing
// service handling the specified intent.
- Intent.FilterComparison fc = new Intent.FilterComparison(intent);
- if (mRemoteViewsAdapter != null &&
- fc.equals(mRemoteViewsAdapter.getRemoteViewsServiceIntent())) {
- return;
+ if (mRemoteViewsAdapter != null) {
+ Intent.FilterComparison fcNew = new Intent.FilterComparison(intent);
+ Intent.FilterComparison fcOld = new Intent.FilterComparison(
+ mRemoteViewsAdapter.getRemoteViewsServiceIntent());
+ if (fcNew.equals(fcOld)) {
+ return;
+ }
}
// Otherwise, create a new RemoteViewsAdapter for binding