Remove ad code.
Change-Id: I10fb58fd7d4c7e3a51dbf515b0d2df801502648e
diff --git a/res/menu/ad_actions.xml b/res/menu/ad_actions.xml
deleted file mode 100644
index 7f4c542..0000000
--- a/res/menu/ad_actions.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright (C) 2013 Google Inc.
- Licensed to 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.
- -->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@+id/star"
- android:showAsAction="always"
- android:title="@string/add_star"
- android:icon="@drawable/ic_star_off_convo_view_holo_light" />
-
- <item android:id="@+id/remove_star"
- android:showAsAction="always"
- android:title="@string/remove_star"
- android:icon="@drawable/ic_star_on_convo_view_holo_light" />
-
- <item android:id="@+id/delete"
- android:showAsAction="always"
- android:title="@string/delete"
- android:icon="@drawable/ic_menu_trash_holo_light"/>
-
- <item android:id="@+id/forward"
- android:showAsAction="always"
- android:title="@string/forward"
- android:icon="@drawable/ic_forward_holo_light" />
-
- <!-- Always available -->
- <item android:id="@+id/settings"
- android:showAsAction="never"
- android:title="@string/menu_settings" />
-
- <!-- Always available -->
- <item android:id="@+id/feedback_menu_item"
- android:showAsAction="never"
- android:title="@string/feedback" />
-
- <!-- Always available -->
- <item android:id="@+id/help_info_menu_item"
- android:showAsAction="never"
- android:title="@string/help_and_info" />
-</menu>
\ No newline at end of file
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index c25d1d2..9aadf87 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -1290,6 +1290,9 @@
@Override
public final boolean onCreateOptionsMenu(Menu menu) {
+ if (mViewMode.isAdMode()) {
+ return false;
+ }
final MenuInflater inflater = mActivity.getMenuInflater();
inflater.inflate(mActionBarView.getOptionsMenuId(), menu);
mActionBarView.onCreateOptionsMenu(menu);
@@ -1313,10 +1316,6 @@
return true;
}
- if (mActivity.getViewMode().isAdMode()) {
- return onAdOptionsItemSelected(item);
- }
-
final int id = item.getItemId();
LogUtils.d(LOG_TAG, "AbstractController.onOptionsItemSelected(%d) called.", id);
boolean handled = true;
@@ -1417,31 +1416,6 @@
return handled;
}
- private boolean onAdOptionsItemSelected(MenuItem item) {
- final int id = item.getItemId();
- if (id == android.R.id.home) {
- onUpPressed();
- } else if (id == R.id.star) {
-
- } else if (id == R.id.remove_star) {
-
- } else if (id == R.id.forward) {
-
- } else if (id == R.id.delete) {
-
- } else if (id == R.id.settings) {
- Utils.showSettings(mActivity.getActivityContext(), mAccount);
- } else if (id == R.id.help_info_menu_item) {
- Utils.showHelp(mActivity.getActivityContext(), mAccount, getHelpContext());
- } else if (id == R.id.feedback_menu_item) {
- Utils.sendFeedback(mActivity, mAccount, false);
- } else {
- return false;
- }
-
- return true;
- }
-
/**
* Opens an {@link EmptyFolderDialogFragment} for the current folder.
*/
@@ -2095,10 +2069,6 @@
setCurrentConversation(null);
}
- if (!ViewMode.isAdMode(newMode)) {
- setCurrentStarrable(null);
- }
-
// If the viewmode is not set, preserve existing icon.
if (newMode != ViewMode.UNKNOWN) {
resetActionBarIcon();
@@ -2493,11 +2463,6 @@
}
}
- @Override
- public void setCurrentStarrable(Starrable starrable) {
- mActionBarView.setCurrentStarrable(starrable);
- }
-
/**
* {@link LoaderManager} currently has a bug in
* {@link LoaderManager#restartLoader(int, Bundle, android.app.LoaderManager.LoaderCallbacks)}
diff --git a/src/com/android/mail/ui/ConversationListCallbacks.java b/src/com/android/mail/ui/ConversationListCallbacks.java
index 09a354b..370a265 100644
--- a/src/com/android/mail/ui/ConversationListCallbacks.java
+++ b/src/com/android/mail/ui/ConversationListCallbacks.java
@@ -47,7 +47,6 @@
Conversation getCurrentConversation();
void setCurrentConversation(Conversation c);
- void setCurrentStarrable(Starrable starrable);
/**
* Returns whether the initial conversation has begun but not finished loading. If this returns
diff --git a/src/com/android/mail/ui/MailActionBarView.java b/src/com/android/mail/ui/MailActionBarView.java
index 73ef8dc..c952010 100644
--- a/src/com/android/mail/ui/MailActionBarView.java
+++ b/src/com/android/mail/ui/MailActionBarView.java
@@ -106,8 +106,6 @@
private FolderObserver mFolderObserver;
- private Starrable mCurrentStarrable;
-
/** A handler that changes the subtitle when it receives a message. */
private final class SubtitleHandler extends Handler {
/** Message sent to display the account email address in the subtitle. */
@@ -261,8 +259,6 @@
return R.menu.conversation_actions;
case ViewMode.WAITING_FOR_ACCOUNT_INITIALIZATION:
return R.menu.wait_mode_actions;
- case ViewMode.AD:
- return R.menu.ad_actions;
}
LogUtils.wtf(LOG_TAG, "Menu requested for unknown view mode");
return R.menu.conversation_list_menu;
@@ -424,11 +420,6 @@
Utils.setMenuItemVisibility(menu, R.id.compose, false);
Utils.setMenuItemVisibility(menu, R.id.search, false);
break;
- case ViewMode.AD:
- final boolean isStarred = mCurrentStarrable.isStarred();
- Utils.setMenuItemVisibility(menu, R.id.star, !isStarred);
- Utils.setMenuItemVisibility(menu, R.id.remove_star, isStarred);
- break;
}
return false;
@@ -793,10 +784,6 @@
mCurrentConversation = conversation;
}
- public void setCurrentStarrable(Starrable starrable) {
- mCurrentStarrable = starrable;
- }
-
//We need to do this here instead of in the fragment
public void setConversationModeOptions(Menu menu) {
if (mCurrentConversation == null) {
diff --git a/src/com/android/mail/ui/Starrable.java b/src/com/android/mail/ui/Starrable.java
deleted file mode 100644
index 34fc569..0000000
--- a/src/com/android/mail/ui/Starrable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc.
- * Licensed to 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.mail.ui;
-
-/**
- * Interface for data types that can be starred for use in {@link MailActionBarView}.
- */
-public interface Starrable {
- public boolean isStarred();
-}
diff --git a/src/com/android/mail/ui/UpOrBackController.java b/src/com/android/mail/ui/UpOrBackController.java
index 1b1989e..34d9e30 100644
--- a/src/com/android/mail/ui/UpOrBackController.java
+++ b/src/com/android/mail/ui/UpOrBackController.java
@@ -9,5 +9,4 @@
void addUpOrBackHandler(UpOrBackHandler handler);
void removeUpOrBackHandler(UpOrBackHandler handler);
-
}