summaryrefslogtreecommitdiff
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/dialer/DialtactsActivity.java18
-rw-r--r--src/com/android/dialer/PhoneCallDetailsHelper.java2
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java11
-rw-r--r--src/com/android/dialer/calllog/PhoneAccountUtils.java2
-rw-r--r--src/com/android/dialer/list/PhoneFavoritesTileAdapter.java3
5 files changed, 31 insertions, 5 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 3c9b870dd..5e6f03597 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -229,6 +229,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
private int mActionBarHeight;
+ /**
+ * The text returned from a voice search query. Set in {@link #onActivityResult} and used in
+ * {@link #onResume()} to populate the search box.
+ */
+ private String mVoiceSearchQuery;
+
private class OptionsPopupMenu extends PopupMenu {
public OptionsPopupMenu(Context context, View anchor) {
super(context, anchor, Gravity.END);
@@ -477,6 +483,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
showDialpadFragment(false);
mShowDialpadOnResume = false;
}
+
+ // If there was a voice query result returned in the {@link #onActivityResult} callback, it
+ // will have been stashed in mVoiceSearchQuery since the search results fragment cannot be
+ // shown until onResume has completed. Active the search UI and set the search term now.
+ if (!TextUtils.isEmpty(mVoiceSearchQuery)) {
+ mActionBarController.onSearchBoxTapped();
+ mSearchView.setText(mVoiceSearchQuery);
+ mVoiceSearchQuery = null;
+ }
+
mFirstLaunch = false;
if (mIsRestarting) {
@@ -618,7 +634,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
RecognizerIntent.EXTRA_RESULTS);
if (matches.size() > 0) {
final String match = matches.get(0);
- mSearchView.setText(match);
+ mVoiceSearchQuery = match;
} else {
Log.e(TAG, "Voice search - nothing heard");
}
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index 2e1651a70..b4e817174 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -115,7 +115,7 @@ public class PhoneCallDetailsHelper {
views.callAccountLabel.setVisibility(View.VISIBLE);
views.callAccountLabel.setText(accountLabel);
int color = PhoneAccountUtils.getAccountColor(mContext, details.accountHandle);
- if (color == PhoneAccount.NO_COLOR) {
+ if (color == PhoneAccount.NO_HIGHLIGHT_COLOR) {
int defaultColor = R.color.dialtacts_secondary_text_color;
views.callAccountLabel.setTextColor(mContext.getResources().getColor(defaultColor));
} else {
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 99bf38615..9528e4507 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -982,7 +982,8 @@ public class CallLogAdapter extends GroupingListAdapter
}
/***
- * Binds click handlers and intents to the voicemail, details and callback action buttons.
+ * Binds text titles, click handlers and intents to the voicemail, details and callback action
+ * buttons.
*
* @param views The call log item views.
*/
@@ -1005,6 +1006,14 @@ public class CallLogAdapter extends GroupingListAdapter
}
views.callBackButtonView.setVisibility(View.VISIBLE);
views.callBackButtonView.setOnClickListener(mActionListener);
+
+ final int titleId;
+ if (views.callType == Calls.VOICEMAIL_TYPE || views.callType == Calls.OUTGOING_TYPE) {
+ titleId = R.string.call_log_action_redial;
+ } else {
+ titleId = R.string.call_log_action_call_back;
+ }
+ views.callBackButtonView.setText(mContext.getString(titleId));
} else {
// Number is not callable, so hide button.
views.callBackButtonView.setTag(null);
diff --git a/src/com/android/dialer/calllog/PhoneAccountUtils.java b/src/com/android/dialer/calllog/PhoneAccountUtils.java
index 2eaf94937..3979a3e5e 100644
--- a/src/com/android/dialer/calllog/PhoneAccountUtils.java
+++ b/src/com/android/dialer/calllog/PhoneAccountUtils.java
@@ -73,7 +73,7 @@ public class PhoneAccountUtils {
*/
public static int getAccountColor(Context context, PhoneAccountHandle accountHandle) {
PhoneAccount account = getAccountOrNull(context, accountHandle);
- return account == null ? PhoneAccount.NO_COLOR : account.getHighlightColor();
+ return account == null ? PhoneAccount.NO_HIGHLIGHT_COLOR : account.getHighlightColor();
}
/**
diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
index 382e42e56..3f670127f 100644
--- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
+++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java
@@ -441,7 +441,8 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements
* @param itemIndex Position of the contact in {@link #mContactEntries}.
*/
private void markDropArea(int itemIndex) {
- if (isIndexInBound(mDragEnteredEntryIndex) && isIndexInBound(itemIndex)) {
+ if (mDraggedEntry != null && isIndexInBound(mDragEnteredEntryIndex) &&
+ isIndexInBound(itemIndex)) {
mDataSetChangedListener.cacheOffsetsForDatasetChange();
// Remove the old placeholder item and place the new placeholder item.
final int oldIndex = mDragEnteredEntryIndex;