use of android.support.v7.preference.PreferenceGroupAdapter in project android_packages_apps_Settings by crdroidandroid.
the class SettingsPreferenceFragment method canUseListViewForHighLighting.
/**
* Return a valid ListView position or -1 if none is found
*/
private int canUseListViewForHighLighting(String key) {
if (getListView() == null) {
return -1;
}
RecyclerView listView = getListView();
RecyclerView.Adapter adapter = listView.getAdapter();
if (adapter != null && adapter instanceof PreferenceGroupAdapter) {
return findListPositionFromKey((PreferenceGroupAdapter) adapter, key);
}
return -1;
}
use of android.support.v7.preference.PreferenceGroupAdapter in project android_packages_apps_Settings by crdroidandroid.
the class SettingsPreferenceFragment method findListPositionFromKey.
private int findListPositionFromKey(PreferenceGroupAdapter adapter, String key) {
final int count = adapter.getItemCount();
for (int n = 0; n < count; n++) {
final Preference preference = adapter.getItem(n);
final String preferenceKey = preference.getKey();
if (preferenceKey != null && preferenceKey.equals(key)) {
return n;
}
}
return -1;
}
use of android.support.v7.preference.PreferenceGroupAdapter in project android_packages_apps_Settings by SudaMod.
the class SettingsPreferenceFragment method canUseListViewForHighLighting.
/**
* Return a valid ListView position or -1 if none is found
*/
private int canUseListViewForHighLighting(String key) {
if (getListView() == null) {
return -1;
}
RecyclerView listView = getListView();
RecyclerView.Adapter adapter = listView.getAdapter();
if (adapter != null && adapter instanceof PreferenceGroupAdapter) {
return findListPositionFromKey((PreferenceGroupAdapter) adapter, key);
}
return -1;
}
use of android.support.v7.preference.PreferenceGroupAdapter in project android_packages_apps_Settings by SudaMod.
the class SettingsPreferenceFragment method findListPositionFromKey.
private int findListPositionFromKey(PreferenceGroupAdapter adapter, String key) {
final int count = adapter.getItemCount();
for (int n = 0; n < count; n++) {
final Preference preference = adapter.getItem(n);
final String preferenceKey = preference.getKey();
if (preferenceKey != null && preferenceKey.equals(key)) {
return n;
}
}
return -1;
}
use of android.support.v7.preference.PreferenceGroupAdapter in project android_packages_apps_CMParts by LineageOS.
the class SettingsPreferenceFragment method canUseListViewForHighLighting.
/**
* Return a valid ListView position or -1 if none is found
*/
private int canUseListViewForHighLighting(String key) {
if (getListView() == null) {
return -1;
}
RecyclerView listView = getListView();
RecyclerView.Adapter adapter = listView.getAdapter();
if (adapter != null && adapter instanceof PreferenceGroupAdapter) {
return findListPositionFromKey((PreferenceGroupAdapter) adapter, key);
}
return -1;
}
Aggregations