diff options
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsGridAdapter.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsGridAdapter.java | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index 3065fb428..643182588 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -80,6 +80,9 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. private int mGridTheme; + + private AlphabeticalAppsList.SectionInfo mFocusedSection; + /** * ViewHolder for each icon. */ @@ -572,6 +575,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. boolean hideIconLabels = SettingsProvider.getBoolean(mLauncher, SettingsProvider.SETTINGS_UI_DRAWER_HIDE_ICON_LABELS, R.bool.preferences_interface_drawer_hide_icon_labels_default); + FastScrollFocusApplicator.setFastScrollDimmed(holder.mContent, false, false); + FastScrollFocusApplicator.setFastScrollFocused(holder.mContent, false, false); switch (holder.getItemViewType()) { case ICON_VIEW_TYPE: { AppInfo info = mApps.getAdapterItems().get(position).appInfo; @@ -581,7 +586,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. icon.setTextVisibility(!hideIconLabels); } icon.applyFromApplicationInfo(info); - FastScrollFocusApplicator.setFastScrollDimmed(icon, mIconsDimmed, !mIconsDimmed); + FastScrollFocusApplicator.setFastScrollDimmed(icon, shouldDimPosition(position), + !mIconsDimmed); FastScrollFocusApplicator.setFastScrollFocused(icon, false, !mIconsDimmed); break; } @@ -593,7 +599,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. icon.setTextVisibility(!hideIconLabels); } icon.applyFromApplicationInfo(info); - FastScrollFocusApplicator.setFastScrollDimmed(icon, mIconsDimmed, !mIconsDimmed); + FastScrollFocusApplicator.setFastScrollDimmed(icon, shouldDimPosition(position), + !mIconsDimmed); FastScrollFocusApplicator.setFastScrollFocused(icon, false, !mIconsDimmed); mRemoteFolderManager.onBindViewHolder(holder, info); @@ -620,7 +627,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. case CUSTOM_PREDICTED_APPS_HEADER_VIEW_TYPE: { TextView title = (TextView) holder.mContent.findViewById(R.id.title); title.setTextColor(mAllAppsTextColor); - FastScrollFocusApplicator.setFastScrollDimmed(holder.mContent, mIconsDimmed, !mIconsDimmed); + FastScrollFocusApplicator.setFastScrollDimmed(holder.mContent, + shouldDimPosition(position), !mIconsDimmed); FastScrollFocusApplicator.setFastScrollFocused(holder.mContent, false, !mIconsDimmed); ViewGroup.MarginLayoutParams lp = @@ -637,6 +645,17 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. } } + private boolean shouldDimPosition(int position) { + if (mFocusedSection != null && mIconsDimmed) { + if (position >= mFocusedSection.firstAppItem.position && + position < mFocusedSection.firstAppItem.position + + mFocusedSection.numApps) { + return false; + } + } + return mIconsDimmed; + } + public int getCustomPredictedAppsOffset(int rowIndex) { int offset = mCustomPredictedAppsHeaderHeight; if (rowIndex > 0) offset += mCustomPredictedAppsFooterHeight; @@ -661,6 +680,11 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. } } + public void setFocusedSection( + AlphabeticalAppsList.SectionInfo focusedSection) { + mFocusedSection = focusedSection; + } + public void setGridTheme(int gridTheme) { mGridTheme = gridTheme; int sectionTextColorId = mGridTheme == AllAppsContainerView.GRID_THEME_DARK ? |