1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php 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 17 package com.android.ide.eclipse.adt.internal.assetstudio; 18 19 /** 20 * The type of asset to create: launcher icon, menu icon, etc. 21 */ 22 public enum AssetType { 23 /** Launcher icon to be shown in the application list */ 24 LAUNCHER("Launcher Icons", "ic_launcher"), //$NON-NLS-2$ 25 26 /** Icons shown in the action bar */ 27 ACTIONBAR("Action Bar and Tab Icons (Android 3.0+)", "ic_action_%s"), //$NON-NLS-2$ 28 29 /** Icons shown in a notification message */ 30 NOTIFICATION("Notification Icons", "ic_stat_%s"), //$NON-NLS-2$ 31 32 /** Icons shown as part of tabs */ 33 TAB("Pre-Android 3.0 Tab Icons", "ic_tab_%s"), //$NON-NLS-2$ 34 35 /** Icons shown in menus */ 36 MENU("Pre-Android 3.0 Menu Icons", "ic_menu_%s"); //$NON-NLS-2$ 37 38 /** Display name to show to the user in the asset type selection list */ 39 private final String mDisplayName; 40 41 /** Default asset name format */ 42 private String mDefaultNameFormat; 43 AssetType(String displayName, String defaultNameFormat)44 AssetType(String displayName, String defaultNameFormat) { 45 mDisplayName = displayName; 46 mDefaultNameFormat = defaultNameFormat; 47 } 48 49 /** 50 * Returns the display name of this asset type to show to the user in the 51 * asset wizard selection page etc 52 */ getDisplayName()53 String getDisplayName() { 54 return mDisplayName; 55 } 56 57 /** 58 * Returns the default format to use to suggest a name for the asset 59 */ getDefaultNameFormat()60 String getDefaultNameFormat() { 61 return mDefaultNameFormat; 62 } 63 64 /** Whether this asset type configures foreground scaling */ needsForegroundScaling()65 boolean needsForegroundScaling() { 66 return this == LAUNCHER; 67 } 68 69 /** Whether this asset type needs a shape parameter */ needsShape()70 boolean needsShape() { 71 return this == LAUNCHER; 72 } 73 74 /** Whether this asset type needs foreground and background color parameters */ needsColors()75 boolean needsColors() { 76 return this == LAUNCHER; 77 } 78 79 /** Whether this asset type needs an effects parameter */ needsEffects()80 boolean needsEffects() { 81 return this == LAUNCHER; 82 } 83 84 /** Whether this asset type needs a theme parameter */ needsTheme()85 boolean needsTheme() { 86 return this == ACTIONBAR; 87 } 88 } 89