Java Code Examples for android.preference.PreferenceScreen#bind()

The following examples show how to use android.preference.PreferenceScreen#bind() . 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: PreferenceCompatFragment.java    From Audinaut with GNU General Public License v3.0 5 votes vote down vote up
private void bindPreferences() {
    PreferenceScreen localPreferenceScreen = getPreferenceScreen();
    if (localPreferenceScreen != null) {
        ListView localListView = getListView();
        localPreferenceScreen.bind(localListView);
    }
}
 
Example 2
Source File: PreferenceCompatFragment.java    From Popeens-DSub with GNU General Public License v3.0 5 votes vote down vote up
private void bindPreferences() {
	PreferenceScreen localPreferenceScreen = getPreferenceScreen();
	if (localPreferenceScreen != null) {
		ListView localListView = getListView();
		localPreferenceScreen.bind(localListView);
	}
}
 
Example 3
Source File: PreferenceFragmentBase.java    From AcDisplay with GNU General Public License v2.0 5 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        preferenceScreen.bind(getListView());
    }
    onBindPreferences();
}
 
Example 4
Source File: PreferenceFragmentCompat.java    From MaxLock with GNU General Public License v3.0 5 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        preferenceScreen.bind(getListView());
    } else {
        return;
    }
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
        // https://github.com/android/platform_frameworks_base/commit/2d43d283fc0f22b08f43c6db4da71031168e7f59
        getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(final AdapterView<?> parent, final View view, int position, final long id) {
                // If the list has headers, subtract them from the index.
                if (parent instanceof ListView) {
                    position -= ((ListView) parent).getHeaderViewsCount();
                }
                try {
                    final Object item = preferenceScreen.getRootAdapter().getItem(position);
                    if (!(item instanceof Preference)) {
                        return;
                    }
                    final Preference preference = (Preference) item;
                    final Method performClick = Preference.class.getDeclaredMethod("performClick", PreferenceScreen.class);
                    performClick.setAccessible(true);
                    performClick.invoke(preference, preferenceScreen);
                } catch (final Exception e) {
                    Log.e(TAG, "Couldn't call Preference.performClick by reflection", e);
                }
            }

        });
    }
}
 
Example 5
Source File: PreferenceFragmentBase.java    From HeadsUp with GNU General Public License v2.0 5 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        preferenceScreen.bind(getListView());
    }
    onBindPreferences();
}
 
Example 6
Source File: PreferenceListFragment.java    From GeoLog with Apache License 2.0 5 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
    	try {
    		if (lv == null) lv = getListView();
    		preferenceScreen.bind(lv);
    	} catch (Exception e) {        		
    	}
    }
}
 
Example 7
Source File: PreferencesListFragment.java    From Linphone4Android with GNU General Public License v3.0 4 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null && preferencesList != null) {
        preferenceScreen.bind(preferencesList);
    }
}
 
Example 8
Source File: PreferenceListFragment.java    From sms-ticket with Apache License 2.0 4 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        preferenceScreen.bind(lv);
    }
}
 
Example 9
Source File: PreferenceListFragment.java    From android_dbinspector with Apache License 2.0 4 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        preferenceScreen.bind(lv);
    }
}
 
Example 10
Source File: PreferenceListFragment.java    From screenstandby with GNU General Public License v2.0 4 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null && lv != null) {
        preferenceScreen.bind(lv);
    }
}
 
Example 11
Source File: PreferenceDialogFragment.java    From meatspace-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private void bindPreferences() {
    final PreferenceScreen preferenceScreen = getPreferenceScreen();
    if (preferenceScreen != null) {
        preferenceScreen.bind(lv);
    }
}