当前位置: 首页>>代码示例>>C++>>正文


C++ IView::GetViewTreeObserver方法代码示例

本文整理汇总了C++中IView::GetViewTreeObserver方法的典型用法代码示例。如果您正苦于以下问题:C++ IView::GetViewTreeObserver方法的具体用法?C++ IView::GetViewTreeObserver怎么用?C++ IView::GetViewTreeObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IView的用法示例。


在下文中一共展示了IView::GetViewTreeObserver方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TriggerViewsReady

ECode EnterTransitionCoordinator::TriggerViewsReady(
    /* [in] */ IArrayMap* sharedElements) //ArrayMap<String, View>
{
    if (mAreViewsReady) {
        return NOERROR;
    }

    mAreViewsReady = TRUE;
    // Ensure the views have been laid out before capturing the views -- we need the epicenter.
    Boolean isEmpty;
    sharedElements->IsEmpty(&isEmpty);
    if (isEmpty) {
        ViewsReady(sharedElements);
        return NOERROR;
    }

    AutoPtr<IInterface> obj;
    sharedElements->Get(0, (IInterface**)&obj);
    IView* sharedElement = IView::Probe(obj);
    Boolean requested;
    sharedElement->IsLayoutRequested(&requested);

    if (!requested) {
        ViewsReady(sharedElements);
    }
    else {
        AutoPtr<IOnPreDrawListener> listener = new SharedElementOnPreDrawListener(
            this, sharedElements, sharedElement);
        AutoPtr<IViewTreeObserver> vto;
        sharedElement->GetViewTreeObserver((IViewTreeObserver**)&vto);
        vto->AddOnPreDrawListener(listener);
    }

    return NOERROR;
}
开发者ID:elastos,项目名称:Elastos5,代码行数:35,代码来源:EnterTransitionCoordinator.cpp

示例2: constructor

ECode EnterTransitionCoordinator::constructor(
    /* [in] */ IActivity* activity,
    /* [in] */ IResultReceiver* resultReceiver,
    /* [in] */ IArrayList* sharedElementNames,
    /* [in] */ Boolean isReturning)
{
    AutoPtr<IWindow> window;
    activity->GetWindow((IWindow**)&window);

    FAIL_RETURN(ActivityTransitionCoordinator::constructor(
        window, sharedElementNames, GetListener(activity, isReturning), isReturning))
    mActivity = activity;
    SetResultReceiver(resultReceiver);
    PrepareEnter();
    AutoPtr<IBundle> resultReceiverBundle;
    CBundle::New((IBundle**)&resultReceiverBundle);
    resultReceiverBundle->PutParcelable(
        ActivityTransitionCoordinator::KEY_REMOTE_RECEIVER, this);

    mResultReceiver->Send(
        IActivityTransitionCoordinator::MSG_SET_REMOTE_RECEIVER, resultReceiverBundle);

    AutoPtr<IViewGroup> vg;
    GetDecor((IViewGroup**)&vg);
    IView* decorView = IView::Probe(vg);
    if (decorView != NULL) {
        AutoPtr<IViewTreeObserver> vto;
        decorView->GetViewTreeObserver((IViewTreeObserver**)&vto);
        AutoPtr<IOnPreDrawListener> listener = new DecorViewOnPreDrawListener(this, decorView);
        vto->AddOnPreDrawListener(listener);
    }
    return NOERROR;
}
开发者ID:elastos,项目名称:Elastos5,代码行数:33,代码来源:EnterTransitionCoordinator.cpp

示例3: SendSharedElementDestination

void EnterTransitionCoordinator::SendSharedElementDestination()
{
    Boolean allReady, bval;
    AutoPtr<IViewGroup> vg;
    GetDecor((IViewGroup**)&vg);
    IView* decorView = IView::Probe(vg);
    AutoPtr<ITransition> evt;
    GetEnterViewsTransition((ITransition**)&evt);
    if (AllowOverlappingTransitions() && evt != NULL) {
        allReady = FALSE;
    }
    else if (decorView == NULL) {
        allReady = TRUE;
    }
    else {
        decorView->IsLayoutRequested(&allReady);
        allReady = !allReady;
        if (allReady) {
            Int32 size;
            mSharedElements->GetSize(&size);
            IView* view;
            for (Int32 i = 0; i < size; i++) {
                AutoPtr<IInterface> obj;
                mSharedElements->Get(i, (IInterface**)&obj);
                view = IView::Probe(obj);
                view->IsLayoutRequested(&bval);
                if (bval) {
                    allReady = FALSE;
                    break;
                }
            }
        }
    }

    if (allReady) {
        AutoPtr<IBundle> state = CaptureSharedElementState();
        SetSharedElementMatrices();
        MoveSharedElementsToOverlay();
        mResultReceiver->Send(
            IActivityTransitionCoordinator::MSG_SHARED_ELEMENT_DESTINATION, state);
    }
    else if (decorView != NULL) {
        AutoPtr<IViewTreeObserver> vto;
        decorView->GetViewTreeObserver((IViewTreeObserver**)&vto);
        AutoPtr<IOnPreDrawListener> listener = new DestinationDecorViewOnPreDrawListener(this, decorView);
        vto->AddOnPreDrawListener(listener);
    }
    if (AllowOverlappingTransitions()) {
        StartEnterTransitionOnly();
    }
}
开发者ID:elastos,项目名称:Elastos5,代码行数:51,代码来源:EnterTransitionCoordinator.cpp

示例4: OnTakeSharedElements

void EnterTransitionCoordinator::OnTakeSharedElements()
{
    if (!mIsReadyForTransition || mSharedElementsBundle == NULL) {
        return;
    }
    AutoPtr<IBundle> sharedElementState = mSharedElementsBundle;
    mSharedElementsBundle = NULL;
    AutoPtr<IViewGroup> vg;
    GetDecor((IViewGroup**)&vg);
    IView* decorView = IView::Probe(vg);
    if (decorView != NULL) {
        AutoPtr<IViewTreeObserver> vto;
        decorView->GetViewTreeObserver((IViewTreeObserver**)&vto);
        AutoPtr<IOnPreDrawListener> listener = new TakeSharedElementsOnPreDrawListener(
            this, decorView, sharedElementState);
        vto->AddOnPreDrawListener(listener);
        decorView->Invalidate();
    }
}
开发者ID:elastos,项目名称:Elastos5,代码行数:19,代码来源:EnterTransitionCoordinator.cpp


注:本文中的IView::GetViewTreeObserver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。