diff options
author | Santos Cordon <santoscordon@google.com> | 2013-07-30 18:27:35 -0700 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2013-07-31 10:25:28 -0700 |
commit | c2b430394ac612ba4dd455fb988e29bfcc4d5c5f (patch) | |
tree | 54cc0632ce2bdb04bc69d0dc80e533d28c5c66df /InCallUI/src/com/android/incallui/InCallActivity.java | |
parent | 8f34bc316f681d185f99e7e87cd959b391b9b86c (diff) |
Adding simple number data to callcard
This CL allows the number to be displayed in the CallCard.
Previous interaction:
CallHandlerService->CallList CallCardFragment (isolated, no data)
New interaction:
CallHandlerService->MainHandler->CallList->CallCardPresenter->CallCardFragment
1) CallHandlerService.MainHandler: executes remote method calls on the
main thread.
2) CallList: Added support for listeners.
3) CallCardPresenter: Presenter layer for fragment. Listens to CallList
4) CallCardFragment: Gets real data from presenter, displays phone #.
Change-Id: I6de3a9da15b69d44826c3226701eed6a1b86239c
Diffstat (limited to 'InCallUI/src/com/android/incallui/InCallActivity.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 71e981b94..04f1f09b1 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -38,6 +38,7 @@ public class InCallActivity extends Activity implements CallButtonPresenter.EndC private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE); private CallButtonPresenter mCallButtonPresenter; + private CallCardPresenter mCallCardPresenter; @Override protected void onCreate(Bundle icicle) { @@ -57,6 +58,8 @@ public class InCallActivity extends Activity implements CallButtonPresenter.EndC // Inflate everything in incall_screen.xml and add it to the screen. setContentView(R.layout.incall_screen); + initializeInCall(); + logD("onCreate(): exit"); } @@ -65,11 +68,6 @@ public class InCallActivity extends Activity implements CallButtonPresenter.EndC protected void onResume() { logD("onResume()..."); - final CallButtonFragment callButtonFragment = (CallButtonFragment) getFragmentManager() - .findFragmentById(R.id.callButtonFragment); - mCallButtonPresenter = callButtonFragment.getPresenter(); - mCallButtonPresenter.setEndCallListener(this); - // TODO(klp): create once and reset when needed. final AnswerFragment answerFragment = new AnswerFragment(); final AnswerPresenter presenter = answerFragment.getPresenter(); @@ -207,8 +205,20 @@ public class InCallActivity extends Activity implements CallButtonPresenter.EndC return super.onKeyDown(keyCode, event); } + private void initializeInCall() { + + final CallButtonFragment callButtonFragment = (CallButtonFragment) getFragmentManager() + .findFragmentById(R.id.callButtonFragment); + mCallButtonPresenter = callButtonFragment.getPresenter(); + mCallButtonPresenter.setEndCallListener(this); + + final CallCardFragment callCardFragment = (CallCardFragment) getFragmentManager() + .findFragmentById(R.id.callCardFragment); + } + private void toast(String text) { final Toast toast = Toast.makeText(this, text, Toast.LENGTH_SHORT); + toast.show(); } |