diff options
author | Christine Chen <christinech@google.com> | 2013-08-02 20:31:31 -0700 |
---|---|---|
committer | Christine Chen <christinech@google.com> | 2013-08-06 12:40:25 -0700 |
commit | e7097d78980eccdc2425266db92a3e88f4f5c1a5 (patch) | |
tree | 60fd7261f2fafa69ab6a21363b5a2a65ef77f764 /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | 1b60e8c70bdcbf07c3efab310790134ecf81d4fd (diff) |
Dialpad Ui elements for InCallUi
Change-Id: I7b230cc46993493459923c436a643910026cf6a6
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 9eb54ee5e..28e02b3b3 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -33,6 +33,7 @@ public class InCallActivity extends Activity { private CallButtonFragment mCallButtonFragment; private CallCardFragment mCallCardFragment; private AnswerFragment mAnswerFragment; + private DialpadFragment mDialpadFragment; @Override protected void onCreate(Bundle icicle) { @@ -133,7 +134,16 @@ public class InCallActivity extends Activity { @Override public void onBackPressed() { - // TODO(klp): implement + // TODO(klp): implement fully + Logger.d(this, "onBackPressed()..."); + + // BACK is also used to exit out of any "special modes" of the + // in-call UI: + + if (mDialpadFragment.isVisible()) { + mCallButtonFragment.displayDialpad(false); // do the "closing" animation + return; + } // Nothing special to do. Fall back to the default behavior. super.onBackPressed(); @@ -185,8 +195,7 @@ public class InCallActivity extends Activity { break; } - // TODO(klp): handle dialer key down - + // TODO(klp) Adds hardware keyboard support return super.onKeyDown(keyCode, event); } @@ -208,6 +217,12 @@ public class InCallActivity extends Activity { .findFragmentById(R.id.answerFragment); } + if (mDialpadFragment == null) { + mDialpadFragment = (DialpadFragment) getFragmentManager() + .findFragmentById(R.id.dialpadFragment); + mDialpadFragment.getView().setVisibility(View.INVISIBLE); + } + setUpPresenters(); } @@ -235,4 +250,14 @@ public class InCallActivity extends Activity { toast.show(); } + + public void displayDialpad(boolean showDialpad) { + if (showDialpad) { + mDialpadFragment.setVisible(true); + mCallCardFragment.setVisible(false); + } else { + mDialpadFragment.setVisible(false); + mCallCardFragment.setVisible(true); + } + } } |