summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnan <adnan@cyngn.com>2014-10-15 14:26:24 -0700
committerAdnan <adnan@cyngn.com>2014-10-20 09:03:01 -0700
commitd3551ba1c10b7ff842e3e13c3e816a9753ed7f94 (patch)
tree72d1d5aa4b6e47e74cb1e0af40c9f68a993a49c4
parent85fa16ae3eb8043c329c730d2314a26608340a4b (diff)
downloadpackages_apps_Contacts-d3551ba1c10b7ff842e3e13c3e816a9753ed7f94.tar.gz
packages_apps_Contacts-d3551ba1c10b7ff842e3e13c3e816a9753ed7f94.tar.bz2
packages_apps_Contacts-d3551ba1c10b7ff842e3e13c3e816a9753ed7f94.zip
ContactsCommon: Add direct call from contact list feature. (2/2)
- Requires cmcc overlay flag to be set in Contacts. Change-Id: I014240c6d70db904f6ae027cd168cebe2d5c2977
-rw-r--r--AndroidManifest.xml1
-rw-r--r--res/values-sw600dp-land/styles.xml1
-rw-r--r--res/values-sw600dp/styles.xml1
-rw-r--r--res/values-sw720dp/styles.xml1
-rw-r--r--res/values/config.xml19
-rw-r--r--res/values/styles.xml1
-rw-r--r--src/com/android/contacts/activities/PeopleActivity.java4
7 files changed, 27 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index bdefaff97..1fe5d1c85 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -22,6 +22,7 @@
<original-package android:name="com.android.contacts" />
+ <uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
diff --git a/res/values-sw600dp-land/styles.xml b/res/values-sw600dp-land/styles.xml
index bdf0e8aeb..2feeccd8b 100644
--- a/res/values-sw600dp-land/styles.xml
+++ b/res/values-sw600dp-land/styles.xml
@@ -39,6 +39,7 @@
<item name="list_item_presence_icon_margin">4dip</item>
<item name="list_item_presence_icon_size">16dip</item>
<item name="list_item_photo_size">64dip</item>
+ <item name="list_item_quick_call_size">48dip</item>
<item name="list_item_profile_photo_size">80dip</item>
<item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
<item name="list_item_header_text_indent">8dip</item>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index a27198ae5..a6015e520 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -40,6 +40,7 @@
<item name="list_item_presence_icon_margin">4dip</item>
<item name="list_item_presence_icon_size">16dip</item>
<item name="list_item_photo_size">64dip</item>
+ <item name="list_item_quick_call_size">48dip</item>
<item name="list_item_profile_photo_size">80dip</item>
<item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
<item name="list_item_header_text_indent">8dip</item>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
index 4381631c1..668fa18a3 100644
--- a/res/values-sw720dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
@@ -40,6 +40,7 @@
<item name="list_item_presence_icon_margin">4dip</item>
<item name="list_item_presence_icon_size">16dip</item>
<item name="list_item_photo_size">64dip</item>
+ <item name="list_item_quick_call_size">48dip</item>
<item name="list_item_profile_photo_size">80dip</item>
<item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
<item name="list_item_header_text_indent">8dip</item>
diff --git a/res/values/config.xml b/res/values/config.xml
new file mode 100644
index 000000000..24faab64f
--- /dev/null
+++ b/res/values/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The CyanogenMod 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>
+ <!-- CMCC feature -->
+ <bool name="config_show_quick_call_button" translatable="false">false</bool>
+</resources> \ No newline at end of file
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 1472e8a6f..3e8fcde27 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -81,6 +81,7 @@
<item name="list_item_presence_icon_margin">4dip</item>
<item name="list_item_presence_icon_size">16dip</item>
<item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
+ <item name="list_item_quick_call_size">48dip</item>
<item name="list_item_profile_photo_size">70dip</item>
<item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
<item name="list_item_header_text_color">@color/people_app_theme_color</item>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 2bea5fe78..2a45dfa63 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -1083,10 +1083,12 @@ public class PeopleActivity extends ContactsActivity
mAllFragment.setFilter(mContactListFilterController.getFilter());
final boolean useTwoPane = PhoneCapabilityTester.isUsingTwoPanes(this);
-
+ final boolean cmccFeature = getResources().
+ getBoolean(R.bool.config_show_quick_call_button);
mAllFragment.setVerticalScrollbarPosition(getScrollBarPosition(useTwoPane));
mAllFragment.setSelectionVisible(useTwoPane);
mAllFragment.setQuickContactEnabled(!useTwoPane);
+ mAllFragment.setQuickCallButtonEnabled(cmccFeature && !useTwoPane);
}
private int getScrollBarPosition(boolean useTwoPane) {