Java Code Examples for android.content.RestrictionEntry#setTitle()

The following examples show how to use android.content.RestrictionEntry#setTitle() . 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 vote down vote up
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 vote down vote up
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: GetRestrictionsReceiver.java    From android-AppRestrictions with Apache License 2.0 5 votes vote down vote up
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 4
Source File: GetRestrictionsReceiver.java    From android-AppRestrictions with Apache License 2.0 5 votes vote down vote up
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 5
Source File: GetRestrictionReceiver.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
private ArrayList<RestrictionEntry> initRestrictions(Context context) {
    ArrayList<RestrictionEntry> restrictions = new ArrayList<RestrictionEntry>();
    RestrictionEntry allowChanges = new RestrictionEntry("allow_changes",false);
    allowChanges.setTitle(context.getString(R.string.allow_vpn_changes));
    restrictions.add(allowChanges);

    return restrictions;
}
 
Example 6
Source File: GetRestrictionsReceiver.java    From enterprise-samples with Apache License 2.0 4 votes vote down vote up
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 vote down vote up
public static void populateBooleanEntry(Resources res, RestrictionEntry entry) {
    entry.setType(RestrictionEntry.TYPE_BOOLEAN);
    entry.setTitle(res.getString(R.string.boolean_entry_title));
}