On an “hdpi” device with a normal screen size, I understand that 72 x 72 pixel graphics should be used, and otherwise they should follow the Icon Design Rules (which some of the platform’s graphics do not make more interesting). However, when I try to do this by creating my own graphics or copying a graphic file from the Android SDK, the graphic image in the menu is too large, and it forces a text label, that is, a title that should be lower, it will not appear. If I use 48 x 48 pixels graphics “forcibly”, then the size looks good and the text mark may appear, but this does not seem to be the right solution, as the quality of the graphic display is reduced, and the documentation clearly says that you need to use 72 x 72 graphics .
I understand that 9-patch graphics should be used to ensure proper scaling, but not one of the graphic menu symbols in drawable folders is actually a 9-patch, since they do not have 9-patch markers. For these screenshots, I added 9-patch markers to a copy of the Android SDK 10 72 x 72 hdpi ic_menu_share.png platform. (The draw9patch.bat tool unexpectedly changed the colors of the graphics.)
In the following four screenshots, I show nine displayed menu icons that work on my G2, and work on an emulator with G2-like qualities: Android 2.2 API 8 WVGA800 240 dpi. (Both of these devices have “normal” hdpi screen sizes.) Because the graphic menu icon only displays six at a time, there are two screenshots for each device: v1 and v2. After the screenshots, the code components used to create this application are used, as well as a link to the complete project with all the graphic files that I used.
Emulator_2.2_API8_WVGA800-240_v1:

(. , " G2", , "Running Platform", Android, G2. , .)
Emulator_2.2_API8_WVGA800-240_v2:

G2_v1:

G2_v2:

(, , .
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="fubar.guiexamples"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name">
<activity
android:name=".MenuIconConfusion"
android:label="@string/app_name">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
MenuIconConfusion.java:
public class MenuIconConfusion extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_options_menu, menu);
return true;
}
}
main_options_menu.xml v1:
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/g2_platform_with_title"
android:icon="@android:drawable/ic_menu_share"
android:title="G2 Platform" />
<item
android:id="@+id/g2_platform_no_title"
android:icon="@android:drawable/ic_menu_share" />
<item
android:id="@+id/platform_10_auto_selection_with_title"
android:icon="@drawable/ic_menu_share"
android:title="Platform 10 Auto" />
<item
android:id="@+id/platform_10_auto_selection_no_title"
android:icon="@drawable/ic_menu_share" />
<item
android:id="@+id/pixels_auto_selection"
android:icon="@drawable/ic_menu_pixels"
android:title="Pixels" />
</menu>
main_options_menu.xml v2:
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/platform_10_hdpi_72_with_title"
android:icon="@drawable/ic_menu_share_p10_hdpi_72"
android:title="Platform 10 72 Copy" />
<item
android:id="@+id/platform_10_hdpi_72_no_title"
android:icon="@drawable/ic_menu_share_p10_hdpi_72" />
<item
android:id="@+id/platform_10_mdpi_48_with_title"
android:icon="@drawable/ic_menu_share_p10_mdpi_48"
android:title="Platform 10 48 Copy" />
<item
android:id="@+id/platform_10_hdpi_72_9_patch_with_title"
android:icon="@drawable/ic_menu_share_p10_hdpi_72_nine_patch"
android:title="Platform 10 72 9p Copy" />
<item
android:id="@+id/platform_10_hdpi_72_9_patch_no_title"
android:icon="@drawable/ic_menu_share_p10_hdpi_72_nine_patch" />
<item
android:id="@+id/pixels_auto_selection"
android:icon="@drawable/ic_menu_pixels"
android:title="Pixels" />
</menu>
:
, , android: drawable, , .
- - , , , .
" 10 48 " 48- 48- , -mdpi Android SDK.
- . , .
"72" , , drawable-hdpi , . drawable-hdmi, "48".
:
, , . 72 x 72 drawable-hdpi, , . ...
: " , ?"
: " , , ?"
: ", , ? ?"
Android , , https://sites.google.com/site/androidguiexamples/home/downloads/MenuIconConfusion.zip