From ef1b5e0afd8e824979d1acda015eda314e61955b Mon Sep 17 00:00:00 2001 From: David Braun Date: Sat, 5 Oct 2013 19:33:46 -0700 Subject: Add custom message dialog for Respond via Message. We don't want to require SMS applications to implement activities that show over lock just to handle the "respond via custom message" scenario for rejecting phone calls. This change adds an entry dialog into the phone call UI. A separate change removes the code in the Telephony service that would have asked the default SMS app to show UI. Bug: 11084719 Provide UI for "quick response" messages built into Phone app Change-Id: I7fcf20280fd3b741aa941cc6a24f5c262db1899b --- res/values/strings.xml | 4 ++ src/com/android/incallui/AnswerFragment.java | 73 +++++++++++++++++++++++---- src/com/android/incallui/AnswerPresenter.java | 13 ++--- 3 files changed, 70 insertions(+), 20 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index e7049e5b..7c588b34 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1280,6 +1280,10 @@ Can\'t talk now. Call me later? Write your own... + + Cancel + + Send Quick responses diff --git a/src/com/android/incallui/AnswerFragment.java b/src/com/android/incallui/AnswerFragment.java index 324d5228..29a45865 100644 --- a/src/com/android/incallui/AnswerFragment.java +++ b/src/com/android/incallui/AnswerFragment.java @@ -18,12 +18,18 @@ package com.android.incallui; import android.app.AlertDialog; import android.app.Dialog; +import android.content.DialogInterface; import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.WindowManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; import android.widget.ListView; import com.google.common.base.Preconditions; @@ -106,12 +112,7 @@ public class AnswerFragment extends BaseFragment textResponses) { + public void configureMessageDialog(ArrayList textResponses) { final ArrayList textResponsesForDisplay = new ArrayList(textResponses); textResponsesForDisplay.add(getResources().getString( @@ -178,12 +228,13 @@ public class AnswerFragment extends BaseFragment if (call.can(Call.Capabilities.RESPOND_VIA_TEXT) && textMsgs != null) { getUi().showTextButton(true); - getUi().configureMessageDialogue(textMsgs); + getUi().configureMessageDialog(textMsgs); } else { getUi().showTextButton(false); } @@ -134,24 +134,19 @@ public class AnswerPresenter extends Presenter public void onText() { if (getUi() != null) { - getUi().showMessageDialogue(); + getUi().showMessageDialog(); } } public void rejectCallWithMessage(String message) { Log.d(this, "sendTextToDefaultActivity()..."); - if (getUi() != null) { - getUi().dismissPopup(); - } CallCommandClient.getInstance().rejectCall(mCallId, true, message); } interface AnswerUi extends Ui { public void showAnswerUi(boolean show); public void showTextButton(boolean show); - public boolean isMessageDialogueShowing(); - public void showMessageDialogue(); - public void dismissPopup(); - public void configureMessageDialogue(ArrayList textResponses); + public void showMessageDialog(); + public void configureMessageDialog(ArrayList textResponses); } } -- cgit v1.2.3