diff options
author | Andrew Lee <anwlee@google.com> | 2015-10-04 01:31:28 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-10-07 15:39:57 -0700 |
commit | 3663afe2e1afb109e117e5b707e8ed9547ed2103 (patch) | |
tree | 0442bd232e46d006912366ff169142aa961d0c16 /src/com/android/dialer/filterednumber/BlockedNumberFragment.java | |
parent | 41bf2e4c8c9793d2f218ce1d1835bfa957ba53e4 (diff) |
Combine blocked number fragments into Activity.
Mocks indicate that after adding, the user should be returned to
the management UI and the snackbar should be shown there. This is
kind of pain to do across fragments in different activities. To
help address this, make one Activity the parent of both the blocked
number manage and add/search UI. This also makes sense in terms of
logical organization.
Bug: 24134038
Change-Id: I682342a73c964a5d4eb90469f10d6584b85400f1
Diffstat (limited to 'src/com/android/dialer/filterednumber/BlockedNumberFragment.java')
-rw-r--r-- | src/com/android/dialer/filterednumber/BlockedNumberFragment.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/dialer/filterednumber/BlockedNumberFragment.java b/src/com/android/dialer/filterednumber/BlockedNumberFragment.java index 79e5861dc..e12fd6b38 100644 --- a/src/com/android/dialer/filterednumber/BlockedNumberFragment.java +++ b/src/com/android/dialer/filterednumber/BlockedNumberFragment.java @@ -27,7 +27,6 @@ import android.view.View; 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 @@ public class BlockedNumberFragment extends ListFragment implements @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 @@ public class BlockedNumberFragment extends ListFragment implements } @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 @@ public class BlockedNumberFragment extends ListFragment implements @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(); + } } } |