public void dismissImmediately() { mPickerOptions.decorView.post(new Runnable() { @Override public void run() { //从根视图移除 mPickerOptions.decorView.removeView(rootView); isShowing = false; dismissing = false; if (onDismissListener != null) { onDismissListener.onDismiss(BasePickerView.this); } } }); }
@Override public void onAnimationEnd(Animation animation) { decorView.post(new Runnable() { @Override public void run() { decorView.removeView(rootView); isDismissing = false; if (onDismissListener != null) { onDismissListener.onDismiss(DialogPlus.this); } } }); }
void watchContainerAttach() { container.post(new Runnable() { @Override public void run() { containerFullyAttached = true; } }); }
@Override public void run() { bubbleLayout.post(new Runnable() { @Override public void run() { addHeart(); } }); } }, 0, 200);
private void performControllerChange(@Nullable final Controller to, @Nullable final Controller from, final boolean isPush, @Nullable final ControllerChangeHandler changeHandler) { if (isPush && to != null && to.isDestroyed()) { throw new IllegalStateException("Trying to push a controller that has already been destroyed. (" + to.getClass().getSimpleName() + ")"); } final ChangeTransaction transaction = new ChangeTransaction(to, from, isPush, container, changeHandler, new ArrayList<>(changeListeners)); if (pendingControllerChanges.size() > 0) { // If we already have changes queued up (awaiting full container attach), queue this one up as well so they don't happen // out of order. pendingControllerChanges.add(transaction); } else if (from != null && (changeHandler == null || changeHandler.removesFromViewOnPush()) && !containerFullyAttached) { // If the change handler will remove the from view, we have to make sure the container is fully attached first so we avoid NPEs // within ViewGroup (details on issue #287). Post this to the container to ensure the attach is complete before we try to remove // anything. pendingControllerChanges.add(transaction); container.post(new Runnable() { @Override public void run() { performPendingControllerChanges(); } }); } else { ControllerChangeHandler.executeChange(transaction); } }
parent.post(r);
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
/** * remove top stickyView * @param component */ private void removeSticky(WXComponent component) { final WXCell headComponent = headComponentStack.pop(); if (!component.getRef().equals(headComponent.getRef())) { headComponentStack.push(headComponent); return; } final View headerView = headerViewStack.pop(); final ViewGroup parent = (ViewGroup) getParent(); if(parent != null){ parent.post(WXThread.secure(new Runnable() { @Override public void run() { parent.removeView(headerView); headComponent.recoverySticky(); } })); } }
/** * remove top stickyView * @param component */ private void removeSticky(WXComponent component) { final WXCell headComponent = headComponentStack.pop(); if (!component.getRef().equals(headComponent.getRef())) { headComponentStack.push(headComponent); return; } final View headerView = headerViewStack.pop(); final ViewGroup parent = (ViewGroup) getParent(); if(parent != null){ parent.post(WXThread.secure(new Runnable() { @Override public void run() { parent.removeView(headerView); headComponent.recoverySticky(); } })); } }
/** * Pop stickyView to stack */ private void showSticky() { WXCell headComponent = headComponentStack.pop(); headComponentStack.push(headComponent); final View headerView = headComponent.getRealView(); if (headerView == null) return; headerViewStack.push(headerView); headComponent.removeSticky(); final ViewGroup parent = (ViewGroup) getParent(); if(parent != null){ parent.post(WXThread.secure(new Runnable() { @Override public void run() { ViewGroup existedParent; if((existedParent = (ViewGroup)headerView.getParent())!= null){ existedParent.removeView(headerView); } parent.addView(headerView); } })); } }
/** * Pop stickyView to stack */ private void showSticky() { WXCell headComponent = headComponentStack.pop(); headComponentStack.push(headComponent); final View headerView = headComponent.getRealView(); if (headerView == null) return; headerViewStack.push(headerView); headComponent.removeSticky(); final ViewGroup parent = (ViewGroup) getParent(); if(parent != null){ parent.post(WXThread.secure(new Runnable() { @Override public void run() { ViewGroup existedParent; if((existedParent = (ViewGroup)headerView.getParent())!= null){ existedParent.removeView(headerView); } parent.addView(headerView); } })); } }
private void initTransitions() { final PLVideoEncodeSetting setting = new PLVideoEncodeSetting(TransitionMakeActivity.this); setting.setEncodingSizeLevel(PLVideoEncodeSetting.VIDEO_ENCODING_SIZE_LEVEL.VIDEO_ENCODING_SIZE_LEVEL_720P_3); for (int i = 0; i < mTransitions.length; i++) { final ViewGroup viewGroup = (ViewGroup) findViewById(getResources().getIdentifier("transition_container" + i, "id", getPackageName())); final int index = i; viewGroup.post(new Runnable() { @Override public void run() { try { Constructor constructor = TRANSITION_CLASS[index].getConstructor(ViewGroup.class, PLVideoEncodeSetting.class); TransitionBase transition = (TransitionBase) constructor.newInstance(viewGroup, setting); mTransitions[index] = transition; //default show first transition if (index == 0) { transition.setVisibility(View.VISIBLE); mCurTransition = transition; mTransEditView.setTransition(mCurTransition); } else { transition.setVisibility(View.INVISIBLE); } } catch (Exception e) { e.printStackTrace(); ToastUtils.s(TransitionMakeActivity.this, "Can not init Transition : " + "Transition" + index); } } }); } }
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
@Override public void run() { instantCollapse(); if (mRunAfterInstantCollapse != null) mNotificationPanelView.post(mRunAfterInstantCollapse); } };
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);
mParentView.post(mSetIdleRunnable); } else { setDragState(STATE_IDLE);