Unifying focus indicator handling for workspace and all-apps

Adding an abstract FocusIndicatorHelper based on FocusIndicatorView
which draws the background instead of using a dummy view.

Change-Id: Id560195323d2ddad8fcd77ba675cf3f4fd4a94ab
This commit is contained in:
Sunny Goyal
2016-05-09 20:43:21 -07:00
parent ab06999a70
commit 3333b0ced8
18 changed files with 438 additions and 313 deletions

View File

@@ -52,6 +52,7 @@ import com.android.launcher3.LauncherTransitionable;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.keyboard.FocusedItemDecorator;
import com.android.launcher3.util.ComponentKey;
import java.nio.charset.Charset;
@@ -311,6 +312,10 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
mAppsRecyclerView.addItemDecoration(mItemDecoration);
}
FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(mAppsRecyclerView);
mAppsRecyclerView.addItemDecoration(focusedItemDecorator);
mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener());
// Precalculate the prediction icon and normal icon sizes
LayoutInflater layoutInflater = LayoutInflater.from(getContext());
final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(