From dfb2eee7d98f8540fd1614db66bb03e8e1f3a26a Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 26 Jun 2013 18:24:32 -0700 Subject: Initial commit of all new dialer activities, layouts and styles As far as possible, this change does not modify any behavior/look of the existing dialer. All modifications to classes/layouts/style attributes that would affect functionality of the old dialer are instead done in separate new files. Added new versions of all activities, fragments, layouts, menus and resources that have been rewritten or modified. The activities do not have intent filters yet in order to not interfere with the existing dialer. Added some new values in colors/styles/dimens for the newly added layouts. Added NewCallLogActivity to separate the CallLogFragment from DialtactsActivity. All call log and voicemail entries are now presented in a separate (New)CallLogActivity. IntentProvider.getCallDetailIntent now takes a cursor instead of an adapter for more flexibility. Add OnListFragmentScrolledListener interface for DialtactsActivity to receive callback when one of its children fragment is scrolled. Added slide in and slide out animations for DialpadFragment. Add slide up and hide animations for search view All menu options now show up in a PopupMenu in NewPhoneFavoriteFragment. Added call log adapter into NewPhoneFavoriteMergedAdapter. Rewrote layout of DialpadFragment to show up as a fragment partially overlaying the screen. Removed some unused code in DialpadFragment (smart dialing, menu handling) Add fragments and adapters for SmartDial. - Update Dialer database to support highlight masking and record contact data Uri, as well as photo uri - Add a fragment and adapter for smart dialing - Add SmartDialCursorLoader to load SmartDial results. - Typing in the dialpad now returns smart dialing results instead of regular search results QuickContactTiles for all sub-adapters of PhoneFavoriteMergedAdapter now use light theme instead of the the default dark theme. Removed all redundant call log filter and contacts to display filter code Moved Dialer specific UI list-related classes to the Dialer package Change-Id: I34885813e4fa79b69e29ac870a87a56d6f08a5e7 --- src/com/android/dialer/NewSearchFragment.java | 75 +++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/com/android/dialer/NewSearchFragment.java (limited to 'src/com/android/dialer/NewSearchFragment.java') diff --git a/src/com/android/dialer/NewSearchFragment.java b/src/com/android/dialer/NewSearchFragment.java new file mode 100644 index 000000000..c428db239 --- /dev/null +++ b/src/com/android/dialer/NewSearchFragment.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2013 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.dialer; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AbsListView; +import android.widget.AbsListView.OnScrollListener; +import android.widget.ListView; + +import com.android.contacts.common.list.ContactListItemView; +import com.android.contacts.common.list.PhoneNumberListAdapter; +import com.android.contacts.common.list.PhoneNumberPickerFragment; +import com.android.dialer.list.OnListFragmentScrolledListener; + +public class NewSearchFragment extends PhoneNumberPickerFragment { + + private OnListFragmentScrolledListener mActivityScrollListener; + + @Override + public void onAttach(Activity activity) { + super.onAttach(activity); + + setQuickContactEnabled(true); + setDarkTheme(false); + setPhotoPosition(ContactListItemView.getDefaultPhotoPosition(true /* opposite */)); + setUseCallableUri(true); + + try { + mActivityScrollListener = (OnListFragmentScrolledListener) activity; + } catch (ClassCastException e) { + throw new ClassCastException(activity.toString() + + " must implement OnListFragmentScrolledListener"); + } + } + + @Override + public void onStart() { + super.onStart(); + getListView().setOnScrollListener(new OnScrollListener() { + @Override + public void onScrollStateChanged(AbsListView view, int scrollState) { + mActivityScrollListener.onListFragmentScrollStateChange(scrollState); + } + + @Override + public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, + int totalItemCount) { + } + }); + } + + @Override + protected void setSearchMode(boolean flag) { + super.setSearchMode(flag); + // This hides the "All contacts with phone numbers" header in the search fragment + getAdapter().setHasHeader(0, false); + } +} -- cgit v1.2.3