Adapts the visibility of the top and bottom divider, depending on the state of the dialog's
scroll view.
507456
private void adaptDividerVisibilities() {
        if (scrollView != null) {
            adaptDividerVisibilities(scrollView.isScrolledToTop(), scrollView.isScrolledToBottom(),
                    false);
        } else if (listView != null) {
            adaptDividerVisibilities(isListViewScrolledToTop(listView),
                    isListViewScrolledToBottom(listView), false);
        }
    }
1014916
def adjustContentsMargins( self ):
        
        anchor = self.anchor()
        mode   = self.currentMode()
        
        # margins for a dialog
        if ( mode == XPopupWidget.Mode.Dialog ):
            self.setContentsMargins(0, 0, 0, 0)
        
        # margins for a top anchor point
        elif ( anchor & (XPopupWidget.Anchor.TopLeft |
                         XPopupWidget.Anchor.TopCenter |
                         XPopupWidget.Anchor.TopRight) ):
            self.setContentsMargins(0, self.popupPadding() + 5, 0, 0)
        
        # margins for a bottom anchor point
        elif ( anchor & (XPopupWidget.Anchor.BottomLeft |
                         XPopupWidget.Anchor.BottomCenter |
                         XPopupWidget.Anchor.BottomRight) ):
            self.setContentsMargins(0, 0, 0, self.popupPadding())
        
        # margins for a left anchor point
        elif ( anchor & (XPopupWidget.Anchor.LeftTop |
                         XPopupWidget.Anchor.LeftCenter |
                         XPopupWidget.Anchor.LeftBottom) ):
            self.setContentsMargins(self.popupPadding(), 0, 0, 0)
        
        # margins for a right anchor point
        else:
            self.setContentsMargins(0, 0, self.popupPadding(), 0)
        
        self.adjustMask()
255845
def toggle_hscrollbar(self, checked):
        """"""
        self.parent_widget.sig_option_changed.emit('show_hscrollbar', checked)
        self.show_hscrollbar = checked
        self.header().setStretchLastSection(not checked)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        try:
            self.header().setSectionResizeMode(QHeaderView.ResizeToContents)
        except:  # support for qtpy<1.2.0
            self.header().setResizeMode(QHeaderView.ResizeToContents)
1349886
public void setPreviewVisible(boolean visible) {

        m_previewVisible = visible;
        if (m_previewVisible) {
            useMaxDimensions();
            m_previewVisibility.setValue(I_CmsLayoutBundle.INSTANCE.previewDialogCss().previewVisible());
            if (m_galleryHandler instanceof CmsGalleryPopup) {
                ((CmsGalleryPopup)m_galleryHandler).center();
            }
        } else {
            m_previewVisibility.setValue(I_CmsLayoutBundle.INSTANCE.previewDialogCss().hidePreview());
            updateSizes();
        }
    }
1010157
public void show() {
        if (!(container instanceof RootPanel)) {
            if (!(container instanceof MaterialDialog)) {
                container.getElement().getStyle().setPosition(Style.Position.RELATIVE);
            }
            div.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
        }
        if (scrollDisabled) {
            RootPanel.get().getElement().getStyle().setOverflow(Style.Overflow.HIDDEN);
        }
        if (type == LoaderType.CIRCULAR) {
            div.setStyleName(CssName.VALIGN_WRAPPER + " " + CssName.LOADER_WRAPPER);
            div.add(preLoader);
        } else if (type == LoaderType.PROGRESS) {
            div.setStyleName(CssName.VALIGN_WRAPPER + " " + CssName.PROGRESS_WRAPPER);
            progress.getElement().getStyle().setProperty("margin", "auto");
            div.add(progress);
        }
        container.add(div);
    }
1365133
private void adaptButtonBarContainerVisibility() {
        if (buttonBarContainer != null) {
            if (TextUtils.isEmpty(positiveButtonText) && TextUtils.isEmpty(neutralButtonText) &&
                    TextUtils.isEmpty(negativeButtonText)) {
                buttonBarContainer.setVisibility(View.GONE);
            } else {
                buttonBarContainer.setVisibility(View.VISIBLE);
            }
        }
    }
