Skip to content

Instantly share code, notes, and snippets.

@Tyderion
Last active August 29, 2015 14:00
Show Gist options
  • Save Tyderion/11288287 to your computer and use it in GitHub Desktop.
Save Tyderion/11288287 to your computer and use it in GitHub Desktop.
Preferences wrong default padding
package ch.isageek.tyderion.habittracker.settings;
import android.content.Context;
import android.preference.TwoStatePreference;
import android.util.AttributeSet;
import ch.isageek.tyderion.habittracker.R;
/**
* Created by tzhnaga1 on 24/04/14.
*/
public class DropboxConnectorPreference extends TwoStatePreference {
public DropboxConnectorPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setSummary(R.string.dropbox_disconnected);
}
}
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<ch.isageek.tyderion.habittracker.settings.DropboxConnectorPreference
android:key="pref_dropbox"
android:title="@string/dropbox_title" />
<Preference
android:key="test"
android:title="Blablabla"
android:summary="Test summary"
/>
<ListPreference
android:dependency="pref_dropbox"
android:key="pref_dropboxSyncSchedule"
android:title="@string/connection_type"
android:dialogTitle="Select connection type"
android:entries="@array/pref_dropboxSyncSchedule"
android:entryValues="@array/pref_dropboxSyncSchedule_values"
android:defaultValue="Never" />
</PreferenceScreen>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment