From 5ad4484df3e477f9d8819605629b6e75a42e31ed Mon Sep 17 00:00:00 2001 From: Anjali Koppal Date: Mon, 10 Mar 2014 20:34:39 -0700 Subject: [PATCH] Add a setter/getter for Launcher.mAllAppsButton. Also, handle clicks on the all apps button by using onClick() method in Launcher instead of directly calling onClickAllAppsButton in Hotseat.java Bug 12553852 Change-Id: I261c27d3e964bbb1f52c2ab610997defd99a59bd --- src/com/android/launcher3/Hotseat.java | 10 ++-------- src/com/android/launcher3/Launcher.java | 11 +++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 59d60e3812..2ac2f00a87 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -156,15 +156,9 @@ public class Hotseat extends FrameLayout { allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); if (mLauncher != null) { allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener()); + mLauncher.setAllAppsButton(allAppsButton); + allAppsButton.setOnClickListener(mLauncher); } - allAppsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(android.view.View v) { - if (mLauncher != null) { - mLauncher.onClickAllAppsButton(v); - } - } - }); // Note: We do this to ensure that the hotseat is always laid out in the orientation of // the hotseat in order regardless of which orientation they were added diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index bd1ef321a8..f1ce23524e 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1333,6 +1333,17 @@ public class Launcher extends Activity } } + /** + * Sets the all apps button. This method is called from {@link Hotseat}. + */ + public void setAllAppsButton(View allAppsButton) { + mAllAppsButton = allAppsButton; + } + + public View getAllAppsButton() { + return mAllAppsButton; + } + /** * Creates a view representing a shortcut. *