summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2015-01-09 02:01:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-09 02:01:11 +0000
commitbcbf5b1ac1eb65fc679c5b6e9c28a1af0c71fc65 (patch)
tree2e9de42bdbe3a26fc5b2a29bc2852cd0fe1dc6c7 /src
parentebc7ab5c42240d8cfbb34245d7e996091c480aaa (diff)
parent935dc32e4a9302e9c121cd0a18b00f0e565c2bef (diff)
am 935dc32e: am 97d15c72: Merge "Fixing overlap pane offset when shortcut card disappears." into lmp-mr1-dev
* commit '935dc32e4a9302e9c121cd0a18b00f0e565c2bef': Fixing overlap pane offset when shortcut card disappears.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/list/ListsFragment.java7
-rw-r--r--src/com/android/dialer/widget/OverlappingPaneLayout.java16
2 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index 408d5b1f1..af82e4075 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -90,6 +90,7 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
private ShortcutCardsAdapter mMergedAdapter;
private CallLogAdapter mCallLogAdapter;
private CallLogQueryHandler mCallLogQueryHandler;
+ private OverlappingPaneLayout mOverlappingPaneLayout;
private boolean mIsPanelOpen = true;
@@ -302,6 +303,7 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
mRemoveViewContent = parentView.findViewById(R.id.remove_view_content);
setupPaneLayout((OverlappingPaneLayout) parentView);
+ mOverlappingPaneLayout = (OverlappingPaneLayout) parentView;
return parentView;
}
@@ -322,6 +324,11 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
mCallLogAdapter.changeCursor(cursor);
mMergedAdapter.notifyDataSetChanged();
+
+ // Refresh the overlapping pane to ensure that any changes in the shortcut card height
+ // are appropriately reflected in the overlap position.
+ mOverlappingPaneLayout.refresh();
+
// Return true; took ownership of cursor
return true;
}
diff --git a/src/com/android/dialer/widget/OverlappingPaneLayout.java b/src/com/android/dialer/widget/OverlappingPaneLayout.java
index 8f911c2da..167b849f2 100644
--- a/src/com/android/dialer/widget/OverlappingPaneLayout.java
+++ b/src/com/android/dialer/widget/OverlappingPaneLayout.java
@@ -717,6 +717,22 @@ public class OverlappingPaneLayout extends ViewGroup {
return wantTouchEvents;
}
+ /**
+ * Refreshes the {@link OverlappingPaneLayout} be attempting to re-open or re-close the pane.
+ * This ensures that the overlapping pane is repositioned based on any changes to the view
+ * which is being overlapped.
+ * <p>
+ * The {@link #openPane()} and {@link #closePane()} methods do not perform any animation if the
+ * pane has already been positioned appropriately.
+ */
+ public void refresh() {
+ if (isOpen()) {
+ openPane();
+ } else {
+ closePane();
+ }
+ }
+
private boolean closePane(View pane, int initialVelocity) {
if (mFirstLayout || smoothSlideTo(0.f, initialVelocity)) {
mPreservedOpenState = false;