1/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.messaging.ui;
17
18import android.view.View;
19import android.view.ViewGroup;
20
21/**
22 * Holds reusable View(s) for a {@link FixedViewPagerAdapter} to display a page. By using
23 * reusable Views inside ViewPagers this allows us to get rid of nested fragments and the messy
24 * activity lifecycle problems they entail.
25 */
26public interface PagerViewHolder extends PersistentInstanceState {
27    /** Instructs the pager to clean up any view related resources
28     * @return the destroyed View so that the adapter may remove it from the container, or
29     * null if no View has been created. */
30    View destroyView();
31
32    /** @return The view that presents the page view to the user */
33    View getView(ViewGroup container);
34}
35