顯示具有 ui 標籤的文章。 顯示所有文章
顯示具有 ui 標籤的文章。 顯示所有文章

2013年5月5日 星期日

[Android] Screen Size Notes






  • xlarge screens are at least 960dp x 720dp
  • large screens are at least 640dp x 480dp
  • normal screens are at least 470dp x 320dp
  • small screens are at least 426dp x 320dp
Screen characteristic Qualifier Description
Size small Resources for small size screens.
normal Resources for normal size screens. (This is the baseline size.)
large Resources for large size screens.
xlarge Resources for extra large size screens.
Density ldpi Resources for low-density (ldpi) screens (~120dpi).
mdpi Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi Resources for high-density (hdpi) screens (~240dpi).
xhdpi Resources for extra high-density (xhdpi) screens (~320dpi).
nodpi Resources for all densities. These are density-independent resources. The system does not scale resources tagged with this qualifier, regardless of the current screen's density.
tvdpi Resources for screens somewhere between mdpi and hdpi; approximately 213dpi. This is not considered a "primary" density group. It is mostly intended for televisions and most apps shouldn't need it—providing mdpi and hdpi resources is sufficient for most apps and the system will scale them as appropriate. If you find it necessary to provide tvdpi resources, you should size them at a factor of 1.33*mdpi. For example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.
Orientation land Resources for screens in the landscape orientation (wide aspect ratio).
port Resources for screens in the portrait orientation (tall aspect ratio).
Aspect ratio long Resources for screens that have a significantly taller or wider aspect ratio (when in portrait or landscape orientation, respectively) than the baseline screen configuration.
notlong Resources for use screens that have an aspect ratio that is similar to the baseline screen configuration.





Screen Resolution Names


http://tekeye.biz/2012/screen-resolution-names

2013年4月13日 星期六

[Android] TableLayout 的使用法

目前最喜歡用 TableLayout, 不過, 直覺使用時有些並不符合我的期待, 因此研究一下這個Layout 使用法。 分為兩部份, 第一部份是 Android Reference 裡的內容, 第二部份是 Api Demo 裡的實作。

Android Reference :  TableLayout

HightLight Principles

1 .  Table 有 row & column 。  column 可以 Span (像 HTML  )
2.  Column 寬度的定義是 - 所有 row 裡有著最寬的cell的那個column 的寬度。
3. Table 總寬度就是他的 container 的寬度, Table 的 children 寬度必須是MATCH_PARENT, 但高度可以是其它, 像 TableRow default 就是 WRAP_CONTENT

4.  TableLayout 可以設定特定 Column 是 shrinkable 與stretchable (兩者可同時存在)
5.  Shrinkable 就是說 column width 可以減縮到讓 table 放在他的 parent object 裡 (感覺好偉大 www)
6. Stretchable  就是說  column 可以延展自己的寬度把空白填滿
7. 如果要隱藏column 用 Collapse
8. Column - number ,  Cell ( ie. view object)  可以設定 column-number 如果不自訂的化系統會幫忙定   以 increase +1 的方法. Column number 是從 0 開始的
9. 如果你的view object 不放在 Table row 裡, layout會把這個 view 當作一個 row 來看 (span all columns)


ApiDemo 解析 : 


Api TableLayout Demo 06. More spanning and stretchable (學習  Column Number / Stretch  )


2013年4月7日 星期日

[Android] Menu icon 製作

Android Menu icon 製作規則整理 

整理  Icon Design Guidelines

Highlight : 

1. Greyscales and flat-front  and PNG format

2. 版本 variant 

2.1 Android 3.0 以後要參考 Action Bar Icons 因為3.0 以後Action Bar取代了Menu
   2.1.1 PNG transparent no background 
   2.1.2 Size
          xhdpi 48x48  hdpi 36x36           mdpi 24x24           ldpi  18x18
   2.1.3 For 2 android theme
   2.1.3.1  Holo Light
   Color Fill :  #333333, 60% opacity
   Inner Content : Inner content should subtract from the outer shape and consist purely of transparent pixels.