The introduction of Android Resource Dimens & Menu

Android Dimmension (Source Google Images)

Just as you specify the string or colors that you can define the dimensions. Typical  Dimensions dimens.xml stored in files in the folder value  (in resources).

Usually already have a file like that and all you have to do is add your additional definitions.

dp or dip – density-independent pixels, an abstract unit based on physical density screens px – pixels (not recommended) you have to put the unit after the value without a space in between. The syntax examples like this.

android:layout_width="140dp"

Android Menu

Android Menu (Source Google Images)

The menu is a user interface component that is common in many types of applications.

Options Menu is the main collection of menu items for the activity. That’s where you have to put actions that have a global impact on the application, such as “Search”, “Compose mail”, and “Settings.”

Menu Context is a floating menu that appears when users perform a long-click on an element. It provides actions that affect the content or context of the selected frame.

Popup Menu displays a list of items in a vertical list that is anchored on the display call up the menu. Note: You must specify the menu and every item in the source XML menu.

Popup Menu displays a list of items in a vertical list that is anchored on the display call up the menu. Note: You must specify the menu and every item in the source XML menu.

To determine the menu, create an XML file in the directory res / menu of your project and make a menu with the following elements:

<menu>
Define menu, which is a container for the menu items. The <menu> must be a root node for a file and can accommodate one or more elements <item> and <group>.

<item>
Make MenuItem, which represents an item in a menu. This element may contain a <menu> nested to create a submenu.

<group>
An optional container and invisible to the <item>. This allows you to categorize menu items so that they share the property as an active status and visibility.

Source: MasterAndroid (App)

Post Author: Study