summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-06-25 16:46:47 -0700
committerWinson Chung <winsonc@google.com>2015-06-26 00:08:34 +0000
commit1cddad6c6bff0b271e8ebde44013a5a09f273436 (patch)
treefa04e19998639537667cca9bbd2c1753d93e4cb8 /src
parentca0f7d7728c76c3fb1f657c09d9e9fac9b1c2066 (diff)
downloadandroid_packages_apps_Trebuchet-1cddad6c6bff0b271e8ebde44013a5a09f273436.tar.gz
android_packages_apps_Trebuchet-1cddad6c6bff0b271e8ebde44013a5a09f273436.tar.bz2
android_packages_apps_Trebuchet-1cddad6c6bff0b271e8ebde44013a5a09f273436.zip
Fixing issue with casting context to activity.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java2
-rw-r--r--src/com/android/launcher3/allapps/AllAppsRecyclerView.java9
2 files changed, 2 insertions, 9 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 32b7be807..0651fb02e 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -417,7 +417,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
new SimpleSectionMergeAlgorithm((int) Math.ceil(mNumAppsPerRow / 2f),
MIN_ROWS_IN_MERGED_SECTION_PHONE, MAX_NUM_MERGES_PHONE);
- mAppsRecyclerView.setNumAppsPerRow(mNumAppsPerRow);
+ mAppsRecyclerView.setNumAppsPerRow(grid, mNumAppsPerRow);
mAdapter.setNumAppsPerRow(mNumAppsPerRow);
mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow, mergeAlgorithm);
}
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 874e895d9..988ecdda3 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -21,13 +21,11 @@ import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
-import android.view.ContextThemeWrapper;
import android.view.View;
import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.BaseRecyclerViewFastScrollBar;
import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.Launcher;
import com.android.launcher3.Stats;
import com.android.launcher3.util.Thunk;
@@ -57,7 +55,6 @@ public class AllAppsRecyclerView extends BaseRecyclerView
private final int mFastScrollMode = FAST_SCROLL_MODE_JUMP_TO_FIRST_ICON;
private final int mScrollBarMode = FAST_SCROLL_BAR_MODE_DISTRIBUTE_BY_ROW;
- private Launcher mLauncher;
private ScrollPositionState mScrollPosState = new ScrollPositionState();
public AllAppsRecyclerView(Context context) {
@@ -75,9 +72,6 @@ public class AllAppsRecyclerView extends BaseRecyclerView
public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr);
- // We have a theme on this view, so we need to coerce the base activity context from that
- ContextThemeWrapper ctx = (ContextThemeWrapper) context;
- mLauncher = (Launcher) ctx.getBaseContext();
}
/**
@@ -90,10 +84,9 @@ public class AllAppsRecyclerView extends BaseRecyclerView
/**
* Sets the number of apps per row in this recycler view.
*/
- public void setNumAppsPerRow(int numAppsPerRow) {
+ public void setNumAppsPerRow(DeviceProfile grid, int numAppsPerRow) {
mNumAppsPerRow = numAppsPerRow;
- DeviceProfile grid = mLauncher.getDeviceProfile();
RecyclerView.RecycledViewPool pool = getRecycledViewPool();
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
pool.setMaxRecycledViews(AllAppsGridAdapter.PREDICTION_BAR_SPACER_TYPE, 1);