diff options
author | Richard MacGregor <rmacgregor@cyngn.com> | 2016-02-19 15:25:54 -0800 |
---|---|---|
committer | Richard MacGregor <rmacgregor@cyngn.com> | 2016-04-08 09:16:15 -0700 |
commit | d4812c8e7a5b192a1f1ce522c02e8d14a0ae1031 (patch) | |
tree | a696e58e33851a9c67c23f37d2e1a1a41b058cad /src | |
parent | c05de726bc59d7182590ce22399f9cb48afd2ca7 (diff) | |
download | packages_apps_InCallUI-d4812c8e7a5b192a1f1ce522c02e8d14a0ae1031.tar.gz packages_apps_InCallUI-d4812c8e7a5b192a1f1ce522c02e8d14a0ae1031.tar.bz2 packages_apps_InCallUI-d4812c8e7a5b192a1f1ce522c02e8d14a0ae1031.zip |
Adjust end call fab relative to invite snackbar
Requires http://review.cyanogenmod.org/#/c/133551/
Change-Id: I40f94944c5c45106ce2f2fdff97420f56d3f19ef
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/incallui/CallCardFragment.java | 11 | ||||
-rw-r--r-- | src/com/android/incallui/InCallActivity.java | 21 |
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(); |