android.view.View#setTagInternal ( )源码实例Demo

下面列出了android.view.View#setTagInternal ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: ActivityOptions.java
/**
 * This method should be called when the {@link #startSharedElementAnimation(Window, Pair[])}
 * animation must be stopped and the Views reset. This can happen if there was an error
 * from startActivity or a springboard activity and the animation should stop and reset.
 *
 * @hide
 */
public static void stopSharedElementAnimation(Window window) {
    final View decorView = window.getDecorView();
    if (decorView == null) {
        return;
    }
    final ExitTransitionCoordinator exit = (ExitTransitionCoordinator)
            decorView.getTag(com.android.internal.R.id.cross_task_transition);
    if (exit != null) {
        exit.cancelPendingTransitions();
        decorView.setTagInternal(com.android.internal.R.id.cross_task_transition, null);
        TransitionManager.endTransitions((ViewGroup) decorView);
        exit.resetViews();
        exit.clearState();
        decorView.setVisibility(View.VISIBLE);
    }
}
 
源代码2 项目: android_9.0.0_r45   文件: ActivityOptions.java
public HideWindowListener(Window window, ExitTransitionCoordinator exit) {
    mWindow = window;
    mExit = exit;
    mSharedElements = new ArrayList<>(exit.mSharedElements);
    Transition transition = mWindow.getExitTransition();
    if (transition != null) {
        transition.addListener(this);
        mWaitingForTransition = true;
    } else {
        mWaitingForTransition = false;
    }
    View decorView = mWindow.getDecorView();
    if (decorView != null) {
        if (decorView.getTag(com.android.internal.R.id.cross_task_transition) != null) {
            throw new IllegalStateException(
                    "Cannot start a transition while one is running");
        }
        decorView.setTagInternal(com.android.internal.R.id.cross_task_transition, exit);
    }
}
 
源代码3 项目: android_9.0.0_r45   文件: ActivityOptions.java
private void hideWhenDone() {
    if (mSharedElementHidden && (!mWaitingForTransition || mTransitionEnded)) {
        mExit.resetViews();
        int numSharedElements = mSharedElements.size();
        for (int i = 0; i < numSharedElements; i++) {
            View view = mSharedElements.get(i);
            view.requestLayout();
        }
        View decorView = mWindow.getDecorView();
        if (decorView != null) {
            decorView.setTagInternal(
                    com.android.internal.R.id.cross_task_transition, null);
            decorView.setVisibility(View.GONE);
        }
    }
}
 
源代码4 项目: android_9.0.0_r45   文件: RemoteViews.java
@Override
public void apply(View root, ViewGroup rootParent, OnClickHandler handler) {
    final View target = root.findViewById(viewId);
    if (target == null) return;

    target.setTagInternal(R.id.remote_input_tag, remoteInputs);
}
 
源代码5 项目: android_9.0.0_r45   文件: Scene.java
/**
 * Set the scene that the given view is in. The current scene is set only
 * on the root view of a scene, not for every view in that hierarchy. This
 * information is used by Scene to determine whether there is a previous
 * scene which should be exited before the new scene is entered.
 *
 * @param view The view on which the current scene is being set
 */
static void setCurrentScene(View view, Scene scene) {
    view.setTagInternal(com.android.internal.R.id.current_scene, scene);
}
 
 方法所在类
 同类方法