diff options
author | Adam Cohen <adamcohen@google.com> | 2013-09-30 15:58:20 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2013-09-30 16:21:00 -0700 |
commit | 61f560d92ab4b11a61beeb8df97b9952027e08e4 (patch) | |
tree | 06f9c9c02f64c8638fafb5e90bdbaac37de9bf06 /src/com/android/launcher3/Hotseat.java | |
parent | f9e8640fcc02a4f1e85ff371d3938a04b24564a4 (diff) | |
download | android_packages_apps_Trebuchet-61f560d92ab4b11a61beeb8df97b9952027e08e4.tar.gz android_packages_apps_Trebuchet-61f560d92ab4b11a61beeb8df97b9952027e08e4.tar.bz2 android_packages_apps_Trebuchet-61f560d92ab4b11a61beeb8df97b9952027e08e4.zip |
Fixing AllApps pressed state (issue 10845969)
-> Adding haptic feedback to overview mode buttons (issue 10917359)
Change-Id: Iaf7ac31521ae08f4223aa0d0ffc2f6511b85567f
Diffstat (limited to 'src/com/android/launcher3/Hotseat.java')
-rw-r--r-- | src/com/android/launcher3/Hotseat.java | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index fbbb09f51..986a89b5d 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -28,6 +28,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; +import android.widget.TextView; import java.util.ArrayList; @@ -126,27 +127,17 @@ public class Hotseat extends FrameLayout { // Add the Apps button Context context = getContext(); - Drawable rawIcon = - context.getResources().getDrawable(R.drawable.all_apps_button_icon); - Bitmap icon = Utilities.createIconBitmap(rawIcon, context); - LayoutInflater inflater = LayoutInflater.from(context); - BubbleTextView allAppsButton = (BubbleTextView) - inflater.inflate(R.layout.application, mContent, false); - allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null, - new FastBitmapDrawable(icon), null, null); - allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); - allAppsButton.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View v, MotionEvent event) { - if (mLauncher != null && - (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { - mLauncher.onTouchDownAllAppsButton(v); - } - return false; - } - }); + TextView allAppsButton = (TextView) + inflater.inflate(R.layout.all_apps_button, mContent, false); + Drawable d = context.getResources().getDrawable(R.drawable.all_apps_button_icon); + d.setBounds(0, 0, Utilities.sIconTextureWidth, Utilities.sIconTextureHeight); + allAppsButton.setCompoundDrawables(null, d, null, null); + allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); + if (mLauncher != null) { + allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener()); + } allAppsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(android.view.View v) { |