idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
125,400 | protected final void setContext ( final Context context ) { Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; this . context = context ; } | Sets the context which should be used by the builder . |
125,401 | private int getCustomMessageId ( ) { switch ( progressBarPosition ) { case LEFT : return R . layout . progress_dialog_left ; case TOP : return R . layout . progress_dialog_top ; case RIGHT : return R . layout . progress_dialog_right ; case BOTTOM : return R . layout . progress_dialog_bottom ; default : return R . layou... | Returns the resource id of the layout which should be used as the dialog s custom message depending on the position of the dialog s progress bar . |
125,402 | private void adaptProgressBar ( ) { LayoutInflater inflater = LayoutInflater . from ( getContext ( ) ) ; View view = inflater . inflate ( getCustomMessageId ( ) , getRootView ( ) , false ) ; getDialog ( ) . setCustomMessage ( view ) ; View progressView = view . findViewById ( R . id . progress_bar ) ; progressBar = pro... | Adapts the dialog s progress bar . |
125,403 | private void adaptProgressBarSize ( ) { if ( progressBar != null ) { progressBar . setVisibility ( progressBarSize > 0 ? View . VISIBLE : View . GONE ) ; ViewGroup . LayoutParams layoutParams = progressBar . getLayoutParams ( ) ; layoutParams . width = progressBarSize ; layoutParams . height = progressBarSize ; } } | Adapts the size of the dialog s circular progress bar . |
125,404 | private void adaptMessageTextSize ( ) { if ( getRootView ( ) != null ) { View messageView = getRootView ( ) . findViewById ( android . R . id . message ) ; if ( messageView instanceof TextView ) { TextView messageTextView = ( TextView ) messageView ; if ( TextUtils . isEmpty ( getDialog ( ) . getTitle ( ) ) ) { message... | Adapts the text size of the dialog s message depending on whether a title is shown . |
125,405 | public final void addItem ( final CharSequence title , final Class < ? extends Fragment > fragmentClass , final Bundle arguments ) { Condition . INSTANCE . ensureNotNull ( fragmentClass , "The fragment class may not be null" ) ; items . add ( new ViewPagerItem ( title , fragmentClass , arguments ) ) ; notifyDataSetChan... | Adds a new fragment to the adapter . |
125,406 | private void initializeAlertDialog ( ) { MaterialDialog . Builder builder = new MaterialDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; alertDialog = builder . create ( ) ; } | Initializes the alert dialog . |
125,407 | private void initializeListDialog ( ) { MaterialDialog . Builder builder = new MaterialDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; builder . setItems ( R . array . list_items , createSingleChoiceListener ( ) ) ; listDialog = builder . c... | Initializes the list dialog . |
125,408 | private void initializeSingleChoiceListDialog ( ) { MaterialDialog . Builder builder = new MaterialDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; builder . setSingleChoiceItems ( R . array . list_items , 0 , createSingleChoiceListener ( ) ... | Initializes the single choice list dialog . |
125,409 | private void initializeMultipleChoiceListDialog ( ) { MaterialDialog . Builder builder = new MaterialDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; builder . setMultiChoiceItems ( R . array . list_items , new boolean [ ] { true , false , f... | Initializes the multiple choice list dialog . |
125,410 | private void initializeCustomDialog ( ) { MaterialDialog . Builder builder = new MaterialDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; builder . setView ( R . layout . custom_dialog_content ) ; builder . setCustomTitle ( R . layout . cust... | Initializes the custom dialog . |
125,411 | private void initializeProgressDialog ( ) { ProgressDialog . Builder builder = new ProgressDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; progressDialog = builder . create ( ) ; } | Initializes the progress dialog . |
125,412 | private void initializeEditTextDialog ( ) { EditTextDialog . Builder builder = new EditTextDialog . Builder ( getActivity ( ) ) . setHint ( R . string . edit_text_dialog_hint ) . setText ( getContext ( ) . getString ( R . string . edit_text_dialog_text ) ) . addValidator ( Validators . notEmpty ( getContext ( ) ) ) ; c... | Initializes the edit text dialog . |
125,413 | private void initializeThemePreference ( ) { Preference themePreference = findPreference ( getString ( R . string . theme_preference_key ) ) ; themePreference . setOnPreferenceChangeListener ( createThemeChangeListener ( ) ) ; } | Initializes the preference which allows to change the app s theme . |
125,414 | private void initializeFullscreenPreference ( ) { Preference fullscreenPreference = findPreference ( getString ( R . string . fullscreen_preference_key ) ) ; fullscreenPreference . setOnPreferenceChangeListener ( createThemeChangeListener ( ) ) ; } | Initializes the preference which allows to specfify whether dialogs should be shown fullscreen or not . |
125,415 | private void initializeShowAlertDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_alert_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preference ) { initializeAle... | Initializes the preference which allows to show the alert dialog . |
125,416 | private void initializeShowListDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_list_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preference ) { initializeListD... | Initializes the preference which allows to show the list dialog . |
125,417 | private void initializeShowSingleChoiceListDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_single_choice_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preferenc... | Initializes the preference which allows to show the single choice list dialog . |
125,418 | private void initializeShowMultipleChoiceListDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_multi_choice_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preferen... | Initializes the preference which allows to show the multiple choice list dialog . |
125,419 | private void initializeShowCustomDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_custom_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preference ) { initializeC... | Initializes the preference which allows to show the custom dialog . |
125,420 | private void initializeShowProgressDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_progress_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preference ) { initial... | Initializes the preference which allows to show the progress dialog . |
125,421 | private void initializeShowEditTextDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_edit_text_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preference ) { initia... | Initializes the preference which allows to show the edit text dialog . |
125,422 | private DialogAnimation createRectangularRevealAnimation ( final Preference preference ) { if ( shouldUseAnimations ( ) ) { RecyclerView recyclerView = getListView ( ) ; View view = recyclerView . getChildAt ( preference . getOrder ( ) + 1 ) ; int [ ] viewLocation = new int [ 2 ] ; view . getLocationOnScreen ( viewLoca... | Creates and returns the rectangular reveal animation which should be used to show or hide dialogs . |
125,423 | private DialogAnimation createCircleRevealAnimation ( final View view ) { int [ ] location = new int [ 2 ] ; view . getLocationOnScreen ( location ) ; int margin = getResources ( ) . getDimensionPixelSize ( R . dimen . floating_action_button_margin ) ; int width = view . getWidth ( ) ; int height = view . getHeight ( )... | Creates and returns the circle reveal animation which should be used to show or hide dialogs . |
125,424 | private OnClickListener createSingleChoiceListener ( ) { return new OnClickListener ( ) { public void onClick ( final DialogInterface dialog , final int position ) { String text = getString ( R . string . single_choice_listener_text ) ; showToast ( String . format ( text , position ) ) ; } } ; } | Creates and returns a listener which allows to show a toast which indicates when a single choice list item of a dialog has been selected or unselected . |
125,425 | private OnMultiChoiceClickListener createMultiChoiceListener ( ) { return new OnMultiChoiceClickListener ( ) { public void onClick ( final DialogInterface dialog , final int position , final boolean isChecked ) { String text = getString ( R . string . multi_choice_listener_selected_text ) ; if ( ! isChecked ) { text = ... | Creates and returns a listener which allows to show a toast which indicates when a multi choice list item of a dialog has been selected or unselected . |
125,426 | private void initializeShowWizardDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_wizard_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { public boolean onPreferenceClick ( final Preference preference ) { WizardDialo... | Initializes the preference which allows to show a wizard dialog . |
125,427 | private OnPageChangeListener createWizardDialogPageChangeListener ( final WizardDialog wizardDialog ) { return new OnPageChangeListener ( ) { public void onPageScrolled ( final int position , final float positionOffset , final int positionOffsetPixels ) { } public void onPageSelected ( final int position ) { int [ ] co... | Creates and returns a listener which allows to change the background color of the wizard dialog when its view pager is scrolled . |
125,428 | private AnimationListener createHeaderAnimationListener ( final WizardDialog wizardDialog ) { return new AnimationListener ( ) { public void onAnimationStart ( ) { } public void onAnimationEnd ( ) { int duration = getResources ( ) . getInteger ( android . R . integer . config_shortAnimTime ) ; BackgroundAnimation anima... | Creates and returns a listener which allows to reset a wizard dialog s header background to default when its animation is finished . |
125,429 | private void addFragment ( final WizardDialog . Builder builder , final int index ) { Bundle arguments = new Bundle ( ) ; arguments . putInt ( DialogFragment . INDEX_EXTRA , index ) ; CharSequence title = shouldHeaderBeShown ( ) ? null : String . format ( getString ( R . string . dialog_tab_text ) , index ) ; builder .... | Adds a new fragment to a builder which allows to create wizard dialogs . |
125,430 | private void showToast ( final String text ) { if ( toast != null ) { toast . cancel ( ) ; } toast = Toast . makeText ( getActivity ( ) , text , Toast . LENGTH_SHORT ) ; toast . show ( ) ; } | Shows a specific toast and cancels a previous one if existing . |
125,431 | private void configureHeaderDialogBuilder ( final AbstractHeaderDialogBuilder builder ) { builder . setFullscreen ( shouldUseFullscreen ( ) ) ; if ( shouldTitleBeShown ( ) ) { builder . setTitle ( getDialogTitle ( ) ) ; } if ( shouldMessageBeShown ( ) ) { builder . setMessage ( getDialogMessage ( ) ) ; } if ( shouldIco... | Configures a builder which allows to create header dialogs depending on the app s settings . |
125,432 | private void configureButtonBarDialogBuilder ( final AbstractButtonBarDialogBuilder builder ) { if ( shouldNegativeButtonBeShown ( ) ) { builder . setNegativeButton ( getNegativeButtonText ( ) , createNegativeButtonListener ( ) ) ; } if ( shouldNeutralButtonBeShown ( ) ) { builder . setNeutralButton ( getNeutralButtonT... | Configures a builder which allows to create button bar dialogs depending on the app s settings . |
125,433 | private OnClickListener createNegativeButtonListener ( ) { return new OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { Toast . makeText ( getActivity ( ) , R . string . negative_button_toast , Toast . LENGTH_SHORT ) . show ( ) ; } } ; } | Creates and returns a listener which allows to show a toast when the negative button of a dialog has been clicked . |
125,434 | private OnClickListener createNeutralButtonListener ( ) { return new OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { Toast . makeText ( getActivity ( ) , R . string . neutral_button_toast , Toast . LENGTH_SHORT ) . show ( ) ; } } ; } | Creates and returns a listener which allows to show a toast when the neutral button of a dialog has been clicked . |
125,435 | private OnClickListener createPositiveButtonListener ( ) { return new OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { Toast . makeText ( getActivity ( ) , R . string . positive_button_toast , Toast . LENGTH_SHORT ) . show ( ) ; } } ; } | Creates and returns a listener which allows to show a toast when the positive button of a dialog has been clicked . |
125,436 | private boolean shouldTitleBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_dialog_title_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_dialog_title_preference_d... | Returns whether the title of the example dialog should be shown or not . |
125,437 | private String getDialogTitle ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . dialog_title_preference_key ) ; String defaultValue = getString ( R . string . dialog_title_preference_default_value ) ; return sharedPref... | Returns the title of the example dialog . |
125,438 | private boolean shouldIconBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_dialog_icon_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_dialog_icon_preference_defa... | Returns whether the icon of the example dialog should be shown or not . |
125,439 | private boolean shouldMessageBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_dialog_message_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_dialog_message_prefer... | Returns whether the message of the example dialog should be shown or not . |
125,440 | private String getDialogMessage ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . dialog_message_preference_key ) ; String defaultValue = getString ( R . string . dialog_message_preference_default_value ) ; return shar... | Returns the message of the example dialog . |
125,441 | private boolean shouldNegativeButtonBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_negative_button_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_negative_butt... | Returns whether the negative button of the example dialog should be shown or not . |
125,442 | private String getNegativeButtonText ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . negative_button_text_preference_key ) ; String defaultValue = getString ( R . string . negative_button_text_preference_default_valu... | Returns the text of the example dialog s negative button . |
125,443 | private boolean shouldNeutralButtonBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_neutral_button_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_neutral_button_... | Returns whether the neutral button of the example dialog should be shown or not . |
125,444 | private String getNeutralButtonText ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . neutral_button_text_preference_key ) ; String defaultValue = getString ( R . string . neutral_button_text_preference_default_value )... | Returns the text of the example dialog s neutral button . |
125,445 | private boolean shouldPositiveButtonBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_positive_button_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_positive_butt... | Returns whether the positive button of the example dialog should be shown or not . |
125,446 | private String getPositiveButtonText ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . positive_button_text_preference_key ) ; String defaultValue = getString ( R . string . positive_button_text_preference_default_valu... | Returns the text of the example dialog s positive button . |
125,447 | private boolean shouldStackButtons ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . stack_buttons_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . stack_buttons_preference_default_v... | Returns whether the buttons of the example dialog should be stacked or not . |
125,448 | private boolean shouldButtonBarDividerBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_button_bar_divider_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_button_b... | Returns whether the divider which is located above the dialog s buttons should be shown or not . |
125,449 | private boolean shouldHeaderBeShown ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_dialog_header_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_dialog_header_preferenc... | Returns whether the header of the example dialog should be shown or not . |
125,450 | private boolean shouldUseAnimations ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . animation_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . animation_preference_default_value ) ... | Returns whether animations should be used to show or hide dialogs or not . |
125,451 | private boolean shouldUseFullscreen ( ) { SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . fullscreen_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . fullscreen_preference_default_value ... | Returns whether dialogs should be shown fullscreen or not . |
125,452 | public final void showAlertDialog ( final View view ) { initializeAlertDialog ( ) ; alertDialog . setShowAnimation ( createCircleRevealAnimation ( view ) ) ; alertDialog . setDismissAnimation ( createCircleRevealAnimation ( view ) ) ; alertDialog . setCancelAnimation ( createCircleRevealAnimation ( view ) ) ; alertDial... | Shows an alert dialog using a circle reveal animation . |
125,453 | private AnimatorListener createVisibilityAnimationListener ( final boolean show ) { return new AnimatorListenerAdapter ( ) { public void onAnimationStart ( final Animator animation ) { super . onAnimationStart ( animation ) ; if ( show ) { Divider . super . setVisibility ( View . VISIBLE ) ; } } public void onAnimation... | Creates and returns a listener which allows to observe the progress of an animation which is used to show or hide the divider . |
125,454 | public final void setVisibility ( final int visibility , final boolean animate ) { boolean visible = visibility == View . VISIBLE ; Boolean tag = ( Boolean ) getTag ( ) ; setTag ( visible ) ; if ( animate ) { if ( tag == null || tag != visible ) { if ( getAnimation ( ) != null ) { getAnimation ( ) . cancel ( ) ; } anim... | Sets the visibility of the divider . |
125,455 | private Map < ViewType , View > applyDecorators ( final Window window , final DialogRootView rootView , final View view , final FragmentManager fragmentManager ) { Map < ViewType , View > result = new HashMap < > ( ) ; for ( AbstractDecorator < ? , ? > decorator : decorators ) { if ( decorator instanceof AbstractDialog... | Applies all registered decorators to the dialog . |
125,456 | private void detachDecorators ( final DialogRootView rootView ) { for ( AbstractDecorator < ? , ? > decorator : decorators ) { decorator . detach ( ) ; decorator . removeAreaListener ( rootView ) ; } } | Detaches all registered decorators from the dialog . |
125,457 | private void obtainShowHeader ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogShowHeader } ) ; showHeader ( typedArray . getBoolean ( 0 , false ) ) ; } | Obtains whether the dialog s header should be shown or not from a specific theme . |
125,458 | private void obtainHeaderHeight ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderHeight } ) ; int defaultHeight = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . dialog_... | Obtains the height of the dialog s header from a specific theme . |
125,459 | private void obtainHeaderBackground ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderBackground } ) ; int resourceId = typedArray . getResourceId ( 0 , 0 ) ; if ( resourceId != 0 ) { setHeaderB... | Obtains the background of the dialog s header from a specific theme . |
125,460 | private void obtainHeaderIcon ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderIcon } ) ; int resourceId = typedArray . getResourceId ( 0 , 0 ) ; if ( resourceId != 0 ) { setHeaderIcon ( resour... | Obtains the icon of the dialog s header from a specific theme . |
125,461 | private void obtainHeaderIconTintList ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderIconTint } ) ; setHeaderIconTintList ( typedArray . getColorStateList ( 0 ) ) ; } | Obtains the color state list which is used to tint the header icon of the dialog from a specific theme . |
125,462 | private void obtainHeaderDividerColor ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderDividerColor } ) ; int defaultColor = ContextCompat . getColor ( getContext ( ) , R . color . header_divid... | Obtains the color of the divider of the dialog s header from a specific theme . |
125,463 | private void obtainShowHeaderDivider ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogShowHeaderDivider } ) ; showHeaderDivider ( typedArray . getBoolean ( 0 , true ) ) ; } | Obtains whether the divider of the dialog s header should be shown or not from a specific theme . |
125,464 | public static ScrollableArea create ( final Area top , final Area bottom ) { return new ScrollableArea ( top , bottom ) ; } | Creates and returns a new scrollable area . |
125,465 | public final boolean isScrollable ( final Area area ) { return topScrollableArea != null && topScrollableArea . getIndex ( ) <= area . getIndex ( ) && bottomScrollableArea . getIndex ( ) >= area . getIndex ( ) ; } | Returns whether a specific area is scrollable . |
125,466 | private void reInflateTabLayout ( ) { View rootView = getRootView ( ) ; if ( rootView != null ) { View headerContentContainer = rootView . findViewById ( R . id . header_content_container ) ; View contentContainer = rootView . findViewById ( R . id . content_container ) ; if ( headerContentContainer != null && contentC... | Re - inflates the tab layout which indicates the currently shown fragment if the dialog has already been created . |
125,467 | private void inflateTabLayout ( final View headerView , final View contentView ) { LayoutInflater layoutInflater = LayoutInflater . from ( getContext ( ) ) ; ViewGroup headerContentContainer = headerView . findViewById ( R . id . header_content_container ) ; ViewGroup contentContainer = contentView . findViewById ( R .... | Inflates the tab layout which indicates the currently shown fragment . |
125,468 | 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 ) ; }... | Adapts the enable state of the tab layout which indicates the currently shown fragment . |
125,469 | private void adaptTabLayoutVisibility ( ) { if ( tabLayout != null ) { tabLayout . setVisibility ( tabLayoutShown ? View . VISIBLE : View . GONE ) ; } } | Adapts the visibility of the tab layout which indicates the currently shown fragment . |
125,470 | private void adaptBackButton ( ) { if ( backButton != null ) { backButton . setText ( backButtonText . toString ( ) . toUpperCase ( Locale . getDefault ( ) ) ) ; backButton . setOnClickListener ( createBackButtonListener ( ) ) ; } } | Adapts the dialog s back button . |
125,471 | private OnClickListener createBackButtonListener ( ) { return new OnClickListener ( ) { public void onClick ( final View v ) { int selectedIndex = viewPager . getCurrentItem ( ) ; if ( notifyOnPrevious ( selectedIndex ) ) { viewPager . setCurrentItem ( selectedIndex - 1 ) ; } } } ; } | Creates and returns a listener which allows to show the previous fragment when the corresponding button is clicked . |
125,472 | private void adaptNextButton ( ) { if ( nextButton != null ) { nextButton . setText ( nextButtonText . toString ( ) . toUpperCase ( Locale . getDefault ( ) ) ) ; nextButton . setOnClickListener ( createNextButtonListener ( ) ) ; } } | Adapts the dialog s next button . |
125,473 | private OnClickListener createNextButtonListener ( ) { return new OnClickListener ( ) { public void onClick ( final View v ) { int selectedIndex = viewPager . getCurrentItem ( ) ; if ( notifyOnNext ( selectedIndex ) ) { viewPager . setCurrentItem ( selectedIndex + 1 ) ; } } } ; } | Creates and returns a listener which allows to show the next fragment when the corresponding button is clicked . |
125,474 | private void adaptFinishButton ( ) { if ( finishButton != null ) { finishButton . setText ( finishButtonText . toString ( ) . toUpperCase ( Locale . getDefault ( ) ) ) ; finishButton . setOnClickListener ( createFinishButtonListener ( ) ) ; } } | Adapts the dialog s finish button . |
125,475 | private OnClickListener createFinishButtonListener ( ) { return new OnClickListener ( ) { public void onClick ( final View v ) { int selectedIndex = viewPager . getCurrentItem ( ) ; if ( notifyOnFinish ( selectedIndex ) ) { getDialog ( ) . dismiss ( ) ; } } } ; } | Creates and returns a listener which allows to close the dialog when the corresponding button is clicked . |
125,476 | private void adaptButtonBarVisibility ( ) { if ( buttonBarContainer != null ) { buttonBarContainer . setVisibility ( buttonBarShown ? View . VISIBLE : View . GONE ) ; } } | Adapts the visibility of the dialog s buttons . |
125,477 | private void adaptButtonBarDividerMargin ( ) { if ( buttonBarDivider != null ) { LinearLayout . LayoutParams layoutParams = ( LinearLayout . LayoutParams ) buttonBarDivider . getLayoutParams ( ) ; layoutParams . leftMargin = buttonBarDividerMargin ; layoutParams . rightMargin = buttonBarDividerMargin ; buttonBarDivider... | Adapts the left and right margin of the divider which is shown above the dialog s buttons . |
125,478 | 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 . setVisib... | Adapts the visibility of the dialog s buttons depending on the currently shown fragment . |
125,479 | private boolean notifyOnNext ( final int index ) { boolean result = true ; for ( WizardListener listener : wizardListeners ) { result &= listener . onNext ( index , viewPagerAdapter . getItem ( index ) ) ; } return result ; } | Notifies all listeners when the next fragment is about to be shown . |
125,480 | private boolean notifyOnPrevious ( final int index ) { boolean result = true ; for ( WizardListener listener : wizardListeners ) { result &= listener . onPrevious ( index , viewPagerAdapter . getItem ( index ) ) ; } return result ; } | Notifies all listeners when the previous fragment is about to be shown . |
125,481 | private boolean notifyOnFinish ( final int index ) { boolean result = true ; for ( WizardListener listener : wizardListeners ) { result &= listener . onFinish ( index , viewPagerAdapter . getItem ( index ) ) ; } return result ; } | Notifies all listeners when the last fragment is about to be finished . |
125,482 | private void obtainButtonTextColor ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogButtonTextColor } ) ; ColorStateList colorStateList = typedArray . getColorStateList ( 0 ) ; if ( colorStateList !=... | Obtains the button text color from a specific theme . |
125,483 | private void obtainShowButtonBarDivider ( final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogShowButtonBarDivider } ) ; showButtonBarDivider ( typedArray . getBoolean ( 0 , false ) ) ; } | Obtains whether the divider which is located above the dialog s buttons should be shown or not from a specific theme . |
125,484 | public final BuilderType addDialogValidator ( final DialogValidator validator ) { Condition . INSTANCE . ensureNotNull ( validator , "The validator may not be null" ) ; getProduct ( ) . addDialogValidator ( validator ) ; return self ( ) ; } | Adds a new validator which should be executed when the positive button of the dialog which is created by the builder is clicked . |
125,485 | public final BuilderType addAllDialogValidators ( final Collection < DialogValidator > validators ) { Condition . INSTANCE . ensureNotNull ( validators , "The collection may not be null" ) ; getProduct ( ) . addAllDialogValidators ( validators ) ; return self ( ) ; } | Adds all validators which are contained by a specific collection and should be executed when the positive button of the dialog which is created by the builder is clicked . |
125,486 | public static void show ( FragmentManager fragmentManager , Class < ? extends MvcDialog > dialogClass ) { FragmentTransaction ft = fragmentManager . beginTransaction ( ) ; MvcDialog dialogFragment = ( MvcDialog ) fragmentManager . findFragmentByTag ( dialogClass . getName ( ) ) ; if ( dialogFragment == null ) { try { d... | Show dialog . |
125,487 | public void onCreate ( ) { super . onCreate ( ) ; graphMonitor = new Graph . Monitor ( ) { public void onInject ( Object target ) { if ( controller != null && target == MvcService . this ) { controller . view = MvcService . this ; } } public void onRelease ( Object target ) { } } ; Mvc . graph ( ) . registerMonitor ( g... | Callback of creating a service |
125,488 | public void onDestroy ( ) { super . onDestroy ( ) ; eventRegister . unregisterEventBuses ( ) ; if ( getControllerClass ( ) != null ) { try { Mvc . graph ( ) . dereference ( controller , getControllerClass ( ) , null ) ; } catch ( ProviderMissingException e ) { Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ... | Callback of destroying a service |
125,489 | public Component unregister ( Provider provider ) throws ProviderMissingException { return unregister ( provider . type ( ) , provider . getQualifier ( ) ) ; } | Unregister provider . If there is an overridden type registered already only unregister the overridden binding . The original one will be unregistered if the this method is called again against to the type and qualifier associated with the provider . |
125,490 | protected < T > Provider < T > findProvider ( Class < T > type , Annotation qualifier ) throws ProviderMissingException { String key = PokeHelper . makeProviderKey ( type , qualifier ) ; Component targetComponent = getRootComponent ( ) . componentLocator . get ( key ) ; Provider provider = null ; if ( targetComponent !... | Find the provider specified by the type and qualifier . It will look through the providers registered to this component and all its children components . |
125,491 | private void addNewKeyToComponent ( String key , Component component ) throws ProviderConflictException { Component root = getRootComponent ( ) ; if ( componentLocator . keySet ( ) . contains ( key ) ) { String msg = String . format ( "Type %s has already been registered " + "in this component(%s)." , key , getComponen... | Add key to the component locator of the component . This component and the the component tree root s component locator will both be updated . |
125,492 | public void release ( final Object target ) { if ( uiThreadRunner . isOnUiThread ( ) ) { try { graph . release ( target , Inject . class ) ; } catch ( ProviderMissingException e ) { throw new MvcGraphException ( e . getMessage ( ) , e ) ; } } else { uiThreadRunner . post ( new Runnable ( ) { public void run ( ) { try {... | Release cached instances held by fields of target object . References of instances of the instances will be decremented . Once the reference count of a contract type reaches 0 it will be removed from the instances . |
125,493 | private void go ( ) { if ( navigateEvent != null ) { navigationManager . postEvent2C ( navigateEvent ) ; if ( navigationManager . logger . isTraceEnabled ( ) ) { if ( navigateEvent instanceof NavigationManager . Event . OnLocationForward ) { NavigationManager . Event . OnLocationForward event = ( NavigationManager . Ev... | Sends out the navigation event to execute the navigation |
125,494 | void destroy ( ) { if ( onSettled != null ) { onSettled . run ( ) ; } if ( pendingReleaseInstances != null ) { for ( PendingReleaseInstance i : pendingReleaseInstances ) { try { Mvc . graph ( ) . dereference ( i . instance , i . type , i . qualifier ) ; } catch ( ProviderMissingException e ) { navigationManager . logge... | Internal use . Don t do it in your app . |
125,495 | private void checkAppExit ( Object sender ) { NavLocation curLocation = navigationManager . getModel ( ) . getCurrentLocation ( ) ; if ( curLocation == null ) { navigationManager . postEvent2C ( new NavigationManager . Event . OnAppExit ( sender ) ) ; } } | Check the app is exiting |
125,496 | private void dumpHistory ( ) { if ( navigationManager . dumpHistoryOnLocationChange ) { navigationManager . logger . trace ( "" ) ; navigationManager . logger . trace ( "Nav Controller: dump: begin -------------------------------------------- ) ; NavLocation curLoc = navigationManager . getModel ( ) . getCurrentLocatio... | Prints navigation history |
125,497 | void retain ( Object owner , Field field ) { retain ( ) ; Map < String , Integer > fields = owners . get ( owner ) ; if ( fields == null ) { fields = new HashMap < > ( ) ; owners . put ( owner , fields ) ; } Integer count = fields . get ( field . toGenericString ( ) ) ; if ( count == null ) { fields . put ( field . toG... | Retain an instance injected as a field of an object |
125,498 | void release ( Object owner , Field field ) { Map < String , Integer > fields = owners . get ( owner ) ; if ( fields != null ) { release ( ) ; Integer count = fields . get ( field . toGenericString ( ) ) ; if ( -- count > 0 ) { fields . put ( field . toGenericString ( ) , count ) ; } else { fields . remove ( field . to... | Release an instance injected as a field of an object |
125,499 | public T getCachedInstance ( ) { ScopeCache cache = getScopeCache ( ) ; if ( cache != null ) { String key = PokeHelper . makeProviderKey ( type , qualifier ) ; Object instance = cache . findInstance ( key ) ; if ( instance != null ) { return ( T ) instance ; } } return null ; } | Get the cached instance of this provider when there is a instances associated with this provider and the instance is cached already . Note that the method will NOT increase reference count of this provider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.