OSDN Git Service

Make footer preferences non-clickable by default
authorjackqdyulei <jackqdyulei@google.com>
Mon, 5 Jun 2017 17:44:34 +0000 (10:44 -0700)
committerjackqdyulei <jackqdyulei@google.com>
Mon, 5 Jun 2017 17:44:34 +0000 (10:44 -0700)
cherry-picked from ag/2301717

Both the footer preference and the TextView they contain
were clickable, which confused some accessibility services.

Bug: 62050563
Test: Verified that switch access no longer offers users
the option of clicking on the footer for accessibility
services and Magnification as well as in the Battery
settings screen.

Change-Id: I5cb13d6268466c690dd38f2b652422d2c3d813b4
Merged-In: I937340fda93f6a8097919e1f86d5d890487370bc

src/com/android/settings/widget/FooterPreference.java

index 9cb9e11..84e3ed8 100644 (file)
@@ -50,11 +50,14 @@ public class FooterPreference extends Preference {
         super.onBindViewHolder(holder);
         TextView title = holder.itemView.findViewById(android.R.id.title);
         title.setMovementMethod(new LinkMovementMethod());
+        title.setClickable(false);
+        title.setLongClickable(false);
     }
 
     private void init() {
         setIcon(R.drawable.ic_info_outline_24dp);
         setKey(KEY_FOOTER);
         setOrder(ORDER_FOOTER);
+        setSelectable(false);
     }
 }