Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 434d05a9 authored by Katherine Kuan's avatar Katherine Kuan Committed by Android (Google) Code Review
Browse files

Merge "Show "no contacts" in frequent list on tablet" into ics-mr1

parents d12fdde6 f7689c37
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@
                <!-- Most Frequent -->
                <fragment
                    android:id="@+id/frequent_fragment"
                    class="com.android.contacts.list.ContactTileListFragment"
                    class="com.android.contacts.list.ContactTileFrequentFragment"
                    android:layout_width="0dip"
                    android:layout_height="match_parent"
                    android:layout_weight="3"
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@
                <!-- Most Frequent -->
                <fragment
                    android:id="@+id/frequent_fragment"
                    class="com.android.contacts.list.ContactTileListFragment"
                    class="com.android.contacts.list.ContactTileFrequentFragment"
                    android:layout_width="0dip"
                    android:layout_height="match_parent"
                    android:layout_weight="8"
+51 −0
Original line number Diff line number Diff line
<?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.
-->

<!--
  This is very similar to contact_tile_list.xml (there needs to be a ListView called
  contact_tile_list and an empty view called contact_tile_list_empty). However, this layout also
  contains a container view for the title of the frequently contacted list.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="?attr/favorites_padding_bottom"
    android:orientation="vertical">

    <FrameLayout
        android:id="@+id/header_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <ListView
        android:id="@+id/contact_tile_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fadingEdge="none"
        android:divider="@null" />

    <TextView
        android:id="@+id/contact_tile_list_empty"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_horizontal"
        android:layout_marginTop="@dimen/empty_message_top_margin"
        android:textColor="?android:attr/textColorSecondary"
        android:textAppearance="?android:attr/textAppearanceLarge"/>

</LinearLayout>
+13 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import android.provider.ContactsContract.CommonDataKinds.Im;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import java.util.List;

@@ -208,4 +210,15 @@ public class ContactsUtils {
        intent.setData(lookupUri);
        return intent;
    }

    /**
     * Returns a header view based on the R.layout.list_separator, where the
     * containing {@link TextView} is set using the given textResourceId.
     */
    public static View createHeaderView(Context context, int textResourceId) {
        View view = View.inflate(context, R.layout.list_separator, null);
        TextView textView = (TextView) view.findViewById(R.id.title);
        textView.setText(context.getString(textResourceId));
        return view;
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.contacts.list.ContactEntryListFragment;
import com.android.contacts.list.ContactListFilter;
import com.android.contacts.list.ContactListFilterController;
import com.android.contacts.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;
@@ -145,7 +146,7 @@ public class PeopleActivity extends ContactsActivity
     */
    private DefaultContactBrowseListFragment mAllFragment;
    private ContactTileListFragment mFavoritesFragment;
    private ContactTileListFragment mFrequentFragment;
    private ContactTileFrequentFragment mFrequentFragment;
    private GroupBrowseListFragment mGroupsFragment;

    private View mFavoritesView;
Loading