Add None-entry to ListPreference
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="openpgp_list_preference_none">None</string>
|
||||||
|
|
||||||
|
</resources>
|
@ -33,6 +33,8 @@ import android.widget.TextView;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.api.R;
|
||||||
|
|
||||||
public class OpenPgpListPreference extends DialogPreference {
|
public class OpenPgpListPreference extends DialogPreference {
|
||||||
ArrayList<OpenPgpProviderEntry> mProviderList = new ArrayList<OpenPgpProviderEntry>();
|
ArrayList<OpenPgpProviderEntry> mProviderList = new ArrayList<OpenPgpProviderEntry>();
|
||||||
private String mSelectedPackage;
|
private String mSelectedPackage;
|
||||||
@ -55,6 +57,10 @@ public class OpenPgpListPreference extends DialogPreference {
|
|||||||
mProviderList.add(new OpenPgpProviderEntry(packageName, simpleName, icon));
|
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) {
|
public OpenPgpListPreference(Context context) {
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
6
libraries/keychain-api-library/res/values/strings.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="openpgp_list_preference_none">None</string>
|
||||||
|
|
||||||
|
</resources>
|
@ -33,6 +33,8 @@ import android.widget.TextView;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.api.R;
|
||||||
|
|
||||||
public class OpenPgpListPreference extends DialogPreference {
|
public class OpenPgpListPreference extends DialogPreference {
|
||||||
ArrayList<OpenPgpProviderEntry> mProviderList = new ArrayList<OpenPgpProviderEntry>();
|
ArrayList<OpenPgpProviderEntry> mProviderList = new ArrayList<OpenPgpProviderEntry>();
|
||||||
private String mSelectedPackage;
|
private String mSelectedPackage;
|
||||||
@ -55,6 +57,10 @@ public class OpenPgpListPreference extends DialogPreference {
|
|||||||
mProviderList.add(new OpenPgpProviderEntry(packageName, simpleName, icon));
|
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) {
|
public OpenPgpListPreference(Context context) {
|
||||||
|