diff options
author | Nancy Chen <nancychen@google.com> | 2015-08-13 12:03:47 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2015-08-13 14:30:01 -0700 |
commit | 44898ad0aa2a12788fc9cfc6b78fa7adc9d90f23 (patch) | |
tree | b484d58e0009d6336c83c463440d3ecf95ce5d8f /src/com/android/dialer/DialtactsActivity.java | |
parent | f5250369eb99d5f2b435be845b5bb19a531538bb (diff) |
Convert Dialer activities to AppCompat to support Snackbar.
In order to add an "Undo" snackbar for voicemail, dialer activities need
to inherit from the AppCompat library. Add the relevant libraries to the
make files and change the styles to be compatible.
Bug: 22460745
Change-Id: Ia3cc4002cbd943da818fec67f888d085d53a3b25
Diffstat (limited to 'src/com/android/dialer/DialtactsActivity.java')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index ddb09272d..8b43e5d96 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -16,7 +16,6 @@ package com.android.dialer; -import android.app.ActionBar; import android.app.Fragment; import android.app.FragmentTransaction; import android.content.ActivityNotFoundException; @@ -32,6 +31,7 @@ import android.os.Trace; import android.provider.CallLog.Calls; import android.speech.RecognizerIntent; import android.support.v4.view.ViewPager; +import android.support.v7.app.ActionBar; import android.telecom.PhoneAccount; import android.telecom.TelecomManager; import android.text.Editable; @@ -58,7 +58,6 @@ import android.widget.PopupMenu; import android.widget.TextView; import android.widget.Toast; -import com.android.contacts.common.activity.TransactionSafeActivity; import com.android.contacts.common.dialog.ClearFrequentsDialog; import com.android.contacts.common.interactions.ImportExportDialogFragment; import com.android.contacts.common.interactions.TouchPointManager; @@ -389,7 +388,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O getWindow().setBackgroundDrawable(null); Trace.beginSection(TAG + " setup Views"); - final ActionBar actionBar = getActionBar(); + final ActionBar actionBar = getSupportActionBar(); actionBar.setCustomView(R.layout.search_edittext); actionBar.setDisplayShowCustomEnabled(true); actionBar.setBackgroundDrawable(null); @@ -851,7 +850,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * Sets the hint text for the contacts search box */ private void setSearchBoxHint() { - SearchEditTextLayout searchEditTextLayout = (SearchEditTextLayout) getActionBar() + SearchEditTextLayout searchEditTextLayout = (SearchEditTextLayout) getSupportActionBar() .getCustomView().findViewById(R.id.search_view_container); ((TextView) searchEditTextLayout.findViewById(R.id.search_box_start_search)) .setHint(getSearchBoxHint()); @@ -1342,12 +1341,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public int getActionBarHideOffset() { - return getActionBar().getHideOffset(); + return getSupportActionBar().getHideOffset(); } @Override public void setActionBarHideOffset(int offset) { - getActionBar().setHideOffset(offset); + getSupportActionBar().setHideOffset(offset); } @Override |