ConversationListHelper.java revision 17fcc1e767958c0da28004a0d98a4448c5e6945a
1/*
2 * Copyright (C) 2013 Google Inc.
3 * Licensed to The Android Open Source Project.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package com.android.mail.ui;
18
19import com.google.common.collect.Lists;
20
21import android.content.Context;
22import android.view.LayoutInflater;
23
24import com.android.mail.providers.Account;
25
26import com.android.mail.R;
27
28import java.util.ArrayList;
29
30public class ConversationListHelper {
31    /**
32     * Creates a list of newly created special views.
33     */
34    public ArrayList<ConversationSpecialItemView> makeConversationListSpecialViews(
35            final Context context, final ControllableActivity activity, final Account account) {
36        // Conversation photo teaser view
37        final ConversationPhotoTeaserView conversationPhotoTeaser =
38                (ConversationPhotoTeaserView) LayoutInflater.from(context)
39                        .inflate(R.layout.conversation_photo_teaser_view, null);
40
41
42        // Long press to select tip
43        final ConversationLongPressTipView conversationLongPressTipView =
44                (ConversationLongPressTipView) LayoutInflater.from(context)
45                        .inflate(R.layout.conversation_long_press_to_select_tip_view, null);
46
47        final ArrayList<ConversationSpecialItemView> itemViews = Lists.newArrayList();
48        itemViews.add(conversationPhotoTeaser);
49        itemViews.add(conversationLongPressTipView);
50        return itemViews;
51    }
52}
53