当前位置: 首页>>代码示例>>Java>>正文


Java TypedArrayUtils.getString方法代码示例

本文整理汇总了Java中android.support.v4.content.res.TypedArrayUtils.getString方法的典型用法代码示例。如果您正苦于以下问题:Java TypedArrayUtils.getString方法的具体用法?Java TypedArrayUtils.getString怎么用?Java TypedArrayUtils.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.content.res.TypedArrayUtils的用法示例。


在下文中一共展示了TypedArrayUtils.getString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HttpUriPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
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, defStyleAttr, defStyleRes);
    mSummary = TypedArrayUtils.getString(a, R.styleable.Preference_summary,
            R.styleable.Preference_android_summary);
    a.recycle();

    setDialogLayoutResource(R.layout.dialog_http_uri_preference);

}
 
开发者ID:RikkaApps,项目名称:FCM-for-Mojo,代码行数:20,代码来源:HttpUriPreference.java

示例2: NumberPickerPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public NumberPickerPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, 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,
            R.styleable.Preference, defStyleAttr, defStyleRes);

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

    a.recycle();
}
 
开发者ID:RikkaW,项目名称:MaterialPreference,代码行数:20,代码来源:NumberPickerPreference.java

示例3: ListPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public ListPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);

    TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.ListPreference, defStyleAttr, 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, defStyleAttr, defStyleRes);

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

    a.recycle();
}
 
开发者ID:RikkaW,项目名称:MaterialPreference,代码行数:27,代码来源:ListPreference.java

示例4: RingtonePreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
public RingtonePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);

    TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.RingtonePreference, defStyleAttr, 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, defStyleAttr, defStyleRes);

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

    a.recycle();
}
 
开发者ID:RikkaW,项目名称:MaterialPreference,代码行数:27,代码来源:RingtonePreference.java

示例5: NumberPickerPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public NumberPickerPreference(Context context, AttributeSet attrs, int defStyleAttr, int
        defStyleRes) {
    super(context, attrs, defStyleAttr, 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,
            R.styleable.Preference, defStyleAttr, defStyleRes);
    mSummary =  TypedArrayUtils.getString(array, R.styleable.Preference_summary,
            R.styleable.Preference_android_summary);
    array.recycle();
}
 
开发者ID:fiepi,项目名称:moebooru-android,代码行数:16,代码来源:NumberPickerPreference.java

示例6: EditTextPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public EditTextPreference(Context context, AttributeSet attrs, int defStyleAttr,
                          int defStyleRes) {
    super(context, attrs, defStyleAttr, 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, defStyleAttr, defStyleRes);

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

    a.recycle();
}
 
开发者ID:RikkaW,项目名称:MaterialPreference,代码行数:32,代码来源:EditTextPreference.java

示例7: DialogPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public DialogPreference(
        Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);

    final TypedArray a = context.obtainStyledAttributes(attrs,
            R.styleable.DialogPreference, defStyleAttr, 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();
}
 
开发者ID:RikkaW,项目名称:MaterialPreference,代码行数:37,代码来源:DialogPreference.java

示例8: IntegerEditTextPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
public IntegerEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, 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, defStyleAttr, defStyleRes);

    mSummary = TypedArrayUtils.getString(a, android.support.v7.preference.R.styleable.Preference_summary,
                                         android.support.v7.preference.R.styleable.Preference_android_summary);

    a.recycle();
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:14,代码来源:IntegerEditTextPreference.java

示例9: NotificationSoundPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
public NotificationSoundPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
    TypedArray a = context.obtainStyledAttributes(attrs,
                                                  android.support.v7.preference.R.styleable.Preference, defStyleAttr, defStyleRes);

    mSummary = TypedArrayUtils.getString(a, android.support.v7.preference.R.styleable.Preference_summary,
                                         android.support.v7.preference.R.styleable.Preference_android_summary);

    a.recycle();
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:11,代码来源:NotificationSoundPreference.java

示例10: IntegerSimpleMenuPreference

import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public IntegerSimpleMenuPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);

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

    a.recycle();

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

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

    mEntryValues = getIntArray(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, defStyleAttr, defStyleRes);

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

    a.recycle();

    a = context.obtainStyledAttributes(
            attrs, R.styleable.SimpleMenuPreference, defStyleAttr, defStyleRes);

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

    mPopupWindow = new SimpleMenuPopupWindow(context, attrs, 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);
            }
        }
    });
}
 
开发者ID:RikkaApps,项目名称:FontProvider,代码行数:48,代码来源:IntegerSimpleMenuPreference.java


注:本文中的android.support.v4.content.res.TypedArrayUtils.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。