예제 #1
0
ContentView::ContentView(
    /* [in] */ IContext* context,
    /* [in] */ ContentViewCore* cvc)
{
    assert(0);
#if 0
    super(context, NULL, android::R::attr::webViewStyle);

    if (GetScrollBarStyle() == IView::SCROLLBARS_INSIDE_OVERLAY) {
        SetHorizontalScrollBarEnabled(FALSE);
        SetVerticalScrollBarEnabled(FALSE);
    }

    SetFocusable(TRUE);
    SetFocusableInTouchMode(TRUE);

    mContentViewCore = cvc;
#endif
}
예제 #2
0
ECode CCandidateView::constructor(
    /* [in] */ IContext * context)
{
    FAIL_RETURN(View::constructor(context));
    AutoPtr<IResources> r;
    FAIL_RETURN(context->GetResources((IResources**)&r));
    r->GetDrawable(R::drawable::list_selector_background,
            (IDrawable**)&mSelectionHighlight);

    AutoPtr< ArrayOf<Int32> > states = ArrayOf<Int32>::Alloc(4);
    (*states)[0] = R::attr::state_enabled;
    (*states)[1] = R::attr::state_focused;
    (*states)[2] = R::attr::state_window_focused;
    (*states)[3] = R::attr::state_pressed;
    Boolean temp = FALSE;
    mSelectionHighlight->SetState(states, &temp);

    Int32 color = 0;
    r->GetColor(0x7f050003 /*R.color.candidate_background*/, &color);
    SetBackgroundColor(color);

    r->GetColor(0x7f050000 /*R.color.candidate_normal*/, &mColorNormal);
    r->GetColor(0x7f050001 /*R.color.candidate_recommended*/, &mColorRecommended);
    r->GetColor(0x7f050002 /*R.color.candidate_other*/, &mColorOther);
    r->GetDimensionPixelSize(0x7f060002 /*R.dimen.candidate_vertical_padding*/, &mVerticalPadding);

    CPaint::New((IPaint**)&mPaint);
    mPaint->SetColor(mColorNormal);
    mPaint->SetAntiAlias(TRUE);
    Int32 tmp = 0;
    r->GetDimensionPixelSize(0x7f060001 /*R.dimen.candidate_font_height*/, &tmp);
    mPaint->SetTextSize(tmp);
    mPaint->SetStrokeWidth(0);

    //mGestureDetector = new GestureDetector(NULL, new SelfSimpleOnGestureListener(this));
    SetHorizontalFadingEdgeEnabled(TRUE);
    SetWillNotDraw(FALSE);
    SetHorizontalScrollBarEnabled(FALSE);
    SetVerticalScrollBarEnabled(FALSE);
    return NOERROR;
}