diff options
author | Yorke Lee <yorkelee@google.com> | 2013-08-09 22:34:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-09 22:34:40 +0000 |
commit | 7b3b10b6cb5596b61ae781ef7932c12d6761fc23 (patch) | |
tree | 0f5744982c6e4bf61a04c2959bba143de43c4f17 | |
parent | d121059a49b2a771bb5c25f7dc8fa6ab45242a92 (diff) | |
parent | f420a5344995b2c450379159f679809690bc9880 (diff) |
Merge "Clean up todos in Dialer" into klp-dev
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 13 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemHelper.java | 4 | ||||
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteFragment.java | 23 |
3 files changed, 6 insertions, 34 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 79d8d6977..c9c94fa11 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -81,9 +81,6 @@ import java.util.ArrayList; /** * The dialer tab's title is 'phone', a more common name (see strings.xml). - * - * TODO krelease: All classes currently prefixed with New will replace the original classes or - * be renamed more appropriately before shipping. */ public class DialtactsActivity extends TransactionSafeActivity implements View.OnClickListener, DialpadFragment.OnDialpadQueryChangedListener, PopupMenu.OnMenuItemClickListener, @@ -370,6 +367,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O final PopupMenu popupMenu = new PopupMenu(DialtactsActivity.this, view); final Menu menu = popupMenu.getMenu(); popupMenu.inflate(R.menu.dialtacts_options); + final MenuItem clearFrequents = menu.findItem(R.id.menu_clear_frequents); + clearFrequents.setEnabled(mPhoneFavoriteFragment.hasFrequents()); popupMenu.setOnMenuItemClickListener(this); popupMenu.show(); break; @@ -379,9 +378,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O break; case R.id.call_history_on_dialpad_button: case R.id.call_history_button: - // TODO krelease: This should start an intent with content type - // CallLog.Calls.CONTENT_TYPE, once the intent filters for the call log activity - // is enabled + // Use explicit CallLogActivity intent instead of ACTION_VIEW + + // CONTENT_TYPE, so that we always open our call log from our dialer final Intent intent = new Intent(this, CallLogActivity.class); startActivity(intent); break; @@ -610,9 +608,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * @param intent Intent that contains information about which tab should be selected */ private void displayFragment(Intent intent) { - // TODO krelease: Make navigation via intent work by displaying the correct fragment - // as appropriate. - // If we got here by hitting send and we're in call forward along to the in-call activity boolean recentCallsRequest = Calls.CONTENT_TYPE.equals(intent.resolveType( getContentResolver())); diff --git a/src/com/android/dialer/calllog/CallLogListItemHelper.java b/src/com/android/dialer/calllog/CallLogListItemHelper.java index fdebeb166..23366e469 100644 --- a/src/com/android/dialer/calllog/CallLogListItemHelper.java +++ b/src/com/android/dialer/calllog/CallLogListItemHelper.java @@ -27,10 +27,6 @@ import com.android.dialer.R; /** * Helper class to fill in the views of a call log entry. - * TODO krelease: The only difference between this and the original is that we don't touch - * divider views, which are not present in the new dialer. Once the new dialer replaces - * the old one, we can replace it entirely. Otherwise we would have redundant divider=null - * checks all over the place. */ /* package */class CallLogListItemHelper { /** Helper for populating the details of a phone call. */ diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java index 64a9b84d2..3cff901a5 100644 --- a/src/com/android/dialer/list/PhoneFavoriteFragment.java +++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java @@ -135,7 +135,6 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen private OnListFragmentScrolledListener mActivityScrollListener; private PhoneFavoriteMergedAdapter mAdapter; private PhoneFavoritesTileAdapter mContactTileAdapter; - private PhoneNumberListAdapter mAllContactsAdapter; private CallLogAdapter mCallLogAdapter; private CallLogQueryHandler mCallLogQueryHandler; @@ -161,8 +160,6 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen new ContactTileLoaderListener(); private final ScrollListener mScrollListener = new ScrollListener(); - private boolean mOptionsMenuHasFrequents; - @Override public void onAttach(Activity activity) { if (DEBUG) Log.d(TAG, "onAttach()"); @@ -245,24 +242,8 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen return listLayout; } - - // TODO krelease: update the options menu when displaying the popup menu instead. We could - // possibly get rid of this method entirely. - private boolean isOptionsMenuChanged() { - return mOptionsMenuHasFrequents != hasFrequents(); - } - - // TODO krelease: Configure the menu items properly. Since the menu items show up as a PopupMenu - // rather than a normal actionbar menu, the initialization should be done there. - /* - @Override - public void onPrepareOptionsMenu(Menu menu) { - final MenuItem clearFrequents = menu.findItem(R.id.menu_clear_frequents); - mOptionsMenuHasFrequents = hasFrequents(); - clearFrequents.setVisible(mOptionsMenuHasFrequents); - }*/ - - private boolean hasFrequents() { + public boolean hasFrequents() { + if (mContactTileAdapter == null) return false; return mContactTileAdapter.getNumFrequents() > 0; } |