summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml9
-rw-r--r--res/layout/lists_fragment.xml8
-rw-r--r--res/values-bn-rBD/strings.xml6
-rw-r--r--res/values-et-rEE/strings.xml6
-rw-r--r--res/values-eu-rES/strings.xml6
-rw-r--r--res/values-hi/strings.xml6
-rw-r--r--res/values-hy-rAM/strings.xml6
-rw-r--r--res/values-ka-rGE/strings.xml6
-rw-r--r--res/values-kk-rKZ/strings.xml6
-rw-r--r--res/values-km-rKH/strings.xml6
-rw-r--r--res/values-kn-rIN/strings.xml6
-rw-r--r--res/values-ko/strings.xml6
-rw-r--r--res/values-ky-rKG/strings.xml6
-rw-r--r--res/values-lt/strings.xml6
-rw-r--r--res/values-lv/strings.xml6
-rw-r--r--res/values-ml-rIN/strings.xml6
-rw-r--r--res/values-ru/strings.xml6
-rw-r--r--res/values-sl/strings.xml6
-rw-r--r--res/values-ta-rIN/strings.xml6
-rw-r--r--res/values-te-rIN/strings.xml6
-rw-r--r--res/values-th/strings.xml6
-rw-r--r--res/values-tl/strings.xml6
-rw-r--r--res/values-tr/strings.xml6
-rw-r--r--res/values-ur-rPK/strings.xml6
-rw-r--r--res/values-uz-rUZ/strings.xml6
-rw-r--r--res/values-vi/strings.xml6
-rw-r--r--res/values-zh-rCN/strings.xml6
-rw-r--r--res/values-zh-rHK/strings.xml6
-rw-r--r--res/values-zh-rTW/strings.xml6
-rw-r--r--res/values/dimens.xml12
-rw-r--r--res/values/ids.xml22
-rw-r--r--src/com/android/dialer/list/ListsFragment.java48
-rw-r--r--src/com/android/dialer/list/ShortcutCardsManager.java129
-rw-r--r--src/com/android/dialer/list/SwipeHelper.java470
-rw-r--r--src/com/android/dialer/list/SwipeableShortcutCard.java238
35 files changed, 61 insertions, 1037 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 039cc3183..861fd1dbc 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -273,15 +273,6 @@
android:screenOrientation="nosensor" >
</activity>
- <activity android:name="com.android.incallui.CircularRevealActivity"
- android:theme="@style/Theme.CircularRevealAnimation"
- android:exported="false"
- android:configChanges="keyboardHidden|orientation"
- android:launchMode="singleInstance"
- android:noHistory="true"
- android:excludeFromRecents="true"
- android:screenOrientation="nosensor" />
-
<!-- BroadcastReceiver for receiving Intents from Notification mechanism. -->
<receiver android:name="com.android.incallui.InCallApp$NotificationBroadcastReceiver"
android:exported="false">
diff --git a/res/layout/lists_fragment.xml b/res/layout/lists_fragment.xml
index a11c89fef..26f62c7d8 100644
--- a/res/layout/lists_fragment.xml
+++ b/res/layout/lists_fragment.xml
@@ -21,11 +21,11 @@
android:layout_height="match_parent"
android:animateLayoutChanges="true" >
- <com.android.dialer.list.SwipeableShortcutCard
- android:id="@+id/shortcut_card"
+ <!-- TODO: Apply background color to ActionBar instead of a FrameLayout. For now, this is the
+ easiest way to preserve correct pane scrolling and searchbar collapse/expand behaviors. -->
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="@dimen/action_bar_height_large"
+ android:layout_height="@dimen/action_bar_height_large"
android:background="@color/actionbar_background_color" />
<FrameLayout
diff --git a/res/values-bn-rBD/strings.xml b/res/values-bn-rBD/strings.xml
index 86739d28b..f4df05637 100644
--- a/res/values-bn-rBD/strings.xml
+++ b/res/values-bn-rBD/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"ধীরে প্লে করুন৷"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"প্লেব্যাক শুরু করুন বা বিরতি দিন৷"</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"প্রদর্শনের বিকল্পগুলি"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"শব্দ এবং কম্পন"</string>
<string name="ringtone_title" msgid="760362035635084653">"ফোন রিংটোন"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"এছাড়াও কল এলে কম্পিত করুন"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"ডায়ালপ্যাড টোনগুলি"</string>
diff --git a/res/values-et-rEE/strings.xml b/res/values-et-rEE/strings.xml
index 8a40c7272..b6e3f2fa6 100644
--- a/res/values-et-rEE/strings.xml
+++ b/res/values-et-rEE/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Aeglasem esitus."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Esituse alustamine või peatamine."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Kuvamisvalikud"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Helid ja vibratsioon"</string>
<string name="ringtone_title" msgid="760362035635084653">"Telefoni helin"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Vibreeri ka kõnede puhul"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Valimisklahvistiku toonid"</string>
diff --git a/res/values-eu-rES/strings.xml b/res/values-eu-rES/strings.xml
index 97a88a548..03b3072d5 100644
--- a/res/values-eu-rES/strings.xml
+++ b/res/values-eu-rES/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Erreproduzitu mantsoago."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Hasi edo gelditu erreprodukzioa."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Bistaratze-aukerak"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Soinuak eta dardara"</string>
<string name="ringtone_title" msgid="760362035635084653">"Telefonoaren tonua"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Dardara deiak jasotzean ere"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Markagailuaren tonuak"</string>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index 91f329838..bb3fc6ba9 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"धीरे चलाएं."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"प्लेबैक प्रारंभ करें या रोकें."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"प्रदर्शन विकल्प"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"ध्‍वनि और कंपन"</string>
<string name="ringtone_title" msgid="760362035635084653">"फ़ोन रिंगटोन"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"कॉल के लिए भी कंपन"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"डायलपैड टोन"</string>
diff --git a/res/values-hy-rAM/strings.xml b/res/values-hy-rAM/strings.xml
index 16c8982c4..aa1aff82c 100644
--- a/res/values-hy-rAM/strings.xml
+++ b/res/values-hy-rAM/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Նվագարկել ավելի դանդաղ:"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Սկսել կամ դադարեցնել նվագարկումը:"</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Ցուցադրման ընտրանքներ"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Ձայներ և թրթռում"</string>
<string name="ringtone_title" msgid="760362035635084653">"Հեռախոսի զանգերանգ"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Նաև թրթռալ զանգերի ժամանակ"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Թվաշարի ձայներանգներ"</string>
diff --git a/res/values-ka-rGE/strings.xml b/res/values-ka-rGE/strings.xml
index 0d565e9d3..106fa5420 100644
--- a/res/values-ka-rGE/strings.xml
+++ b/res/values-ka-rGE/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"დაკვრის შენელება."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"დაკვრის დაწყება ან პაუზა."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ეკრანის პარამეტრები"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"კინო და ვიბრაცია"</string>
<string name="ringtone_title" msgid="760362035635084653">"ტელეფონის ზარი"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"ზარებზე ასევე ვიბრირება"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"ციფერბლატის ტონები"</string>
diff --git a/res/values-kk-rKZ/strings.xml b/res/values-kk-rKZ/strings.xml
index 848316893..fb7cec60a 100644
--- a/res/values-kk-rKZ/strings.xml
+++ b/res/values-kk-rKZ/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Баяуырақ ойнату."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Ойнатуды бастау немесе кідірту."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Дисплей опциялары"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Дыбыстар мен діріл"</string>
<string name="ringtone_title" msgid="760362035635084653">"Телефон қоңырау әуені"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Сондай-ақ, қоңыраулар үшін дірілдету"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Теру тақтасының үндері"</string>
diff --git a/res/values-km-rKH/strings.xml b/res/values-km-rKH/strings.xml
index f2db857fb..0988ff99f 100644
--- a/res/values-km-rKH/strings.xml
+++ b/res/values-km-rKH/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"ចាក់​កាន់តែ​យឺត។"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"ចាប់ផ្ដើម ឬ​ផ្អាក​ការ​ចាក់​ឡើងវិញ។"</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ជម្រើសបង្ហាញ"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"សម្លេង និងភាពរំញ័រ"</string>
<string name="ringtone_title" msgid="760362035635084653">"សំឡេង​រោទ៍​ទូរស័ព្ទ"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"ញ័រ​សម្រាប់​ការ​ហៅ​ផងដែរ"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"សំឡេង​បន្ទះ​លេខ"</string>
diff --git a/res/values-kn-rIN/strings.xml b/res/values-kn-rIN/strings.xml
index 4cd4cbb05..b5de55dae 100644
--- a/res/values-kn-rIN/strings.xml
+++ b/res/values-kn-rIN/strings.xml
@@ -179,10 +179,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"ನಿಧಾನವಾಗಿ ಪ್ಲೇ ಮಾಡಿ."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"ಪ್ಲೇಬ್ಯಾಕ್‌ ಪ್ರಾರಂಭಿಸಿ ಅಥವಾ ವಿರಾಮಗೊಳಿಸಿ."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ಪ್ರದರ್ಶನ ಆಯ್ಕೆಗಳು"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"ಧ್ವನಿ ಮತ್ತು ವೈಬ್ರೇಷನ್‌"</string>
<string name="ringtone_title" msgid="760362035635084653">"ಫೋನ್ ರಿಂಗ್‌ಟೋನ್"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"ಕರೆಗಳಿಗೂ ಸಹ ವೈಬ್ರೇಟ್‌"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"ಡಯಲ್‌ಪ್ಯಾಡ್‌ ಧ್ವನಿಗಳು"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index bc65cc0e0..315e25913 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"더 느리게 재생합니다."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"재생을 시작하거나 일시중지합니다."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"표시 옵션"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"소리 및 진동"</string>
<string name="ringtone_title" msgid="760362035635084653">"전화 벨소리"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"전화 올 때 벨소리와 함께 진동"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"다이얼패드 신호음"</string>
diff --git a/res/values-ky-rKG/strings.xml b/res/values-ky-rKG/strings.xml
index 2c272ceb7..377782515 100644
--- a/res/values-ky-rKG/strings.xml
+++ b/res/values-ky-rKG/strings.xml
@@ -205,10 +205,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Жайыраак ойнотуу."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Ойнотуп баштоо же бир азга токтотуу"</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Параметрлерди көрсөтүү"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Үндөр жана титирөө"</string>
<string name="ringtone_title" msgid="760362035635084653">"Телефондун шыңгыры"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Чалуулар үчүн дагы дирилдесин"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Тергичтин үндөрү"</string>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index b5279cc64..3fef3f7aa 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -180,10 +180,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Leisti lėčiau."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Pradėti arba pristabdyti atkūrimą."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Pateikties parinktys"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Garsai ir vibravimas"</string>
<string name="ringtone_title" msgid="760362035635084653">"Telefono skambėjimo tonas"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Taip pat vibruoti, kai skamb."</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Skambinimo skydelio garsai"</string>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index 765fff3f8..dc8b90e3c 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -179,10 +179,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Atskaņot lēnāk."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Sākt vai apturēt atskaņošanu."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Attēlojuma opcijas"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Skaņas un vibrācija"</string>
<string name="ringtone_title" msgid="760362035635084653">"Tālruņa zvana signāls"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Izmantot vibrozvanu zvaniem"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Numura sast. tastatūras toņi"</string>
diff --git a/res/values-ml-rIN/strings.xml b/res/values-ml-rIN/strings.xml
index 8f2ba723f..fb892e524 100644
--- a/res/values-ml-rIN/strings.xml
+++ b/res/values-ml-rIN/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"കുറഞ്ഞവേഗതയിൽ പ്ലേചെയ്യുക."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"പ്ലേബാക്ക് ആരംഭിക്കുകയോ താൽക്കാലികമായി നിർത്തുകയോ ചെയ്യുക."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ഡിസ്‌പ്ലേ ഓപ്‌ഷനുകൾ"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"ശബ്‌ദവും വൈബ്രേഷനും"</string>
<string name="ringtone_title" msgid="760362035635084653">"ഫോൺ റിംഗ്ടോൺ"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"കോളുകൾക്കായും വൈബ്രേറ്റ് ചെയ്യും"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"ഡയൽപാഡ് ടോണുകൾ"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index a7a0e7447..405c93fab 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -180,10 +180,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Уменьшить скорость воспроизведения."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Начать или приостановить воспроизведение."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Упорядочить"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Звуки и вибрация"</string>
<string name="ringtone_title" msgid="760362035635084653">"Рингтон"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Вибросигнал при вызове"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Звук при наборе номера"</string>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index a28ac149c..cd19c1e53 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -180,10 +180,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Predvajaj počasneje."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Začni ali zaustavi predvajanje."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Možnosti prikaza"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Zvoki in vibriranje"</string>
<string name="ringtone_title" msgid="760362035635084653">"Ton zvonjenja telefona"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Vibriranje tudi za klice"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Toni tipkovnice"</string>
diff --git a/res/values-ta-rIN/strings.xml b/res/values-ta-rIN/strings.xml
index 4418312ce..1926a1644 100644
--- a/res/values-ta-rIN/strings.xml
+++ b/res/values-ta-rIN/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"மெதுவாக இயக்கு."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"பிளேபேக்கைத் தொடங்கு அல்லது இடைநிறுத்து."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"திரை விருப்பங்கள்"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"ஒலிகளும் அதிர்வும்"</string>
<string name="ringtone_title" msgid="760362035635084653">"மொபைலின் ரிங்டோன்"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"அழைப்புகளுக்கும் அதிர்வுறு"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"டயல்பேட் ஒலிகள்"</string>
diff --git a/res/values-te-rIN/strings.xml b/res/values-te-rIN/strings.xml
index 52238175c..ea25c982e 100644
--- a/res/values-te-rIN/strings.xml
+++ b/res/values-te-rIN/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"నెమ్మదిగా ప్లే చేయి."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"ప్లేబ్యాక్‌ను ప్రారంభించు లేదా పాజ్ చేయి."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ప్రదర్శన ఎంపికలు"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"ధ్వనులు మరియు వైబ్రేషన్"</string>
<string name="ringtone_title" msgid="760362035635084653">"ఫోన్ రింగ్‌టోన్"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"కాల్‌ల కోసం వైబ్రేట్ కూడా చేయి"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"డయల్‌ప్యాడ్ టోన్‌లు"</string>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index 7aae54a50..6cec7ce4d 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"เล่นช้าลง"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"เริ่มหรือหยุดเล่นชั่วคราว"</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ตัวเลือกการแสดง"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"เสียงและการสั่น"</string>
<string name="ringtone_title" msgid="760362035635084653">"เสียงเรียกเข้า"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"สั่นเมื่อมีสายเรียกเข้าด้วย"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"เสียงแป้นหมายเลข"</string>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index 4c0993762..9be8ca349 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Mag-play nang mas mabagal."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Simulan o i-pause ang pag-playback."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Mga opsyon sa pagpapakita"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Tunog at pag-vibrate"</string>
<string name="ringtone_title" msgid="760362035635084653">"Ringtone ng telepono"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Mag-vibrate din para sa tawag"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Mga dialpad tone"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index e2b0077ee..e6d3a84ca 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Daha yavaş çalın."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Çalmayı başlatın veya duraklatın."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Görüntüleme seçenekleri"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Ses ve titreşim"</string>
<string name="ringtone_title" msgid="760362035635084653">"Telefon zil sesi"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Çağrılarda ayrıca titret"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Tuş takımı tonları"</string>
diff --git a/res/values-ur-rPK/strings.xml b/res/values-ur-rPK/strings.xml
index f08eee83e..4873c32d9 100644
--- a/res/values-ur-rPK/strings.xml
+++ b/res/values-ur-rPK/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"آہستہ چلائیں۔"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"پلے بیک شروع یا موقوف کریں۔"</string>
<string name="list_delimeter" msgid="4571593167738725100">"، "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"ڈسپلے کے اختیارات"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"آوازیں اور وائبریشن"</string>
<string name="ringtone_title" msgid="760362035635084653">"فون رِنگ ٹون"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"کالز کیلئے وائبریٹ بھی کرے"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"ڈائل پیڈ ٹونز"</string>
diff --git a/res/values-uz-rUZ/strings.xml b/res/values-uz-rUZ/strings.xml
index f31b7a9d2..437c2b97f 100644
--- a/res/values-uz-rUZ/strings.xml
+++ b/res/values-uz-rUZ/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Sekinroq ijro etish."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Ijroni boshlash yoki to‘xtatish"</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Ko‘rsatish sozlamalari"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Ovozlar va tebranish"</string>
<string name="ringtone_title" msgid="760362035635084653">"Telefon uchun rington"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Qo‘ng‘iroq vaqtida tebranish"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Tugmalar tovushi"</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index d612a2e5e..b9f234c03 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"Phát chậm hơn."</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"Bắt đầu hoặc tạm dừng phát lại."</string>
<string name="list_delimeter" msgid="4571593167738725100">", "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"Tùy chọn hiển thị"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"Âm thanh và rung"</string>
<string name="ringtone_title" msgid="760362035635084653">"Nhạc chuông điện thoại"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"Đồng thời rung khi có cuộc gọi"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"Âm bàn phím số"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 3ec874abe..a71b5b992 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"慢放。"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"开始或暂停播放。"</string>
<string name="list_delimeter" msgid="4571593167738725100">"、 "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"显示选项"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"提示音和振动"</string>
<string name="ringtone_title" msgid="760362035635084653">"手机铃声"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"有来电时响铃并振动"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"拨号键盘提示音"</string>
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index b5316600e..882aa4b2e 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"放慢播放速度。"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"開始或暫停播放。"</string>
<string name="list_delimeter" msgid="4571593167738725100">"、 "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"顯示選項"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"聲音和震動"</string>
<string name="ringtone_title" msgid="760362035635084653">"手機鈴聲"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"來電時同時震動"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"撥號盤音效"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 400f5aff8..f433900f3 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -178,10 +178,8 @@
<string name="voicemail_play_slower" msgid="4544796503902818832">"放慢播放速度。"</string>
<string name="voicemail_play_start_pause" msgid="3687447935787768983">"開始或暫停播放。"</string>
<string name="list_delimeter" msgid="4571593167738725100">"、 "</string>
- <!-- no translation found for display_options_title (7812852361055667468) -->
- <skip />
- <!-- no translation found for sounds_and_vibration_title (1692290115642160845) -->
- <skip />
+ <string name="display_options_title" msgid="7812852361055667468">"顯示選項"</string>
+ <string name="sounds_and_vibration_title" msgid="1692290115642160845">"音效與振動"</string>
<string name="ringtone_title" msgid="760362035635084653">"手機鈴聲"</string>
<string name="vibrate_on_ring_title" msgid="3362916460327555241">"來電時同時震動"</string>
<string name="dtmf_tone_enable_title" msgid="6571449695997521615">"撥號鍵盤音效"</string>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index b8b93cb0a..e4097e3eb 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -64,18 +64,6 @@
<dimen name="favorites_row_end_padding">0dp</dimen>
<dimen name="favorites_row_undo_text_side_padding">32dp</dimen>
- <!-- Dimensions for most recent call shortcut cards -->
- <dimen name="recent_call_log_item_translation_z">3dp</dimen>
- <dimen name="recent_call_log_item_margin_horizontal">8dp</dimen>
- <dimen name="recent_call_log_item_margin_top">4dp</dimen>
- <dimen name="recent_call_log_item_margin_bottom">6dp</dimen>
-
- <!-- The maximum amount to clip on the left and right of the recent call shortcut card -->
- <dimen name="recent_call_log_item_horizontal_clip_limit">20dp</dimen>
- <dimen name="recent_call_log_item_padding_start">8dp</dimen>
- <dimen name="recent_call_log_item_padding_top">12dp</dimen>
- <dimen name="recent_call_log_item_padding_bottom">11dp</dimen>
-
<dimen name="call_log_item_extra_padding_vertical">4dp</dimen>
diff --git a/res/values/ids.xml b/res/values/ids.xml
deleted file mode 100644
index 2b095043a..000000000
--- a/res/values/ids.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2012 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
- -->
-<resources>
- <item type="id"
- name="is_swipeable_tag" />
- <item type="id"
- name="contact_entry_index_tag" />
-</resources> \ No newline at end of file
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index 9ae5c57f5..098b647a1 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -42,7 +42,7 @@ import java.util.ArrayList;
*
* Contains a ViewPager that contains various contact lists like the Speed Dial list and the
* All Contacts list. This will also eventually contain the logic that allows sliding the
- * ViewPager containing the lists up above the shortcut cards and pin it against the top of the
+ * ViewPager containing the lists up above the search bar and pin it against the top of the
* screen.
*/
public class ListsFragment extends Fragment implements CallLogQueryHandler.Listener,
@@ -76,7 +76,6 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
private ViewPager mViewPager;
private ViewPagerTabs mViewPagerTabs;
private ViewPagerAdapter mViewPagerAdapter;
- private SwipeableShortcutCard mShortcutCard;
private RemoveView mRemoveView;
private View mRemoveViewContent;
private SpeedDialFragment mSpeedDialFragment;
@@ -107,26 +106,10 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
private PanelSlideCallbacks mPanelSlideCallbacks = new PanelSlideCallbacks() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
- // For every 1 percent that the panel is slid upwards, clip 1 percent off the top
- // edge of the shortcut card, to achieve the animated effect of the shortcut card
- // being pushed out of view when the panel is slid upwards. slideOffset is 1 when
- // the shortcut card is fully exposed, and 0 when completely hidden.
- if (mShortcutCard.isShown()) {
- float ratioCardHidden = (1 - slideOffset);
- mShortcutCard.clipCard(ratioCardHidden);
- }
-
if (mActionBar != null) {
- // Amount of available space that is not being hidden by the bottom pane
- final int shortcutCardHeight =
- mShortcutCard.isShown() ? mShortcutCard.getHeight() : 0;
- final int topPaneHeight = (int) (slideOffset * shortcutCardHeight);
-
- final int availableActionBarHeight =
- Math.min(mActionBar.getHeight(), topPaneHeight);
- final ActionBarController controller =
+ ActionBarController controller =
((HostInterface) getActivity()).getActionBarController();
- controller.setHideOffset(mActionBar.getHeight() - availableActionBarHeight);
+ controller.setHideOffset((int) (mActionBar.getHeight() * (1 - slideOffset)));
if (!mActionBar.isShowing()) {
mActionBar.show();
@@ -307,9 +290,6 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
mViewPagerTabs.setViewPager(mViewPager);
addOnPageChangeListener(mViewPagerTabs);
- mShortcutCard = (SwipeableShortcutCard) parentView.findViewById(R.id.shortcut_card);
- new ShortcutCardsManager(getActivity(), this, mCallLogAdapter, mShortcutCard);
-
mRemoveView = (RemoveView) parentView.findViewById(R.id.remove_view);
mRemoveViewContent = parentView.findViewById(R.id.remove_view_content);
@@ -349,20 +329,6 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
mCallLogQueryHandler.fetchCalls(CallLogQueryHandler.CALL_TYPE_ALL, mLastCallShortcutDate);
}
- public void dismissShortcut(View view) {
- mLastCallShortcutDate = mCurrentCallShortcutDate;
- final SharedPreferences prefs = view.getContext().getSharedPreferences(
- DialtactsActivity.SHARED_PREFS_NAME, Context.MODE_PRIVATE);
- prefs.edit().putLong(KEY_LAST_DISMISSED_CALL_SHORTCUT_DATE, mLastCallShortcutDate)
- .apply();
- fetchCalls();
-
- LayoutTransition transition = mOverlappingPaneLayout.getLayoutTransition();
- // Turns on animations for all types of layout changes so that they occur for
- // height changes.
- transition.enableTransitionType(LayoutTransition.CHANGING);
- }
-
public void addOnPageChangeListener(OnPageChangeListener onPageChangeListener) {
if (!mOnPageChangeListeners.contains(onPageChangeListener)) {
mOnPageChangeListeners.add(onPageChangeListener);
@@ -399,14 +365,6 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
mRemoveViewContent.setVisibility(show ? View.VISIBLE : View.GONE);
mRemoveView.setAlpha(show ? 0 : 1);
mRemoveView.animate().alpha(show ? 1 : 0).start();
-
- if (mShortcutCard.isShown()) {
- final View child = mShortcutCard.getChildAt(0);
- if (child != null) {
- child.animate().withLayer()
- .alpha(show ? REMOVE_VIEW_SHOWN_ALPHA : REMOVE_VIEW_HIDDEN_ALPHA).start();
- }
- }
}
public boolean shouldShowActionBar() {
diff --git a/src/com/android/dialer/list/ShortcutCardsManager.java b/src/com/android/dialer/list/ShortcutCardsManager.java
deleted file mode 100644
index 8b8a7ba62..000000000
--- a/src/com/android/dialer/list/ShortcutCardsManager.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.
- * Licensed to 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.
- */
-package com.android.dialer.list;
-
-import android.content.Context;
-import android.database.Cursor;
-import android.database.DataSetObserver;
-import android.view.View;
-
-import com.android.dialer.calllog.CallLogAdapter;
-import com.android.dialer.calllog.CallLogNotificationsHelper;
-import com.android.dialer.calllog.CallLogQueryHandler;
-import com.android.dialer.list.SwipeHelper.OnItemGestureListener;
-
-/**
- * Handles the logic that displays call shortcuts from
- * {@link com.android.dialer.calllog.CallLogAdapter} in the form of cards.
- */
-public class ShortcutCardsManager {
-
- private class CustomDataSetObserver extends DataSetObserver {
- @Override
- public void onChanged() {
- updateShortcutCard();
- }
- }
-
- private static final String TAG = ShortcutCardsManager.class.getSimpleName();
-
- // The position of the shortcut card within the CallLogAdapter
- private static final int SHORTCUT_CARD_INDEX = 0;
-
- private final CallLogAdapter mCallLogAdapter;
- private final ListsFragment mFragment;
- private final SwipeableShortcutCard mShortcutCard;
-
- private final Context mContext;
-
- private final DataSetObserver mObserver;
-
- private final CallLogQueryHandler mCallLogQueryHandler;
-
- private final OnItemGestureListener mCallLogOnItemSwipeListener =
- new OnItemGestureListener() {
- @Override
- public void onSwipe(View view) {
- mCallLogQueryHandler.markNewCallsAsOld();
- mCallLogQueryHandler.markNewVoicemailsAsOld();
- CallLogNotificationsHelper.removeMissedCallNotifications(mContext);
- CallLogNotificationsHelper.updateVoicemailNotifications(mContext);
- mFragment.dismissShortcut(view);
- }
-
- @Override
- public void onTouch() {}
-
- @Override
- public boolean isSwipeEnabled() {
- return true;
- }
- };
-
- private final CallLogQueryHandler.Listener mCallLogQueryHandlerListener =
- new CallLogQueryHandler.Listener() {
- @Override
- public void onVoicemailStatusFetched(Cursor statusCursor) {}
-
- @Override
- public boolean onCallsFetched(Cursor combinedCursor) {
- mCallLogAdapter.invalidateCache();
- mCallLogAdapter.changeCursor(combinedCursor);
- mCallLogAdapter.notifyDataSetChanged();
- // Return true; took ownership of cursor
- return true;
- }
- };
-
- public ShortcutCardsManager(Context context,
- ListsFragment fragment,
- CallLogAdapter callLogAdapter,
- SwipeableShortcutCard shortcutCard) {
- mContext = context;
- mFragment = fragment;
- mShortcutCard = shortcutCard;
-
- mCallLogAdapter = callLogAdapter;
- mObserver = new CustomDataSetObserver();
- mCallLogAdapter.registerDataSetObserver(mObserver);
- mCallLogQueryHandler = new CallLogQueryHandler(mContext.getContentResolver(),
- mCallLogQueryHandlerListener);
- mShortcutCard.setOnItemSwipeListener(mCallLogOnItemSwipeListener);
- }
-
- /**
- * Updates the contents of the shortcut card with the view provided by the
- * {@link CallLogAdapter}.
- */
- private void updateShortcutCard() {
- final int count = mCallLogAdapter.getCount();
- final View convertView = mShortcutCard.getChildAt(SHORTCUT_CARD_INDEX);
- if (count <= SHORTCUT_CARD_INDEX) {
- if (convertView != null) {
- convertView.setVisibility(View.GONE);
- }
- } else {
- mShortcutCard.setVisibility(View.VISIBLE);
- final View view = mCallLogAdapter.getView(SHORTCUT_CARD_INDEX, convertView,
- mShortcutCard);
- mShortcutCard.removeAllViews();
- mShortcutCard.prepareChildView(view);
- mShortcutCard.addView(view);
- view.setVisibility(View.VISIBLE);
- }
- }
-}
diff --git a/src/com/android/dialer/list/SwipeHelper.java b/src/com/android/dialer/list/SwipeHelper.java
deleted file mode 100644
index 03300df42..000000000
--- a/src/com/android/dialer/list/SwipeHelper.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc.
- * Licensed to 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.
- */
-
-package com.android.dialer.list;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.ObjectAnimator;
-import android.animation.ValueAnimator;
-import android.animation.ValueAnimator.AnimatorUpdateListener;
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.RectF;
-import android.util.Log;
-import android.view.MotionEvent;
-import android.view.VelocityTracker;
-import android.view.View;
-import android.view.animation.LinearInterpolator;
-
-import com.android.dialer.R;
-
-/**
- * Copy of packages/apps/UnifiedEmail - com.android.mail.ui.SwipeHelper with changes.
- */
-public class SwipeHelper {
- static final String TAG = SwipeHelper.class.getSimpleName();
- private static final boolean DEBUG_INVALIDATE = false;
- private static final boolean CONSTRAIN_SWIPE = true;
- private static final boolean FADE_OUT_DURING_SWIPE = true;
- private static final boolean DISMISS_IF_SWIPED_FAR_ENOUGH = true;
- private static final boolean LOG_SWIPE_DISMISS_VELOCITY = false; // STOPSHIP - DEBUG ONLY
-
- public static final int IS_SWIPEABLE_TAG = R.id.is_swipeable_tag;
- public static final Object IS_SWIPEABLE = new Object();
-
- public static final int X = 0;
- public static final int Y = 1;
-
- private static LinearInterpolator sLinearInterpolator = new LinearInterpolator();
-
- private static int SWIPE_ESCAPE_VELOCITY = -1;
- private static int DEFAULT_ESCAPE_ANIMATION_DURATION;
- private static int MAX_ESCAPE_ANIMATION_DURATION;
- private static int MAX_DISMISS_VELOCITY;
- private static int SNAP_ANIM_LEN;
- private static int SWIPE_SCROLL_SLOP;
- private static float MIN_SWIPE;
- private static float MIN_VERT;
- private static float MIN_LOCK;
-
- public static float ALPHA_FADE_START = 0f; // fraction of thumbnail width
- // where fade starts
- static final float ALPHA_FADE_END = 0.7f; // fraction of thumbnail width
- // beyond which alpha->0
- private static final float FACTOR = 1.2f;
-
- private static final int PROTECTION_PADDING = 50;
-
- private float mMinAlpha = 0.3f;
-
- private float mPagingTouchSlop;
- private final SwipeHelperCallback mCallback;
- private final int mSwipeDirection;
- private final VelocityTracker mVelocityTracker;
-
- private float mInitialTouchPosX;
- private boolean mDragging;
- private View mCurrView;
- private View mCurrAnimView;
- private boolean mCanCurrViewBeDimissed;
- private float mDensityScale;
- private float mLastY;
- private float mInitialTouchPosY;
-
- private float mStartAlpha;
- private boolean mProtected = false;
-
- private float mChildSwipedFarEnoughFactor = 0.4f;
- private float mChildSwipedFastEnoughFactor = 0.05f;
-
- public SwipeHelper(Context context, int swipeDirection, SwipeHelperCallback callback, float densityScale,
- float pagingTouchSlop) {
- mCallback = callback;
- mSwipeDirection = swipeDirection;
- mVelocityTracker = VelocityTracker.obtain();
- mDensityScale = densityScale;
- mPagingTouchSlop = pagingTouchSlop;
- if (SWIPE_ESCAPE_VELOCITY == -1) {
- Resources res = context.getResources();
- SWIPE_ESCAPE_VELOCITY = res.getInteger(R.integer.swipe_escape_velocity);
- DEFAULT_ESCAPE_ANIMATION_DURATION = res.getInteger(R.integer.escape_animation_duration);
- MAX_ESCAPE_ANIMATION_DURATION = res.getInteger(R.integer.max_escape_animation_duration);
- MAX_DISMISS_VELOCITY = res.getInteger(R.integer.max_dismiss_velocity);
- SNAP_ANIM_LEN = res.getInteger(R.integer.snap_animation_duration);
- SWIPE_SCROLL_SLOP = res.getInteger(R.integer.swipe_scroll_slop);
- MIN_SWIPE = res.getDimension(R.dimen.min_swipe);
- MIN_VERT = res.getDimension(R.dimen.min_vert);
- MIN_LOCK = res.getDimension(R.dimen.min_lock);
- }
- }
-
- public void setDensityScale(float densityScale) {
- mDensityScale = densityScale;
- }
-
- public void setPagingTouchSlop(float pagingTouchSlop) {
- mPagingTouchSlop = pagingTouchSlop;
- }
-
- public void setChildSwipedFarEnoughFactor(float factor) {
- mChildSwipedFarEnoughFactor = factor;
- }
-
- public void setChildSwipedFastEnoughFactor(float factor) {
- mChildSwipedFastEnoughFactor = factor;
- }
-
- private float getVelocity(VelocityTracker vt) {
- return mSwipeDirection == X ? vt.getXVelocity() :
- vt.getYVelocity();
- }
-
- private ObjectAnimator createTranslationAnimation(View v, float newPos) {
- ObjectAnimator anim = ObjectAnimator.ofFloat(v,
- mSwipeDirection == X ? "translationX" : "translationY", newPos);
- return anim;
- }
-
- private ObjectAnimator createDismissAnimation(View v, float newPos, int duration) {
- ObjectAnimator anim = createTranslationAnimation(v, newPos);
- anim.setInterpolator(sLinearInterpolator);
- anim.setDuration(duration);
- return anim;
- }
-
- private float getPerpendicularVelocity(VelocityTracker vt) {
- return mSwipeDirection == X ? vt.getYVelocity() :
- vt.getXVelocity();
- }
-
- private void setTranslation(View v, float translate) {
- if (mSwipeDirection == X) {
- v.setTranslationX(translate);
- } else {
- v.setTranslationY(translate);
- }
- }
-
- private float getSize(View v) {
- return mSwipeDirection == X ? v.getMeasuredWidth() :
- v.getMeasuredHeight();
- }
-
- public void setMinAlpha(float minAlpha) {
- mMinAlpha = minAlpha;
- }
-
- private float getAlphaForOffset(View view) {
- float viewSize = getSize(view);
- final float fadeSize = ALPHA_FADE_END * viewSize;
- float result = mStartAlpha;
- float pos = view.getTranslationX();
- if (pos >= viewSize * ALPHA_FADE_START) {
- result = mStartAlpha - (pos - viewSize * ALPHA_FADE_START) / fadeSize;
- } else if (pos < viewSize * (mStartAlpha - ALPHA_FADE_START)) {
- result = mStartAlpha + (viewSize * ALPHA_FADE_START + pos) / fadeSize;
- }
- return Math.max(mMinAlpha, result);
- }
-
- // invalidate the view's own bounds all the way up the view hierarchy
- public static void invalidateGlobalRegion(View view) {
- invalidateGlobalRegion(
- view,
- new RectF(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
- }
-
- // invalidate a rectangle relative to the view's coordinate system all the way up the view
- // hierarchy
- public static void invalidateGlobalRegion(View view, RectF childBounds) {
- // childBounds.offset(view.getTranslationX(), view.getTranslationY());
- if (DEBUG_INVALIDATE)
- Log.v(TAG, "-------------");
- while (view.getParent() != null && view.getParent() instanceof View) {
- view = (View) view.getParent();
- view.getMatrix().mapRect(childBounds);
- view.invalidate((int) Math.floor(childBounds.left),
- (int) Math.floor(childBounds.top),
- (int) Math.ceil(childBounds.right),
- (int) Math.ceil(childBounds.bottom));
- if (DEBUG_INVALIDATE) {
- Log.v(TAG, "INVALIDATE(" + (int) Math.floor(childBounds.left)
- + "," + (int) Math.floor(childBounds.top)
- + "," + (int) Math.ceil(childBounds.right)
- + "," + (int) Math.ceil(childBounds.bottom));
- }
- }
- }
-
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- final int action = ev.getAction();
- switch (action) {
- case MotionEvent.ACTION_DOWN:
- mLastY = ev.getY();
- mDragging = false;
- mCurrView = mCallback.getChildAtPosition(ev);
- mVelocityTracker.clear();
- if (mCurrView != null) {
- mCurrAnimView = mCallback.getChildContentView(mCurrView);
- mStartAlpha = mCurrAnimView.getAlpha();
- mCanCurrViewBeDimissed = mCallback.canChildBeDismissed(mCurrView);
- mVelocityTracker.addMovement(ev);
- mInitialTouchPosX = ev.getX();
- mInitialTouchPosY = ev.getY();
- }
- break;
- case MotionEvent.ACTION_MOVE:
- if (mCurrView != null) {
- // Check the movement direction.
- if (mLastY >= 0 && !mDragging) {
- float currY = ev.getY();
- float currX = ev.getX();
- float deltaY = Math.abs(currY - mInitialTouchPosY);
- float deltaX = Math.abs(currX - mInitialTouchPosX);
- if (deltaY > SWIPE_SCROLL_SLOP && deltaY > (FACTOR * deltaX)) {
- mLastY = ev.getY();
- mCallback.onScroll();
- return false;
- }
- }
- mVelocityTracker.addMovement(ev);
- float pos = ev.getX();
- float delta = pos - mInitialTouchPosX;
- if (Math.abs(delta) > mPagingTouchSlop) {
- mCallback.onBeginDrag(mCallback.getChildContentView(mCurrView));
- mDragging = true;
- mInitialTouchPosX = ev.getX() - mCurrAnimView.getTranslationX();
- mInitialTouchPosY = ev.getY();
- }
- }
- mLastY = ev.getY();
- break;
- case MotionEvent.ACTION_UP:
- case MotionEvent.ACTION_CANCEL:
- mDragging = false;
- mCurrView = null;
- mCurrAnimView = null;
- mLastY = -1;
- break;
- }
- return mDragging;
- }
-
- /**
- * @param view The view to be dismissed
- * @param velocity The desired pixels/second speed at which the view should
- * move
- */
- private void dismissChild(final View view, float velocity) {
- final View animView = mCallback.getChildContentView(view);
- final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
- float newPos = determinePos(animView, velocity);
- int duration = determineDuration(animView, newPos, velocity);
-
- animView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
- ObjectAnimator anim = createDismissAnimation(animView, newPos, duration);
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mCallback.onChildDismissed(view);
- animView.setLayerType(View.LAYER_TYPE_NONE, null);
- }
- });
- anim.addUpdateListener(new AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- if (FADE_OUT_DURING_SWIPE && canAnimViewBeDismissed) {
- animView.setAlpha(getAlphaForOffset(animView));
- }
- invalidateGlobalRegion(animView);
- }
- });
- anim.start();
- }
-
- private int determineDuration(View animView, float newPos, float velocity) {
- int duration = MAX_ESCAPE_ANIMATION_DURATION;
- if (velocity != 0) {
- duration = Math
- .min(duration,
- (int) (Math.abs(newPos - animView.getTranslationX()) * 1000f / Math
- .abs(velocity)));
- } else {
- duration = DEFAULT_ESCAPE_ANIMATION_DURATION;
- }
- return duration;
- }
-
- private float determinePos(View animView, float velocity) {
- float newPos = 0;
- if (velocity < 0 || (velocity == 0 && animView.getTranslationX() < 0)
- // if we use the Menu to dismiss an item in landscape, animate up
- || (velocity == 0 && animView.getTranslationX() == 0 && mSwipeDirection == Y)) {
- newPos = -getSize(animView);
- } else {
- newPos = getSize(animView);
- }
- return newPos;
- }
-
- public void snapChild(final View view, float velocity) {
- final View animView = mCallback.getChildContentView(view);
- final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
- ObjectAnimator anim = createTranslationAnimation(animView, 0);
- int duration = SNAP_ANIM_LEN;
- anim.setDuration(duration);
- anim.addUpdateListener(new AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- if (FADE_OUT_DURING_SWIPE && canAnimViewBeDismissed) {
- animView.setAlpha(getAlphaForOffset(animView));
- }
- invalidateGlobalRegion(animView);
- }
- });
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- animView.setAlpha(mStartAlpha);
- mCallback.onDragCancelled(mCurrView);
- }
- });
- anim.start();
- }
-
- public boolean onTouchEvent(MotionEvent ev) {
- if (!mDragging || mProtected) {
- return false;
- }
- mVelocityTracker.addMovement(ev);
- final int action = ev.getAction();
- switch (action) {
- case MotionEvent.ACTION_OUTSIDE:
- case MotionEvent.ACTION_MOVE:
- if (mCurrView != null) {
- float deltaX = ev.getX() - mInitialTouchPosX;
- float deltaY = Math.abs(ev.getY() - mInitialTouchPosY);
- // If the user has gone vertical and not gone horizontalish AT
- // LEAST minBeforeLock, switch to scroll. Otherwise, cancel
- // the swipe.
- if (!mDragging && deltaY > MIN_VERT && (Math.abs(deltaX)) < MIN_LOCK
- && deltaY > (FACTOR * Math.abs(deltaX))) {
- mCallback.onScroll();
- return false;
- }
- float minDistance = MIN_SWIPE;
- if (Math.abs(deltaX) < minDistance) {
- // Don't start the drag until at least X distance has
- // occurred.
- return true;
- }
- // don't let items that can't be dismissed be dragged more
- // than maxScrollDistance
- if (CONSTRAIN_SWIPE && !mCallback.canChildBeDismissed(mCurrView)) {
- float size = getSize(mCurrAnimView);
- float maxScrollDistance = 0.15f * size;
- if (Math.abs(deltaX) >= size) {
- deltaX = deltaX > 0 ? maxScrollDistance : -maxScrollDistance;
- } else {
- deltaX = maxScrollDistance
- * (float) Math.sin((deltaX / size) * (Math.PI / 2));
- }
- }
- setTranslation(mCurrAnimView, deltaX);
- if (FADE_OUT_DURING_SWIPE && mCanCurrViewBeDimissed) {
- mCurrAnimView.setAlpha(getAlphaForOffset(mCurrAnimView));
- }
- invalidateGlobalRegion(mCallback.getChildContentView(mCurrView));
- }
- break;
- case MotionEvent.ACTION_UP:
- case MotionEvent.ACTION_CANCEL:
- if (mCurrView != null) {
- float maxVelocity = MAX_DISMISS_VELOCITY * mDensityScale;
- mVelocityTracker.computeCurrentVelocity(1000 /* px/sec */, maxVelocity);
- float escapeVelocity = SWIPE_ESCAPE_VELOCITY * mDensityScale;
- float velocity = getVelocity(mVelocityTracker);
- float perpendicularVelocity = getPerpendicularVelocity(mVelocityTracker);
-
- // Decide whether to dismiss the current view
- // Tweak constants below as required to prevent erroneous
- // swipe/dismiss
- float translation = Math.abs(mCurrAnimView.getTranslationX());
- float currAnimViewSize = getSize(mCurrAnimView);
- // Long swipe = translation of {@link #mChildSwipedFarEnoughFactor} * width
- boolean childSwipedFarEnough = DISMISS_IF_SWIPED_FAR_ENOUGH
- && translation > mChildSwipedFarEnoughFactor * currAnimViewSize;
- // Fast swipe = > escapeVelocity and translation of
- // {@link #mChildSwipedFastEnoughFactor} * width
- boolean childSwipedFastEnough = (Math.abs(velocity) > escapeVelocity)
- && (Math.abs(velocity) > Math.abs(perpendicularVelocity))
- && (velocity > 0) == (mCurrAnimView.getTranslationX() > 0)
- && translation > mChildSwipedFastEnoughFactor * currAnimViewSize;
- if (LOG_SWIPE_DISMISS_VELOCITY) {
- Log.v(TAG, "Swipe/Dismiss: " + velocity + "/" + escapeVelocity + "/"
- + perpendicularVelocity + ", x: " + translation + "/"
- + currAnimViewSize);
- }
-
- boolean dismissChild = mCallback.canChildBeDismissed(mCurrView)
- && (childSwipedFastEnough || childSwipedFarEnough);
-
- if (dismissChild) {
- dismissChild(mCurrView, childSwipedFastEnough ? velocity : 0f);
- } else {
- snapChild(mCurrView, velocity);
- }
- }
- break;
- }
- return true;
- }
-
- public static void setSwipeable(View view, boolean swipeable) {
- view.setTag(IS_SWIPEABLE_TAG, swipeable ? IS_SWIPEABLE : null);
- }
-
- public static boolean isSwipeable(View view) {
- return IS_SWIPEABLE == view.getTag(IS_SWIPEABLE_TAG);
- }
-
- public interface SwipeHelperCallback {
- View getChildAtPosition(MotionEvent ev);
-
- View getChildContentView(View v);
-
- void onScroll();
-
- boolean canChildBeDismissed(View v);
-
- void onBeginDrag(View v);
-
- void onChildDismissed(View v);
-
- void onDragCancelled(View v);
-
- }
-
- public interface OnItemGestureListener {
- public void onSwipe(View view);
-
- public void onTouch();
-
- public boolean isSwipeEnabled();
- }
-}
diff --git a/src/com/android/dialer/list/SwipeableShortcutCard.java b/src/com/android/dialer/list/SwipeableShortcutCard.java
deleted file mode 100644
index db2210a47..000000000
--- a/src/com/android/dialer/list/SwipeableShortcutCard.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-package com.android.dialer.list;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Rect;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewConfiguration;
-import android.view.ViewGroup;
-import android.widget.FrameLayout;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.android.dialer.R;
-import com.android.dialer.list.SwipeHelper.OnItemGestureListener;
-import com.android.dialer.list.SwipeHelper.SwipeHelperCallback;
-
-/**
- * The swipeable call log row.
- */
-public class SwipeableShortcutCard extends FrameLayout implements SwipeHelperCallback {
-
- private static final float CLIP_CARD_BARELY_HIDDEN_RATIO = 0.001f;
- private static final float CLIP_CARD_MOSTLY_HIDDEN_RATIO = 0.9f;
- // Fade out 5x faster than the hidden ratio.
- private static final float CLIP_CARD_OPACITY_RATIO = 5f;
-
- final int mCallLogMarginHorizontal;
- final int mCallLogMarginTop;
- final int mCallLogMarginBottom;
- final int mCallLogPaddingStart;
- final int mCallLogPaddingTop;
- final int mCallLogPaddingBottom;
- final int mShortCardBackgroundColor;
-
- private SwipeHelper mSwipeHelper;
- private OnItemGestureListener mOnItemSwipeListener;
-
- private float mPreviousTranslationZ = 0;
- private Rect mClipRect = new Rect();
-
- public SwipeableShortcutCard(Context context) {
- this(context, null);
- }
-
- public SwipeableShortcutCard(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public SwipeableShortcutCard(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- final Resources resources = getResources();
- final float densityScale =resources.getDisplayMetrics().density;
- final float pagingTouchSlop = ViewConfiguration.get(context)
- .getScaledPagingTouchSlop();
- mSwipeHelper = new SwipeHelper(context, SwipeHelper.X, this,
- densityScale, pagingTouchSlop);
-
- mCallLogMarginHorizontal =
- resources.getDimensionPixelSize(R.dimen.recent_call_log_item_margin_horizontal);
- mCallLogMarginTop =
- resources.getDimensionPixelSize(R.dimen.recent_call_log_item_margin_top);
- mCallLogMarginBottom =
- resources.getDimensionPixelSize(R.dimen.recent_call_log_item_margin_bottom);
- mCallLogPaddingStart =
- resources.getDimensionPixelSize(R.dimen.recent_call_log_item_padding_start);
- mCallLogPaddingTop =
- resources.getDimensionPixelSize(R.dimen.recent_call_log_item_padding_top);
- mCallLogPaddingBottom =
- resources.getDimensionPixelSize(R.dimen.recent_call_log_item_padding_bottom);
- mShortCardBackgroundColor =
- resources.getColor(R.color.call_log_expanded_background_color, null);
- }
-
- void prepareChildView(View view) {
- // Override CallLogAdapter's accessibility behavior; don't expand the shortcut card.
- view.setAccessibilityDelegate(null);
- view.setBackgroundResource(R.drawable.rounded_corner_bg);
-
- final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.WRAP_CONTENT);
- params.setMargins(mCallLogMarginHorizontal, mCallLogMarginTop, mCallLogMarginHorizontal,
- mCallLogMarginBottom);
- view.setLayoutParams(params);
-
- LinearLayout actionView =
- (LinearLayout) view.findViewById(R.id.primary_action_view);
- actionView.setPaddingRelative(mCallLogPaddingStart, mCallLogPaddingTop,
- actionView.getPaddingEnd(), mCallLogPaddingBottom);
-
- // TODO: Set content description including type/location and time information.
- TextView nameView = (TextView) actionView.findViewById(R.id.name);
-
- actionView.setContentDescription(
- TextUtils.expandTemplate(
- getResources().getString(R.string.description_call_back_action),
- nameView.getText()));
-
- mPreviousTranslationZ = getResources().getDimensionPixelSize(
- R.dimen.recent_call_log_item_translation_z);
- view.setTranslationZ(mPreviousTranslationZ);
-
- final ViewGroup callLogItem = (ViewGroup) view.findViewById(R.id.call_log_list_item);
- // Reset the internal call log item view if it is being recycled
- callLogItem.setTranslationX(0);
- callLogItem.setTranslationY(0);
- callLogItem.setAlpha(1);
- callLogItem.setClipBounds(null);
- setChildrenOpacity(callLogItem, 1.0f);
-
- callLogItem.findViewById(R.id.call_log_row)
- .setBackgroundColor(mShortCardBackgroundColor);
-
- callLogItem.findViewById(R.id.call_indicator_icon).setVisibility(View.VISIBLE);
- }
-
- @Override
- public View getChildAtPosition(MotionEvent ev) {
- return getChildCount() > 0 ? getChildAt(0) : null;
- }
-
- @Override
- public View getChildContentView(View v) {
- return v.findViewById(R.id.call_log_list_item);
- }
-
- @Override
- public void onScroll() {}
-
- @Override
- public boolean canChildBeDismissed(View v) {
- return true;
- }
-
- @Override
- public void onBeginDrag(View v) {
- // We do this so the underlying ScrollView knows that it won't get
- // the chance to intercept events anymore
- requestDisallowInterceptTouchEvent(true);
- }
-
- @Override
- public void onChildDismissed(View v) {
- if (v != null && mOnItemSwipeListener != null) {
- mOnItemSwipeListener.onSwipe(v);
- }
- }
-
- @Override
- public void onDragCancelled(View v) {}
-
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- if (mSwipeHelper != null) {
- return mSwipeHelper.onInterceptTouchEvent(ev) || super.onInterceptTouchEvent(ev);
- } else {
- return super.onInterceptTouchEvent(ev);
- }
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent ev) {
- if (mSwipeHelper != null) {
- return mSwipeHelper.onTouchEvent(ev) || super.onTouchEvent(ev);
- } else {
- return super.onTouchEvent(ev);
- }
- }
-
- public void setOnItemSwipeListener(OnItemGestureListener listener) {
- mOnItemSwipeListener = listener;
- }
-
- /**
- * Clips the card by a specified amount.
- *
- * @param ratioHidden A float indicating how much of each edge of the card should be
- * clipped. If 0, the entire card is displayed. If 0.5f, each edge is hidden
- * entirely, thus obscuring the entire card.
- */
- public void clipCard(float ratioHidden) {
- final View viewToClip = getChildAt(0);
- if (viewToClip == null) {
- return;
- }
- int width = viewToClip.getWidth();
- int height = viewToClip.getHeight();
-
- if (ratioHidden <= CLIP_CARD_BARELY_HIDDEN_RATIO) {
- viewToClip.setTranslationZ(mPreviousTranslationZ);
- } else if (viewToClip.getTranslationZ() != 0){
- mPreviousTranslationZ = viewToClip.getTranslationZ();
- viewToClip.setTranslationZ(0);
- }
-
- if (ratioHidden > CLIP_CARD_MOSTLY_HIDDEN_RATIO) {
- mClipRect.set(0, 0 , 0, 0);
- } else {
- int newTop = (int) (ratioHidden * height);
- mClipRect.set(0, newTop, width, height);
-
- // Since the pane will be overlapping with the action bar, apply a vertical offset
- // to top align the clipped card in the viewable area;
- viewToClip.setTranslationY(-newTop);
- }
- viewToClip.setClipBounds(mClipRect);
-
- // If the view has any children, fade them out of view.
- final ViewGroup viewGroup = (ViewGroup) viewToClip;
- setChildrenOpacity(
- viewGroup, Math.max(0, 1 - (CLIP_CARD_OPACITY_RATIO * ratioHidden)));
- }
-
- private void setChildrenOpacity(ViewGroup viewGroup, float alpha) {
- final int count = viewGroup.getChildCount();
- for (int i = 0; i < count; i++) {
- viewGroup.getChildAt(i).setAlpha(alpha);
- }
- }
-} \ No newline at end of file