Altering touch feedback for qsb assets. (Bug: 5560273)

- Removing some dead code

Change-Id: If6f3ffcf28249ca08c23089acb5bcd501b455119
diff --git a/src/com/android/launcher2/HolographicLinearLayout.java b/src/com/android/launcher2/HolographicLinearLayout.java
index 986a063..c6a8d6a 100644
--- a/src/com/android/launcher2/HolographicLinearLayout.java
+++ b/src/com/android/launcher2/HolographicLinearLayout.java
@@ -17,13 +17,21 @@
 package com.android.launcher2;
 
 import android.content.Context;
+import android.content.res.TypedArray;
 import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.StateListDrawable;
 import android.util.AttributeSet;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 
+import com.android.launcher.R;
+
 public class HolographicLinearLayout extends LinearLayout {
 
     private final HolographicViewHelper mHolographicHelper;
+    private ImageView mImageView;
+    private int mImageViewId;
 
     public HolographicLinearLayout(Context context) {
         this(context, null);
@@ -36,16 +44,37 @@
     public HolographicLinearLayout(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
 
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HolographicLinearLayout,
+                defStyle, 0);
+        mImageViewId = a.getResourceId(R.styleable.HolographicLinearLayout_sourceImageViewId, -1);
+        a.recycle();
+
         setWillNotDraw(false);
         mHolographicHelper = new HolographicViewHelper(context);
     }
 
     @Override
+    protected void drawableStateChanged() {
+        super.drawableStateChanged();
+
+        if (mImageView != null) {
+            Drawable d = mImageView.getDrawable();
+            if (d instanceof StateListDrawable) {
+                StateListDrawable sld = (StateListDrawable) d;
+                sld.setState(getDrawableState());
+            }
+        }
+    }
+
+    @Override
     protected void onDraw(Canvas canvas) {
         super.onDraw(canvas);
 
         // One time call to generate the pressed/focused state -- must be called after
         // measure/layout
-        mHolographicHelper.generatePressedFocusedStates(this);
+        if (mImageView == null) {
+            mImageView = (ImageView) findViewById(mImageViewId);
+        }
+        mHolographicHelper.generatePressedFocusedStates(mImageView);
     }
 }