Winson Chung | c58497e | 2013-09-03 17:48:37 -0700 | [diff] [blame^] | 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 | |
| 17 | package com.android.launcher3; |
| 18 | |
| 19 | import android.content.Context; |
| 20 | import android.content.res.Resources; |
| 21 | import android.util.AttributeSet; |
| 22 | import android.view.MotionEvent; |
| 23 | import android.view.View; |
| 24 | import android.view.ViewDebug; |
| 25 | import android.view.ViewGroup; |
| 26 | |
| 27 | public class AppsCustomizeCellLayout extends CellLayout implements Page { |
| 28 | public AppsCustomizeCellLayout(Context context) { |
| 29 | super(context); |
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | public void removeAllViewsOnPage() { |
| 34 | removeAllViews(); |
| 35 | setLayerType(LAYER_TYPE_NONE, null); |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public void removeViewOnPageAt(int index) { |
| 40 | removeViewAt(index); |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public int getPageChildCount() { |
| 45 | return getChildCount(); |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public View getChildOnPageAt(int i) { |
| 50 | return getChildAt(i); |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public int indexOfChildOnPage(View v) { |
| 55 | return indexOfChild(v); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Clears all the key listeners for the individual icons. |
| 60 | */ |
| 61 | public void resetChildrenOnKeyListeners() { |
| 62 | ShortcutAndWidgetContainer children = getShortcutsAndWidgets(); |
| 63 | int childCount = children.getChildCount(); |
| 64 | for (int j = 0; j < childCount; ++j) { |
| 65 | children.getChildAt(j).setOnKeyListener(null); |
| 66 | } |
| 67 | } |
| 68 | } |