微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.support.v4.content.res.TypedArrayUtils的实例源码

项目:FCM-for-Mojo    文件HttpUriPreference.java   
public HttpUriPreference(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes) {
    super(context,attrs,defStyleAttr,defStyleRes);
    TypedArray a;

    a = context.obtainStyledAttributes(attrs,R.styleable.HttpUriPreference);
    mSummaryWhenAuthorizationSet = a.getString(R.styleable.HttpUriPreference_summaryWhenAuthorizationSet);
    keyUsername = a.getString(R.styleable.HttpUriPreference_keyHttpUsername);
    keyPassword = a.getString(R.styleable.HttpUriPreference_keyHttpPassword);
    a.recycle();

    a = context.obtainStyledAttributes(attrs,R.styleable.Preference,defStyleRes);
    mSummary = TypedArrayUtils.getString(a,R.styleable.Preference_summary,R.styleable.Preference_android_summary);
    a.recycle();

    setDialogLayoutResource(R.layout.dialog_http_uri_preference);

}
项目:MaterialPreference    文件NumberPickerPreference.java   
@SuppressLint("RestrictedApi")
public NumberPickerPreference(Context context,defStyleRes);

    mNumberPicker = new NumberPicker(context);

    TypedArray a;
    a = context.obtainStyledAttributes(attrs,R.styleable.NumberPickerPreference);
    mNumberPicker.setMinValue(a.getInt(R.styleable.NumberPickerPreference_min,0));
    mNumberPicker.setMaxValue(a.getInt(R.styleable.NumberPickerPreference_max,100));

    a = context.obtainStyledAttributes(attrs,defStyleRes);

    mSummary = TypedArrayUtils.getString(a,R.styleable.Preference_android_summary);

    a.recycle();
}
项目:MaterialPreference    文件ListPreference.java   
@SuppressLint("RestrictedApi")
public ListPreference(Context context,defStyleRes);

    TypedArray a = context.obtainStyledAttributes(
            attrs,R.styleable.ListPreference,defStyleRes);

    mEntries = TypedArrayUtils.getTextArray(a,R.styleable.ListPreference_entries,R.styleable.ListPreference_android_entries);

    mEntryValues = TypedArrayUtils.getTextArray(a,R.styleable.ListPreference_entryValues,R.styleable.ListPreference_android_entryValues);

    a.recycle();

    /* Retrieve the Preference summary attribute since it's private
     * in the Preference class.
     */
    a = context.obtainStyledAttributes(attrs,R.styleable.Preference_android_summary);

    a.recycle();
}
项目:MaterialPreference    文件CheckBoxPreference.java   
@SuppressLint("RestrictedApi")
public CheckBoxPreference(
        Context context,defStyleRes);

    final TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.CheckBoxPreference,defStyleRes);

    setSummaryOn(TypedArrayUtils.getString(a,R.styleable.CheckBoxPreference_summaryOn,R.styleable.CheckBoxPreference_android_summaryOn));

    setSummaryOff(TypedArrayUtils.getString(a,R.styleable.CheckBoxPreference_summaryOff,R.styleable.CheckBoxPreference_android_summaryOff));

    setdisableDependentsstate(TypedArrayUtils.getBoolean(a,R.styleable.CheckBoxPreference_disableDependentsstate,R.styleable.CheckBoxPreference_android_disableDependentsstate,false));

    a.recycle();
}
项目:MaterialPreference    文件MultiSelectListPreference.java   
@SuppressLint("RestrictedApi")
public MultiSelectListPreference(
        Context context,R.styleable.MultiSelectListPreference,R.styleable.MultiSelectListPreference_entries,R.styleable.MultiSelectListPreference_android_entries);

    mEntryValues = TypedArrayUtils.getTextArray(a,R.styleable.MultiSelectListPreference_entryValues,R.styleable.MultiSelectListPreference_android_entryValues);

    a.recycle();
}
项目:MaterialPreference    文件ringtonePreference.java   
public ringtonePreference(Context context,R.styleable.ringtonePreference,defStyleRes);

    mringtoneType = TypedArrayUtils.getInt(a,R.styleable.ringtonePreference_ringtoneType,R.styleable.ringtonePreference_android_ringtoneType,ringtoneManager.TYPE_ringtone);
    mShowDefault = TypedArrayUtils.getBoolean(a,R.styleable.ringtonePreference_showDefault,R.styleable.ringtonePreference_android_showDefault,true);
    mShowSilent = TypedArrayUtils.getBoolean(a,R.styleable.ringtonePreference_showSilent,R.styleable.ringtonePreference_android_showSilent,true);
    mSummaryNone = a.getString(R.styleable.ringtonePreference_summaryNone);
    a.recycle();

    /* Retrieve the Preference summary attribute since it's private
     * in the Preference class.
     */
    a = context.obtainStyledAttributes(attrs,R.styleable.Preference_android_summary);

    a.recycle();
}
项目:moebooru-android    文件NumberPickerPreference.java   
@SuppressLint("RestrictedApi")
public NumberPickerPreference(Context context,int
        defStyleRes) {
    super(context,defStyleRes);
    mNumberPicker = new NumberPicker(context);

    TypedArray array = context.obtainStyledAttributes(attrs,R.styleable.NumberPickerPreference);
    mNumberPicker.setMinValue(array.getInt(R.styleable.NumberPickerPreference_min,0));
    mNumberPicker.setMaxValue(array.getInt(R.styleable.NumberPickerPreference_max,100));
    array = context.obtainStyledAttributes(attrs,defStyleRes);
    mSummary =  TypedArrayUtils.getString(array,R.styleable.Preference_android_summary);
    array.recycle();
}
项目:MaterialPreference    文件SwitchPreference.java   
/**
 * Construct a new SwitchPreference with the given style options.
 *
 * @param context The Context that will style this preference
 * @param attrs Style attributes that differ from the default
 * @param defStyleAttr An attribute in the current theme that contains a
 *        reference to a style resource that supplies default values for
 *        the view. Can be 0 to not look for defaults.
 * @param defStyleRes A resource identifier of a style resource that
 *        supplies default values for the view,used only if
 *        defStyleAttr is 0 or can not be found in the theme. Can be 0
 *        to not look for defaults.
 */
