1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.mail.drawer; 18 19import com.android.mail.R; 20import com.android.mail.analytics.Analytics; 21import com.android.mail.providers.Account; 22import com.android.mail.ui.ControllableActivity; 23import com.android.mail.ui.FolderListFragment; 24import com.android.mail.utils.FolderUri; 25import com.android.mail.utils.Utils; 26 27class SettingsItem extends FooterItem { 28 SettingsItem(ControllableActivity activity, Account account, 29 FolderListFragment.DrawerStateListener drawerListener) { 30 super(activity, account, drawerListener, 31 R.drawable.ic_drawer_settings_24dp, R.string.menu_settings); 32 } 33 34 @Override 35 public void onFooterClicked() { 36 Analytics.getInstance().sendMenuItemEvent(Analytics.EVENT_CATEGORY_MENU_ITEM, 37 R.id.settings, getEventLabel(), 0); 38 Utils.showSettings(mActivity.getActivityContext(), mAccount); 39 } 40 41 @Override 42 public int getType() { 43 return VIEW_FOOTER_SETTINGS; 44 } 45 46 @Override 47 public boolean isHighlighted(FolderUri currentFolder, int currentType) { 48 return false; 49 } 50 51 @Override 52 public boolean isItemEnabled() { 53 return false; 54 } 55 56 @Override 57 public String toString() { 58 return "[FooterItem VIEW_SETTINGS_ITEM]"; 59 } 60} 61