diff options
Diffstat (limited to 'src/com/android')
5 files changed, 34 insertions, 12 deletions
diff --git a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java index 7788cbe1b..fa40e2609 100644 --- a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java +++ b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java @@ -109,7 +109,6 @@ public class BlockedNumbersFragment extends ListFragment ColorDrawable backgroundDrawable = new ColorDrawable(getActivity().getColor(R.color.dialer_theme_color)); actionBar.setBackgroundDrawable(backgroundDrawable); - actionBar.setElevation(getResources().getDimensionPixelSize(R.dimen.action_bar_elevation)); actionBar.setDisplayShowCustomEnabled(false); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(true); @@ -138,8 +137,7 @@ public class BlockedNumbersFragment extends ListFragment @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.blocked_number_fragment, container, false); - return view; + return inflater.inflate(R.layout.blocked_number_fragment, container, false); } @Override diff --git a/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java b/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java index f785cf77a..109fd97b5 100644 --- a/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java +++ b/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java @@ -120,7 +120,7 @@ public class ManageBlockedNumbersActivity extends AppCompatActivity @Override public boolean isActionBarShowing() { - return true; + return false; } @Override @@ -135,11 +135,11 @@ public class ManageBlockedNumbersActivity extends AppCompatActivity @Override public int getActionBarHideOffset() { - return getSupportActionBar().getHideOffset(); + return 0; } @Override public int getActionBarHeight() { - return getSupportActionBar().getHeight(); + return 0; } } diff --git a/src/com/android/dialer/filterednumber/ViewNumbersToImportFragment.java b/src/com/android/dialer/filterednumber/ViewNumbersToImportFragment.java index 947dc6793..9912416ec 100644 --- a/src/com/android/dialer/filterednumber/ViewNumbersToImportFragment.java +++ b/src/com/android/dialer/filterednumber/ViewNumbersToImportFragment.java @@ -72,6 +72,10 @@ public class ViewNumbersToImportFragment extends ListFragment ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); actionBar.setTitle(R.string.import_send_to_voicemail_numbers_label); + actionBar.setDisplayShowCustomEnabled(false); + actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setDisplayShowHomeEnabled(true); + actionBar.setDisplayShowTitleEnabled(true); getActivity().findViewById(R.id.cancel_button).setOnClickListener(this); getActivity().findViewById(R.id.import_button).setOnClickListener(this); diff --git a/src/com/android/dialer/list/BlockedListSearchFragment.java b/src/com/android/dialer/list/BlockedListSearchFragment.java index 6ff7dda3b..d1490f5a4 100644 --- a/src/com/android/dialer/list/BlockedListSearchFragment.java +++ b/src/com/android/dialer/list/BlockedListSearchFragment.java @@ -19,6 +19,7 @@ import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.text.Editable; +import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.util.TypedValue; @@ -41,9 +42,12 @@ public class BlockedListSearchFragment extends RegularSearchFragment implements FilterNumberDialogFragment.Callback { private static final String TAG = BlockedListSearchFragment.class.getSimpleName(); + private static final String KEY_SEARCH_QUERY = "search_query"; + private FilteredNumberAsyncQueryHandler mFilteredNumberAsyncQueryHandler; private EditText mSearchView; + private String mSearchQuery; private final TextWatcher mPhoneSearchQueryTextListener = new TextWatcher() { @Override @@ -52,7 +56,8 @@ public class BlockedListSearchFragment extends RegularSearchFragment @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - setQueryString(s.toString(), false); + mSearchQuery = s.toString(); + setQueryString(mSearchQuery, false); } @Override @@ -72,7 +77,6 @@ public class BlockedListSearchFragment extends RegularSearchFragment } }; - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -82,6 +86,9 @@ public class BlockedListSearchFragment extends RegularSearchFragment mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler( getContext().getContentResolver()); + if (savedInstanceState != null) { + mSearchQuery = savedInstanceState.getString(KEY_SEARCH_QUERY); + } } @Override @@ -90,8 +97,6 @@ public class BlockedListSearchFragment extends RegularSearchFragment ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); actionBar.setCustomView(R.layout.search_edittext); - actionBar.setBackgroundDrawable(null); - actionBar.setElevation(0); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowHomeEnabled(false); @@ -100,21 +105,36 @@ public class BlockedListSearchFragment extends RegularSearchFragment .getCustomView().findViewById(R.id.search_view_container); searchEditTextLayout.expand(false, true); searchEditTextLayout.setCallback(mSearchLayoutCallback); + searchEditTextLayout.setBackgroundDrawable(null); mSearchView = (EditText) searchEditTextLayout.findViewById(R.id.search_view); mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener); mSearchView.setHint(R.string.block_number_search_hint); + searchEditTextLayout.findViewById(R.id.search_box_expanded) + .setBackgroundColor(getContext().getResources().getColor(android.R.color.white)); + + if (!TextUtils.isEmpty(mSearchQuery)) { + mSearchView.setText(mSearchQuery); + } + // TODO: Don't set custom text size; use default search text size. mSearchView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.blocked_number_search_text_size)); } @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(KEY_SEARCH_QUERY, getAdapter().getQueryString()); + } + + @Override protected ContactEntryListAdapter createListAdapter() { BlockedListSearchAdapter adapter = new BlockedListSearchAdapter(getActivity()); adapter.setDisplayPhotos(true); adapter.setUseCallableUri(usesCallableUri()); + adapter.setQueryString(mSearchQuery); return adapter; } @@ -183,7 +203,8 @@ public class BlockedListSearchFragment extends RegularSearchFragment if (activity == null) { return; } - activity.onBackPressed(); + + activity.showManagementUi(); } @Override diff --git a/src/com/android/dialer/widget/SearchEditTextLayout.java b/src/com/android/dialer/widget/SearchEditTextLayout.java index 544749f33..4f100dc44 100644 --- a/src/com/android/dialer/widget/SearchEditTextLayout.java +++ b/src/com/android/dialer/widget/SearchEditTextLayout.java @@ -230,7 +230,6 @@ public class SearchEditTextLayout extends FrameLayout { setElevation(0); setPaddingRelative(paddingStart, paddingTop, paddingEnd, paddingBottom); - setElevation(0); if (requestFocus) { mSearchView.requestFocus(); } |