diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-07-23 13:30:19 -0700 |
---|---|---|
committer | Chiao Cheng <chiaocheng@google.com> | 2013-07-24 14:52:07 -0700 |
commit | a152b4605cd8f441257f8b561fb8b1473e34c8a9 (patch) | |
tree | 76a9dc7c6c7f4a6d4d019423b97e012f7e410f44 /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | 65c46da8d41a40110e19b0bbe3bc86ac341e3cbd (diff) |
Integrating mute and speaker buttons.
* Adding base classes for presenter, ui and fragments.
* Moved common presenter integration logic into base fragment.
* Adding presenter to handle button logic.
* Integrated disconnect and text from glowpad to presenter.
* Changed in-call buttons to be invisible so they do not show under transparent
glowpad.
Change-Id: I446db149769b5cf1abce960ecede01effeabfe1e
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 380d48764..c2e0b0516 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -37,6 +37,8 @@ public class InCallActivity extends Activity { private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE); + private CallButtonPresenter mCallButtonPresenter; + @Override protected void onCreate(Bundle icicle) { logD("onCreate()... this = " + this); @@ -58,18 +60,26 @@ public class InCallActivity extends Activity { logD("onCreate(): exit"); } + @Override protected void onResume() { logD("onResume()..."); + final CallButtonFragment callButtonFragment = (CallButtonFragment) getFragmentManager() + .findFragmentById(R.id.callButtonFragment); + mCallButtonPresenter = callButtonFragment.getPresenter(); + // TODO(klp): create once and reset when needed. final AnswerFragment answerFragment = new AnswerFragment(); - final CallCardFragment callCardFragment = new CallCardFragment(); - final CallButtonFragment callButtonFragment = new CallButtonFragment(); - final FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); - fragmentTransaction.add(R.id.in_call_and_button_container, callCardFragment); - fragmentTransaction.add(R.id.in_call_and_button_container, callButtonFragment); + final AnswerPresenter presenter = answerFragment.getPresenter(); + presenter.addCloseListener(new AnswerPresenter.Listener() { + @Override + public void onClose() { + mCallButtonPresenter.show(); + } + }); + final FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.add(R.id.main, answerFragment); fragmentTransaction.commit(); super.onResume(); @@ -206,10 +216,4 @@ public class InCallActivity extends Activity { Log.d(TAG, msg); } } - - private void logV(String msg) { - if (VERBOSE) { - Log.v(TAG, msg); - } - } } |