From 1f9f163262efb7efd5d782b6151f20f8cfc1438e Mon Sep 17 00:00:00 2001 From: Chiao Cheng Date: Fri, 30 Aug 2013 14:58:47 -0700 Subject: Automating calls to onUiUnready() in parent fragment. The code was duplicated un-necessarily in each child fragment. Change-Id: I619b723c9afc690ff9011fc43367fe5752094fb6 --- InCallUI/src/com/android/incallui/AnswerFragment.java | 6 ------ InCallUI/src/com/android/incallui/BaseFragment.java | 11 +++++++---- InCallUI/src/com/android/incallui/CallButtonFragment.java | 6 ------ InCallUI/src/com/android/incallui/CallCardFragment.java | 6 ------ 4 files changed, 7 insertions(+), 22 deletions(-) (limited to 'InCallUI/src/com/android/incallui') diff --git a/InCallUI/src/com/android/incallui/AnswerFragment.java b/InCallUI/src/com/android/incallui/AnswerFragment.java index 40462ce1f..e105289b2 100644 --- a/InCallUI/src/com/android/incallui/AnswerFragment.java +++ b/InCallUI/src/com/android/incallui/AnswerFragment.java @@ -71,12 +71,6 @@ public class AnswerFragment extends BaseFragment, U extends Ui> extends Fragment { @@ -51,4 +48,10 @@ public abstract class BaseFragment, U extends Ui> extends super.onActivityCreated(savedInstanceState); mPresenter.onUiReady(getUi()); } + + @Override + public void onDestroyView() { + super.onDestroyView(); + mPresenter.onUiUnready(getUi()); + } } diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index bd193818a..1c3e737e6 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -126,12 +126,6 @@ public class CallButtonFragment updateAudioButtons(getPresenter().getSupportedAudio()); } - @Override - public void onDestroyView() { - super.onDestroyView(); - getPresenter().onUiUnready(this); - } - @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { } diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index d880b973a..60090365f 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -110,12 +110,6 @@ public class CallCardFragment extends BaseFragment