536835
private void adaptHeaderDividerVisibility() {
        if (headerDivider != null) {
            headerDivider.setVisibility(showHeaderDivider ? View.VISIBLE : View.GONE);
        }
    }
1019826
function(oTable) {
			var oScrollExtension = oTable._getScrollExtension();
			var iMaxFirstRenderedRowIndex = oTable._getMaxFirstRenderedRowIndex();
			var iNewFirstVisibleRowIndex = VerticalScrollingHelper.getRowIndexAtCurrentScrollPosition(oTable);
			var iOldFirstVisibleRowIndex = oTable.getFirstVisibleRow();
			var bNewFirstVisibleRowInBuffer = iNewFirstVisibleRowIndex < 0;
			var bOldFirstVisibleRowInBuffer = iOldFirstVisibleRowIndex >= iMaxFirstRenderedRowIndex;
			var bFirstVisibleRowChanged = iNewFirstVisibleRowIndex !== iOldFirstVisibleRowIndex;
			var bRowsUpdateRequired = bFirstVisibleRowChanged && !(bNewFirstVisibleRowInBuffer && bOldFirstVisibleRowInBuffer);

			if (bRowsUpdateRequired) {
				var bExpectRowsUpdatedEvent = !bOldFirstVisibleRowInBuffer || iNewFirstVisibleRowIndex !== iMaxFirstRenderedRowIndex;

				if (bNewFirstVisibleRowInBuffer) {
					// The actual new first visible row cannot be determined yet. It will be done when the inner scroll position gets updated.
					iNewFirstVisibleRowIndex = iMaxFirstRenderedRowIndex;
				}

				log("updateFirstVisibleRow: From " + iOldFirstVisibleRowIndex + " to " + iNewFirstVisibleRowIndex, oTable);

				oTable.setFirstVisibleRow(iNewFirstVisibleRowIndex, true, bNewFirstVisibleRowInBuffer);

				if (bExpectRowsUpdatedEvent) {
					VerticalScrollingHelper.setOnRowsUpdatedPreprocessor(oTable, function(oEvent) {
						log("updateFirstVisibleRow - onRowsUpdatedPreprocessor: Reason " + oEvent.getParameters().reason, this);

						oScrollExtension.updateInnerVerticalScrollPosition();

						if (bNewFirstVisibleRowInBuffer) {
							var iCurrentFirstVisibleRow = this.getFirstVisibleRow();
							var bFirstVisibleRowNotChanged = iNewFirstVisibleRowIndex === iCurrentFirstVisibleRow;

							// The firstVisibleRow was previously set to the maximum first visible row index while suppressing the event. If the first
							// visible row is not adjusted in #updateInnerVerticalScrollPosition, make sure the event is called here.
							if (bFirstVisibleRowNotChanged) {
								this.setProperty("firstVisibleRow", -1, true);
								this.setFirstVisibleRow(iCurrentFirstVisibleRow, true);
							}
						}

						return false;
					});
				} else {
					log("updateFirstVisibleRow: Update inner vertical scroll position", oTable);
					oScrollExtension.updateInnerVerticalScrollPosition();
				}

			} else if (TableUtils.isVariableRowHeightEnabled(oTable)) {
				log("updateFirstVisibleRow: Update inner vertical scroll position", oTable);
				oScrollExtension.updateInnerVerticalScrollPosition();
			}
		}
664818
private void adaptButtonVisibility() {
        if (viewPager != null && viewPagerAdapter != null && backButton != null &&
                nextButton != null && finishButton != null) {
            int selectedIndex = viewPager.getCurrentItem();
            backButton.setVisibility(selectedIndex > 0 ? View.VISIBLE : View.GONE);
            nextButton.setVisibility(
                    selectedIndex < viewPagerAdapter.getCount() - 1 ? View.VISIBLE : View.GONE);
            finishButton.setVisibility(
                    selectedIndex == viewPagerAdapter.getCount() - 1 ? View.VISIBLE : View.GONE);
        }
    }
