i have made some changes to your code and it works fine for me
it is not exacly as it was before - but its better then nothing..
(i posted only the methods i changed)

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.save();

        if(mTitleBar != null) {
            final int sy = getScrollY();
            int titleBarOffs = mTitleBar.getHeight() - sy;
            if(titleBarOffs < 0) titleBarOffs = 0;
            canvas.translate(0, titleBarOffs);
        }

        super.onDraw(canvas);
        canvas.restore();
    }

    @Override
    protected boolean drawChild(Canvas canvas, View child, long 
drawingTime) {
        if(child == mTitleBar) {
            mTitleBar.offsetLeftAndRight((int) (getScrollX() - 
mTitleBar.getLeft()));
        }

        return super.drawChild(canvas, child, drawingTime);
    }

On Sunday, July 1, 2012 8:27:17 PM UTC+3, Nobu Games wrote:
>
> I was toying around with the implementation of the embedded title bar 
> view. I attached the source code to this post. The "TitleBarWebView" is 
> tested on Android 2.3 and 4.0.1. I couldn't get my hands on 4.1 yet. The 
> emulator is simply too slow on my development machine and I have yet to 
> find a VirtualBox image for it.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to