summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/dialer_preferences.xml60
-rw-r--r--src/com/android/dialer/CallDetailActivity.java1
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java2
-rw-r--r--src/com/android/dialer/list/AllContactsFragment.java4
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteSquareTileView.java3
-rw-r--r--src/com/android/dialer/settings/DialerSettingsActivity.java71
6 files changed, 8 insertions, 133 deletions
diff --git a/res/layout/dialer_preferences.xml b/res/layout/dialer_preferences.xml
deleted file mode 100644
index 023b12251..000000000
--- a/res/layout/dialer_preferences.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 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.
--->
-
-<!-- Layout of a header item in PreferenceActivity. This is modified from the platform
- preference_header_item-->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="48dp"
- android:background="?android:attr/activatedBackgroundIndicator"
- android:gravity="center_vertical"
- android:paddingEnd="?android:attr/scrollbarSize">
-
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/preference_side_margin"
- android:layout_marginEnd="@dimen/preference_side_margin"
- android:layout_weight="1"
- android:paddingTop="@dimen/preference_padding_top"
- android:paddingBottom="@dimen/preference_padding_bottom">
-
- <TextView android:id="@+id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearance"
- android:textSize="16sp"
- android:textColor="@color/setting_primary_color"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal" />
-
- <TextView android:id="@+id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/title"
- android:layout_alignStart="@id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/setting_secondary_color"
- android:lineSpacingExtra="@dimen/preference_summary_line_spacing_extra"
- android:ellipsize="end"
- android:maxLines="2" />
-
- </RelativeLayout>
-
-</LinearLayout> \ No newline at end of file
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index fb663d729..df8197a10 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -245,6 +245,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware
mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo);
mQuickContactBadge.setOverlay(null);
+ mQuickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
mCallerName = (TextView) findViewById(R.id.caller_name);
mCallerNumber = (TextView) findViewById(R.id.caller_number);
mAccountLabel = (TextView) findViewById(R.id.phone_account_label);
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index b6f91e75b..8bfe0dec5 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -27,6 +27,7 @@ import android.os.Handler;
import android.os.Message;
import android.provider.CallLog.Calls;
import android.provider.ContactsContract;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.PhoneLookup;
import android.telecom.PhoneAccountHandle;
import android.telephony.PhoneNumberUtils;
@@ -820,6 +821,7 @@ public class CallLogAdapter extends GroupingListAdapter
} else {
setPhoto(views, photoId, lookupUri, nameForDefaultImage, lookupKey, contactType);
}
+ views.quickContactView.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
// Listen for the first draw
if (mViewTreeObserver == null) {
diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java
index deabb80b9..94efc4869 100644
--- a/src/com/android/dialer/list/AllContactsFragment.java
+++ b/src/com/android/dialer/list/AllContactsFragment.java
@@ -18,6 +18,7 @@ package com.android.dialer.list;
import android.database.Cursor;
import android.net.Uri;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.QuickContact;
import android.view.LayoutInflater;
import android.view.View;
@@ -83,7 +84,8 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Uri uri = (Uri) view.getTag();
if (uri != null) {
- QuickContact.showQuickContact(getActivity(), view, uri, QuickContact.MODE_LARGE, null);
+ QuickContact.showQuickContact(getContext(), view, uri, null,
+ Phone.CONTENT_ITEM_TYPE);
}
}
diff --git a/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java b/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java
index 5f8877616..05780c66a 100644
--- a/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteSquareTileView.java
@@ -17,6 +17,7 @@
package com.android.dialer.list;
import android.content.Context;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.QuickContact;
import android.util.AttributeSet;
import android.view.View;
@@ -63,7 +64,7 @@ public class PhoneFavoriteSquareTileView extends PhoneFavoriteTileView {
private void launchQuickContact() {
QuickContact.showQuickContact(getContext(), PhoneFavoriteSquareTileView.this,
- getLookupUri(), QuickContact.MODE_LARGE, null);
+ getLookupUri(), null, Phone.CONTENT_ITEM_TYPE);
}
@Override
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java
index bdffa93d0..935b6c7fd 100644
--- a/src/com/android/dialer/settings/DialerSettingsActivity.java
+++ b/src/com/android/dialer/settings/DialerSettingsActivity.java
@@ -15,13 +15,7 @@ import android.preference.PreferenceActivity.Header;
import android.telecom.TelecomManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
-import android.view.LayoutInflater;
import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ListAdapter;
-import android.widget.TextView;
import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
@@ -31,7 +25,6 @@ import java.util.List;
public class DialerSettingsActivity extends PreferenceActivity {
protected SharedPreferences mPreferences;
- private HeaderAdapter mHeaderAdapter;
private static final int OWNER_HANDLE_ID = 0;
@@ -100,23 +93,6 @@ public class DialerSettingsActivity extends PreferenceActivity {
return true;
}
- @Override
- public void setListAdapter(ListAdapter adapter) {
- if (adapter == null) {
- super.setListAdapter(null);
- } else {
- // We don't have access to the hidden getHeaders() method, so grab the headers from
- // the intended adapter and then replace it with our own.
- int headerCount = adapter.getCount();
- List<Header> headers = Lists.newArrayList();
- for (int i = 0; i < headerCount; i++) {
- headers.add((Header) adapter.getItem(i));
- }
- mHeaderAdapter = new HeaderAdapter(this, headers);
- super.setListAdapter(mHeaderAdapter);
- }
- }
-
/**
* Whether a user handle associated with the current user is that of the primary owner. That is,
* whether there is a user handle which has an id which matches the owner's handle.
@@ -133,51 +109,4 @@ public class DialerSettingsActivity extends PreferenceActivity {
return false;
}
-
- /**
- * This custom {@code ArrayAdapter} is mostly identical to the equivalent one in
- * {@code PreferenceActivity}, except with a local layout resource.
- */
- private static class HeaderAdapter extends ArrayAdapter<Header> {
- static class HeaderViewHolder {
- TextView title;
- TextView summary;
- }
-
- private LayoutInflater mInflater;
-
- public HeaderAdapter(Context context, List<Header> objects) {
- super(context, 0, objects);
- mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- HeaderViewHolder holder;
- View view;
-
- if (convertView == null) {
- view = mInflater.inflate(R.layout.dialer_preferences, parent, false);
- holder = new HeaderViewHolder();
- holder.title = (TextView) view.findViewById(R.id.title);
- holder.summary = (TextView) view.findViewById(R.id.summary);
- view.setTag(holder);
- } else {
- view = convertView;
- holder = (HeaderViewHolder) view.getTag();
- }
-
- // All view fields must be updated every time, because the view may be recycled
- Header header = getItem(position);
- holder.title.setText(header.getTitle(getContext().getResources()));
- CharSequence summary = header.getSummary(getContext().getResources());
- if (!TextUtils.isEmpty(summary)) {
- holder.summary.setVisibility(View.VISIBLE);
- holder.summary.setText(summary);
- } else {
- holder.summary.setVisibility(View.GONE);
- }
- return view;
- }
- }
}