349877
private void adaptWizardButtonVisibilities() {
        if (buttonBar != null && backButton != null && nextButton != null && finishButton != null &&
                navigationFragment != null) {
            int selectedNavigationPreferenceIndex =
                    navigationFragment.getSelectedNavigationPreferenceIndex();

            if (selectedNavigationPreferenceIndex != -1 && isButtonBarShown()) {
                int navigationPreferenceCount = navigationFragment.getNavigationPreferenceCount();
                backButton.setVisibility(
                        (selectedNavigationPreferenceIndex != 0) ? View.VISIBLE : View.GONE);
                nextButton.setVisibility(
                        (selectedNavigationPreferenceIndex != navigationPreferenceCount - 1) ?
                                View.VISIBLE : View.GONE);
                finishButton.setVisibility(
                        (selectedNavigationPreferenceIndex == navigationPreferenceCount - 1) ?
                                View.VISIBLE : View.GONE);
            } else if (isButtonBarShown()) {
                backButton.setVisibility(View.GONE);
                nextButton.setVisibility(View.GONE);
                finishButton.setVisibility(View.VISIBLE);
            }
        }
    }
568047
private void adaptTabLayoutEnableState() {
        if (tabLayout != null) {
            LinearLayout tabStrip = ((LinearLayout) tabLayout.getChildAt(0));
            tabStrip.setEnabled(tabLayoutEnabled);

            for (int i = 0; i < tabStrip.getChildCount(); i++) {
                tabStrip.getChildAt(i).setEnabled(tabLayoutEnabled);
            }
        }
    }
84818
protected void adjustHeight() {

        if ((m_scrollPanel != null) && (m_resourceItem != null)) {
            m_scrollPanel.getElement().getStyle().setPropertyPx(
                "maxHeight",
                getAvailableHeight(m_resourceItem.getOffsetHeight()));
        }
        center();
    }
1158878
private void inflateScrollView(@NonNull final ScrollableArea scrollableArea) {
        if (scrollView == null) {
            LayoutInflater layoutInflater = LayoutInflater.from(getContext());
            scrollView = (ScrollView) layoutInflater
                    .inflate(R.layout.material_dialog_scroll_view, this, false);
            scrollView.addScrollListener(createScrollViewScrollListener());
            scrollView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
            scrollView.setFocusableInTouchMode(true);

            if (scrollableArea.getBottomScrollableArea().getIndex() -
                    scrollableArea.getTopScrollableArea().getIndex() > 0) {
                LinearLayout scrollContainer = new LinearLayout(getContext());
                scrollContainer.setOrientation(LinearLayout.VERTICAL);
                scrollView.addView(scrollContainer, ScrollView.LayoutParams.MATCH_PARENT,
                        ScrollView.LayoutParams.MATCH_PARENT);
            }

            addView(scrollView);
        }
    }
931219
private void adjustBannerTextVerticalBias(float percentBias) {
    if (!isLandscape()) {
      ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) instructionLayoutText.getLayoutParams();
      params.verticalBias = percentBias;
      instructionLayoutText.setLayoutParams(params);
    }
  }
1104926
private void adaptDividerColor() {
        adaptDividerColor(topDivider);
        adaptDividerColor(bottomDivider);

        if (dividers != null) {
            for (Divider divider : dividers.values()) {
                adaptDividerColor(divider);
            }
        }
    }
1343455
private void adaptContentContainerVisibility() {
        if (contentContainer != null) {
            if (isCustomViewUsed()) {
                contentContainer.setVisibility(View.VISIBLE);
                notifyOnAreaShown(Area.CONTENT);
            } else {
                contentContainer.setVisibility(View.GONE);
                notifyOnAreaHidden(Area.CONTENT);
            }
        }
    }
1213644
@Override
    public void onScroll(
            AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        SimpleMonthView child = (SimpleMonthView) view.getChildAt(0);
        if (child == null) {
            return;
        }

        // Figure out where we are
        long currScroll = view.getFirstVisiblePosition() * child.getHeight() - child.getBottom();
        mPreviousScrollPosition = currScroll;
        mPreviousScrollState = mCurrentScrollState;
    }