From e58788a9fc47164e3586e862df1427b89cbe02db Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Wed, 24 Jul 2013 19:19:03 -0700 Subject: Finishing in call screen when call ends. Change-Id: I80220deb47ec17fbfb017795f916ba0822ea41da --- .../com/android/incallui/CallButtonFragment.java | 14 ++++++++------ .../com/android/incallui/CallButtonPresenter.java | 22 ++++++++++++++++++++-- .../src/com/android/incallui/InCallActivity.java | 8 +++++++- 3 files changed, 35 insertions(+), 9 deletions(-) (limited to 'InCallUI/src') diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 8b90c5d49..0e9fa9a47 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -23,15 +23,14 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.CompoundButton; import android.widget.ToggleButton; /** * Fragment for call control buttons */ -public class CallButtonFragment extends BaseFragment implements - CallButtonPresenter.CallButtonUi { +public class CallButtonFragment extends BaseFragment + implements CallButtonPresenter.CallButtonUi { @Override CallButtonPresenter createPresenter() { @@ -85,9 +84,12 @@ public class CallButtonFragment extends BaseFragment implem } @Override - public void setVisible() { - Log.e("TEST", "" + getView()); - getView().setVisibility(View.VISIBLE); + public void setVisible(boolean on) { + if (on) { + getView().setVisibility(View.VISIBLE); + } else { + getView().setVisibility(View.INVISIBLE); + } } @Override diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 122e48d85..ab47867a2 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -24,6 +24,7 @@ import android.media.AudioManager; public class CallButtonPresenter extends Presenter { private AudioManager mAudioManager; + private EndCallListener mEndCallListener; public void init(AudioManager audioManager) { mAudioManager = audioManager; @@ -37,12 +38,21 @@ public class CallButtonPresenter extends Presenter