summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/dialpad/DialpadFragment.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-05-13 13:21:16 -0700
committerAndrew Lee <anwlee@google.com>2014-05-13 14:14:57 -0700
commita73e189f57d70e81e6c5150d10032dae29846fd7 (patch)
tree724354b229d355c8594a3e991197ab643b481bb5 /src/com/android/dialer/dialpad/DialpadFragment.java
parent7ff97a0c24daa15738d26c16367e122dfa6f7591 (diff)
Use one ImageButton for the floating action button.
This means that the touch feedback transition can continue to propagate, even while we're switching the icons. Change-Id: Ia0c4e7bb4556c84cabccbda5f4c5861e25e2928f
Diffstat (limited to 'src/com/android/dialer/dialpad/DialpadFragment.java')
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 0ded9ab76..4557bd4b1 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -109,8 +109,7 @@ public class DialpadFragment extends Fragment
* TODO: Refactor the app so this interchange is a bit cleaner.
*/
public interface HostInterface {
- void setDialButtonEnabled(boolean enabled);
- void setDialButtonContainerVisible(boolean visible);
+ void setFloatingActionButtonVisible(boolean visible);
}
/**
@@ -318,7 +317,7 @@ public class DialpadFragment extends Fragment
if (mDialpadQueryListener != null) {
mDialpadQueryListener.onDialpadQueryChanged(mDigits.getText().toString());
}
- updateDialAndDeleteButtonEnabledState();
+ updateDeleteButtonEnabledState();
}
@Override
@@ -673,7 +672,7 @@ public class DialpadFragment extends Fragment
stopWatch.lap("hnt");
- updateDialAndDeleteButtonEnabledState();
+ updateDeleteButtonEnabledState();
stopWatch.lap("bes");
@@ -1218,7 +1217,7 @@ public class DialpadFragment extends Fragment
if (mDialpadView != null) {
mDialpadView.setVisibility(View.GONE);
}
- ((HostInterface) getActivity()).setDialButtonContainerVisible(false);
+ ((HostInterface) getActivity()).setFloatingActionButtonVisible(false);
mDialpadChooser.setVisibility(View.VISIBLE);
@@ -1235,7 +1234,7 @@ public class DialpadFragment extends Fragment
} else {
mDigits.setVisibility(View.VISIBLE);
}
- ((HostInterface) getActivity()).setDialButtonContainerVisible(true);
+ ((HostInterface) getActivity()).setFloatingActionButtonVisible(true);
mDialpadChooser.setVisibility(View.GONE);
}
}
@@ -1486,23 +1485,12 @@ public class DialpadFragment extends Fragment
/**
* Update the enabledness of the "Dial" and "Backspace" buttons if applicable.
*/
- private void updateDialAndDeleteButtonEnabledState() {
+ private void updateDeleteButtonEnabledState() {
if (getActivity() == null) {
return;
}
final boolean digitsNotEmpty = !isDigitsEmpty();
mDelete.setEnabled(digitsNotEmpty);
- // On CDMA phones, if we're already on a call, we *always* enable the Dial button (since
- // you can press it without entering any digits to send an empty flash.)
- if (phoneIsCdma() && phoneIsOffhook()) {
- ((HostInterface) getActivity()).setDialButtonEnabled(true);
- } else {
- // Common case: GSM, or CDMA but not on a call. Enable the Dial button if something
- // has been entered into the digits field, or if there is a last dialed number that
- // could be redialed.
- ((HostInterface) getActivity()).setDialButtonEnabled(
- digitsNotEmpty || !TextUtils.isEmpty(mLastNumberDialed));
- }
}
/**
@@ -1587,7 +1575,7 @@ public class DialpadFragment extends Fragment
// doing anything here.
if (getActivity() == null) return;
mLastNumberDialed = number;
- updateDialAndDeleteButtonEnabledState();
+ updateDeleteButtonEnabledState();
}
});
mCallLog.getLastOutgoingCall(lastCallArgs);