merge in jb-mr1-release history after reset to jb-mr1-dev
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index e69f540..71ec12b 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -528,8 +528,8 @@
<string name="call_log_item_count_and_date" msgid="7641933305703520787">"(<xliff:g id="COUNT">%1$d</xliff:g>) <xliff:g id="DATE">%2$s</xliff:g>"</string>
<string name="group_name_hint" msgid="238359485263401293">"Nom del grup"</string>
<string name="nfc_vcard_file_name" msgid="2823095213265993609">"Contac. reb. NFC"</string>
- <string name="menu_show_outgoing_only" msgid="1965570298133301970">"Mostra només les trucades sortints"</string>
- <string name="menu_show_incoming_only" msgid="7534206815238877417">"Mostra només les trucades entrants"</string>
+ <string name="menu_show_outgoing_only" msgid="1965570298133301970">"Mostra només trucades sortints"</string>
+ <string name="menu_show_incoming_only" msgid="7534206815238877417">"Mostra només trucades entrants"</string>
<string name="menu_show_missed_only" msgid="154473166059743996">"Mostra només trucades perdudes"</string>
<string name="menu_show_voicemails_only" msgid="1898421289561435703">"Mostra només missatges de veu"</string>
<string name="menu_show_all_calls" msgid="7560347482073345885">"Mostra totes les trucades"</string>
@@ -556,7 +556,7 @@
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"S\'estan mostrant tots els contactes"</string>
<string name="no_account_prompt" msgid="7061052512446855192">"Contactes funciona millor amb un Compte de Google."\n\n"• Accedeix-hi des de qualsevol navegador web."\n"• Fes una còpia de seguretat dels teus contactes."</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"Mantén els contactes segurs encara que perdis el telèfon: sincronitza\'ls amb un servidor en línia."</string>
- <string name="generic_no_account_prompt_title" msgid="753783911899054860">"Addició d\'un compte"</string>
+ <string name="generic_no_account_prompt_title" msgid="753783911899054860">"Afegeix un compte"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"No es farà una còpia de seguretat del teu contacte nou. Vols afegir un compte que faci còpies de seguretat dels contactes en línia?"</string>
<string name="contact_editor_prompt_one_account" msgid="8669032699767375976">"El teu contacte nou se sincronitzarà amb <xliff:g id="ACCOUNT_NAME">%1$s</xliff:g>."</string>
<string name="contact_editor_prompt_multiple_accounts" msgid="611828200100438242">"Pots sincronitzar el teu contacte nou amb un dels comptes següents. Quin vols utilitzar?"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index e96bdff..84b1d2d 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -286,7 +286,7 @@
<string name="missing_name" msgid="8745511583852904385">"(Kein Name)"</string>
<string name="menu_accounts" msgid="8499114602017077970">"Konten"</string>
<string name="menu_clear_frequents" msgid="7688250191932838833">"\"Häufig kontaktiert\" löschen"</string>
- <string name="menu_contacts_filter" msgid="2165153460860262501">"Kontakte zum Anzeigen"</string>
+ <string name="menu_contacts_filter" msgid="2165153460860262501">"Kontakte zur Ansicht"</string>
<string name="menu_import_export" msgid="26217871113229507">"Importieren/Exportieren"</string>
<string name="dialog_import_export" msgid="4360648034889921624">"Import/Export von Kontakten"</string>
<string name="dialog_import" msgid="2431698729761448759">"Kontakte importieren"</string>
@@ -455,7 +455,7 @@
<string name="custom_list_filter" msgid="7836035257402013957">"Ansicht festlegen"</string>
<string name="contact_list_loading" msgid="5488620820563977329">"Wird geladen…"</string>
<string name="activity_title_settings" msgid="5464130076132770781">"Einstellungen"</string>
- <string name="activity_title_contacts_filter" msgid="8275542497615516969">"Kontakte zum Anzeigen"</string>
+ <string name="activity_title_contacts_filter" msgid="8275542497615516969">"Kontakte zur Ansicht"</string>
<string name="menu_settings" msgid="377929915873428211">"Einstellungen"</string>
<string name="menu_help" msgid="5123887102216637725">"Hilfe"</string>
<string name="preference_displayOptions" msgid="1341720270148252393">"Anzeigeoptionen"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index d254099..cabde2f 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -144,7 +144,7 @@
<string name="recentCalls_editNumberBeforeCall" msgid="7756171675833267857">"Изменить номер и вызвать"</string>
<string name="recentCalls_addToContact" msgid="1429899535546487008">"Добавить в контакты"</string>
<string name="recentCalls_removeFromRecentList" msgid="401662244636511330">"Удалить из списка вызовов"</string>
- <string name="recentCalls_deleteAll" msgid="6352364392762163704">"Очистить список вызовов"</string>
+ <string name="recentCalls_deleteAll" msgid="6352364392762163704">"Очистить список"</string>
<string name="recentCalls_trashVoicemail" msgid="7604696960787435655">"Удалить голосовое сообщение"</string>
<string name="recentCalls_shareVoicemail" msgid="1416112847592942840">"Поделиться"</string>
<string name="recentCalls_empty" msgid="247053222448663107">"Список вызовов пуст."</string>
@@ -532,7 +532,7 @@
<string name="menu_show_incoming_only" msgid="7534206815238877417">"Входящие"</string>
<string name="menu_show_missed_only" msgid="154473166059743996">"Пропущенные"</string>
<string name="menu_show_voicemails_only" msgid="1898421289561435703">"Показать голосовые сообщения"</string>
- <string name="menu_show_all_calls" msgid="7560347482073345885">"Показать все вызовы"</string>
+ <string name="menu_show_all_calls" msgid="7560347482073345885">"Все вызовы"</string>
<string name="status_available" msgid="5586870015822828392">"На месте"</string>
<string name="status_away" msgid="1838861100379804730">"Отсутствует"</string>
<string name="status_busy" msgid="9147992455450257136">"Не беспокоить"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index f83fbca..8fce496 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -543,7 +543,7 @@
<string name="description_call_log_voicemail" msgid="4600798771975158948">"語音留言"</string>
<string name="description_add_contact" msgid="3103414772502485851">"新增聯絡人"</string>
<string name="description_view_contact" msgid="5205669345700598415">"查看聯絡人<xliff:g id="NAME">%1$s</xliff:g>"</string>
- <string name="description_call" msgid="3443678121983852666">"打電話給<xliff:g id="NAME">%1$s</xliff:g>"</string>
+ <string name="description_call" msgid="3443678121983852666">"撥電話給<xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="description_send_text_message" msgid="7803126439934046891">"傳送簡訊給<xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="description_call_log_unheard_voicemail" msgid="118101684236996786">"未聽取的語音留言"</string>
<string name="description_send_message" msgid="6046623392322890962">"傳送訊息給<xliff:g id="NAME">%1$s</xliff:g>"</string>
diff --git a/src/com/android/contacts/dialpad/DialpadImageButton.java b/src/com/android/contacts/dialpad/DialpadImageButton.java
index a18cbb8..040eeb4 100644
--- a/src/com/android/contacts/dialpad/DialpadImageButton.java
+++ b/src/com/android/contacts/dialpad/DialpadImageButton.java
@@ -17,19 +17,26 @@
package com.android.contacts.dialpad;
import android.content.Context;
+import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
+import android.view.accessibility.AccessibilityManager;
import android.widget.ImageButton;
/**
* Custom {@link ImageButton} for dialpad buttons.
- *
- * During horizontal swipe, we want to exit "fading out" animation offered by its background
- * just after starting the swipe.This class overrides {@link #onTouchEvent(MotionEvent)} to achieve
- * the behavior.
+ * <p>
+ * This class implements lift-to-type interaction when touch exploration is
+ * enabled.
*/
public class DialpadImageButton extends ImageButton {
+ /** Accessibility manager instance used to check touch exploration state. */
+ private AccessibilityManager mAccessibilityManager;
+
+ /** Bounds used to filter HOVER_EXIT events. */
+ private Rect mHoverBounds = new Rect();
+
public interface OnPressedListener {
public void onPressed(View view, boolean pressed);
}
@@ -42,10 +49,17 @@
public DialpadImageButton(Context context, AttributeSet attrs) {
super(context, attrs);
+ initForAccessibility(context);
}
public DialpadImageButton(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ initForAccessibility(context);
+ }
+
+ private void initForAccessibility(Context context) {
+ mAccessibilityManager = (AccessibilityManager) context.getSystemService(
+ Context.ACCESSIBILITY_SERVICE);
}
@Override
@@ -55,4 +69,54 @@
mOnPressedListener.onPressed(this, pressed);
}
}
+
+ @Override
+ public void onSizeChanged(int w, int h, int oldw, int oldh) {
+ super.onSizeChanged(w, h, oldw, oldh);
+
+ mHoverBounds.left = getPaddingLeft();
+ mHoverBounds.right = w - getPaddingRight();
+ mHoverBounds.top = getPaddingTop();
+ mHoverBounds.bottom = h - getPaddingBottom();
+ }
+
+ @Override
+ public boolean performClick() {
+ // When accessibility is on, simulate press and release to preserve the
+ // semantic meaning of performClick(). Required for Braille support.
+ if (mAccessibilityManager.isEnabled()) {
+ // Checking the press state prevents double activation.
+ if (!isPressed()) {
+ setPressed(true);
+ setPressed(false);
+ }
+
+ return true;
+ }
+
+ return super.performClick();
+ }
+
+ @Override
+ public boolean onHoverEvent(MotionEvent event) {
+ // When touch exploration is turned on, lifting a finger while inside
+ // the button's hover target bounds should perform a click action.
+ if (mAccessibilityManager.isEnabled()
+ && mAccessibilityManager.isTouchExplorationEnabled()) {
+ switch (event.getActionMasked()) {
+ case MotionEvent.ACTION_HOVER_ENTER:
+ // Lift-to-type temporarily disables double-tap activation.
+ setClickable(false);
+ break;
+ case MotionEvent.ACTION_HOVER_EXIT:
+ if (mHoverBounds.contains((int) event.getX(), (int) event.getY())) {
+ performClick();
+ }
+ setClickable(true);
+ break;
+ }
+ }
+
+ return super.onHoverEvent(event);
+ }
}