Remove two panel layout from PeopleActivity
Also, removed tablet versions of PeopleTheme. There isn't a good
reason to have seperate themes for tablets and phones. The only
differences will be dimensions. These will be controllable by
dimens.xml.
Change-Id: Icf24e57fe052d6a820e8bee50fced438bba157b2
diff --git a/res/layout-sw600dp-land/people_activity.xml b/res/layout-sw600dp-land/people_activity.xml
deleted file mode 100644
index 03a65d2..0000000
--- a/res/layout-sw600dp-land/people_activity.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/people_view"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:id="@+id/main_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- android:splitMotionEvents="true"
- android:baselineAligned="false">
-
- <!-- Left panel browse list for All tab -->
- <FrameLayout
- android:id="@+id/browse_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="@drawable/list_background_holo"
- android:visibility="gone">
-
- <!-- All -->
- <fragment
- android:id="@+id/all_fragment"
- class="com.android.contacts.list.DefaultContactBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
- </FrameLayout>
-
- <!-- Right panel detail view for All tab -->
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/contact_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This layout includes all possible views needed for a contact detail page -->
- <include
- android:id="@+id/contact_detail_container"
- layout="@layout/contact_detail_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
- <!-- This invisible worker fragment loads the contact's details -->
- <fragment
- android:id="@+id/contact_detail_loader_fragment"
- class="com.android.contacts.detail.ContactLoaderFragment"
- android:layout_height="0dip"
- android:layout_width="0dip"
- android:visibility="gone"/>
- </view>
-
- <!-- Two-panel view under the Favorites tab -->
- <LinearLayout
- android:id="@+id/favorites_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/list_background_holo"
- android:baselineAligned="false">
-
- <!-- Starred -->
- <FrameLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:background="@drawable/panel_favorites_holo_light">
-
- <fragment
- android:id="@+id/favorites_fragment"
- class="com.android.contacts.list.ContactTileListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginStart="16dip"
- android:layout_marginEnd="16dip" />
-
- </FrameLayout>
-
- <!-- Most Frequent -->
- <fragment
- android:id="@+id/frequent_fragment"
- class="com.android.contacts.list.ContactTileFrequentFragment"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_marginTop="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginEnd="16dip"/>
-
- </LinearLayout>
-
- </LinearLayout>
-
- <com.android.contacts.widget.InterpolatingLayout
- android:id="@+id/contacts_unavailable_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/background_holo_light"
- android:visibility="gone">
-
- <FrameLayout
- android:id="@+id/contacts_unavailable_container"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- ex:layout_narrowParentWidth="800dip"
- ex:layout_narrowMarginLeft="80dip"
- ex:layout_narrowMarginRight="80dip"
- ex:layout_wideParentWidth="1280dip"
- ex:layout_wideMarginLeft="200dip"
- ex:layout_wideMarginRight="200dip"
- android:paddingBottom="20dip" />
-
- </com.android.contacts.widget.InterpolatingLayout>
-</view>
diff --git a/res/layout-sw600dp/people_activity.xml b/res/layout-sw600dp/people_activity.xml
deleted file mode 100644
index d3f50e9..0000000
--- a/res/layout-sw600dp/people_activity.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/people_view"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:id="@+id/main_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- android:splitMotionEvents="true"
- android:baselineAligned="false">
-
- <!-- Left panel browse list for All tab -->
- <FrameLayout
- android:id="@+id/browse_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="@drawable/list_background_holo"
- android:visibility="gone">
-
- <!-- All -->
- <fragment
- android:id="@+id/all_fragment"
- class="com.android.contacts.list.DefaultContactBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
- </FrameLayout>
-
- <!-- Right panel detail view for All tab -->
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/contact_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This layout includes all possible views needed for a contact detail page -->
- <include
- android:id="@+id/contact_detail_container"
- layout="@layout/contact_detail_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginStart="16dip"
- android:layout_marginEnd="16dip"
- android:layout_marginTop="16dip" />
-
- <!-- This invisible worker fragment loads the contact's details -->
- <fragment
- android:id="@+id/contact_detail_loader_fragment"
- class="com.android.contacts.detail.ContactLoaderFragment"
- android:layout_height="0dip"
- android:layout_width="0dip"
- android:visibility="gone" />
- </view>
-
- <!-- Single panel view under the Favorites tab (Strequent) -->
- <FrameLayout
- android:id="@+id/favorites_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/background_primary">
-
- <fragment
- android:id="@+id/favorites_fragment"
- class="com.android.contacts.list.ContactTileListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginStart="16dip"
- android:layout_marginEnd="16dip" />
-
- </FrameLayout>
-
- </LinearLayout>
-
- <com.android.contacts.widget.InterpolatingLayout
- android:id="@+id/contacts_unavailable_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/background_holo_light"
- android:visibility="gone">
-
- <FrameLayout
- android:id="@+id/contacts_unavailable_container"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- ex:layout_narrowParentWidth="800dip"
- ex:layout_narrowMarginLeft="80dip"
- ex:layout_narrowMarginRight="80dip"
- ex:layout_wideParentWidth="1280dip"
- ex:layout_wideMarginLeft="200dip"
- ex:layout_wideMarginRight="200dip"
- android:paddingBottom="20dip" />
-
- </com.android.contacts.widget.InterpolatingLayout>
-</view>
diff --git a/res/layout-sw720dp-land/people_activity.xml b/res/layout-sw720dp-land/people_activity.xml
deleted file mode 100644
index 7c5ac44..0000000
--- a/res/layout-sw720dp-land/people_activity.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/people_view"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:id="@+id/main_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- android:splitMotionEvents="true">
-
- <FrameLayout
- android:id="@+id/browse_view"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="@drawable/list_background_holo"
- android:visibility="gone">
-
- <!-- All -->
- <fragment
- android:id="@+id/all_fragment"
- class="com.android.contacts.list.DefaultContactBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
- </FrameLayout>
-
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/contact_details_view"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This layout includes all possible views needed for a contact detail page -->
- <include
- android:id="@+id/contact_detail_container"
- layout="@layout/contact_detail_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
- <!-- This invisible worker fragment loads the contact's details -->
- <fragment
- android:id="@+id/contact_detail_loader_fragment"
- class="com.android.contacts.detail.ContactLoaderFragment"
- android:layout_height="0dip"
- android:layout_width="0dip"
- android:visibility="gone"/>
- </view>
- <LinearLayout
- android:id="@+id/favorites_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/list_background_holo"
- android:baselineAligned="false">
-
- <!-- Starred -->
- <FrameLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="7"
- android:background="@drawable/panel_favorites_holo_light">
-
- <fragment
- android:id="@+id/favorites_fragment"
- class="com.android.contacts.list.ContactTileListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_marginLeft="32dip"
- android:layout_marginRight="32dip"
- android:layout_marginStart="32dip"
- android:layout_marginEnd="32dip"/>
-
- </FrameLayout>
-
- <!-- Most Frequent -->
- <fragment
- android:id="@+id/frequent_fragment"
- class="com.android.contacts.list.ContactTileFrequentFragment"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="3"
- android:layout_marginTop="32dip"
- android:layout_marginRight="16dip"
- android:layout_marginEnd="16dip"/>
-
- </LinearLayout>
-
- </LinearLayout>
-
- <com.android.contacts.widget.InterpolatingLayout
- android:id="@+id/contacts_unavailable_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/background_holo_light"
- android:visibility="gone">
-
- <FrameLayout
- android:id="@+id/contacts_unavailable_container"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- ex:layout_narrowParentWidth="800dip"
- ex:layout_narrowMarginLeft="80dip"
- ex:layout_narrowMarginRight="80dip"
- ex:layout_wideParentWidth="1280dip"
- ex:layout_wideMarginLeft="200dip"
- ex:layout_wideMarginRight="200dip"
- android:paddingBottom="20dip" />
-
- </com.android.contacts.widget.InterpolatingLayout>
-</view>
diff --git a/res/layout-sw720dp/people_activity.xml b/res/layout-sw720dp/people_activity.xml
deleted file mode 100644
index db585a9..0000000
--- a/res/layout-sw720dp/people_activity.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/people_view"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:id="@+id/main_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- android:splitMotionEvents="true"
- android:baselineAligned="false">
-
- <!-- Left panel browse list for All tab -->
- <FrameLayout
- android:id="@+id/browse_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="@drawable/list_background_holo"
- android:visibility="gone">
-
- <!-- All -->
- <fragment
- android:id="@+id/all_fragment"
- class="com.android.contacts.list.DefaultContactBrowseListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent" />
- </FrameLayout>
-
- <!-- Right panel detail view for All tab -->
- <view
- class="com.android.contacts.widget.TransitionAnimationView"
- android:id="@+id/contact_details_view"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="2"
- android:visibility="gone">
-
- <!-- This layout includes all possible views needed for a contact detail page -->
- <include
- android:id="@+id/contact_detail_container"
- layout="@layout/contact_detail_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginStart="16dip"
- android:layout_marginEnd="16dip"
- android:layout_marginTop="16dip" />
-
- <!-- This invisible worker fragment loads the contact's details -->
- <fragment
- android:id="@+id/contact_detail_loader_fragment"
- class="com.android.contacts.detail.ContactLoaderFragment"
- android:layout_height="0dip"
- android:layout_width="0dip"
- android:visibility="gone"/>
- </view>
-
- <!-- Two-panel view under the Favorites tab -->
- <LinearLayout
- android:id="@+id/favorites_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/list_background_holo"
- android:baselineAligned="false">
-
- <!-- Starred -->
- <FrameLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="10"
- android:background="@drawable/panel_favorites_holo_light">
-
- <fragment
- android:id="@+id/favorites_fragment"
- class="com.android.contacts.list.ContactTileListFragment"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginStart="16dip"
- android:layout_marginEnd="16dip" />
-
- </FrameLayout>
-
- <!-- Most Frequent -->
- <fragment
- android:id="@+id/frequent_fragment"
- class="com.android.contacts.list.ContactTileFrequentFragment"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="8"
- android:layout_marginTop="16dip"
- android:layout_marginRight="16dip"
- android:layout_marginEnd="16dip"/>
-
- </LinearLayout>
-
- </LinearLayout>
-
- <com.android.contacts.widget.InterpolatingLayout
- android:id="@+id/contacts_unavailable_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/background_holo_light"
- android:visibility="gone">
-
- <FrameLayout
- android:id="@+id/contacts_unavailable_container"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- ex:layout_narrowParentWidth="800dip"
- ex:layout_narrowMarginLeft="80dip"
- ex:layout_narrowMarginRight="80dip"
- ex:layout_wideParentWidth="1280dip"
- ex:layout_wideMarginLeft="200dip"
- ex:layout_wideMarginRight="200dip"
- android:paddingBottom="20dip" />
-
- </com.android.contacts.widget.InterpolatingLayout>
-</view>
diff --git a/res/values-sw600dp-land/styles.xml b/res/values-sw600dp-land/styles.xml
deleted file mode 100644
index 3119623..0000000
--- a/res/values-sw600dp-land/styles.xml
+++ /dev/null
@@ -1,56 +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>
- <style name="PeopleTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
- <item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
- <item name="android:actionBarWidgetTheme">@style/ContactsActionBarTheme</item>
- <item name="android:actionOverflowButtonStyle">@style/ContactsActionBarOverflow</item>
- <item name="android:actionBarItemBackground">@drawable/action_bar_item_background</item>
- <item name="android:actionBarTabStyle">@style/ContactsActionBarTabView</item>
- <item name="android:actionDropDownStyle">@style/ContactsActionBarDropDownStyle</item>
- <item name="android:textColorPrimary">@color/primary_text_color</item>
- <item name="android:textColorSecondary">@color/secondary_text_color</item>
- <item name="android:listViewStyle">@style/ListViewStyle</item>
- <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
- <item name="activated_background">@drawable/list_item_activated_background</item>
- <item name="section_header_background">@drawable/list_title_holo</item>
- <item name="list_item_padding_top">0dip</item>
- <item name="list_item_padding_right">24dip</item>
- <item name="list_item_padding_bottom">0dip</item>
- <item name="list_item_padding_left">0dip</item>
- <item name="list_item_gap_between_image_and_text">8dip</item>
- <item name="list_item_gap_between_label_and_data">5dip</item>
- <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_profile_photo_size">80dip</item>
- <item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
- <item name="list_item_background_color">@color/holo_list_background_color</item>
- <item name="list_item_header_text_indent">8dip</item>
- <item name="list_item_header_text_size">14sp</item>
- <item name="list_item_header_text_color">@color/people_app_theme_color</item>
- <item name="list_item_header_height">32dip</item>
- <item name="list_item_data_width_weight">5</item>
- <item name="list_item_label_width_weight">3</item>
- <item name="contact_browser_list_padding_left">0dip</item>
- <item name="contact_browser_list_padding_right">0dip</item>
- <item name="contact_browser_background">@android:color/transparent</item>
- <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
- <!-- Favorites -->
- <item name="favorites_padding_bottom">0dip</item>
- </style>
-
-</resources>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index 827d6a4..a96aa5a 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -14,45 +14,7 @@
limitations under the License.
-->
<resources>
- <style name="PeopleTheme" parent="@android:style/Theme.Holo.Light">
- <item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
- <item name="android:homeAsUpIndicator">@drawable/ic_menu_back</item>
- <item name="android:actionOverflowButtonStyle">@style/ContactsActionBarOverflow</item>
- <item name="android:actionBarWidgetTheme">@style/ContactsActionBarTheme</item>
- <item name="android:actionBarItemBackground">@drawable/action_bar_item_background</item>
- <item name="android:actionBarTabStyle">@style/ContactsActionBarTabView</item>
- <item name="android:actionDropDownStyle">@style/ContactsActionBarDropDownStyle</item>
- <item name="android:textColorPrimary">@color/primary_text_color</item>
- <item name="android:textColorSecondary">@color/secondary_text_color</item>
- <item name="android:listViewStyle">@style/ListViewStyle</item>
- <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
- <item name="activated_background">@drawable/list_item_activated_background</item>
- <item name="section_header_background">@drawable/list_title_holo</item>
- <item name="list_item_padding_top">8dip</item>
- <item name="list_item_padding_right">12dip</item>
- <item name="list_item_padding_bottom">8dip</item>
- <item name="list_item_padding_left">0dip</item>
- <item name="list_item_gap_between_image_and_text">8dip</item>
- <item name="list_item_gap_between_label_and_data">5dip</item>
- <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_profile_photo_size">80dip</item>
- <item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
- <item name="list_item_background_color">@color/holo_list_background_color</item>
- <item name="list_item_header_text_indent">8dip</item>
- <item name="list_item_header_text_size">14sp</item>
- <item name="list_item_header_text_color">@color/people_app_theme_color</item>
- <item name="list_item_header_height">30dip</item>
- <item name="list_item_data_width_weight">5</item>
- <item name="list_item_label_width_weight">3</item>
- <item name="contact_browser_list_padding_left">0dip</item>
- <item name="contact_browser_list_padding_right">0dip</item>
- <item name="contact_browser_background">@android:color/transparent</item>
- <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
- <!-- Favorites -->
- <item name="favorites_padding_bottom">0dip</item>
- </style>
+
<style name="ContactPickerTheme" parent="@android:Theme.Holo.Light.Dialog">
<item name="android:windowSoftInputMode">adjustResize</item>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
deleted file mode 100644
index 740a02c..0000000
--- a/res/values-sw720dp/styles.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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>
- <style name="PeopleTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
- <item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
- <item name="android:homeAsUpIndicator">@drawable/ic_menu_back</item>
- <item name="android:actionOverflowButtonStyle">@style/ContactsActionBarOverflow</item>
- <item name="android:actionBarWidgetTheme">@style/ContactsActionBarTheme</item>
- <item name="android:actionBarItemBackground">@drawable/action_bar_item_background</item>
- <item name="android:actionBarTabStyle">@style/ContactsActionBarTabView</item>
- <item name="android:actionDropDownStyle">@style/ContactsActionBarDropDownStyle</item>
- <item name="android:textColorPrimary">@color/primary_text_color</item>
- <item name="android:textColorSecondary">@color/secondary_text_color</item>
- <item name="android:listViewStyle">@style/ListViewStyle</item>
- <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
- <item name="activated_background">@drawable/list_item_activated_background</item>
- <item name="section_header_background">@drawable/list_title_holo</item>
- <item name="list_item_padding_top">8dip</item>
- <item name="list_item_padding_right">24dip</item>
- <item name="list_item_padding_bottom">8dip</item>
- <item name="list_item_padding_left">0dip</item>
- <item name="list_item_gap_between_image_and_text">16dip</item>
- <item name="list_item_gap_between_label_and_data">5dip</item>
- <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_profile_photo_size">80dip</item>
- <item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
- <item name="list_item_background_color">@color/holo_list_background_color</item>
- <item name="list_item_header_text_indent">8dip</item>
- <item name="list_item_header_text_color">@color/people_app_theme_color</item>
- <item name="list_item_header_height">30dip</item>
- <item name="list_item_header_text_size">14sp</item>
- <item name="contact_browser_list_padding_left">0dip</item>
- <item name="contact_browser_list_padding_right">0dip</item>
- <item name="contact_browser_background">@android:color/transparent</item>
- <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
- <!-- Favorites -->
- <item name="favorites_padding_bottom">0dip</item>
- </style>
-</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cf49035..127d93b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -474,9 +474,6 @@
<!-- The description of the directory where the contact was found [CHAR LIMIT=100]-->
<string name="contact_directory_description">Directory <xliff:g id="type" example="Corporate Directory">%1$s</xliff:g></string>
- <!-- Toast shown when creating a personal copy of a contact [CHAR LIMIT=100] -->
- <string name="toast_making_personal_copy">Creating a personal copy\u2026</string>
-
<!-- Contact list filter indicating that the list shows groups chosen by the user [CHAR LIMIT=64] -->
<string name="list_filter_custom">Custom</string>
diff --git a/src/com/android/contacts/activities/ContactDetailActivity.java b/src/com/android/contacts/activities/ContactDetailActivity.java
index a4e0470..c984b7a 100644
--- a/src/com/android/contacts/activities/ContactDetailActivity.java
+++ b/src/com/android/contacts/activities/ContactDetailActivity.java
@@ -66,35 +66,11 @@
@Override
protected void onCreate(Bundle savedState) {
super.onCreate(savedState);
- if (PhoneCapabilityTester.isUsingTwoPanes(this)) {
- // This activity must not be shown. We have to select the contact in the
- // PeopleActivity instead ==> Create a forward intent and finish
- final Intent originalIntent = getIntent();
- Intent intent = new Intent();
- intent.setAction(originalIntent.getAction());
- intent.setDataAndType(originalIntent.getData(), originalIntent.getType());
-
- // If we are launched from the outside, we should create a new task, because the user
- // can freely navigate the app (this is different from phones, where only the UP button
- // kicks the user into the full app)
- if (shouldUpRecreateTask(intent)) {
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- } else {
- intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS |
- Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_SINGLE_TOP |
- Intent.FLAG_ACTIVITY_CLEAR_TOP);
- }
- intent.setClass(this, PeopleActivity.class);
- startActivity(intent);
- finish();
- return;
- }
setContentView(R.layout.contact_detail_activity);
mContactDetailLayoutController = new ContactDetailLayoutController(this, savedState,
- getFragmentManager(), null, findViewById(R.id.contact_detail_container),
- mContactDetailFragmentListener);
+ getFragmentManager(), null, mContactDetailFragmentListener);
// We want the UP affordance but no app icon.
// Setting HOME_AS_UP, SHOW_TITLE and clearing SHOW_HOME does the trick.
diff --git a/src/com/android/contacts/activities/GroupEditorActivity.java b/src/com/android/contacts/activities/GroupEditorActivity.java
index ff9301b..b204418 100644
--- a/src/com/android/contacts/activities/GroupEditorActivity.java
+++ b/src/com/android/contacts/activities/GroupEditorActivity.java
@@ -145,20 +145,13 @@
@Override
public void onSaveFinished(int resultCode, Intent resultIntent) {
- // TODO: Collapse these 2 cases into 1 that will just launch an intent with the VIEW
- // action to see the group URI (when group URIs are supported)
- // For a 2-pane screen, set the activity result, so the original activity (that launched
- // the editor) can display the group detail page
- if (PhoneCapabilityTester.isUsingTwoPanes(GroupEditorActivity.this)) {
- setResult(resultCode, resultIntent);
- } else if (resultIntent != null) {
- // For a 1-pane screen, launch the group detail page
+ if (resultIntent != null) {
Intent intent = new Intent(GroupEditorActivity.this, GroupDetailActivity.class);
intent.setData(resultIntent.getData());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
+ finish();
}
- finish();
}
};
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 38e4d28..8b75a7e 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -19,13 +19,10 @@
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
-import android.content.ActivityNotFoundException;
-import android.content.ContentValues;
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
import android.os.Parcelable;
import android.os.UserManager;
import android.preference.PreferenceActivity;
@@ -44,30 +41,21 @@
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
-import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
-import android.widget.Toast;
-import com.android.contacts.ContactSaveService;
import com.android.contacts.ContactsActivity;
import com.android.contacts.R;
import com.android.contacts.activities.ActionBarAdapter.TabState;
-import com.android.contacts.detail.ContactDetailFragment;
-import com.android.contacts.detail.ContactDetailLayoutController;
-import com.android.contacts.detail.ContactLoaderFragment;
-import com.android.contacts.detail.ContactLoaderFragment.ContactLoaderFragmentListener;
import com.android.contacts.common.ContactsUtils;
import com.android.contacts.common.dialog.ClearFrequentsDialog;
import com.android.contacts.interactions.ContactDeletionInteraction;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
-import com.android.contacts.list.ContactBrowseListFragment;
import com.android.contacts.common.list.ContactEntryListFragment;
import com.android.contacts.common.list.ContactListFilter;
import com.android.contacts.common.list.ContactListFilterController;
import com.android.contacts.common.list.ContactTileAdapter.DisplayType;
-import com.android.contacts.list.ContactTileFrequentFragment;
import com.android.contacts.list.ContactTileListFragment;
import com.android.contacts.list.ContactsIntentResolver;
import com.android.contacts.list.ContactsRequest;
@@ -78,8 +66,6 @@
import com.android.contacts.list.OnContactsUnavailableActionListener;
import com.android.contacts.list.ProviderStatusWatcher;
import com.android.contacts.list.ProviderStatusWatcher.ProviderStatusListener;
-import com.android.contacts.common.model.Contact;
-import com.android.contacts.common.model.account.AccountWithDataSet;
import com.android.contacts.preference.ContactsPreferenceActivity;
import com.android.contacts.preference.DisplayOptionsPreferenceFragment;
import com.android.contacts.common.util.AccountFilterUtil;
@@ -88,17 +74,12 @@
import com.android.contacts.common.util.Constants;
import com.android.contacts.util.DialogManager;
import com.android.contacts.util.HelpUtils;
-import com.android.contacts.util.PhoneCapabilityTester;
-import com.android.contacts.common.util.UriUtils;
-import com.android.contacts.widget.TransitionAnimationView;
-import java.util.ArrayList;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicInteger;
/**
- * Displays a list to browse contacts. For xlarge screens, this also displays a detail-pane on
- * the right.
+ * Displays a list to browse contacts.
*/
public class PeopleActivity extends ContactsActivity implements
View.OnCreateContextMenuListener,
@@ -110,14 +91,10 @@
private static final String TAG = "PeopleActivity";
- private static final int TAB_FADE_IN_DURATION = 500;
-
private static final String ENABLE_DEBUG_OPTIONS_HIDDEN_CODE = "debug debug!";
// 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_ACCOUNT_FILTER = 6;
+ private static final int SUBACTIVITY_ACCOUNT_FILTER = 2;
private final DialogManager mDialogManager = new DialogManager(this);
@@ -126,12 +103,6 @@
private ActionBarAdapter mActionBarAdapter;
- private ContactDetailFragment mContactDetailFragment;
-
- private ContactLoaderFragment mContactDetailLoaderFragment;
- private final ContactDetailLoaderFragmentListener mContactDetailLoaderFragmentListener =
- new ContactDetailLoaderFragmentListener();
-
private ContactTileListFragment.Listener mFavoritesFragmentListener =
new StrequentContactListFragmentListener();
@@ -148,28 +119,14 @@
*/
private DefaultContactBrowseListFragment mAllFragment;
private ContactTileListFragment mFavoritesFragment;
- private ContactTileFrequentFragment mFrequentFragment;
- private View mFavoritesView;
- private View mBrowserView;
- private TransitionAnimationView mPeopleActivityView;
- private TransitionAnimationView mContactDetailsView;
-
- private View mFloatingActionButtonContainer;
- private ImageButton mFloatingActionButton;
-
- /** ViewPager for swipe, used only on the phone (i.e. one-pane mode) */
+ /** ViewPager for swipe */
private ViewPager mTabPager;
private TabPagerAdapter mTabPagerAdapter;
private final TabPagerListener mTabPagerListener = new TabPagerListener();
- private int mPreviousTab = TabState.DEFAULT;
-
- private ContactDetailLayoutController mContactDetailLayoutController;
private boolean mEnableDebugMenuOptions;
- private final Handler mHandler = new Handler();
-
/**
* True if this activity instance is a re-created one. i.e. set true after orientation change.
* This is set in {@link #onCreate} for later use in {@link #onStart}.
@@ -185,14 +142,6 @@
private boolean mFragmentInitialized;
/**
- * Whether or not the current contact filter is valid or not. We need to do a check on
- * start of the app to verify that the user is not in single contact mode. If so, we should
- * dynamically change the filter, unless the incoming intent specifically requested a contact
- * that should be displayed in that mode.
- */
- private boolean mCurrentFilterIsValid;
-
- /**
* This is to disable {@link #onOptionsItemSelected} when we trying to stop the activity.
*/
private boolean mDisableOptionItemSelected;
@@ -232,18 +181,14 @@
* For the fragments that are in the layout, we initialize them in
* {@link #createViewsAndFragments(Bundle)} after inflating the layout.
*
- * However, there are special fragments which may not be in the layout, so we have to do the
- * initialization here.
- * The target fragments are:
- * - {@link ContactDetailFragment}: This may not be available
- * in the layout depending on the configuration. (i.e. portrait)
- * - {@link ContactsUnavailableFragment}: We always create it at runtime.
+ * However, the {@link ContactsUnavailableFragment} is a special fragment which may not
+ * be in the layout, so we have to do the initialization here.
+ *
+ * The ContactsUnavailableFragment is always created at runtime.
*/
@Override
public void onAttachFragment(Fragment fragment) {
- if (fragment instanceof ContactDetailFragment) {
- mContactDetailFragment = (ContactDetailFragment) fragment;
- } else if (fragment instanceof ContactsUnavailableFragment) {
+ if (fragment instanceof ContactsUnavailableFragment) {
mContactsUnavailableFragment = (ContactsUnavailableFragment)fragment;
mContactsUnavailableFragment.setOnContactsUnavailableActionListener(
new ContactsUnavailableFragmentListener());
@@ -285,7 +230,6 @@
mActionBarAdapter.initialize(null, mRequest);
mContactListFilterController.checkFilterValidity(false);
- mCurrentFilterIsValid = true;
// Re-configure fragments.
configureFragments(true /* from request */);
@@ -320,8 +264,7 @@
return false;
}
- if (mRequest.getActionCode() == ContactsRequest.ACTION_VIEW_CONTACT
- && !PhoneCapabilityTester.isUsingTwoPanes(this)) {
+ if (mRequest.getActionCode() == ContactsRequest.ACTION_VIEW_CONTACT) {
redirect = new Intent(this, ContactDetailActivity.class);
redirect.setAction(Intent.ACTION_VIEW);
redirect.setData(mRequest.getContactUri());
@@ -339,38 +282,31 @@
// Hide all tabs (the current tab will later be reshown once a tab is selected)
final FragmentTransaction transaction = fragmentManager.beginTransaction();
- // Prepare the fragments which are used both on 1-pane and on 2-pane.
- final boolean isUsingTwoPanes = PhoneCapabilityTester.isUsingTwoPanes(this);
- if (isUsingTwoPanes) {
- mFavoritesFragment = getFragment(R.id.favorites_fragment);
- mAllFragment = getFragment(R.id.all_fragment);
- } else {
- mTabPager = getView(R.id.tab_pager);
- mTabPagerAdapter = new TabPagerAdapter();
- mTabPager.setAdapter(mTabPagerAdapter);
- mTabPager.setOnPageChangeListener(mTabPagerListener);
+ mTabPager = getView(R.id.tab_pager);
+ mTabPagerAdapter = new TabPagerAdapter();
+ mTabPager.setAdapter(mTabPagerAdapter);
+ mTabPager.setOnPageChangeListener(mTabPagerListener);
- final String FAVORITE_TAG = "tab-pager-favorite";
- final String ALL_TAG = "tab-pager-all";
+ final String FAVORITE_TAG = "tab-pager-favorite";
+ final String ALL_TAG = "tab-pager-all";
- // Create the fragments and add as children of the view pager.
- // The pager adapter will only change the visibility; it'll never create/destroy
- // fragments.
- // However, if it's after screen rotation, the fragments have been re-created by
- // the fragment manager, so first see if there're already the target fragments
- // existing.
- mFavoritesFragment = (ContactTileListFragment)
- fragmentManager.findFragmentByTag(FAVORITE_TAG);
- mAllFragment = (DefaultContactBrowseListFragment)
- fragmentManager.findFragmentByTag(ALL_TAG);
+ // Create the fragments and add as children of the view pager.
+ // The pager adapter will only change the visibility; it'll never create/destroy
+ // fragments.
+ // However, if it's after screen rotation, the fragments have been re-created by
+ // the fragment manager, so first see if there're already the target fragments
+ // existing.
+ mFavoritesFragment = (ContactTileListFragment)
+ fragmentManager.findFragmentByTag(FAVORITE_TAG);
+ mAllFragment = (DefaultContactBrowseListFragment)
+ fragmentManager.findFragmentByTag(ALL_TAG);
- if (mFavoritesFragment == null) {
- mFavoritesFragment = new ContactTileListFragment();
- mAllFragment = new DefaultContactBrowseListFragment();
+ if (mFavoritesFragment == null) {
+ mFavoritesFragment = new ContactTileListFragment();
+ mAllFragment = new DefaultContactBrowseListFragment();
- transaction.add(R.id.tab_pager, mFavoritesFragment, FAVORITE_TAG);
- transaction.add(R.id.tab_pager, mAllFragment, ALL_TAG);
- }
+ transaction.add(R.id.tab_pager, mFavoritesFragment, FAVORITE_TAG);
+ transaction.add(R.id.tab_pager, mAllFragment, ALL_TAG);
}
mFavoritesFragment.setListener(mFavoritesFragmentListener);
@@ -382,59 +318,22 @@
transaction.hide(mFavoritesFragment);
transaction.hide(mAllFragment);
- if (isUsingTwoPanes) {
- // Prepare 2-pane only fragments/views...
-
- // Container views for fragments
- mPeopleActivityView = getView(R.id.people_view);
- mFavoritesView = getView(R.id.favorites_view);
- mContactDetailsView = getView(R.id.contact_details_view);
- mBrowserView = getView(R.id.browse_view);
-
- // Only favorites tab with two panes has a separate frequent fragment
- if (PhoneCapabilityTester.isUsingTwoPanesInFavorites(this)) {
- mFrequentFragment = getFragment(R.id.frequent_fragment);
- mFrequentFragment.setListener(mFavoritesFragmentListener);
- mFrequentFragment.setDisplayType(DisplayType.FREQUENT_ONLY);
- mFrequentFragment.enableQuickContact(true);
- }
-
- mContactDetailLoaderFragment = getFragment(R.id.contact_detail_loader_fragment);
- mContactDetailLoaderFragment.setListener(mContactDetailLoaderFragmentListener);
-
- if (mContactDetailFragment != null) {
- transaction.hide(mContactDetailFragment);
- }
-
- // Configure contact details
- mContactDetailLayoutController = new ContactDetailLayoutController(this, savedState,
- getFragmentManager(), mContactDetailsView,
- findViewById(R.id.contact_detail_container),
- new ContactDetailFragmentListener());
- }
transaction.commitAllowingStateLoss();
fragmentManager.executePendingTransactions();
// Setting Properties after fragment is created
- if (PhoneCapabilityTester.isUsingTwoPanesInFavorites(this)) {
- mFavoritesFragment.enableQuickContact(true);
- mFavoritesFragment.setDisplayType(DisplayType.STARRED_ONLY);
- } else {
- // For 2-pane in All but not in Favorites fragment, show the chevron
- // for quick contact popup
- mFavoritesFragment.enableQuickContact(isUsingTwoPanes);
- mFavoritesFragment.setDisplayType(DisplayType.STREQUENT);
- }
+ mFavoritesFragment.setDisplayType(DisplayType.STREQUENT);
// Configure action bar
mActionBarAdapter = new ActionBarAdapter(this, this, getActionBar());
mActionBarAdapter.initialize(savedState, mRequest);
// Configure action button
- mFloatingActionButtonContainer = findViewById(R.id.floating_action_button_container);
- ViewUtil.setupFloatingActionButton(mFloatingActionButtonContainer, getResources());
- mFloatingActionButton = (ImageButton) findViewById(R.id.floating_action_button);
- mFloatingActionButton.setOnClickListener(this);
+ final View floatingActionButtonContainer = findViewById(
+ R.id.floating_action_button_container);
+ ViewUtil.setupFloatingActionButton(floatingActionButtonContainer, getResources());
+ final ImageButton floatingActionButton = (ImageButton) findViewById(R.id.floating_action_button);
+ floatingActionButton.setOnClickListener(this);
invalidateOptionsMenuIfNeeded();
}
@@ -459,19 +358,6 @@
* (so the argument.)
*/
configureFragments(!mIsRecreatedInstance);
- } else if (PhoneCapabilityTester.isUsingTwoPanes(this) && !mCurrentFilterIsValid) {
- // We only want to do the filter check in onStart for wide screen devices where it
- // is often possible to get into single contact mode. Only do this check if
- // the filter hasn't already been set properly (i.e. onCreate or onActivityResult).
-
- // Since there is only one {@link ContactListFilterController} across multiple
- // activity instances, make sure the filter controller is in sync withthe current
- // contact list fragment filter.
- // TODO: Clean this up. Perhaps change {@link ContactListFilterController} to not be a
- // singleton?
- mContactListFilterController.setContactListFilter(mAllFragment.getFilter(), true);
- mContactListFilterController.checkFilterValidity(true);
- mCurrentFilterIsValid = true;
}
super.onStart();
}
@@ -505,7 +391,6 @@
@Override
protected void onStop() {
super.onStop();
- mCurrentFilterIsValid = false;
}
@Override
@@ -548,13 +433,6 @@
tabToOpen = TabState.FAVORITES;
break;
case ContactsRequest.ACTION_VIEW_CONTACT:
- // We redirect this intent to the detail activity on 1-pane, so we don't get
- // here. It's only for 2-pane.
- Uri currentlyLoadedContactUri = mContactDetailFragment.getUri();
- if (currentlyLoadedContactUri != null
- && !mRequest.getContactUri().equals(currentlyLoadedContactUri)) {
- mContactDetailsView.setMaskVisibility(true);
- }
tabToOpen = TabState.ALL;
break;
default:
@@ -594,11 +472,6 @@
invalidateOptionsMenuIfNeeded();
}
- private void setupContactDetailFragment(final Uri contactLookupUri) {
- mContactDetailLoaderFragment.loadUri(contactLookupUri);
- invalidateOptionsMenuIfNeeded();
- }
-
/**
* Handler for action bar actions.
*/
@@ -651,77 +524,17 @@
private void updateFragmentsVisibility() {
int tab = mActionBarAdapter.getCurrentTab();
- // We use ViewPager on 1-pane.
- if (!PhoneCapabilityTester.isUsingTwoPanes(this)) {
- if (mActionBarAdapter.isSearchMode()) {
- mTabPagerAdapter.setSearchMode(true);
- } else {
- // No smooth scrolling if quitting from the search mode.
- final boolean wasSearchMode = mTabPagerAdapter.isSearchMode();
- mTabPagerAdapter.setSearchMode(false);
- if (mTabPager.getCurrentItem() != tab) {
- mTabPager.setCurrentItem(tab, !wasSearchMode);
- }
- }
- invalidateOptionsMenu();
- showEmptyStateForTab(tab);
- return;
- }
-
- // for the tablet...
-
- // If in search mode, we use the all list + contact details to show the result.
if (mActionBarAdapter.isSearchMode()) {
- tab = TabState.ALL;
+ mTabPagerAdapter.setSearchMode(true);
+ } else {
+ // No smooth scrolling if quitting from the search mode.
+ final boolean wasSearchMode = mTabPagerAdapter.isSearchMode();
+ mTabPagerAdapter.setSearchMode(false);
+ if (mTabPager.getCurrentItem() != tab) {
+ mTabPager.setCurrentItem(tab, !wasSearchMode);
+ }
}
-
- switch (tab) {
- case TabState.FAVORITES:
- mFavoritesView.setVisibility(View.VISIBLE);
- mBrowserView.setVisibility(View.GONE);
- mContactDetailsView.setVisibility(View.GONE);
- break;
- case TabState.ALL:
- mFavoritesView.setVisibility(View.GONE);
- mBrowserView.setVisibility(View.VISIBLE);
- mContactDetailsView.setVisibility(View.VISIBLE);
- break;
- }
-
- // Perform the fade in transition only if the current tab has changed
- if (mPreviousTab != tab) {
- mPeopleActivityView.startMaskTransition(false, TAB_FADE_IN_DURATION);
- mPreviousTab = tab;
- }
-
- FragmentManager fragmentManager = getFragmentManager();
- FragmentTransaction ft = fragmentManager.beginTransaction();
-
- // Note mContactDetailLoaderFragment is an invisible fragment, but we still have to show/
- // hide it so its options menu will be shown/hidden.
- switch (tab) {
- case TabState.FAVORITES:
- showFragment(ft, mFavoritesFragment);
- showFragment(ft, mFrequentFragment);
- hideFragment(ft, mAllFragment);
- hideFragment(ft, mContactDetailLoaderFragment);
- hideFragment(ft, mContactDetailFragment);
- break;
- case TabState.ALL:
- hideFragment(ft, mFavoritesFragment);
- hideFragment(ft, mFrequentFragment);
- showFragment(ft, mAllFragment);
- showFragment(ft, mContactDetailLoaderFragment);
- showFragment(ft, mContactDetailFragment);
- break;
- }
- if (!ft.isEmpty()) {
- ft.commitAllowingStateLoss();
- fragmentManager.executePendingTransactions();
- // When switching tabs, we need to invalidate options menu, but executing a
- // fragment transaction does it implicitly. We don't have to call invalidateOptionsMenu
- // manually.
- }
+ invalidateOptionsMenu();
showEmptyStateForTab(tab);
}
@@ -921,12 +734,6 @@
private void configureContactListFragmentForRequest() {
Uri contactUri = mRequest.getContactUri();
if (contactUri != null) {
- // For an incoming request, explicitly require a selection if we are on 2-pane UI,
- // (i.e. even if we view the same selected contact, the contact may no longer be
- // in the list, so we must refresh the list).
- if (PhoneCapabilityTester.isUsingTwoPanes(this)) {
- mAllFragment.setSelectionRequired(true);
- }
mAllFragment.setSelectedContactUri(contactUri);
}
@@ -944,22 +751,12 @@
// Filter may be changed when this Activity is in background.
mAllFragment.setFilter(mContactListFilterController.getFilter());
- final boolean useTwoPane = PhoneCapabilityTester.isUsingTwoPanes(this);
-
- mAllFragment.setVerticalScrollbarPosition(getScrollBarPosition(useTwoPane));
- mAllFragment.setSelectionVisible(useTwoPane);
- mAllFragment.setQuickContactEnabled(!useTwoPane);
+ mAllFragment.setVerticalScrollbarPosition(getScrollBarPosition());
+ mAllFragment.setSelectionVisible(false);
}
- private int getScrollBarPosition(boolean useTwoPane) {
- final boolean isLayoutRtl = isRTL();
- final int position;
- if (useTwoPane) {
- position = isLayoutRtl ? View.SCROLLBAR_POSITION_RIGHT : View.SCROLLBAR_POSITION_LEFT;
- } else {
- position = isLayoutRtl ? View.SCROLLBAR_POSITION_LEFT : View.SCROLLBAR_POSITION_RIGHT;
- }
- return position;
+ private int getScrollBarPosition() {
+ return isRTL() ? View.SCROLLBAR_POSITION_LEFT : View.SCROLLBAR_POSITION_RIGHT;
}
private boolean isRTL() {
@@ -979,7 +776,6 @@
mProviderStatus = providerStatus;
View contactsUnavailableView = findViewById(R.id.contacts_unavailable_view);
- View mainView = findViewById(R.id.main_view);
if (mProviderStatus.status == ProviderStatus.STATUS_NORMAL) {
// Ensure that the mTabPager is visible; we may have made it invisible below.
@@ -988,9 +784,6 @@
mTabPager.setVisibility(View.VISIBLE);
}
- if (mainView != null) {
- mainView.setVisibility(View.VISIBLE);
- }
if (mAllFragment != null) {
mAllFragment.setEnabled(true);
}
@@ -1032,10 +825,6 @@
mTabPager.setVisibility(View.GONE);
}
- if (mainView != null) {
- mainView.setVisibility(View.INVISIBLE);
- }
-
showEmptyStateForTab(mActionBarAdapter.getCurrentTab());
}
@@ -1047,60 +836,18 @@
@Override
public void onSelectionChange() {
- if (PhoneCapabilityTester.isUsingTwoPanes(PeopleActivity.this)) {
- setupContactDetailFragment(mAllFragment.getSelectedContactUri());
- }
+
}
@Override
public void onViewContactAction(Uri contactLookupUri) {
- if (PhoneCapabilityTester.isUsingTwoPanes(PeopleActivity.this)) {
- setupContactDetailFragment(contactLookupUri);
- } else {
- Intent intent = QuickContact.composeQuickContactsIntent(PeopleActivity.this,
- getCurrentFocus().getRootView(), contactLookupUri, QuickContact.MODE_LARGE,
- null);
- startActivity(intent);
- }
- }
-
- @Override
- public void onCreateNewContactAction() {
- Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
- Bundle extras = getIntent().getExtras();
- if (extras != null) {
- intent.putExtras(extras);
- }
+ Intent intent = QuickContact.composeQuickContactsIntent(PeopleActivity.this,
+ getCurrentFocus().getRootView(), contactLookupUri, QuickContact.MODE_LARGE,
+ null);
startActivity(intent);
}
@Override
- public void onEditContactAction(Uri contactLookupUri) {
- Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
- Bundle extras = getIntent().getExtras();
- if (extras != null) {
- intent.putExtras(extras);
- }
- intent.putExtra(
- ContactEditorActivity.INTENT_KEY_FINISH_ACTIVITY_ON_SAVE_COMPLETED, true);
- startActivityForResult(intent, SUBACTIVITY_EDIT_CONTACT);
- }
-
- @Override
- public void onAddToFavoritesAction(Uri contactUri) {
- ContentValues values = new ContentValues(1);
- values.put(Contacts.STARRED, 1);
- getContentResolver().update(contactUri, values, null, null);
- }
-
- @Override
- public void onRemoveFromFavoritesAction(Uri contactUri) {
- ContentValues values = new ContentValues(1);
- values.put(Contacts.STARRED, 0);
- getContentResolver().update(contactUri, values, null, null);
- }
-
- @Override
public void onDeleteContactAction(Uri contactUri) {
ContactDeletionInteraction.start(PeopleActivity.this, contactUri, false);
}
@@ -1128,75 +875,6 @@
}
}
- private class ContactDetailLoaderFragmentListener implements ContactLoaderFragmentListener {
- ContactDetailLoaderFragmentListener() {}
-
- @Override
- public void onContactNotFound() {
- // Nothing needs to be done here
- }
-
- @Override
- public void onDetailsLoaded(final Contact result) {
- if (result == null) {
- // Nothing is loaded. Show empty state.
- mContactDetailLayoutController.showEmptyState();
- return;
- }
- // Since {@link FragmentTransaction}s cannot be done in the onLoadFinished() of the
- // {@link LoaderCallbacks}, then post this {@link Runnable} to the {@link Handler}
- // on the main thread to execute later.
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- // If the activity is destroyed (or will be destroyed soon), don't update the UI
- if (isFinishing()) {
- return;
- }
- mContactDetailLayoutController.setContactData(result);
- }
- });
- }
-
- @Override
- public void onEditRequested(Uri contactLookupUri) {
- Intent intent = new Intent(Intent.ACTION_EDIT, contactLookupUri);
- intent.putExtra(
- ContactEditorActivity.INTENT_KEY_FINISH_ACTIVITY_ON_SAVE_COMPLETED, true);
- startActivityForResult(intent, SUBACTIVITY_EDIT_CONTACT);
- }
-
- @Override
- public void onDeleteRequested(Uri contactUri) {
- ContactDeletionInteraction.start(PeopleActivity.this, contactUri, false);
- }
- }
-
- public class ContactDetailFragmentListener implements ContactDetailFragment.Listener {
- @Override
- public void onItemClicked(Intent intent) {
- if (intent == null) {
- return;
- }
- try {
- startActivity(intent);
- } catch (ActivityNotFoundException e) {
- Log.e(TAG, "No activity found for intent: " + intent);
- }
- }
-
- @Override
- public void onCreateRawContactRequested(ArrayList<ContentValues> values,
- AccountWithDataSet account) {
- Toast.makeText(PeopleActivity.this, R.string.toast_making_personal_copy,
- Toast.LENGTH_LONG).show();
- Intent serviceIntent = ContactSaveService.createNewRawContactIntent(
- PeopleActivity.this, values, account,
- PeopleActivity.class, Intent.ACTION_VIEW);
- startService(serviceIntent);
- }
- }
-
private class ContactsUnavailableFragmentListener
implements OnContactsUnavailableActionListener {
ContactsUnavailableFragmentListener() {}
@@ -1233,13 +911,9 @@
@Override
public void onContactSelected(Uri contactUri, Rect targetRect) {
- if (PhoneCapabilityTester.isUsingTwoPanes(PeopleActivity.this)) {
- QuickContact.showQuickContact(PeopleActivity.this, targetRect, contactUri, 0, null);
- } else {
- Intent intent = QuickContact.composeQuickContactsIntent(PeopleActivity.this,
- targetRect, contactUri, QuickContact.MODE_LARGE, null);
- startActivity(intent);
- }
+ Intent intent = QuickContact.composeQuickContactsIntent(PeopleActivity.this,
+ targetRect, contactUri, QuickContact.MODE_LARGE, null);
+ startActivity(intent);
}
@Override
@@ -1249,18 +923,6 @@
}
}
- public void startActivityAndForwardResult(final Intent intent) {
- intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
-
- // Forward extras to the new activity
- Bundle extras = getIntent().getExtras();
- if (extras != null) {
- intent.putExtras(extras);
- }
- startActivity(intent);
- finish();
- }
-
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (!areContactsAvailable()) {
@@ -1290,11 +952,6 @@
return true;
}
- if (mContactDetailLoaderFragment != null &&
- mContactDetailLoaderFragment.isOptionsMenuChanged()) {
- return true;
- }
-
return false;
}
@@ -1351,11 +1008,7 @@
* @return
*/
private boolean hasFrequents() {
- if (PhoneCapabilityTester.isUsingTwoPanesInFavorites(this)) {
- return mFrequentFragment.hasFrequents();
- } else {
- return mFavoritesFragment.hasFrequents();
- }
+ return mFavoritesFragment.hasFrequents();
}
private void makeMenuItemVisible(Menu menu, int itemId, boolean visible) {
@@ -1408,18 +1061,7 @@
}
case R.id.menu_add_contact: {
final Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
- // On 2-pane UI, we can let the editor activity finish itself and return
- // to this activity to display the new contact.
- if (PhoneCapabilityTester.isUsingTwoPanes(this)) {
- intent.putExtra(
- ContactEditorActivity.INTENT_KEY_FINISH_ACTIVITY_ON_SAVE_COMPLETED,
- true);
- startActivityForResult(intent, SUBACTIVITY_NEW_CONTACT);
- } else {
- // Otherwise, on 1-pane UI, we need the editor to launch the view contact
- // intent itself.
- startActivity(intent);
- }
+ startActivity(intent);
return true;
}
case R.id.menu_import_export: {
@@ -1465,21 +1107,6 @@
break;
}
- case SUBACTIVITY_NEW_CONTACT:
- case SUBACTIVITY_EDIT_CONTACT: {
- if (resultCode == RESULT_OK && PhoneCapabilityTester.isUsingTwoPanes(this)) {
- mRequest.setActionCode(ContactsRequest.ACTION_VIEW_CONTACT);
- mAllFragment.setSelectionRequired(true);
- mAllFragment.setSelectedContactUri(data.getData());
- // Suppress IME if in search mode
- if (mActionBarAdapter != null) {
- mActionBarAdapter.clearFocusOnSearchView();
- }
- // No need to change the contact filter
- mCurrentFilterIsValid = true;
- }
- break;
- }
// TODO: Using the new startActivityWithResultFromFragment API this should not be needed
// anymore
case ContactEntryListFragment.ACTIVITY_REQUEST_CODE_PICKER:
@@ -1562,9 +1189,6 @@
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mActionBarAdapter.onSaveInstanceState(outState);
- if (mContactDetailLayoutController != null) {
- mContactDetailLayoutController.onSaveInstanceState(outState);
- }
// Clear the listener to make sure we don't get callbacks after onSaveInstanceState,
// in order to avoid doing fragment transactions after it.
@@ -1592,16 +1216,6 @@
return mDialogManager;
}
- // Visible for testing
- public ContactBrowseListFragment getListFragment() {
- return mAllFragment;
- }
-
- // Visible for testing
- public ContactDetailFragment getDetailFragment() {
- return mContactDetailFragment;
- }
-
@Override
public void onClick(View view) {
switch (view.getId()) {
diff --git a/src/com/android/contacts/detail/ContactDetailLayoutController.java b/src/com/android/contacts/detail/ContactDetailLayoutController.java
index 7e412e0..098d950 100644
--- a/src/com/android/contacts/detail/ContactDetailLayoutController.java
+++ b/src/com/android/contacts/detail/ContactDetailLayoutController.java
@@ -27,9 +27,7 @@
import com.android.contacts.R.id;
import com.android.contacts.activities.ContactDetailActivity.FragmentKeyListener;
import com.android.contacts.common.model.Contact;
-import com.android.contacts.util.PhoneCapabilityTester;
import com.android.contacts.common.util.UriUtils;
-import com.android.contacts.widget.TransitionAnimationView;
/**
* Sets ContactDetailFragment data and performs animations when data changes.
@@ -47,7 +45,6 @@
private final Activity mActivity;
private final FragmentManager mFragmentManager;
private final ContactDetailFragment.Listener mContactDetailFragmentListener;
- private final TransitionAnimationView mTransitionAnimationView;
private final View mViewContainer;
private ContactDetailFragment mDetailFragment;
@@ -55,8 +52,8 @@
private Uri mContactUri;
public ContactDetailLayoutController(Activity activity, Bundle savedState,
- FragmentManager fragmentManager, TransitionAnimationView animationView,
- View viewContainer, ContactDetailFragment.Listener contactDetailFragmentListener) {
+ FragmentManager fragmentManager, View viewContainer,
+ ContactDetailFragment.Listener contactDetailFragmentListener) {
if (fragmentManager == null) {
throw new IllegalStateException("Cannot initialize a ContactDetailLayoutController "
@@ -66,7 +63,6 @@
mActivity = activity;
mFragmentManager = fragmentManager;
mContactDetailFragmentListener = contactDetailFragmentListener;
- mTransitionAnimationView = animationView;
mViewContainer = viewContainer;
initialize(savedState);
@@ -100,19 +96,12 @@
}
mContactData = data;
- if (PhoneCapabilityTester.isUsingTwoPanes(mActivity)) {
- // Tablet: If we already showed data before, we want to cross-fade from screen to screen
- if (contactWasLoaded && mTransitionAnimationView != null && isDifferentContact) {
- mTransitionAnimationView.startMaskTransition(mContactData == null, -1);
- }
- } else {
- // Small screen: We are on our own screen. Fade the data in, but only the first time
- if (!contactWasLoaded) {
- mViewContainer.setAlpha(0.0f);
- final ViewPropertyAnimator animator = mViewContainer.animate();
- animator.alpha(1.0f);
- animator.setDuration(SINGLE_PANE_FADE_IN_DURATION);
- }
+ // Small screen: We are on our own screen. Fade the data in, but only the first time
+ if (!contactWasLoaded) {
+ mViewContainer.setAlpha(0.0f);
+ final ViewPropertyAnimator animator = mViewContainer.animate();
+ animator.alpha(1.0f);
+ animator.setDuration(SINGLE_PANE_FADE_IN_DURATION);
}
showContact();
diff --git a/src/com/android/contacts/list/ContactBrowseListFragment.java b/src/com/android/contacts/list/ContactBrowseListFragment.java
index 14e8949..855f923 100644
--- a/src/com/android/contacts/list/ContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/ContactBrowseListFragment.java
@@ -597,31 +597,15 @@
mListener = listener;
}
- public void createNewContact() {
- if (mListener != null) mListener.onCreateNewContactAction();
- }
-
public void viewContact(Uri contactUri) {
setSelectedContactUri(contactUri, false, false, true, false);
if (mListener != null) mListener.onViewContactAction(contactUri);
}
- public void editContact(Uri contactUri) {
- if (mListener != null) mListener.onEditContactAction(contactUri);
- }
-
public void deleteContact(Uri contactUri) {
if (mListener != null) mListener.onDeleteContactAction(contactUri);
}
- public void addToFavorites(Uri contactUri) {
- if (mListener != null) mListener.onAddToFavoritesAction(contactUri);
- }
-
- public void removeFromFavorites(Uri contactUri) {
- if (mListener != null) mListener.onRemoveFromFavoritesAction(contactUri);
- }
-
private void notifyInvalidSelection() {
if (mListener != null) mListener.onInvalidSelection();
}
diff --git a/src/com/android/contacts/list/ContactTileFrequentFragment.java b/src/com/android/contacts/list/ContactTileFrequentFragment.java
deleted file mode 100644
index 605bdd3..0000000
--- a/src/com/android/contacts/list/ContactTileFrequentFragment.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2011 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.contacts.list;
-
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.contacts.R;
-import com.android.contacts.common.MoreContactUtils;
-
-/**
- * Fragment containing a list of frequently contacted people.
- */
-public class ContactTileFrequentFragment extends ContactTileListFragment {
- private static final String TAG = ContactTileFrequentFragment.class.getSimpleName();
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View listLayout = inflateAndSetupView(inflater, container, savedInstanceState,
- R.layout.contact_tile_list_frequent);
- View headerView = MoreContactUtils.createHeaderView(getActivity(),
- R.string.favoritesFrequentContacted);
- ViewGroup headerContainer = (ViewGroup) listLayout.findViewById(R.id.header_container);
- headerContainer.addView(headerView);
- return listLayout;
- }
-}
diff --git a/src/com/android/contacts/list/OnContactBrowserActionListener.java b/src/com/android/contacts/list/OnContactBrowserActionListener.java
index 6d28bac..d91fee4 100644
--- a/src/com/android/contacts/list/OnContactBrowserActionListener.java
+++ b/src/com/android/contacts/list/OnContactBrowserActionListener.java
@@ -36,31 +36,11 @@
void onViewContactAction(Uri contactLookupUri);
/**
- * Creates a new contact.
- */
- void onCreateNewContactAction();
-
- /**
- * Opens the specified contact for editing.
- */
- void onEditContactAction(Uri contactLookupUri);
-
- /**
* Initiates the contact deletion process.
*/
void onDeleteContactAction(Uri contactUri);
/**
- * Adds the specified contact to favorites
- */
- void onAddToFavoritesAction(Uri contactUri);
-
- /**
- * Removes the specified contact from favorites.
- */
- void onRemoveFromFavoritesAction(Uri contactUri);
-
- /**
* Closes the contact browser.
*/
void onFinishAction();
diff --git a/src/com/android/contacts/util/PhoneCapabilityTester.java b/src/com/android/contacts/util/PhoneCapabilityTester.java
index e20a076..eec9916 100644
--- a/src/com/android/contacts/util/PhoneCapabilityTester.java
+++ b/src/com/android/contacts/util/PhoneCapabilityTester.java
@@ -102,19 +102,4 @@
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
return isIntentRegistered(context, intent);
}
-
- /**
- * True if we are using two-pane layouts ("tablet mode"), false if we are using single views
- * ("phone mode")
- */
- public static boolean isUsingTwoPanes(Context context) {
- return context.getResources().getBoolean(R.bool.config_use_two_panes);
- }
-
- /**
- * True if the favorites tab should be shown in two-pane mode. False, otherwise.
- */
- public static boolean isUsingTwoPanesInFavorites(Context context) {
- return context.getResources().getBoolean(R.bool.config_use_two_panes_in_favorites);
- }
}
diff --git a/tests/src/com/android/contacts/activities/PeopleActivityTest.java b/tests/src/com/android/contacts/activities/PeopleActivityTest.java
index 592b606..4b9c281 100644
--- a/tests/src/com/android/contacts/activities/PeopleActivityTest.java
+++ b/tests/src/com/android/contacts/activities/PeopleActivityTest.java
@@ -121,49 +121,6 @@
super.tearDown();
}
- public void testSingleAccountNoGroups() {
-
- if (true) { // Need this to avoid "unreachable statement"
- return; // Disabled for now.
- }
-
- // This two-pane UI test only makes sense if we run with two panes.
- // Let's ignore this in the single pane case
- if (!PhoneCapabilityTester.isUsingTwoPanes(mContext)) return;
-
- expectSettingsQueriesAndReturnDefault();
- expectProviderStatusQueryAndReturnNormal();
- expectGroupsQueryAndReturnEmpty();
- expectContactListQuery(100);
- expectContactLookupQuery("lu1", 1, "lu1", 1);
- expectContactEntityQuery("lu1", 1);
-
- setActivityIntent(new Intent(Intent.ACTION_DEFAULT));
-
- PeopleActivity activity = getActivity();
-
- getInstrumentation().waitForIdleSync();
-
- ContactBrowseListFragment listFragment = activity.getListFragment();
- ContactDetailFragment detailFragment = activity.getDetailFragment();
-
- Loader<?> filterLoader =
- activity.getLoaderManager().getLoader(R.id.contact_list_filter_loader);
- Loader<?> listLoader =
- listFragment.getLoaderManager().getLoader(0);
-
- // TODO: wait for detail loader
- // TODO: wait for lookup key loading
- TestLoaderManager.waitForLoaders(filterLoader, listLoader);
-
- getInstrumentation().waitForIdleSync();
-
- mContext.verify();
-
- TextView nameText = (TextView) detailFragment.getView().findViewById(R.id.name);
- assertEquals("Contact 1", nameText.getText());
- }
-
private void expectSettingsQueriesAndReturnDefault() {
mSettingsProvider
.expectQuery(Settings.System.CONTENT_URI)