Java Code Examples for android.content.RestrictionEntry#setType()
The following examples show how to use
android.content.RestrictionEntry#setType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GetRestrictionsReceiver.java From enterprise-samples with Apache License 2.0 | 5 votes |
public static void populateChoiceEntry(Resources res, RestrictionEntry reSingleChoice) { String[] choiceEntries = res.getStringArray(R.array.choice_entry_entries); String[] choiceValues = res.getStringArray(R.array.choice_entry_values); if (reSingleChoice.getSelectedString() == null) { reSingleChoice.setSelectedString(choiceValues[0]); } reSingleChoice.setTitle(res.getString(R.string.choice_entry_title)); reSingleChoice.setChoiceEntries(choiceEntries); reSingleChoice.setChoiceValues(choiceValues); reSingleChoice.setType(RestrictionEntry.TYPE_CHOICE); }
Example 2
Source File: GetRestrictionsReceiver.java From enterprise-samples with Apache License 2.0 | 5 votes |
public static void populateMultiEntry(Resources res, RestrictionEntry reMultiSelect) { String[] multiEntries = res.getStringArray(R.array.multi_entry_entries); String[] multiValues = res.getStringArray(R.array.multi_entry_values); if (reMultiSelect.getAllSelectedStrings() == null) { reMultiSelect.setAllSelectedStrings(new String[0]); } reMultiSelect.setTitle(res.getString(R.string.multi_entry_title)); reMultiSelect.setChoiceEntries(multiEntries); reMultiSelect.setChoiceValues(multiValues); reMultiSelect.setType(RestrictionEntry.TYPE_MULTI_SELECT); }
Example 3
Source File: ManagedConfigurationsFragment.java From android-testdpc with Apache License 2.0 | 5 votes |
/** * TODO (b/23378519): Remove this method and add support for type choice and null. */ private void convertTypeChoiceAndNullToString(List<RestrictionEntry> restrictionEntries) { for (RestrictionEntry entry : restrictionEntries) { if (entry.getType() == RestrictionEntry.TYPE_CHOICE || entry.getType() == RestrictionEntry.TYPE_NULL) { entry.setType(RestrictionEntry.TYPE_STRING); } } }
Example 4
Source File: GetRestrictionsReceiver.java From android-AppRestrictions with Apache License 2.0 | 5 votes |
public static void populateChoiceEntry(Resources res, RestrictionEntry reSingleChoice) { String[] choiceEntries = res.getStringArray(R.array.choice_entry_entries); String[] choiceValues = res.getStringArray(R.array.choice_entry_values); if (reSingleChoice.getSelectedString() == null) { reSingleChoice.setSelectedString(choiceValues[0]); } reSingleChoice.setTitle(res.getString(R.string.choice_entry_title)); reSingleChoice.setChoiceEntries(choiceEntries); reSingleChoice.setChoiceValues(choiceValues); reSingleChoice.setType(RestrictionEntry.TYPE_CHOICE); }
Example 5
Source File: GetRestrictionsReceiver.java From android-AppRestrictions with Apache License 2.0 | 5 votes |
public static void populateMultiEntry(Resources res, RestrictionEntry reMultiSelect) { String[] multiEntries = res.getStringArray(R.array.multi_entry_entries); String[] multiValues = res.getStringArray(R.array.multi_entry_values); if (reMultiSelect.getAllSelectedStrings() == null) { reMultiSelect.setAllSelectedStrings(new String[0]); } reMultiSelect.setTitle(res.getString(R.string.multi_entry_title)); reMultiSelect.setChoiceEntries(multiEntries); reMultiSelect.setChoiceValues(multiValues); reMultiSelect.setType(RestrictionEntry.TYPE_MULTI_SELECT); }
Example 6
Source File: GetRestrictionsReceiver.java From enterprise-samples with Apache License 2.0 | 4 votes |
public static void populateBooleanEntry(Resources res, RestrictionEntry entry) { entry.setType(RestrictionEntry.TYPE_BOOLEAN); entry.setTitle(res.getString(R.string.boolean_entry_title)); }
Example 7
Source File: GetRestrictionsReceiver.java From android-AppRestrictions with Apache License 2.0 | 4 votes |
public static void populateBooleanEntry(Resources res, RestrictionEntry entry) { entry.setType(RestrictionEntry.TYPE_BOOLEAN); entry.setTitle(res.getString(R.string.boolean_entry_title)); }