Merge "Combine blocked number fragments into Activity." into ub-contactsdialer-a-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 94333eb..f85f25e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -142,17 +142,17 @@
</activity>
<activity android:name="com.android.dialer.settings.DialerSettingsActivity"
- android:label="@string/dialer_settings_label"
- android:parentActivityName="com.android.dialer.DialtactsActivity"
- android:theme="@style/SettingsStyle"
- android:exported="false">
+ android:label="@string/dialer_settings_label"
+ android:parentActivityName="com.android.dialer.DialtactsActivity"
+ android:theme="@style/SettingsStyle"
+ android:exported="false">
</activity>
- <activity android:name="com.android.dialer.filterednumber.BlockedNumberSearchActivity"
- android:label="@string/dialer_settings_label"
+ <activity android:name="com.android.dialer.filterednumber.ManageBlockedNumbersActivity"
+ android:label="@string/manage_blocked_numbers_label"
android:parentActivityName="com.android.dialer.settings.DialerSettingsActivity"
- android:theme="@style/DialtactsActivityTheme"
- android:windowSoftInputMode="stateVisible">
+ android:theme="@style/ManageBlockedNumbersStyle"
+ android:exported="false">
</activity>
<activity android:name="com.android.dialer.calllog.CallLogActivity"
@@ -162,11 +162,9 @@
</activity>
<activity android:name="com.android.dialer.CallDetailActivity"
- android:label="@string/callDetailTitle"
- android:theme="@style/CallDetailActivityTheme"
- android:icon="@mipmap/ic_launcher_phone"
- android:parentActivityName="com.android.dialer.calllog.CallLogActivity"
- >
+ android:label="@string/callDetailTitle"
+ android:theme="@style/CallDetailActivityTheme"
+ android:icon="@mipmap/ic_launcher_phone">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
diff --git a/res/layout/blocked_number_fragment.xml b/res/layout/blocked_number_fragment.xml
index bbface6..e86ccb5 100644
--- a/res/layout/blocked_number_fragment.xml
+++ b/res/layout/blocked_number_fragment.xml
@@ -16,10 +16,11 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/blocked_number_fragment"
- android:orientation="vertical"
- android:background="@color/blocked_number_background"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingTop="?android:attr/actionBarSize"
+ android:background="@color/blocked_number_background">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
@@ -54,4 +55,4 @@
</android.support.v7.widget.CardView>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/search_activity.xml b/res/layout/blocked_numbers_activity.xml
similarity index 93%
rename from res/layout/search_activity.xml
rename to res/layout/blocked_numbers_activity.xml
index 8feeac2..b5810b7 100644
--- a/res/layout/search_activity.xml
+++ b/res/layout/blocked_numbers_activity.xml
@@ -15,7 +15,7 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/search_activity_container"
+ android:id="@+id/blocked_numbers_activity_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 38e4d0e..b38994b 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -81,7 +81,7 @@
room to the search box-->
<dimen name="action_bar_height">56dp</dimen>
<dimen name="action_bar_height_large">64dp</dimen>
- <dimen name="action_bar_elevation">2dp</dimen>
+ <dimen name="action_bar_elevation">3dp</dimen>
<dimen name="tab_height">43dp</dimen>
<!-- actionbar height + tab height -->
<dimen name="actionbar_and_tab_height">107dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3f4b9e2..a4b64a9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -830,8 +830,8 @@
<!-- Label for the call settings section [CHAR LIMIT=30] -->
<string name="call_settings_label">Calls</string>
- <!-- Label for the blocked calls settings section [CHAR LIMIT=30] -->
- <string name="blocked_calls_settings_label">Spam and blocked calls</string>
+ <!-- Label for the blocked numbers settings section [CHAR LIMIT=30] -->
+ <string name="manage_blocked_numbers_label">Blocked numbers</string>
<!-- Text informing the user they have previously marked contacts to be sent to voicemail.
This will be followed by two buttons, 1) to view who is marked to be sent to voicemail
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 005fd45..f21d62f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -241,6 +241,21 @@
<item name="android:textColorLink">@color/dialtacts_theme_color</item>
</style>
+ <style name="ManageBlockedNumbersStyle" parent="SettingsStyle">
+ <!-- Styles that require AppCompat compatibility, remember to update both sets -->
+ <item name="android:windowActionBarOverlay">true</item>
+ <item name="windowActionBarOverlay">true</item>
+ <item name="android:actionBarStyle">@style/ManageBlockedNumbersActionBarStyle</item>
+ <item name="actionBarStyle">@style/ManageBlockedNumbersActionBarStyle</item>
+ <item name="android:fastScrollTrackDrawable">@null</item>
+ </style>
+
+ <style name="ManageBlockedNumbersActionBarStyle" parent="DialtactsActionBarWithoutTitleStyle">
+ <!-- Styles that require AppCompat compatibility, remember to update both sets -->
+ <item name="android:height">@dimen/action_bar_height</item>
+ <item name="height">@dimen/action_bar_height</item>
+ </style>
+
<!-- Inherit from Theme.Material.Light.Dialog instead of Theme.Material.Light.Dialog.Alert
since the Alert dialog is private. They are identical anyway. -->
<style name="AlertDialogTheme" parent="@android:style/Theme.Material.Light.Dialog">
diff --git a/src/com/android/dialer/filterednumber/BlockedNumberFragment.java b/src/com/android/dialer/filterednumber/BlockedNumberFragment.java
index 79e5861..e12fd6b 100644
--- a/src/com/android/dialer/filterednumber/BlockedNumberFragment.java
+++ b/src/com/android/dialer/filterednumber/BlockedNumberFragment.java
@@ -27,7 +27,6 @@
import android.view.ViewGroup;
import com.android.dialer.R;
-import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
import com.android.dialer.database.FilteredNumberContract;
public class BlockedNumberFragment extends ListFragment implements
@@ -38,12 +37,14 @@
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
+
LayoutInflater inflater = LayoutInflater.from(getContext());
getListView().addHeaderView(inflater.inflate(R.layout.blocked_number_header, null));
if (mAdapter == null) {
mAdapter = new BlockedNumberAdapter(getContext());
}
setListAdapter(mAdapter);
+
getActivity().findViewById(R.id.add_number_button).setOnClickListener(this);
getListView().getEmptyView().findViewById(R.id.add_number_button).setOnClickListener(this);
}
@@ -61,8 +62,8 @@
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
+ public View onCreateView(
+ LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.blocked_number_fragment, container, false);
return view;
}
@@ -95,6 +96,10 @@
@Override
public void onClick(final View v) {
- startActivity(new Intent(getActivity(), BlockedNumberSearchActivity.class));
+ ManageBlockedNumbersActivity manageBlockedNumbersActivity =
+ (ManageBlockedNumbersActivity) getActivity();
+ if (manageBlockedNumbersActivity != null && v.getId() == R.id.add_number_button) {
+ manageBlockedNumbersActivity.enterSearchUi();
+ }
}
}
diff --git a/src/com/android/dialer/filterednumber/BlockedNumberSearchActivity.java b/src/com/android/dialer/filterednumber/BlockedNumberSearchActivity.java
deleted file mode 100644
index cfa404f..0000000
--- a/src/com/android/dialer/filterednumber/BlockedNumberSearchActivity.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.dialer.filterednumber;
-
-import android.app.Fragment;
-import android.app.FragmentTransaction;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatActivity;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.util.Log;
-import android.util.TypedValue;
-import android.widget.EditText;
-import android.widget.FrameLayout;
-import android.widget.FrameLayout.LayoutParams;
-import android.widget.Toast;
-
-import com.android.contacts.common.GeoUtil;
-import com.android.contacts.common.dialog.IndeterminateProgressDialog;
-import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
-import com.android.dialer.R;
-import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
-import com.android.dialer.list.BlockedListSearchAdapter;
-import com.android.dialer.list.OnListFragmentScrolledListener;
-import com.android.dialer.list.BlockedListSearchFragment;
-import com.android.dialer.list.SearchFragment;
-import com.android.dialer.widget.SearchEditTextLayout;
-
-public class BlockedNumberSearchActivity extends AppCompatActivity
- implements SearchFragment.HostInterface {
- private static final String TAG_BLOCKED_SEARCH_FRAGMENT = "blocked_search";
-
- private FilteredNumberAsyncQueryHandler mFilteredNumberAsyncQueryHandler;
- private SearchFragment mSearchFragment;
- private EditText mSearchView;
- private ActionBar mActionBar;
- private String mSearchQuery;
-
- private final TextWatcher mPhoneSearchQueryTextListener = new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- }
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- final String newText = s.toString();
- if (newText.equals(mSearchQuery)) {
- return;
- }
- mSearchQuery = newText;
- mSearchFragment.setQueryString(mSearchQuery, false);
- }
-
- @Override
- public void afterTextChanged(Editable s) {
- }
- };
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mFilteredNumberAsyncQueryHandler =
- new FilteredNumberAsyncQueryHandler(getContentResolver());
-
- setContentView(R.layout.search_activity);
-
- mActionBar = getSupportActionBar();
- mActionBar.setCustomView(R.layout.search_edittext);
- mActionBar.setBackgroundDrawable(null);
- mActionBar.setDisplayShowCustomEnabled(true);
- mActionBar.setDisplayHomeAsUpEnabled(false);
- mActionBar.setDisplayShowHomeEnabled(false);
-
- final SearchEditTextLayout searchEditTextLayout = (SearchEditTextLayout) mActionBar
- .getCustomView().findViewById(R.id.search_view_container);
- searchEditTextLayout.expand(false, true);
- searchEditTextLayout.setCallback(new SearchEditTextLayout.Callback() {
- @Override
- public void onBackButtonClicked() {
- onBackPressed();
- }
-
- @Override
- public void onSearchViewClicked() {
- }
- });
-
- mSearchView = (EditText) searchEditTextLayout.findViewById(R.id.search_view);
- mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener);
- mSearchView.setHint(R.string.block_number_search_hint);
- mSearchView.setTextSize(TypedValue.COMPLEX_UNIT_PX,
- getResources().getDimension(R.dimen.blocked_number_search_text_size));
-
- enterSearchUi();
- }
-
- private void enterSearchUi() {
- if (mSearchFragment != null) {
- return;
- }
- final FragmentTransaction transaction = getFragmentManager().beginTransaction();
- BlockedListSearchFragment fragment = (BlockedListSearchFragment) getFragmentManager()
- .findFragmentByTag(TAG_BLOCKED_SEARCH_FRAGMENT);
- if (fragment == null) {
- fragment = new BlockedListSearchFragment();
- transaction.add(R.id.search_activity_container, fragment, TAG_BLOCKED_SEARCH_FRAGMENT);
- } else {
- transaction.show(fragment);
- }
- fragment.setHasOptionsMenu(false);
- fragment.setShowEmptyListForNullQuery(true);
- fragment.setDirectorySearchEnabled(false);
- transaction.commit();
- }
-
- @Override
- public void onAttachFragment(Fragment fragment) {
- if (fragment instanceof BlockedListSearchFragment) {
- mSearchFragment = (BlockedListSearchFragment) fragment;
- }
- }
-
- @Override
- public boolean isActionBarShowing() {
- return true;
- }
-
- @Override
- public boolean isDialpadShown() {
- return false;
- }
-
- @Override
- public int getDialpadHeight() {
- return 0;
- }
-
- @Override
- public int getActionBarHideOffset() {
- return getSupportActionBar().getHideOffset();
- }
-
- @Override
- public int getActionBarHeight() {
- return getResources().getDimensionPixelSize(R.dimen.action_bar_height_large);
- }
-}
diff --git a/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java b/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java
new file mode 100644
index 0000000..356c55c
--- /dev/null
+++ b/src/com/android/dialer/filterednumber/ManageBlockedNumbersActivity.java
@@ -0,0 +1,240 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.dialer.filterednumber;
+
+import android.app.Fragment;
+import android.app.FragmentTransaction;
+import android.content.Intent;
+import android.graphics.drawable.ColorDrawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.util.TypedValue;
+import android.view.MenuItem;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.FrameLayout.LayoutParams;
+import android.widget.Toast;
+
+import com.android.contacts.common.GeoUtil;
+import com.android.contacts.common.dialog.IndeterminateProgressDialog;
+import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
+import com.android.dialer.R;
+import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
+import com.android.dialer.list.BlockedListSearchAdapter;
+import com.android.dialer.list.OnListFragmentScrolledListener;
+import com.android.dialer.list.BlockedListSearchFragment;
+import com.android.dialer.list.SearchFragment;
+import com.android.dialer.widget.SearchEditTextLayout;
+
+public class ManageBlockedNumbersActivity extends AppCompatActivity
+ implements SearchFragment.HostInterface {
+
+ private static final String TAG_BLOCKED_MANAGEMENT_FRAGMENT = "blocked_management";
+ private static final String TAG_BLOCKED_SEARCH_FRAGMENT = "blocked_search";
+
+ private FilteredNumberAsyncQueryHandler mFilteredNumberAsyncQueryHandler;
+
+ private BlockedNumberFragment mManagementFragment;
+ private SearchFragment mSearchFragment;
+
+ private EditText mSearchView;
+ private ActionBar mActionBar;
+ private String mSearchQuery;
+
+ private boolean mIsShowingManagementUi;
+
+ private final TextWatcher mPhoneSearchQueryTextListener = new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
+ final String newText = s.toString();
+ if (newText.equals(mSearchQuery)) {
+ return;
+ }
+ mSearchQuery = newText;
+ mSearchFragment.setQueryString(mSearchQuery, false);
+ }
+
+ @Override
+ public void afterTextChanged(Editable s) {
+ }
+ };
+
+ private final SearchEditTextLayout.Callback mSearchLayoutCallback =
+ new SearchEditTextLayout.Callback() {
+ @Override
+ public void onBackButtonClicked() {
+ showManagementUi();
+ }
+
+ @Override
+ public void onSearchViewClicked() {
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.blocked_numbers_activity);
+
+ mFilteredNumberAsyncQueryHandler =
+ new FilteredNumberAsyncQueryHandler(getContentResolver());
+
+ showManagementUi();
+ }
+
+ private void showManagementUi() {
+ mIsShowingManagementUi = true;
+
+ showManagementUiActionBar();
+
+ final FragmentTransaction transaction = getFragmentManager().beginTransaction();
+ if (mSearchFragment != null) {
+ transaction.hide(mSearchFragment);
+ }
+
+ BlockedNumberFragment fragment = (BlockedNumberFragment) getFragmentManager()
+ .findFragmentByTag(TAG_BLOCKED_MANAGEMENT_FRAGMENT);
+ if (fragment == null) {
+ fragment = new BlockedNumberFragment();
+ transaction.add(R.id.blocked_numbers_activity_container, fragment,
+ TAG_BLOCKED_MANAGEMENT_FRAGMENT);
+ } else {
+ transaction.show(fragment);
+ }
+ transaction.commit();
+ }
+
+ private void showManagementUiActionBar() {
+ mActionBar = getSupportActionBar();
+ ColorDrawable backgroundDrawable = new ColorDrawable(getColor(R.color.dialer_theme_color));
+ mActionBar.setBackgroundDrawable(backgroundDrawable);
+ mActionBar.setElevation(getResources().getDimensionPixelSize(R.dimen.action_bar_elevation));
+ mActionBar.setDisplayShowCustomEnabled(false);
+ mActionBar.setDisplayHomeAsUpEnabled(true);
+ mActionBar.setDisplayShowHomeEnabled(true);
+ mActionBar.setDisplayShowTitleEnabled(true);
+ mActionBar.setTitle(R.string.manage_blocked_numbers_label);
+ }
+
+ public void enterSearchUi() {
+ mIsShowingManagementUi = false;
+
+ showSearchUiActionBar();
+
+ final FragmentTransaction transaction = getFragmentManager().beginTransaction();
+ if (mManagementFragment != null) {
+ transaction.hide(mManagementFragment);
+ }
+
+ BlockedListSearchFragment fragment = (BlockedListSearchFragment) getFragmentManager()
+ .findFragmentByTag(TAG_BLOCKED_SEARCH_FRAGMENT);
+ if (fragment == null) {
+ fragment = new BlockedListSearchFragment();
+ fragment.setHasOptionsMenu(false);
+ fragment.setShowEmptyListForNullQuery(true);
+ fragment.setDirectorySearchEnabled(false);
+ transaction.add(R.id.blocked_numbers_activity_container, fragment,
+ TAG_BLOCKED_SEARCH_FRAGMENT);
+ } else {
+ transaction.show(fragment);
+ }
+ transaction.commit();
+ }
+
+ private void showSearchUiActionBar() {
+ mActionBar = getSupportActionBar();
+ mActionBar.setCustomView(R.layout.search_edittext);
+ mActionBar.setBackgroundDrawable(null);
+ mActionBar.setElevation(0);
+ mActionBar.setDisplayShowCustomEnabled(true);
+ mActionBar.setDisplayHomeAsUpEnabled(false);
+ mActionBar.setDisplayShowHomeEnabled(false);
+
+ final SearchEditTextLayout searchEditTextLayout = (SearchEditTextLayout) mActionBar
+ .getCustomView().findViewById(R.id.search_view_container);
+ searchEditTextLayout.expand(false, true);
+ searchEditTextLayout.setCallback(mSearchLayoutCallback);
+
+ mSearchView = (EditText) searchEditTextLayout.findViewById(R.id.search_view);
+ mSearchView.addTextChangedListener(mPhoneSearchQueryTextListener);
+ mSearchView.setHint(R.string.block_number_search_hint);
+
+ // 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 onAttachFragment(Fragment fragment) {
+ if (fragment instanceof BlockedNumberFragment) {
+ mManagementFragment = (BlockedNumberFragment) fragment;
+ } else if (fragment instanceof BlockedListSearchFragment) {
+ mSearchFragment = (BlockedListSearchFragment) fragment;
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ onBackPressed();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void onBackPressed() {
+ if (mIsShowingManagementUi) {
+ super.onBackPressed();
+ } else {
+ showManagementUi();
+ }
+ }
+
+ @Override
+ public boolean isActionBarShowing() {
+ return true;
+ }
+
+ @Override
+ public boolean isDialpadShown() {
+ return false;
+ }
+
+ @Override
+ public int getDialpadHeight() {
+ return 0;
+ }
+
+ @Override
+ public int getActionBarHideOffset() {
+ return getSupportActionBar().getHideOffset();
+ }
+
+ @Override
+ public int getActionBarHeight() {
+ return getSupportActionBar().getHeight();
+ }
+}
diff --git a/src/com/android/dialer/list/BlockedListSearchFragment.java b/src/com/android/dialer/list/BlockedListSearchFragment.java
index 6750812..eef24af 100644
--- a/src/com/android/dialer/list/BlockedListSearchFragment.java
+++ b/src/com/android/dialer/list/BlockedListSearchFragment.java
@@ -86,13 +86,9 @@
private void blockNumber(final String number) {
final String countryIso = GeoUtil.getCurrentCountryIso(getContext());
- final IndeterminateProgressDialog progressDialog =
- IndeterminateProgressDialog.show(getFragmentManager(),
- getString(R.string.checkingNumber, number), null, 500);
final String normalizedNumber =
FilteredNumberAsyncQueryHandler.getNormalizedNumber(number, countryIso);
if (normalizedNumber == null) {
- progressDialog.dismiss();
Toast.makeText(getContext(), getString(R.string.invalidNumber, number),
Toast.LENGTH_SHORT).show();
return;
@@ -100,12 +96,11 @@
final OnCheckBlockedListener onCheckListener = new OnCheckBlockedListener() {
@Override
public void onCheckComplete(Integer id) {
- progressDialog.dismiss();
if (id == null) {
final FilterNumberDialogFragment newFragment = FilterNumberDialogFragment
.newInstance(id, normalizedNumber, number, countryIso, number);
newFragment.setParentView(
- getActivity().findViewById(R.id.search_activity_container));
+ getActivity().findViewById(R.id.blocked_numbers_activity_container));
newFragment.show(
getFragmentManager(), FilterNumberDialogFragment.BLOCK_DIALOG_FRAGMENT);
} else {
@@ -118,9 +113,11 @@
onCheckListener, normalizedNumber, number, countryIso);
}
- private void blockContactNumber(final BlockedListSearchAdapter adapter,
- final ContactListItemView view, final String number,
- final Integer blockId) {
+ private void blockContactNumber(
+ final BlockedListSearchAdapter adapter,
+ final ContactListItemView view,
+ final String number,
+ final Integer blockId) {
final String countryIso = GeoUtil.getCurrentCountryIso(getContext());
final String normalizedNumber =
FilteredNumberAsyncQueryHandler.getNormalizedNumber(number, countryIso);
@@ -136,19 +133,8 @@
}
final FilterNumberDialogFragment newFragment = FilterNumberDialogFragment
.newInstance(blockId, normalizedNumber, number, countryIso, number);
- newFragment.setParentView(getActivity().findViewById(R.id.search_activity_container));
- newFragment.setOnUndoBlockListener(new FilterNumberDialogFragment.OnUndoBlockListener() {
- @Override
- public void onUndoBlockComplete() {
- adapter.setViewUnblocked(view);
- }
- });
- newFragment.setOnBlockListener(new FilterNumberDialogFragment.OnBlockListener() {
- @Override
- public void onBlockComplete(Uri uri) {
- adapter.setViewBlocked(view, Long.valueOf(ContentUris.parseId(uri)).intValue());
- }
- });
+ newFragment.setParentView(
+ getActivity().findViewById(R.id.blocked_numbers_activity_container));
newFragment.show(getFragmentManager(), FilterNumberDialogFragment.BLOCK_DIALOG_FRAGMENT);
}
}
diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java
index 1c895d3..c8711e7 100644
--- a/src/com/android/dialer/list/SearchFragment.java
+++ b/src/com/android/dialer/list/SearchFragment.java
@@ -289,12 +289,12 @@
public void updatePosition(boolean animate) {
// Use negative shadow height instead of 0 to account for the 9-patch's shadow.
int startTranslationValue =
- mActivity.isDialpadShown() ? mActionBarHeight - mShadowHeight: -mShadowHeight;
+ mActivity.isDialpadShown() ? mActionBarHeight - mShadowHeight : -mShadowHeight;
int endTranslationValue = 0;
// Prevents ListView from being translated down after a rotation when the ActionBar is up.
if (animate || mActivity.isActionBarShowing()) {
endTranslationValue =
- mActivity.isDialpadShown() ? 0 : mActionBarHeight -mShadowHeight;
+ mActivity.isDialpadShown() ? 0 : mActionBarHeight - mShadowHeight;
}
if (animate) {
// If the dialpad will be shown, then this animation involves sliding the list up.
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java
index 58b0ab8..6fcd221 100644
--- a/src/com/android/dialer/settings/DialerSettingsActivity.java
+++ b/src/com/android/dialer/settings/DialerSettingsActivity.java
@@ -28,7 +28,7 @@
import android.widget.Toast;
import com.android.dialer.R;
-import com.android.dialer.filterednumber.BlockedNumberFragment;
+import com.android.dialer.filterednumber.ManageBlockedNumbersActivity;
import java.util.List;
@@ -87,8 +87,8 @@
}
Header blockedCallsHeader = new Header();
- blockedCallsHeader.titleRes = R.string.blocked_calls_settings_label;
- blockedCallsHeader.fragment = BlockedNumberFragment.class.getName();
+ blockedCallsHeader.titleRes = R.string.manage_blocked_numbers_label;
+ blockedCallsHeader.intent = new Intent(this, ManageBlockedNumbersActivity.class);
target.add(blockedCallsHeader);
if (telephonyManager.isTtyModeSupported()