Merge "allow daydream settings to be keyboard driven." into jb-mr2-dev
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 @@
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 @@
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 @@
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);