Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +7 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ package com.android.systemui.plugins.qs; import android.view.View; import android.view.View.OnClickListener; import com.android.systemui.plugins.FragmentBase; import com.android.systemui.plugins.annotations.DependsOn; Loading @@ -34,7 +33,7 @@ public interface QS extends FragmentBase { String ACTION = "com.android.systemui.action.PLUGIN_QS"; int VERSION = 13; int VERSION = 14; String TAG = "QS"; Loading Loading @@ -68,7 +67,12 @@ public interface QS extends FragmentBase { void setHeaderListening(boolean listening); void notifyCustomizeChanged(); void setContainerController(QSContainerController controller); void setExpandClickListener(OnClickListener onClickListener); /** * Provide an action to collapse if expanded or expand if collapsed. * @param action */ void setCollapseExpandAction(Runnable action); /** * Returns the height difference between the QSPanel container and the QuickQSPanel container Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java +4 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import com.android.systemui.plugins.qs.QSTile.State; @DependsOn(target = QSIconView.class) @DependsOn(target = QSTile.class) public abstract class QSTileView extends LinearLayout { public static final int VERSION = 2; public static final int VERSION = 3; public QSTileView(Context context) { super(context); Loading Loading @@ -71,4 +71,7 @@ public abstract class QSTileView extends LinearLayout { public View getSecondaryLabel() { return null; } /** Sets the index of this tile in its layout */ public abstract void setPosition(int position); } packages/SystemUI/res/layout/qs_tile_label.xml +6 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ android:orientation="vertical" android:layout_marginStart="@dimen/qs_label_container_margin" android:layout_marginEnd="0dp" android:focusable="false" android:importantForAccessibility="no" android:layout_gravity="center_vertical | start"> <com.android.systemui.util.SafeMarqueeTextView Loading @@ -35,6 +37,8 @@ android:ellipsize="marquee" android:marqueeRepeatLimit="1" android:singleLine="true" android:focusable="false" android:importantForAccessibility="no" android:textAppearance="@style/TextAppearance.QS.TileLabel"/> <com.android.systemui.util.SafeMarqueeTextView Loading @@ -47,6 +51,8 @@ android:marqueeRepeatLimit="1" android:singleLine="true" android:visibility="gone" android:focusable="false" android:importantForAccessibility="no" android:textAppearance="@style/TextAppearance.QS.TileLabel.Secondary" android:textColor="?android:attr/textColorSecondary"/> Loading packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +46 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; import android.widget.Scroller; Loading Loading @@ -552,6 +553,51 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { postInvalidateOnAnimation(); } private int sanitizePageAction(int action) { int pageLeftId = AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_LEFT.getId(); int pageRightId = AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_RIGHT.getId(); if (action == pageLeftId || action == pageRightId) { if (!isLayoutRtl()) { if (action == pageLeftId) { return AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD; } else { return AccessibilityNodeInfo.ACTION_SCROLL_FORWARD; } } else { if (action == pageLeftId) { return AccessibilityNodeInfo.ACTION_SCROLL_FORWARD; } else { return AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD; } } } return action; } @Override public boolean performAccessibilityAction(int action, Bundle arguments) { action = sanitizePageAction(action); boolean performed = super.performAccessibilityAction(action, arguments); if (performed && (action == AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD || action == AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)) { requestAccessibilityFocus(); } return performed; } @Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfoInternal(info); // getCurrentItem does not respect RTL, so it works well together with page actions that // use left/right positioning. if (getCurrentItem() != 0) { info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_LEFT); } if (getCurrentItem() != mPages.size() - 1) { info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_RIGHT); } } private static Animator setupBounceAnimator(View view, int ordinal) { view.setAlpha(0f); view.setScaleX(0f); Loading packages/SystemUI/src/com/android/systemui/qs/QSFooter.java +0 −5 Original line number Diff line number Diff line Loading @@ -48,10 +48,5 @@ public interface QSFooter { */ void setKeyguardShowing(boolean keyguardShowing); /** * Sets the {@link android.view.View.OnClickListener to be used on elements that expend QS. */ void setExpandClickListener(View.OnClickListener onClickListener); default void disable(int state1, int state2, boolean animate) {} } Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +7 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ package com.android.systemui.plugins.qs; import android.view.View; import android.view.View.OnClickListener; import com.android.systemui.plugins.FragmentBase; import com.android.systemui.plugins.annotations.DependsOn; Loading @@ -34,7 +33,7 @@ public interface QS extends FragmentBase { String ACTION = "com.android.systemui.action.PLUGIN_QS"; int VERSION = 13; int VERSION = 14; String TAG = "QS"; Loading Loading @@ -68,7 +67,12 @@ public interface QS extends FragmentBase { void setHeaderListening(boolean listening); void notifyCustomizeChanged(); void setContainerController(QSContainerController controller); void setExpandClickListener(OnClickListener onClickListener); /** * Provide an action to collapse if expanded or expand if collapsed. * @param action */ void setCollapseExpandAction(Runnable action); /** * Returns the height difference between the QSPanel container and the QuickQSPanel container Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java +4 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import com.android.systemui.plugins.qs.QSTile.State; @DependsOn(target = QSIconView.class) @DependsOn(target = QSTile.class) public abstract class QSTileView extends LinearLayout { public static final int VERSION = 2; public static final int VERSION = 3; public QSTileView(Context context) { super(context); Loading Loading @@ -71,4 +71,7 @@ public abstract class QSTileView extends LinearLayout { public View getSecondaryLabel() { return null; } /** Sets the index of this tile in its layout */ public abstract void setPosition(int position); }
packages/SystemUI/res/layout/qs_tile_label.xml +6 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ android:orientation="vertical" android:layout_marginStart="@dimen/qs_label_container_margin" android:layout_marginEnd="0dp" android:focusable="false" android:importantForAccessibility="no" android:layout_gravity="center_vertical | start"> <com.android.systemui.util.SafeMarqueeTextView Loading @@ -35,6 +37,8 @@ android:ellipsize="marquee" android:marqueeRepeatLimit="1" android:singleLine="true" android:focusable="false" android:importantForAccessibility="no" android:textAppearance="@style/TextAppearance.QS.TileLabel"/> <com.android.systemui.util.SafeMarqueeTextView Loading @@ -47,6 +51,8 @@ android:marqueeRepeatLimit="1" android:singleLine="true" android:visibility="gone" android:focusable="false" android:importantForAccessibility="no" android:textAppearance="@style/TextAppearance.QS.TileLabel.Secondary" android:textColor="?android:attr/textColorSecondary"/> Loading
packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +46 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; import android.widget.Scroller; Loading Loading @@ -552,6 +553,51 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { postInvalidateOnAnimation(); } private int sanitizePageAction(int action) { int pageLeftId = AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_LEFT.getId(); int pageRightId = AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_RIGHT.getId(); if (action == pageLeftId || action == pageRightId) { if (!isLayoutRtl()) { if (action == pageLeftId) { return AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD; } else { return AccessibilityNodeInfo.ACTION_SCROLL_FORWARD; } } else { if (action == pageLeftId) { return AccessibilityNodeInfo.ACTION_SCROLL_FORWARD; } else { return AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD; } } } return action; } @Override public boolean performAccessibilityAction(int action, Bundle arguments) { action = sanitizePageAction(action); boolean performed = super.performAccessibilityAction(action, arguments); if (performed && (action == AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD || action == AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)) { requestAccessibilityFocus(); } return performed; } @Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfoInternal(info); // getCurrentItem does not respect RTL, so it works well together with page actions that // use left/right positioning. if (getCurrentItem() != 0) { info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_LEFT); } if (getCurrentItem() != mPages.size() - 1) { info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_RIGHT); } } private static Animator setupBounceAnimator(View view, int ordinal) { view.setAlpha(0f); view.setScaleX(0f); Loading
packages/SystemUI/src/com/android/systemui/qs/QSFooter.java +0 −5 Original line number Diff line number Diff line Loading @@ -48,10 +48,5 @@ public interface QSFooter { */ void setKeyguardShowing(boolean keyguardShowing); /** * Sets the {@link android.view.View.OnClickListener to be used on elements that expend QS. */ void setExpandClickListener(View.OnClickListener onClickListener); default void disable(int state1, int state2, boolean animate) {} }