OnChildViewHolderSelectedListener.java revision 0246318f27a905a31df5a8af445cfe67d31dfb68
1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
12 * the License.
13 */
14package android.support.v17.leanback.widget;
15
16import android.support.v17.leanback.widget.ItemAlignmentFacet.ItemAlignmentDef;
17import android.support.v7.widget.RecyclerView;
18import android.view.View;
19import android.view.ViewGroup;
20
21/**
22 * Interface for receiving notification when a child of this
23 * ViewGroup has been selected.
24 */
25public abstract class OnChildViewHolderSelectedListener {
26    /**
27     * Callback method to be invoked when a child of this ViewGroup has been
28     * selected.
29     *
30     * @param parent The RecyclerView where the selection happened.
31     * @param child The ViewHolder within the RecyclerView that is selected, or null if no
32     *        view is selected.
33     * @param position The position of the view in the adapter, or NO_POSITION
34     *        if no view is selected.
35     * @param subposition The index of which {@link ItemAlignmentDef} being used,
36     *                    0 if there is no ItemAlignmentDef defined for the item.
37     */
38    public void onChildViewHolderSelected(RecyclerView parent, RecyclerView.ViewHolder child,
39            int position, int subposition) {
40    }
41}
42