diff options
Diffstat (limited to 'src')
5 files changed, 44 insertions, 24 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index e716719f4..5ef75dbea 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -43,6 +43,7 @@ import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.LinearLayout; import android.widget.ListView; import android.widget.QuickContactBadge; import android.widget.TextView; @@ -135,6 +136,9 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe private TextView mStatusMessageText; private TextView mStatusMessageAction; private TextView mVoicemailTranscription; + private LinearLayout mVoicemailHeader; + + private Uri mVoicemailUri; /** Whether we should show "edit number before call" in the options menu. */ private boolean mHasEditNumberBeforeCallOption; @@ -239,10 +243,9 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe mPhoneNumberHelper = new PhoneNumberDisplayHelper(mResources); mVoicemailStatusHelper = new VoicemailStatusHelperImpl(); mAsyncQueryHandler = new CallDetailActivityQueryHandler(this); - mStatusMessageView = findViewById(R.id.voicemail_status); - mStatusMessageText = (TextView) findViewById(R.id.voicemail_status_message); - mStatusMessageAction = (TextView) findViewById(R.id.voicemail_status_action); - mVoicemailTranscription = (TextView) findViewById(R.id.voicemail_transcription); + + mVoicemailUri = getIntent().getParcelableExtra(EXTRA_VOICEMAIL_URI); + mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo); mQuickContactBadge.setOverlay(null); mCallerName = (TextView) findViewById(R.id.caller_name); @@ -253,6 +256,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe mProximitySensorManager = new ProximitySensorManager(this, mProximitySensorListener); mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this)); getActionBar().setDisplayHomeAsUpEnabled(true); + optionallyHandleVoicemail(); if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) { closeSystemDialogs(); @@ -269,11 +273,25 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe * Handle voicemail playback or hide voicemail ui. * <p> * If the Intent used to start this Activity contains the suitable extras, then start voicemail - * playback. If it doesn't, then hide the voicemail ui. + * playback. If it doesn't, then don't inflate the voicemail ui. */ private void optionallyHandleVoicemail() { - View voicemailContainer = findViewById(R.id.voicemail_container); + if (hasVoicemail()) { + LayoutInflater inflater = + (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); + mVoicemailHeader = + (LinearLayout) inflater.inflate(R.layout.call_details_voicemail_header, null); + View voicemailContainer = mVoicemailHeader.findViewById(R.id.voicemail_container); + mStatusMessageView = mVoicemailHeader.findViewById(R.id.voicemail_status); + mStatusMessageText = + (TextView) mVoicemailHeader.findViewById(R.id.voicemail_status_message); + mStatusMessageAction = + (TextView) mVoicemailHeader.findViewById(R.id.voicemail_status_action); + mVoicemailTranscription = ( + TextView) mVoicemailHeader.findViewById(R.id.voicemail_transcription); + ListView historyList = (ListView) findViewById(R.id.history); + historyList.addHeaderView(mVoicemailHeader); // Has voicemail: add the voicemail fragment. Add suitable arguments to set the uri // to play and optionally start the playback. // Do a query to fetch the voicemail status messages. @@ -285,7 +303,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe if (playbackFragment == null) { playbackFragment = new VoicemailPlaybackFragment(); Bundle fragmentArguments = new Bundle(); - fragmentArguments.putParcelable(EXTRA_VOICEMAIL_URI, getVoicemailUri()); + fragmentArguments.putParcelable(EXTRA_VOICEMAIL_URI, mVoicemailUri); if (getIntent().getBooleanExtra(EXTRA_VOICEMAIL_START_PLAYBACK, false)) { fragmentArguments.putBoolean(EXTRA_VOICEMAIL_START_PLAYBACK, true); } @@ -296,21 +314,13 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe } voicemailContainer.setVisibility(View.VISIBLE); - mAsyncQueryHandler.startVoicemailStatusQuery(getVoicemailUri()); - markVoicemailAsRead(getVoicemailUri()); - } else { - // No voicemail uri: hide the status view. - mStatusMessageView.setVisibility(View.GONE); - voicemailContainer.setVisibility(View.GONE); + mAsyncQueryHandler.startVoicemailStatusQuery(mVoicemailUri); + markVoicemailAsRead(mVoicemailUri); } } private boolean hasVoicemail() { - return getVoicemailUri() != null; - } - - private Uri getVoicemailUri() { - return getIntent().getParcelableExtra(EXTRA_VOICEMAIL_URI); + return mVoicemailUri != null; } private void markVoicemailAsRead(final Uri voicemailUri) { @@ -480,9 +490,6 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe if (hasVoicemail() && !TextUtils.isEmpty(firstDetails.transcription)) { mVoicemailTranscription.setText(firstDetails.transcription); mVoicemailTranscription.setVisibility(View.VISIBLE); - } else { - mVoicemailTranscription.setText(null); - mVoicemailTranscription.setVisibility(View.GONE); } loadContactPhotos( @@ -720,12 +727,11 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe } public void onMenuTrashVoicemail(MenuItem menuItem) { - final Uri voicemailUri = getVoicemailUri(); mAsyncTaskExecutor.submit(Tasks.DELETE_VOICEMAIL_AND_FINISH, new AsyncTask<Void, Void, Void>() { @Override public Void doInBackground(Void... params) { - getContentResolver().delete(voicemailUri, null, null); + getContentResolver().delete(mVoicemailUri, null, null); return null; } diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 8033909df..cb01e8ef0 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -89,6 +89,7 @@ import com.android.dialer.widget.ActionBarController; import com.android.dialer.widget.SearchEditTextLayout; import com.android.dialer.widget.SearchEditTextLayout.OnBackButtonClickedListener; import com.android.dialerbind.DatabaseHelperManager; +import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.animation.AnimationListenerAdapter; import java.util.ArrayList; @@ -354,6 +355,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O actionBar.setCustomView(R.layout.search_edittext); actionBar.setDisplayShowCustomEnabled(true); actionBar.setBackgroundDrawable(null); + actionBar.setElevation(resources.getDimensionPixelSize(R.dimen.action_bar_elevation)); mActionBarController = new ActionBarController(this, (SearchEditTextLayout) actionBar.getCustomView()); @@ -417,6 +419,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mSlideOut = AnimationUtils.loadAnimation(this, mIsLandscape ? R.anim.dialpad_slide_out_right : R.anim.dialpad_slide_out_bottom); + mSlideIn.setInterpolator(AnimUtils.EASE_IN); + mSlideOut.setInterpolator(AnimUtils.EASE_OUT); + mSlideOut.setAnimationListener(mSlideOutListener); parentLayout = (FrameLayout) findViewById(R.id.dialtacts_mainlayout); @@ -616,6 +621,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } mIsDialpadShown = true; mDialpadFragment.setAnimate(animate); + mDialpadFragment.sendScreenView(); final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.show(mDialpadFragment); @@ -879,7 +885,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } else { transaction.show(fragment); } - // DialtactsActivity will provide the options menu fragment.setHasOptionsMenu(false); fragment.setShowEmptyListForNullQuery(true); diff --git a/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java b/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java index fedd012d9..477aa86a3 100644 --- a/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java +++ b/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java @@ -181,6 +181,7 @@ public class DefaultVoicemailNotifier implements VoicemailNotifier { } else { // Open the call log. contentIntent = new Intent(Intent.ACTION_VIEW, Calls.CONTENT_URI); + contentIntent.putExtra(Calls.EXTRA_CALL_TYPE_FILTER, Calls.VOICEMAIL_TYPE); } notificationBuilder.setContentIntent( PendingIntent.getActivity(mContext, 0, contentIntent, 0)); diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index b214836cf..966d265dd 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -331,6 +331,13 @@ public class ListsFragment extends AnalyticsFragment implements CallLogQueryHand @Override public void onPageSelected(int position) { + if (position == TAB_INDEX_SPEED_DIAL) { + mSpeedDialFragment.sendScreenView(); + } else if (position == TAB_INDEX_RECENTS) { + mRecentsFragment.sendScreenView(); + } else if (position == TAB_INDEX_ALL_CONTACTS) { + mAllContactsFragment.sendScreenView(); + } final int count = mOnPageChangeListeners.size(); for (int i = 0; i < count; i++) { mOnPageChangeListeners.get(i).onPageSelected(position); diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java index 027db8811..d993b237f 100644 --- a/src/com/android/dialer/list/SearchFragment.java +++ b/src/com/android/dialer/list/SearchFragment.java @@ -69,6 +69,7 @@ public class SearchFragment extends PhoneNumberPickerFragment { setDarkTheme(false); setPhotoPosition(ContactListItemView.getDefaultPhotoPosition(false /* opposite */)); setUseCallableUri(true); + sendScreenView(); try { mActivityScrollListener = (OnListFragmentScrolledListener) activity; |