summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2013-03-12 16:32:26 -0400
committerChris Wren <cwren@android.com>2013-03-12 16:32:40 -0400
commit797805909b4852169c1e884a0a458ec1443dab84 (patch)
treeab3908075dfbb0837696ccc39b41cb59db36fd5b
parent9471675c0a280e23186977434efdd0db0ab5bf9d (diff)
downloadpackages_apps_Settings-797805909b4852169c1e884a0a458ec1443dab84.zip
packages_apps_Settings-797805909b4852169c1e884a0a458ec1443dab84.tar.gz
packages_apps_Settings-797805909b4852169c1e884a0a458ec1443dab84.tar.bz2
allow daydream settings to be keyboard driven.
Bug: 8339092 Change-Id: I9ef93a6633cdaee9bb823da424cd422efffd2475
-rw-r--r--res/layout/dream_info_row.xml6
-rw-r--r--src/com/android/settings/DreamSettings.java6
2 files changed, 10 insertions, 2 deletions
diff --git a/res/layout/dream_info_row.xml b/res/layout/dream_info_row.xml
index acc3a65..e8dd824 100644
--- a/res/layout/dream_info_row.xml
+++ b/res/layout/dream_info_row.xml
@@ -24,6 +24,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/divider"
+ android:clickable="true"
+ android:focusable="true"
android:background="?android:attr/selectableItemBackground" >
<!-- Dream icon -->
@@ -95,6 +97,8 @@
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/screensaver_settings_button"
android:padding="8dip"
+ android:clickable="true"
+ android:focusable="true"
android:src="@drawable/ic_bt_config" />
-</RelativeLayout> \ No newline at end of file
+</RelativeLayout>
diff --git a/src/com/android/settings/DreamSettings.java b/src/com/android/settings/DreamSettings.java
index 5c9f1cf..1c8f988 100644
--- a/src/com/android/settings/DreamSettings.java
+++ b/src/com/android/settings/DreamSettings.java
@@ -123,6 +123,8 @@ public class DreamSettings extends SettingsPreferenceFragment {
ListView listView = getListView();
+ listView.setItemsCanFocus(true);
+
TextView emptyView = (TextView) getView().findViewById(android.R.id.empty);
emptyView.setText(R.string.screensaver_settings_disabled_prompt);
listView.setEmptyView(emptyView);
@@ -318,6 +320,7 @@ public class DreamSettings extends SettingsPreferenceFragment {
settingsButton.setVisibility(showSettings ? View.VISIBLE : View.INVISIBLE);
settingsButton.setAlpha(dreamInfo.isActive ? 1f : Utils.DISABLED_ALPHA);
settingsButton.setEnabled(dreamInfo.isActive);
+ settingsButton.setFocusable(dreamInfo.isActive);
settingsButton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
@@ -329,7 +332,8 @@ public class DreamSettings extends SettingsPreferenceFragment {
private View createDreamInfoRow(ViewGroup parent) {
final View row = mInflater.inflate(R.layout.dream_info_row, parent, false);
- row.setOnClickListener(new OnClickListener(){
+ final View header = row.findViewById(android.R.id.widget_frame);
+ header.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
v.setPressed(true);