[QS] Add PageIndicator to footer

Allow the footer to provide a new PageIndicator to the QSPanel.
Wrapped the cellular text/info in a LinearLayout such that it
fills the space available and updated params for the action
container depending on what orientation we're in.

Since we're swapping the page indicator, it's important not to
lose num pages/location, so additionally storing & resetting
those values when swapping.

Test: Visually
Change-Id: Iffa8a47601a20d3386abd6f77ed120ece552b726
Fixes: 77152480
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index c548cf6..d8d07c0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -46,6 +46,7 @@
     private final ArrayList<TilePage> mPages = new ArrayList<>();
 
     private PageIndicator mPageIndicator;
+    private float mPageIndicatorPosition;
 
     private int mNumPages;
     private PageListener mPageListener;
@@ -145,6 +146,8 @@
 
     public void setPageIndicator(PageIndicator indicator) {
         mPageIndicator = indicator;
+        mPageIndicator.setNumPages(mNumPages);
+        mPageIndicator.setLocation(mPageIndicatorPosition);
     }
 
     @Override
@@ -212,7 +215,6 @@
             }
             if (DEBUG) Log.d(TAG, "Size: " + mNumPages);
             mPageIndicator.setNumPages(mNumPages);
-            mPageIndicator.setVisibility(mNumPages > 1 ? View.VISIBLE : View.GONE);
             setAdapter(mAdapter);
             mAdapter.notifyDataSetChanged();
             setCurrentItem(0, false);
@@ -221,6 +223,12 @@
 
     @Override
     public boolean updateResources() {
+        // Update bottom padding, useful for removing extra space once the panel page indicator is
+        // hidden.
+        setPadding(0, 0, 0,
+                getContext().getResources().getDimensionPixelSize(
+                        R.dimen.qs_paged_tile_layout_padding_bottom));
+
         boolean changed = false;
         for (int i = 0; i < mPages.size(); i++) {
             changed |= mPages.get(i).updateResources();
@@ -326,7 +334,8 @@
                 public void onPageScrolled(int position, float positionOffset,
                         int positionOffsetPixels) {
                     if (mPageIndicator == null) return;
-                    mPageIndicator.setLocation(position + positionOffset);
+                    mPageIndicatorPosition = position + positionOffset;
+                    mPageIndicator.setLocation(mPageIndicatorPosition);
                     if (mPageListener != null) {
                         mPageListener.onPageChanged(positionOffsetPixels == 0 &&
                                 (isLayoutRtl() ? position == mPages.size() - 1 : position == 0));