Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +6 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ public interface QS extends FragmentBase { String ACTION = "com.android.systemui.action.PLUGIN_QS"; int VERSION = 12; int VERSION = 13; String TAG = "QS"; Loading Loading @@ -70,6 +70,11 @@ public interface QS extends FragmentBase { void setContainerController(QSContainerController controller); void setExpandClickListener(OnClickListener onClickListener); /** * Returns the height difference between the QSPanel container and the QuickQSPanel container */ int getHeightDiff(); View getHeader(); default void setHasNotifications(boolean hasNotifications) { Loading packages/SystemUI/res/layout/qs_paged_tile_layout.xml +3 −1 Original line number Diff line number Diff line Loading @@ -20,4 +20,6 @@ android:id="@+id/qs_pager" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"/> android:layout_weight="1" android:clipChildren="false" android:clipToPadding="false" /> packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +27 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.systemui.qs.QSPanel.QSTileLayout; import com.android.systemui.qs.QSPanelControllerBase.TileRecord; import java.util.ArrayList; import java.util.List; import java.util.Set; public class PagedTileLayout extends ViewPager implements QSTileLayout { Loading Loading @@ -332,6 +333,18 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { mPageListener = listener; } public List<String> getSpecsForPage(int page) { ArrayList<String> out = new ArrayList<>(); if (page < 0) return out; int perPage = mPages.get(0).maxTiles(); int startOfPage = page * perPage; int endOfPage = (page + 1) * perPage; for (int i = startOfPage; i < endOfPage && i < mTiles.size(); i++) { out.add(mTiles.get(i).tile.getTileSpec()); } return out; } private void distributeTiles() { emptyAndInflateOrRemovePages(); Loading Loading @@ -491,6 +504,11 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { return currentPage.mRecords.size(); } public int getNumTilesFirstPage() { if (mPages.size() == 0) return 0; return mPages.get(0).mRecords.size(); } public void startTileReveal(Set<String> tileSpecs, final Runnable postAnimation) { if (tileSpecs.isEmpty() || mPages.size() < 2 || getScrollX() != 0 || !beginFakeDrag()) { // Do not start the reveal animation unless there are tiles to animate, multiple Loading Loading @@ -556,8 +574,9 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { updateSelected(); if (mPageIndicator == null) return; if (mPageListener != null) { int pageNumber = isLayoutRtl() ? mPages.size() - 1 - position : position; mPageListener.onPageChanged(isLayoutRtl() ? position == mPages.size() - 1 : position == 0); : position == 0, pageNumber); } } Loading @@ -575,8 +594,12 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { mPageIndicatorPosition = position + positionOffset; mPageIndicator.setLocation(mPageIndicatorPosition); if (mPageListener != null) { int pageNumber = isLayoutRtl() ? mPages.size() - 1 - position : position; mPageListener.onPageChanged(positionOffsetPixels == 0 && (isLayoutRtl() ? position == mPages.size() - 1 : position == 0)); (isLayoutRtl() ? position == mPages.size() - 1 : position == 0), // Send only valid page number on integer pages positionOffsetPixels == 0 ? pageNumber : PageListener.INVALID_PAGE ); } } Loading Loading @@ -626,6 +649,7 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { }; public interface PageListener { void onPageChanged(boolean isFirst); int INVALID_PAGE = -1; void onPageChanged(boolean isFirst, int pageNumber); } } packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +208 −72 File changed.Preview size limit exceeded, changes collapsed. Show changes packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +7 −2 Original line number Diff line number Diff line Loading @@ -503,6 +503,12 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca isTransitioningToFullShade ? progress : mSquishinessFraction); } @Override public int getHeightDiff() { return mQSPanelScrollView.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom(); } @Override public void setQsExpansion(float expansion, float panelExpansionFraction, float proposedTranslation, float squishinessFraction) { Loading Loading @@ -537,8 +543,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca boolean fullyExpanded = expansion == 1; boolean fullyCollapsed = expansion == 0.0f; int heightDiff = mQSPanelScrollView.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom(); int heightDiff = getHeightDiff(); float panelTranslationY = translationScaleY * heightDiff; // Let the views animate their contents correctly by giving them the necessary context. Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +6 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ public interface QS extends FragmentBase { String ACTION = "com.android.systemui.action.PLUGIN_QS"; int VERSION = 12; int VERSION = 13; String TAG = "QS"; Loading Loading @@ -70,6 +70,11 @@ public interface QS extends FragmentBase { void setContainerController(QSContainerController controller); void setExpandClickListener(OnClickListener onClickListener); /** * Returns the height difference between the QSPanel container and the QuickQSPanel container */ int getHeightDiff(); View getHeader(); default void setHasNotifications(boolean hasNotifications) { Loading
packages/SystemUI/res/layout/qs_paged_tile_layout.xml +3 −1 Original line number Diff line number Diff line Loading @@ -20,4 +20,6 @@ android:id="@+id/qs_pager" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"/> android:layout_weight="1" android:clipChildren="false" android:clipToPadding="false" />
packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +27 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.systemui.qs.QSPanel.QSTileLayout; import com.android.systemui.qs.QSPanelControllerBase.TileRecord; import java.util.ArrayList; import java.util.List; import java.util.Set; public class PagedTileLayout extends ViewPager implements QSTileLayout { Loading Loading @@ -332,6 +333,18 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { mPageListener = listener; } public List<String> getSpecsForPage(int page) { ArrayList<String> out = new ArrayList<>(); if (page < 0) return out; int perPage = mPages.get(0).maxTiles(); int startOfPage = page * perPage; int endOfPage = (page + 1) * perPage; for (int i = startOfPage; i < endOfPage && i < mTiles.size(); i++) { out.add(mTiles.get(i).tile.getTileSpec()); } return out; } private void distributeTiles() { emptyAndInflateOrRemovePages(); Loading Loading @@ -491,6 +504,11 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { return currentPage.mRecords.size(); } public int getNumTilesFirstPage() { if (mPages.size() == 0) return 0; return mPages.get(0).mRecords.size(); } public void startTileReveal(Set<String> tileSpecs, final Runnable postAnimation) { if (tileSpecs.isEmpty() || mPages.size() < 2 || getScrollX() != 0 || !beginFakeDrag()) { // Do not start the reveal animation unless there are tiles to animate, multiple Loading Loading @@ -556,8 +574,9 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { updateSelected(); if (mPageIndicator == null) return; if (mPageListener != null) { int pageNumber = isLayoutRtl() ? mPages.size() - 1 - position : position; mPageListener.onPageChanged(isLayoutRtl() ? position == mPages.size() - 1 : position == 0); : position == 0, pageNumber); } } Loading @@ -575,8 +594,12 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { mPageIndicatorPosition = position + positionOffset; mPageIndicator.setLocation(mPageIndicatorPosition); if (mPageListener != null) { int pageNumber = isLayoutRtl() ? mPages.size() - 1 - position : position; mPageListener.onPageChanged(positionOffsetPixels == 0 && (isLayoutRtl() ? position == mPages.size() - 1 : position == 0)); (isLayoutRtl() ? position == mPages.size() - 1 : position == 0), // Send only valid page number on integer pages positionOffsetPixels == 0 ? pageNumber : PageListener.INVALID_PAGE ); } } Loading Loading @@ -626,6 +649,7 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { }; public interface PageListener { void onPageChanged(boolean isFirst); int INVALID_PAGE = -1; void onPageChanged(boolean isFirst, int pageNumber); } }
packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +208 −72 File changed.Preview size limit exceeded, changes collapsed. Show changes
packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +7 −2 Original line number Diff line number Diff line Loading @@ -503,6 +503,12 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca isTransitioningToFullShade ? progress : mSquishinessFraction); } @Override public int getHeightDiff() { return mQSPanelScrollView.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom(); } @Override public void setQsExpansion(float expansion, float panelExpansionFraction, float proposedTranslation, float squishinessFraction) { Loading Loading @@ -537,8 +543,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca boolean fullyExpanded = expansion == 1; boolean fullyCollapsed = expansion == 0.0f; int heightDiff = mQSPanelScrollView.getBottom() - mHeader.getBottom() + mHeader.getPaddingBottom(); int heightDiff = getHeightDiff(); float panelTranslationY = translationScaleY * heightDiff; // Let the views animate their contents correctly by giving them the necessary context. Loading