diff options
author | Setup Wizard Team <android-setup-team-eng@google.com> | 2019-12-16 10:43:08 +0800 |
---|---|---|
committer | Nicole Huang <nicolehuang@google.com> | 2019-12-16 10:59:12 +0800 |
commit | 0564078669999e2e240c9a5ca55e7cd5c28a7e04 (patch) | |
tree | d286d88a82211bd4c90e6c088a2af06f2d219f97 /main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java | |
parent | 2cd12a9cc6d6ff6c4c6211ce1cf0c7c8528fc9d0 (diff) | |
download | setupdesign-0564078669999e2e240c9a5ca55e7cd5c28a7e04.tar.gz |
Import updated Android Setupdesign Library 285688831
Copied from google3/third_party/java_src/android_libs/setupdesign
Test: mm
Included changes:
- 285688831 [SetupDesign] implement "performAccessibilityAction" for ...
- 265096362 Move LinkAccessibilityHelper into accessibility package
- 264301994 Adding @Nullable annotations to Item class's getters & se...
- 261097700 Automated g4 rollback of changelist 261048813.
- 261048813 adjust the minimum size of illustration to fit with Go2Ph...
- 256892595 Set error text color in glif dark and light theme
- 255878051 Refactor field name for readability
- 255552761 Scroll the screen to next page when receive KeyEvent.DPAD...
- 255375228 1. ContentStyler - api to apply partner resource on the t...
- 251624487 Add API HeaderContainerStyler for header container apply ...
- 251553482 qt-dev is freeze, code will sync to qt-r1-dev
PiperOrigin-RevId: 285688831
Change-Id: I8c62f218a40f3ae38c485ea3e18ef32845b8a87a
Diffstat (limited to 'main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java')
-rw-r--r-- | main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java b/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java index 28b41c9..42438d6 100644 --- a/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java +++ b/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java @@ -23,6 +23,7 @@ import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; +import android.os.Bundle; import androidx.core.view.AccessibilityDelegateCompat; import androidx.core.view.ViewCompat; import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; @@ -64,6 +65,22 @@ public class ExpandableSwitchItem extends SwitchItem ? AccessibilityActionCompat.ACTION_COLLAPSE : AccessibilityActionCompat.ACTION_EXPAND); } + + @Override + public boolean performAccessibilityAction(View view, int action, Bundle args) { + boolean result; + switch (action) { + case AccessibilityNodeInfoCompat.ACTION_COLLAPSE: + case AccessibilityNodeInfoCompat.ACTION_EXPAND: + setExpanded(!isExpanded()); + result = true; + break; + default: + result = super.performAccessibilityAction(view, action, args); + break; + } + return result; + } }; public ExpandableSwitchItem() { |