AppsCustomizeCellLayout.java revision 26acafbe67565a9cc6aeb7d6c43a1c6d1cb9b73c
1/*
2 * Copyright (C) 2010 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 */
16
17package com.android.launcher3;
18
19import android.content.Context;
20import android.view.View;
21
22public class AppsCustomizeCellLayout extends CellLayout implements Page {
23    public AppsCustomizeCellLayout(Context context) {
24        super(context);
25    }
26
27    @Override
28    public void removeAllViewsOnPage() {
29        removeAllViews();
30        setLayerType(LAYER_TYPE_NONE, null);
31    }
32
33    @Override
34    public void removeViewOnPageAt(int index) {
35        removeViewAt(index);
36    }
37
38    @Override
39    public int getPageChildCount() {
40        return getChildCount();
41    }
42
43    @Override
44    public View getChildOnPageAt(int i) {
45        return getChildAt(i);
46    }
47
48    @Override
49    public int indexOfChildOnPage(View v) {
50        return indexOfChild(v);
51    }
52
53    /**
54     * Clears all the key listeners for the individual icons.
55     */
56    public void resetChildrenOnKeyListeners() {
57        ShortcutAndWidgetContainer children = getShortcutsAndWidgets();
58        int childCount = children.getChildCount();
59        for (int j = 0; j < childCount; ++j) {
60            children.getChildAt(j).setOnKeyListener(null);
61        }
62    }
63}