summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/incallui/CallCardFragment.java11
-rw-r--r--src/com/android/incallui/InCallActivity.java21
2 files changed, 31 insertions, 1 deletions
diff --git a/src/com/android/incallui/CallCardFragment.java b/src/com/android/incallui/CallCardFragment.java
index 683b8d9c..78d18534 100644
--- a/src/com/android/incallui/CallCardFragment.java
+++ b/src/com/android/incallui/CallCardFragment.java
@@ -1356,12 +1356,21 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
updateFabPosition();
}
- private void updateFabPosition() {
+ public void updateFabPosition() {
+ updateFabPosition(0);
+ }
+
+ public void updateFabPosition(int yOffset) {
int offsetY = 0;
if (!mIsDialpadShowing) {
offsetY = mFloatingActionButtonVerticalOffset;
if (mSecondaryCallInfo.isShown()) {
offsetY -= mSecondaryCallInfo.getHeight();
+ } else if (yOffset != 0) {
+ // This needs to not happen if/when we move to
+ // android.support.design.widget.FloatingActionButton instead of rolling our
+ // own implementation
+ offsetY -= yOffset;
}
}
diff --git a/src/com/android/incallui/InCallActivity.java b/src/com/android/incallui/InCallActivity.java
index 3daa7dcd..baf4691e 100644
--- a/src/com/android/incallui/InCallActivity.java
+++ b/src/com/android/incallui/InCallActivity.java
@@ -1048,6 +1048,27 @@ public class InCallActivity extends Activity implements FragmentDisplayManager {
" intent", e);
}
}
+ })
+ .setCallback(new Snackbar.Callback() {
+ @Override
+ public void onDismissed(Snackbar snackbar, int event) {
+ if (DEBUG) {
+ Log.d(TAG, "Snackbar.Callback.onDismissed");
+ }
+ if (mCallCardFragment != null) {
+ mCallCardFragment.updateFabPosition();
+ }
+ }
+
+ @Override
+ public void onShown(Snackbar snackbar) {
+ if (DEBUG) {
+ Log.d(TAG, "Snackbar.Callback.onShown");
+ }
+ if (mCallCardFragment != null) {
+ mCallCardFragment.updateFabPosition(snackbar.getView().getHeight());
+ }
+ }
});
}
mInviteSnackbar.show();