'eclair'에 해당되는 글 2건

  1. 2009.12.14 [Android-Eclair] Using exact size of Views
  2. 2009.12.03 [Android-Ecliar][Tips] build Android..

[Android-Eclair] Using exact size of Views

Domain/Android 2009.12.14 15:11

[[ blog 이사 과정에서 정확한 posting날짜가 분실됨. 년도와 분기 정도는 맞지 않을까? ]]

On Android, usually developer just set parameter of layout (LayoutParams.FILL_PARENT ... etc) for compatibility.

Then, when the exact size of each view is determined? The size of each View is decided when "onLayout()" is called.

The problem is, sometimes we need to know exact size of some Views and do something with this.
In this case, in my opinion, "onWindowFocusChanged()" is quite good place to do this. (in Activity).
At the moment when "onWindowFocusChanged()" is firstly called, all exact size of Views are decided. That is, we can get each View's exact size by calling "getWidth()/getHeigh()". - yes, I know. We need to handle quite many exceptional cases... :-(
But, until now, I cannot find any better place to do this.

Note!
Views added at "onLayout" of ViewGroup, are not drawn in Canvas before layout is re-updated!.

pseudo code)

    class View myView {
        onDraw(...) { // -- (*1)
            ...
        }
    }

    class LinearLayout layout {
        onLayout(...) {
            addView(myView)... // ---(*2)
        }
    }

At (*2), we can know exact size of 'layout'. So we can create myView's instance with layout's exact size, and add it to 'layout'.
In this case, even though (*1) is called, (process stops at (*1) when I set breakpoint.), it is not shown in the LCD screen.
Why? Because, newly added view - henceforth new View - is already excluded in the process of calculating View's exact size. So, layout of this new View is just empty rectangle! So, this cannot be drawn!.
So, all layout(by parameter) in View Tree should be decided, before starting framework's calculating-layout process (recursive calls of each View's 'onLayout()') to determine exact size of each View in View Tree.

신고
tags : Android, eclair, View
Trackback 0 : Comment 0

[Android-Ecliar][Tips] build Android..

Domain/Android 2009.12.03 15:14

[[ blog 이사 과정에서 정확한 posting날짜가 분실됨. 년도와 분기 정도는 맞지 않을까? ]]

* We can refer *.mk in /build/target/product/ to know which Apps. are installed in which product!.

* External WebKit build.
Whole STL is not 100% compatible with ARM, Android uses some STL subset functions of HP - swap, min, max. (see external/webkit/WebKit/android/stl/algorithm). The problem is, if there is standard STL, this conflicts with above function (std::swap). So, if we should use standard STL, we need to modify something about this...

신고
tags : Android, build, eclair, stl
Trackback 0 : Comment 0