Launcher3: add support for hotseat qsb

and fix styles to support ListPreference

Change-Id: I571dfacf67a63872a8f7351ad9c6106397f79505

Launcher3: fix crash on taskbar usage

we use search_container_hotseat.xml for phone when using
qsb in hotseat. So add a new empty one for taskbar

Change-Id: I3df2c9ad432c51e06102b65282bcbc9c4848e6fa

Launcher3: fixup hardocded usages of QSB_ON_FIRST_SCREEN

Change-Id: Id8f6ca9c332f0c53bdf96c944f8daa361adeab1c

Launcher3: fix hotseat qsb widget width

we are not going beyond isScalableGrid in
recalculateHotseatWidthAndBorderSpace so hotseatQsbWidth is 0
in that case. To prevent any unwanted side effects add
a separate API for the width to use if not isQsbInline

Change-Id: I2d49127aa6ea3e10eab043f3f9a102154f1d8458
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 8546454..117c281 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -33,6 +33,7 @@
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
 
+import com.android.launcher3.Utilities;
 import com.android.launcher3.util.HorizontalInsettableView;
 import com.android.launcher3.util.MultiTranslateDelegate;
 import com.android.launcher3.views.ActivityContext;
@@ -64,7 +65,11 @@
     public Hotseat(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
 
-        mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
+        if (Utilities.showHotseatQsbWidget(context)) {
+            mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
+        } else {
+            mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat_empty, this, false);
+        }
         addView(mQsb);
     }
 
@@ -248,7 +253,8 @@
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
 
         DeviceProfile dp = mActivity.getDeviceProfile();
-        mQsb.measure(MeasureSpec.makeMeasureSpec(dp.hotseatQsbWidth, MeasureSpec.EXACTLY),
+        int hotseatQsbWidth = dp.isQsbInline ? dp.hotseatQsbWidth : dp.getHostseatQsbWidth();
+        mQsb.measure(MeasureSpec.makeMeasureSpec(hotseatQsbWidth, MeasureSpec.EXACTLY),
                 MeasureSpec.makeMeasureSpec(dp.hotseatQsbHeight, MeasureSpec.EXACTLY));
     }