preference/src/androidTest/java/androidx/preference/PreferenceGroupInitialExpandedChildrenCountTest.java
@Test
    @UiThreadTest
    public void clickExpandButton_shouldShowAllPreferences() {
        mScreen.setInitialExpandedChildrenCount(INITIAL_EXPANDED_COUNT);

        // First showing 5 preference with expand button
        PreferenceGroupAdapter preferenceGroupAdapter =
                PreferenceGroupAdapter.createInstanceWithCustomHandler(mScreen, mHandler);
        assertPreferencesAreCollapsed(preferenceGroupAdapter);

        // Click the expand button, should review all preferences
        final Preference expandButton = preferenceGroupAdapter.getItem(INITIAL_EXPANDED_COUNT);
        expandButton.performClick();
        assertPreferencesAreExpanded(preferenceGroupAdapter);
    }
/**
     * Verifies that clicking the expand button will show all preferences.
     */
Verifies that clicking the expand button will show all preferences.
Verifies that clicking the expand button will show all preferences .
@Test
    @UiThreadTest
    public void clickExpandButton_shouldShowAllPreferences() {
        mScreen.setInitialExpandedChildrenCount(INITIAL_EXPANDED_COUNT);
        PreferenceGroupAdapter preferenceGroupAdapter =
                PreferenceGroupAdapter.createInstanceWithCustomHandler(mScreen, mHandler);
        assertPreferencesAreCollapsed(preferenceGroupAdapter);
        final Preference expandButton = preferenceGroupAdapter.getItem(INITIAL_EXPANDED_COUNT);
        expandButton.performClick();
        assertPreferencesAreExpanded(preferenceGroupAdapter);
    }
@ Test @ UiThreadTest public void clickExpandButton_shouldShowAllPreferences ( ) { mScreen . setInitialExpandedChildrenCount ( INITIAL_EXPANDED_COUNT ) ; PreferenceGroupAdapter preferenceGroupAdapter = PreferenceGroupAdapter . createInstanceWithCustomHandler ( mScreen , mHandler ) ; assertPreferencesAreCollapsed ( preferenceGroupAdapter ) ; final Preference expandButton = preferenceGroupAdapter . getItem ( INITIAL_EXPANDED_COUNT ) ; expandButton . performClick ( ) ; assertPreferencesAreExpanded ( preferenceGroupAdapter ) ; }
Verifies that clicking the expand button will show all preferences.
Verifies that clicking the expand button will show all preferences .
// First showing 5 preference with expand button // Click the expand button, should review all preferences