diff options
author | Brint E. Kriebel <bekit@cyngn.com> | 2014-11-18 13:50:42 -0800 |
---|---|---|
committer | Brint E. Kriebel <bekit@cyngn.com> | 2014-11-18 13:50:42 -0800 |
commit | 1827f38db40957c561240d9072ae3fc29a1c032d (patch) | |
tree | f42f2a9d330910b62552b9e3ab868ee6309ed1d7 | |
parent | ce8278bf56f1909b3d77474aa7908e2302b809a9 (diff) | |
parent | f8132fc17e8b07916deae0845f07da184b67c8b4 (diff) | |
download | packages_apps_Contacts-shipping/cm-11.0.tar.gz packages_apps_Contacts-shipping/cm-11.0.tar.bz2 packages_apps_Contacts-shipping/cm-11.0.zip |
Merge branch 'cm-11.0' into stable/cm-11.0cm-11.0-XNPH05Q-tomato-9828f8e9ccstable/cm-11.0-XNF8Yshipping/cm-11.0
-rw-r--r-- | AndroidManifest.xml | 2 | ||||
-rw-r--r-- | res/layout/group_manage.xml | 12 | ||||
-rw-r--r-- | res/layout/member_item.xml | 1 | ||||
-rw-r--r-- | res/menu/people_options.xml | 1 | ||||
-rw-r--r-- | res/values/config.xml | 2 | ||||
-rw-r--r-- | src/com/android/contacts/detail/ContactDetailFragment.java | 4 | ||||
-rw-r--r-- | src/com/android/contacts/group/local/MemberListActivity.java | 69 |
7 files changed, 59 insertions, 32 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1fe5d1c85..87a6e7c1b 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -69,7 +69,7 @@ <!-- The main Contacts activity with the contact list, favorites, and groups. --> <activity android:name=".activities.PeopleActivity" - android:label="@string/people" + android:label="@string/app_name" android:theme="@style/PeopleTheme" android:screenOrientation="nosensor" android:uiOptions="splitActionBarWhenNarrow" diff --git a/res/layout/group_manage.xml b/res/layout/group_manage.xml index a5e720ced..4c1f474af 100644 --- a/res/layout/group_manage.xml +++ b/res/layout/group_manage.xml @@ -2,6 +2,7 @@ <!-- * * Copyright (c) 2013, The Linux Foundation. All Rights Reserved. + * Copyright (c) 2014, The CyanogenMod Project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,13 +29,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> -<TabHost - android:id="@android:id/tabhost" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - xmlns:android="http://schemas.android.com/apk/res/android"> - - <LinearLayout +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> @@ -58,5 +53,4 @@ android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" /> - </LinearLayout> -</TabHost> +</LinearLayout> diff --git a/res/layout/member_item.xml b/res/layout/member_item.xml index 0ac8239a9..08530c03f 100644 --- a/res/layout/member_item.xml +++ b/res/layout/member_item.xml @@ -34,6 +34,7 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:minHeight="?android:attr/listPreferredItemHeight" + android:background="?android:activatedBackgroundIndicator" android:paddingTop="3dip" android:paddingBottom="3dip" > diff --git a/res/menu/people_options.xml b/res/menu/people_options.xml index 0ef579cb2..bd3926f15 100644 --- a/res/menu/people_options.xml +++ b/res/menu/people_options.xml @@ -71,6 +71,7 @@ <item android:id="@+id/menu_memory_status" + android:visible="false" android:title="@string/menu_memory_status" /> <item diff --git a/res/values/config.xml b/res/values/config.xml index 24faab64f..87d654c73 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -16,4 +16,6 @@ <resources> <!-- CMCC feature --> <bool name="config_show_quick_call_button" translatable="false">false</bool> + + <string name="app_name">@string/people</string> </resources>
\ No newline at end of file diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java index eb8fadbbd..8bf04ef9b 100644 --- a/src/com/android/contacts/detail/ContactDetailFragment.java +++ b/src/com/android/contacts/detail/ContactDetailFragment.java @@ -2039,8 +2039,10 @@ public class ContactDetailFragment extends Fragment implements FragmentKeyListen ContextMenu.NONE, getString(R.string.set_default)); } if (Phone.CONTENT_ITEM_TYPE.equals(selectedMimeType)) { + final boolean isIPPrefixEnabled = + SystemProperties.getBoolean("persist.radio.ipcall.enabled", false); // add limit length to show IP call item - if (selectedEntry.data.length() > MAX_NUM_LENGTH) { + if (isIPPrefixEnabled && selectedEntry.data.length() > MAX_NUM_LENGTH) { if (MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB1)) { String sub1Name = MoreContactUtils.getMultiSimAliasesName( mContext, MSimConstants.SUB1); diff --git a/src/com/android/contacts/group/local/MemberListActivity.java b/src/com/android/contacts/group/local/MemberListActivity.java index 723bb60f9..a1f3647de 100644 --- a/src/com/android/contacts/group/local/MemberListActivity.java +++ b/src/com/android/contacts/group/local/MemberListActivity.java @@ -278,9 +278,16 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl emptyText = (TextView) findViewById(R.id.emptyText); mListView = (ListView) findViewById(R.id.member_list); mListView.setAdapter(mAdapter); - mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); mListView.setOnItemClickListener(this); + mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); mListView.setMultiChoiceModeListener(mMultiChoiceModeListener); + mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { + @Override + public boolean onItemLongClick(AdapterView<?> list, View v, int position, long arg3) { + mListView.setItemChecked(position, true); + return true; + } + }); uri = getIntent().getParcelableExtra("data"); getContentResolver().registerContentObserver( Uri.withAppendedPath(LocalGroup.CONTENT_FILTER_URI, @@ -291,6 +298,15 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl } @Override + public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { + if (!mListView.isItemChecked(position)) { + mListView.setItemChecked(position, true); + } else { + mListView.setItemChecked(position, false); + } + } + + @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.member_list_options, menu); @@ -389,9 +405,7 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl @Override protected void onPause() { super.onPause(); - mPaused = true; - mAdapter.changeCursor(null); } public void onDestroy() { @@ -415,15 +429,15 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl @Override public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { - View v = mListView.getChildAt(position); - String contactId = (String) v.getTag(); - CheckBox checkBox = (CheckBox) v.findViewById(R.id.pick_contact_check); - if (mRemoveSet.containsKey(contactId)) { - mRemoveSet.remove(contactId); - } else { - mRemoveSet.putString(contactId, contactId); + ContactItem item = mAdapter.getItem(position); + if (item != null) { + if (mRemoveSet.containsKey(item.toString())) { + mRemoveSet.remove(item.toString()); + } else { + mRemoveSet.putString(item.toString(), item.toString()); + } } - setCheckStatus(contactId, checkBox); + mAdapter.notifyDataSetChanged(); } @Override @@ -492,6 +506,15 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl null, null); } + class ContactItem { + private long rawContactId; + + @Override + public String toString() { + return String.valueOf(rawContactId); + } + } + private class QueryHandler extends AsyncQueryHandler { protected final WeakReference<MemberListActivity> mActivity; @@ -518,6 +541,20 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl } @Override + public ContactItem getItem(int position) { + Cursor cursor = getCursor(); + ContactItem contactItem; + if (cursor != null && cursor.moveToPosition(position)) { + contactItem = new ContactItem(); + contactItem.rawContactId = cursor.getLong(SUMMARY_RAW_CONTACTS_ID_INDEX); + } else { + return null; + } + + return contactItem; + } + + @Override public void bindView(View view, Context context, Cursor cursor) { long contactId = cursor.getLong(SUMMARY_ID_COLUMN_INDEX); String lookupId = cursor.getString(SUMMARY_LOOKUP_KEY_INDEX); @@ -537,7 +574,6 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl String key = String.valueOf(rawContactsId); setCheckStatus(key, checkBox); - view.setTag(key); } @Override @@ -647,15 +683,6 @@ public class MemberListActivity extends Activity implements AdapterView.OnItemCl return icon; } - @Override - public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { - if (!mListView.isItemChecked(position)) { - mListView.setItemChecked(position, true); - } else { - mListView.setItemChecked(position, false); - } - } - private void pickMembers() { Intent intent = new Intent(MultiPickContactActivity.ACTION_MULTI_PICK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); |