background preloader

5 Android Material Design Tutorial 01~05 /39

Facebook Twitter

Color - Style - Google design guidelines. ActionBar. Public void setHomeButtonEnabled (boolean enabled) ActionBar. Public abstract void setDisplayHomeAsUpEnabled (boolean showHomeAsUp) NavUtils. Public static void navigateUpFromSameTask (Activity sourceActivity) Toolbar. Class Overview A standard toolbar for use within application content.


Toolbar supports a more focused feature set than ActionBar. From start to end, a toolbar may contain a combination of the following optional elements: A navigation button. This may be an Up arrow, navigation menu toggle, close, collapse, done or another glyph of the app's choosing. In modern Android UIs developers should lean more on a visually distinct color scheme for toolbars than on their application icon. Summary Public Constructors Public Methods public void collapseActionView () Collapse a currently expanded action view.

An action view may be expanded either directly from the MenuItem it belongs to or by user action. public void dismissPopupMenus () Dismiss all currently showing popup menus, including overflow or submenus. public Toolbar.LayoutParams generateLayoutParams (AttributeSet attrs) Returns a new set of layout parameters based on the supplied attributes set. Parameters public int getContentInsetEnd () Returns. Metrics & keylines - Layout - Google design guidelines. The minimum touch target size is 48dp.

Metrics & keylines - Layout - Google design guidelines

Keep this in mind when spacing icons (24dp) or avatars (40dp) in a layout. The touch targets shouldn’t overlap. On average, 48dp translates to a physical size of about 9mm (with some variability). This is comfortably in the range of recommended target sizes (7-10mm) for touchscreen objects and ensures that users will be able to reliably and accurately target them with their fingers. If you design your elements to be at least 48dp high and wide, you can ensure that: Your targets will never be smaller than the minimum recommended target size of 7mm regardless of the screen on which they are displayed.You strike a good compromise between overall information density and targetability of UI elements on the other.

Using the Material Theme. The new material theme provides: System widgets that let you set their color palette Touch feedback animations for the system widgets Activity transition animations You can customize the look of the material theme according to your brand identity with a color palette you control.

Using the Material Theme

You can tint the action bar and the status bar using theme attributes, as shown in Figure 3. The system widgets have a new design and touch feedback animations. You can customize the color palette, the touch feedback animations, and the activity transitions for your app. The material theme is defined as: @android:style/Theme.Material (dark version) @android:style/Theme.Material.Light (light version) @android:style/Theme.Material.Light.DarkActionBar For a list of material styles that you can use, see the API reference for Structure - Layout - Google design guidelines. The top level communicates your app’s capabilities by introducing the user to the major functional areas.

Structure - Layout - Google design guidelines

Some apps will be very focused and have modest navigation needs. In other apps, the top level will consist of multiple views, and you'll want to make sure that the user can navigate between them efficiently. Select the approach that best matches your app's navigation needs. Focus on a single view with embedded navigation. By putting all the necessary navigation directly inline with other app content, you make it extremely visible to the user. Use in-context navigation if: Your app has a strong primary view, and no or few alternate ones.Your users can complete the most common tasks easily within the main view.You expect users will use your app very infrequently and will appreciate well-exposed paths.

Use tabs to switch between a small number of equally important views.