Add None-entry to ListPreference

This commit is contained in:
Dominik Schürmann 2014-02-15 18:04:30 +01:00
parent b97a099598
commit 9f7f4fd27a
12 changed files with 24 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="openpgp_list_preference_none">None</string>
</resources>

View File

@ -33,6 +33,8 @@ import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import org.sufficientlysecure.keychain.api.R;
public class OpenPgpListPreference extends DialogPreference {
ArrayList<OpenPgpProviderEntry> mProviderList = new ArrayList<OpenPgpProviderEntry>();
private String mSelectedPackage;
@ -55,6 +57,10 @@ public class OpenPgpListPreference extends DialogPreference {
mProviderList.add(new OpenPgpProviderEntry(packageName, simpleName, icon));
}
}
// add "none"
mProviderList.add(0, new OpenPgpProviderEntry("", context.getString(R.string.openpgp_list_preference_none),
context.getResources().getDrawable(R.drawable.ic_action_cancel_launchersize)));
}
public OpenPgpListPreference(Context context) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="openpgp_list_preference_none">None</string>
</resources>

View File

@ -33,6 +33,8 @@ import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import org.sufficientlysecure.keychain.api.R;
public class OpenPgpListPreference extends DialogPreference {
ArrayList<OpenPgpProviderEntry> mProviderList = new ArrayList<OpenPgpProviderEntry>();
private String mSelectedPackage;
@ -55,6 +57,10 @@ public class OpenPgpListPreference extends DialogPreference {
mProviderList.add(new OpenPgpProviderEntry(packageName, simpleName, icon));
}
}
// add "none"
mProviderList.add(0, new OpenPgpProviderEntry("", context.getString(R.string.openpgp_list_preference_none),
context.getResources().getDrawable(R.drawable.ic_action_cancel_launchersize)));
}
public OpenPgpListPreference(Context context) {