本文整理汇总了Java中android.support.v4.content.res.TypedArrayUtils.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java TypedArrayUtils.getBoolean方法的具体用法?Java TypedArrayUtils.getBoolean怎么用?Java TypedArrayUtils.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.content.res.TypedArrayUtils
的用法示例。
在下文中一共展示了TypedArrayUtils.getBoolean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: PreferenceGroup
import android.support.v4.content.res.TypedArrayUtils; //导入方法依赖的package包/类
@SuppressLint("RestrictedApi")
public PreferenceGroup(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
mPreferenceList = new ArrayList<>();
final TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.PreferenceGroup, defStyleAttr, defStyleRes);
mOrderingAsAdded =
TypedArrayUtils.getBoolean(a, R.styleable.PreferenceGroup_orderingFromXml,
R.styleable.PreferenceGroup_orderingFromXml, true);
a.recycle();
}