+ * See
+ * Android Design: Settings for design guidelines and the Settings
+ * API Guide for more information on developing a Settings UI.
+ */
+public class SettingsActivity extends PreferenceActivity {
+ /**
+ * Determines whether to always show the simplified settings UI, where
+ * settings are presented in a single list. When false, settings are shown
+ * as a master/detail two-pane view on tablets. When true, a single pane is
+ * shown on tablets.
+ */
+ private static final boolean ALWAYS_SIMPLE_PREFS = false;
+
+ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+ setupSimplePreferencesScreen();
+ //This doesn't always work right with HoneyComb, so I removed it.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ {
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ }
+ }
+
+ /**
+ * Shows the simplified settings UI if the device configuration if the
+ * device configuration dictates that a simplified, single-pane UI should be
+ * shown.
+ */
+ @SuppressWarnings("deprecation")
+ private void setupSimplePreferencesScreen() {
+ if (!isSimplePreferences(this)) {
+ return;
+ }
+
+ // In the simplified UI, fragments are not used at all and we instead
+ // use the older PreferenceActivity APIs.
+
+ // Add 'general' preferences.
+ addPreferencesFromResource(R.xml.pref_name);
+
+
+ // Bind the summaries of EditText/List/Dialog/Ringtone preferences to
+ // their values. When their values change, their summaries are updated
+ // to reflect the new value, per the Android Design guidelines.
+
+ }
+
+ @Override
+ public boolean onIsMultiPane() {
+ return isLargeTablet(this) && !isSimplePreferences(this);
+ }
+
+ /**
+ * Helper method to determine if the device has an extra-large screen. For
+ * example, 10" tablets are extra-large.
+ */
+ private static boolean isLargeTablet(Context context) {
+ return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
+ }
+
+ /**
+ * Determines whether the simplified settings UI should be shown. This is
+ * true if this is forced via {@link #ALWAYS_SIMPLE_PREFS}, or the device
+ * doesn't have newer APIs like {@link PreferenceFragment}, or the device
+ * doesn't have an extra-large screen. In these cases, a single-pane
+ * "simplified" settings UI should be shown.
+ */
+ private static boolean isSimplePreferences(Context context) {
+ return ALWAYS_SIMPLE_PREFS
+ || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public void onBuildHeaders(List["a", "b", "c"]
+ * @param separator
+ * Separates entries ex.: ","
+ * @return joined string ex.: "a,b,c"
+ */
+ protected static String join(Iterable> iterable, String separator) {
+ Iterator> oIter;
+ if (iterable == null || (!(oIter = iterable.iterator()).hasNext()))
+ return "";
+ StringBuilder oBuilder = new StringBuilder(String.valueOf(oIter.next()));
+ while (oIter.hasNext())
+ oBuilder.append(separator).append(oIter.next());
+ return oBuilder.toString();
+ }
+}
diff --git a/library/src/com/mobeta/android/dslv/DragSortListView.java b/library/src/com/mobeta/android/dslv/DragSortListView.java
index ed45637..a90786e 100644
--- a/library/src/com/mobeta/android/dslv/DragSortListView.java
+++ b/library/src/com/mobeta/android/dslv/DragSortListView.java
@@ -640,7 +640,7 @@ public ListAdapter getInputAdapter() {
}
}
- private class AdapterWrapper implements WrapperListAdapter {
+ private class AdapterWrapper extends BaseAdapter implements WrapperListAdapter {
private ListAdapter mAdapter;
public AdapterWrapper(ListAdapter adapter) {