summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-05-05 21:29:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-05 21:29:48 +0000
commitf6f8d4dd8e4008b76abcc86c3e5be374fd731abd (patch)
tree4a3f4d37a32ee65b2be5354127365f8401eebcd6
parent7d2b79eafe7675db9fcbcdc15c23dcb8c568f68f (diff)
parent877ace10c8aac66798a42d74204032e518e31e49 (diff)
am 877ace10: Allow configuration of dialpad buttons visibility
* commit '877ace10c8aac66798a42d74204032e518e31e49': Allow configuration of dialpad buttons visibility
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java2
-rw-r--r--src/com/android/dialer/dialpad/DialpadView.java15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index ce2db3c67..5de9ffdce 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -309,7 +309,7 @@ public class DialpadFragment extends Fragment
mDigitsFilledByIntent = false;
mDigits.setCursorVisible(false);
mAddContactButton.setVisibility(View.INVISIBLE);
- } else {
+ } else if (mDialpadView.canDigitsBeEdited()){
mAddContactButton.setVisibility(View.VISIBLE);
}
diff --git a/src/com/android/dialer/dialpad/DialpadView.java b/src/com/android/dialer/dialpad/DialpadView.java
index d81be4d2a..a8b1e79a7 100644
--- a/src/com/android/dialer/dialpad/DialpadView.java
+++ b/src/com/android/dialer/dialpad/DialpadView.java
@@ -38,6 +38,8 @@ public class DialpadView extends LinearLayout {
private EditText mDigits;
private ImageButton mDelete;
+ private boolean mCanDigitsBeEdited;
+
public DialpadView(Context context) {
this(context, null);
}
@@ -115,7 +117,7 @@ public class DialpadView extends LinearLayout {
* @param canBeEdited If true, the backspace button will be shown and the digits EditText
* will be configured to allow text manipulation.
*/
- public void setDigitsCanBeEdited(boolean canBeEdited) {
+ public void setCanDigitsBeEdited(boolean canBeEdited) {
View deleteButton = findViewById(R.id.deleteButton);
deleteButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE);
@@ -124,6 +126,17 @@ public class DialpadView extends LinearLayout {
digits.setLongClickable(canBeEdited);
digits.setFocusableInTouchMode(canBeEdited);
digits.setCursorVisible(false);
+
+ View overflowMenuButton = findViewById(R.id.dialpad_overflow);
+ overflowMenuButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE);
+
+ View addContactButton = findViewById(R.id.dialpad_add_contact);
+ addContactButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE);
+ mCanDigitsBeEdited = canBeEdited;
+ }
+
+ public boolean canDigitsBeEdited() {
+ return mCanDigitsBeEdited;
}
/**