From 3b2d307b89b10857ce4d03ce2974ab23688a10ad Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Fri, 26 Apr 2013 10:45:33 -0700 Subject: [PATCH] Scroll if an accessibility setting description does not fit the screen. 1. Certain accessibility settings are shown on a separate screen with a toggle switch and a description. Sometimes the description does not fit the screen. The preference framework is using a list view for holding the description item. This list view was disabled, thus not scrolling (done to avoid drawable state change on click). Now the list view is enabled and the drawable state change on click problem is solved by setting the selector and divider drawables to a transparent one. 2. The layout for the list item that shows the feature description had an unnecessary linear layout. bug:8632146 Change-Id: Ib81a8513158d5b8d90fa80f57720c8590022ae1a --- res/layout/text_description_preference.xml | 21 +++++++------------ .../settings/AccessibilitySettings.java | 10 ++++----- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/res/layout/text_description_preference.xml b/res/layout/text_description_preference.xml index 7d73f587fe6..78eb02aa2a4 100644 --- a/res/layout/text_description_preference.xml +++ b/res/layout/text_description_preference.xml @@ -14,18 +14,11 @@ limitations under the License. --> - - - - - + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="?android:attr/textColorSecondary" + android:padding="16dip" /> diff --git a/src/com/android/settings/AccessibilitySettings.java b/src/com/android/settings/AccessibilitySettings.java index 638aae6d928..a4438d056a0 100644 --- a/src/com/android/settings/AccessibilitySettings.java +++ b/src/com/android/settings/AccessibilitySettings.java @@ -32,6 +32,8 @@ import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Configuration; import android.database.ContentObserver; +import android.graphics.Color; +import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -427,11 +429,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements @Override protected void onBindView(View view) { super.onBindView(view); - - LinearLayout containerView = - (LinearLayout) view.findViewById(R.id.message_container); - containerView.setGravity(Gravity.CENTER); - TextView summaryView = (TextView) view.findViewById(R.id.summary); String title = getString(R.string.accessibility_no_services_installed); summaryView.setText(title); @@ -1030,8 +1027,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements super.onViewCreated(view, savedInstanceState); onInstallActionBarToggleSwitch(); onProcessArguments(getArguments()); + // Set a transparent drawable to prevent use of the default one. + getListView().setSelector(new ColorDrawable(Color.TRANSPARENT)); getListView().setDivider(null); - getListView().setEnabled(false); } @Override