WM = (WindowManager) getsystemservice (Context.window_service);
Displaymetrics dm = new Displaymetrics ();
Wm.getdefaultdisplay (). Getmetrics (DM); Put some information about the current window in the Displaymetrics class
float density = dm.density; Density px = DP * Density dp/px = density
int dpi = dm.densitydpi;
width = dm.widthpixels;
Height = dm.heightpixels;
PX = DP * Density dp/px = density
Focus: Android:focusable= "True" does not change Android:focusableintouchmode keyboard
Android:focusable= "false" will make android:focusableintouchmode= "false"
Android:focusableintouchmode= "false" does not affect android:focusable for touch screen
Android:focusableintouchmode= "true", it must be android:focusable= "true"
Font
English fonts use Roboto, Chinese fonts use Noto. Noto has 7 types of characters: Thin, light, Demilight, Regular, Medium, Bold and Black.
Text layout
Common Font Size:
12SP Small Print Tips
14SP (desktop 13SP) Body/Button text
16SP (desktop side 15sp) Small title
20SP AppBar Text
24SP Big Title
34SP/45SP/56SP/112SP Extra-Large text
The length of the text, each line suggested 60 characters (English) about. Short text, suggest about 30 characters per line (English).
Layout
All operable elements min. Click area Size: 48DP X 48DP.
The minimum unit for a grid system is 8DP, and all distances and dimensions should be multiples of 8DP. Here are some common dimensions and distances:
Top status bar Height: 24DP
AppBar min. Height: 56DP
Bottom navigation bar Height: 48DP
Suspension button Size: 56X56DP/40X40DP
User picture size: 64X64DP/40X40DP
Small icon Click Area: 48X48DP
Side drawer distance to the right of the screen: 56DP
Card pitch: 8DP
Separator line up and down white: 8DP
White space for most elements: 16DP
Screen left to baseline line: 16DP
Text left to baseline line: 72DP
tab is used only to show different types of content and cannot be used as a navigation menu. tab at least 2 items, up to 6 items.
The underline height of the tab check is 2DP
Android Interface Design