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

The following examples show how to use android.view.ViewGroup#getOverlay() . 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
Source File: ActivityTransitionCoordinator.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
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 File: BasePopup.java    From EasyPopup with 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 File: BasePopup.java    From EasyPopup with 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 File: BasePopup.java    From EasyPopup with 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
Source File: GuiInfoPopupWindow.java    From PhoneProfilesPlus with Apache License 2.0 5 votes vote down vote up
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
Source File: ViewGroupOverlayApi18.java    From material-components-android with Apache License 2.0 4 votes vote down vote up
ViewGroupOverlayApi18(@NonNull ViewGroup group) {
  viewGroupOverlay = group.getOverlay();
}
 
Example 7
Source File: BasePopup.java    From EasyPopup with 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
Source File: GuiInfoPopupWindow.java    From PhoneProfilesPlus with Apache License 2.0 4 votes vote down vote up
static void clearDim(@NonNull ViewGroup parent) {
    ViewGroupOverlay overlay = parent.getOverlay();
    overlay.clear();
}