Java Code Examples for android.view.ViewGroup#getOverlay()

The following examples show how to use android.view.ViewGroup#getOverlay() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
protected void moveSharedElementsFromOverlay() {
    int numListeners = mGhostViewListeners.size();
    for (int i = 0; i < numListeners; i++) {
        GhostViewListeners listener = mGhostViewListeners.get(i);
        listener.removeListener();
    }
    mGhostViewListeners.clear();

    if (mWindow == null || !mWindow.getSharedElementsUseOverlay()) {
        return;
    }
    ViewGroup decor = getDecor();
    if (decor != null) {
        ViewGroupOverlay overlay = decor.getOverlay();
        int count = mSharedElements.size();
        for (int i = 0; i < count; i++) {
            View sharedElement = mSharedElements.get(i);
            GhostView.removeGhost(sharedElement);
        }
    }
}
 
Example 2
Source Project: EasyPopup   File: BasePopup.java    License: Apache License 2.0 5 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
    private void applyDim(Activity activity) {
        ViewGroup parent = (ViewGroup) activity.getWindow().getDecorView().getRootView();
        //activity跟布局
//        ViewGroup parent = (ViewGroup) parent1.getChildAt(0);
        Drawable dimDrawable = new ColorDrawable(mDimColor);
        dimDrawable.setBounds(0, 0, parent.getWidth(), parent.getHeight());
        dimDrawable.setAlpha((int) (255 * mDimValue));
        ViewGroupOverlay overlay = parent.getOverlay();
        overlay.add(dimDrawable);
    }
 
Example 3
Source Project: EasyPopup   File: BasePopup.java    License: Apache License 2.0 5 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
private void applyDim(ViewGroup dimView) {
    Drawable dimDrawable = new ColorDrawable(mDimColor);
    dimDrawable.setBounds(0, 0, dimView.getWidth(), dimView.getHeight());
    dimDrawable.setAlpha((int) (255 * mDimValue));
    ViewGroupOverlay overlay = dimView.getOverlay();
    overlay.add(dimDrawable);
}
 
Example 4
Source Project: EasyPopup   File: BasePopup.java    License: Apache License 2.0 5 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
    private void clearDim(Activity activity) {
        ViewGroup parent = (ViewGroup) activity.getWindow().getDecorView().getRootView();
        //activity跟布局
//        ViewGroup parent = (ViewGroup) parent1.getChildAt(0);
        ViewGroupOverlay overlay = parent.getOverlay();
        overlay.clear();
    }
 
Example 5
static void applyDim(@NonNull ViewGroup parent){
    Drawable dim = new ColorDrawable(Color.BLACK);
    dim.setBounds(0, 0, parent.getWidth(), parent.getHeight());
    dim.setAlpha((int) (255 * 0.5));

    ViewGroupOverlay overlay = parent.getOverlay();
    overlay.add(dim);
}
 
Example 6
ViewGroupOverlayApi18(@NonNull ViewGroup group) {
  viewGroupOverlay = group.getOverlay();
}
 
Example 7
Source Project: EasyPopup   File: BasePopup.java    License: Apache License 2.0 4 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
private void clearDim(ViewGroup dimView) {
    ViewGroupOverlay overlay = dimView.getOverlay();
    overlay.clear();
}
 
Example 8
static void clearDim(@NonNull ViewGroup parent) {
    ViewGroupOverlay overlay = parent.getOverlay();
    overlay.clear();
}