@SuppressLint("RestrictedApi")
public SwitchPreference(Context context,defStyleRes);

    TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.SwitchPreference,R.styleable.SwitchPreference_summaryOn,R.styleable.SwitchPreference_android_summaryOn));

    setSummaryOff(TypedArrayUtils.getString(a,R.styleable.SwitchPreference_summaryOff,R.styleable.SwitchPreference_android_summaryOff));

    setSwitchTextOn(TypedArrayUtils.getString(a,R.styleable.SwitchPreference_switchTextOn,R.styleable.SwitchPreference_android_switchTextOn));

    setSwitchTextOff(TypedArrayUtils.getString(a,R.styleable.SwitchPreference_switchTextOff,R.styleable.SwitchPreference_android_switchTextOff));

    setdisableDependentsstate(TypedArrayUtils.getBoolean(a,R.styleable.SwitchPreference_disableDependentsstate,R.styleable.SwitchPreference_android_disableDependentsstate,false));

    a.recycle();
}
项目:MaterialPreference    文件EditTextPreference.java   
@SuppressLint("RestrictedApi")
public EditTextPreference(Context context,defStyleRes);

    TypedArray a;
    a = context.obtainStyledAttributes(attrs,R.styleable.EditTextPreference);

    mInputType = TypedArrayUtils.getInt(a,R.styleable.EditTextPreference_inputType,R.styleable.EditTextPreference_android_inputType,InputType.TYPE_CLASS_TEXT);

    mSingleLine = TypedArrayUtils.getBoolean(a,R.styleable.EditTextPreference_singleLine,R.styleable.EditTextPreference_android_singleLine,true);

    mSelectAllOnFocus = TypedArrayUtils.getBoolean(a,R.styleable.EditTextPreference_selectAllOnFocus,R.styleable.EditTextPreference_android_selectAllOnFocus,false);

    mCommitOnEnter = a.getBoolean(R.styleable.EditTextPreference_commitOnEnter,false);
    a.recycle();

    /* Retrieve the Preference summary attribute since it's private
     * in the Preference class.
     */
    a = context.obtainStyledAttributes(attrs,R.styleable.Preference_android_summary);

    a.recycle();
}
项目:MaterialPreference    文件DialogPreference.java   
@SuppressLint("RestrictedApi")
public DialogPreference(
        Context context,R.styleable.DialogPreference,defStyleRes);

    mDialogTitle = TypedArrayUtils.getString(a,R.styleable.DialogPreference_dialogTitle,R.styleable.DialogPreference_android_dialogTitle);
    if (mDialogTitle == null) {
        // Fall back on the regular title of the preference
        // (the one that is seen in the list)
        mDialogTitle = getTitle();
    }

    mDialogMessage = TypedArrayUtils.getString(a,R.styleable.DialogPreference_dialogMessage,R.styleable.DialogPreference_android_dialogMessage);

    mDialogIcon = TypedArrayUtils.getDrawable(a,R.styleable.DialogPreference_dialogIcon,R.styleable.DialogPreference_android_dialogIcon);

    mPositiveButtonText = TypedArrayUtils.getString(a,R.styleable.DialogPreference_positiveButtonText,R.styleable.DialogPreference_android_positiveButtonText);

    mNegativeButtonText = TypedArrayUtils.getString(a,R.styleable.DialogPreference_negativeButtonText,R.styleable.DialogPreference_android_negativeButtonText);

    mDialogLayoutResId = TypedArrayUtils.getResourceId(a,R.styleable.DialogPreference_dialogLayout,R.styleable.DialogPreference_android_dialogLayout,0);

    a.recycle();
}
项目:MaterialPreference    文件PreferenceGroup.java   
@SuppressLint("RestrictedApi")
public PreferenceGroup(Context context,defStyleRes);

    mPreferenceList = new ArrayList<>();

    final TypedArray a = context.obtainStyledAttributes(
            attrs,R.styleable.PreferenceGroup,defStyleRes);

    mOrderingAsAdded =
            TypedArrayUtils.getBoolean(a,R.styleable.PreferenceGroup_orderingFromXml,true);

    a.recycle();
}
项目:tazapp-android    文件IntegerEditTextPreference.java   
public IntegerEditTextPreference(Context context,defStyleRes);
    /* Retrieve the Preference summary attribute since it's private
     * in the Preference class.
     */
    TypedArray a = context.obtainStyledAttributes(attrs,android.support.v7.preference.R.styleable.Preference,android.support.v7.preference.R.styleable.Preference_summary,android.support.v7.preference.R.styleable.Preference_android_summary);

    a.recycle();
}
项目:tazapp-android    文件NotificationSoundPreference.java   
public NotificationSoundPreference(Context context,defStyleRes);
    TypedArray a = context.obtainStyledAttributes(attrs,android.support.v7.preference.R.styleable.Preference_android_summary);

    a.recycle();
}
项目:MyCalendar    文件ColorPickerPreference.java   
@SuppressLint("RestrictedApi")
public ColorPickerPreference(Context context,AttributeSet attrs) {
    this(context,TypedArrayUtils.getAttr(context,R.attr.dialogPreferenceStyle,android.R.attr.dialogPreferenceStyle));
}
项目:FontProvider    文件IntegerSimpleMenuPreference.java   
@SuppressLint("RestrictedApi")
public IntegerSimpleMenuPreference(Context context,R.styleable.SimpleMenuPreference,defStyleRes);

    a.recycle();

    a = context.obtainStyledAttributes(
            attrs,R.styleable.ListPreference_android_entries);

    mEntryValues = getIntArray(a,R.styleable.Preference_android_summary);

    a.recycle();

    a = context.obtainStyledAttributes(
            attrs,defStyleRes);

    int popupStyle = a.getResourceId(R.styleable.SimpleMenuPreference_popupStyle,R.style.Preference_SimpleMenuPreference_Popup);

    mPopupWindow = new SimpleMenuPopupWindow(context,R.styleable.SimpleMenuPreference_popupStyle,popupStyle);
    mPopupWindow.setonItemClickListener(new SimpleMenuPopupWindow.OnItemClickListener() {
        @Override
        public void onClick(int i) {
            int value = getEntryValues()[i];
            if (callchangelistener(value)) {
                setValue(value);
            }
        }
    });
}
项目:FontProvider    文件IntegerSimpleMenuPreference.java   
@SuppressLint("RestrictedApi")
private static int[] getIntArray(TypedArray a,@StyleableRes int index,@StyleableRes int fallbackIndex) {
    int resourceId = TypedArrayUtils.getResourceId(a,index,fallbackIndex,0);
    return a.getResources().getIntArray(resourceId);
}
项目:android_external_MicroGUiTools    文件RadioButtonPreference.java   
@SuppressLint("RestrictedApi")
public RadioButtonPreference(Context context,R.attr.checkBoxPreferenceStyle,android.R.attr.checkBoxPreferenceStyle));
}
项目:Android-Support-Preference-V7-Fix    文件ColorPickerPreference.java   
@SuppressLint("RestrictedApi")
public ColorPickerPreference(Context context,android.R.attr.dialogPreferenceStyle));
}
项目:Android-Support-Preference-V7-Fix    文件ringtonePreference.java   
@SuppressLint("RestrictedApi")
public ringtonePreference(Context context,android.R.attr.dialogPreferenceStyle));
}
项目:Android-Support-Preference-V7-Fix    文件PreferenceCategory.java   
public PreferenceCategory(Context context,R.attr.preferenceCategoryStyle,android.R.attr.preferenceCategoryStyle));
}
项目:Android-Support-Preference-V7-Fix    文件TimePickerPreference.java   
@SuppressLint("RestrictedApi")
public TimePickerPreference(Context context,android.R.attr.dialogPreferenceStyle));
}
项目:Android-Support-Preference-V7-Fix    文件DatePickerPreference.java   
@SuppressLint("RestrictedApi")
public DatePickerPreference(Context context,android.R.attr.dialogPreferenceStyle));
}
项目:tazapp-android    文件NotificationSoundPreference.java   
public NotificationSoundPreference(Context context,android.support.v7.preference.R.attr.preferenceStyle,android.R.attr.preferenceStyle));
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。