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
This commit is contained in:
Svetoslav
2013-04-26 10:45:33 -07:00
parent 0cb93523b2
commit 3b2d307b89
2 changed files with 11 additions and 20 deletions

View File

@@ -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