Previously, taping the dialed number used to dial the number.
Now if non-empty, a cursor shows up at the tap location.
The user can then use the dialpad to delete/insert new numbers.
The previous version of the selectors that drive the number background
has been moved to the non finger drawable because they show the right
background when focused.
In touch mode, the background does not change when focused.
Bug:
2160189
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
+ <item android:state_pressed="true"
android:drawable="@drawable/btn_dial_textfield_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/btn_dial_textfield_selected" />
+ android:drawable="@drawable/btn_dial_textfield_normal" />
<item
android:drawable="@drawable/btn_dial_textfield_normal" />
</selector>
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true"
+ <item android:state_pressed="true"
android:drawable="@drawable/btn_dial_textfield_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/btn_dial_textfield_selected" />
+ android:drawable="@drawable/btn_dial_textfield_activated" />
<item
android:drawable="@drawable/btn_dial_textfield_activated" />
</selector>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_dial_textfield_pressed" />
+ <item android:state_focused="true"
+ android:drawable="@drawable/btn_dial_textfield_selected" />
+ <item
+ android:drawable="@drawable/btn_dial_textfield_normal" />
+</selector>
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/btn_dial_textfield_pressed" />
+ <item android:state_focused="true"
+ android:drawable="@drawable/btn_dial_textfield_selected" />
+ <item
+ android:drawable="@drawable/btn_dial_textfield_activated" />
+</selector>
+
android:freezesText="true"
android:background="@drawable/btn_dial_textfield"
android:textColor="@color/dialer_button_text"
- android:focusableInTouchMode="false"
+ android:focusableInTouchMode="true"
+ android:editable="true"
+ android:cursorVisible="false"
/>
<!-- Keypad section -->
android:freezesText="true"
android:background="@drawable/btn_dial_textfield"
android:textColor="@color/dialer_button_text"
- android:focusableInTouchMode="false"
+ android:focusableInTouchMode="true"
+ android:editable="true"
+ android:cursorVisible="false"
/>
<!-- Keypad section -->
if (notEmpty) {
mDigits.setBackgroundDrawable(mDigitsBackground);
} else {
+ mDigits.setCursorVisible(false);
mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
}
mDigits.setKeyListener(DialerKeyListener.getInstance());
mDigits.setOnClickListener(this);
mDigits.setOnKeyListener(this);
+ mDigits.setInputType(android.text.InputType.TYPE_NULL); // Don't show IME when focused.
+
maybeAddNumberFormatting();
// Check for the presence of the keypad
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
- case R.id.dialButton:
- case R.id.digits: {
+ case R.id.dialButton: {
vibrate(); // Vibrate here too, just like we do for the regular keys
placeCall();
return;
vibrate();
return;
}
+ case R.id.digits: {
+ if (mDigits.length() != 0) {
+ mDigits.setCursorVisible(true);
+ }
+ return;
+ }
}
}