Creates and returns a listener, which allows to immediately maximize the bottom sheet after
it has been shown.

@return The listener, which has been created, as an instance of the type {@link
OnShowListener}
333391
@TargetApi(VERSION_CODES.FROYO)
    private OnShowListener createOnShowListener() {
        return new OnShowListener() {

            @Override
            public void onShow(final DialogInterface dialog) {
                if (onShowListener != null) {
                    onShowListener.onShow(dialog);
                }

                if (maximize) {
                    maximize = false;
                    rootView.maximize(new DecelerateInterpolator());
                }
            }

        };
    }
954681
public static <T> Listener<T> createListenerToFire(Event<T> event) {
		return new Listener<T>() {
			@Override
			public void fire(T obj) {
				event.fire(obj);
			}
		};
	}
1261230
private void initListeners() {
        listViewProperty().addListener((listObj, oldList, newList) -> {
            if (newList != null) {
                if (getListView() instanceof JFXListView) {
                    ((JFXListView<?>) newList).currentVerticalGapProperty().addListener((o, oldVal, newVal) -> {
                        cellRippler.rippler.setClip(null);
                        if (newVal.doubleValue() != 0) {
                            playExpandAnimation = true;
                            getListView().requestLayout();
                        } else {
                            // fake expand state
                            double gap = clip.getY() * 2;
                            gapAnimation = new Timeline(
                                new KeyFrame(Duration.millis(240),
                                    new KeyValue(this.translateYProperty(),
                                        -gap / 2 - (gap * (getIndex())),
                                        Interpolator.EASE_BOTH)
                                ));
                            gapAnimation.play();
                            gapAnimation.setOnFinished((finish) -> {
                                requestLayout();
                                Platform.runLater(() -> getListView().requestLayout());
                            });
                        }
                    });

                    selectedProperty().addListener((o, oldVal, newVal) -> {
                        if (newVal) {
                            selectionChanged = true;
                        }
                    });
                }
31551
@Override
    public void onCancel(DialogInterface dialog) {
        super.onCancel(dialog);

        if (mListener == null) {
            throw new NullPointerException(
                    "Listener no longer exists in onCancel()");
        }

        mListener.onDateTimeCancel();
    }
1210693
private OnValueChangeListener createNumberPickerListener() {
        return new OnValueChangeListener() {

            @Override
            public void onValueChange(final android.widget.NumberPicker numberPicker,
                                      final int oldValue, final int newValue) {
                numberPicker.setValue(newValue);
                currentIndex = getMinNumber() + newValue * getStepSize();
            }

        };
    }
627081
private OnSeekBarChangeListener createSeekBarListener() {
        return new OnSeekBarChangeListener() {

            @Override
            public void onProgressChanged(final SeekBar seekBar, final int progress,
                                          final boolean fromUser) {
                adaptElevation(progress, parallelLightCheckBox.isChecked());
            }

            @Override
            public void onStartTrackingTouch(final SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(final SeekBar seekBar) {

            }

        };
    }
663812
private OnClickListener createPreferenceInitialFragmentButtonListener() {
        return new OnClickListener() {

            @Override
            public void onClick(final View v) {
                Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
                intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT,
                        BehaviorPreferenceFragment.class.getName());

                SharedPreferences sharedPreferences =
                        PreferenceManager.getDefaultSharedPreferences(MainActivity.this);

                boolean useAlternativeTitleDefaultValue =
                        Boolean.valueOf(getString(R.string.use_alternative_title_preference_key));
                String useAlternativeTitleKey =
                        getString(R.string.use_alternative_title_preference_key);

                if (sharedPreferences
                        .getBoolean(useAlternativeTitleKey, useAlternativeTitleDefaultValue)) {
                    String titleDefaultValue =
                            getString(R.string.alternative_title_preference_default_value);
                    String titleKey = getString(R.string.alternative_title_preference_key);
                    String title = sharedPreferences.getString(titleKey, titleDefaultValue);
                    intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
                }

                startActivity(intent);
            }

        };
    }
710860
public BaseListener getNextEnabledListener()
    {
        if (m_nextListener == null)
            return null;
        if (m_nextListener.isEnabled())
            return m_nextListener;
        else
            return m_nextListener.getNextEnabledListener();
    }
690182
private MouseListener createMouseListener() {
        return new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {
                Point clickPoint = new Point(e.getPoint());

                SwingUtilities.convertPointToScreen(clickPoint, fComponent);

                dX = clickPoint.x - fWindow.getX();
                dY = clickPoint.y - fWindow.getY();
            }
        };
    }
846791
public BuilderType setOnShowListener(@Nullable final DialogInterface.OnShowListener listener) {
        getProduct().setOnShowListener(listener);
        return self();
    }
291470
private OnClickListener createNextButtonListener() {
        return new OnClickListener() {

            @Override
            public void onClick(final View v) {
                int selectedIndex = viewPager.getCurrentItem();

                if (notifyOnNext(selectedIndex)) {
                    viewPager.setCurrentItem(selectedIndex + 1);
                }
            }

        };
    }
1219680
public java.util.List<Listener> getListeners() {
        if (listeners == null) {
            listeners = new com.amazonaws.internal.SdkInternalList<Listener>();
        }
        return listeners;
    }
905399
public RuntimeEventListener getRuntimeEventListener() {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled()) {
            SibTr.entry(tc, "getRuntimeEventListener");
            SibTr.exit(tc, "getRuntimeEventListener", _runtimeEventListener);
        }
        return _runtimeEventListener;
    }
933571
private JScrollPane getWorkPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setViewportView(getHttpSessionsTable());
		}
		return jScrollPane;
	}
145454
private BottomSheet.Builder createBottomSheetBuilder() {
        BottomSheet.Builder builder = new BottomSheet.Builder(getActivity());
        builder.setStyle(getStyle());

        if (shouldTitleBeShown()) {
            builder.setTitle(getBottomSheetTitle());
        }

        if (shouldIconBeShown()) {
            builder.setIcon(android.R.drawable.ic_dialog_alert);
        }

        return builder;
    }
257266
private static WindowFocusListener createRepaintWindowListener(final JComponent component) {
        return new WindowAdapter() {
            public void windowActivated(WindowEvent e) {
                component.repaint();
            }

            public void windowDeactivated(WindowEvent e) {
                component.repaint();
            }
        };
    }
1043153
public Listeners<JobXMLDescriptor> getOrCreateListeners()
   {
      Node node = model.getOrCreate("listeners");
      Listeners<JobXMLDescriptor> listeners = new ListenersImpl<JobXMLDescriptor>(this, "listeners", model, node);
      return listeners;
   }