diff options
Diffstat (limited to 'src/com/android')
7 files changed, 9 insertions, 81 deletions
diff --git a/src/com/android/launcher3/AppsContainerRecyclerView.java b/src/com/android/launcher3/AppsContainerRecyclerView.java index 63e7fe4ac..c93bacf93 100644 --- a/src/com/android/launcher3/AppsContainerRecyclerView.java +++ b/src/com/android/launcher3/AppsContainerRecyclerView.java @@ -339,7 +339,7 @@ public class AppsContainerRecyclerView extends RecyclerView int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); - int position = getChildAdapterPosition(child); + int position = getChildPosition(child); if (position != NO_POSITION) { AlphabeticalAppsList.AdapterItem item = mApps.getAdapterItems().get(position); if (!item.isSectionHeader) { diff --git a/src/com/android/launcher3/AppsGridAdapter.java b/src/com/android/launcher3/AppsGridAdapter.java index 96d971669..5b6967c26 100644 --- a/src/com/android/launcher3/AppsGridAdapter.java +++ b/src/com/android/launcher3/AppsGridAdapter.java @@ -79,10 +79,10 @@ class AppsGridAdapter extends RecyclerView.Adapter<AppsGridAdapter.ViewHolder> { GridLayoutManager.LayoutParams lp = (GridLayoutManager.LayoutParams) child.getLayoutParams(); if (!holder.mIsSectionRow && !holder.mIsEmptyRow && !lp.isItemRemoved()) { - if (items.get(holder.getAdapterPosition() - 1).isSectionHeader) { + if (items.get(holder.getPosition() - 1).isSectionHeader) { // Draw at the parent AlphabeticalAppsList.AdapterItem item = - items.get(holder.getAdapterPosition()); + items.get(holder.getPosition()); String section = item.sectionName; mSectionTextPaint.getTextBounds(section, 0, section.length(), mTmpBounds); diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 73f54ab70..331695acc 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -429,7 +429,7 @@ public class DeviceProfile { int availableAppsWidthPx = (appsContainerViewPx > 0) ? appsContainerViewPx : availableWidthPx; appsViewNumCols = (availableAppsWidthPx - appsViewLeftMarginPx) / - (allAppsCellWidthPx + allAppsCellPaddingPx); + (allAppsCellWidthPx + 2 * allAppsCellPaddingPx); } void updateFromConfiguration(Context context, Resources resources, int wPx, int hPx, diff --git a/src/com/android/launcher3/FocusIndicatorView.java b/src/com/android/launcher3/FocusIndicatorView.java index ab21c90e6..ecf93e4b3 100644 --- a/src/com/android/launcher3/FocusIndicatorView.java +++ b/src/com/android/launcher3/FocusIndicatorView.java @@ -149,7 +149,7 @@ public class FocusIndicatorView extends View implements View.OnFocusChangeListen } /** - * Computes the location of a view relative to {@link #mCommonParent}, off-setting + * Computes the location of a view relative to {@param parent}, off-setting * any shift due to page view scroll. * @param pos an array of two integers in which to hold the coordinates */ @@ -166,12 +166,12 @@ public class FocusIndicatorView extends View implements View.OnFocusChangeListen private static void computeLocationRelativeToParentHelper(View child, View commonParent, int[] shift) { View parent = (View) child.getParent(); - if (parent instanceof PagedView) { - child = ((PagedView) parent).getPageAt(0); - } - shift[0] += child.getLeft(); shift[1] += child.getTop(); + if (parent instanceof PagedView) { + PagedView page = (PagedView) parent; + shift[0] -= page.getScrollForPage(page.indexOfChild(child)); + } if (parent != commonParent) { computeLocationRelativeToParentHelper(parent, commonParent, shift); diff --git a/src/com/android/launcher3/PackageChangedReceiver.java b/src/com/android/launcher3/PackageChangedReceiver.java deleted file mode 100644 index b98f47272..000000000 --- a/src/com/android/launcher3/PackageChangedReceiver.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.android.launcher3; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -// TODO: Remove this -public class PackageChangedReceiver extends BroadcastReceiver { - @Override - public void onReceive(final Context context, Intent intent) { - - } -} diff --git a/src/com/android/launcher3/UninstallShortcutReceiver.java b/src/com/android/launcher3/UninstallShortcutReceiver.java deleted file mode 100644 index 59e4cb591..000000000 --- a/src/com/android/launcher3/UninstallShortcutReceiver.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher3; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -//TODO: Remove this -public class UninstallShortcutReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent data) { } -} diff --git a/src/com/android/launcher3/UserInitializeReceiver.java b/src/com/android/launcher3/UserInitializeReceiver.java deleted file mode 100644 index d8e17b12f..000000000 --- a/src/com/android/launcher3/UserInitializeReceiver.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher3; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -/** - * Takes care of setting initial wallpaper for a user, by selecting the - * first wallpaper that is not in use by another user. - */ -public class UserInitializeReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - // TODO: initial wallpaper now that wallpapers are owned by another app - } -} |