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
This commit is contained in:
Anjali Koppal
2014-03-10 20:34:39 -07:00
parent fc4787f7be
commit 5ad4484df3
2 changed files with 13 additions and 8 deletions
+2 -8
View File
@@ -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
+11
View File
@@ -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.
*