【Android】2015.08.29 安卓官方文档学习:Day2 Count:2

-----------------------------------------------
Android Official Documents
Day2
Adding the action bar
-----------------------------------------------
Questions:
1. Why change the style , doesn’t work?
Because I have to chang the  property :name = “AppTheme”  to “MyAppTheme"

2.I feel the properties of different parent are so complex, so confusing? Especially the text Appearance
For example: If I want to change the textcolor of action bar menu text , I can use     
< item  name= "android:actionMenuTextColor">@android:color/holo_red_dark</ item>
But if I want to change the the textcolor of action bar title text, I must use:
< item  name= "android:actionBarStyle">@style/MyActionBar</ item>
                  ↓
< style  name= "MyActionBar"  parent= "android:Widget.Holo.Light.ActionBar.Solid.Inverse">
    < item  name= "android:background">@drawable/actionbar_background_blue</ item>
    <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style>
                                             ↓
< style  name= "MyActionBarTitleText"  parent= "android:TextAppearance.Holo.Widget.ActionBar.Title">
    < item  name= "android:textColor">@android:color/holo_green_dark</ item>
</ style>

Why different?

3.Why  paddingTop=“?android:actionBarSize” doesn’t work for display message actvity?

4. What are the differences between the methods?
// Get a string resource from your app's  Resources
String  hello  =   getResources() . getString ( R . string . hello_world );

// Or supply a string resource to a method that requires a string
TextView  textView  =   new   TextView ( this );
textView
. setText ( R . string . hello_world );

5. When an Activity inherits from parent Activity, What properties it inherits?



Points:
1. Reason for there two modes  to set style:
Also notice that this theme includes two definitions for the  windowActionBarOverlay  style: one with the android:  prefix and one without. The one with the  android:  prefix is for versions of Android that include the style in the platform and the one without the prefix is for older versions that read the style from the Support Library.

2.Portrait vs landscape


3. Support Multiple  
languages:(IOS languages code: http://www.w3schools.com/tags/ref_language_codes.asp )
MyProject/
    res/
       values/
           strings.xml
       values-es/
           strings.xml
       values-fr/
           strings.xml
Screen:( By default, the  layout/main.xml  file is used for portrait orientation.
MyProject/
    res/
        layout/              # default (portrait)
            main.xml
        layout-land/         # landscape
            main.xml
        layout-large/        # large (portrait)
            main.xml
        layout-large-land/   # large landscape
            main.xml
Bitmap:( Note:  Low-density (ldpi) resources aren’t always necessary. When you provide hdpi assets, the system scales them down by one half to properly fit ldpi screens.
MyProject/
    res/
        drawable-xhdpi/   200x200
            awesomeimage.png
        drawable-hdpi/     150x150
            awesomeimage.png
        drawable-mdpi/     100x100
            awesomeimage.png
        drawable-ldpi/     75x75
            awesomeimage.png

4. Activity !!!
Basic Lifecycle: (pyramid)
 
Static States for an extended period time:
Resumed
In this state, the activity is in the foreground and the user can interact with it. (Also sometimes referred to as the "running" state.)
Paused
In this state, the activity is partially obscured by another activity—the other activity that's in the foreground is semi-transparent or doesn't cover the entire screen. The paused activity does not receive user input and cannot execute any code.
Stopped
In this state, the activity is completely hidden and not visible to the user; it is considered to be in the background. While stopped, the activity instance and all its state information such as member variables is retained, but it cannot execute any code.
The other states (Created and Started) are transient and the system quickly moves from them to the next state by calling the next lifecycle callback method. That is, after the system calls  onCreate() , it quickly calls onStart() , which is quickly followed by  onResume() .



Terms:
Holo:整体的
Overplay Mode: 叠加模式

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值