Fixed: Make items selectable via track ball
Fixed: Set correct item in display order dialog
Change-Id: I040b33f782224a226a59687e23b0a479f1887c74
diff --git a/res/layout-finger/preference_with_more_button.xml b/res/layout-finger/preference_with_more_button.xml
index 8599cee..93b8d5b 100644
--- a/res/layout-finger/preference_with_more_button.xml
+++ b/res/layout-finger/preference_with_more_button.xml
@@ -23,8 +23,6 @@
android:background="@android:drawable/list_selector_background"
android:orientation="horizontal"
android:gravity="center_vertical"
- android:focusable="true"
- android:clickable="true"
>
<RelativeLayout
diff --git a/src/com/android/contacts/ContactOptionsActivity.java b/src/com/android/contacts/ContactOptionsActivity.java
index f93ddf8..38090aa 100644
--- a/src/com/android/contacts/ContactOptionsActivity.java
+++ b/src/com/android/contacts/ContactOptionsActivity.java
@@ -63,6 +63,7 @@
setContentView(R.layout.contact_options);
View ringtoneLayout = findViewById(R.id.ringtone);
+ ringtoneLayout.setFocusable(true);
ringtoneLayout.setOnClickListener(this);
TextView label = (TextView)findViewById(R.id.label);
label.setText(getString(R.string.label_ringtone));
diff --git a/src/com/android/contacts/ui/ContactsPreferencesActivity.java b/src/com/android/contacts/ui/ContactsPreferencesActivity.java
index aa6aa14..d9491be 100644
--- a/src/com/android/contacts/ui/ContactsPreferencesActivity.java
+++ b/src/com/android/contacts/ui/ContactsPreferencesActivity.java
@@ -162,35 +162,23 @@
mSortOrderView = inflater.inflate(R.layout.preference_with_more_button, mList, false);
View preferenceLayout = mSortOrderView.findViewById(R.id.preference);
- preferenceLayout.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
- showDialog(DIALOG_SORT_ORDER);
- }
- });
TextView label = (TextView)preferenceLayout.findViewById(R.id.label);
label.setText(getString(R.string.display_options_sort_list_by));
mSortOrderTextView = (TextView)preferenceLayout.findViewById(R.id.data);
- mList.addHeaderView(mSortOrderView, null, false);
+ mList.addHeaderView(mSortOrderView, null, true);
}
private void addDisplayOrderPreferenceView(LayoutInflater inflater) {
mDisplayOrderView = inflater.inflate(R.layout.preference_with_more_button, mList, false);
View preferenceLayout = mDisplayOrderView.findViewById(R.id.preference);
- preferenceLayout.setOnClickListener(new View.OnClickListener() {
-
- public void onClick(View v) {
- showDialog(DIALOG_DISPLAY_ORDER);
- }
- });
TextView label = (TextView)preferenceLayout.findViewById(R.id.label);
label.setText(getString(R.string.display_options_view_names_as));
mDisplayOrderTextView = (TextView)preferenceLayout.findViewById(R.id.data);
- mList.addHeaderView(mDisplayOrderView, null, false);
+ mList.addHeaderView(mDisplayOrderView, null, true);
}
private void addDivider(LayoutInflater inflater) {
@@ -295,7 +283,8 @@
break;
case DIALOG_DISPLAY_ORDER:
setCheckedItem(dialog,
- mSortOrder == ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY ? 0 : 1);
+ mDisplayOrder == ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY
+ ? 0 : 1);
break;
}
}
@@ -814,11 +803,20 @@
* are usually the global modifier checkboxes.
*/
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- switch (view.getId()) {
- case R.id.header_phones: {
- mDisplayPhones.toggle();
- break;
- }
+ Log.d(TAG, "OnItemClick, position=" + position + ", id=" + id);
+ if (view == mHeaderPhones) {
+ mDisplayPhones.toggle();
+ return;
+ }
+ if (view == mDisplayOrderView) {
+ Log.d(TAG, "Showing Display Order dialog");
+ showDialog(DIALOG_DISPLAY_ORDER);
+ return;
+ }
+ if (view == mSortOrderView) {
+ Log.d(TAG, "Showing Sort Order dialog");
+ showDialog(DIALOG_SORT_ORDER);
+ return;
}
}