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


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

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


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

示例1: StartSharedElementTransition

void EnterTransitionCoordinator::StartSharedElementTransition(
    /* [in] */ IBundle* sharedElementState)
{
    AutoPtr<IViewGroup> vg;
    GetDecor((IViewGroup**)&vg);
    IView* decorView = IView::Probe(vg);
    if (decorView == NULL) {
        return;
    }
    // Remove rejected shared elements
    AutoPtr<IArrayList> rejectedNames;
    CArrayList::New(ICollection::Probe(mAllSharedElementNames), (IArrayList**)&rejectedNames);
    rejectedNames->RemoveAll(ICollection::Probe(mSharedElementNames));
    AutoPtr<IArrayList> rejectedSnapshots = CreateSnapshots(
        sharedElementState, ICollection::Probe(rejectedNames));
    if (mListener != NULL) {
        mListener->OnRejectSharedElements(IList::Probe(rejectedSnapshots));
    }
    StartRejectedAnimations(rejectedSnapshots);

    // Now start shared element transition
    AutoPtr<IArrayList> sharedElementSnapshots = CreateSnapshots(
        sharedElementState, ICollection::Probe(mSharedElementNames));
    ShowViews(mSharedElements, TRUE);
    ScheduleSetSharedElementEnd(sharedElementSnapshots);
    AutoPtr<IArrayList> originalImageViewState = SetSharedElementState(
        sharedElementState, sharedElementSnapshots);
    RequestLayoutForSharedElements();

    Boolean startEnterTransition = AllowOverlappingTransitions() && !mIsReturning;
    Boolean startSharedElementTransition = TRUE;
    SetGhostVisibility(IView::INVISIBLE);
    ScheduleGhostVisibilityChange(IView::INVISIBLE);
    AutoPtr<ITransition> transition = BeginTransition(
        vg, startEnterTransition, startSharedElementTransition);
    ScheduleGhostVisibilityChange(IView::VISIBLE);
    SetGhostVisibility(IView::VISIBLE);

    if (startEnterTransition) {
        StartEnterTransition(transition);
    }

    SetOriginalSharedElementState(mSharedElements, originalImageViewState);

    if (mResultReceiver != NULL) {
        // We can't trust that the view will disappear on the same frame that the shared
        // element appears here. Assure that we get at least 2 frames for double-buffering.
        AutoPtr<IRunnable> runnable = new OnAnimationRunnable(this);
        decorView->PostOnAnimation(runnable);
    }
}
开发者ID:elastos,项目名称:Elastos5,代码行数:51,代码来源:EnterTransitionCoordinator.cpp

示例2: if

ECode EnterTransitionCoordinator::OnAnimationRunnable::Run()
{
    if (mAnimations++ < EnterTransitionCoordinator::MIN_ANIMATION_FRAMES) {
        AutoPtr<IViewGroup> vg;
        mHost->GetDecor((IViewGroup**)&vg);
        IView* decorView = IView::Probe(vg);
        if (decorView != NULL) {
            decorView->PostOnAnimation(this);
        }
    }
    else if (mHost->mResultReceiver != NULL) {
        mHost->mResultReceiver->Send(
            IActivityTransitionCoordinator::MSG_HIDE_SHARED_ELEMENTS, NULL);
        mHost->mResultReceiver = NULL; // all done sending messages.
    }
    return NOERROR;
}
开发者ID:elastos,项目名称:Elastos5,代码行数:17,代码来源:EnterTransitionCoordinator.cpp


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