Android:Notes: Difference between revisions
From Wiki³
(Created page with "{{DISPLAYTITLE:Android Development Notes}} <div id="tocalign">__TOC__</div> =Hiding the Activity Titlebar= public void onCreate(Bundle savedInstanceState) { //Rem...") |
No edit summary |
||
Line 3: | Line 3: | ||
=Hiding the Activity Titlebar= | =Hiding the Activity Titlebar= | ||
<syntaxhighlight lang="java"> | |||
public void onCreate(Bundle savedInstanceState) { | |||
//Remove title bar | |||
this.requestWindowFeature(Window.FEATURE_NO_TITLE); | |||
//Remove notification bar | |||
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); | |||
//Launch the Main layout | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.main); | |||
} | |||
</syntaxhighlight> | |||
=Image Sizing= | |||
==Icon Sizes== | |||
* Low-density (ldpi): 36x36 | |||
* Medium-density (mdpi): 48x48 | |||
* High-density (hdpi): 72x72 | |||
* Extra high-density (xhdpi): 96x96 | |||
* Recommended Initial Artboard Size: 864x864 | |||
==Icon Naming Convention== | |||
{| class="wikitable" | |||
!Asset Type | |||
!Prefix | |||
!Example | |||
|- | |||
|Icons | |||
|ic_ | |||
|ic_star.png | |||
|- | |||
|Launcher icons | |||
|ic_launcher | |||
|ic_launcher_calendar.png | |||
|- | |||
|Menu icons and Action Bar icons | |||
|ic_menu | |||
|ic_menu_archive.png | |||
|- | |||
|Status bar icons | |||
|ic_stat_notify | |||
|ic_stat_notify_msg.png | |||
|- | |||
|Tab icons | |||
|ic_tab | |||
|ic_tab_recent.png | |||
|- | |||
|Dialog icons | |||
|ic_dialog | |||
|ic_dialog_info.png | |||
|} | |||
[[Category:Android]] | [[Category:Android]] |
Revision as of 14:07, 25 June 2012
Hiding the Activity Titlebar
public void onCreate(Bundle savedInstanceState) {
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//Launch the Main layout
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
Image Sizing
Icon Sizes
- Low-density (ldpi): 36x36
- Medium-density (mdpi): 48x48
- High-density (hdpi): 72x72
- Extra high-density (xhdpi): 96x96
- Recommended Initial Artboard Size: 864x864
Icon Naming Convention
Asset Type | Prefix | Example |
---|---|---|
Icons | ic_ | ic_star.png |
Launcher icons | ic_launcher | ic_launcher_calendar.png |
Menu icons and Action Bar icons | ic_menu | ic_menu_archive.png |
Status bar icons | ic_stat_notify | ic_stat_notify_msg.png |
Tab icons | ic_tab | ic_tab_recent.png |
Dialog icons | ic_dialog | ic_dialog_info.png |