id
int32 0
165k
| repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
list | docstring
stringlengths 3
16k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 105
339
|
---|---|---|---|---|---|---|---|---|---|---|---|
4,600 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java
|
ColorPalettePreference.createItemSelectedListener
|
@NonNull
private ListDialog.OnItemSelectedListener createItemSelectedListener() {
return new ListDialog.OnItemSelectedListener() {
@Override
public void onItemSelected(final int position) {
ColorPalettePreference.this.selectedIndex = position;
ColorPalettePreference.this.onClick(getDialog(), DialogInterface.BUTTON_POSITIVE);
if (getDialog() != null) {
getDialog().dismiss();
}
}
};
}
|
java
|
@NonNull
private ListDialog.OnItemSelectedListener createItemSelectedListener() {
return new ListDialog.OnItemSelectedListener() {
@Override
public void onItemSelected(final int position) {
ColorPalettePreference.this.selectedIndex = position;
ColorPalettePreference.this.onClick(getDialog(), DialogInterface.BUTTON_POSITIVE);
if (getDialog() != null) {
getDialog().dismiss();
}
}
};
}
|
[
"@",
"NonNull",
"private",
"ListDialog",
".",
"OnItemSelectedListener",
"createItemSelectedListener",
"(",
")",
"{",
"return",
"new",
"ListDialog",
".",
"OnItemSelectedListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onItemSelected",
"(",
"final",
"int",
"position",
")",
"{",
"ColorPalettePreference",
".",
"this",
".",
"selectedIndex",
"=",
"position",
";",
"ColorPalettePreference",
".",
"this",
".",
"onClick",
"(",
"getDialog",
"(",
")",
",",
"DialogInterface",
".",
"BUTTON_POSITIVE",
")",
";",
"if",
"(",
"getDialog",
"(",
")",
"!=",
"null",
")",
"{",
"getDialog",
"(",
")",
".",
"dismiss",
"(",
")",
";",
"}",
"}",
"}",
";",
"}"
] |
Creates and returns a listener, which allows to observe when a list item has been selected.
@return The listener, which has been created, as an instance of the type {@link
ListDialog.OnItemSelectedListener}. The listener may not be null
|
[
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"observe",
"when",
"a",
"list",
"item",
"has",
"been",
"selected",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L280-L295
|
4,601 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java
|
ColorPalettePreference.setDialogPreviewShape
|
public final void setDialogPreviewShape(@NonNull final PreviewShape previewShape) {
Condition.INSTANCE.ensureNotNull(previewShape, "The preview shape may not be null");
this.dialogPreviewShape = previewShape;
}
|
java
|
public final void setDialogPreviewShape(@NonNull final PreviewShape previewShape) {
Condition.INSTANCE.ensureNotNull(previewShape, "The preview shape may not be null");
this.dialogPreviewShape = previewShape;
}
|
[
"public",
"final",
"void",
"setDialogPreviewShape",
"(",
"@",
"NonNull",
"final",
"PreviewShape",
"previewShape",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"previewShape",
",",
"\"The preview shape may not be null\"",
")",
";",
"this",
".",
"dialogPreviewShape",
"=",
"previewShape",
";",
"}"
] |
Sets the shape, which should be used to preview colors in the preference's dialog.
@param previewShape
The shape, which should be set, as a value of the enum {@link PreviewShape}. The
shape may not be null
|
[
"Sets",
"the",
"shape",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L442-L445
|
4,602 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java
|
ResolutionPreference.obtainUnit
|
private void obtainUnit(@NonNull final TypedArray typedArray) {
CharSequence obtainedUnit = typedArray.getText(R.styleable.AbstractUnitPreference_unit);
if (obtainedUnit == null) {
obtainedUnit = getContext().getText(R.string.resolution_preference_unit);
}
setUnit(obtainedUnit);
}
|
java
|
private void obtainUnit(@NonNull final TypedArray typedArray) {
CharSequence obtainedUnit = typedArray.getText(R.styleable.AbstractUnitPreference_unit);
if (obtainedUnit == null) {
obtainedUnit = getContext().getText(R.string.resolution_preference_unit);
}
setUnit(obtainedUnit);
}
|
[
"private",
"void",
"obtainUnit",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"CharSequence",
"obtainedUnit",
"=",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"AbstractUnitPreference_unit",
")",
";",
"if",
"(",
"obtainedUnit",
"==",
"null",
")",
"{",
"obtainedUnit",
"=",
"getContext",
"(",
")",
".",
"getText",
"(",
"R",
".",
"string",
".",
"resolution_preference_unit",
")",
";",
"}",
"setUnit",
"(",
"obtainedUnit",
")",
";",
"}"
] |
Obtains the unit of the resolution, which is shown in the preference's dialog, from a
specific typed array.
@param typedArray
The typed array, the unit should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"unit",
"of",
"the",
"resolution",
"which",
"is",
"shown",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java#L232-L240
|
4,603 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java
|
ResolutionPreference.obtainWidthHint
|
private void obtainWidthHint(@NonNull final TypedArray typedArray) {
CharSequence obtainedHint = typedArray.getText(R.styleable.ResolutionPreference_widthHint);
if (obtainedHint == null) {
obtainedHint = getContext().getText(R.string.resolution_preference_width_hint);
}
setWidthHint(obtainedHint);
}
|
java
|
private void obtainWidthHint(@NonNull final TypedArray typedArray) {
CharSequence obtainedHint = typedArray.getText(R.styleable.ResolutionPreference_widthHint);
if (obtainedHint == null) {
obtainedHint = getContext().getText(R.string.resolution_preference_width_hint);
}
setWidthHint(obtainedHint);
}
|
[
"private",
"void",
"obtainWidthHint",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"CharSequence",
"obtainedHint",
"=",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"ResolutionPreference_widthHint",
")",
";",
"if",
"(",
"obtainedHint",
"==",
"null",
")",
"{",
"obtainedHint",
"=",
"getContext",
"(",
")",
".",
"getText",
"(",
"R",
".",
"string",
".",
"resolution_preference_width_hint",
")",
";",
"}",
"setWidthHint",
"(",
"obtainedHint",
")",
";",
"}"
] |
Obtains the hint of the edit text widget, which allows to enter the width of the resolution,
from a specific typed array.
@param typedArray
The typed array, the hint should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"hint",
"of",
"the",
"edit",
"text",
"widget",
"which",
"allows",
"to",
"enter",
"the",
"width",
"of",
"the",
"resolution",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java#L250-L258
|
4,604 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java
|
ResolutionPreference.obtainHeightHint
|
private void obtainHeightHint(@NonNull final TypedArray typedArray) {
CharSequence obtainedHint = typedArray.getText(R.styleable.ResolutionPreference_heightHint);
if (obtainedHint == null) {
obtainedHint = getContext().getText(R.string.resolution_preference_height_hint);
}
setHeightHint(obtainedHint);
}
|
java
|
private void obtainHeightHint(@NonNull final TypedArray typedArray) {
CharSequence obtainedHint = typedArray.getText(R.styleable.ResolutionPreference_heightHint);
if (obtainedHint == null) {
obtainedHint = getContext().getText(R.string.resolution_preference_height_hint);
}
setHeightHint(obtainedHint);
}
|
[
"private",
"void",
"obtainHeightHint",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"CharSequence",
"obtainedHint",
"=",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"ResolutionPreference_heightHint",
")",
";",
"if",
"(",
"obtainedHint",
"==",
"null",
")",
"{",
"obtainedHint",
"=",
"getContext",
"(",
")",
".",
"getText",
"(",
"R",
".",
"string",
".",
"resolution_preference_height_hint",
")",
";",
"}",
"setHeightHint",
"(",
"obtainedHint",
")",
";",
"}"
] |
Obtains the hint of the edit text widget, which allows to enter the height of the resolution,
from a specific typed array.
@param typedArray
The typed array, the hint should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"hint",
"of",
"the",
"edit",
"text",
"widget",
"which",
"allows",
"to",
"enter",
"the",
"height",
"of",
"the",
"resolution",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java#L268-L276
|
4,605 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java
|
ResolutionPreference.parseResolution
|
public static Pair<Integer, Integer> parseResolution(@NonNull final Context context,
@NonNull final String resolution) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
Condition.INSTANCE.ensureNotNull(resolution, "The resolution may not be null");
Condition.INSTANCE.ensureNotEmpty(resolution, "The resolution may not be empty");
String separator = context.getString(R.string.resolution_preference_separator);
String[] dimensions = resolution.split(separator);
if (dimensions.length != 2) {
throw new IllegalArgumentException("Malformed resolution: " + resolution);
}
try {
int width = Integer.parseInt(dimensions[0]);
int height = Integer.parseInt(dimensions[1]);
return Pair.create(width, height);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(
"Resolution contains invalid dimension: " + resolution, e);
}
}
|
java
|
public static Pair<Integer, Integer> parseResolution(@NonNull final Context context,
@NonNull final String resolution) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
Condition.INSTANCE.ensureNotNull(resolution, "The resolution may not be null");
Condition.INSTANCE.ensureNotEmpty(resolution, "The resolution may not be empty");
String separator = context.getString(R.string.resolution_preference_separator);
String[] dimensions = resolution.split(separator);
if (dimensions.length != 2) {
throw new IllegalArgumentException("Malformed resolution: " + resolution);
}
try {
int width = Integer.parseInt(dimensions[0]);
int height = Integer.parseInt(dimensions[1]);
return Pair.create(width, height);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(
"Resolution contains invalid dimension: " + resolution, e);
}
}
|
[
"public",
"static",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
"parseResolution",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"String",
"resolution",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"context",
",",
"\"The context may not be null\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"resolution",
",",
"\"The resolution may not be null\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureNotEmpty",
"(",
"resolution",
",",
"\"The resolution may not be empty\"",
")",
";",
"String",
"separator",
"=",
"context",
".",
"getString",
"(",
"R",
".",
"string",
".",
"resolution_preference_separator",
")",
";",
"String",
"[",
"]",
"dimensions",
"=",
"resolution",
".",
"split",
"(",
"separator",
")",
";",
"if",
"(",
"dimensions",
".",
"length",
"!=",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Malformed resolution: \"",
"+",
"resolution",
")",
";",
"}",
"try",
"{",
"int",
"width",
"=",
"Integer",
".",
"parseInt",
"(",
"dimensions",
"[",
"0",
"]",
")",
";",
"int",
"height",
"=",
"Integer",
".",
"parseInt",
"(",
"dimensions",
"[",
"1",
"]",
")",
";",
"return",
"Pair",
".",
"create",
"(",
"width",
",",
"height",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Resolution contains invalid dimension: \"",
"+",
"resolution",
",",
"e",
")",
";",
"}",
"}"
] |
Parses a specific textual representation of a resolution and returns its dimensions.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resolution
The textual representation of the resolution, which should be parsed, as a {@link
String}. The resolution may neither be null, nor empty
@return A pair, which contains the width and height of the given resolution, as an instance
of the class {@link Pair}
|
[
"Parses",
"a",
"specific",
"textual",
"representation",
"of",
"a",
"resolution",
"and",
"returns",
"its",
"dimensions",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java#L368-L388
|
4,606 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java
|
ResolutionPreference.formatResolution
|
public static String formatResolution(@NonNull final Context context, final int width,
final int height) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
String separator = context.getString(R.string.resolution_preference_separator);
return width + separator + height;
}
|
java
|
public static String formatResolution(@NonNull final Context context, final int width,
final int height) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
String separator = context.getString(R.string.resolution_preference_separator);
return width + separator + height;
}
|
[
"public",
"static",
"String",
"formatResolution",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"width",
",",
"final",
"int",
"height",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"context",
",",
"\"The context may not be null\"",
")",
";",
"String",
"separator",
"=",
"context",
".",
"getString",
"(",
"R",
".",
"string",
".",
"resolution_preference_separator",
")",
";",
"return",
"width",
"+",
"separator",
"+",
"height",
";",
"}"
] |
Creates and returns the textual representation of a specific resolution.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param width
The width of the resolution as an {@link Integer} value. The width must be at least
1
@param height
The height of the resolution as an {@link Integer} value. The height must be at least
1
@return The textual representation of the given resolution as a {@link String}
|
[
"Creates",
"and",
"returns",
"the",
"textual",
"representation",
"of",
"a",
"specific",
"resolution",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java#L404-L409
|
4,607 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java
|
ResolutionPreference.setResolution
|
public final void setResolution(final int width, final int height) {
Condition.INSTANCE.ensureAtLeast(width, 1, "The width must be at least 1");
Condition.INSTANCE.ensureAtLeast(height, 1, "The height must be at least 1");
this.width = width;
this.height = height;
persistString(formatResolution(getContext(), width, height));
notifyChanged();
}
|
java
|
public final void setResolution(final int width, final int height) {
Condition.INSTANCE.ensureAtLeast(width, 1, "The width must be at least 1");
Condition.INSTANCE.ensureAtLeast(height, 1, "The height must be at least 1");
this.width = width;
this.height = height;
persistString(formatResolution(getContext(), width, height));
notifyChanged();
}
|
[
"public",
"final",
"void",
"setResolution",
"(",
"final",
"int",
"width",
",",
"final",
"int",
"height",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"width",
",",
"1",
",",
"\"The width must be at least 1\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"height",
",",
"1",
",",
"\"The height must be at least 1\"",
")",
";",
"this",
".",
"width",
"=",
"width",
";",
"this",
".",
"height",
"=",
"height",
";",
"persistString",
"(",
"formatResolution",
"(",
"getContext",
"(",
")",
",",
"width",
",",
"height",
")",
")",
";",
"notifyChanged",
"(",
")",
";",
"}"
] |
Sets the current resolution of the preference. By setting a value, it will be persisted.
@param width
The width, which should be set, as an {@link Integer} value. The width must be at
least 1
@param height
The height, which should be set, as an {@link Integer} value. The height must be at
least 1
|
[
"Sets",
"the",
"current",
"resolution",
"of",
"the",
"preference",
".",
"By",
"setting",
"a",
"value",
"it",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ResolutionPreference.java#L439-L446
|
4,608 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ListPreference.java
|
ListPreference.createListItemListener
|
private OnClickListener createListItemListener() {
return new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
selectedIndex = which;
ListPreference.this.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
dialog.dismiss();
}
};
}
|
java
|
private OnClickListener createListItemListener() {
return new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
selectedIndex = which;
ListPreference.this.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
dialog.dismiss();
}
};
}
|
[
"private",
"OnClickListener",
"createListItemListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"DialogInterface",
"dialog",
",",
"final",
"int",
"which",
")",
"{",
"selectedIndex",
"=",
"which",
";",
"ListPreference",
".",
"this",
".",
"onClick",
"(",
"dialog",
",",
"DialogInterface",
".",
"BUTTON_POSITIVE",
")",
";",
"dialog",
".",
"dismiss",
"(",
")",
";",
"}",
"}",
";",
"}"
] |
Creates and returns a listener, which allows to persist the value a list item, which is
clicked by the user.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener}
|
[
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"persist",
"the",
"value",
"a",
"list",
"item",
"which",
"is",
"clicked",
"by",
"the",
"user",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ListPreference.java#L134-L144
|
4,609 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/ListPreference.java
|
ListPreference.getEntry
|
public final CharSequence getEntry() {
int index = indexOf(value);
return index >= 0 && getEntries() != null ? getEntries()[index] : null;
}
|
java
|
public final CharSequence getEntry() {
int index = indexOf(value);
return index >= 0 && getEntries() != null ? getEntries()[index] : null;
}
|
[
"public",
"final",
"CharSequence",
"getEntry",
"(",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"value",
")",
";",
"return",
"index",
">=",
"0",
"&&",
"getEntries",
"(",
")",
"!=",
"null",
"?",
"getEntries",
"(",
")",
"[",
"index",
"]",
":",
"null",
";",
"}"
] |
Returns the entry, the currently persisted value of the preference belongs to.
@return The entry, the currently persisted value of the preference belongs to, as an instance
of the type {@link CharSequence}
|
[
"Returns",
"the",
"entry",
"the",
"currently",
"persisted",
"value",
"of",
"the",
"preference",
"belongs",
"to",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ListPreference.java#L259-L262
|
4,610 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/view/NumberPicker.java
|
NumberPicker.setDividerColor
|
public final void setDividerColor(@ColorInt final int color) {
this.seekBarColor = color;
try {
Field divider = getClass().getSuperclass().getDeclaredField("mSelectionDivider");
divider.setAccessible(true);
divider.set(this, new ColorDrawable(color));
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
Log.w(TAG, "Failed to set divider color", e);
}
}
|
java
|
public final void setDividerColor(@ColorInt final int color) {
this.seekBarColor = color;
try {
Field divider = getClass().getSuperclass().getDeclaredField("mSelectionDivider");
divider.setAccessible(true);
divider.set(this, new ColorDrawable(color));
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
Log.w(TAG, "Failed to set divider color", e);
}
}
|
[
"public",
"final",
"void",
"setDividerColor",
"(",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"this",
".",
"seekBarColor",
"=",
"color",
";",
"try",
"{",
"Field",
"divider",
"=",
"getClass",
"(",
")",
".",
"getSuperclass",
"(",
")",
".",
"getDeclaredField",
"(",
"\"mSelectionDivider\"",
")",
";",
"divider",
".",
"setAccessible",
"(",
"true",
")",
";",
"divider",
".",
"set",
"(",
"this",
",",
"new",
"ColorDrawable",
"(",
"color",
")",
")",
";",
"}",
"catch",
"(",
"NoSuchFieldException",
"|",
"IllegalArgumentException",
"|",
"IllegalAccessException",
"e",
")",
"{",
"Log",
".",
"w",
"(",
"TAG",
",",
"\"Failed to set divider color\"",
",",
"e",
")",
";",
"}",
"}"
] |
Sets the color of the number picker's divider.
@param color
The color, which should be set, as an {@link Integer} value
|
[
"Sets",
"the",
"color",
"of",
"the",
"number",
"picker",
"s",
"divider",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/view/NumberPicker.java#L148-L158
|
4,611 |
michael-rapp/AndroidMaterialPreferences
|
example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java
|
PreferenceFragment.createShowValueAsSummaryListener
|
private Preference.OnPreferenceChangeListener createShowValueAsSummaryListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showValueAsSummary = (Boolean) newValue;
editTextPreference.showValueAsSummary(showValueAsSummary);
listPreference.showValueAsSummary(showValueAsSummary);
multiChoiceListPreference.showValueAsSummary(showValueAsSummary);
seekBarPreference.showValueAsSummary(showValueAsSummary);
numberPickerPreference.showValueAsSummary(showValueAsSummary);
digitPickerPreference.showValueAsSummary(showValueAsSummary);
resolutionPreference.showValueAsSummary(showValueAsSummary);
colorPalettePreference.showValueAsSummary(showValueAsSummary);
adaptSwitchPreferenceSummary(showValueAsSummary);
return true;
}
};
}
|
java
|
private Preference.OnPreferenceChangeListener createShowValueAsSummaryListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showValueAsSummary = (Boolean) newValue;
editTextPreference.showValueAsSummary(showValueAsSummary);
listPreference.showValueAsSummary(showValueAsSummary);
multiChoiceListPreference.showValueAsSummary(showValueAsSummary);
seekBarPreference.showValueAsSummary(showValueAsSummary);
numberPickerPreference.showValueAsSummary(showValueAsSummary);
digitPickerPreference.showValueAsSummary(showValueAsSummary);
resolutionPreference.showValueAsSummary(showValueAsSummary);
colorPalettePreference.showValueAsSummary(showValueAsSummary);
adaptSwitchPreferenceSummary(showValueAsSummary);
return true;
}
};
}
|
[
"private",
"Preference",
".",
"OnPreferenceChangeListener",
"createShowValueAsSummaryListener",
"(",
")",
"{",
"return",
"new",
"Preference",
".",
"OnPreferenceChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreferenceChange",
"(",
"final",
"Preference",
"preference",
",",
"final",
"Object",
"newValue",
")",
"{",
"boolean",
"showValueAsSummary",
"=",
"(",
"Boolean",
")",
"newValue",
";",
"editTextPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"listPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"multiChoiceListPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"seekBarPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"numberPickerPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"digitPickerPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"resolutionPreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"colorPalettePreference",
".",
"showValueAsSummary",
"(",
"showValueAsSummary",
")",
";",
"adaptSwitchPreferenceSummary",
"(",
"showValueAsSummary",
")",
";",
"return",
"true",
";",
"}",
"}",
";",
"}"
] |
Creates and returns a listener, which allows to adapt, whether the preference's values should
be shown as summaries, or not, when the corresponding setting has been changed.
@return The listener, which has been created, as an instance of the type {@link
Preference.OnPreferenceChangeListener}
|
[
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"adapt",
"whether",
"the",
"preference",
"s",
"values",
"should",
"be",
"shown",
"as",
"summaries",
"or",
"not",
"when",
"the",
"corresponding",
"setting",
"has",
"been",
"changed",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java#L147-L166
|
4,612 |
michael-rapp/AndroidMaterialPreferences
|
example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java
|
PreferenceFragment.createShowDialogHeaderListener
|
private Preference.OnPreferenceChangeListener createShowDialogHeaderListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showDialogHeader = (Boolean) newValue;
dialogPreference.showDialogHeader(showDialogHeader);
editTextPreference.showDialogHeader(showDialogHeader);
listPreference.showDialogHeader(showDialogHeader);
multiChoiceListPreference.showDialogHeader(showDialogHeader);
seekBarPreference.showDialogHeader(showDialogHeader);
numberPickerPreference.showDialogHeader(showDialogHeader);
digitPickerPreference.showDialogHeader(showDialogHeader);
resolutionPreference.showDialogHeader(showDialogHeader);
colorPalettePreference.showDialogHeader(showDialogHeader);
return true;
}
};
}
|
java
|
private Preference.OnPreferenceChangeListener createShowDialogHeaderListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showDialogHeader = (Boolean) newValue;
dialogPreference.showDialogHeader(showDialogHeader);
editTextPreference.showDialogHeader(showDialogHeader);
listPreference.showDialogHeader(showDialogHeader);
multiChoiceListPreference.showDialogHeader(showDialogHeader);
seekBarPreference.showDialogHeader(showDialogHeader);
numberPickerPreference.showDialogHeader(showDialogHeader);
digitPickerPreference.showDialogHeader(showDialogHeader);
resolutionPreference.showDialogHeader(showDialogHeader);
colorPalettePreference.showDialogHeader(showDialogHeader);
return true;
}
};
}
|
[
"private",
"Preference",
".",
"OnPreferenceChangeListener",
"createShowDialogHeaderListener",
"(",
")",
"{",
"return",
"new",
"Preference",
".",
"OnPreferenceChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreferenceChange",
"(",
"final",
"Preference",
"preference",
",",
"final",
"Object",
"newValue",
")",
"{",
"boolean",
"showDialogHeader",
"=",
"(",
"Boolean",
")",
"newValue",
";",
"dialogPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"editTextPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"listPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"multiChoiceListPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"seekBarPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"numberPickerPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"digitPickerPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"resolutionPreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"colorPalettePreference",
".",
"showDialogHeader",
"(",
"showDialogHeader",
")",
";",
"return",
"true",
";",
"}",
"}",
";",
"}"
] |
Creates and returns a listener, which allows to adapt, whether the headers of the
preference's dialogs should be shown, or not, when the corresponding setting has been
changed.
@return The listener, which has been created, as an instance of the type {@link
Preference.OnPreferenceChangeListener}
|
[
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"adapt",
"whether",
"the",
"headers",
"of",
"the",
"preference",
"s",
"dialogs",
"should",
"be",
"shown",
"or",
"not",
"when",
"the",
"corresponding",
"setting",
"has",
"been",
"changed",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java#L176-L195
|
4,613 |
michael-rapp/AndroidMaterialPreferences
|
example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java
|
PreferenceFragment.createShowDialogButtonBarDividerListener
|
private Preference.OnPreferenceChangeListener createShowDialogButtonBarDividerListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showDialogButtonBarDivider = (Boolean) newValue;
dialogPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
editTextPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
listPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
multiChoiceListPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
seekBarPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
numberPickerPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
digitPickerPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
resolutionPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
colorPalettePreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
return true;
}
};
}
|
java
|
private Preference.OnPreferenceChangeListener createShowDialogButtonBarDividerListener() {
return new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(final Preference preference, final Object newValue) {
boolean showDialogButtonBarDivider = (Boolean) newValue;
dialogPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
editTextPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
listPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
multiChoiceListPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
seekBarPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
numberPickerPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
digitPickerPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
resolutionPreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
colorPalettePreference.showDialogButtonBarDivider(showDialogButtonBarDivider);
return true;
}
};
}
|
[
"private",
"Preference",
".",
"OnPreferenceChangeListener",
"createShowDialogButtonBarDividerListener",
"(",
")",
"{",
"return",
"new",
"Preference",
".",
"OnPreferenceChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onPreferenceChange",
"(",
"final",
"Preference",
"preference",
",",
"final",
"Object",
"newValue",
")",
"{",
"boolean",
"showDialogButtonBarDivider",
"=",
"(",
"Boolean",
")",
"newValue",
";",
"dialogPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"editTextPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"listPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"multiChoiceListPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"seekBarPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"numberPickerPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"digitPickerPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"resolutionPreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"colorPalettePreference",
".",
"showDialogButtonBarDivider",
"(",
"showDialogButtonBarDivider",
")",
";",
"return",
"true",
";",
"}",
"}",
";",
"}"
] |
Creates and returns a listener, which allows to adapt, whether the button bar dividers of the
preference's dialogs should be shown, or not, when the corresponding setting has been
changed.
@return The listener, which has been created, as an instance of the type {@link
Preference.OnPreferenceChangeListener}
|
[
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"adapt",
"whether",
"the",
"button",
"bar",
"dividers",
"of",
"the",
"preference",
"s",
"dialogs",
"should",
"be",
"shown",
"or",
"not",
"when",
"the",
"corresponding",
"setting",
"has",
"been",
"changed",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java#L205-L224
|
4,614 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.initialize
|
private void initialize(@Nullable final AttributeSet attributeSet,
@AttrRes final int defaultStyle,
@StyleRes final int defaultStyleResource) {
entries = new CharSequence[0];
entryValues = new CharSequence[0];
obtainStyledAttributes(attributeSet, defaultStyle, defaultStyleResource);
}
|
java
|
private void initialize(@Nullable final AttributeSet attributeSet,
@AttrRes final int defaultStyle,
@StyleRes final int defaultStyleResource) {
entries = new CharSequence[0];
entryValues = new CharSequence[0];
obtainStyledAttributes(attributeSet, defaultStyle, defaultStyleResource);
}
|
[
"private",
"void",
"initialize",
"(",
"@",
"Nullable",
"final",
"AttributeSet",
"attributeSet",
",",
"@",
"AttrRes",
"final",
"int",
"defaultStyle",
",",
"@",
"StyleRes",
"final",
"int",
"defaultStyleResource",
")",
"{",
"entries",
"=",
"new",
"CharSequence",
"[",
"0",
"]",
";",
"entryValues",
"=",
"new",
"CharSequence",
"[",
"0",
"]",
";",
"obtainStyledAttributes",
"(",
"attributeSet",
",",
"defaultStyle",
",",
"defaultStyleResource",
")",
";",
"}"
] |
Initializes the list preference.
@param attributeSet
The attribute set, which should be used to initialize the list preferences, as an
instance of the type {@link AttributeSet} or null, if no attributes should be
obtained
@param defaultStyle
The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resource
@param defaultStyleResource
A resource identifier of a style resource that supplies default values for the
preference, used only if the default style is 0 or can not be found in the theme. Can
be 0 to not look for defaults
|
[
"Initializes",
"the",
"list",
"preference",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L80-L86
|
4,615 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.obtainDialogItemColor
|
private void obtainDialogItemColor(@NonNull final TypedArray typedArray) {
setDialogItemColor(
typedArray.getColor(R.styleable.AbstractListPreference_dialogItemColor, -1));
}
|
java
|
private void obtainDialogItemColor(@NonNull final TypedArray typedArray) {
setDialogItemColor(
typedArray.getColor(R.styleable.AbstractListPreference_dialogItemColor, -1));
}
|
[
"private",
"void",
"obtainDialogItemColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogItemColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"AbstractListPreference_dialogItemColor",
",",
"-",
"1",
")",
")",
";",
"}"
] |
Obtains the item color of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the item color should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"item",
"color",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L127-L130
|
4,616 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.obtainEntries
|
private void obtainEntries(@NonNull final TypedArray typedArray) {
CharSequence[] obtainedEntries =
typedArray.getTextArray(R.styleable.AbstractListPreference_android_entries);
if (obtainedEntries != null) {
setEntries(obtainedEntries);
}
}
|
java
|
private void obtainEntries(@NonNull final TypedArray typedArray) {
CharSequence[] obtainedEntries =
typedArray.getTextArray(R.styleable.AbstractListPreference_android_entries);
if (obtainedEntries != null) {
setEntries(obtainedEntries);
}
}
|
[
"private",
"void",
"obtainEntries",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"CharSequence",
"[",
"]",
"obtainedEntries",
"=",
"typedArray",
".",
"getTextArray",
"(",
"R",
".",
"styleable",
".",
"AbstractListPreference_android_entries",
")",
";",
"if",
"(",
"obtainedEntries",
"!=",
"null",
")",
"{",
"setEntries",
"(",
"obtainedEntries",
")",
";",
"}",
"}"
] |
Obtains the the entries of the list preference from a specific typed array.
@param typedArray
The typed array, the entries should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"the",
"entries",
"of",
"the",
"list",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L139-L146
|
4,617 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.obtainEntryValues
|
private void obtainEntryValues(@NonNull final TypedArray typedArray) {
CharSequence[] obtainedEntryValues =
typedArray.getTextArray(R.styleable.AbstractListPreference_android_entryValues);
if (obtainedEntryValues != null) {
setEntryValues(obtainedEntryValues);
}
}
|
java
|
private void obtainEntryValues(@NonNull final TypedArray typedArray) {
CharSequence[] obtainedEntryValues =
typedArray.getTextArray(R.styleable.AbstractListPreference_android_entryValues);
if (obtainedEntryValues != null) {
setEntryValues(obtainedEntryValues);
}
}
|
[
"private",
"void",
"obtainEntryValues",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"CharSequence",
"[",
"]",
"obtainedEntryValues",
"=",
"typedArray",
".",
"getTextArray",
"(",
"R",
".",
"styleable",
".",
"AbstractListPreference_android_entryValues",
")",
";",
"if",
"(",
"obtainedEntryValues",
"!=",
"null",
")",
"{",
"setEntryValues",
"(",
"obtainedEntryValues",
")",
";",
"}",
"}"
] |
Obtains the the values, which correspond to the entries of the list preference from a
specific typed array.
@param typedArray
The typed array, the entry values should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"the",
"values",
"which",
"correspond",
"to",
"the",
"entries",
"of",
"the",
"list",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L156-L163
|
4,618 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.obtainDialogScrollableArea
|
private void obtainDialogScrollableArea(@NonNull final TypedArray typedArray) {
int topIndex = typedArray.getInt(R.styleable.DialogPreference_dialogScrollableAreaTop, -1);
ScrollableArea.Area top = null;
ScrollableArea.Area bottom = null;
if (topIndex != -1) {
top = ScrollableArea.Area.fromIndex(topIndex);
int bottomIndex =
typedArray.getInt(R.styleable.DialogPreference_dialogScrollableAreaBottom, -1);
if (bottomIndex != -1) {
bottom = ScrollableArea.Area.fromIndex(bottomIndex);
}
}
setDialogScrollableArea(top, bottom != null ? bottom : top);
}
|
java
|
private void obtainDialogScrollableArea(@NonNull final TypedArray typedArray) {
int topIndex = typedArray.getInt(R.styleable.DialogPreference_dialogScrollableAreaTop, -1);
ScrollableArea.Area top = null;
ScrollableArea.Area bottom = null;
if (topIndex != -1) {
top = ScrollableArea.Area.fromIndex(topIndex);
int bottomIndex =
typedArray.getInt(R.styleable.DialogPreference_dialogScrollableAreaBottom, -1);
if (bottomIndex != -1) {
bottom = ScrollableArea.Area.fromIndex(bottomIndex);
}
}
setDialogScrollableArea(top, bottom != null ? bottom : top);
}
|
[
"private",
"void",
"obtainDialogScrollableArea",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"topIndex",
"=",
"typedArray",
".",
"getInt",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogScrollableAreaTop",
",",
"-",
"1",
")",
";",
"ScrollableArea",
".",
"Area",
"top",
"=",
"null",
";",
"ScrollableArea",
".",
"Area",
"bottom",
"=",
"null",
";",
"if",
"(",
"topIndex",
"!=",
"-",
"1",
")",
"{",
"top",
"=",
"ScrollableArea",
".",
"Area",
".",
"fromIndex",
"(",
"topIndex",
")",
";",
"int",
"bottomIndex",
"=",
"typedArray",
".",
"getInt",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogScrollableAreaBottom",
",",
"-",
"1",
")",
";",
"if",
"(",
"bottomIndex",
"!=",
"-",
"1",
")",
"{",
"bottom",
"=",
"ScrollableArea",
".",
"Area",
".",
"fromIndex",
"(",
"bottomIndex",
")",
";",
"}",
"}",
"setDialogScrollableArea",
"(",
"top",
",",
"bottom",
"!=",
"null",
"?",
"bottom",
":",
"top",
")",
";",
"}"
] |
Obtains the scrollable area of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the scrollable area should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"scrollable",
"area",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L172-L188
|
4,619 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.indexOf
|
protected final int indexOf(@Nullable final CharSequence value) {
if (value != null && getEntryValues() != null) {
for (int i = getEntryValues().length - 1; i >= 0; i--) {
if (getEntryValues()[i].equals(value)) {
return i;
}
}
}
return -1;
}
|
java
|
protected final int indexOf(@Nullable final CharSequence value) {
if (value != null && getEntryValues() != null) {
for (int i = getEntryValues().length - 1; i >= 0; i--) {
if (getEntryValues()[i].equals(value)) {
return i;
}
}
}
return -1;
}
|
[
"protected",
"final",
"int",
"indexOf",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"getEntryValues",
"(",
")",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"getEntryValues",
"(",
")",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"getEntryValues",
"(",
")",
"[",
"i",
"]",
".",
"equals",
"(",
"value",
")",
")",
"{",
"return",
"i",
";",
"}",
"}",
"}",
"return",
"-",
"1",
";",
"}"
] |
Return the index of the entry, a specific value corresponds to.
@param value
The value of the entry, whose index should be returned, as an instance of the type
{@link CharSequence}
@return The index of the entry, the given value corresponds to, as an {@link Integer} value
or -1 if there is no such entry
|
[
"Return",
"the",
"index",
"of",
"the",
"entry",
"a",
"specific",
"value",
"corresponds",
"to",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L199-L209
|
4,620 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.setEntries
|
public final void setEntries(@NonNull final CharSequence[] entries) {
Condition.INSTANCE.ensureNotNull(entries, "The entries may not be null");
this.entries = entries;
}
|
java
|
public final void setEntries(@NonNull final CharSequence[] entries) {
Condition.INSTANCE.ensureNotNull(entries, "The entries may not be null");
this.entries = entries;
}
|
[
"public",
"final",
"void",
"setEntries",
"(",
"@",
"NonNull",
"final",
"CharSequence",
"[",
"]",
"entries",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"entries",
",",
"\"The entries may not be null\"",
")",
";",
"this",
".",
"entries",
"=",
"entries",
";",
"}"
] |
Sets the entries of the list, which is shown by the preference.
@param entries
The entries, which should be set, as an {@link CharSequence} array. The entries may
not be null
|
[
"Sets",
"the",
"entries",
"of",
"the",
"list",
"which",
"is",
"shown",
"by",
"the",
"preference",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L345-L348
|
4,621 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java
|
AbstractListPreference.setEntryValues
|
public final void setEntryValues(@NonNull final CharSequence[] entryValues) {
Condition.INSTANCE.ensureNotNull(entryValues, "The entry values may not be null");
this.entryValues = entryValues;
}
|
java
|
public final void setEntryValues(@NonNull final CharSequence[] entryValues) {
Condition.INSTANCE.ensureNotNull(entryValues, "The entry values may not be null");
this.entryValues = entryValues;
}
|
[
"public",
"final",
"void",
"setEntryValues",
"(",
"@",
"NonNull",
"final",
"CharSequence",
"[",
"]",
"entryValues",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"entryValues",
",",
"\"The entry values may not be null\"",
")",
";",
"this",
".",
"entryValues",
"=",
"entryValues",
";",
"}"
] |
Sets the values, which correspond to the entries of the list, which is shown by the
preference.
@param entryValues
The values, which should be set, as a {@link CharSequence} array. The values may not
be null and the array's length must be equal to the number of list items
|
[
"Sets",
"the",
"values",
"which",
"correspond",
"to",
"the",
"entries",
"of",
"the",
"list",
"which",
"is",
"shown",
"by",
"the",
"preference",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractListPreference.java#L380-L383
|
4,622 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/multithreading/ColorPreviewDataBinder.java
|
ColorPreviewDataBinder.setShape
|
public final void setShape(@NonNull final PreviewShape shape) {
Condition.INSTANCE.ensureNotNull(shape, "The shape may not be null");
this.shape = shape;
}
|
java
|
public final void setShape(@NonNull final PreviewShape shape) {
Condition.INSTANCE.ensureNotNull(shape, "The shape may not be null");
this.shape = shape;
}
|
[
"public",
"final",
"void",
"setShape",
"(",
"@",
"NonNull",
"final",
"PreviewShape",
"shape",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"shape",
",",
"\"The shape may not be null\"",
")",
";",
"this",
".",
"shape",
"=",
"shape",
";",
"}"
] |
Sets the shape of the preview.
@param shape
The shape, which should be set, as a value of the enum {@link PreviewShape}. The
shape may not be null
|
[
"Sets",
"the",
"shape",
"of",
"the",
"preview",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/multithreading/ColorPreviewDataBinder.java#L137-L140
|
4,623 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.obtainMaxNumber
|
private void obtainMaxNumber(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_max_number);
setMaxNumber(typedArray
.getInteger(R.styleable.AbstractNumericPreference_android_max, defaultValue));
}
|
java
|
private void obtainMaxNumber(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_max_number);
setMaxNumber(typedArray
.getInteger(R.styleable.AbstractNumericPreference_android_max, defaultValue));
}
|
[
"private",
"void",
"obtainMaxNumber",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"number_picker_preference_default_max_number",
")",
";",
"setMaxNumber",
"(",
"typedArray",
".",
"getInteger",
"(",
"R",
".",
"styleable",
".",
"AbstractNumericPreference_android_max",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the maximum number, the preference allows to choose, from a specific typed array.
@param typedArray
The typed array, the maximum number should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"maximum",
"number",
"the",
"preference",
"allows",
"to",
"choose",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L200-L205
|
4,624 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.obtainMinNumber
|
private void obtainMinNumber(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_min_number);
setMinNumber(
typedArray.getInteger(R.styleable.AbstractNumericPreference_min, defaultValue));
}
|
java
|
private void obtainMinNumber(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_min_number);
setMinNumber(
typedArray.getInteger(R.styleable.AbstractNumericPreference_min, defaultValue));
}
|
[
"private",
"void",
"obtainMinNumber",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"number_picker_preference_default_min_number",
")",
";",
"setMinNumber",
"(",
"typedArray",
".",
"getInteger",
"(",
"R",
".",
"styleable",
".",
"AbstractNumericPreference_min",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the minimum number, the preference allows to choose, from a specific typed array.
@param typedArray
The typed array, the minimum number should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"minimum",
"number",
"the",
"preference",
"allows",
"to",
"choose",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L214-L219
|
4,625 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.obtainStepSize
|
private void obtainStepSize(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_step_size);
setStepSize(typedArray
.getInteger(R.styleable.AbstractNumericPreference_stepSize, defaultValue));
}
|
java
|
private void obtainStepSize(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_step_size);
setStepSize(typedArray
.getInteger(R.styleable.AbstractNumericPreference_stepSize, defaultValue));
}
|
[
"private",
"void",
"obtainStepSize",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"number_picker_preference_default_step_size",
")",
";",
"setStepSize",
"(",
"typedArray",
".",
"getInteger",
"(",
"R",
".",
"styleable",
".",
"AbstractNumericPreference_stepSize",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the step size, the number should be increased or decreased by when moving the
selector wheel, form a specific typed array.
@param typedArray
The typed array, the step size should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"step",
"size",
"the",
"number",
"should",
"be",
"increased",
"or",
"decreased",
"by",
"when",
"moving",
"the",
"selector",
"wheel",
"form",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L229-L234
|
4,626 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.adaptToStepSize
|
private int adaptToStepSize(final int number) {
if (getStepSize() > 0) {
int offset = number - getMinNumber();
int mod = offset % getStepSize();
float halfStepSize = (float) getStepSize() / 2.0f;
int result = ((mod > halfStepSize) ? offset + getStepSize() - mod : offset - mod) +
getMinNumber();
return Math.min(result, getMaxNumber());
}
return number;
}
|
java
|
private int adaptToStepSize(final int number) {
if (getStepSize() > 0) {
int offset = number - getMinNumber();
int mod = offset % getStepSize();
float halfStepSize = (float) getStepSize() / 2.0f;
int result = ((mod > halfStepSize) ? offset + getStepSize() - mod : offset - mod) +
getMinNumber();
return Math.min(result, getMaxNumber());
}
return number;
}
|
[
"private",
"int",
"adaptToStepSize",
"(",
"final",
"int",
"number",
")",
"{",
"if",
"(",
"getStepSize",
"(",
")",
">",
"0",
")",
"{",
"int",
"offset",
"=",
"number",
"-",
"getMinNumber",
"(",
")",
";",
"int",
"mod",
"=",
"offset",
"%",
"getStepSize",
"(",
")",
";",
"float",
"halfStepSize",
"=",
"(",
"float",
")",
"getStepSize",
"(",
")",
"/",
"2.0f",
";",
"int",
"result",
"=",
"(",
"(",
"mod",
">",
"halfStepSize",
")",
"?",
"offset",
"+",
"getStepSize",
"(",
")",
"-",
"mod",
":",
"offset",
"-",
"mod",
")",
"+",
"getMinNumber",
"(",
")",
";",
"return",
"Math",
".",
"min",
"(",
"result",
",",
"getMaxNumber",
"(",
")",
")",
";",
"}",
"return",
"number",
";",
"}"
] |
Adapts a specific number to the step size, which is currently set. The number will be
decreased or increased to the numerically closest value, which matches the step size.
@param number
The number, which should be adapted to the step size, as an {@link Integer} value
@return The adapted number as an {@link Integer} value
|
[
"Adapts",
"a",
"specific",
"number",
"to",
"the",
"step",
"size",
"which",
"is",
"currently",
"set",
".",
"The",
"number",
"will",
"be",
"decreased",
"or",
"increased",
"to",
"the",
"numerically",
"closest",
"value",
"which",
"matches",
"the",
"step",
"size",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L244-L255
|
4,627 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.setMinNumber
|
public final void setMinNumber(final int minNumber) {
Condition.INSTANCE.ensureSmaller(minNumber, getMaxNumber(),
"The minimum number must be less than the maximum number");
this.minNumber = minNumber;
setNumber(Math.max(getNumber(), minNumber));
}
|
java
|
public final void setMinNumber(final int minNumber) {
Condition.INSTANCE.ensureSmaller(minNumber, getMaxNumber(),
"The minimum number must be less than the maximum number");
this.minNumber = minNumber;
setNumber(Math.max(getNumber(), minNumber));
}
|
[
"public",
"final",
"void",
"setMinNumber",
"(",
"final",
"int",
"minNumber",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureSmaller",
"(",
"minNumber",
",",
"getMaxNumber",
"(",
")",
",",
"\"The minimum number must be less than the maximum number\"",
")",
";",
"this",
".",
"minNumber",
"=",
"minNumber",
";",
"setNumber",
"(",
"Math",
".",
"max",
"(",
"getNumber",
"(",
")",
",",
"minNumber",
")",
")",
";",
"}"
] |
Sets the minimum number, the preference allows to choose.
@param minNumber
The minimum number, which should be set, as an {@link Integer} value. The number must
be less than the maximum number
|
[
"Sets",
"the",
"minimum",
"number",
"the",
"preference",
"allows",
"to",
"choose",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L399-L404
|
4,628 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.setMaxNumber
|
public final void setMaxNumber(final int maxNumber) {
Condition.INSTANCE.ensureGreater(maxNumber, getMinNumber(),
"The maximum number must be greater than the minimum number");
this.maxNumber = maxNumber;
setNumber(Math.min(getNumber(), maxNumber));
}
|
java
|
public final void setMaxNumber(final int maxNumber) {
Condition.INSTANCE.ensureGreater(maxNumber, getMinNumber(),
"The maximum number must be greater than the minimum number");
this.maxNumber = maxNumber;
setNumber(Math.min(getNumber(), maxNumber));
}
|
[
"public",
"final",
"void",
"setMaxNumber",
"(",
"final",
"int",
"maxNumber",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureGreater",
"(",
"maxNumber",
",",
"getMinNumber",
"(",
")",
",",
"\"The maximum number must be greater than the minimum number\"",
")",
";",
"this",
".",
"maxNumber",
"=",
"maxNumber",
";",
"setNumber",
"(",
"Math",
".",
"min",
"(",
"getNumber",
"(",
")",
",",
"maxNumber",
")",
")",
";",
"}"
] |
Sets the maximum number, the preference allows to choose.
@param maxNumber
The maximum number, which should be set, as an {@link Integer} value. The number must
be greater than the minimum number
|
[
"Sets",
"the",
"maximum",
"number",
"the",
"preference",
"allows",
"to",
"choose",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L422-L427
|
4,629 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java
|
NumberPickerPreference.setStepSize
|
public final void setStepSize(final int stepSize) {
Condition.INSTANCE.ensureAtLeast(stepSize, 1, "The step size must be at least 1");
Condition.INSTANCE.ensureAtMaximum(stepSize, getRange(),
"The step size must be at maximum the range");
this.stepSize = stepSize;
setNumber(adaptToStepSize(getNumber()));
}
|
java
|
public final void setStepSize(final int stepSize) {
Condition.INSTANCE.ensureAtLeast(stepSize, 1, "The step size must be at least 1");
Condition.INSTANCE.ensureAtMaximum(stepSize, getRange(),
"The step size must be at maximum the range");
this.stepSize = stepSize;
setNumber(adaptToStepSize(getNumber()));
}
|
[
"public",
"final",
"void",
"setStepSize",
"(",
"final",
"int",
"stepSize",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"stepSize",
",",
"1",
",",
"\"The step size must be at least 1\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureAtMaximum",
"(",
"stepSize",
",",
"getRange",
"(",
")",
",",
"\"The step size must be at maximum the range\"",
")",
";",
"this",
".",
"stepSize",
"=",
"stepSize",
";",
"setNumber",
"(",
"adaptToStepSize",
"(",
"getNumber",
"(",
")",
")",
")",
";",
"}"
] |
Sets the step size, the number should be increased or decreased by when moving the selector
wheel.
@param stepSize
The step size, which should be set, as an {@link Integer} value. The value must be
between at least 1 and at maximum the value of the method
<code>getRange():int</code>
|
[
"Sets",
"the",
"step",
"size",
"the",
"number",
"should",
"be",
"increased",
"or",
"decreased",
"by",
"when",
"moving",
"the",
"selector",
"wheel",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/NumberPickerPreference.java#L459-L465
|
4,630 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java
|
AbstractTwoStatePreference.obtainSummaryOn
|
private void obtainSummaryOn(@NonNull final TypedArray typedArray) {
setSummaryOn(typedArray.getText(R.styleable.AbstractTwoStatePreference_android_summaryOn));
}
|
java
|
private void obtainSummaryOn(@NonNull final TypedArray typedArray) {
setSummaryOn(typedArray.getText(R.styleable.AbstractTwoStatePreference_android_summaryOn));
}
|
[
"private",
"void",
"obtainSummaryOn",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setSummaryOn",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"AbstractTwoStatePreference_android_summaryOn",
")",
")",
";",
"}"
] |
Obtains the summary, which should be shown when the preference is checked, from a specific
typed array.
@param typedArray
The typed array, the summary should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"summary",
"which",
"should",
"be",
"shown",
"when",
"the",
"preference",
"is",
"checked",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java#L170-L172
|
4,631 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java
|
AbstractTwoStatePreference.obtainSummaryOff
|
private void obtainSummaryOff(@NonNull final TypedArray typedArray) {
setSummaryOff(
typedArray.getText(R.styleable.AbstractTwoStatePreference_android_summaryOff));
}
|
java
|
private void obtainSummaryOff(@NonNull final TypedArray typedArray) {
setSummaryOff(
typedArray.getText(R.styleable.AbstractTwoStatePreference_android_summaryOff));
}
|
[
"private",
"void",
"obtainSummaryOff",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setSummaryOff",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"AbstractTwoStatePreference_android_summaryOff",
")",
")",
";",
"}"
] |
Obtains the summary, which should be shown when the preference is not checked, from a
specific typed array.
@param typedArray
The typed array, the summary should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"summary",
"which",
"should",
"be",
"shown",
"when",
"the",
"preference",
"is",
"not",
"checked",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java#L182-L185
|
4,632 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java
|
AbstractTwoStatePreference.obtainDisableDependantsState
|
private void obtainDisableDependantsState(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.two_state_preference_default_disable_dependents_state);
setDisableDependentsState(typedArray
.getBoolean(R.styleable.AbstractTwoStatePreference_android_disableDependentsState,
defaultValue));
}
|
java
|
private void obtainDisableDependantsState(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.two_state_preference_default_disable_dependents_state);
setDisableDependentsState(typedArray
.getBoolean(R.styleable.AbstractTwoStatePreference_android_disableDependentsState,
defaultValue));
}
|
[
"private",
"void",
"obtainDisableDependantsState",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"two_state_preference_default_disable_dependents_state",
")",
";",
"setDisableDependentsState",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"AbstractTwoStatePreference_android_disableDependentsState",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the state, when dependent preferences should be disabled, from a specific typed
array.
@param typedArray
The typed array, the state should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"state",
"when",
"dependent",
"preferences",
"should",
"be",
"disabled",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractTwoStatePreference.java#L195-L201
|
4,633 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractValidateableDialogPreference.java
|
AbstractValidateableDialogPreference.obtainHelperText
|
private void obtainHelperText(@NonNull final TypedArray typedArray) {
setHelperText(typedArray.getString(R.styleable.AbstractValidateableView_helperText));
}
|
java
|
private void obtainHelperText(@NonNull final TypedArray typedArray) {
setHelperText(typedArray.getString(R.styleable.AbstractValidateableView_helperText));
}
|
[
"private",
"void",
"obtainHelperText",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setHelperText",
"(",
"typedArray",
".",
"getString",
"(",
"R",
".",
"styleable",
".",
"AbstractValidateableView_helperText",
")",
")",
";",
"}"
] |
Obtains the helper text from a specific typed array.
@param typedArray
The typed array, the helper text should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"helper",
"text",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractValidateableDialogPreference.java#L156-L158
|
4,634 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractValidateableDialogPreference.java
|
AbstractValidateableDialogPreference.obtainHelperTextColor
|
private void obtainHelperTextColor(@NonNull final TypedArray typedArray) {
setHelperTextColor(typedArray.getColor(R.styleable.AbstractValidateableView_helperTextColor,
ContextCompat.getColor(getContext(), R.color.default_helper_text_color)));
}
|
java
|
private void obtainHelperTextColor(@NonNull final TypedArray typedArray) {
setHelperTextColor(typedArray.getColor(R.styleable.AbstractValidateableView_helperTextColor,
ContextCompat.getColor(getContext(), R.color.default_helper_text_color)));
}
|
[
"private",
"void",
"obtainHelperTextColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setHelperTextColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"AbstractValidateableView_helperTextColor",
",",
"ContextCompat",
".",
"getColor",
"(",
"getContext",
"(",
")",
",",
"R",
".",
"color",
".",
"default_helper_text_color",
")",
")",
")",
";",
"}"
] |
Obtains the color of the helper text from a specific typed array.
@param typedArray
The typed array, the color of the helper text should be obtained from, as an instance
of the class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"color",
"of",
"the",
"helper",
"text",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractValidateableDialogPreference.java#L167-L170
|
4,635 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractValidateableDialogPreference.java
|
AbstractValidateableDialogPreference.obtainErrorColor
|
private void obtainErrorColor(@NonNull final TypedArray typedArray) {
setErrorColor(typedArray.getColor(R.styleable.AbstractValidateableView_errorColor,
ContextCompat.getColor(getContext(), R.color.default_error_color)));
}
|
java
|
private void obtainErrorColor(@NonNull final TypedArray typedArray) {
setErrorColor(typedArray.getColor(R.styleable.AbstractValidateableView_errorColor,
ContextCompat.getColor(getContext(), R.color.default_error_color)));
}
|
[
"private",
"void",
"obtainErrorColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setErrorColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"AbstractValidateableView_errorColor",
",",
"ContextCompat",
".",
"getColor",
"(",
"getContext",
"(",
")",
",",
"R",
".",
"color",
".",
"default_error_color",
")",
")",
")",
";",
"}"
] |
Obtains the color, which is used to indicate validation errors, from a specific typed array.
@param typedArray
The typed array, the error color should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"color",
"which",
"is",
"used",
"to",
"indicate",
"validation",
"errors",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractValidateableDialogPreference.java#L179-L182
|
4,636 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogTheme
|
private void obtainDialogTheme(@NonNull final TypedArray typedArray) {
int themeId = typedArray.getResourceId(R.styleable.DialogPreference_dialogThemeResource, 0);
if (themeId == 0) {
TypedValue typedValue = new TypedValue();
getContext().getTheme()
.resolveAttribute(R.attr.preferenceDialogTheme, typedValue, true);
themeId = typedValue.resourceId;
}
dialogTheme = themeId != 0 ? themeId : R.style.MaterialDialog_Light;
}
|
java
|
private void obtainDialogTheme(@NonNull final TypedArray typedArray) {
int themeId = typedArray.getResourceId(R.styleable.DialogPreference_dialogThemeResource, 0);
if (themeId == 0) {
TypedValue typedValue = new TypedValue();
getContext().getTheme()
.resolveAttribute(R.attr.preferenceDialogTheme, typedValue, true);
themeId = typedValue.resourceId;
}
dialogTheme = themeId != 0 ? themeId : R.style.MaterialDialog_Light;
}
|
[
"private",
"void",
"obtainDialogTheme",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"themeId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogThemeResource",
",",
"0",
")",
";",
"if",
"(",
"themeId",
"==",
"0",
")",
"{",
"TypedValue",
"typedValue",
"=",
"new",
"TypedValue",
"(",
")",
";",
"getContext",
"(",
")",
".",
"getTheme",
"(",
")",
".",
"resolveAttribute",
"(",
"R",
".",
"attr",
".",
"preferenceDialogTheme",
",",
"typedValue",
",",
"true",
")",
";",
"themeId",
"=",
"typedValue",
".",
"resourceId",
";",
"}",
"dialogTheme",
"=",
"themeId",
"!=",
"0",
"?",
"themeId",
":",
"R",
".",
"style",
".",
"MaterialDialog_Light",
";",
"}"
] |
Obtains the theme, which should be used by the preference's dialog, from a specific typed
array.
@param typedArray
The typed array, the theme should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"theme",
"which",
"should",
"be",
"used",
"by",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L546-L557
|
4,637 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogFullscreen
|
private void obtainDialogFullscreen(@NonNull final TypedArray typedArray) {
setDialogFullscreen(
typedArray.getBoolean(R.styleable.DialogPreference_dialogFullscreen, false));
}
|
java
|
private void obtainDialogFullscreen(@NonNull final TypedArray typedArray) {
setDialogFullscreen(
typedArray.getBoolean(R.styleable.DialogPreference_dialogFullscreen, false));
}
|
[
"private",
"void",
"obtainDialogFullscreen",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogFullscreen",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogFullscreen",
",",
"false",
")",
")",
";",
"}"
] |
Obtains, whether the preference's dialog should be shown fullscreen, or not, from a specific
typed array.
@param typedArray
The typed array, it should be obtained from, whether the preference's dialog should
be shown fullscreen, or not, as an instance of the class {@link TypedArray}. The
typed array may not be null
|
[
"Obtains",
"whether",
"the",
"preference",
"s",
"dialog",
"should",
"be",
"shown",
"fullscreen",
"or",
"not",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L568-L571
|
4,638 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogGravity
|
private void obtainDialogGravity(@NonNull final TypedArray typedArray) {
int gravity = typedArray.getInteger(R.styleable.DialogPreference_dialogGravity, -1);
setDialogGravity(gravity);
}
|
java
|
private void obtainDialogGravity(@NonNull final TypedArray typedArray) {
int gravity = typedArray.getInteger(R.styleable.DialogPreference_dialogGravity, -1);
setDialogGravity(gravity);
}
|
[
"private",
"void",
"obtainDialogGravity",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"gravity",
"=",
"typedArray",
".",
"getInteger",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogGravity",
",",
"-",
"1",
")",
";",
"setDialogGravity",
"(",
"gravity",
")",
";",
"}"
] |
Obtains the gravity of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the gravity should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"gravity",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L580-L583
|
4,639 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogWidth
|
private void obtainDialogWidth(@NonNull final TypedArray typedArray) {
int width = 0;
try {
width = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogWidth, width);
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
width = typedArray.getInteger(0, width);
}
if (width != 0) {
setDialogWidth(width);
}
}
|
java
|
private void obtainDialogWidth(@NonNull final TypedArray typedArray) {
int width = 0;
try {
width = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogWidth, width);
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
width = typedArray.getInteger(0, width);
}
if (width != 0) {
setDialogWidth(width);
}
}
|
[
"private",
"void",
"obtainDialogWidth",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"width",
"=",
"0",
";",
"try",
"{",
"width",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogWidth",
",",
"width",
")",
";",
"}",
"catch",
"(",
"Resources",
".",
"NotFoundException",
"|",
"UnsupportedOperationException",
"e",
")",
"{",
"width",
"=",
"typedArray",
".",
"getInteger",
"(",
"0",
",",
"width",
")",
";",
"}",
"if",
"(",
"width",
"!=",
"0",
")",
"{",
"setDialogWidth",
"(",
"width",
")",
";",
"}",
"}"
] |
Obtains the width of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the width should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"width",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L592-L605
|
4,640 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogHeight
|
private void obtainDialogHeight(@NonNull final TypedArray typedArray) {
int height = 0;
try {
height = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogHeight, height);
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
height = typedArray.getInteger(0, height);
}
if (height != 0) {
setDialogHeight(height);
}
}
|
java
|
private void obtainDialogHeight(@NonNull final TypedArray typedArray) {
int height = 0;
try {
height = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogHeight, height);
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
height = typedArray.getInteger(0, height);
}
if (height != 0) {
setDialogHeight(height);
}
}
|
[
"private",
"void",
"obtainDialogHeight",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"height",
"=",
"0",
";",
"try",
"{",
"height",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogHeight",
",",
"height",
")",
";",
"}",
"catch",
"(",
"Resources",
".",
"NotFoundException",
"|",
"UnsupportedOperationException",
"e",
")",
"{",
"height",
"=",
"typedArray",
".",
"getInteger",
"(",
"0",
",",
"height",
")",
";",
"}",
"if",
"(",
"height",
"!=",
"0",
")",
"{",
"setDialogHeight",
"(",
"height",
")",
";",
"}",
"}"
] |
Obtains the height of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the height should be obtained from, as an instance of the class
{@link TypedArray} the typed array may not be null
|
[
"Obtains",
"the",
"height",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L614-L627
|
4,641 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogMaxWidth
|
private void obtainDialogMaxWidth(@NonNull final TypedArray typedArray) {
try {
int maxWidth = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogMaxWidth, -1);
if (maxWidth != -1) {
setDialogMaxWidth(maxWidth);
}
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
// No need to handle
}
}
|
java
|
private void obtainDialogMaxWidth(@NonNull final TypedArray typedArray) {
try {
int maxWidth = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogMaxWidth, -1);
if (maxWidth != -1) {
setDialogMaxWidth(maxWidth);
}
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
// No need to handle
}
}
|
[
"private",
"void",
"obtainDialogMaxWidth",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"try",
"{",
"int",
"maxWidth",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMaxWidth",
",",
"-",
"1",
")",
";",
"if",
"(",
"maxWidth",
"!=",
"-",
"1",
")",
"{",
"setDialogMaxWidth",
"(",
"maxWidth",
")",
";",
"}",
"}",
"catch",
"(",
"Resources",
".",
"NotFoundException",
"|",
"UnsupportedOperationException",
"e",
")",
"{",
"// No need to handle",
"}",
"}"
] |
Obtains the maximum width of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the maximum width should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"maximum",
"width",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L636-L647
|
4,642 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogMaxHeight
|
private void obtainDialogMaxHeight(@NonNull final TypedArray typedArray) {
try {
int maxHeight = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogMaxHeight, -1);
if (maxHeight != -1) {
setDialogMaxHeight(maxHeight);
}
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
// No need to handle
}
}
|
java
|
private void obtainDialogMaxHeight(@NonNull final TypedArray typedArray) {
try {
int maxHeight = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogMaxHeight, -1);
if (maxHeight != -1) {
setDialogMaxHeight(maxHeight);
}
} catch (Resources.NotFoundException | UnsupportedOperationException e) {
// No need to handle
}
}
|
[
"private",
"void",
"obtainDialogMaxHeight",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"try",
"{",
"int",
"maxHeight",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMaxHeight",
",",
"-",
"1",
")",
";",
"if",
"(",
"maxHeight",
"!=",
"-",
"1",
")",
"{",
"setDialogMaxHeight",
"(",
"maxHeight",
")",
";",
"}",
"}",
"catch",
"(",
"Resources",
".",
"NotFoundException",
"|",
"UnsupportedOperationException",
"e",
")",
"{",
"// No need to handle",
"}",
"}"
] |
Obtains the maximum height of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the maximum height should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"maximum",
"height",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L656-L667
|
4,643 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogMargin
|
private void obtainDialogMargin(@NonNull final TypedArray typedArray) {
int defaultHorizontalMargin =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_horizontal_margin);
int defaultVerticalMargin =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_vertical_margin);
int left = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginLeft,
defaultHorizontalMargin);
int top = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginTop,
defaultVerticalMargin);
int right = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginRight,
defaultHorizontalMargin);
int bottom = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginBottom,
defaultVerticalMargin);
setDialogMargin(left, top, right, bottom);
}
|
java
|
private void obtainDialogMargin(@NonNull final TypedArray typedArray) {
int defaultHorizontalMargin =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_horizontal_margin);
int defaultVerticalMargin =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_vertical_margin);
int left = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginLeft,
defaultHorizontalMargin);
int top = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginTop,
defaultVerticalMargin);
int right = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginRight,
defaultHorizontalMargin);
int bottom = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogMarginBottom,
defaultVerticalMargin);
setDialogMargin(left, top, right, bottom);
}
|
[
"private",
"void",
"obtainDialogMargin",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultHorizontalMargin",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"dialog_horizontal_margin",
")",
";",
"int",
"defaultVerticalMargin",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"dialog_vertical_margin",
")",
";",
"int",
"left",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMarginLeft",
",",
"defaultHorizontalMargin",
")",
";",
"int",
"top",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMarginTop",
",",
"defaultVerticalMargin",
")",
";",
"int",
"right",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMarginRight",
",",
"defaultHorizontalMargin",
")",
";",
"int",
"bottom",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMarginBottom",
",",
"defaultVerticalMargin",
")",
";",
"setDialogMargin",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";",
"}"
] |
Obtains the margin of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the margin should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"margin",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L676-L691
|
4,644 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogPadding
|
private void obtainDialogPadding(@NonNull final TypedArray typedArray) {
int defaultLeftPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_left_padding);
int defaultTopPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_top_padding);
int defaultRightPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_right_padding);
int defaultBottomPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_bottom_padding);
int left = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingLeft,
defaultLeftPadding);
int top = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingTop,
defaultTopPadding);
int right = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingRight,
defaultRightPadding);
int bottom = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingBottom,
defaultBottomPadding);
setDialogPadding(left, top, right, bottom);
}
|
java
|
private void obtainDialogPadding(@NonNull final TypedArray typedArray) {
int defaultLeftPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_left_padding);
int defaultTopPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_top_padding);
int defaultRightPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_right_padding);
int defaultBottomPadding =
getContext().getResources().getDimensionPixelSize(R.dimen.dialog_bottom_padding);
int left = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingLeft,
defaultLeftPadding);
int top = typedArray.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingTop,
defaultTopPadding);
int right = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingRight,
defaultRightPadding);
int bottom = typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogPaddingBottom,
defaultBottomPadding);
setDialogPadding(left, top, right, bottom);
}
|
[
"private",
"void",
"obtainDialogPadding",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultLeftPadding",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"dialog_left_padding",
")",
";",
"int",
"defaultTopPadding",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"dialog_top_padding",
")",
";",
"int",
"defaultRightPadding",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"dialog_right_padding",
")",
";",
"int",
"defaultBottomPadding",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"dialog_bottom_padding",
")",
";",
"int",
"left",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogPaddingLeft",
",",
"defaultLeftPadding",
")",
";",
"int",
"top",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogPaddingTop",
",",
"defaultTopPadding",
")",
";",
"int",
"right",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogPaddingRight",
",",
"defaultRightPadding",
")",
";",
"int",
"bottom",
"=",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogPaddingBottom",
",",
"defaultBottomPadding",
")",
";",
"setDialogPadding",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";",
"}"
] |
Obtains the padding of the preference's dialog from a specific typed array.
@param typedArray
The typed array, the padding should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"padding",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L700-L720
|
4,645 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogFitsSystemWindows
|
private void obtainDialogFitsSystemWindows(@NonNull final TypedArray typedArray) {
boolean left = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsLeft, true);
boolean top = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsTop, true);
boolean right = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsRight, true);
boolean bottom = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsBottom, true);
setDialogFitsSystemWindows(left, top, right, bottom);
}
|
java
|
private void obtainDialogFitsSystemWindows(@NonNull final TypedArray typedArray) {
boolean left = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsLeft, true);
boolean top = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsTop, true);
boolean right = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsRight, true);
boolean bottom = typedArray
.getBoolean(R.styleable.DialogPreference_dialogFitsSystemWindowsBottom, true);
setDialogFitsSystemWindows(left, top, right, bottom);
}
|
[
"private",
"void",
"obtainDialogFitsSystemWindows",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"left",
"=",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogFitsSystemWindowsLeft",
",",
"true",
")",
";",
"boolean",
"top",
"=",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogFitsSystemWindowsTop",
",",
"true",
")",
";",
"boolean",
"right",
"=",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogFitsSystemWindowsRight",
",",
"true",
")",
";",
"boolean",
"bottom",
"=",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogFitsSystemWindowsBottom",
",",
"true",
")",
";",
"setDialogFitsSystemWindows",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";",
"}"
] |
Obtains, whether the preference's dialog should account for system screen decorations such as
the status bar and inset its content, or not.
@param typedArray
The typed array, it should be obtained from, whether the preference's dialog should
account for system screen decorations, or not, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"whether",
"the",
"preference",
"s",
"dialog",
"should",
"account",
"for",
"system",
"screen",
"decorations",
"such",
"as",
"the",
"status",
"bar",
"and",
"inset",
"its",
"content",
"or",
"not",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L731-L741
|
4,646 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogTitle
|
private void obtainDialogTitle(@NonNull final TypedArray typedArray) {
CharSequence title = typedArray.getText(R.styleable.DialogPreference_android_dialogTitle);
setDialogTitle(title != null ? title : getTitle());
}
|
java
|
private void obtainDialogTitle(@NonNull final TypedArray typedArray) {
CharSequence title = typedArray.getText(R.styleable.DialogPreference_android_dialogTitle);
setDialogTitle(title != null ? title : getTitle());
}
|
[
"private",
"void",
"obtainDialogTitle",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"CharSequence",
"title",
"=",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_android_dialogTitle",
")",
";",
"setDialogTitle",
"(",
"title",
"!=",
"null",
"?",
"title",
":",
"getTitle",
"(",
")",
")",
";",
"}"
] |
Obtains the title of the dialog, which is shown by the preference, from a specific typed
array.
@param typedArray
The typed array, the title should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"title",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L751-L754
|
4,647 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogMessage
|
private void obtainDialogMessage(@NonNull final TypedArray typedArray) {
setDialogMessage(typedArray.getText(R.styleable.DialogPreference_android_dialogMessage));
}
|
java
|
private void obtainDialogMessage(@NonNull final TypedArray typedArray) {
setDialogMessage(typedArray.getText(R.styleable.DialogPreference_android_dialogMessage));
}
|
[
"private",
"void",
"obtainDialogMessage",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogMessage",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_android_dialogMessage",
")",
")",
";",
"}"
] |
Obtains the message of the dialog, which is shown by the preference, from a specific typed
array.
@param typedArray
The typed array, the message should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"message",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L764-L766
|
4,648 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogIcon
|
private void obtainDialogIcon(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_android_dialogIcon, -1);
if (resourceId != -1) {
setDialogIcon(resourceId);
}
}
|
java
|
private void obtainDialogIcon(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_android_dialogIcon, -1);
if (resourceId != -1) {
setDialogIcon(resourceId);
}
}
|
[
"private",
"void",
"obtainDialogIcon",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_android_dialogIcon",
",",
"-",
"1",
")",
";",
"if",
"(",
"resourceId",
"!=",
"-",
"1",
")",
"{",
"setDialogIcon",
"(",
"resourceId",
")",
";",
"}",
"}"
] |
Obtains the icon of the dialog, which is shown by the preference, from a specific typed
array.
@param typedArray
The typed array, the icon should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"icon",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L776-L783
|
4,649 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogIconTintList
|
private void obtainDialogIconTintList(@NonNull final TypedArray typedArray) {
setDialogIconTintList(
typedArray.getColorStateList(R.styleable.DialogPreference_dialogIconTint));
}
|
java
|
private void obtainDialogIconTintList(@NonNull final TypedArray typedArray) {
setDialogIconTintList(
typedArray.getColorStateList(R.styleable.DialogPreference_dialogIconTint));
}
|
[
"private",
"void",
"obtainDialogIconTintList",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogIconTintList",
"(",
"typedArray",
".",
"getColorStateList",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogIconTint",
")",
")",
";",
"}"
] |
Obtains the color state list, which is used to tint the icon of the preference's dialog, from
a specific typed array.
@param typedArray
The typed array, the color state list should be obtained from, as an instance of the
type {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"color",
"state",
"list",
"which",
"is",
"used",
"to",
"tint",
"the",
"icon",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L793-L796
|
4,650 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainPositiveButtonText
|
private void obtainPositiveButtonText(@NonNull final TypedArray typedArray) {
setPositiveButtonText(
typedArray.getText(R.styleable.DialogPreference_android_positiveButtonText));
}
|
java
|
private void obtainPositiveButtonText(@NonNull final TypedArray typedArray) {
setPositiveButtonText(
typedArray.getText(R.styleable.DialogPreference_android_positiveButtonText));
}
|
[
"private",
"void",
"obtainPositiveButtonText",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setPositiveButtonText",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_android_positiveButtonText",
")",
")",
";",
"}"
] |
Obtains the positive button text of the dialog, which is shown by the preference, from a
specific typed array.
@param typedArray
The typed array, the positive button text should be obtained from, as an instance of
the class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"positive",
"button",
"text",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L806-L809
|
4,651 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainNegativeButtonText
|
private void obtainNegativeButtonText(@NonNull final TypedArray typedArray) {
setNegativeButtonText(
typedArray.getText(R.styleable.DialogPreference_android_negativeButtonText));
}
|
java
|
private void obtainNegativeButtonText(@NonNull final TypedArray typedArray) {
setNegativeButtonText(
typedArray.getText(R.styleable.DialogPreference_android_negativeButtonText));
}
|
[
"private",
"void",
"obtainNegativeButtonText",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setNegativeButtonText",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_android_negativeButtonText",
")",
")",
";",
"}"
] |
Obtains the negative button text of the dialog, which is shown by the preference, from a
specific typed array.
@param typedArray
The typed array, the negative button text should be obtained from, as an instance of
the class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"negative",
"button",
"text",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L819-L822
|
4,652 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogTitleColor
|
private void obtainDialogTitleColor(@NonNull final TypedArray typedArray) {
setDialogTitleColor(typedArray.getColor(R.styleable.DialogPreference_dialogTitleColor, -1));
}
|
java
|
private void obtainDialogTitleColor(@NonNull final TypedArray typedArray) {
setDialogTitleColor(typedArray.getColor(R.styleable.DialogPreference_dialogTitleColor, -1));
}
|
[
"private",
"void",
"obtainDialogTitleColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogTitleColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogTitleColor",
",",
"-",
"1",
")",
")",
";",
"}"
] |
Obtains the title color of the dialog, which is shown by the preference, from a specific
typed array.
@param typedArray
The typed array, the title color should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"title",
"color",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L832-L834
|
4,653 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogMessageColor
|
private void obtainDialogMessageColor(@NonNull final TypedArray typedArray) {
setDialogMessageColor(
typedArray.getColor(R.styleable.DialogPreference_dialogMessageColor, -1));
}
|
java
|
private void obtainDialogMessageColor(@NonNull final TypedArray typedArray) {
setDialogMessageColor(
typedArray.getColor(R.styleable.DialogPreference_dialogMessageColor, -1));
}
|
[
"private",
"void",
"obtainDialogMessageColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogMessageColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogMessageColor",
",",
"-",
"1",
")",
")",
";",
"}"
] |
Obtains the message color of the dialog, which is shown by the preference, from a specific
typed array.
@param typedArray
The typed array, the message color should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"message",
"color",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L844-L847
|
4,654 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogButtonTextColor
|
private void obtainDialogButtonTextColor(@NonNull final TypedArray typedArray) {
ColorStateList colorStateList =
typedArray.getColorStateList(R.styleable.DialogPreference_dialogButtonTextColor);
if (colorStateList != null) {
setDialogButtonTextColor(colorStateList);
}
}
|
java
|
private void obtainDialogButtonTextColor(@NonNull final TypedArray typedArray) {
ColorStateList colorStateList =
typedArray.getColorStateList(R.styleable.DialogPreference_dialogButtonTextColor);
if (colorStateList != null) {
setDialogButtonTextColor(colorStateList);
}
}
|
[
"private",
"void",
"obtainDialogButtonTextColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"ColorStateList",
"colorStateList",
"=",
"typedArray",
".",
"getColorStateList",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogButtonTextColor",
")",
";",
"if",
"(",
"colorStateList",
"!=",
"null",
")",
"{",
"setDialogButtonTextColor",
"(",
"colorStateList",
")",
";",
"}",
"}"
] |
Obtains the button text color of the dialog, which is shown by the preference, from a
specific typed array.
@param typedArray
The typed array, the color should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"button",
"text",
"color",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L857-L864
|
4,655 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogBackground
|
private void obtainDialogBackground(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogBackground, -1);
if (resourceId != -1) {
setDialogBackground(resourceId);
} else {
int color = typedArray.getColor(R.styleable.DialogPreference_dialogBackground, -1);
if (color != -1) {
setDialogBackgroundColor(color);
}
}
}
|
java
|
private void obtainDialogBackground(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogBackground, -1);
if (resourceId != -1) {
setDialogBackground(resourceId);
} else {
int color = typedArray.getColor(R.styleable.DialogPreference_dialogBackground, -1);
if (color != -1) {
setDialogBackgroundColor(color);
}
}
}
|
[
"private",
"void",
"obtainDialogBackground",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogBackground",
",",
"-",
"1",
")",
";",
"if",
"(",
"resourceId",
"!=",
"-",
"1",
")",
"{",
"setDialogBackground",
"(",
"resourceId",
")",
";",
"}",
"else",
"{",
"int",
"color",
"=",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogBackground",
",",
"-",
"1",
")",
";",
"if",
"(",
"color",
"!=",
"-",
"1",
")",
"{",
"setDialogBackgroundColor",
"(",
"color",
")",
";",
"}",
"}",
"}"
] |
Obtains the background of the dialog, which is shown by the preference, from a specific typed
array.
@param typedArray
The typed array, the background should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"background",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L874-L887
|
4,656 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogWindowBackground
|
private void obtainDialogWindowBackground(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogWindowBackground, -1);
if (resourceId != -1) {
setDialogWindowBackground(resourceId);
}
}
|
java
|
private void obtainDialogWindowBackground(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogWindowBackground, -1);
if (resourceId != -1) {
setDialogWindowBackground(resourceId);
}
}
|
[
"private",
"void",
"obtainDialogWindowBackground",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogWindowBackground",
",",
"-",
"1",
")",
";",
"if",
"(",
"resourceId",
"!=",
"-",
"1",
")",
"{",
"setDialogWindowBackground",
"(",
"resourceId",
")",
";",
"}",
"}"
] |
Obtains the window background of the dialog, which is shown by the preference, from a
specific typed array.
@param typedArray
The typed array, the window background should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"window",
"background",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L897-L904
|
4,657 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainShowValueAsSummary
|
private void obtainShowValueAsSummary(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.dialog_preference_default_show_value_as_summary);
showValueAsSummary(typedArray
.getBoolean(R.styleable.DialogPreference_showValueAsSummary, defaultValue));
}
|
java
|
private void obtainShowValueAsSummary(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.dialog_preference_default_show_value_as_summary);
showValueAsSummary(typedArray
.getBoolean(R.styleable.DialogPreference_showValueAsSummary, defaultValue));
}
|
[
"private",
"void",
"obtainShowValueAsSummary",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"dialog_preference_default_show_value_as_summary",
")",
";",
"showValueAsSummary",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_showValueAsSummary",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the boolean value, which specifies whether the currently persisted value should be
shown as the summary, instead of the given summaries, from a specific typed array.
@param typedArray
The typed array, the boolean value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"boolean",
"value",
"which",
"specifies",
"whether",
"the",
"currently",
"persisted",
"value",
"should",
"be",
"shown",
"as",
"the",
"summary",
"instead",
"of",
"the",
"given",
"summaries",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L914-L919
|
4,658 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainShowDialogHeader
|
private void obtainShowDialogHeader(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.dialog_preference_default_show_dialog_header);
showDialogHeader(
typedArray.getBoolean(R.styleable.DialogPreference_showDialogHeader, defaultValue));
}
|
java
|
private void obtainShowDialogHeader(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.dialog_preference_default_show_dialog_header);
showDialogHeader(
typedArray.getBoolean(R.styleable.DialogPreference_showDialogHeader, defaultValue));
}
|
[
"private",
"void",
"obtainShowDialogHeader",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"dialog_preference_default_show_dialog_header",
")",
";",
"showDialogHeader",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_showDialogHeader",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the boolean value, which specifies whether the header of the dialog, which is shown
by the preference, should be shown, from a specific typed array.
@param typedArray
The typed array, the boolean value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"boolean",
"value",
"which",
"specifies",
"whether",
"the",
"header",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"should",
"be",
"shown",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L929-L934
|
4,659 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogHeaderBackground
|
private void obtainDialogHeaderBackground(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogHeaderBackground, -1);
if (resourceId != -1) {
setDialogHeaderBackground(resourceId);
} else {
int color =
typedArray.getColor(R.styleable.DialogPreference_dialogHeaderBackground, -1);
if (color != -1) {
setDialogHeaderBackgroundColor(color);
}
}
}
|
java
|
private void obtainDialogHeaderBackground(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogHeaderBackground, -1);
if (resourceId != -1) {
setDialogHeaderBackground(resourceId);
} else {
int color =
typedArray.getColor(R.styleable.DialogPreference_dialogHeaderBackground, -1);
if (color != -1) {
setDialogHeaderBackgroundColor(color);
}
}
}
|
[
"private",
"void",
"obtainDialogHeaderBackground",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogHeaderBackground",
",",
"-",
"1",
")",
";",
"if",
"(",
"resourceId",
"!=",
"-",
"1",
")",
"{",
"setDialogHeaderBackground",
"(",
"resourceId",
")",
";",
"}",
"else",
"{",
"int",
"color",
"=",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogHeaderBackground",
",",
"-",
"1",
")",
";",
"if",
"(",
"color",
"!=",
"-",
"1",
")",
"{",
"setDialogHeaderBackgroundColor",
"(",
"color",
")",
";",
"}",
"}",
"}"
] |
Obtains the background of the header of the dialog, which is shown by the preference, from a
specific typed array.
@param typedArray
The typed array, the background should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"background",
"of",
"the",
"header",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L944-L958
|
4,660 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogHeaderIcon
|
private void obtainDialogHeaderIcon(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogHeaderIcon, -1);
if (resourceId != -1) {
setDialogHeaderIcon(resourceId);
}
}
|
java
|
private void obtainDialogHeaderIcon(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.DialogPreference_dialogHeaderIcon, -1);
if (resourceId != -1) {
setDialogHeaderIcon(resourceId);
}
}
|
[
"private",
"void",
"obtainDialogHeaderIcon",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogHeaderIcon",
",",
"-",
"1",
")",
";",
"if",
"(",
"resourceId",
"!=",
"-",
"1",
")",
"{",
"setDialogHeaderIcon",
"(",
"resourceId",
")",
";",
"}",
"}"
] |
Obtains the icon of the header of the dialog, which is shown by the preference, from a
specific typed array.
@param typedArray
The typed array, the icon should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"icon",
"of",
"the",
"header",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L968-L975
|
4,661 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogHeaderIconTintList
|
private void obtainDialogHeaderIconTintList(@NonNull final TypedArray typedArray) {
setDialogHeaderIconTintList(
typedArray.getColorStateList(R.styleable.DialogPreference_dialogHeaderIconTint));
}
|
java
|
private void obtainDialogHeaderIconTintList(@NonNull final TypedArray typedArray) {
setDialogHeaderIconTintList(
typedArray.getColorStateList(R.styleable.DialogPreference_dialogHeaderIconTint));
}
|
[
"private",
"void",
"obtainDialogHeaderIconTintList",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogHeaderIconTintList",
"(",
"typedArray",
".",
"getColorStateList",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogHeaderIconTint",
")",
")",
";",
"}"
] |
Obtains the color state list, which is used to tint the icon of the header of the
preference's dialog, from a specific typed array.
@param typedArray
The typed array, the color state list should be obtained from, as an instance of the
type {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"color",
"state",
"list",
"which",
"is",
"used",
"to",
"tint",
"the",
"icon",
"of",
"the",
"header",
"of",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L985-L988
|
4,662 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainShowDialogButtonBarDivider
|
private void obtainShowDialogButtonBarDivider(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.dialog_preference_default_show_dialog_button_bar_divider);
showDialogButtonBarDivider(typedArray
.getBoolean(R.styleable.DialogPreference_showDialogButtonBarDivider, defaultValue));
}
|
java
|
private void obtainShowDialogButtonBarDivider(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.dialog_preference_default_show_dialog_button_bar_divider);
showDialogButtonBarDivider(typedArray
.getBoolean(R.styleable.DialogPreference_showDialogButtonBarDivider, defaultValue));
}
|
[
"private",
"void",
"obtainShowDialogButtonBarDivider",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"dialog_preference_default_show_dialog_button_bar_divider",
")",
";",
"showDialogButtonBarDivider",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_showDialogButtonBarDivider",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the boolean value, which specifies whether the divider, which is located above the
buttons of the dialog, which is shown by the preference, should be shown, from a specific
typed array.
@param typedArray
The typed array, the boolean value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"boolean",
"value",
"which",
"specifies",
"whether",
"the",
"divider",
"which",
"is",
"located",
"above",
"the",
"buttons",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"should",
"be",
"shown",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L999-L1004
|
4,663 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogButtonBarDividerColor
|
private void obtainDialogButtonBarDividerColor(@NonNull final TypedArray typedArray) {
int defaultValue = ContextCompat.getColor(getContext(), R.color.divider_color_light);
setDialogDividerColor(
typedArray.getColor(R.styleable.DialogPreference_dialogDividerColor, defaultValue));
}
|
java
|
private void obtainDialogButtonBarDividerColor(@NonNull final TypedArray typedArray) {
int defaultValue = ContextCompat.getColor(getContext(), R.color.divider_color_light);
setDialogDividerColor(
typedArray.getColor(R.styleable.DialogPreference_dialogDividerColor, defaultValue));
}
|
[
"private",
"void",
"obtainDialogButtonBarDividerColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"ContextCompat",
".",
"getColor",
"(",
"getContext",
"(",
")",
",",
"R",
".",
"color",
".",
"divider_color_light",
")",
";",
"setDialogDividerColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogDividerColor",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the color of the divider, which is located above the buttons of the dialog, which is
shown by the preference, from a specific typed array.
@param typedArray
The typed array, the color should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"color",
"of",
"the",
"divider",
"which",
"is",
"located",
"above",
"the",
"buttons",
"of",
"the",
"dialog",
"which",
"is",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1014-L1018
|
4,664 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainDialogButtonBarDividerMargin
|
private void obtainDialogButtonBarDividerMargin(@NonNull final TypedArray typedArray) {
setDialogDividerMargin(typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogDividerMargin, 0));
}
|
java
|
private void obtainDialogButtonBarDividerMargin(@NonNull final TypedArray typedArray) {
setDialogDividerMargin(typedArray
.getDimensionPixelSize(R.styleable.DialogPreference_dialogDividerMargin, 0));
}
|
[
"private",
"void",
"obtainDialogButtonBarDividerMargin",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setDialogDividerMargin",
"(",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_dialogDividerMargin",
",",
"0",
")",
")",
";",
"}"
] |
Obtains the left and right margin of the divider, which is located above the buttons of the
dialog, which shown by the preference, from a specific typed array.
@param typedArray
The typed array, the margin should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"left",
"and",
"right",
"margin",
"of",
"the",
"divider",
"which",
"is",
"located",
"above",
"the",
"buttons",
"of",
"the",
"dialog",
"which",
"shown",
"by",
"the",
"preference",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1028-L1031
|
4,665 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.obtainShowDialogDividersOnScroll
|
private void obtainShowDialogDividersOnScroll(@NonNull final TypedArray typedArray) {
showDialogDividersOnScroll(typedArray
.getBoolean(R.styleable.DialogPreference_showDialogDividersOnScroll, true));
}
|
java
|
private void obtainShowDialogDividersOnScroll(@NonNull final TypedArray typedArray) {
showDialogDividersOnScroll(typedArray
.getBoolean(R.styleable.DialogPreference_showDialogDividersOnScroll, true));
}
|
[
"private",
"void",
"obtainShowDialogDividersOnScroll",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"showDialogDividersOnScroll",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"DialogPreference_showDialogDividersOnScroll",
",",
"true",
")",
")",
";",
"}"
] |
Obtains, whether the dividers, which are shown above and below the list view of the
preference's dialog, should be shown when the list view is scrolled, or not, from a specific
typed array.
@param typedArray
The typed array, the boolean value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"whether",
"the",
"dividers",
"which",
"are",
"shown",
"above",
"and",
"below",
"the",
"list",
"view",
"of",
"the",
"preference",
"s",
"dialog",
"should",
"be",
"shown",
"when",
"the",
"list",
"view",
"is",
"scrolled",
"or",
"not",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1042-L1045
|
4,666 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.requestInputMode
|
private void requestInputMode() {
if (needInputMethod()) {
Window window = dialog.getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
}
}
|
java
|
private void requestInputMode() {
if (needInputMethod()) {
Window window = dialog.getWindow();
if (window != null) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
}
}
|
[
"private",
"void",
"requestInputMode",
"(",
")",
"{",
"if",
"(",
"needInputMethod",
"(",
")",
")",
"{",
"Window",
"window",
"=",
"dialog",
".",
"getWindow",
"(",
")",
";",
"if",
"(",
"window",
"!=",
"null",
")",
"{",
"window",
".",
"setSoftInputMode",
"(",
"WindowManager",
".",
"LayoutParams",
".",
"SOFT_INPUT_STATE_ALWAYS_VISIBLE",
")",
";",
"}",
"}",
"}"
] |
Requests the soft input method to be shown.
|
[
"Requests",
"the",
"soft",
"input",
"method",
"to",
"be",
"shown",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1242-L1250
|
4,667 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.createDialog
|
@NonNull
protected AbstractButtonBarDialog createDialog(
@NonNull final AbstractButtonBarDialogBuilder<?, ?> dialogBuilder) {
return ((MaterialDialog.Builder) dialogBuilder).create();
}
|
java
|
@NonNull
protected AbstractButtonBarDialog createDialog(
@NonNull final AbstractButtonBarDialogBuilder<?, ?> dialogBuilder) {
return ((MaterialDialog.Builder) dialogBuilder).create();
}
|
[
"@",
"NonNull",
"protected",
"AbstractButtonBarDialog",
"createDialog",
"(",
"@",
"NonNull",
"final",
"AbstractButtonBarDialogBuilder",
"<",
"?",
",",
"?",
">",
"dialogBuilder",
")",
"{",
"return",
"(",
"(",
"MaterialDialog",
".",
"Builder",
")",
"dialogBuilder",
")",
".",
"create",
"(",
")",
";",
"}"
] |
The method, which is invoked on subclasses when the preference's dialog is about to be
created. The builder, which is passed as a method parameter may be manipulated by subclasses
in order to change the appearance of the dialog. When views are inflated inside this method,
the context of the builder should be used in order to ensure that the dialog's theme is
used.
@param dialogBuilder
The builder, which is used to create the preference's dialog, as an instance of the
class AbstractMaterialDialogBuilder
@return The dialog, which has been created, as an instance of the class
AbstractButtonBarDialog. The dialog may not be null
|
[
"The",
"method",
"which",
"is",
"invoked",
"on",
"subclasses",
"when",
"the",
"preference",
"s",
"dialog",
"is",
"about",
"to",
"be",
"created",
".",
"The",
"builder",
"which",
"is",
"passed",
"as",
"a",
"method",
"parameter",
"may",
"be",
"manipulated",
"by",
"subclasses",
"in",
"order",
"to",
"change",
"the",
"appearance",
"of",
"the",
"dialog",
".",
"When",
"views",
"are",
"inflated",
"inside",
"this",
"method",
"the",
"context",
"of",
"the",
"builder",
"should",
"be",
"used",
"in",
"order",
"to",
"ensure",
"that",
"the",
"dialog",
"s",
"theme",
"is",
"used",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1355-L1359
|
4,668 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogMargin
|
public final void setDialogMargin(final int left, final int top, final int right,
final int bottom) {
this.dialogMargin = new int[]{left, top, right, bottom};
}
|
java
|
public final void setDialogMargin(final int left, final int top, final int right,
final int bottom) {
this.dialogMargin = new int[]{left, top, right, bottom};
}
|
[
"public",
"final",
"void",
"setDialogMargin",
"(",
"final",
"int",
"left",
",",
"final",
"int",
"top",
",",
"final",
"int",
"right",
",",
"final",
"int",
"bottom",
")",
"{",
"this",
".",
"dialogMargin",
"=",
"new",
"int",
"[",
"]",
"{",
"left",
",",
"top",
",",
"right",
",",
"bottom",
"}",
";",
"}"
] |
Sets the margin of the preference's dialog.
@param left
The left margin, which should be set, in pixels as an {@link Integer} value. The left
margin must be at least 0
@param top
The left margin, which should be set, in pixels as an {@link Integer} value. The left
margin must be at least 0
@param right
The left margin, which should be set, in pixels as an {@link Integer} value. The left
margin must be at least 0
@param bottom
The left margin, which should be set, in pixels as an {@link Integer} value. The left
margin must be at least 0
|
[
"Sets",
"the",
"margin",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1610-L1613
|
4,669 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogPadding
|
public final void setDialogPadding(final int left, final int top, final int right,
final int bottom) {
Condition.INSTANCE.ensureAtLeast(left, 0, "The left padding must be at least 0");
Condition.INSTANCE.ensureAtLeast(top, 0, "The top padding must be at least 0");
Condition.INSTANCE.ensureAtLeast(right, 0, "The right padding must be at least 0");
Condition.INSTANCE.ensureAtLeast(bottom, 0, "The bottom padding must be at least 0");
this.dialogPadding = new int[]{left, top, right, bottom};
}
|
java
|
public final void setDialogPadding(final int left, final int top, final int right,
final int bottom) {
Condition.INSTANCE.ensureAtLeast(left, 0, "The left padding must be at least 0");
Condition.INSTANCE.ensureAtLeast(top, 0, "The top padding must be at least 0");
Condition.INSTANCE.ensureAtLeast(right, 0, "The right padding must be at least 0");
Condition.INSTANCE.ensureAtLeast(bottom, 0, "The bottom padding must be at least 0");
this.dialogPadding = new int[]{left, top, right, bottom};
}
|
[
"public",
"final",
"void",
"setDialogPadding",
"(",
"final",
"int",
"left",
",",
"final",
"int",
"top",
",",
"final",
"int",
"right",
",",
"final",
"int",
"bottom",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"left",
",",
"0",
",",
"\"The left padding must be at least 0\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"top",
",",
"0",
",",
"\"The top padding must be at least 0\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"right",
",",
"0",
",",
"\"The right padding must be at least 0\"",
")",
";",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"bottom",
",",
"0",
",",
"\"The bottom padding must be at least 0\"",
")",
";",
"this",
".",
"dialogPadding",
"=",
"new",
"int",
"[",
"]",
"{",
"left",
",",
"top",
",",
"right",
",",
"bottom",
"}",
";",
"}"
] |
Sets the padding of the preference's dialog.
@param left
The left padding, which should be set, in pixels as an {@link Integer} value. The
left padding must be at least 0
@param top
The top padding, which should be set, in pixels as an {@link Integer} value. The top
padding must be at least 0
@param right
The right padding, which should be set, in pixels as an {@link Integer} value. The
right padding must be at least 0
@param bottom
The bottom padding, which should be set, in pixels as an {@link Integer} value. The
bottom padding must be at least 0
|
[
"Sets",
"the",
"padding",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1667-L1674
|
4,670 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogFitsSystemWindows
|
public final void setDialogFitsSystemWindows(final boolean left, final boolean top,
final boolean right, final boolean bottom) {
this.dialogFitsSystemWindows = new boolean[]{left, top, right, bottom};
}
|
java
|
public final void setDialogFitsSystemWindows(final boolean left, final boolean top,
final boolean right, final boolean bottom) {
this.dialogFitsSystemWindows = new boolean[]{left, top, right, bottom};
}
|
[
"public",
"final",
"void",
"setDialogFitsSystemWindows",
"(",
"final",
"boolean",
"left",
",",
"final",
"boolean",
"top",
",",
"final",
"boolean",
"right",
",",
"final",
"boolean",
"bottom",
")",
"{",
"this",
".",
"dialogFitsSystemWindows",
"=",
"new",
"boolean",
"[",
"]",
"{",
"left",
",",
"top",
",",
"right",
",",
"bottom",
"}",
";",
"}"
] |
Sets, whether the preference's dialog should account for system screen decorations such as
the status bar and inset its content, or not.
@param left
True, if the preference's dialog should inset its content at the left edge, false
otherwise
@param top
True, if the preference's dialog should inset its content at the top edge, false
otherwise
@param right
True, if the preference's dialog should inset its content at the right edge, false
otherwise
@param bottom
True, if the preference's dialog should inset its content at the bottom edge, false
otherwise
|
[
"Sets",
"whether",
"the",
"preference",
"s",
"dialog",
"should",
"account",
"for",
"system",
"screen",
"decorations",
"such",
"as",
"the",
"status",
"bar",
"and",
"inset",
"its",
"content",
"or",
"not",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1747-L1750
|
4,671 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogIconTintMode
|
public final void setDialogIconTintMode(@NonNull final PorterDuff.Mode mode) {
Condition.INSTANCE.ensureNotNull(mode, "The dialog icon tint mode may not be null");
this.dialogIconTintMode = mode;
}
|
java
|
public final void setDialogIconTintMode(@NonNull final PorterDuff.Mode mode) {
Condition.INSTANCE.ensureNotNull(mode, "The dialog icon tint mode may not be null");
this.dialogIconTintMode = mode;
}
|
[
"public",
"final",
"void",
"setDialogIconTintMode",
"(",
"@",
"NonNull",
"final",
"PorterDuff",
".",
"Mode",
"mode",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"mode",
",",
"\"The dialog icon tint mode may not be null\"",
")",
";",
"this",
".",
"dialogIconTintMode",
"=",
"mode",
";",
"}"
] |
Sets the mode, which should be used to tint the icon of the preference's dialog.
@param mode
The mode, which should be set, as a value of the enum {@link PorterDuff.Mode}. The
mode may not be null
|
[
"Sets",
"the",
"mode",
"which",
"should",
"be",
"used",
"to",
"tint",
"the",
"icon",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L1901-L1904
|
4,672 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogButtonTextColor
|
public final void setDialogButtonTextColor(@NonNull final ColorStateList colorStateList) {
Condition.INSTANCE.ensureNotNull(colorStateList, "The color state list may not be null");
this.dialogButtonTextColor = colorStateList;
}
|
java
|
public final void setDialogButtonTextColor(@NonNull final ColorStateList colorStateList) {
Condition.INSTANCE.ensureNotNull(colorStateList, "The color state list may not be null");
this.dialogButtonTextColor = colorStateList;
}
|
[
"public",
"final",
"void",
"setDialogButtonTextColor",
"(",
"@",
"NonNull",
"final",
"ColorStateList",
"colorStateList",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"colorStateList",
",",
"\"The color state list may not be null\"",
")",
";",
"this",
".",
"dialogButtonTextColor",
"=",
"colorStateList",
";",
"}"
] |
Sets the text color of the buttons of the preference's dialog.
@param colorStateList
The color, which should be set, as an instance of the class {@link ColorStateList}.
The color state list may not be null
|
[
"Sets",
"the",
"text",
"color",
"of",
"the",
"buttons",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L2084-L2087
|
4,673 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogBackgroundColor
|
public final void setDialogBackgroundColor(@ColorInt final int color) {
this.dialogBackground = new ColorDrawable(color);
this.dialogBackgroundBitmap = null;
this.dialogBackgroundId = -1;
this.dialogBackgroundColor = color;
}
|
java
|
public final void setDialogBackgroundColor(@ColorInt final int color) {
this.dialogBackground = new ColorDrawable(color);
this.dialogBackgroundBitmap = null;
this.dialogBackgroundId = -1;
this.dialogBackgroundColor = color;
}
|
[
"public",
"final",
"void",
"setDialogBackgroundColor",
"(",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"this",
".",
"dialogBackground",
"=",
"new",
"ColorDrawable",
"(",
"color",
")",
";",
"this",
".",
"dialogBackgroundBitmap",
"=",
"null",
";",
"this",
".",
"dialogBackgroundId",
"=",
"-",
"1",
";",
"this",
".",
"dialogBackgroundColor",
"=",
"color",
";",
"}"
] |
Sets the background color of the preference's dialog.
@param color
The color, which should be set, as an {@link Integer} value or -1, if no custom
background color should be set
|
[
"Sets",
"the",
"background",
"color",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L2156-L2161
|
4,674 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogHeaderBackgroundColor
|
public final void setDialogHeaderBackgroundColor(@ColorInt final int color) {
this.dialogHeaderBackground = new ColorDrawable(color);
this.dialogHeaderBackgroundBitmap = null;
this.dialogHeaderBackgroundId = -1;
this.dialogHeaderBackgroundColor = color;
}
|
java
|
public final void setDialogHeaderBackgroundColor(@ColorInt final int color) {
this.dialogHeaderBackground = new ColorDrawable(color);
this.dialogHeaderBackgroundBitmap = null;
this.dialogHeaderBackgroundId = -1;
this.dialogHeaderBackgroundColor = color;
}
|
[
"public",
"final",
"void",
"setDialogHeaderBackgroundColor",
"(",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"this",
".",
"dialogHeaderBackground",
"=",
"new",
"ColorDrawable",
"(",
"color",
")",
";",
"this",
".",
"dialogHeaderBackgroundBitmap",
"=",
"null",
";",
"this",
".",
"dialogHeaderBackgroundId",
"=",
"-",
"1",
";",
"this",
".",
"dialogHeaderBackgroundColor",
"=",
"color",
";",
"}"
] |
Sets the background color of the header of the preference's dialog.
@param color
The color, which should be set, as an {@link Integer} value or -1, if no custom color
should be set
|
[
"Sets",
"the",
"background",
"color",
"of",
"the",
"header",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L2286-L2291
|
4,675 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogHeaderIconTintMode
|
public final void setDialogHeaderIconTintMode(@NonNull final PorterDuff.Mode mode) {
Condition.INSTANCE.ensureNotNull(mode, "The dialog icon tint mode may not be null");
this.dialogHeaderIconTintMode = mode;
}
|
java
|
public final void setDialogHeaderIconTintMode(@NonNull final PorterDuff.Mode mode) {
Condition.INSTANCE.ensureNotNull(mode, "The dialog icon tint mode may not be null");
this.dialogHeaderIconTintMode = mode;
}
|
[
"public",
"final",
"void",
"setDialogHeaderIconTintMode",
"(",
"@",
"NonNull",
"final",
"PorterDuff",
".",
"Mode",
"mode",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"mode",
",",
"\"The dialog icon tint mode may not be null\"",
")",
";",
"this",
".",
"dialogHeaderIconTintMode",
"=",
"mode",
";",
"}"
] |
Sets the mode, which should be used to tint the icon of the header of the preference's
dialog.
@param mode
The mode, which should be set, as a value of the enum {@link PorterDuff.Mode}. The
mode may not be null
|
[
"Sets",
"the",
"mode",
"which",
"should",
"be",
"used",
"to",
"tint",
"the",
"icon",
"of",
"the",
"header",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L2383-L2386
|
4,676 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/DialogPreference.java
|
DialogPreference.setDialogScrollableArea
|
public final void setDialogScrollableArea(@Nullable final Area top,
@Nullable final Area bottom) {
this.dialogScrollableArea = ScrollableArea.create(top, bottom);
}
|
java
|
public final void setDialogScrollableArea(@Nullable final Area top,
@Nullable final Area bottom) {
this.dialogScrollableArea = ScrollableArea.create(top, bottom);
}
|
[
"public",
"final",
"void",
"setDialogScrollableArea",
"(",
"@",
"Nullable",
"final",
"Area",
"top",
",",
"@",
"Nullable",
"final",
"Area",
"bottom",
")",
"{",
"this",
".",
"dialogScrollableArea",
"=",
"ScrollableArea",
".",
"create",
"(",
"top",
",",
"bottom",
")",
";",
"}"
] |
Sets the scrollable area of the preference's dialog.
@param top
The top scrollable area, which should be set, as a value of the enum Area or null, if
no scrollable area should be set
@param bottom
The bottom scrollable area, which should be set, as a value of the enum Area or null,
if no scrollable area should be set. The index of the bottom area must be at leas the
index of the top area. If the top area is null, the bottom area must be null as well
|
[
"Sets",
"the",
"scrollable",
"area",
"of",
"the",
"preference",
"s",
"dialog",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DialogPreference.java#L2509-L2512
|
4,677 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractNumberPickerPreference.java
|
AbstractNumberPickerPreference.obtainUseInputMethod
|
private void obtainUseInputMethod(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.number_picker_preference_default_use_input_method);
useInputMethod(typedArray
.getBoolean(R.styleable.AbstractNumberPickerPreference_useInputMethod,
defaultValue));
}
|
java
|
private void obtainUseInputMethod(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.number_picker_preference_default_use_input_method);
useInputMethod(typedArray
.getBoolean(R.styleable.AbstractNumberPickerPreference_useInputMethod,
defaultValue));
}
|
[
"private",
"void",
"obtainUseInputMethod",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"number_picker_preference_default_use_input_method",
")",
";",
"useInputMethod",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"AbstractNumberPickerPreference_useInputMethod",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains, whether an input method should be used, or not, from a specific typed array.
@param typedArray
The typed array, which should be used to retrieve, whether an input method should be
used, or not, as an instance of the class {@link TypedArray}. The typed array may not
be null
|
[
"Obtains",
"whether",
"an",
"input",
"method",
"should",
"be",
"used",
"or",
"not",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractNumberPickerPreference.java#L193-L199
|
4,678 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/EditTextPreference.java
|
EditTextPreference.obtainHint
|
private void obtainHint(@NonNull final TypedArray typedArray) {
setHint(typedArray.getText(R.styleable.EditTextPreference_android_hint));
}
|
java
|
private void obtainHint(@NonNull final TypedArray typedArray) {
setHint(typedArray.getText(R.styleable.EditTextPreference_android_hint));
}
|
[
"private",
"void",
"obtainHint",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setHint",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"EditTextPreference_android_hint",
")",
")",
";",
"}"
] |
Obtains the hint of the edit text widget, which is shown in the preference's dialog, from a
specific typed array.
@param typedArray
The typed array, the hint should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"hint",
"of",
"the",
"edit",
"text",
"widget",
"which",
"is",
"shown",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/EditTextPreference.java#L182-L184
|
4,679 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/EditTextPreference.java
|
EditTextPreference.setText
|
public final void setText(@Nullable final String text) {
boolean hasDisabledDependents = shouldDisableDependents();
this.text = text;
persistString(text);
boolean isDisablingDependents = shouldDisableDependents();
if (isDisablingDependents != hasDisabledDependents) {
notifyDependencyChange(isDisablingDependents);
}
notifyChanged();
}
|
java
|
public final void setText(@Nullable final String text) {
boolean hasDisabledDependents = shouldDisableDependents();
this.text = text;
persistString(text);
boolean isDisablingDependents = shouldDisableDependents();
if (isDisablingDependents != hasDisabledDependents) {
notifyDependencyChange(isDisablingDependents);
}
notifyChanged();
}
|
[
"public",
"final",
"void",
"setText",
"(",
"@",
"Nullable",
"final",
"String",
"text",
")",
"{",
"boolean",
"hasDisabledDependents",
"=",
"shouldDisableDependents",
"(",
")",
";",
"this",
".",
"text",
"=",
"text",
";",
"persistString",
"(",
"text",
")",
";",
"boolean",
"isDisablingDependents",
"=",
"shouldDisableDependents",
"(",
")",
";",
"if",
"(",
"isDisablingDependents",
"!=",
"hasDisabledDependents",
")",
"{",
"notifyDependencyChange",
"(",
"isDisablingDependents",
")",
";",
"}",
"notifyChanged",
"(",
")",
";",
"}"
] |
Sets the current text of the preference. By setting a value, it will be persisted.
@param text
The text, which should be set, as a {@link String}
|
[
"Sets",
"the",
"current",
"text",
"of",
"the",
"preference",
".",
"By",
"setting",
"a",
"value",
"it",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/EditTextPreference.java#L275-L286
|
4,680 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.getPersistedSet
|
private Set<String> getPersistedSet(@Nullable final Set<String> defaultValue) {
if (!shouldPersist()) {
return defaultValue;
}
return getPreferenceManager().getSharedPreferences().getStringSet(getKey(), defaultValue);
}
|
java
|
private Set<String> getPersistedSet(@Nullable final Set<String> defaultValue) {
if (!shouldPersist()) {
return defaultValue;
}
return getPreferenceManager().getSharedPreferences().getStringSet(getKey(), defaultValue);
}
|
[
"private",
"Set",
"<",
"String",
">",
"getPersistedSet",
"(",
"@",
"Nullable",
"final",
"Set",
"<",
"String",
">",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"shouldPersist",
"(",
")",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"getPreferenceManager",
"(",
")",
".",
"getSharedPreferences",
"(",
")",
".",
"getStringSet",
"(",
"getKey",
"(",
")",
",",
"defaultValue",
")",
";",
"}"
] |
Loads and returns the currently persisted set, which belongs to the preference's key, from
the shared preferences.
@param defaultValue
The default value, which should be returned, if no set with the preference's key is
currently persisted, as an instance of the type {@link Set}
@return The currently persisted set or the given default value as an instance of the type
{@link Set}
|
[
"Loads",
"and",
"returns",
"the",
"currently",
"persisted",
"set",
"which",
"belongs",
"to",
"the",
"preference",
"s",
"key",
"from",
"the",
"shared",
"preferences",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L150-L156
|
4,681 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.indicesOf
|
private List<Integer> indicesOf(@Nullable final Set<String> values) {
List<Integer> indices = new ArrayList<>();
if (values != null && getEntryValues() != null) {
for (String value : values) {
int index = indexOf(value);
if (index >= 0) {
indices.add(index);
}
}
}
return indices;
}
|
java
|
private List<Integer> indicesOf(@Nullable final Set<String> values) {
List<Integer> indices = new ArrayList<>();
if (values != null && getEntryValues() != null) {
for (String value : values) {
int index = indexOf(value);
if (index >= 0) {
indices.add(index);
}
}
}
return indices;
}
|
[
"private",
"List",
"<",
"Integer",
">",
"indicesOf",
"(",
"@",
"Nullable",
"final",
"Set",
"<",
"String",
">",
"values",
")",
"{",
"List",
"<",
"Integer",
">",
"indices",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"values",
"!=",
"null",
"&&",
"getEntryValues",
"(",
")",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"value",
":",
"values",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"value",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"indices",
".",
"add",
"(",
"index",
")",
";",
"}",
"}",
"}",
"return",
"indices",
";",
"}"
] |
Return the indices of the entries, which correspond to specific values.
@param values
A set, which contains the values of the entries, whose indices should be returned, as
an instance of the type {@link Set}
@return A list, which contains the indices of the entries, the given values correspond to, as
an instance of the type {@link List}
|
[
"Return",
"the",
"indices",
"of",
"the",
"entries",
"which",
"correspond",
"to",
"specific",
"values",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L167-L181
|
4,682 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.persistSet
|
private boolean persistSet(@Nullable final Set<String> set) {
if (set != null && shouldPersist()) {
if (set.equals(getPersistedSet(null))) {
return true;
}
Editor editor = getPreferenceManager().getSharedPreferences().edit();
editor.putStringSet(getKey(), set);
editor.apply();
return true;
}
return false;
}
|
java
|
private boolean persistSet(@Nullable final Set<String> set) {
if (set != null && shouldPersist()) {
if (set.equals(getPersistedSet(null))) {
return true;
}
Editor editor = getPreferenceManager().getSharedPreferences().edit();
editor.putStringSet(getKey(), set);
editor.apply();
return true;
}
return false;
}
|
[
"private",
"boolean",
"persistSet",
"(",
"@",
"Nullable",
"final",
"Set",
"<",
"String",
">",
"set",
")",
"{",
"if",
"(",
"set",
"!=",
"null",
"&&",
"shouldPersist",
"(",
")",
")",
"{",
"if",
"(",
"set",
".",
"equals",
"(",
"getPersistedSet",
"(",
"null",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"Editor",
"editor",
"=",
"getPreferenceManager",
"(",
")",
".",
"getSharedPreferences",
"(",
")",
".",
"edit",
"(",
")",
";",
"editor",
".",
"putStringSet",
"(",
"getKey",
"(",
")",
",",
"set",
")",
";",
"editor",
".",
"apply",
"(",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] |
Persists a specific set in the shared preferences by using the preference's key.
@param set
The set, which should be persisted, as an instance of the type {@link Set}
@return True, if the given set has been persisted, false otherwise
|
[
"Persists",
"a",
"specific",
"set",
"in",
"the",
"shared",
"preferences",
"by",
"using",
"the",
"preference",
"s",
"key",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L190-L203
|
4,683 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.createListItemListener
|
private OnMultiChoiceClickListener createListItemListener() {
return new OnMultiChoiceClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which,
final boolean isChecked) {
if (isChecked) {
selectedIndices.add(which);
} else {
selectedIndices.remove(which);
}
}
};
}
|
java
|
private OnMultiChoiceClickListener createListItemListener() {
return new OnMultiChoiceClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which,
final boolean isChecked) {
if (isChecked) {
selectedIndices.add(which);
} else {
selectedIndices.remove(which);
}
}
};
}
|
[
"private",
"OnMultiChoiceClickListener",
"createListItemListener",
"(",
")",
"{",
"return",
"new",
"OnMultiChoiceClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"DialogInterface",
"dialog",
",",
"final",
"int",
"which",
",",
"final",
"boolean",
"isChecked",
")",
"{",
"if",
"(",
"isChecked",
")",
"{",
"selectedIndices",
".",
"add",
"(",
"which",
")",
";",
"}",
"else",
"{",
"selectedIndices",
".",
"remove",
"(",
"which",
")",
";",
"}",
"}",
"}",
";",
"}"
] |
Creates and returns a listener, which allows to observe when list items are selected or
unselected by the user.
@return The listener, which has been created, as an instance of the type {@link
OnMultiChoiceClickListener}
|
[
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"observe",
"when",
"list",
"items",
"are",
"selected",
"or",
"unselected",
"by",
"the",
"user",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L212-L226
|
4,684 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.setValues
|
public final void setValues(@Nullable final Set<String> values) {
if (values != null && !values.equals(this.values)) {
this.values = values;
persistSet(this.values);
notifyChanged();
}
}
|
java
|
public final void setValues(@Nullable final Set<String> values) {
if (values != null && !values.equals(this.values)) {
this.values = values;
persistSet(this.values);
notifyChanged();
}
}
|
[
"public",
"final",
"void",
"setValues",
"(",
"@",
"Nullable",
"final",
"Set",
"<",
"String",
">",
"values",
")",
"{",
"if",
"(",
"values",
"!=",
"null",
"&&",
"!",
"values",
".",
"equals",
"(",
"this",
".",
"values",
")",
")",
"{",
"this",
".",
"values",
"=",
"values",
";",
"persistSet",
"(",
"this",
".",
"values",
")",
";",
"notifyChanged",
"(",
")",
";",
"}",
"}"
] |
Sets the current values of the preference. By setting values, they will be persisted.
@param values
A set, which contains the values, which should be set, as an instance of the type
{@link Set}
|
[
"Sets",
"the",
"current",
"values",
"of",
"the",
"preference",
".",
"By",
"setting",
"values",
"they",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L319-L325
|
4,685 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.addValue
|
public final void addValue(@NonNull final String value) {
Condition.INSTANCE.ensureNotNull(value, "The value may not be null");
if (this.values != null) {
if (this.values.add(value)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
} else {
Set<String> newValues = new HashSet<>();
newValues.add(value);
setValues(newValues);
}
}
|
java
|
public final void addValue(@NonNull final String value) {
Condition.INSTANCE.ensureNotNull(value, "The value may not be null");
if (this.values != null) {
if (this.values.add(value)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
} else {
Set<String> newValues = new HashSet<>();
newValues.add(value);
setValues(newValues);
}
}
|
[
"public",
"final",
"void",
"addValue",
"(",
"@",
"NonNull",
"final",
"String",
"value",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"value",
",",
"\"The value may not be null\"",
")",
";",
"if",
"(",
"this",
".",
"values",
"!=",
"null",
")",
"{",
"if",
"(",
"this",
".",
"values",
".",
"add",
"(",
"value",
")",
")",
"{",
"if",
"(",
"persistSet",
"(",
"this",
".",
"values",
")",
")",
"{",
"notifyChanged",
"(",
")",
";",
"}",
"}",
"}",
"else",
"{",
"Set",
"<",
"String",
">",
"newValues",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"newValues",
".",
"add",
"(",
"value",
")",
";",
"setValues",
"(",
"newValues",
")",
";",
"}",
"}"
] |
Adds a new value to the preference. By adding a value, the changes will be persisted.
@param value
The value, which should be added, as a {@link String}. The value may not be null
|
[
"Adds",
"a",
"new",
"value",
"to",
"the",
"preference",
".",
"By",
"adding",
"a",
"value",
"the",
"changes",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L333-L347
|
4,686 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.removeValue
|
public final void removeValue(@NonNull final String value) {
Condition.INSTANCE.ensureNotNull(value, "The value may not be null");
if (this.values != null) {
if (this.values.remove(value)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
}
}
|
java
|
public final void removeValue(@NonNull final String value) {
Condition.INSTANCE.ensureNotNull(value, "The value may not be null");
if (this.values != null) {
if (this.values.remove(value)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
}
}
|
[
"public",
"final",
"void",
"removeValue",
"(",
"@",
"NonNull",
"final",
"String",
"value",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"value",
",",
"\"The value may not be null\"",
")",
";",
"if",
"(",
"this",
".",
"values",
"!=",
"null",
")",
"{",
"if",
"(",
"this",
".",
"values",
".",
"remove",
"(",
"value",
")",
")",
"{",
"if",
"(",
"persistSet",
"(",
"this",
".",
"values",
")",
")",
"{",
"notifyChanged",
"(",
")",
";",
"}",
"}",
"}",
"}"
] |
Removes a specific value from the preference. By removing a value, the changes will be
persisted.
@param value
The value, which should be removed, as a {@link String}. The value may not be null
|
[
"Removes",
"a",
"specific",
"value",
"from",
"the",
"preference",
".",
"By",
"removing",
"a",
"value",
"the",
"changes",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L356-L366
|
4,687 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.addAllValues
|
public final void addAllValues(@NonNull final Collection<String> values) {
Condition.INSTANCE.ensureNotNull(values, "The values may not be null");
if (this.values != null) {
if (this.values.addAll(values)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
} else {
Set<String> newValues = new HashSet<>(values);
setValues(newValues);
}
}
|
java
|
public final void addAllValues(@NonNull final Collection<String> values) {
Condition.INSTANCE.ensureNotNull(values, "The values may not be null");
if (this.values != null) {
if (this.values.addAll(values)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
} else {
Set<String> newValues = new HashSet<>(values);
setValues(newValues);
}
}
|
[
"public",
"final",
"void",
"addAllValues",
"(",
"@",
"NonNull",
"final",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"values",
",",
"\"The values may not be null\"",
")",
";",
"if",
"(",
"this",
".",
"values",
"!=",
"null",
")",
"{",
"if",
"(",
"this",
".",
"values",
".",
"addAll",
"(",
"values",
")",
")",
"{",
"if",
"(",
"persistSet",
"(",
"this",
".",
"values",
")",
")",
"{",
"notifyChanged",
"(",
")",
";",
"}",
"}",
"}",
"else",
"{",
"Set",
"<",
"String",
">",
"newValues",
"=",
"new",
"HashSet",
"<>",
"(",
"values",
")",
";",
"setValues",
"(",
"newValues",
")",
";",
"}",
"}"
] |
Adds all values, which are contained by a specific collection, to the preference. By adding
values, the changes will be persisted.
@param values
A collection, which contains the values, which should be added, as an instance of the
type {@link Collection} or an empty collection, if no values should be added
|
[
"Adds",
"all",
"values",
"which",
"are",
"contained",
"by",
"a",
"specific",
"collection",
"to",
"the",
"preference",
".",
"By",
"adding",
"values",
"the",
"changes",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L376-L389
|
4,688 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.removeAllValues
|
public final void removeAllValues(@NonNull final Collection<String> values) {
Condition.INSTANCE.ensureNotNull(values, "The values may not be null");
if (this.values != null) {
if (this.values.removeAll(values)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
}
}
|
java
|
public final void removeAllValues(@NonNull final Collection<String> values) {
Condition.INSTANCE.ensureNotNull(values, "The values may not be null");
if (this.values != null) {
if (this.values.removeAll(values)) {
if (persistSet(this.values)) {
notifyChanged();
}
}
}
}
|
[
"public",
"final",
"void",
"removeAllValues",
"(",
"@",
"NonNull",
"final",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"values",
",",
"\"The values may not be null\"",
")",
";",
"if",
"(",
"this",
".",
"values",
"!=",
"null",
")",
"{",
"if",
"(",
"this",
".",
"values",
".",
"removeAll",
"(",
"values",
")",
")",
"{",
"if",
"(",
"persistSet",
"(",
"this",
".",
"values",
")",
")",
"{",
"notifyChanged",
"(",
")",
";",
"}",
"}",
"}",
"}"
] |
Removes all values, which are contained by a specific collection, from the preference. By
removing values, the changes will be persisted.
@param values
A collection, which contains the values, which should be removed, as an instance of
the type {@link Collection} or an empty collection, if no values should be removed
|
[
"Removes",
"all",
"values",
"which",
"are",
"contained",
"by",
"a",
"specific",
"collection",
"from",
"the",
"preference",
".",
"By",
"removing",
"values",
"the",
"changes",
"will",
"be",
"persisted",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L399-L409
|
4,689 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java
|
MultiChoiceListPreference.getSelectedEntries
|
public final CharSequence[] getSelectedEntries() {
List<Integer> indices = indicesOf(values);
Collections.sort(indices);
if (!indices.isEmpty()) {
CharSequence[] selectedEntries = new CharSequence[indices.size()];
int currentIndex = 0;
for (int index : indices) {
selectedEntries[currentIndex] = getEntries()[index];
currentIndex++;
}
return selectedEntries;
}
return null;
}
|
java
|
public final CharSequence[] getSelectedEntries() {
List<Integer> indices = indicesOf(values);
Collections.sort(indices);
if (!indices.isEmpty()) {
CharSequence[] selectedEntries = new CharSequence[indices.size()];
int currentIndex = 0;
for (int index : indices) {
selectedEntries[currentIndex] = getEntries()[index];
currentIndex++;
}
return selectedEntries;
}
return null;
}
|
[
"public",
"final",
"CharSequence",
"[",
"]",
"getSelectedEntries",
"(",
")",
"{",
"List",
"<",
"Integer",
">",
"indices",
"=",
"indicesOf",
"(",
"values",
")",
";",
"Collections",
".",
"sort",
"(",
"indices",
")",
";",
"if",
"(",
"!",
"indices",
".",
"isEmpty",
"(",
")",
")",
"{",
"CharSequence",
"[",
"]",
"selectedEntries",
"=",
"new",
"CharSequence",
"[",
"indices",
".",
"size",
"(",
")",
"]",
";",
"int",
"currentIndex",
"=",
"0",
";",
"for",
"(",
"int",
"index",
":",
"indices",
")",
"{",
"selectedEntries",
"[",
"currentIndex",
"]",
"=",
"getEntries",
"(",
")",
"[",
"index",
"]",
";",
"currentIndex",
"++",
";",
"}",
"return",
"selectedEntries",
";",
"}",
"return",
"null",
";",
"}"
] |
Returns the entries, the currently persisted values of the preference belong to.
@return An array, which contains the entries, the currently persisted values of the
preference belong to, as an array of the type {@link CharSequence}
|
[
"Returns",
"the",
"entries",
"the",
"currently",
"persisted",
"values",
"of",
"the",
"preference",
"belong",
"to",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/MultiChoiceListPreference.java#L417-L434
|
4,690 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainShowPreview
|
private void obtainShowPreview(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.color_picker_preference_default_show_preview);
showPreview(typedArray
.getBoolean(R.styleable.AbstractColorPickerPreference_showPreview, defaultValue));
}
|
java
|
private void obtainShowPreview(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.color_picker_preference_default_show_preview);
showPreview(typedArray
.getBoolean(R.styleable.AbstractColorPickerPreference_showPreview, defaultValue));
}
|
[
"private",
"void",
"obtainShowPreview",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"color_picker_preference_default_show_preview",
")",
";",
"showPreview",
"(",
"typedArray",
".",
"getBoolean",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_showPreview",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the boolean value, which specifies, whether a preview of the preference's color
should be shown, or not, from a specific typed array.
@param typedArray
The typed array, the boolean value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"boolean",
"value",
"which",
"specifies",
"whether",
"a",
"preview",
"of",
"the",
"preference",
"s",
"color",
"should",
"be",
"shown",
"or",
"not",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L366-L371
|
4,691 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainPreviewSize
|
private void obtainPreviewSize(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getDimensionPixelSize(R.dimen.color_picker_preference_default_preview_size);
setPreviewSize(typedArray
.getDimensionPixelSize(R.styleable.AbstractColorPickerPreference_previewSize,
defaultValue));
}
|
java
|
private void obtainPreviewSize(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getDimensionPixelSize(R.dimen.color_picker_preference_default_preview_size);
setPreviewSize(typedArray
.getDimensionPixelSize(R.styleable.AbstractColorPickerPreference_previewSize,
defaultValue));
}
|
[
"private",
"void",
"obtainPreviewSize",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"color_picker_preference_default_preview_size",
")",
";",
"setPreviewSize",
"(",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_previewSize",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the size of the preview of the preference's color from a specific typed array.
@param typedArray
The typed array, the size should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"size",
"of",
"the",
"preview",
"of",
"the",
"preference",
"s",
"color",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L380-L386
|
4,692 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainPreviewShape
|
private void obtainPreviewShape(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_picker_preference_default_preview_shape);
setPreviewShape(PreviewShape.fromValue(typedArray
.getInteger(R.styleable.AbstractColorPickerPreference_previewShape, defaultValue)));
}
|
java
|
private void obtainPreviewShape(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_picker_preference_default_preview_shape);
setPreviewShape(PreviewShape.fromValue(typedArray
.getInteger(R.styleable.AbstractColorPickerPreference_previewShape, defaultValue)));
}
|
[
"private",
"void",
"obtainPreviewShape",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"color_picker_preference_default_preview_shape",
")",
";",
"setPreviewShape",
"(",
"PreviewShape",
".",
"fromValue",
"(",
"typedArray",
".",
"getInteger",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_previewShape",
",",
"defaultValue",
")",
")",
")",
";",
"}"
] |
Obtains the shape of the preview of the preference's color from a specific typed array.
@param typedArray
The typed array, the shape should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"shape",
"of",
"the",
"preview",
"of",
"the",
"preference",
"s",
"color",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L395-L400
|
4,693 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainPreviewBorderWidth
|
private void obtainPreviewBorderWidth(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getDimensionPixelSize(
R.dimen.color_picker_preference_default_preview_border_width);
setPreviewBorderWidth(typedArray
.getDimensionPixelSize(R.styleable.AbstractColorPickerPreference_previewBorderWidth,
defaultValue));
}
|
java
|
private void obtainPreviewBorderWidth(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getDimensionPixelSize(
R.dimen.color_picker_preference_default_preview_border_width);
setPreviewBorderWidth(typedArray
.getDimensionPixelSize(R.styleable.AbstractColorPickerPreference_previewBorderWidth,
defaultValue));
}
|
[
"private",
"void",
"obtainPreviewBorderWidth",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"color_picker_preference_default_preview_border_width",
")",
";",
"setPreviewBorderWidth",
"(",
"typedArray",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_previewBorderWidth",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the border width of the preview of the preference's color from a specific typed
array.
@param typedArray
The typed array, the border width should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"border",
"width",
"of",
"the",
"preview",
"of",
"the",
"preference",
"s",
"color",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L410-L416
|
4,694 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainPreviewBorderColor
|
private void obtainPreviewBorderColor(@NonNull final TypedArray typedArray) {
int defaultValue = ContextCompat.getColor(getContext(),
R.color.color_picker_preference_default_preview_border_color);
setPreviewBorderColor(typedArray
.getColor(R.styleable.AbstractColorPickerPreference_previewBorderColor,
defaultValue));
}
|
java
|
private void obtainPreviewBorderColor(@NonNull final TypedArray typedArray) {
int defaultValue = ContextCompat.getColor(getContext(),
R.color.color_picker_preference_default_preview_border_color);
setPreviewBorderColor(typedArray
.getColor(R.styleable.AbstractColorPickerPreference_previewBorderColor,
defaultValue));
}
|
[
"private",
"void",
"obtainPreviewBorderColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"ContextCompat",
".",
"getColor",
"(",
"getContext",
"(",
")",
",",
"R",
".",
"color",
".",
"color_picker_preference_default_preview_border_color",
")",
";",
"setPreviewBorderColor",
"(",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_previewBorderColor",
",",
"defaultValue",
")",
")",
";",
"}"
] |
Obtains the border color of the preview of the preference's color from a specific typed
array.
@param typedArray
The typed array, the border color should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"border",
"color",
"of",
"the",
"preview",
"of",
"the",
"preference",
"s",
"color",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L426-L432
|
4,695 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainPreviewBackground
|
private void obtainPreviewBackground(@NonNull final TypedArray typedArray) {
int backgroundColor = typedArray
.getColor(R.styleable.AbstractColorPickerPreference_previewBackground, -1);
if (backgroundColor != -1) {
setPreviewBackgroundColor(backgroundColor);
} else {
int resourceId = typedArray
.getResourceId(R.styleable.AbstractColorPickerPreference_previewBackground,
R.drawable.color_picker_default_preview_background);
setPreviewBackground(ContextCompat.getDrawable(getContext(), resourceId));
}
}
|
java
|
private void obtainPreviewBackground(@NonNull final TypedArray typedArray) {
int backgroundColor = typedArray
.getColor(R.styleable.AbstractColorPickerPreference_previewBackground, -1);
if (backgroundColor != -1) {
setPreviewBackgroundColor(backgroundColor);
} else {
int resourceId = typedArray
.getResourceId(R.styleable.AbstractColorPickerPreference_previewBackground,
R.drawable.color_picker_default_preview_background);
setPreviewBackground(ContextCompat.getDrawable(getContext(), resourceId));
}
}
|
[
"private",
"void",
"obtainPreviewBackground",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"backgroundColor",
"=",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_previewBackground",
",",
"-",
"1",
")",
";",
"if",
"(",
"backgroundColor",
"!=",
"-",
"1",
")",
"{",
"setPreviewBackgroundColor",
"(",
"backgroundColor",
")",
";",
"}",
"else",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_previewBackground",
",",
"R",
".",
"drawable",
".",
"color_picker_default_preview_background",
")",
";",
"setPreviewBackground",
"(",
"ContextCompat",
".",
"getDrawable",
"(",
"getContext",
"(",
")",
",",
"resourceId",
")",
")",
";",
"}",
"}"
] |
Obtains the background of the preview of the preference's color from a specific typed array.
@param typedArray
The typed array, the background should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"background",
"of",
"the",
"preview",
"of",
"the",
"preference",
"s",
"color",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L441-L453
|
4,696 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.obtainColorFormat
|
private void obtainColorFormat(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_picker_preference_default_color_format);
setColorFormat(ColorFormat.fromValue(typedArray
.getInteger(R.styleable.AbstractColorPickerPreference_colorFormat, defaultValue)));
}
|
java
|
private void obtainColorFormat(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_picker_preference_default_color_format);
setColorFormat(ColorFormat.fromValue(typedArray
.getInteger(R.styleable.AbstractColorPickerPreference_colorFormat, defaultValue)));
}
|
[
"private",
"void",
"obtainColorFormat",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"color_picker_preference_default_color_format",
")",
";",
"setColorFormat",
"(",
"ColorFormat",
".",
"fromValue",
"(",
"typedArray",
".",
"getInteger",
"(",
"R",
".",
"styleable",
".",
"AbstractColorPickerPreference_colorFormat",
",",
"defaultValue",
")",
")",
")",
";",
"}"
] |
Obtains the format, which should be used to print a textual representation of the
preference's color, from a specific typed array.
@param typedArray
The typed array, the color format should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null
|
[
"Obtains",
"the",
"format",
"which",
"should",
"be",
"used",
"to",
"print",
"a",
"textual",
"representation",
"of",
"the",
"preference",
"s",
"color",
"from",
"a",
"specific",
"typed",
"array",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L463-L468
|
4,697 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.formatColor
|
private CharSequence formatColor(final ColorFormat colorFormat, @ColorInt final int color) {
Condition.INSTANCE.ensureNotNull(colorFormat, "The color format may not be null");
if (colorFormat == ColorFormat.RGB) {
return String.format(Locale.getDefault(), "R = %d, G = %d, B = %d", Color.red(color),
Color.green(color), Color.blue(color));
} else if (colorFormat == ColorFormat.ARGB) {
return String.format(Locale.getDefault(), "A = %d, R = %d, G = %d, B = %d",
Color.alpha(color), Color.red(color), Color.green(color), Color.blue(color));
} else if (colorFormat == ColorFormat.HEX_3_BYTES) {
return String.format("#%06X", (0xFFFFFF & color));
} else {
return String.format("#%08X", (color));
}
}
|
java
|
private CharSequence formatColor(final ColorFormat colorFormat, @ColorInt final int color) {
Condition.INSTANCE.ensureNotNull(colorFormat, "The color format may not be null");
if (colorFormat == ColorFormat.RGB) {
return String.format(Locale.getDefault(), "R = %d, G = %d, B = %d", Color.red(color),
Color.green(color), Color.blue(color));
} else if (colorFormat == ColorFormat.ARGB) {
return String.format(Locale.getDefault(), "A = %d, R = %d, G = %d, B = %d",
Color.alpha(color), Color.red(color), Color.green(color), Color.blue(color));
} else if (colorFormat == ColorFormat.HEX_3_BYTES) {
return String.format("#%06X", (0xFFFFFF & color));
} else {
return String.format("#%08X", (color));
}
}
|
[
"private",
"CharSequence",
"formatColor",
"(",
"final",
"ColorFormat",
"colorFormat",
",",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"colorFormat",
",",
"\"The color format may not be null\"",
")",
";",
"if",
"(",
"colorFormat",
"==",
"ColorFormat",
".",
"RGB",
")",
"{",
"return",
"String",
".",
"format",
"(",
"Locale",
".",
"getDefault",
"(",
")",
",",
"\"R = %d, G = %d, B = %d\"",
",",
"Color",
".",
"red",
"(",
"color",
")",
",",
"Color",
".",
"green",
"(",
"color",
")",
",",
"Color",
".",
"blue",
"(",
"color",
")",
")",
";",
"}",
"else",
"if",
"(",
"colorFormat",
"==",
"ColorFormat",
".",
"ARGB",
")",
"{",
"return",
"String",
".",
"format",
"(",
"Locale",
".",
"getDefault",
"(",
")",
",",
"\"A = %d, R = %d, G = %d, B = %d\"",
",",
"Color",
".",
"alpha",
"(",
"color",
")",
",",
"Color",
".",
"red",
"(",
"color",
")",
",",
"Color",
".",
"green",
"(",
"color",
")",
",",
"Color",
".",
"blue",
"(",
"color",
")",
")",
";",
"}",
"else",
"if",
"(",
"colorFormat",
"==",
"ColorFormat",
".",
"HEX_3_BYTES",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"#%06X\"",
",",
"(",
"0xFFFFFF",
"&",
"color",
")",
")",
";",
"}",
"else",
"{",
"return",
"String",
".",
"format",
"(",
"\"#%08X\"",
",",
"(",
"color",
")",
")",
";",
"}",
"}"
] |
Creates and returns a textual representation of a color, according to a specific format.
@param colorFormat
The format, which should be used to format the color, as a value of the enum {@link
ColorFormat}. The format may not be null
@param color
The color, which should be formatted, as an {@link Integer} value
@return A textual representation of the given color as an instance of the type {@link
CharSequence}
|
[
"Creates",
"and",
"returns",
"a",
"textual",
"representation",
"of",
"a",
"color",
"according",
"to",
"a",
"specific",
"format",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L481-L495
|
4,698 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.adaptPreviewView
|
private void adaptPreviewView() {
if (previewView != null) {
if (isPreviewShown()) {
previewView.setVisibility(View.VISIBLE);
previewView.setLayoutParams(createPreviewLayoutParams());
previewLoader.load(getColor(), previewView);
} else {
previewView.setVisibility(View.INVISIBLE);
previewView.setImageBitmap(null);
}
}
}
|
java
|
private void adaptPreviewView() {
if (previewView != null) {
if (isPreviewShown()) {
previewView.setVisibility(View.VISIBLE);
previewView.setLayoutParams(createPreviewLayoutParams());
previewLoader.load(getColor(), previewView);
} else {
previewView.setVisibility(View.INVISIBLE);
previewView.setImageBitmap(null);
}
}
}
|
[
"private",
"void",
"adaptPreviewView",
"(",
")",
"{",
"if",
"(",
"previewView",
"!=",
"null",
")",
"{",
"if",
"(",
"isPreviewShown",
"(",
")",
")",
"{",
"previewView",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"previewView",
".",
"setLayoutParams",
"(",
"createPreviewLayoutParams",
"(",
")",
")",
";",
"previewLoader",
".",
"load",
"(",
"getColor",
"(",
")",
",",
"previewView",
")",
";",
"}",
"else",
"{",
"previewView",
".",
"setVisibility",
"(",
"View",
".",
"INVISIBLE",
")",
";",
"previewView",
".",
"setImageBitmap",
"(",
"null",
")",
";",
"}",
"}",
"}"
] |
Adapts the view, which is used to show a preview of the preference's color, depending on the
preference's properties and the currently persisted color.
|
[
"Adapts",
"the",
"view",
"which",
"is",
"used",
"to",
"show",
"a",
"preview",
"of",
"the",
"preference",
"s",
"color",
"depending",
"on",
"the",
"preference",
"s",
"properties",
"and",
"the",
"currently",
"persisted",
"color",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L501-L512
|
4,699 |
michael-rapp/AndroidMaterialPreferences
|
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
|
AbstractColorPickerPreference.createPreviewLayoutParams
|
private LayoutParams createPreviewLayoutParams() {
LayoutParams layoutParams = new LayoutParams(getPreviewSize(), getPreviewSize());
layoutParams.gravity = Gravity.CENTER_VERTICAL;
return layoutParams;
}
|
java
|
private LayoutParams createPreviewLayoutParams() {
LayoutParams layoutParams = new LayoutParams(getPreviewSize(), getPreviewSize());
layoutParams.gravity = Gravity.CENTER_VERTICAL;
return layoutParams;
}
|
[
"private",
"LayoutParams",
"createPreviewLayoutParams",
"(",
")",
"{",
"LayoutParams",
"layoutParams",
"=",
"new",
"LayoutParams",
"(",
"getPreviewSize",
"(",
")",
",",
"getPreviewSize",
"(",
")",
")",
";",
"layoutParams",
".",
"gravity",
"=",
"Gravity",
".",
"CENTER_VERTICAL",
";",
"return",
"layoutParams",
";",
"}"
] |
Creates and returns the layout params of the view, which is used to show a preview of the
preference's color, depending on the preference's properties.
@return The layout params, which have been created, as an instance of the class {@link
LayoutParams}
|
[
"Creates",
"and",
"returns",
"the",
"layout",
"params",
"of",
"the",
"view",
"which",
"is",
"used",
"to",
"show",
"a",
"preview",
"of",
"the",
"preference",
"s",
"color",
"depending",
"on",
"the",
"preference",
"s",
"properties",
"."
] |
73a7e449458313bd041fc8d6038e290506b68eb1
|
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L521-L525
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.