Removes the Group tab from the People Application.
There are still Group related code and resources that need to be removed.
This will occur in smaller subsequent CLs to reduce the scope of each.
Change-Id: Ifcedf38377f9da022942c694193e4e15f3ed77d3
diff --git a/res/layout-sw600dp-land/people_activity.xml b/res/layout-sw600dp-land/people_activity.xml
index 46f27a0..03a65d2 100644
--- a/res/layout-sw600dp-land/people_activity.xml
+++ b/res/layout-sw600dp-land/people_activity.xml
@@ -30,7 +30,7 @@
android:splitMotionEvents="true"
android:baselineAligned="false">
- <!-- Left panel browse list for Groups or All tabs -->
+ <!-- Left panel browse list for All tab -->
<FrameLayout
android:id="@+id/browse_view"
android:layout_width="0dip"
@@ -45,13 +45,6 @@
class="com.android.contacts.list.DefaultContactBrowseListFragment"
android:layout_height="match_parent"
android:layout_width="match_parent" />
-
- <!-- Groups -->
- <fragment
- android:id="@+id/groups_fragment"
- class="com.android.contacts.group.GroupBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
</FrameLayout>
<!-- Right panel detail view for All tab -->
@@ -79,24 +72,6 @@
android:visibility="gone"/>
</view>
- <!-- Right panel detail view for Groups tab -->
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/group_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This is the group detail page -->
- <fragment
- android:id="@+id/group_detail_fragment"
- class="com.android.contacts.group.GroupDetailFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- </view>
-
<!-- Two-panel view under the Favorites tab -->
<LinearLayout
android:id="@+id/favorites_view"
diff --git a/res/layout-sw600dp/people_activity.xml b/res/layout-sw600dp/people_activity.xml
index f788f72..d3f50e9 100644
--- a/res/layout-sw600dp/people_activity.xml
+++ b/res/layout-sw600dp/people_activity.xml
@@ -30,7 +30,7 @@
android:splitMotionEvents="true"
android:baselineAligned="false">
- <!-- Left panel browse list for Groups or All tabs -->
+ <!-- Left panel browse list for All tab -->
<FrameLayout
android:id="@+id/browse_view"
android:layout_width="0dip"
@@ -45,13 +45,6 @@
class="com.android.contacts.list.DefaultContactBrowseListFragment"
android:layout_height="match_parent"
android:layout_width="match_parent" />
-
- <!-- Groups -->
- <fragment
- android:id="@+id/groups_fragment"
- class="com.android.contacts.group.GroupBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
</FrameLayout>
<!-- Right panel detail view for All tab -->
@@ -84,24 +77,6 @@
android:visibility="gone" />
</view>
- <!-- Right panel detail view for Groups tab -->
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/group_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This is the group detail page -->
- <fragment
- android:id="@+id/group_detail_fragment"
- class="com.android.contacts.group.GroupDetailFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- </view>
-
<!-- Single panel view under the Favorites tab (Strequent) -->
<FrameLayout
android:id="@+id/favorites_view"
diff --git a/res/layout-sw720dp-land/people_activity.xml b/res/layout-sw720dp-land/people_activity.xml
index c33f0fa..7c5ac44 100644
--- a/res/layout-sw720dp-land/people_activity.xml
+++ b/res/layout-sw720dp-land/people_activity.xml
@@ -43,13 +43,6 @@
class="com.android.contacts.list.DefaultContactBrowseListFragment"
android:layout_height="match_parent"
android:layout_width="match_parent" />
-
- <!-- Groups -->
- <fragment
- android:id="@+id/groups_fragment"
- class="com.android.contacts.group.GroupBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
</FrameLayout>
<view
@@ -75,24 +68,6 @@
android:layout_width="0dip"
android:visibility="gone"/>
</view>
-
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/group_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This is the group detail page -->
- <fragment
- android:id="@+id/group_detail_fragment"
- class="com.android.contacts.group.GroupDetailFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- </view>
-
<LinearLayout
android:id="@+id/favorites_view"
android:layout_width="match_parent"
diff --git a/res/layout-sw720dp/people_activity.xml b/res/layout-sw720dp/people_activity.xml
index d8b4026..db585a9 100644
--- a/res/layout-sw720dp/people_activity.xml
+++ b/res/layout-sw720dp/people_activity.xml
@@ -30,7 +30,7 @@
android:splitMotionEvents="true"
android:baselineAligned="false">
- <!-- Left panel browse list for Groups or All tabs -->
+ <!-- Left panel browse list for All tab -->
<FrameLayout
android:id="@+id/browse_view"
android:layout_width="0dip"
@@ -45,13 +45,6 @@
class="com.android.contacts.list.DefaultContactBrowseListFragment"
android:layout_height="match_parent"
android:layout_width="match_parent" />
-
- <!-- Groups -->
- <fragment
- android:id="@+id/groups_fragment"
- class="com.android.contacts.group.GroupBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
</FrameLayout>
<!-- Right panel detail view for All tab -->
@@ -84,24 +77,6 @@
android:visibility="gone"/>
</view>
- <!-- Right panel detail view for Groups tab -->
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/group_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This is the group detail page -->
- <fragment
- android:id="@+id/group_detail_fragment"
- class="com.android.contacts.group.GroupDetailFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
- </view>
-
<!-- Two-panel view under the Favorites tab -->
<LinearLayout
android:id="@+id/favorites_view"
diff --git a/res/menu-sw600dp/people_options.xml b/res/menu-sw600dp/people_options.xml
index 891c1b4..97fc0ac 100644
--- a/res/menu-sw600dp/people_options.xml
+++ b/res/menu-sw600dp/people_options.xml
@@ -26,12 +26,6 @@
android:title="@string/menu_new_contact_action_bar"
android:showAsAction="ifRoom" />
- <item
- android:id="@+id/menu_add_group"
- android:icon="@drawable/ic_add_person_dk"
- android:title="@string/menu_new_group_action_bar"
- android:showAsAction="ifRoom" />
-
<!-- Added orderInCategory to keep the following buttons at the end of the menu
Buttons will be added in the order added/inflated. Ordered buttons will be added
at the end according to the orderInCategory. This setup insures that the buttons below
diff --git a/res/menu/people_options.xml b/res/menu/people_options.xml
index 2c7eedb..9638c2e 100644
--- a/res/menu/people_options.xml
+++ b/res/menu/people_options.xml
@@ -27,12 +27,6 @@
android:showAsAction="ifRoom" />
<item
- android:id="@+id/menu_add_group"
- android:icon="@drawable/ic_add_group_dk"
- android:title="@string/menu_new_group_action_bar"
- android:showAsAction="ifRoom" />
-
- <item
android:id="@+id/menu_contacts_filter"
android:title="@string/menu_contacts_filter" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5cad5f2..971bfc2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -281,14 +281,6 @@
[CHAR LIMIT=NONE] -->
<string name="contactsAllLabel">All contacts</string>
- <!-- The content description text for the groups tab.
-
- Note: AccessibilityServices use this attribute to announce what the view represents.
- This is especially valuable for views without textual representation like ImageView.
-
- [CHAR LIMIT=NONE] -->
- <string name="contactsGroupsLabel">Groups</string>
-
<!-- Action string for calling back a number in the call log -->
<string name="callBack">Call back</string>
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java
index f184d12..efad12f 100644
--- a/src/com/android/contacts/activities/ActionBarAdapter.java
+++ b/src/com/android/contacts/activities/ActionBarAdapter.java
@@ -87,9 +87,8 @@
public interface TabState {
public static int FAVORITES = 0;
public static int ALL = 1;
- public static int GROUPS = 2;
- public static int COUNT = 3;
+ public static int COUNT = 2;
public static int DEFAULT = ALL;
}
@@ -180,7 +179,6 @@
private void setupTabs() {
addTab(TabState.FAVORITES, R.drawable.ic_tab_starred, R.string.contactsFavoritesLabel);
addTab(TabState.ALL, R.drawable.ic_tab_all, R.string.contactsAllLabel);
- addTab(TabState.GROUPS, R.drawable.ic_tab_groups, R.string.contactsGroupsLabel);
}
private void setupNavigationList() {
@@ -188,7 +186,6 @@
R.layout.people_navigation_item);
navAdapter.add(mContext.getString(R.string.contactsFavoritesLabel));
navAdapter.add(mContext.getString(R.string.contactsAllLabel));
- navAdapter.add(mContext.getString(R.string.contactsGroupsLabel));
mActionBar.setListNavigationCallbacks(navAdapter, mNavigationListener);
}
@@ -202,8 +199,6 @@
return TabState.FAVORITES;
case 1:
return TabState.ALL;
- case 2:
- return TabState.GROUPS;
}
throw new IllegalArgumentException(
"Parameter must be between 0 and " + Integer.toString(TabState.COUNT-1)
@@ -219,8 +214,6 @@
return 0;
case TabState.ALL:
return 1;
- case TabState.GROUPS:
- return 2;
}
throw new IllegalArgumentException(
"Parameter must be between 0 and " + Integer.toString(TabState.COUNT-1)
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index a1699bf..88f4a19 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -59,9 +59,6 @@
import com.android.contacts.detail.ContactLoaderFragment.ContactLoaderFragmentListener;
import com.android.contacts.common.ContactsUtils;
import com.android.contacts.common.dialog.ClearFrequentsDialog;
-import com.android.contacts.group.GroupBrowseListFragment;
-import com.android.contacts.group.GroupBrowseListFragment.OnGroupBrowserActionListener;
-import com.android.contacts.group.GroupDetailFragment;
import com.android.contacts.interactions.ContactDeletionInteraction;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
import com.android.contacts.list.ContactBrowseListFragment;
@@ -115,8 +112,6 @@
// These values needs to start at 2. See {@link ContactEntryListFragment}.
private static final int SUBACTIVITY_NEW_CONTACT = 2;
private static final int SUBACTIVITY_EDIT_CONTACT = 3;
- private static final int SUBACTIVITY_NEW_GROUP = 4;
- private static final int SUBACTIVITY_EDIT_GROUP = 5;
private static final int SUBACTIVITY_ACCOUNT_FILTER = 6;
private final DialogManager mDialogManager = new DialogManager(this);
@@ -132,10 +127,6 @@
private final ContactDetailLoaderFragmentListener mContactDetailLoaderFragmentListener =
new ContactDetailLoaderFragmentListener();
- private GroupDetailFragment mGroupDetailFragment;
- private final GroupDetailFragmentListener mGroupDetailFragmentListener =
- new GroupDetailFragmentListener();
-
private ContactTileListFragment.Listener mFavoritesFragmentListener =
new StrequentContactListFragmentListener();
@@ -153,13 +144,11 @@
private DefaultContactBrowseListFragment mAllFragment;
private ContactTileListFragment mFavoritesFragment;
private ContactTileFrequentFragment mFrequentFragment;
- private GroupBrowseListFragment mGroupsFragment;
private View mFavoritesView;
private View mBrowserView;
private TransitionAnimationView mPeopleActivityView;
private TransitionAnimationView mContactDetailsView;
- private TransitionAnimationView mGroupDetailsView;
/** ViewPager for swipe, used only on the phone (i.e. one-pane mode) */
private ViewPager mTabPager;
@@ -347,7 +336,6 @@
if (isUsingTwoPanes) {
mFavoritesFragment = getFragment(R.id.favorites_fragment);
mAllFragment = getFragment(R.id.all_fragment);
- mGroupsFragment = getFragment(R.id.groups_fragment);
} else {
mTabPager = getView(R.id.tab_pager);
mTabPagerAdapter = new TabPagerAdapter();
@@ -356,7 +344,6 @@
final String FAVORITE_TAG = "tab-pager-favorite";
final String ALL_TAG = "tab-pager-all";
- final String GROUPS_TAG = "tab-pager-groups";
// Create the fragments and add as children of the view pager.
// The pager adapter will only change the visibility; it'll never create/destroy
@@ -368,17 +355,13 @@
fragmentManager.findFragmentByTag(FAVORITE_TAG);
mAllFragment = (DefaultContactBrowseListFragment)
fragmentManager.findFragmentByTag(ALL_TAG);
- mGroupsFragment = (GroupBrowseListFragment)
- fragmentManager.findFragmentByTag(GROUPS_TAG);
if (mFavoritesFragment == null) {
mFavoritesFragment = new ContactTileListFragment();
mAllFragment = new DefaultContactBrowseListFragment();
- mGroupsFragment = new GroupBrowseListFragment();
transaction.add(R.id.tab_pager, mFavoritesFragment, FAVORITE_TAG);
transaction.add(R.id.tab_pager, mAllFragment, ALL_TAG);
- transaction.add(R.id.tab_pager, mGroupsFragment, GROUPS_TAG);
}
}
@@ -386,13 +369,10 @@
mAllFragment.setOnContactListActionListener(new ContactBrowserActionListener());
- mGroupsFragment.setListener(new GroupBrowserActionListener());
-
// Hide all fragments for now. We adjust visibility when we get onSelectedTabChanged()
// from ActionBarAdapter.
transaction.hide(mFavoritesFragment);
transaction.hide(mAllFragment);
- transaction.hide(mGroupsFragment);
if (isUsingTwoPanes) {
// Prepare 2-pane only fragments/views...
@@ -401,7 +381,6 @@
mPeopleActivityView = getView(R.id.people_view);
mFavoritesView = getView(R.id.favorites_view);
mContactDetailsView = getView(R.id.contact_details_view);
- mGroupDetailsView = getView(R.id.group_details_view);
mBrowserView = getView(R.id.browse_view);
// Only favorites tab with two panes has a separate frequent fragment
@@ -415,14 +394,9 @@
mContactDetailLoaderFragment = getFragment(R.id.contact_detail_loader_fragment);
mContactDetailLoaderFragment.setListener(mContactDetailLoaderFragmentListener);
- mGroupDetailFragment = getFragment(R.id.group_detail_fragment);
- mGroupDetailFragment.setListener(mGroupDetailFragmentListener);
- mGroupDetailFragment.setQuickContact(true);
-
if (mContactDetailFragment != null) {
transaction.hide(mContactDetailFragment);
}
- transaction.hide(mGroupDetailFragment);
// Configure contact details
mContactDetailLayoutController = new ContactDetailLayoutController(this, savedState,
@@ -438,7 +412,7 @@
mFavoritesFragment.enableQuickContact(true);
mFavoritesFragment.setDisplayType(DisplayType.STARRED_ONLY);
} else {
- // For 2-pane in All and Groups but not in Favorites fragment, show the chevron
+ // For 2-pane in All but not in Favorites fragment, show the chevron
// for quick contact popup
mFavoritesFragment.enableQuickContact(isUsingTwoPanes);
mFavoritesFragment.setDisplayType(DisplayType.STREQUENT);
@@ -569,9 +543,6 @@
}
tabToOpen = TabState.ALL;
break;
- case ContactsRequest.ACTION_GROUP:
- tabToOpen = TabState.GROUPS;
- break;
default:
tabToOpen = -1;
break;
@@ -594,7 +565,6 @@
}
configureContactListFragment();
- configureGroupListFragment();
invalidateOptionsMenuIfNeeded();
}
@@ -615,16 +585,6 @@
invalidateOptionsMenuIfNeeded();
}
- private void setupGroupDetailFragment(Uri groupUri) {
- // If we are switching from one group to another, do a cross-fade
- if (mGroupDetailFragment != null && mGroupDetailFragment.getGroupUri() != null &&
- !UriUtils.areEqual(mGroupDetailFragment.getGroupUri(), groupUri)) {
- mGroupDetailsView.startMaskTransition(false, -1);
- }
- mGroupDetailFragment.loadGroup(groupUri);
- invalidateOptionsMenuIfNeeded();
- }
-
/**
* Handler for action bar actions.
*/
@@ -686,9 +646,6 @@
}
invalidateOptionsMenu();
showEmptyStateForTab(tab);
- if (tab == TabState.GROUPS) {
- mGroupsFragment.setAddAccountsVisibility(!areGroupWritableAccountsAvailable());
- }
return;
}
@@ -703,21 +660,12 @@
case TabState.FAVORITES:
mFavoritesView.setVisibility(View.VISIBLE);
mBrowserView.setVisibility(View.GONE);
- mGroupDetailsView.setVisibility(View.GONE);
mContactDetailsView.setVisibility(View.GONE);
break;
- case TabState.GROUPS:
- mFavoritesView.setVisibility(View.GONE);
- mBrowserView.setVisibility(View.VISIBLE);
- mGroupDetailsView.setVisibility(View.VISIBLE);
- mContactDetailsView.setVisibility(View.GONE);
- mGroupsFragment.setAddAccountsVisibility(!areGroupWritableAccountsAvailable());
- break;
case TabState.ALL:
mFavoritesView.setVisibility(View.GONE);
mBrowserView.setVisibility(View.VISIBLE);
mContactDetailsView.setVisibility(View.VISIBLE);
- mGroupDetailsView.setVisibility(View.GONE);
break;
}
@@ -739,8 +687,6 @@
hideFragment(ft, mAllFragment);
hideFragment(ft, mContactDetailLoaderFragment);
hideFragment(ft, mContactDetailFragment);
- hideFragment(ft, mGroupsFragment);
- hideFragment(ft, mGroupDetailFragment);
break;
case TabState.ALL:
hideFragment(ft, mFavoritesFragment);
@@ -748,17 +694,6 @@
showFragment(ft, mAllFragment);
showFragment(ft, mContactDetailLoaderFragment);
showFragment(ft, mContactDetailFragment);
- hideFragment(ft, mGroupsFragment);
- hideFragment(ft, mGroupDetailFragment);
- break;
- case TabState.GROUPS:
- hideFragment(ft, mFavoritesFragment);
- hideFragment(ft, mFrequentFragment);
- hideFragment(ft, mAllFragment);
- hideFragment(ft, mContactDetailLoaderFragment);
- hideFragment(ft, mContactDetailFragment);
- showFragment(ft, mGroupsFragment);
- showFragment(ft, mGroupDetailFragment);
break;
}
if (!ft.isEmpty()) {
@@ -778,10 +713,6 @@
mContactsUnavailableFragment.setMessageText(
R.string.listTotalAllContactsZeroStarred, -1);
break;
- case TabState.GROUPS:
- mContactsUnavailableFragment.setMessageText(R.string.noGroups,
- areGroupWritableAccountsAvailable() ? -1 : R.string.noAccounts);
- break;
case TabState.ALL:
mContactsUnavailableFragment.setMessageText(R.string.noContacts, -1);
break;
@@ -819,9 +750,6 @@
if (!mTabPagerAdapter.isSearchMode()) {
mActionBarAdapter.setCurrentTab(position, false);
showEmptyStateForTab(position);
- if (position == TabState.GROUPS) {
- mGroupsFragment.setAddAccountsVisibility(!areGroupWritableAccountsAvailable());
- }
invalidateOptionsMenu();
}
}
@@ -880,9 +808,6 @@
if (object == mAllFragment) {
return TabState.ALL;
}
- if (object == mGroupsFragment) {
- return TabState.GROUPS;
- }
}
return POSITION_NONE;
}
@@ -905,8 +830,6 @@
return mFavoritesFragment;
} else if (position == TabState.ALL) {
return mAllFragment;
- } else if (position == TabState.GROUPS) {
- return mGroupsFragment;
}
}
throw new IllegalArgumentException("position: " + position);
@@ -1025,12 +948,6 @@
return TextUtils.getLayoutDirectionFromLocale(locale) == View.LAYOUT_DIRECTION_RTL;
}
- private void configureGroupListFragment() {
- final boolean useTwoPane = PhoneCapabilityTester.isUsingTwoPanes(this);
- mGroupsFragment.setVerticalScrollbarPosition(getScrollBarPosition(useTwoPane));
- mGroupsFragment.setSelectionVisible(useTwoPane);
- }
-
@Override
public void onProviderStatusChange() {
updateViewConfiguration(false);
@@ -1309,59 +1226,6 @@
}
}
- private final class GroupBrowserActionListener implements OnGroupBrowserActionListener {
-
- GroupBrowserActionListener() {}
-
- @Override
- public void onViewGroupAction(Uri groupUri) {
- if (PhoneCapabilityTester.isUsingTwoPanes(PeopleActivity.this)) {
- setupGroupDetailFragment(groupUri);
- } else {
- Intent intent = new Intent(PeopleActivity.this, GroupDetailActivity.class);
- intent.setData(groupUri);
- startActivity(intent);
- }
- }
- }
-
- private class GroupDetailFragmentListener implements GroupDetailFragment.Listener {
-
- GroupDetailFragmentListener() {}
-
- @Override
- public void onGroupSizeUpdated(String size) {
- // Nothing needs to be done here because the size will be displayed in the detail
- // fragment
- }
-
- @Override
- public void onGroupTitleUpdated(String title) {
- // Nothing needs to be done here because the title will be displayed in the detail
- // fragment
- }
-
- @Override
- public void onAccountTypeUpdated(String accountTypeString, String dataSet) {
- // Nothing needs to be done here because the group source will be displayed in the
- // detail fragment
- }
-
- @Override
- public void onEditRequested(Uri groupUri) {
- final Intent intent = new Intent(PeopleActivity.this, GroupEditorActivity.class);
- intent.setData(groupUri);
- intent.setAction(Intent.ACTION_EDIT);
- startActivityForResult(intent, SUBACTIVITY_EDIT_GROUP);
- }
-
- @Override
- public void onContactSelected(Uri contactUri) {
- // Nothing needs to be done here because either quickcontact will be displayed
- // or activity will take care of selection
- }
- }
-
public void startActivityAndForwardResult(final Intent intent) {
intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
@@ -1408,10 +1272,6 @@
return true;
}
- if (mGroupDetailFragment != null && mGroupDetailFragment.isOptionsMenuChanged()) {
- return true;
- }
-
return false;
}
@@ -1426,15 +1286,12 @@
final MenuItem addContactMenu = menu.findItem(R.id.menu_add_contact);
final MenuItem contactsFilterMenu = menu.findItem(R.id.menu_contacts_filter);
- MenuItem addGroupMenu = menu.findItem(R.id.menu_add_group);
-
final MenuItem clearFrequentsMenu = menu.findItem(R.id.menu_clear_frequents);
final MenuItem helpMenu = menu.findItem(R.id.menu_help);
final boolean isSearchMode = mActionBarAdapter.isSearchMode();
if (isSearchMode) {
addContactMenu.setVisible(false);
- addGroupMenu.setVisible(false);
contactsFilterMenu.setVisible(false);
clearFrequentsMenu.setVisible(false);
helpMenu.setVisible(false);
@@ -1442,27 +1299,14 @@
switch (mActionBarAdapter.getCurrentTab()) {
case TabState.FAVORITES:
addContactMenu.setVisible(true);
- addGroupMenu.setVisible(false);
contactsFilterMenu.setVisible(false);
clearFrequentsMenu.setVisible(hasFrequents());
break;
case TabState.ALL:
addContactMenu.setVisible(true);
- addGroupMenu.setVisible(false);
contactsFilterMenu.setVisible(true);
clearFrequentsMenu.setVisible(false);
break;
- case TabState.GROUPS:
- // Do not display the "new group" button if no accounts are available
- if (areGroupWritableAccountsAvailable()) {
- addGroupMenu.setVisible(true);
- } else {
- addGroupMenu.setVisible(false);
- }
- addContactMenu.setVisible(false);
- contactsFilterMenu.setVisible(false);
- clearFrequentsMenu.setVisible(false);
- break;
}
HelpUtils.prepareHelpMenuItem(this, helpMenu, R.string.help_url_people_main);
}
@@ -1555,10 +1399,6 @@
}
return true;
}
- case R.id.menu_add_group: {
- createNewGroup();
- return true;
- }
case R.id.menu_import_export: {
ImportExportDialogFragment.show(getFragmentManager(), areContactsAvailable(),
PeopleActivity.class);
@@ -1587,12 +1427,6 @@
return false;
}
- private void createNewGroup() {
- final Intent intent = new Intent(this, GroupEditorActivity.class);
- intent.setAction(Intent.ACTION_INSERT);
- startActivityForResult(intent, SUBACTIVITY_NEW_GROUP);
- }
-
@Override
public boolean onSearchRequested() { // Search key pressed.
mActionBarAdapter.setSearchMode(true);
@@ -1623,16 +1457,6 @@
}
break;
}
-
- case SUBACTIVITY_NEW_GROUP:
- case SUBACTIVITY_EDIT_GROUP: {
- if (resultCode == RESULT_OK && PhoneCapabilityTester.isUsingTwoPanes(this)) {
- mRequest.setActionCode(ContactsRequest.ACTION_GROUP);
- mGroupsFragment.setSelectedUri(data.getData());
- }
- break;
- }
-
// TODO: Using the new startActivityWithResultFromFragment API this should not be needed
// anymore
case ContactEntryListFragment.ACTIVITY_REQUEST_CODE_PICKER: