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,700
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setColor
public final void setColor(@ColorInt final int color) { if (this.color != color) { this.color = color; persistInt(color); notifyChanged(); adaptPreviewView(); } }
java
public final void setColor(@ColorInt final int color) { if (this.color != color) { this.color = color; persistInt(color); notifyChanged(); adaptPreviewView(); } }
[ "public", "final", "void", "setColor", "(", "@", "ColorInt", "final", "int", "color", ")", "{", "if", "(", "this", ".", "color", "!=", "color", ")", "{", "this", ".", "color", "=", "color", ";", "persistInt", "(", "color", ")", ";", "notifyChanged", "(", ")", ";", "adaptPreviewView", "(", ")", ";", "}", "}" ]
Sets the current color of the preference. By setting a value, it will be persisted. @param color The color, which should be set, as an {@link Integer} value
[ "Sets", "the", "current", "color", "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/AbstractColorPickerPreference.java#L616-L623
4,701
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setPreviewSize
public final void setPreviewSize(final int previewSize) { Condition.INSTANCE.ensureAtLeast(previewSize, 1, "The preview size must be at least 1"); this.previewSize = previewSize; if (previewLoader != null) { previewLoader.setSize(previewSize); } }
java
public final void setPreviewSize(final int previewSize) { Condition.INSTANCE.ensureAtLeast(previewSize, 1, "The preview size must be at least 1"); this.previewSize = previewSize; if (previewLoader != null) { previewLoader.setSize(previewSize); } }
[ "public", "final", "void", "setPreviewSize", "(", "final", "int", "previewSize", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureAtLeast", "(", "previewSize", ",", "1", ",", "\"The preview size must be at least 1\"", ")", ";", "this", ".", "previewSize", "=", "previewSize", ";", "if", "(", "previewLoader", "!=", "null", ")", "{", "previewLoader", ".", "setSize", "(", "previewSize", ")", ";", "}", "}" ]
Sets the size of the preview of the preference's color. @param previewSize The size, which should be set, as an {@link Integer} value in pixels. The size must be at least 1
[ "Sets", "the", "size", "of", "the", "preview", "of", "the", "preference", "s", "color", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L662-L669
4,702
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setPreviewShape
public final void setPreviewShape(@NonNull final PreviewShape previewShape) { Condition.INSTANCE.ensureNotNull(previewShape, "The preview shape may not be null"); this.previewShape = previewShape; if (previewLoader != null) { previewLoader.setShape(previewShape); } adaptPreviewView(); }
java
public final void setPreviewShape(@NonNull final PreviewShape previewShape) { Condition.INSTANCE.ensureNotNull(previewShape, "The preview shape may not be null"); this.previewShape = previewShape; if (previewLoader != null) { previewLoader.setShape(previewShape); } adaptPreviewView(); }
[ "public", "final", "void", "setPreviewShape", "(", "@", "NonNull", "final", "PreviewShape", "previewShape", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "previewShape", ",", "\"The preview shape may not be null\"", ")", ";", "this", ".", "previewShape", "=", "previewShape", ";", "if", "(", "previewLoader", "!=", "null", ")", "{", "previewLoader", ".", "setShape", "(", "previewShape", ")", ";", "}", "adaptPreviewView", "(", ")", ";", "}" ]
Sets the shape of the preview of the preference's color. @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", "of", "the", "preview", "of", "the", "preference", "s", "color", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L688-L697
4,703
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setPreviewBorderWidth
public final void setPreviewBorderWidth(final int borderWidth) { Condition.INSTANCE.ensureAtLeast(borderWidth, 0, "The border width must be at least 0"); this.previewBorderWidth = borderWidth; if (previewLoader != null) { previewLoader.setBorderWidth(borderWidth); } adaptPreviewView(); }
java
public final void setPreviewBorderWidth(final int borderWidth) { Condition.INSTANCE.ensureAtLeast(borderWidth, 0, "The border width must be at least 0"); this.previewBorderWidth = borderWidth; if (previewLoader != null) { previewLoader.setBorderWidth(borderWidth); } adaptPreviewView(); }
[ "public", "final", "void", "setPreviewBorderWidth", "(", "final", "int", "borderWidth", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureAtLeast", "(", "borderWidth", ",", "0", ",", "\"The border width must be at least 0\"", ")", ";", "this", ".", "previewBorderWidth", "=", "borderWidth", ";", "if", "(", "previewLoader", "!=", "null", ")", "{", "previewLoader", ".", "setBorderWidth", "(", "borderWidth", ")", ";", "}", "adaptPreviewView", "(", ")", ";", "}" ]
Sets the border width of the preview of the preference's color. @param borderWidth The border width, which should be set, as an {@link Integer} value in pixels. The border width must be at least 0
[ "Sets", "the", "border", "width", "of", "the", "preview", "of", "the", "preference", "s", "color", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L716-L725
4,704
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setPreviewBorderColor
public final void setPreviewBorderColor(@ColorInt final int borderColor) { this.previewBorderColor = borderColor; if (previewLoader != null) { previewLoader.setBorderColor(borderColor); } adaptPreviewView(); }
java
public final void setPreviewBorderColor(@ColorInt final int borderColor) { this.previewBorderColor = borderColor; if (previewLoader != null) { previewLoader.setBorderColor(borderColor); } adaptPreviewView(); }
[ "public", "final", "void", "setPreviewBorderColor", "(", "@", "ColorInt", "final", "int", "borderColor", ")", "{", "this", ".", "previewBorderColor", "=", "borderColor", ";", "if", "(", "previewLoader", "!=", "null", ")", "{", "previewLoader", ".", "setBorderColor", "(", "borderColor", ")", ";", "}", "adaptPreviewView", "(", ")", ";", "}" ]
Sets the border color of the preview of the preference's color. @param borderColor The border color, which should be set, as an {@link Integer} value
[ "Sets", "the", "border", "color", "of", "the", "preview", "of", "the", "preference", "s", "color", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L742-L750
4,705
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setPreviewBackground
public final void setPreviewBackground(final Drawable background) { this.previewBackground = background; if (previewLoader != null) { previewLoader.setBackground(background); } adaptPreviewView(); }
java
public final void setPreviewBackground(final Drawable background) { this.previewBackground = background; if (previewLoader != null) { previewLoader.setBackground(background); } adaptPreviewView(); }
[ "public", "final", "void", "setPreviewBackground", "(", "final", "Drawable", "background", ")", "{", "this", ".", "previewBackground", "=", "background", ";", "if", "(", "previewLoader", "!=", "null", ")", "{", "previewLoader", ".", "setBackground", "(", "background", ")", ";", "}", "adaptPreviewView", "(", ")", ";", "}" ]
Sets the background of the preview of the preference's color. @param background The background, which should be set, as an instance of the class {@link Drawable} or null, if no background should be shown
[ "Sets", "the", "background", "of", "the", "preview", "of", "the", "preference", "s", "color", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L769-L777
4,706
michael-rapp/AndroidMaterialPreferences
library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java
AbstractColorPickerPreference.setColorFormat
public final void setColorFormat(@NonNull final ColorFormat colorFormat) { Condition.INSTANCE.ensureNotNull(colorFormat, "The color format may not be null"); this.colorFormat = colorFormat; }
java
public final void setColorFormat(@NonNull final ColorFormat colorFormat) { Condition.INSTANCE.ensureNotNull(colorFormat, "The color format may not be null"); this.colorFormat = colorFormat; }
[ "public", "final", "void", "setColorFormat", "(", "@", "NonNull", "final", "ColorFormat", "colorFormat", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "colorFormat", ",", "\"The color format may not be null\"", ")", ";", "this", ".", "colorFormat", "=", "colorFormat", ";", "}" ]
Sets the format, which should be used to print a textual representation of the preference's color. @param colorFormat The format, which should be set, as a value of the enum {@link ColorFormat}. The format may not be null
[ "Sets", "the", "format", "which", "should", "be", "used", "to", "print", "a", "textual", "representation", "of", "the", "preference", "s", "color", "." ]
73a7e449458313bd041fc8d6038e290506b68eb1
https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/AbstractColorPickerPreference.java#L821-L824
4,707
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/Async.java
Async.runAsync
public static <T> StoppableObservable<T> runAsync(Scheduler scheduler, final Action2<? super Observer<? super T>, ? super Subscription> action) { return runAsync(scheduler, PublishSubject.<T>create(), action); }
java
public static <T> StoppableObservable<T> runAsync(Scheduler scheduler, final Action2<? super Observer<? super T>, ? super Subscription> action) { return runAsync(scheduler, PublishSubject.<T>create(), action); }
[ "public", "static", "<", "T", ">", "StoppableObservable", "<", "T", ">", "runAsync", "(", "Scheduler", "scheduler", ",", "final", "Action2", "<", "?", "super", "Observer", "<", "?", "super", "T", ">", ",", "?", "super", "Subscription", ">", "action", ")", "{", "return", "runAsync", "(", "scheduler", ",", "PublishSubject", ".", "<", "T", ">", "create", "(", ")", ",", "action", ")", ";", "}" ]
Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned StoppableObservable. The action is immediately executed and unobserved values will be lost. @param <T> the output value type @param scheduler the Scheduler where the action is executed @param action the action to execute, receives an Observer where the events can be pumped and a Subscription which lets it check for cancellation condition @return an Observable that provides a Subscription interface to cancel the action @see <a href="https://github.com/ReactiveX/RxJava/wiki/Async-Operators#wiki-runasync">RxJava Wiki: runAsync()</a>
[ "Runs", "the", "provided", "action", "on", "the", "given", "scheduler", "and", "allows", "propagation", "of", "multiple", "events", "to", "the", "observers", "of", "the", "returned", "StoppableObservable", ".", "The", "action", "is", "immediately", "executed", "and", "unobserved", "values", "will", "be", "lost", "." ]
6294e1da30e639df79f76399906229314c14e74d
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L2093-L2096
4,708
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/Async.java
Async.runAsync
public static <T, U> StoppableObservable<U> runAsync(Scheduler scheduler, final Subject<T, U> subject, final Action2<? super Observer<? super T>, ? super Subscription> action) { final SerialSubscription csub = new SerialSubscription(); StoppableObservable<U> co = new StoppableObservable<U>(new Observable.OnSubscribe<U>() { @Override public void call(Subscriber<? super U> t1) { subject.subscribe(t1); } }, csub); final Worker inner = scheduler.createWorker(); csub.set(inner); inner.schedule(new Action0() { @Override public void call() { if (!csub.isUnsubscribed()) { action.call(subject, csub); } } }); return co; }
java
public static <T, U> StoppableObservable<U> runAsync(Scheduler scheduler, final Subject<T, U> subject, final Action2<? super Observer<? super T>, ? super Subscription> action) { final SerialSubscription csub = new SerialSubscription(); StoppableObservable<U> co = new StoppableObservable<U>(new Observable.OnSubscribe<U>() { @Override public void call(Subscriber<? super U> t1) { subject.subscribe(t1); } }, csub); final Worker inner = scheduler.createWorker(); csub.set(inner); inner.schedule(new Action0() { @Override public void call() { if (!csub.isUnsubscribed()) { action.call(subject, csub); } } }); return co; }
[ "public", "static", "<", "T", ",", "U", ">", "StoppableObservable", "<", "U", ">", "runAsync", "(", "Scheduler", "scheduler", ",", "final", "Subject", "<", "T", ",", "U", ">", "subject", ",", "final", "Action2", "<", "?", "super", "Observer", "<", "?", "super", "T", ">", ",", "?", "super", "Subscription", ">", "action", ")", "{", "final", "SerialSubscription", "csub", "=", "new", "SerialSubscription", "(", ")", ";", "StoppableObservable", "<", "U", ">", "co", "=", "new", "StoppableObservable", "<", "U", ">", "(", "new", "Observable", ".", "OnSubscribe", "<", "U", ">", "(", ")", "{", "@", "Override", "public", "void", "call", "(", "Subscriber", "<", "?", "super", "U", ">", "t1", ")", "{", "subject", ".", "subscribe", "(", "t1", ")", ";", "}", "}", ",", "csub", ")", ";", "final", "Worker", "inner", "=", "scheduler", ".", "createWorker", "(", ")", ";", "csub", ".", "set", "(", "inner", ")", ";", "inner", ".", "schedule", "(", "new", "Action0", "(", ")", "{", "@", "Override", "public", "void", "call", "(", ")", "{", "if", "(", "!", "csub", ".", "isUnsubscribed", "(", ")", ")", "{", "action", ".", "call", "(", "subject", ",", "csub", ")", ";", "}", "}", "}", ")", ";", "return", "co", ";", "}" ]
Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned StoppableObservable. The action is immediately executed and unobserved values might be lost, depending on the Subject type used. @param <T> the output value of the action @param <U> the output type of the observable sequence @param scheduler the Scheduler where the action is executed @param subject the subject to use to distribute values emitted by the action @param action the action to execute, receives an Observer where the events can be pumped and a Subscription which lets it check for cancellation condition @return an Observable that provides a Subscription interface to cancel the action @see <a href="https://github.com/ReactiveX/RxJava/wiki/Async-Operators#wiki-runasync">RxJava Wiki: runAsync()</a>
[ "Runs", "the", "provided", "action", "on", "the", "given", "scheduler", "and", "allows", "propagation", "of", "multiple", "events", "to", "the", "observers", "of", "the", "returned", "StoppableObservable", ".", "The", "action", "is", "immediately", "executed", "and", "unobserved", "values", "might", "be", "lost", "depending", "on", "the", "Subject", "type", "used", "." ]
6294e1da30e639df79f76399906229314c14e74d
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L2112-L2137
4,709
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializeToolbarElevation
private void initializeToolbarElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.toolbar_elevation_preference_key); String defaultValue = getString(R.string.toolbar_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setToolbarElevation(elevation); }
java
private void initializeToolbarElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.toolbar_elevation_preference_key); String defaultValue = getString(R.string.toolbar_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setToolbarElevation(elevation); }
[ "private", "void", "initializeToolbarElevation", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "toolbar_elevation_preference_key", ")", ";", "String", "defaultValue", "=", "getString", "(", "R", ".", "string", ".", "toolbar_elevation_preference_default_value", ")", ";", "int", "elevation", "=", "Integer", ".", "valueOf", "(", "sharedPreferences", ".", "getString", "(", "key", ",", "defaultValue", ")", ")", ";", "setToolbarElevation", "(", "elevation", ")", ";", "}" ]
Initializes the elevation of the activity's toolbar. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "the", "elevation", "of", "the", "activity", "s", "toolbar", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L42-L47
4,710
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializeNavigationWidth
private void initializeNavigationWidth(final SharedPreferences sharedPreferences) { String key = getString(R.string.navigation_width_preference_key); String defaultValue = getString(R.string.navigation_width_preference_default_value); int width = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setNavigationWidth(dpToPixels(this, width)); }
java
private void initializeNavigationWidth(final SharedPreferences sharedPreferences) { String key = getString(R.string.navigation_width_preference_key); String defaultValue = getString(R.string.navigation_width_preference_default_value); int width = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setNavigationWidth(dpToPixels(this, width)); }
[ "private", "void", "initializeNavigationWidth", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "navigation_width_preference_key", ")", ";", "String", "defaultValue", "=", "getString", "(", "R", ".", "string", ".", "navigation_width_preference_default_value", ")", ";", "int", "width", "=", "Integer", ".", "valueOf", "(", "sharedPreferences", ".", "getString", "(", "key", ",", "defaultValue", ")", ")", ";", "setNavigationWidth", "(", "dpToPixels", "(", "this", ",", "width", ")", ")", ";", "}" ]
Initializes the width of the navigation. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "the", "width", "of", "the", "navigation", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L56-L61
4,711
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializePreferenceScreenElevation
private void initializePreferenceScreenElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.preference_screen_elevation_preference_key); String defaultValue = getString(R.string.preference_screen_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setCardViewElevation(elevation); }
java
private void initializePreferenceScreenElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.preference_screen_elevation_preference_key); String defaultValue = getString(R.string.preference_screen_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setCardViewElevation(elevation); }
[ "private", "void", "initializePreferenceScreenElevation", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "preference_screen_elevation_preference_key", ")", ";", "String", "defaultValue", "=", "getString", "(", "R", ".", "string", ".", "preference_screen_elevation_preference_default_value", ")", ";", "int", "elevation", "=", "Integer", ".", "valueOf", "(", "sharedPreferences", ".", "getString", "(", "key", ",", "defaultValue", ")", ")", ";", "setCardViewElevation", "(", "elevation", ")", ";", "}" ]
Initializes the elevation of the preference screen. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "the", "elevation", "of", "the", "preference", "screen", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L70-L76
4,712
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializeBreadCrumbElevation
private void initializeBreadCrumbElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.bread_crumb_elevation_preference_key); String defaultValue = getString(R.string.bread_crumb_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setBreadCrumbElevation(elevation); }
java
private void initializeBreadCrumbElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.bread_crumb_elevation_preference_key); String defaultValue = getString(R.string.bread_crumb_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setBreadCrumbElevation(elevation); }
[ "private", "void", "initializeBreadCrumbElevation", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "bread_crumb_elevation_preference_key", ")", ";", "String", "defaultValue", "=", "getString", "(", "R", ".", "string", ".", "bread_crumb_elevation_preference_default_value", ")", ";", "int", "elevation", "=", "Integer", ".", "valueOf", "(", "sharedPreferences", ".", "getString", "(", "key", ",", "defaultValue", ")", ")", ";", "setBreadCrumbElevation", "(", "elevation", ")", ";", "}" ]
Initializes the elevation of the bread crumbs. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "the", "elevation", "of", "the", "bread", "crumbs", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L85-L90
4,713
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializeWizardButtonBarElevation
private void initializeWizardButtonBarElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.wizard_button_bar_elevation_preference_key); String defaultValue = getString(R.string.wizard_button_bar_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setButtonBarElevation(elevation); }
java
private void initializeWizardButtonBarElevation(final SharedPreferences sharedPreferences) { String key = getString(R.string.wizard_button_bar_elevation_preference_key); String defaultValue = getString(R.string.wizard_button_bar_elevation_preference_default_value); int elevation = Integer.valueOf(sharedPreferences.getString(key, defaultValue)); setButtonBarElevation(elevation); }
[ "private", "void", "initializeWizardButtonBarElevation", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "wizard_button_bar_elevation_preference_key", ")", ";", "String", "defaultValue", "=", "getString", "(", "R", ".", "string", ".", "wizard_button_bar_elevation_preference_default_value", ")", ";", "int", "elevation", "=", "Integer", ".", "valueOf", "(", "sharedPreferences", ".", "getString", "(", "key", ",", "defaultValue", ")", ")", ";", "setButtonBarElevation", "(", "elevation", ")", ";", "}" ]
Initializes the elevation of a wizard's button bar. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "the", "elevation", "of", "a", "wizard", "s", "button", "bar", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L99-L105
4,714
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializeOverrideBackButton
private void initializeOverrideBackButton(final SharedPreferences sharedPreferences) { String key = getString(R.string.override_navigation_icon_preference_key); boolean defaultValue = Boolean.valueOf( getString(R.string.override_navigation_icon_preference_default_value)); boolean overrideNavigationIcon = sharedPreferences.getBoolean(key, defaultValue); overrideNavigationIcon(overrideNavigationIcon); }
java
private void initializeOverrideBackButton(final SharedPreferences sharedPreferences) { String key = getString(R.string.override_navigation_icon_preference_key); boolean defaultValue = Boolean.valueOf( getString(R.string.override_navigation_icon_preference_default_value)); boolean overrideNavigationIcon = sharedPreferences.getBoolean(key, defaultValue); overrideNavigationIcon(overrideNavigationIcon); }
[ "private", "void", "initializeOverrideBackButton", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "override_navigation_icon_preference_key", ")", ";", "boolean", "defaultValue", "=", "Boolean", ".", "valueOf", "(", "getString", "(", "R", ".", "string", ".", "override_navigation_icon_preference_default_value", ")", ")", ";", "boolean", "overrideNavigationIcon", "=", "sharedPreferences", ".", "getBoolean", "(", "key", ",", "defaultValue", ")", ";", "overrideNavigationIcon", "(", "overrideNavigationIcon", ")", ";", "}" ]
Initializes, whether the action bar's back button should be overridden, or not. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "whether", "the", "action", "bar", "s", "back", "button", "should", "be", "overridden", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L114-L120
4,715
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java
AbstractPreferenceActivity.initializeHideNavigation
private void initializeHideNavigation(final SharedPreferences sharedPreferences) { String key = getString(R.string.hide_navigation_preference_key); boolean defaultValue = Boolean.valueOf(getString(R.string.hide_navigation_preference_default_value)); boolean hideNavigation = sharedPreferences.getBoolean(key, defaultValue); hideNavigation(hideNavigation); }
java
private void initializeHideNavigation(final SharedPreferences sharedPreferences) { String key = getString(R.string.hide_navigation_preference_key); boolean defaultValue = Boolean.valueOf(getString(R.string.hide_navigation_preference_default_value)); boolean hideNavigation = sharedPreferences.getBoolean(key, defaultValue); hideNavigation(hideNavigation); }
[ "private", "void", "initializeHideNavigation", "(", "final", "SharedPreferences", "sharedPreferences", ")", "{", "String", "key", "=", "getString", "(", "R", ".", "string", ".", "hide_navigation_preference_key", ")", ";", "boolean", "defaultValue", "=", "Boolean", ".", "valueOf", "(", "getString", "(", "R", ".", "string", ".", "hide_navigation_preference_default_value", ")", ")", ";", "boolean", "hideNavigation", "=", "sharedPreferences", ".", "getBoolean", "(", "key", ",", "defaultValue", ")", ";", "hideNavigation", "(", "hideNavigation", ")", ";", "}" ]
Initializes, whether the navigation should be hidden, or not. @param sharedPreferences The shared preferences, which should be used, as an instance of the type {@link SharedPreferences}
[ "Initializes", "whether", "the", "navigation", "should", "be", "hidden", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/AbstractPreferenceActivity.java#L129-L135
4,716
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java
NavigationPreference.obtainBreadCrumbTitle
private void obtainBreadCrumbTitle(@NonNull final TypedArray typedArray) { setBreadCrumbTitle( typedArray.getText(R.styleable.NavigationPreference_android_breadCrumbTitle)); }
java
private void obtainBreadCrumbTitle(@NonNull final TypedArray typedArray) { setBreadCrumbTitle( typedArray.getText(R.styleable.NavigationPreference_android_breadCrumbTitle)); }
[ "private", "void", "obtainBreadCrumbTitle", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "setBreadCrumbTitle", "(", "typedArray", ".", "getText", "(", "R", ".", "styleable", ".", "NavigationPreference_android_breadCrumbTitle", ")", ")", ";", "}" ]
Obtains the breadcrumb title from a specific typed array. @param typedArray The typed array, the breadcrumb title should be obtained from, as an instance of the class {@link TypedArray}. The typed array may not be null
[ "Obtains", "the", "breadcrumb", "title", "from", "a", "specific", "typed", "array", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java#L254-L257
4,717
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java
NavigationPreference.obtainFragment
private void obtainFragment(@NonNull final TypedArray typedArray) { setFragment(typedArray.getString(R.styleable.NavigationPreference_android_fragment)); }
java
private void obtainFragment(@NonNull final TypedArray typedArray) { setFragment(typedArray.getString(R.styleable.NavigationPreference_android_fragment)); }
[ "private", "void", "obtainFragment", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "setFragment", "(", "typedArray", ".", "getString", "(", "R", ".", "styleable", ".", "NavigationPreference_android_fragment", ")", ")", ";", "}" ]
Obtains the fragment from a specific typed array. @param typedArray The typed array, the fragment should be obtained from, as an instance of the class {@link TypedArray}. The typed array may not be null
[ "Obtains", "the", "fragment", "from", "a", "specific", "typed", "array", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java#L266-L268
4,718
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java
NavigationPreference.obtainIcon
private void obtainIcon(@NonNull final TypedArray typedArray) { int resourceId = typedArray.getResourceId(R.styleable.NavigationPreference_android_icon, -1); if (resourceId != -1) { Drawable icon = AppCompatResources.getDrawable(getContext(), resourceId); setIcon(icon); } }
java
private void obtainIcon(@NonNull final TypedArray typedArray) { int resourceId = typedArray.getResourceId(R.styleable.NavigationPreference_android_icon, -1); if (resourceId != -1) { Drawable icon = AppCompatResources.getDrawable(getContext(), resourceId); setIcon(icon); } }
[ "private", "void", "obtainIcon", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "int", "resourceId", "=", "typedArray", ".", "getResourceId", "(", "R", ".", "styleable", ".", "NavigationPreference_android_icon", ",", "-", "1", ")", ";", "if", "(", "resourceId", "!=", "-", "1", ")", "{", "Drawable", "icon", "=", "AppCompatResources", ".", "getDrawable", "(", "getContext", "(", ")", ",", "resourceId", ")", ";", "setIcon", "(", "icon", ")", ";", "}", "}" ]
Obtains the preference's icon 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", "preference", "s", "icon", "from", "a", "specific", "typed", "array", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java#L277-L285
4,719
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java
NavigationPreference.obtainTint
private void obtainTint(@NonNull final TypedArray typedArray) { setIconTintList( typedArray.getColorStateList(R.styleable.NavigationPreference_android_tint)); }
java
private void obtainTint(@NonNull final TypedArray typedArray) { setIconTintList( typedArray.getColorStateList(R.styleable.NavigationPreference_android_tint)); }
[ "private", "void", "obtainTint", "(", "@", "NonNull", "final", "TypedArray", "typedArray", ")", "{", "setIconTintList", "(", "typedArray", ".", "getColorStateList", "(", "R", ".", "styleable", ".", "NavigationPreference_android_tint", ")", ")", ";", "}" ]
Obtains the color state list to tint the preference's icon from a specific typed array. @param typedArray The typed array, the color state list should be obtained from, as an instance of the class {@link TypedArray}. The typed array may not be null
[ "Obtains", "the", "color", "state", "list", "to", "tint", "the", "preference", "s", "icon", "from", "a", "specific", "typed", "array", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java#L294-L297
4,720
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java
NavigationPreference.createOnPreferenceClickListenerWrapper
@NonNull private OnPreferenceClickListener createOnPreferenceClickListenerWrapper( @Nullable final OnPreferenceClickListener listener) { return new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(final Preference preference) { notifyOnShowFragment(); if (listener != null) { listener.onPreferenceClick(preference); } return true; } }; }
java
@NonNull private OnPreferenceClickListener createOnPreferenceClickListenerWrapper( @Nullable final OnPreferenceClickListener listener) { return new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(final Preference preference) { notifyOnShowFragment(); if (listener != null) { listener.onPreferenceClick(preference); } return true; } }; }
[ "@", "NonNull", "private", "OnPreferenceClickListener", "createOnPreferenceClickListenerWrapper", "(", "@", "Nullable", "final", "OnPreferenceClickListener", "listener", ")", "{", "return", "new", "OnPreferenceClickListener", "(", ")", "{", "@", "Override", "public", "boolean", "onPreferenceClick", "(", "final", "Preference", "preference", ")", "{", "notifyOnShowFragment", "(", ")", ";", "if", "(", "listener", "!=", "null", ")", "{", "listener", ".", "onPreferenceClick", "(", "preference", ")", ";", "}", "return", "true", ";", "}", "}", ";", "}" ]
Creates a click listener, which notifies the callback, when the preference's fragment should be shown and forwards the click event to an encapsulated listener. @param listener The listener, which should be encapsulated, as an instance of the type {@link OnPreferenceClickListener} or null, if no listener should be encapsulated @return The listener, which has been created, as an instance of the type {@link OnPreferenceClickListener}. The listener may not be null
[ "Creates", "a", "click", "listener", "which", "notifies", "the", "callback", "when", "the", "preference", "s", "fragment", "should", "be", "shown", "and", "forwards", "the", "click", "event", "to", "an", "encapsulated", "listener", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/NavigationPreference.java#L321-L338
4,721
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java
RemovePreferenceHeaderDialogBuilder.inflateLayout
@SuppressLint("InflateParams") private View inflateLayout(final Activity activity) { LayoutInflater inflater = activity.getLayoutInflater(); View view = inflater.inflate(R.layout.remove_preference_header_dialog, null); setView(view); return view; }
java
@SuppressLint("InflateParams") private View inflateLayout(final Activity activity) { LayoutInflater inflater = activity.getLayoutInflater(); View view = inflater.inflate(R.layout.remove_preference_header_dialog, null); setView(view); return view; }
[ "@", "SuppressLint", "(", "\"InflateParams\"", ")", "private", "View", "inflateLayout", "(", "final", "Activity", "activity", ")", "{", "LayoutInflater", "inflater", "=", "activity", ".", "getLayoutInflater", "(", ")", ";", "View", "view", "=", "inflater", ".", "inflate", "(", "R", ".", "layout", ".", "remove_preference_header_dialog", ",", "null", ")", ";", "setView", "(", "view", ")", ";", "return", "view", ";", "}" ]
Inflates the layout of the dialog. @param activity The activity, the dialog should belong to, as an instance of the class {@link Activity} @return The view, which has been inflated, as an instance of the class {@link View}
[ "Inflates", "the", "layout", "of", "the", "dialog", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java#L60-L66
4,722
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java
RemovePreferenceHeaderDialogBuilder.initializeSpinner
private void initializeSpinner(final View parentView, final Collection<NavigationPreference> navigationPreferences) { spinner = parentView.findViewById(R.id.remove_preference_header_spinner); List<CharSequence> items = getNavigationPreferenceTitles(navigationPreferences); ArrayAdapter<CharSequence> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); }
java
private void initializeSpinner(final View parentView, final Collection<NavigationPreference> navigationPreferences) { spinner = parentView.findViewById(R.id.remove_preference_header_spinner); List<CharSequence> items = getNavigationPreferenceTitles(navigationPreferences); ArrayAdapter<CharSequence> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); }
[ "private", "void", "initializeSpinner", "(", "final", "View", "parentView", ",", "final", "Collection", "<", "NavigationPreference", ">", "navigationPreferences", ")", "{", "spinner", "=", "parentView", ".", "findViewById", "(", "R", ".", "id", ".", "remove_preference_header_spinner", ")", ";", "List", "<", "CharSequence", ">", "items", "=", "getNavigationPreferenceTitles", "(", "navigationPreferences", ")", ";", "ArrayAdapter", "<", "CharSequence", ">", "adapter", "=", "new", "ArrayAdapter", "<>", "(", "getContext", "(", ")", ",", "android", ".", "R", ".", "layout", ".", "simple_spinner_item", ",", "items", ")", ";", "adapter", ".", "setDropDownViewResource", "(", "android", ".", "R", ".", "layout", ".", "simple_spinner_dropdown_item", ")", ";", "spinner", ".", "setAdapter", "(", "adapter", ")", ";", "}" ]
Initializes the spinner, which allows to choose the preference header, which should be removed. @param parentView The parent view of the spinner as an instance of the class {@link View} @param navigationPreferences A collection, which contains the preference headers, the spinner should allow to choose from, as an instance of the type {@link Collection}
[ "Initializes", "the", "spinner", "which", "allows", "to", "choose", "the", "preference", "header", "which", "should", "be", "removed", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java#L78-L86
4,723
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java
RemovePreferenceHeaderDialogBuilder.getNavigationPreferenceTitles
private List<CharSequence> getNavigationPreferenceTitles( final Collection<NavigationPreference> navigationPreferences) { List<CharSequence> titles = new LinkedList<>(); for (NavigationPreference navigationPreference : navigationPreferences) { titles.add(navigationPreference.getTitle()); } return titles; }
java
private List<CharSequence> getNavigationPreferenceTitles( final Collection<NavigationPreference> navigationPreferences) { List<CharSequence> titles = new LinkedList<>(); for (NavigationPreference navigationPreference : navigationPreferences) { titles.add(navigationPreference.getTitle()); } return titles; }
[ "private", "List", "<", "CharSequence", ">", "getNavigationPreferenceTitles", "(", "final", "Collection", "<", "NavigationPreference", ">", "navigationPreferences", ")", "{", "List", "<", "CharSequence", ">", "titles", "=", "new", "LinkedList", "<>", "(", ")", ";", "for", "(", "NavigationPreference", "navigationPreference", ":", "navigationPreferences", ")", "{", "titles", ".", "add", "(", "navigationPreference", ".", "getTitle", "(", ")", ")", ";", "}", "return", "titles", ";", "}" ]
Returns a list, which contains the titles of all navigation preferences, which are contained by a specific collection. @param navigationPreferences A collection, which contains the navigation preferences, whose title should be returned, as an instance of the type {@link Collection} @return A list, which contains the title of the given navigation preferences, as an instance of the type {@link List}
[ "Returns", "a", "list", "which", "contains", "the", "titles", "of", "all", "navigation", "preferences", "which", "are", "contained", "by", "a", "specific", "collection", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java#L98-L107
4,724
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java
RemovePreferenceHeaderDialogBuilder.initializeButtons
private void initializeButtons() { setPositiveButton(android.R.string.ok, createRemovePreferenceHeaderClickListener()); setNegativeButton(android.R.string.cancel, null); }
java
private void initializeButtons() { setPositiveButton(android.R.string.ok, createRemovePreferenceHeaderClickListener()); setNegativeButton(android.R.string.cancel, null); }
[ "private", "void", "initializeButtons", "(", ")", "{", "setPositiveButton", "(", "android", ".", "R", ".", "string", ".", "ok", ",", "createRemovePreferenceHeaderClickListener", "(", ")", ")", ";", "setNegativeButton", "(", "android", ".", "R", ".", "string", ".", "cancel", ",", "null", ")", ";", "}" ]
Initializes the dialog's buttons.
[ "Initializes", "the", "dialog", "s", "buttons", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java#L120-L123
4,725
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java
RemovePreferenceHeaderDialogBuilder.createRemovePreferenceHeaderClickListener
private OnClickListener createRemovePreferenceHeaderClickListener() { return new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { int position = spinner.getSelectedItemPosition(); listener.onRemovePreferenceHeader(position); } }; }
java
private OnClickListener createRemovePreferenceHeaderClickListener() { return new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { int position = spinner.getSelectedItemPosition(); listener.onRemovePreferenceHeader(position); } }; }
[ "private", "OnClickListener", "createRemovePreferenceHeaderClickListener", "(", ")", "{", "return", "new", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "DialogInterface", "dialog", ",", "final", "int", "which", ")", "{", "int", "position", "=", "spinner", ".", "getSelectedItemPosition", "(", ")", ";", "listener", ".", "onRemovePreferenceHeader", "(", "position", ")", ";", "}", "}", ";", "}" ]
Creates and returns a listener, which allows to notify the registered listener, when the user closes the dialog confirmatively. @return The listener, which has been created, as an instance of the type {@link OnClickListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "notify", "the", "registered", "listener", "when", "the", "user", "closes", "the", "dialog", "confirmatively", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/dialog/RemovePreferenceHeaderDialogBuilder.java#L132-L142
4,726
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/operators/Functionals.java
Functionals.fromRunnable
public static Action0 fromRunnable(Runnable run, Worker inner) { if (run == null) { throw new NullPointerException("run"); } return new ActionWrappingRunnable(run, inner); }
java
public static Action0 fromRunnable(Runnable run, Worker inner) { if (run == null) { throw new NullPointerException("run"); } return new ActionWrappingRunnable(run, inner); }
[ "public", "static", "Action0", "fromRunnable", "(", "Runnable", "run", ",", "Worker", "inner", ")", "{", "if", "(", "run", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"run\"", ")", ";", "}", "return", "new", "ActionWrappingRunnable", "(", "run", ",", "inner", ")", ";", "}" ]
Converts a runnable instance into an Action0 instance. @param run the Runnable to run when the Action0 is called @return the Action0 wrapping the Runnable
[ "Converts", "a", "runnable", "instance", "into", "an", "Action0", "instance", "." ]
6294e1da30e639df79f76399906229314c14e74d
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/operators/Functionals.java#L69-L74
4,727
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainStyledAttributes
private void obtainStyledAttributes() { obtainUseSplitScreen(); obtainNavigationWidth(); obtainNavigationVisibility(); obtainOverrideNavigationIcon(); obtainShowButtonBar(); obtainNextButtonText(); obtainBackButtonText(); obtainFinishButtonText(); obtainShowProgress(); obtainProgressFormat(); obtainBreadCrumbVisibility(); obtainToolbarElevation(); obtainBreadcrumbElevation(); obtainCardViewElevation(); obtainButtonBarElevation(); obtainCardViewBackgroundColor(); obtainBreadCrumbBackgroundColor(); obtainButtonBarBackground(); obtainNavigationBackground(); obtainNavigationSelectionColor(); obtainNavigationDividerColor(); }
java
private void obtainStyledAttributes() { obtainUseSplitScreen(); obtainNavigationWidth(); obtainNavigationVisibility(); obtainOverrideNavigationIcon(); obtainShowButtonBar(); obtainNextButtonText(); obtainBackButtonText(); obtainFinishButtonText(); obtainShowProgress(); obtainProgressFormat(); obtainBreadCrumbVisibility(); obtainToolbarElevation(); obtainBreadcrumbElevation(); obtainCardViewElevation(); obtainButtonBarElevation(); obtainCardViewBackgroundColor(); obtainBreadCrumbBackgroundColor(); obtainButtonBarBackground(); obtainNavigationBackground(); obtainNavigationSelectionColor(); obtainNavigationDividerColor(); }
[ "private", "void", "obtainStyledAttributes", "(", ")", "{", "obtainUseSplitScreen", "(", ")", ";", "obtainNavigationWidth", "(", ")", ";", "obtainNavigationVisibility", "(", ")", ";", "obtainOverrideNavigationIcon", "(", ")", ";", "obtainShowButtonBar", "(", ")", ";", "obtainNextButtonText", "(", ")", ";", "obtainBackButtonText", "(", ")", ";", "obtainFinishButtonText", "(", ")", ";", "obtainShowProgress", "(", ")", ";", "obtainProgressFormat", "(", ")", ";", "obtainBreadCrumbVisibility", "(", ")", ";", "obtainToolbarElevation", "(", ")", ";", "obtainBreadcrumbElevation", "(", ")", ";", "obtainCardViewElevation", "(", ")", ";", "obtainButtonBarElevation", "(", ")", ";", "obtainCardViewBackgroundColor", "(", ")", ";", "obtainBreadCrumbBackgroundColor", "(", ")", ";", "obtainButtonBarBackground", "(", ")", ";", "obtainNavigationBackground", "(", ")", ";", "obtainNavigationSelectionColor", "(", ")", ";", "obtainNavigationDividerColor", "(", ")", ";", "}" ]
Obtains all relevant attributes from the activity's theme.
[ "Obtains", "all", "relevant", "attributes", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L415-L437
4,728
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainUseSplitScreen
private void obtainUseSplitScreen() { boolean useSplitScreen = ThemeUtil.getBoolean(this, R.attr.useSplitScreen, true); useSplitScreen(useSplitScreen); }
java
private void obtainUseSplitScreen() { boolean useSplitScreen = ThemeUtil.getBoolean(this, R.attr.useSplitScreen, true); useSplitScreen(useSplitScreen); }
[ "private", "void", "obtainUseSplitScreen", "(", ")", "{", "boolean", "useSplitScreen", "=", "ThemeUtil", ".", "getBoolean", "(", "this", ",", "R", ".", "attr", ".", "useSplitScreen", ",", "true", ")", ";", "useSplitScreen", "(", "useSplitScreen", ")", ";", "}" ]
Obtains, whether the split screen layout should be used on tablets, from the activities theme.
[ "Obtains", "whether", "the", "split", "screen", "layout", "should", "be", "used", "on", "tablets", "from", "the", "activities", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L443-L446
4,729
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainNavigationWidth
private void obtainNavigationWidth() { int navigationWidth; try { navigationWidth = ThemeUtil.getDimensionPixelSize(this, R.attr.navigationWidth); } catch (NotFoundException e) { navigationWidth = getResources().getDimensionPixelSize(R.dimen.navigation_width); } setNavigationWidth(navigationWidth); }
java
private void obtainNavigationWidth() { int navigationWidth; try { navigationWidth = ThemeUtil.getDimensionPixelSize(this, R.attr.navigationWidth); } catch (NotFoundException e) { navigationWidth = getResources().getDimensionPixelSize(R.dimen.navigation_width); } setNavigationWidth(navigationWidth); }
[ "private", "void", "obtainNavigationWidth", "(", ")", "{", "int", "navigationWidth", ";", "try", "{", "navigationWidth", "=", "ThemeUtil", ".", "getDimensionPixelSize", "(", "this", ",", "R", ".", "attr", ".", "navigationWidth", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "navigationWidth", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "navigation_width", ")", ";", "}", "setNavigationWidth", "(", "navigationWidth", ")", ";", "}" ]
Obtains the width of the navigation from the activity's theme.
[ "Obtains", "the", "width", "of", "the", "navigation", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L451-L461
4,730
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainNavigationVisibility
private void obtainNavigationVisibility() { boolean hideNavigation = ThemeUtil.getBoolean(this, R.attr.hideNavigation, false); hideNavigation(hideNavigation); }
java
private void obtainNavigationVisibility() { boolean hideNavigation = ThemeUtil.getBoolean(this, R.attr.hideNavigation, false); hideNavigation(hideNavigation); }
[ "private", "void", "obtainNavigationVisibility", "(", ")", "{", "boolean", "hideNavigation", "=", "ThemeUtil", ".", "getBoolean", "(", "this", ",", "R", ".", "attr", ".", "hideNavigation", ",", "false", ")", ";", "hideNavigation", "(", "hideNavigation", ")", ";", "}" ]
Obtains, whether the navigation should be shown, from the activity's theme.
[ "Obtains", "whether", "the", "navigation", "should", "be", "shown", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L466-L469
4,731
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainOverrideNavigationIcon
private void obtainOverrideNavigationIcon() { boolean overrideNavigationIcon = ThemeUtil.getBoolean(this, R.attr.overrideNavigationIcon, true); overrideNavigationIcon(overrideNavigationIcon); }
java
private void obtainOverrideNavigationIcon() { boolean overrideNavigationIcon = ThemeUtil.getBoolean(this, R.attr.overrideNavigationIcon, true); overrideNavigationIcon(overrideNavigationIcon); }
[ "private", "void", "obtainOverrideNavigationIcon", "(", ")", "{", "boolean", "overrideNavigationIcon", "=", "ThemeUtil", ".", "getBoolean", "(", "this", ",", "R", ".", "attr", ".", "overrideNavigationIcon", ",", "true", ")", ";", "overrideNavigationIcon", "(", "overrideNavigationIcon", ")", ";", "}" ]
Obtains, whether the behavior of the navigation icon should be overridden, or not, from the activity's theme.
[ "Obtains", "whether", "the", "behavior", "of", "the", "navigation", "icon", "should", "be", "overridden", "or", "not", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L475-L479
4,732
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainShowButtonBar
private void obtainShowButtonBar() { boolean showButtonBar = ThemeUtil.getBoolean(this, R.attr.showButtonBar, false); showButtonBar(showButtonBar); }
java
private void obtainShowButtonBar() { boolean showButtonBar = ThemeUtil.getBoolean(this, R.attr.showButtonBar, false); showButtonBar(showButtonBar); }
[ "private", "void", "obtainShowButtonBar", "(", ")", "{", "boolean", "showButtonBar", "=", "ThemeUtil", ".", "getBoolean", "(", "this", ",", "R", ".", "attr", ".", "showButtonBar", ",", "false", ")", ";", "showButtonBar", "(", "showButtonBar", ")", ";", "}" ]
Obtains, whether the activity should be used as a wizard, or not, from the activity's theme.
[ "Obtains", "whether", "the", "activity", "should", "be", "used", "as", "a", "wizard", "or", "not", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L484-L487
4,733
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainNextButtonText
private void obtainNextButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.nextButtonText); } catch (NotFoundException e) { text = getText(R.string.next_button_text); } setNextButtonText(text); }
java
private void obtainNextButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.nextButtonText); } catch (NotFoundException e) { text = getText(R.string.next_button_text); } setNextButtonText(text); }
[ "private", "void", "obtainNextButtonText", "(", ")", "{", "CharSequence", "text", ";", "try", "{", "text", "=", "ThemeUtil", ".", "getText", "(", "this", ",", "R", ".", "attr", ".", "nextButtonText", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "text", "=", "getText", "(", "R", ".", "string", ".", "next_button_text", ")", ";", "}", "setNextButtonText", "(", "text", ")", ";", "}" ]
Obtains the text of the next button from the activity's theme.
[ "Obtains", "the", "text", "of", "the", "next", "button", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L492-L502
4,734
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainBackButtonText
private void obtainBackButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.backButtonText); } catch (NotFoundException e) { text = getText(R.string.back_button_text); } setBackButtonText(text); }
java
private void obtainBackButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.backButtonText); } catch (NotFoundException e) { text = getText(R.string.back_button_text); } setBackButtonText(text); }
[ "private", "void", "obtainBackButtonText", "(", ")", "{", "CharSequence", "text", ";", "try", "{", "text", "=", "ThemeUtil", ".", "getText", "(", "this", ",", "R", ".", "attr", ".", "backButtonText", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "text", "=", "getText", "(", "R", ".", "string", ".", "back_button_text", ")", ";", "}", "setBackButtonText", "(", "text", ")", ";", "}" ]
Obtains the text of the back button from the activity's theme.
[ "Obtains", "the", "text", "of", "the", "back", "button", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L507-L517
4,735
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainFinishButtonText
private void obtainFinishButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.finishButtonText); } catch (NotFoundException e) { text = getText(R.string.finish_button_text); } setFinishButtonText(text); }
java
private void obtainFinishButtonText() { CharSequence text; try { text = ThemeUtil.getText(this, R.attr.finishButtonText); } catch (NotFoundException e) { text = getText(R.string.finish_button_text); } setFinishButtonText(text); }
[ "private", "void", "obtainFinishButtonText", "(", ")", "{", "CharSequence", "text", ";", "try", "{", "text", "=", "ThemeUtil", ".", "getText", "(", "this", ",", "R", ".", "attr", ".", "finishButtonText", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "text", "=", "getText", "(", "R", ".", "string", ".", "finish_button_text", ")", ";", "}", "setFinishButtonText", "(", "text", ")", ";", "}" ]
Obtains the text of the finish button from the activity's theme.
[ "Obtains", "the", "text", "of", "the", "finish", "button", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L522-L532
4,736
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainShowProgress
private void obtainShowProgress() { boolean showProgress = ThemeUtil.getBoolean(this, R.attr.showProgress, true); showProgress(showProgress); }
java
private void obtainShowProgress() { boolean showProgress = ThemeUtil.getBoolean(this, R.attr.showProgress, true); showProgress(showProgress); }
[ "private", "void", "obtainShowProgress", "(", ")", "{", "boolean", "showProgress", "=", "ThemeUtil", ".", "getBoolean", "(", "this", ",", "R", ".", "attr", ".", "showProgress", ",", "true", ")", ";", "showProgress", "(", "showProgress", ")", ";", "}" ]
Obtains, whether the progress should be shown, when the activity is used as a wizard, or not, from the activity's theme.
[ "Obtains", "whether", "the", "progress", "should", "be", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "or", "not", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L538-L541
4,737
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainProgressFormat
private void obtainProgressFormat() { String progressFormat; try { progressFormat = ThemeUtil.getString(this, R.attr.progressFormat); } catch (NotFoundException e) { progressFormat = getString(R.string.progress_format); } setProgressFormat(progressFormat); }
java
private void obtainProgressFormat() { String progressFormat; try { progressFormat = ThemeUtil.getString(this, R.attr.progressFormat); } catch (NotFoundException e) { progressFormat = getString(R.string.progress_format); } setProgressFormat(progressFormat); }
[ "private", "void", "obtainProgressFormat", "(", ")", "{", "String", "progressFormat", ";", "try", "{", "progressFormat", "=", "ThemeUtil", ".", "getString", "(", "this", ",", "R", ".", "attr", ".", "progressFormat", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "progressFormat", "=", "getString", "(", "R", ".", "string", ".", "progress_format", ")", ";", "}", "setProgressFormat", "(", "progressFormat", ")", ";", "}" ]
Obtains the string, which is used to format the progress, which is shown, when the activity is used as a wizard, from the activity's theme.
[ "Obtains", "the", "string", "which", "is", "used", "to", "format", "the", "progress", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L547-L557
4,738
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainBreadCrumbVisibility
private void obtainBreadCrumbVisibility() { boolean hide = ThemeUtil.getBoolean(this, R.attr.hideBreadCrumb, false); hideBreadCrumb(hide); }
java
private void obtainBreadCrumbVisibility() { boolean hide = ThemeUtil.getBoolean(this, R.attr.hideBreadCrumb, false); hideBreadCrumb(hide); }
[ "private", "void", "obtainBreadCrumbVisibility", "(", ")", "{", "boolean", "hide", "=", "ThemeUtil", ".", "getBoolean", "(", "this", ",", "R", ".", "attr", ".", "hideBreadCrumb", ",", "false", ")", ";", "hideBreadCrumb", "(", "hide", ")", ";", "}" ]
Obtains the visibility of the toolbar, which is used to show the breadcrumb of the currently selected navigation preference, from the activity's theme.
[ "Obtains", "the", "visibility", "of", "the", "toolbar", "which", "is", "used", "to", "show", "the", "breadcrumb", "of", "the", "currently", "selected", "navigation", "preference", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L563-L566
4,739
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainToolbarElevation
private void obtainToolbarElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.toolbarElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.toolbar_elevation); } setToolbarElevation(pixelsToDp(this, elevation)); }
java
private void obtainToolbarElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.toolbarElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.toolbar_elevation); } setToolbarElevation(pixelsToDp(this, elevation)); }
[ "private", "void", "obtainToolbarElevation", "(", ")", "{", "int", "elevation", ";", "try", "{", "elevation", "=", "ThemeUtil", ".", "getDimensionPixelSize", "(", "this", ",", "R", ".", "attr", ".", "toolbarElevation", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "elevation", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "toolbar_elevation", ")", ";", "}", "setToolbarElevation", "(", "pixelsToDp", "(", "this", ",", "elevation", ")", ")", ";", "}" ]
Obtains the elevation of the activity's toolbar from the activity's theme.
[ "Obtains", "the", "elevation", "of", "the", "activity", "s", "toolbar", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L571-L581
4,740
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainBreadcrumbElevation
private void obtainBreadcrumbElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.breadCrumbElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.bread_crumb_toolbar_elevation); } setBreadCrumbElevation(pixelsToDp(this, elevation)); }
java
private void obtainBreadcrumbElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.breadCrumbElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.bread_crumb_toolbar_elevation); } setBreadCrumbElevation(pixelsToDp(this, elevation)); }
[ "private", "void", "obtainBreadcrumbElevation", "(", ")", "{", "int", "elevation", ";", "try", "{", "elevation", "=", "ThemeUtil", ".", "getDimensionPixelSize", "(", "this", ",", "R", ".", "attr", ".", "breadCrumbElevation", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "elevation", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "bread_crumb_toolbar_elevation", ")", ";", "}", "setBreadCrumbElevation", "(", "pixelsToDp", "(", "this", ",", "elevation", ")", ")", ";", "}" ]
Obtains the elevation of the toolbar, which is used to show the bread crumb of the currently selected preference fragment, when using the split screen layout.
[ "Obtains", "the", "elevation", "of", "the", "toolbar", "which", "is", "used", "to", "show", "the", "bread", "crumb", "of", "the", "currently", "selected", "preference", "fragment", "when", "using", "the", "split", "screen", "layout", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L587-L597
4,741
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainCardViewElevation
private void obtainCardViewElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.cardViewElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.card_view_elevation); } setCardViewElevation(pixelsToDp(this, elevation)); }
java
private void obtainCardViewElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.cardViewElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.card_view_elevation); } setCardViewElevation(pixelsToDp(this, elevation)); }
[ "private", "void", "obtainCardViewElevation", "(", ")", "{", "int", "elevation", ";", "try", "{", "elevation", "=", "ThemeUtil", ".", "getDimensionPixelSize", "(", "this", ",", "R", ".", "attr", ".", "cardViewElevation", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "elevation", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "card_view_elevation", ")", ";", "}", "setCardViewElevation", "(", "pixelsToDp", "(", "this", ",", "elevation", ")", ")", ";", "}" ]
Obtains the elevation of the card view, which contains the currently shown preference fragment, when using the split screen layout, from the activity's theme.
[ "Obtains", "the", "elevation", "of", "the", "card", "view", "which", "contains", "the", "currently", "shown", "preference", "fragment", "when", "using", "the", "split", "screen", "layout", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L603-L613
4,742
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainButtonBarElevation
private void obtainButtonBarElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.buttonBarElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.button_bar_elevation); } setButtonBarElevation(pixelsToDp(this, elevation)); }
java
private void obtainButtonBarElevation() { int elevation; try { elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.buttonBarElevation); } catch (NotFoundException e) { elevation = getResources().getDimensionPixelSize(R.dimen.button_bar_elevation); } setButtonBarElevation(pixelsToDp(this, elevation)); }
[ "private", "void", "obtainButtonBarElevation", "(", ")", "{", "int", "elevation", ";", "try", "{", "elevation", "=", "ThemeUtil", ".", "getDimensionPixelSize", "(", "this", ",", "R", ".", "attr", ".", "buttonBarElevation", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "elevation", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "button_bar_elevation", ")", ";", "}", "setButtonBarElevation", "(", "pixelsToDp", "(", "this", ",", "elevation", ")", ")", ";", "}" ]
Obtains the elevation of the button bar, which is shown when using the activity as a wizard, from the activity's theme.
[ "Obtains", "the", "elevation", "of", "the", "button", "bar", "which", "is", "shown", "when", "using", "the", "activity", "as", "a", "wizard", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L619-L629
4,743
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainCardViewBackgroundColor
private void obtainCardViewBackgroundColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.cardViewBackgroundColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.card_view_background_light); } setCardViewBackgroundColor(color); }
java
private void obtainCardViewBackgroundColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.cardViewBackgroundColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.card_view_background_light); } setCardViewBackgroundColor(color); }
[ "private", "void", "obtainCardViewBackgroundColor", "(", ")", "{", "int", "color", ";", "try", "{", "color", "=", "ThemeUtil", ".", "getColor", "(", "this", ",", "R", ".", "attr", ".", "cardViewBackgroundColor", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "color", "=", "ContextCompat", ".", "getColor", "(", "this", ",", "R", ".", "color", ".", "card_view_background_light", ")", ";", "}", "setCardViewBackgroundColor", "(", "color", ")", ";", "}" ]
Obtains the background color of the card view, which contains the currently shown preference fragment, when using the split screen layout, from the activity's theme.
[ "Obtains", "the", "background", "color", "of", "the", "card", "view", "which", "contains", "the", "currently", "shown", "preference", "fragment", "when", "using", "the", "split", "screen", "layout", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L635-L645
4,744
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainBreadCrumbBackgroundColor
private void obtainBreadCrumbBackgroundColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.breadCrumbBackgroundColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.bread_crumb_background_light); } setBreadCrumbBackgroundColor(color); }
java
private void obtainBreadCrumbBackgroundColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.breadCrumbBackgroundColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.bread_crumb_background_light); } setBreadCrumbBackgroundColor(color); }
[ "private", "void", "obtainBreadCrumbBackgroundColor", "(", ")", "{", "int", "color", ";", "try", "{", "color", "=", "ThemeUtil", ".", "getColor", "(", "this", ",", "R", ".", "attr", ".", "breadCrumbBackgroundColor", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "color", "=", "ContextCompat", ".", "getColor", "(", "this", ",", "R", ".", "color", ".", "bread_crumb_background_light", ")", ";", "}", "setBreadCrumbBackgroundColor", "(", "color", ")", ";", "}" ]
Obtains the background color of the toolbar, which is used to show the bread crumb of the currently selected navigation preference, when using the split screen layout, from the activity's theme.
[ "Obtains", "the", "background", "color", "of", "the", "toolbar", "which", "is", "used", "to", "show", "the", "bread", "crumb", "of", "the", "currently", "selected", "navigation", "preference", "when", "using", "the", "split", "screen", "layout", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L652-L662
4,745
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainButtonBarBackground
private void obtainButtonBarBackground() { try { setButtonBarBackgroundColor(ThemeUtil.getColor(this, R.attr.buttonBarBackground)); } catch (NotFoundException e) { int resourceId = ThemeUtil.getResId(this, R.attr.buttonBarBackground, -1); if (resourceId != -1) { setButtonBarBackground(resourceId); } else { setButtonBarBackground(null); } } }
java
private void obtainButtonBarBackground() { try { setButtonBarBackgroundColor(ThemeUtil.getColor(this, R.attr.buttonBarBackground)); } catch (NotFoundException e) { int resourceId = ThemeUtil.getResId(this, R.attr.buttonBarBackground, -1); if (resourceId != -1) { setButtonBarBackground(resourceId); } else { setButtonBarBackground(null); } } }
[ "private", "void", "obtainButtonBarBackground", "(", ")", "{", "try", "{", "setButtonBarBackgroundColor", "(", "ThemeUtil", ".", "getColor", "(", "this", ",", "R", ".", "attr", ".", "buttonBarBackground", ")", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "int", "resourceId", "=", "ThemeUtil", ".", "getResId", "(", "this", ",", "R", ".", "attr", ".", "buttonBarBackground", ",", "-", "1", ")", ";", "if", "(", "resourceId", "!=", "-", "1", ")", "{", "setButtonBarBackground", "(", "resourceId", ")", ";", "}", "else", "{", "setButtonBarBackground", "(", "null", ")", ";", "}", "}", "}" ]
Obtains the background of the button bar from the activity's theme.
[ "Obtains", "the", "background", "of", "the", "button", "bar", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L667-L679
4,746
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainNavigationBackground
private void obtainNavigationBackground() { try { setNavigationBackgroundColor(ThemeUtil.getColor(this, R.attr.navigationBackground)); } catch (NotFoundException e) { int resourceId = ThemeUtil.getResId(this, R.attr.navigationBackground, -1); if (resourceId != -1) { setNavigationBackground(resourceId); } else { setNavigationBackground(null); } } }
java
private void obtainNavigationBackground() { try { setNavigationBackgroundColor(ThemeUtil.getColor(this, R.attr.navigationBackground)); } catch (NotFoundException e) { int resourceId = ThemeUtil.getResId(this, R.attr.navigationBackground, -1); if (resourceId != -1) { setNavigationBackground(resourceId); } else { setNavigationBackground(null); } } }
[ "private", "void", "obtainNavigationBackground", "(", ")", "{", "try", "{", "setNavigationBackgroundColor", "(", "ThemeUtil", ".", "getColor", "(", "this", ",", "R", ".", "attr", ".", "navigationBackground", ")", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "int", "resourceId", "=", "ThemeUtil", ".", "getResId", "(", "this", ",", "R", ".", "attr", ".", "navigationBackground", ",", "-", "1", ")", ";", "if", "(", "resourceId", "!=", "-", "1", ")", "{", "setNavigationBackground", "(", "resourceId", ")", ";", "}", "else", "{", "setNavigationBackground", "(", "null", ")", ";", "}", "}", "}" ]
Obtains the background of the navigation from the activity's theme.
[ "Obtains", "the", "background", "of", "the", "navigation", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L684-L696
4,747
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainNavigationSelectionColor
private void obtainNavigationSelectionColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.navigationSelectionColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.preference_selection_color_light); } setNavigationSelectionColor(color); }
java
private void obtainNavigationSelectionColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.navigationSelectionColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.preference_selection_color_light); } setNavigationSelectionColor(color); }
[ "private", "void", "obtainNavigationSelectionColor", "(", ")", "{", "int", "color", ";", "try", "{", "color", "=", "ThemeUtil", ".", "getColor", "(", "this", ",", "R", ".", "attr", ".", "navigationSelectionColor", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "color", "=", "ContextCompat", ".", "getColor", "(", "this", ",", "R", ".", "color", ".", "preference_selection_color_light", ")", ";", "}", "setNavigationSelectionColor", "(", "color", ")", ";", "}" ]
Obtains the background color of the currently selected navigation preference from the activity's theme.
[ "Obtains", "the", "background", "color", "of", "the", "currently", "selected", "navigation", "preference", "from", "the", "activity", "s", "theme", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L702-L712
4,748
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.obtainNavigationDividerColor
private void obtainNavigationDividerColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.navigationDividerColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.preference_divider_color_light); } setNavigationDividerColor(color); }
java
private void obtainNavigationDividerColor() { int color; try { color = ThemeUtil.getColor(this, R.attr.navigationDividerColor); } catch (NotFoundException e) { color = ContextCompat.getColor(this, R.color.preference_divider_color_light); } setNavigationDividerColor(color); }
[ "private", "void", "obtainNavigationDividerColor", "(", ")", "{", "int", "color", ";", "try", "{", "color", "=", "ThemeUtil", ".", "getColor", "(", "this", ",", "R", ".", "attr", ".", "navigationDividerColor", ")", ";", "}", "catch", "(", "NotFoundException", "e", ")", "{", "color", "=", "ContextCompat", ".", "getColor", "(", "this", ",", "R", ".", "color", ".", "preference_divider_color_light", ")", ";", "}", "setNavigationDividerColor", "(", "color", ")", ";", "}" ]
Obtains the color of the dividers, which are contained by the navigation.
[ "Obtains", "the", "color", "of", "the", "dividers", "which", "are", "contained", "by", "the", "navigation", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L717-L727
4,749
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showInitialFragment
private boolean showInitialFragment(@Nullable final String initialFragment) { if (!TextUtils.isEmpty(initialFragment)) { for (int i = 0; i < navigationFragment.getNavigationPreferenceCount(); i++) { NavigationPreference navigationPreference = navigationFragment.getNavigationPreference(i); if (navigationPreference != null && navigationPreference.getFragment() != null && navigationPreference.getFragment().equals(initialFragment)) { Bundle arguments = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS); CharSequence title = getCharSequenceFromIntent(getIntent(), EXTRA_SHOW_FRAGMENT_TITLE); if (title != null) { if (arguments == null) { arguments = new Bundle(); } arguments.putCharSequence(EXTRA_SHOW_FRAGMENT_TITLE, title); } navigationFragment.selectNavigationPreference(i, arguments); return true; } } } return false; }
java
private boolean showInitialFragment(@Nullable final String initialFragment) { if (!TextUtils.isEmpty(initialFragment)) { for (int i = 0; i < navigationFragment.getNavigationPreferenceCount(); i++) { NavigationPreference navigationPreference = navigationFragment.getNavigationPreference(i); if (navigationPreference != null && navigationPreference.getFragment() != null && navigationPreference.getFragment().equals(initialFragment)) { Bundle arguments = getIntent().getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS); CharSequence title = getCharSequenceFromIntent(getIntent(), EXTRA_SHOW_FRAGMENT_TITLE); if (title != null) { if (arguments == null) { arguments = new Bundle(); } arguments.putCharSequence(EXTRA_SHOW_FRAGMENT_TITLE, title); } navigationFragment.selectNavigationPreference(i, arguments); return true; } } } return false; }
[ "private", "boolean", "showInitialFragment", "(", "@", "Nullable", "final", "String", "initialFragment", ")", "{", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "initialFragment", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "navigationFragment", ".", "getNavigationPreferenceCount", "(", ")", ";", "i", "++", ")", "{", "NavigationPreference", "navigationPreference", "=", "navigationFragment", ".", "getNavigationPreference", "(", "i", ")", ";", "if", "(", "navigationPreference", "!=", "null", "&&", "navigationPreference", ".", "getFragment", "(", ")", "!=", "null", "&&", "navigationPreference", ".", "getFragment", "(", ")", ".", "equals", "(", "initialFragment", ")", ")", "{", "Bundle", "arguments", "=", "getIntent", "(", ")", ".", "getBundleExtra", "(", "EXTRA_SHOW_FRAGMENT_ARGUMENTS", ")", ";", "CharSequence", "title", "=", "getCharSequenceFromIntent", "(", "getIntent", "(", ")", ",", "EXTRA_SHOW_FRAGMENT_TITLE", ")", ";", "if", "(", "title", "!=", "null", ")", "{", "if", "(", "arguments", "==", "null", ")", "{", "arguments", "=", "new", "Bundle", "(", ")", ";", "}", "arguments", ".", "putCharSequence", "(", "EXTRA_SHOW_FRAGMENT_TITLE", ",", "title", ")", ";", "}", "navigationFragment", ".", "selectNavigationPreference", "(", "i", ",", "arguments", ")", ";", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}" ]
Initially displays a specific fragment. @param initialFragment The fully classified class name of the preference fragment, which should be shown, as a {@link String} or null, if no fragment should be initially shown @return True, if a fragment has been shown, false otherwise
[ "Initially", "displays", "a", "specific", "fragment", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L747-L774
4,750
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.getCharSequenceFromIntent
private CharSequence getCharSequenceFromIntent(@NonNull final Intent intent, @NonNull final String name) { CharSequence charSequence = intent.getCharSequenceExtra(name); if (charSequence == null) { int resourceId = intent.getIntExtra(name, 0); if (resourceId != 0) { charSequence = getText(resourceId); } } return charSequence; }
java
private CharSequence getCharSequenceFromIntent(@NonNull final Intent intent, @NonNull final String name) { CharSequence charSequence = intent.getCharSequenceExtra(name); if (charSequence == null) { int resourceId = intent.getIntExtra(name, 0); if (resourceId != 0) { charSequence = getText(resourceId); } } return charSequence; }
[ "private", "CharSequence", "getCharSequenceFromIntent", "(", "@", "NonNull", "final", "Intent", "intent", ",", "@", "NonNull", "final", "String", "name", ")", "{", "CharSequence", "charSequence", "=", "intent", ".", "getCharSequenceExtra", "(", "name", ")", ";", "if", "(", "charSequence", "==", "null", ")", "{", "int", "resourceId", "=", "intent", ".", "getIntExtra", "(", "name", ",", "0", ")", ";", "if", "(", "resourceId", "!=", "0", ")", "{", "charSequence", "=", "getText", "(", "resourceId", ")", ";", "}", "}", "return", "charSequence", ";", "}" ]
Returns the char sequence, which is specified by a specific intent extra. The char sequence can either be specified as a string or as a resource id. @param intent The intent, which specifies the char sequence, as an instance of the class {@link Intent}. The intent may not be null @param name The name of the intent extra, which specifies the char sequence, as a {@link String}. The name may not be null @return The char sequence, which is specified by the given intent, as an instance of the class {@link CharSequence} or null, if the intent does not specify a char sequence with the given name
[ "Returns", "the", "char", "sequence", "which", "is", "specified", "by", "a", "specific", "intent", "extra", ".", "The", "char", "sequence", "can", "either", "be", "specified", "as", "a", "string", "or", "as", "a", "resource", "id", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L790-L803
4,751
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleIntent
private void handleIntent() { Bundle extras = getIntent().getExtras(); if (extras != null) { handleHideNavigationIntent(extras); handleShowButtonBarIntent(extras); handleNextButtonTextIntent(extras); handleBackButtonTextIntent(extras); handleFinishButtonTextIntent(extras); handleShowProgressIntent(extras); handleProgressFormatIntent(extras); handleNoBreadcrumbsIntent(extras); } }
java
private void handleIntent() { Bundle extras = getIntent().getExtras(); if (extras != null) { handleHideNavigationIntent(extras); handleShowButtonBarIntent(extras); handleNextButtonTextIntent(extras); handleBackButtonTextIntent(extras); handleFinishButtonTextIntent(extras); handleShowProgressIntent(extras); handleProgressFormatIntent(extras); handleNoBreadcrumbsIntent(extras); } }
[ "private", "void", "handleIntent", "(", ")", "{", "Bundle", "extras", "=", "getIntent", "(", ")", ".", "getExtras", "(", ")", ";", "if", "(", "extras", "!=", "null", ")", "{", "handleHideNavigationIntent", "(", "extras", ")", ";", "handleShowButtonBarIntent", "(", "extras", ")", ";", "handleNextButtonTextIntent", "(", "extras", ")", ";", "handleBackButtonTextIntent", "(", "extras", ")", ";", "handleFinishButtonTextIntent", "(", "extras", ")", ";", "handleShowProgressIntent", "(", "extras", ")", ";", "handleProgressFormatIntent", "(", "extras", ")", ";", "handleNoBreadcrumbsIntent", "(", "extras", ")", ";", "}", "}" ]
Handles extras the intent, which has been used to start the activity.
[ "Handles", "extras", "the", "intent", "which", "has", "been", "used", "to", "start", "the", "activity", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L808-L821
4,752
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleHideNavigationIntent
private void handleHideNavigationIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_HIDE_NAVIGATION)) { hideNavigation(extras.getBoolean(EXTRA_HIDE_NAVIGATION)); } }
java
private void handleHideNavigationIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_HIDE_NAVIGATION)) { hideNavigation(extras.getBoolean(EXTRA_HIDE_NAVIGATION)); } }
[ "private", "void", "handleHideNavigationIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "if", "(", "extras", ".", "containsKey", "(", "EXTRA_HIDE_NAVIGATION", ")", ")", "{", "hideNavigation", "(", "extras", ".", "getBoolean", "(", "EXTRA_HIDE_NAVIGATION", ")", ")", ";", "}", "}" ]
Handles the intent extra, which specifies, whether the navigation should be shown, or not. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "whether", "the", "navigation", "should", "be", "shown", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L830-L834
4,753
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleShowButtonBarIntent
private void handleShowButtonBarIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_SHOW_BUTTON_BAR)) { showButtonBar(extras.getBoolean(EXTRA_SHOW_BUTTON_BAR)); } }
java
private void handleShowButtonBarIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_SHOW_BUTTON_BAR)) { showButtonBar(extras.getBoolean(EXTRA_SHOW_BUTTON_BAR)); } }
[ "private", "void", "handleShowButtonBarIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "if", "(", "extras", ".", "containsKey", "(", "EXTRA_SHOW_BUTTON_BAR", ")", ")", "{", "showButtonBar", "(", "extras", ".", "getBoolean", "(", "EXTRA_SHOW_BUTTON_BAR", ")", ")", ";", "}", "}" ]
Handles the intent extra, which specifies, whether the button bar should be shown, or not. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "whether", "the", "button", "bar", "should", "be", "shown", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L843-L847
4,754
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleNextButtonTextIntent
private void handleNextButtonTextIntent(@NonNull final Bundle extras) { CharSequence text = extras.getString(EXTRA_NEXT_BUTTON_TEXT); if (!TextUtils.isEmpty(text)) { setNextButtonText(text); } }
java
private void handleNextButtonTextIntent(@NonNull final Bundle extras) { CharSequence text = extras.getString(EXTRA_NEXT_BUTTON_TEXT); if (!TextUtils.isEmpty(text)) { setNextButtonText(text); } }
[ "private", "void", "handleNextButtonTextIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "CharSequence", "text", "=", "extras", ".", "getString", "(", "EXTRA_NEXT_BUTTON_TEXT", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "text", ")", ")", "{", "setNextButtonText", "(", "text", ")", ";", "}", "}" ]
Handles the intent extra, which specifies the text of the next button. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "the", "text", "of", "the", "next", "button", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L856-L862
4,755
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleBackButtonTextIntent
private void handleBackButtonTextIntent(@NonNull final Bundle extras) { CharSequence text = extras.getString(EXTRA_BACK_BUTTON_TEXT); if (!TextUtils.isEmpty(text)) { setBackButtonText(text); } }
java
private void handleBackButtonTextIntent(@NonNull final Bundle extras) { CharSequence text = extras.getString(EXTRA_BACK_BUTTON_TEXT); if (!TextUtils.isEmpty(text)) { setBackButtonText(text); } }
[ "private", "void", "handleBackButtonTextIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "CharSequence", "text", "=", "extras", ".", "getString", "(", "EXTRA_BACK_BUTTON_TEXT", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "text", ")", ")", "{", "setBackButtonText", "(", "text", ")", ";", "}", "}" ]
Handles the intent extra, which specifies the text of the back button. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "the", "text", "of", "the", "back", "button", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L871-L877
4,756
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleFinishButtonTextIntent
private void handleFinishButtonTextIntent(@NonNull final Bundle extras) { CharSequence text = extras.getString(EXTRA_FINISH_BUTTON_TEXT); if (!TextUtils.isEmpty(text)) { setFinishButtonText(text); } }
java
private void handleFinishButtonTextIntent(@NonNull final Bundle extras) { CharSequence text = extras.getString(EXTRA_FINISH_BUTTON_TEXT); if (!TextUtils.isEmpty(text)) { setFinishButtonText(text); } }
[ "private", "void", "handleFinishButtonTextIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "CharSequence", "text", "=", "extras", ".", "getString", "(", "EXTRA_FINISH_BUTTON_TEXT", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "text", ")", ")", "{", "setFinishButtonText", "(", "text", ")", ";", "}", "}" ]
Handles the intent extra, which specifies the text of the finish button. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "the", "text", "of", "the", "finish", "button", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L886-L892
4,757
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleShowProgressIntent
private void handleShowProgressIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_SHOW_PROGRESS)) { showProgress(extras.getBoolean(EXTRA_SHOW_PROGRESS)); } }
java
private void handleShowProgressIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_SHOW_PROGRESS)) { showProgress(extras.getBoolean(EXTRA_SHOW_PROGRESS)); } }
[ "private", "void", "handleShowProgressIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "if", "(", "extras", ".", "containsKey", "(", "EXTRA_SHOW_PROGRESS", ")", ")", "{", "showProgress", "(", "extras", ".", "getBoolean", "(", "EXTRA_SHOW_PROGRESS", ")", ")", ";", "}", "}" ]
Handles the intent extra, which specifies, whether the progress should be shown, when the activity is used as a wizard, or not. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "whether", "the", "progress", "should", "be", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L902-L906
4,758
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleProgressFormatIntent
private void handleProgressFormatIntent(@NonNull final Bundle extras) { String progressFormat = extras.getString(EXTRA_PROGRESS_FORMAT); if (!TextUtils.isEmpty(progressFormat)) { setProgressFormat(progressFormat); } }
java
private void handleProgressFormatIntent(@NonNull final Bundle extras) { String progressFormat = extras.getString(EXTRA_PROGRESS_FORMAT); if (!TextUtils.isEmpty(progressFormat)) { setProgressFormat(progressFormat); } }
[ "private", "void", "handleProgressFormatIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "String", "progressFormat", "=", "extras", ".", "getString", "(", "EXTRA_PROGRESS_FORMAT", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "progressFormat", ")", ")", "{", "setProgressFormat", "(", "progressFormat", ")", ";", "}", "}" ]
Handles the intent extra, which specifies the format of the progress, which is shown, when the activity is used as a wizard. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "the", "format", "of", "the", "progress", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L916-L922
4,759
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.handleNoBreadcrumbsIntent
private void handleNoBreadcrumbsIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_NO_BREAD_CRUMBS)) { hideBreadCrumb(extras.getBoolean(EXTRA_NO_BREAD_CRUMBS)); } }
java
private void handleNoBreadcrumbsIntent(@NonNull final Bundle extras) { if (extras.containsKey(EXTRA_NO_BREAD_CRUMBS)) { hideBreadCrumb(extras.getBoolean(EXTRA_NO_BREAD_CRUMBS)); } }
[ "private", "void", "handleNoBreadcrumbsIntent", "(", "@", "NonNull", "final", "Bundle", "extras", ")", "{", "if", "(", "extras", ".", "containsKey", "(", "EXTRA_NO_BREAD_CRUMBS", ")", ")", "{", "hideBreadCrumb", "(", "extras", ".", "getBoolean", "(", "EXTRA_NO_BREAD_CRUMBS", ")", ")", ";", "}", "}" ]
Handles the intent extra, which specifies whether bread crumbs should be shown, not. @param extras The extras of the intent, which has been used to start the activity, as an instance of the class {@link Bundle}. The bundle may not be null
[ "Handles", "the", "intent", "extra", "which", "specifies", "whether", "bread", "crumbs", "should", "be", "shown", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L931-L935
4,760
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.inflateLayout
private void inflateLayout() { setContentView(isSplitScreen() ? R.layout.preference_activity_tablet : R.layout.preference_activity_phone); frameLayout = findViewById(R.id.frame_layout); navigationFragmentContainer = findViewById(R.id.navigation_fragment_container); cardView = findViewById(R.id.card_view); toolbar = findViewById(R.id.toolbar); toolbarLarge = findViewById(R.id.large_toolbar); breadCrumbToolbar = findViewById(R.id.bread_crumb_toolbar); buttonBar = findViewById(R.id.wizard_button_bar); nextButton = findViewById(R.id.next_button); nextButton.setOnClickListener(createNextButtonListener()); backButton = findViewById(R.id.back_button); backButton.setOnClickListener(createBackButtonListener()); finishButton = findViewById(R.id.finish_button); finishButton.setOnClickListener(createFinishButtonListener()); buttonBarShadowView = findViewById(R.id.wizard_button_bar_shadow_view); toolbarShadowView = findViewById(R.id.toolbar_shadow_view); breadCrumbShadowView = findViewById(R.id.bread_crumb_shadow_view); }
java
private void inflateLayout() { setContentView(isSplitScreen() ? R.layout.preference_activity_tablet : R.layout.preference_activity_phone); frameLayout = findViewById(R.id.frame_layout); navigationFragmentContainer = findViewById(R.id.navigation_fragment_container); cardView = findViewById(R.id.card_view); toolbar = findViewById(R.id.toolbar); toolbarLarge = findViewById(R.id.large_toolbar); breadCrumbToolbar = findViewById(R.id.bread_crumb_toolbar); buttonBar = findViewById(R.id.wizard_button_bar); nextButton = findViewById(R.id.next_button); nextButton.setOnClickListener(createNextButtonListener()); backButton = findViewById(R.id.back_button); backButton.setOnClickListener(createBackButtonListener()); finishButton = findViewById(R.id.finish_button); finishButton.setOnClickListener(createFinishButtonListener()); buttonBarShadowView = findViewById(R.id.wizard_button_bar_shadow_view); toolbarShadowView = findViewById(R.id.toolbar_shadow_view); breadCrumbShadowView = findViewById(R.id.bread_crumb_shadow_view); }
[ "private", "void", "inflateLayout", "(", ")", "{", "setContentView", "(", "isSplitScreen", "(", ")", "?", "R", ".", "layout", ".", "preference_activity_tablet", ":", "R", ".", "layout", ".", "preference_activity_phone", ")", ";", "frameLayout", "=", "findViewById", "(", "R", ".", "id", ".", "frame_layout", ")", ";", "navigationFragmentContainer", "=", "findViewById", "(", "R", ".", "id", ".", "navigation_fragment_container", ")", ";", "cardView", "=", "findViewById", "(", "R", ".", "id", ".", "card_view", ")", ";", "toolbar", "=", "findViewById", "(", "R", ".", "id", ".", "toolbar", ")", ";", "toolbarLarge", "=", "findViewById", "(", "R", ".", "id", ".", "large_toolbar", ")", ";", "breadCrumbToolbar", "=", "findViewById", "(", "R", ".", "id", ".", "bread_crumb_toolbar", ")", ";", "buttonBar", "=", "findViewById", "(", "R", ".", "id", ".", "wizard_button_bar", ")", ";", "nextButton", "=", "findViewById", "(", "R", ".", "id", ".", "next_button", ")", ";", "nextButton", ".", "setOnClickListener", "(", "createNextButtonListener", "(", ")", ")", ";", "backButton", "=", "findViewById", "(", "R", ".", "id", ".", "back_button", ")", ";", "backButton", ".", "setOnClickListener", "(", "createBackButtonListener", "(", ")", ")", ";", "finishButton", "=", "findViewById", "(", "R", ".", "id", ".", "finish_button", ")", ";", "finishButton", ".", "setOnClickListener", "(", "createFinishButtonListener", "(", ")", ")", ";", "buttonBarShadowView", "=", "findViewById", "(", "R", ".", "id", ".", "wizard_button_bar_shadow_view", ")", ";", "toolbarShadowView", "=", "findViewById", "(", "R", ".", "id", ".", "toolbar_shadow_view", ")", ";", "breadCrumbShadowView", "=", "findViewById", "(", "R", ".", "id", ".", "bread_crumb_shadow_view", ")", ";", "}" ]
Inflates the activity's layout, depending on whether the split screen layout is used, or not.
[ "Inflates", "the", "activity", "s", "layout", "depending", "on", "whether", "the", "split", "screen", "layout", "is", "used", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L941-L960
4,761
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.initializeToolbar
private void initializeToolbar() { Condition.INSTANCE.ensureTrue(getSupportActionBar() == null, "An action bar is already attached to the activity. Use the theme " + "\"@style/Theme.MaterialComponents.NoActionBar\" or " + "\"@style/Theme.MaterialComponents.Light.NoActionBar\" as the activity's theme", IllegalStateException.class); if (isSplitScreen()) { toolbarLarge.setVisibility(View.VISIBLE); } else { toolbar.setVisibility(View.VISIBLE); } setSupportActionBar(toolbar); resetTitle(); }
java
private void initializeToolbar() { Condition.INSTANCE.ensureTrue(getSupportActionBar() == null, "An action bar is already attached to the activity. Use the theme " + "\"@style/Theme.MaterialComponents.NoActionBar\" or " + "\"@style/Theme.MaterialComponents.Light.NoActionBar\" as the activity's theme", IllegalStateException.class); if (isSplitScreen()) { toolbarLarge.setVisibility(View.VISIBLE); } else { toolbar.setVisibility(View.VISIBLE); } setSupportActionBar(toolbar); resetTitle(); }
[ "private", "void", "initializeToolbar", "(", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureTrue", "(", "getSupportActionBar", "(", ")", "==", "null", ",", "\"An action bar is already attached to the activity. Use the theme \"", "+", "\"\\\"@style/Theme.MaterialComponents.NoActionBar\\\" or \"", "+", "\"\\\"@style/Theme.MaterialComponents.Light.NoActionBar\\\" as the activity's theme\"", ",", "IllegalStateException", ".", "class", ")", ";", "if", "(", "isSplitScreen", "(", ")", ")", "{", "toolbarLarge", ".", "setVisibility", "(", "View", ".", "VISIBLE", ")", ";", "}", "else", "{", "toolbar", ".", "setVisibility", "(", "View", ".", "VISIBLE", ")", ";", "}", "setSupportActionBar", "(", "toolbar", ")", ";", "resetTitle", "(", ")", ";", "}" ]
Initializes the activity's toolbar.
[ "Initializes", "the", "activity", "s", "toolbar", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L965-L979
4,762
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.initializeFragments
private void initializeFragments() { navigationFragment = (NavigationFragment) getSupportFragmentManager() .findFragmentByTag(NAVIGATION_FRAGMENT_TAG); if (navigationFragment == null) { navigationFragment = (NavigationFragment) Fragment .instantiate(this, NavigationFragment.class.getName()); navigationFragment.setRetainInstance(true); navigationFragment.setCallback(this); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.add(R.id.navigation_fragment_container, navigationFragment, NAVIGATION_FRAGMENT_TAG); transaction.commit(); } else if (!navigationFragment.isAdapterCreated()) { navigationFragment.setCallback(this); } navigationFragment.setAdapterCallback(this); preferenceFragment = getSupportFragmentManager().findFragmentByTag(PREFERENCE_FRAGMENT_TAG); adaptNavigationSelectionColor(); adaptNavigationDividerColor(); adaptNavigationEnabledState(); }
java
private void initializeFragments() { navigationFragment = (NavigationFragment) getSupportFragmentManager() .findFragmentByTag(NAVIGATION_FRAGMENT_TAG); if (navigationFragment == null) { navigationFragment = (NavigationFragment) Fragment .instantiate(this, NavigationFragment.class.getName()); navigationFragment.setRetainInstance(true); navigationFragment.setCallback(this); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.add(R.id.navigation_fragment_container, navigationFragment, NAVIGATION_FRAGMENT_TAG); transaction.commit(); } else if (!navigationFragment.isAdapterCreated()) { navigationFragment.setCallback(this); } navigationFragment.setAdapterCallback(this); preferenceFragment = getSupportFragmentManager().findFragmentByTag(PREFERENCE_FRAGMENT_TAG); adaptNavigationSelectionColor(); adaptNavigationDividerColor(); adaptNavigationEnabledState(); }
[ "private", "void", "initializeFragments", "(", ")", "{", "navigationFragment", "=", "(", "NavigationFragment", ")", "getSupportFragmentManager", "(", ")", ".", "findFragmentByTag", "(", "NAVIGATION_FRAGMENT_TAG", ")", ";", "if", "(", "navigationFragment", "==", "null", ")", "{", "navigationFragment", "=", "(", "NavigationFragment", ")", "Fragment", ".", "instantiate", "(", "this", ",", "NavigationFragment", ".", "class", ".", "getName", "(", ")", ")", ";", "navigationFragment", ".", "setRetainInstance", "(", "true", ")", ";", "navigationFragment", ".", "setCallback", "(", "this", ")", ";", "FragmentTransaction", "transaction", "=", "getSupportFragmentManager", "(", ")", ".", "beginTransaction", "(", ")", ";", "transaction", ".", "add", "(", "R", ".", "id", ".", "navigation_fragment_container", ",", "navigationFragment", ",", "NAVIGATION_FRAGMENT_TAG", ")", ";", "transaction", ".", "commit", "(", ")", ";", "}", "else", "if", "(", "!", "navigationFragment", ".", "isAdapterCreated", "(", ")", ")", "{", "navigationFragment", ".", "setCallback", "(", "this", ")", ";", "}", "navigationFragment", ".", "setAdapterCallback", "(", "this", ")", ";", "preferenceFragment", "=", "getSupportFragmentManager", "(", ")", ".", "findFragmentByTag", "(", "PREFERENCE_FRAGMENT_TAG", ")", ";", "adaptNavigationSelectionColor", "(", ")", ";", "adaptNavigationDividerColor", "(", ")", ";", "adaptNavigationEnabledState", "(", ")", ";", "}" ]
Initializes the activity's fragments.
[ "Initializes", "the", "activity", "s", "fragments", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L984-L1006
4,763
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showPreferenceFragment
private void showPreferenceFragment(@NonNull final NavigationPreference navigationPreference, @Nullable final Bundle arguments) { if (arguments != null && navigationPreference.getExtras() != null) { arguments.putAll(navigationPreference.getExtras()); } selectedPreferenceFragment = navigationPreference.getFragment(); selectedPreferenceFragmentArguments = arguments != null ? arguments : navigationPreference.getExtras(); if (!TextUtils.isEmpty(selectedPreferenceFragment)) { Fragment fragment = Fragment.instantiate(this, navigationPreference.getFragment(), selectedPreferenceFragmentArguments); showPreferenceFragment(navigationPreference, fragment); showBreadCrumb(navigationPreference, selectedPreferenceFragmentArguments); } else { removePreferenceFragmentUnconditionally(); if (isSplitScreen()) { showBreadCrumb(navigationPreference, selectedPreferenceFragmentArguments); } } adaptWizardButtonVisibilities(); }
java
private void showPreferenceFragment(@NonNull final NavigationPreference navigationPreference, @Nullable final Bundle arguments) { if (arguments != null && navigationPreference.getExtras() != null) { arguments.putAll(navigationPreference.getExtras()); } selectedPreferenceFragment = navigationPreference.getFragment(); selectedPreferenceFragmentArguments = arguments != null ? arguments : navigationPreference.getExtras(); if (!TextUtils.isEmpty(selectedPreferenceFragment)) { Fragment fragment = Fragment.instantiate(this, navigationPreference.getFragment(), selectedPreferenceFragmentArguments); showPreferenceFragment(navigationPreference, fragment); showBreadCrumb(navigationPreference, selectedPreferenceFragmentArguments); } else { removePreferenceFragmentUnconditionally(); if (isSplitScreen()) { showBreadCrumb(navigationPreference, selectedPreferenceFragmentArguments); } } adaptWizardButtonVisibilities(); }
[ "private", "void", "showPreferenceFragment", "(", "@", "NonNull", "final", "NavigationPreference", "navigationPreference", ",", "@", "Nullable", "final", "Bundle", "arguments", ")", "{", "if", "(", "arguments", "!=", "null", "&&", "navigationPreference", ".", "getExtras", "(", ")", "!=", "null", ")", "{", "arguments", ".", "putAll", "(", "navigationPreference", ".", "getExtras", "(", ")", ")", ";", "}", "selectedPreferenceFragment", "=", "navigationPreference", ".", "getFragment", "(", ")", ";", "selectedPreferenceFragmentArguments", "=", "arguments", "!=", "null", "?", "arguments", ":", "navigationPreference", ".", "getExtras", "(", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "selectedPreferenceFragment", ")", ")", "{", "Fragment", "fragment", "=", "Fragment", ".", "instantiate", "(", "this", ",", "navigationPreference", ".", "getFragment", "(", ")", ",", "selectedPreferenceFragmentArguments", ")", ";", "showPreferenceFragment", "(", "navigationPreference", ",", "fragment", ")", ";", "showBreadCrumb", "(", "navigationPreference", ",", "selectedPreferenceFragmentArguments", ")", ";", "}", "else", "{", "removePreferenceFragmentUnconditionally", "(", ")", ";", "if", "(", "isSplitScreen", "(", ")", ")", "{", "showBreadCrumb", "(", "navigationPreference", ",", "selectedPreferenceFragmentArguments", ")", ";", "}", "}", "adaptWizardButtonVisibilities", "(", ")", ";", "}" ]
Shows the fragment, which is associated with a specific navigation preference. @param navigationPreference The navigation preference, whose fragment should be shown, as an instance of the class {@link NavigationPreference}. The navigation preference may not be null @param arguments The arguments, which should be passed to the fragment, as an instance of the class {@link Bundle} or null, if the navigation preferences's extras should be used instead
[ "Shows", "the", "fragment", "which", "is", "associated", "with", "a", "specific", "navigation", "preference", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1019-L1043
4,764
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showPreferenceFragment
private void showPreferenceFragment(@NonNull final NavigationPreference navigationPreference, @NonNull final Fragment fragment) { fragment.setRetainInstance(true); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); if (!isSplitScreen()) { transaction.hide(navigationFragment); if (preferenceFragment != null) { transaction.remove(preferenceFragment); notifyOnPreferenceFragmentHidden(preferenceFragment); } transaction.add(R.id.navigation_fragment_container, fragment, PREFERENCE_FRAGMENT_TAG); } else { if (preferenceFragment != null) { notifyOnPreferenceFragmentHidden(preferenceFragment); } transaction .replace(R.id.preference_fragment_container, fragment, PREFERENCE_FRAGMENT_TAG); } transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); transaction.commit(); this.preferenceFragment = fragment; showToolbarNavigationIcon(); adaptBreadCrumbVisibility(selectedPreferenceFragmentArguments); notifyOnPreferenceFragmentShown(navigationPreference, fragment); }
java
private void showPreferenceFragment(@NonNull final NavigationPreference navigationPreference, @NonNull final Fragment fragment) { fragment.setRetainInstance(true); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); if (!isSplitScreen()) { transaction.hide(navigationFragment); if (preferenceFragment != null) { transaction.remove(preferenceFragment); notifyOnPreferenceFragmentHidden(preferenceFragment); } transaction.add(R.id.navigation_fragment_container, fragment, PREFERENCE_FRAGMENT_TAG); } else { if (preferenceFragment != null) { notifyOnPreferenceFragmentHidden(preferenceFragment); } transaction .replace(R.id.preference_fragment_container, fragment, PREFERENCE_FRAGMENT_TAG); } transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); transaction.commit(); this.preferenceFragment = fragment; showToolbarNavigationIcon(); adaptBreadCrumbVisibility(selectedPreferenceFragmentArguments); notifyOnPreferenceFragmentShown(navigationPreference, fragment); }
[ "private", "void", "showPreferenceFragment", "(", "@", "NonNull", "final", "NavigationPreference", "navigationPreference", ",", "@", "NonNull", "final", "Fragment", "fragment", ")", "{", "fragment", ".", "setRetainInstance", "(", "true", ")", ";", "FragmentTransaction", "transaction", "=", "getSupportFragmentManager", "(", ")", ".", "beginTransaction", "(", ")", ";", "if", "(", "!", "isSplitScreen", "(", ")", ")", "{", "transaction", ".", "hide", "(", "navigationFragment", ")", ";", "if", "(", "preferenceFragment", "!=", "null", ")", "{", "transaction", ".", "remove", "(", "preferenceFragment", ")", ";", "notifyOnPreferenceFragmentHidden", "(", "preferenceFragment", ")", ";", "}", "transaction", ".", "add", "(", "R", ".", "id", ".", "navigation_fragment_container", ",", "fragment", ",", "PREFERENCE_FRAGMENT_TAG", ")", ";", "}", "else", "{", "if", "(", "preferenceFragment", "!=", "null", ")", "{", "notifyOnPreferenceFragmentHidden", "(", "preferenceFragment", ")", ";", "}", "transaction", ".", "replace", "(", "R", ".", "id", ".", "preference_fragment_container", ",", "fragment", ",", "PREFERENCE_FRAGMENT_TAG", ")", ";", "}", "transaction", ".", "setTransition", "(", "FragmentTransaction", ".", "TRANSIT_FRAGMENT_OPEN", ")", ";", "transaction", ".", "commit", "(", ")", ";", "this", ".", "preferenceFragment", "=", "fragment", ";", "showToolbarNavigationIcon", "(", ")", ";", "adaptBreadCrumbVisibility", "(", "selectedPreferenceFragmentArguments", ")", ";", "notifyOnPreferenceFragmentShown", "(", "navigationPreference", ",", "fragment", ")", ";", "}" ]
Shows a specific preference fragment. @param navigationPreference The navigation preference, the fragment, which should be shown, is associated with, as an instance of the class {@link NavigationPreference}. The navigation preference may not be null @param fragment The fragment, which should be shown, as an instance of the class Fragment. The fragment may not be null
[ "Shows", "a", "specific", "preference", "fragment", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1056-L1085
4,765
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.removePreferenceFragment
private boolean removePreferenceFragment() { if (!isSplitScreen() && isPreferenceFragmentShown() && !isNavigationHidden() && !isButtonBarShown()) { navigationFragment.selectNavigationPreference(-1, null); removePreferenceFragmentUnconditionally(); selectedPreferenceFragment = null; selectedPreferenceFragmentArguments = null; return true; } return false; }
java
private boolean removePreferenceFragment() { if (!isSplitScreen() && isPreferenceFragmentShown() && !isNavigationHidden() && !isButtonBarShown()) { navigationFragment.selectNavigationPreference(-1, null); removePreferenceFragmentUnconditionally(); selectedPreferenceFragment = null; selectedPreferenceFragmentArguments = null; return true; } return false; }
[ "private", "boolean", "removePreferenceFragment", "(", ")", "{", "if", "(", "!", "isSplitScreen", "(", ")", "&&", "isPreferenceFragmentShown", "(", ")", "&&", "!", "isNavigationHidden", "(", ")", "&&", "!", "isButtonBarShown", "(", ")", ")", "{", "navigationFragment", ".", "selectNavigationPreference", "(", "-", "1", ",", "null", ")", ";", "removePreferenceFragmentUnconditionally", "(", ")", ";", "selectedPreferenceFragment", "=", "null", ";", "selectedPreferenceFragmentArguments", "=", "null", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Removes the currently shown preference fragment, if the split screen layout is not used and the navigation is not hidden. @return True, if a preference fragment has been removed, false otherwise
[ "Removes", "the", "currently", "shown", "preference", "fragment", "if", "the", "split", "screen", "layout", "is", "not", "used", "and", "the", "navigation", "is", "not", "hidden", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1093-L1104
4,766
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.removePreferenceFragmentUnconditionally
private void removePreferenceFragmentUnconditionally() { if (isPreferenceFragmentShown()) { resetTitle(); hideToolbarNavigationIcon(); adaptBreadCrumbVisibility(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.remove(preferenceFragment); if (!isSplitScreen()) { transaction.show(navigationFragment); } transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE); transaction.commit(); notifyOnPreferenceFragmentHidden(preferenceFragment); preferenceFragment = null; } }
java
private void removePreferenceFragmentUnconditionally() { if (isPreferenceFragmentShown()) { resetTitle(); hideToolbarNavigationIcon(); adaptBreadCrumbVisibility(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.remove(preferenceFragment); if (!isSplitScreen()) { transaction.show(navigationFragment); } transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE); transaction.commit(); notifyOnPreferenceFragmentHidden(preferenceFragment); preferenceFragment = null; } }
[ "private", "void", "removePreferenceFragmentUnconditionally", "(", ")", "{", "if", "(", "isPreferenceFragmentShown", "(", ")", ")", "{", "resetTitle", "(", ")", ";", "hideToolbarNavigationIcon", "(", ")", ";", "adaptBreadCrumbVisibility", "(", ")", ";", "FragmentTransaction", "transaction", "=", "getSupportFragmentManager", "(", ")", ".", "beginTransaction", "(", ")", ";", "transaction", ".", "remove", "(", "preferenceFragment", ")", ";", "if", "(", "!", "isSplitScreen", "(", ")", ")", "{", "transaction", ".", "show", "(", "navigationFragment", ")", ";", "}", "transaction", ".", "setTransition", "(", "FragmentTransaction", ".", "TRANSIT_FRAGMENT_CLOSE", ")", ";", "transaction", ".", "commit", "(", ")", ";", "notifyOnPreferenceFragmentHidden", "(", "preferenceFragment", ")", ";", "preferenceFragment", "=", "null", ";", "}", "}" ]
Removes the currently preference fragment, regardless of whether the split screen layout is used, or not.
[ "Removes", "the", "currently", "preference", "fragment", "regardless", "of", "whether", "the", "split", "screen", "layout", "is", "used", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1110-L1127
4,767
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showBreadCrumb
private void showBreadCrumb(@NonNull final NavigationPreference navigationPreference, @Nullable final Bundle arguments) { CharSequence breadCrumbTitle = null; if (arguments != null && arguments.containsKey(EXTRA_SHOW_FRAGMENT_TITLE)) { breadCrumbTitle = arguments.getCharSequence(EXTRA_SHOW_FRAGMENT_TITLE); } if (TextUtils.isEmpty(breadCrumbTitle)) { breadCrumbTitle = navigationPreference.getBreadCrumbTitle(); if (TextUtils.isEmpty(breadCrumbTitle)) { breadCrumbTitle = navigationPreference.getTitle(); if (TextUtils.isEmpty(breadCrumbTitle)) { breadCrumbTitle = getTitle(); } } } showBreadCrumb(breadCrumbTitle); }
java
private void showBreadCrumb(@NonNull final NavigationPreference navigationPreference, @Nullable final Bundle arguments) { CharSequence breadCrumbTitle = null; if (arguments != null && arguments.containsKey(EXTRA_SHOW_FRAGMENT_TITLE)) { breadCrumbTitle = arguments.getCharSequence(EXTRA_SHOW_FRAGMENT_TITLE); } if (TextUtils.isEmpty(breadCrumbTitle)) { breadCrumbTitle = navigationPreference.getBreadCrumbTitle(); if (TextUtils.isEmpty(breadCrumbTitle)) { breadCrumbTitle = navigationPreference.getTitle(); if (TextUtils.isEmpty(breadCrumbTitle)) { breadCrumbTitle = getTitle(); } } } showBreadCrumb(breadCrumbTitle); }
[ "private", "void", "showBreadCrumb", "(", "@", "NonNull", "final", "NavigationPreference", "navigationPreference", ",", "@", "Nullable", "final", "Bundle", "arguments", ")", "{", "CharSequence", "breadCrumbTitle", "=", "null", ";", "if", "(", "arguments", "!=", "null", "&&", "arguments", ".", "containsKey", "(", "EXTRA_SHOW_FRAGMENT_TITLE", ")", ")", "{", "breadCrumbTitle", "=", "arguments", ".", "getCharSequence", "(", "EXTRA_SHOW_FRAGMENT_TITLE", ")", ";", "}", "if", "(", "TextUtils", ".", "isEmpty", "(", "breadCrumbTitle", ")", ")", "{", "breadCrumbTitle", "=", "navigationPreference", ".", "getBreadCrumbTitle", "(", ")", ";", "if", "(", "TextUtils", ".", "isEmpty", "(", "breadCrumbTitle", ")", ")", "{", "breadCrumbTitle", "=", "navigationPreference", ".", "getTitle", "(", ")", ";", "if", "(", "TextUtils", ".", "isEmpty", "(", "breadCrumbTitle", ")", ")", "{", "breadCrumbTitle", "=", "getTitle", "(", ")", ";", "}", "}", "}", "showBreadCrumb", "(", "breadCrumbTitle", ")", ";", "}" ]
Shows the bread crumb of a specific navigation preference. When using the split screen layout, the bread crumb is shown above the currently shown preference fragment, otherwise the bread crumb is shown as the toolbar title. @param navigationPreference The navigation preference, whose bread crumb should be shown, as an instance of the class {@link NavigationPreference}. The navigation preference may not be null @param arguments The arguments, which are passed to the fragment, which is associated with the navigation preference, as an instance of the class {@link Bundle} or null, if no arguments are passed to the fragment
[ "Shows", "the", "bread", "crumb", "of", "a", "specific", "navigation", "preference", ".", "When", "using", "the", "split", "screen", "layout", "the", "bread", "crumb", "is", "shown", "above", "the", "currently", "shown", "preference", "fragment", "otherwise", "the", "bread", "crumb", "is", "shown", "as", "the", "toolbar", "title", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1142-L1163
4,768
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showBreadCrumb
private void showBreadCrumb(@Nullable final CharSequence breadCrumbTitle) { CharSequence formattedBreadCrumbTitle = formatBreadCrumbTitle(breadCrumbTitle); if (isSplitScreen()) { breadCrumbToolbar.setTitle(formattedBreadCrumbTitle); } else if (!TextUtils.isEmpty(formattedBreadCrumbTitle)) { showTitle(formattedBreadCrumbTitle); } }
java
private void showBreadCrumb(@Nullable final CharSequence breadCrumbTitle) { CharSequence formattedBreadCrumbTitle = formatBreadCrumbTitle(breadCrumbTitle); if (isSplitScreen()) { breadCrumbToolbar.setTitle(formattedBreadCrumbTitle); } else if (!TextUtils.isEmpty(formattedBreadCrumbTitle)) { showTitle(formattedBreadCrumbTitle); } }
[ "private", "void", "showBreadCrumb", "(", "@", "Nullable", "final", "CharSequence", "breadCrumbTitle", ")", "{", "CharSequence", "formattedBreadCrumbTitle", "=", "formatBreadCrumbTitle", "(", "breadCrumbTitle", ")", ";", "if", "(", "isSplitScreen", "(", ")", ")", "{", "breadCrumbToolbar", ".", "setTitle", "(", "formattedBreadCrumbTitle", ")", ";", "}", "else", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "formattedBreadCrumbTitle", ")", ")", "{", "showTitle", "(", "formattedBreadCrumbTitle", ")", ";", "}", "}" ]
Shows a specific bread crumb. When using the split screen layout, the bread crumb is shown above the currently shown preference fragment, otherwise the bread crumb is shown as the toolbar title. @param breadCrumbTitle The bread crumb title, which should be shown, as an instance of the type {@link CharSequence} or null, if no bread crumb should be shown
[ "Shows", "a", "specific", "bread", "crumb", ".", "When", "using", "the", "split", "screen", "layout", "the", "bread", "crumb", "is", "shown", "above", "the", "currently", "shown", "preference", "fragment", "otherwise", "the", "bread", "crumb", "is", "shown", "as", "the", "toolbar", "title", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1174-L1182
4,769
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.formatBreadCrumbTitle
@Nullable private CharSequence formatBreadCrumbTitle(@Nullable final CharSequence breadCrumbTitle) { if (!TextUtils.isEmpty(breadCrumbTitle) && isButtonBarShown() && navigationFragment != null) { String format = getProgressFormat(); int selectedNavigationPreferenceIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (!TextUtils.isEmpty(format) && selectedNavigationPreferenceIndex != -1) { int currentStep = selectedNavigationPreferenceIndex + 1; int totalSteps = navigationFragment.getNavigationPreferenceCount(); return String.format(format, currentStep, totalSteps, breadCrumbTitle); } } return breadCrumbTitle; }
java
@Nullable private CharSequence formatBreadCrumbTitle(@Nullable final CharSequence breadCrumbTitle) { if (!TextUtils.isEmpty(breadCrumbTitle) && isButtonBarShown() && navigationFragment != null) { String format = getProgressFormat(); int selectedNavigationPreferenceIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (!TextUtils.isEmpty(format) && selectedNavigationPreferenceIndex != -1) { int currentStep = selectedNavigationPreferenceIndex + 1; int totalSteps = navigationFragment.getNavigationPreferenceCount(); return String.format(format, currentStep, totalSteps, breadCrumbTitle); } } return breadCrumbTitle; }
[ "@", "Nullable", "private", "CharSequence", "formatBreadCrumbTitle", "(", "@", "Nullable", "final", "CharSequence", "breadCrumbTitle", ")", "{", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "breadCrumbTitle", ")", "&&", "isButtonBarShown", "(", ")", "&&", "navigationFragment", "!=", "null", ")", "{", "String", "format", "=", "getProgressFormat", "(", ")", ";", "int", "selectedNavigationPreferenceIndex", "=", "navigationFragment", ".", "getSelectedNavigationPreferenceIndex", "(", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "format", ")", "&&", "selectedNavigationPreferenceIndex", "!=", "-", "1", ")", "{", "int", "currentStep", "=", "selectedNavigationPreferenceIndex", "+", "1", ";", "int", "totalSteps", "=", "navigationFragment", ".", "getNavigationPreferenceCount", "(", ")", ";", "return", "String", ".", "format", "(", "format", ",", "currentStep", ",", "totalSteps", ",", "breadCrumbTitle", ")", ";", "}", "}", "return", "breadCrumbTitle", ";", "}" ]
Formats a specific bread crumb title, depending on whether the activity is used as a wizard and whether the progress should be shown, or not. @param breadCrumbTitle The bread crumb title, which should be formatted, as an instance of the class {@link CharSequence} or null, if no bread crumb title should be shown @return The formatted bread crumb title as an instance of the class {@link CharSequence} or null, if no bread crumb title should be shown
[ "Formats", "a", "specific", "bread", "crumb", "title", "depending", "on", "whether", "the", "activity", "is", "used", "as", "a", "wizard", "and", "whether", "the", "progress", "should", "be", "shown", "or", "not", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1194-L1210
4,770
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showTitle
private void showTitle(@Nullable final CharSequence title) { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { if (isSplitScreen()) { if (toolbarLarge != null) { toolbarLarge.setTitle(title); } actionBar.setTitle(null); } else { actionBar.setTitle(title); } } }
java
private void showTitle(@Nullable final CharSequence title) { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { if (isSplitScreen()) { if (toolbarLarge != null) { toolbarLarge.setTitle(title); } actionBar.setTitle(null); } else { actionBar.setTitle(title); } } }
[ "private", "void", "showTitle", "(", "@", "Nullable", "final", "CharSequence", "title", ")", "{", "ActionBar", "actionBar", "=", "getSupportActionBar", "(", ")", ";", "if", "(", "actionBar", "!=", "null", ")", "{", "if", "(", "isSplitScreen", "(", ")", ")", "{", "if", "(", "toolbarLarge", "!=", "null", ")", "{", "toolbarLarge", ".", "setTitle", "(", "title", ")", ";", "}", "actionBar", ".", "setTitle", "(", "null", ")", ";", "}", "else", "{", "actionBar", ".", "setTitle", "(", "title", ")", ";", "}", "}", "}" ]
Shows a specific title. @param title The title, which should be shown, as an instance of the type {@link CharSequence} or null, if no title should be shown
[ "Shows", "a", "specific", "title", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1219-L1233
4,771
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.showToolbarNavigationIcon
private void showToolbarNavigationIcon() { if (isPreferenceFragmentShown() && isNavigationIconOverridden() && !isNavigationHidden() && !(!isSplitScreen() && isButtonBarShown())) { displayHomeAsUp = isDisplayHomeAsUpEnabled(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } } }
java
private void showToolbarNavigationIcon() { if (isPreferenceFragmentShown() && isNavigationIconOverridden() && !isNavigationHidden() && !(!isSplitScreen() && isButtonBarShown())) { displayHomeAsUp = isDisplayHomeAsUpEnabled(); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } } }
[ "private", "void", "showToolbarNavigationIcon", "(", ")", "{", "if", "(", "isPreferenceFragmentShown", "(", ")", "&&", "isNavigationIconOverridden", "(", ")", "&&", "!", "isNavigationHidden", "(", ")", "&&", "!", "(", "!", "isSplitScreen", "(", ")", "&&", "isButtonBarShown", "(", ")", ")", ")", "{", "displayHomeAsUp", "=", "isDisplayHomeAsUpEnabled", "(", ")", ";", "ActionBar", "actionBar", "=", "getSupportActionBar", "(", ")", ";", "if", "(", "actionBar", "!=", "null", ")", "{", "actionBar", ".", "setDisplayHomeAsUpEnabled", "(", "true", ")", ";", "}", "}", "}" ]
Shows the navigation icon of the activity's toolbar.
[ "Shows", "the", "navigation", "icon", "of", "the", "activity", "s", "toolbar", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1257-L1267
4,772
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.hideToolbarNavigationIcon
private void hideToolbarNavigationIcon() { if (!displayHomeAsUp) { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setHomeButtonEnabled(false); } } }
java
private void hideToolbarNavigationIcon() { if (!displayHomeAsUp) { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setHomeButtonEnabled(false); } } }
[ "private", "void", "hideToolbarNavigationIcon", "(", ")", "{", "if", "(", "!", "displayHomeAsUp", ")", "{", "ActionBar", "actionBar", "=", "getSupportActionBar", "(", ")", ";", "if", "(", "actionBar", "!=", "null", ")", "{", "actionBar", ".", "setDisplayHomeAsUpEnabled", "(", "false", ")", ";", "actionBar", ".", "setHomeButtonEnabled", "(", "false", ")", ";", "}", "}", "}" ]
Hides the navigation icon of the activity's toolbar, respectively sets it to the previous icon.
[ "Hides", "the", "navigation", "icon", "of", "the", "activity", "s", "toolbar", "respectively", "sets", "it", "to", "the", "previous", "icon", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1273-L1282
4,773
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.setMarginStart
private void setMarginStart(@NonNull final FrameLayout.LayoutParams layoutParams, final int margin) { if (isRtlLayoutUsed()) { layoutParams.rightMargin = margin; } else { layoutParams.leftMargin = margin; } }
java
private void setMarginStart(@NonNull final FrameLayout.LayoutParams layoutParams, final int margin) { if (isRtlLayoutUsed()) { layoutParams.rightMargin = margin; } else { layoutParams.leftMargin = margin; } }
[ "private", "void", "setMarginStart", "(", "@", "NonNull", "final", "FrameLayout", ".", "LayoutParams", "layoutParams", ",", "final", "int", "margin", ")", "{", "if", "(", "isRtlLayoutUsed", "(", ")", ")", "{", "layoutParams", ".", "rightMargin", "=", "margin", ";", "}", "else", "{", "layoutParams", ".", "leftMargin", "=", "margin", ";", "}", "}" ]
Sets the start margin of specific layout params. @param layoutParams The layout params whose margin should be set, as an instance of the class {@link FrameLayout.LayoutParams}. The layout params may not be null @param margin The start margin, which should be set, in pixels as an {@link Integer} valueF
[ "Sets", "the", "start", "margin", "of", "specific", "layout", "params", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1293-L1300
4,774
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptNavigationWidth
private void adaptNavigationWidth() { if (frameLayout != null && navigationFragmentContainer != null && cardView != null && toolbarLarge != null) { ViewCompat.setPaddingRelative(navigationFragmentContainer, 0, 0, getDisplayWidth(this) - navigationWidth, 0); if (!isNavigationHidden()) { toolbarLarge.setNavigationWidth(navigationWidth); FrameLayout.LayoutParams cardViewLayoutParams = (FrameLayout.LayoutParams) cardView.getLayoutParams(); int margin = navigationWidth - getResources().getDimensionPixelSize(R.dimen.card_view_intrinsic_margin); setMarginStart(cardViewLayoutParams, margin); } } }
java
private void adaptNavigationWidth() { if (frameLayout != null && navigationFragmentContainer != null && cardView != null && toolbarLarge != null) { ViewCompat.setPaddingRelative(navigationFragmentContainer, 0, 0, getDisplayWidth(this) - navigationWidth, 0); if (!isNavigationHidden()) { toolbarLarge.setNavigationWidth(navigationWidth); FrameLayout.LayoutParams cardViewLayoutParams = (FrameLayout.LayoutParams) cardView.getLayoutParams(); int margin = navigationWidth - getResources().getDimensionPixelSize(R.dimen.card_view_intrinsic_margin); setMarginStart(cardViewLayoutParams, margin); } } }
[ "private", "void", "adaptNavigationWidth", "(", ")", "{", "if", "(", "frameLayout", "!=", "null", "&&", "navigationFragmentContainer", "!=", "null", "&&", "cardView", "!=", "null", "&&", "toolbarLarge", "!=", "null", ")", "{", "ViewCompat", ".", "setPaddingRelative", "(", "navigationFragmentContainer", ",", "0", ",", "0", ",", "getDisplayWidth", "(", "this", ")", "-", "navigationWidth", ",", "0", ")", ";", "if", "(", "!", "isNavigationHidden", "(", ")", ")", "{", "toolbarLarge", ".", "setNavigationWidth", "(", "navigationWidth", ")", ";", "FrameLayout", ".", "LayoutParams", "cardViewLayoutParams", "=", "(", "FrameLayout", ".", "LayoutParams", ")", "cardView", ".", "getLayoutParams", "(", ")", ";", "int", "margin", "=", "navigationWidth", "-", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "card_view_intrinsic_margin", ")", ";", "setMarginStart", "(", "cardViewLayoutParams", ",", "margin", ")", ";", "}", "}", "}" ]
Adapts the width of the navigation.
[ "Adapts", "the", "width", "of", "the", "navigation", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1342-L1357
4,775
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptNavigationVisibility
private void adaptNavigationVisibility() { if (isSplitScreen()) { if (navigationFragmentContainer != null && cardView != null && toolbarLarge != null) { navigationFragmentContainer .setVisibility(isNavigationHidden() ? View.GONE : View.VISIBLE); toolbarLarge.hideNavigation(isNavigationHidden()); int preferenceScreenHorizontalMargin = getResources().getDimensionPixelSize(R.dimen.card_view_horizontal_margin); int preferenceScreenMarginRight = getResources().getDimensionPixelSize(R.dimen.card_view_margin_right); int cardViewIntrinsicMargin = getResources().getDimensionPixelSize(R.dimen.card_view_intrinsic_margin); FrameLayout.LayoutParams cardViewLayoutParams = (FrameLayout.LayoutParams) cardView.getLayoutParams(); cardViewLayoutParams.gravity = isNavigationHidden() ? Gravity.CENTER_HORIZONTAL : Gravity.NO_GRAVITY; int marginStart = (isNavigationHidden() ? preferenceScreenHorizontalMargin : navigationWidth) - cardViewIntrinsicMargin; int marginEnd = (isNavigationHidden() ? preferenceScreenHorizontalMargin : preferenceScreenMarginRight) - cardViewIntrinsicMargin; setMarginStart(cardViewLayoutParams, marginStart); setMarginEnd(cardViewLayoutParams, marginEnd); } } else { if (getSelectedNavigationPreference() != null) { if (isNavigationHidden()) { hideToolbarNavigationIcon(); } else { showToolbarNavigationIcon(); } } else if (isNavigationHidden() && navigationFragment != null && navigationFragment.getCallback() == null) { if (navigationFragment.getNavigationPreferenceCount() > 0) { navigationFragment.selectNavigationPreference(0, null); } else { finish(); } } } }
java
private void adaptNavigationVisibility() { if (isSplitScreen()) { if (navigationFragmentContainer != null && cardView != null && toolbarLarge != null) { navigationFragmentContainer .setVisibility(isNavigationHidden() ? View.GONE : View.VISIBLE); toolbarLarge.hideNavigation(isNavigationHidden()); int preferenceScreenHorizontalMargin = getResources().getDimensionPixelSize(R.dimen.card_view_horizontal_margin); int preferenceScreenMarginRight = getResources().getDimensionPixelSize(R.dimen.card_view_margin_right); int cardViewIntrinsicMargin = getResources().getDimensionPixelSize(R.dimen.card_view_intrinsic_margin); FrameLayout.LayoutParams cardViewLayoutParams = (FrameLayout.LayoutParams) cardView.getLayoutParams(); cardViewLayoutParams.gravity = isNavigationHidden() ? Gravity.CENTER_HORIZONTAL : Gravity.NO_GRAVITY; int marginStart = (isNavigationHidden() ? preferenceScreenHorizontalMargin : navigationWidth) - cardViewIntrinsicMargin; int marginEnd = (isNavigationHidden() ? preferenceScreenHorizontalMargin : preferenceScreenMarginRight) - cardViewIntrinsicMargin; setMarginStart(cardViewLayoutParams, marginStart); setMarginEnd(cardViewLayoutParams, marginEnd); } } else { if (getSelectedNavigationPreference() != null) { if (isNavigationHidden()) { hideToolbarNavigationIcon(); } else { showToolbarNavigationIcon(); } } else if (isNavigationHidden() && navigationFragment != null && navigationFragment.getCallback() == null) { if (navigationFragment.getNavigationPreferenceCount() > 0) { navigationFragment.selectNavigationPreference(0, null); } else { finish(); } } } }
[ "private", "void", "adaptNavigationVisibility", "(", ")", "{", "if", "(", "isSplitScreen", "(", ")", ")", "{", "if", "(", "navigationFragmentContainer", "!=", "null", "&&", "cardView", "!=", "null", "&&", "toolbarLarge", "!=", "null", ")", "{", "navigationFragmentContainer", ".", "setVisibility", "(", "isNavigationHidden", "(", ")", "?", "View", ".", "GONE", ":", "View", ".", "VISIBLE", ")", ";", "toolbarLarge", ".", "hideNavigation", "(", "isNavigationHidden", "(", ")", ")", ";", "int", "preferenceScreenHorizontalMargin", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "card_view_horizontal_margin", ")", ";", "int", "preferenceScreenMarginRight", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "card_view_margin_right", ")", ";", "int", "cardViewIntrinsicMargin", "=", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "card_view_intrinsic_margin", ")", ";", "FrameLayout", ".", "LayoutParams", "cardViewLayoutParams", "=", "(", "FrameLayout", ".", "LayoutParams", ")", "cardView", ".", "getLayoutParams", "(", ")", ";", "cardViewLayoutParams", ".", "gravity", "=", "isNavigationHidden", "(", ")", "?", "Gravity", ".", "CENTER_HORIZONTAL", ":", "Gravity", ".", "NO_GRAVITY", ";", "int", "marginStart", "=", "(", "isNavigationHidden", "(", ")", "?", "preferenceScreenHorizontalMargin", ":", "navigationWidth", ")", "-", "cardViewIntrinsicMargin", ";", "int", "marginEnd", "=", "(", "isNavigationHidden", "(", ")", "?", "preferenceScreenHorizontalMargin", ":", "preferenceScreenMarginRight", ")", "-", "cardViewIntrinsicMargin", ";", "setMarginStart", "(", "cardViewLayoutParams", ",", "marginStart", ")", ";", "setMarginEnd", "(", "cardViewLayoutParams", ",", "marginEnd", ")", ";", "}", "}", "else", "{", "if", "(", "getSelectedNavigationPreference", "(", ")", "!=", "null", ")", "{", "if", "(", "isNavigationHidden", "(", ")", ")", "{", "hideToolbarNavigationIcon", "(", ")", ";", "}", "else", "{", "showToolbarNavigationIcon", "(", ")", ";", "}", "}", "else", "if", "(", "isNavigationHidden", "(", ")", "&&", "navigationFragment", "!=", "null", "&&", "navigationFragment", ".", "getCallback", "(", ")", "==", "null", ")", "{", "if", "(", "navigationFragment", ".", "getNavigationPreferenceCount", "(", ")", ">", "0", ")", "{", "navigationFragment", ".", "selectNavigationPreference", "(", "0", ",", "null", ")", ";", "}", "else", "{", "finish", "(", ")", ";", "}", "}", "}", "}" ]
Adapts the visibility of the navigation.
[ "Adapts", "the", "visibility", "of", "the", "navigation", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1362-L1401
4,776
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptButtonBarVisibility
private void adaptButtonBarVisibility() { if (buttonBar != null && buttonBarShadowView != null) { buttonBar.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE); buttonBarShadowView.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE); if (isButtonBarShown() && !isSplitScreen()) { adaptNavigationVisibility(); } adaptNavigationEnabledState(); adaptWizardButtonVisibilities(); } }
java
private void adaptButtonBarVisibility() { if (buttonBar != null && buttonBarShadowView != null) { buttonBar.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE); buttonBarShadowView.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE); if (isButtonBarShown() && !isSplitScreen()) { adaptNavigationVisibility(); } adaptNavigationEnabledState(); adaptWizardButtonVisibilities(); } }
[ "private", "void", "adaptButtonBarVisibility", "(", ")", "{", "if", "(", "buttonBar", "!=", "null", "&&", "buttonBarShadowView", "!=", "null", ")", "{", "buttonBar", ".", "setVisibility", "(", "isButtonBarShown", "(", ")", "?", "View", ".", "VISIBLE", ":", "View", ".", "GONE", ")", ";", "buttonBarShadowView", ".", "setVisibility", "(", "isButtonBarShown", "(", ")", "?", "View", ".", "VISIBLE", ":", "View", ".", "GONE", ")", ";", "if", "(", "isButtonBarShown", "(", ")", "&&", "!", "isSplitScreen", "(", ")", ")", "{", "adaptNavigationVisibility", "(", ")", ";", "}", "adaptNavigationEnabledState", "(", ")", ";", "adaptWizardButtonVisibilities", "(", ")", ";", "}", "}" ]
Adapts the visibility of the button bar, which is shown, when the activity is used as a wizard.
[ "Adapts", "the", "visibility", "of", "the", "button", "bar", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1407-L1419
4,777
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptWizardButtonVisibilities
private void adaptWizardButtonVisibilities() { if (buttonBar != null && backButton != null && nextButton != null && finishButton != null && navigationFragment != null) { int selectedNavigationPreferenceIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (selectedNavigationPreferenceIndex != -1 && isButtonBarShown()) { int navigationPreferenceCount = navigationFragment.getNavigationPreferenceCount(); backButton.setVisibility( (selectedNavigationPreferenceIndex != 0) ? View.VISIBLE : View.GONE); nextButton.setVisibility( (selectedNavigationPreferenceIndex != navigationPreferenceCount - 1) ? View.VISIBLE : View.GONE); finishButton.setVisibility( (selectedNavigationPreferenceIndex == navigationPreferenceCount - 1) ? View.VISIBLE : View.GONE); } else if (isButtonBarShown()) { backButton.setVisibility(View.GONE); nextButton.setVisibility(View.GONE); finishButton.setVisibility(View.VISIBLE); } } }
java
private void adaptWizardButtonVisibilities() { if (buttonBar != null && backButton != null && nextButton != null && finishButton != null && navigationFragment != null) { int selectedNavigationPreferenceIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (selectedNavigationPreferenceIndex != -1 && isButtonBarShown()) { int navigationPreferenceCount = navigationFragment.getNavigationPreferenceCount(); backButton.setVisibility( (selectedNavigationPreferenceIndex != 0) ? View.VISIBLE : View.GONE); nextButton.setVisibility( (selectedNavigationPreferenceIndex != navigationPreferenceCount - 1) ? View.VISIBLE : View.GONE); finishButton.setVisibility( (selectedNavigationPreferenceIndex == navigationPreferenceCount - 1) ? View.VISIBLE : View.GONE); } else if (isButtonBarShown()) { backButton.setVisibility(View.GONE); nextButton.setVisibility(View.GONE); finishButton.setVisibility(View.VISIBLE); } } }
[ "private", "void", "adaptWizardButtonVisibilities", "(", ")", "{", "if", "(", "buttonBar", "!=", "null", "&&", "backButton", "!=", "null", "&&", "nextButton", "!=", "null", "&&", "finishButton", "!=", "null", "&&", "navigationFragment", "!=", "null", ")", "{", "int", "selectedNavigationPreferenceIndex", "=", "navigationFragment", ".", "getSelectedNavigationPreferenceIndex", "(", ")", ";", "if", "(", "selectedNavigationPreferenceIndex", "!=", "-", "1", "&&", "isButtonBarShown", "(", ")", ")", "{", "int", "navigationPreferenceCount", "=", "navigationFragment", ".", "getNavigationPreferenceCount", "(", ")", ";", "backButton", ".", "setVisibility", "(", "(", "selectedNavigationPreferenceIndex", "!=", "0", ")", "?", "View", ".", "VISIBLE", ":", "View", ".", "GONE", ")", ";", "nextButton", ".", "setVisibility", "(", "(", "selectedNavigationPreferenceIndex", "!=", "navigationPreferenceCount", "-", "1", ")", "?", "View", ".", "VISIBLE", ":", "View", ".", "GONE", ")", ";", "finishButton", ".", "setVisibility", "(", "(", "selectedNavigationPreferenceIndex", "==", "navigationPreferenceCount", "-", "1", ")", "?", "View", ".", "VISIBLE", ":", "View", ".", "GONE", ")", ";", "}", "else", "if", "(", "isButtonBarShown", "(", ")", ")", "{", "backButton", ".", "setVisibility", "(", "View", ".", "GONE", ")", ";", "nextButton", ".", "setVisibility", "(", "View", ".", "GONE", ")", ";", "finishButton", ".", "setVisibility", "(", "View", ".", "VISIBLE", ")", ";", "}", "}", "}" ]
Adapts the visibilities of the buttons of the button bar which is shown, when the activity is used as a wizard, depending on the currently selected navigation preference.
[ "Adapts", "the", "visibilities", "of", "the", "buttons", "of", "the", "button", "bar", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "depending", "on", "the", "currently", "selected", "navigation", "preference", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1425-L1447
4,778
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptBreadCrumbVisibility
private void adaptBreadCrumbVisibility(@Nullable final Bundle arguments) { if (arguments != null && arguments.containsKey(EXTRA_NO_BREAD_CRUMBS)) { boolean hideBreadCrumb = arguments.getBoolean(EXTRA_NO_BREAD_CRUMBS, false); adaptBreadCrumbVisibility(hideBreadCrumb); } else { adaptBreadCrumbVisibility(); } }
java
private void adaptBreadCrumbVisibility(@Nullable final Bundle arguments) { if (arguments != null && arguments.containsKey(EXTRA_NO_BREAD_CRUMBS)) { boolean hideBreadCrumb = arguments.getBoolean(EXTRA_NO_BREAD_CRUMBS, false); adaptBreadCrumbVisibility(hideBreadCrumb); } else { adaptBreadCrumbVisibility(); } }
[ "private", "void", "adaptBreadCrumbVisibility", "(", "@", "Nullable", "final", "Bundle", "arguments", ")", "{", "if", "(", "arguments", "!=", "null", "&&", "arguments", ".", "containsKey", "(", "EXTRA_NO_BREAD_CRUMBS", ")", ")", "{", "boolean", "hideBreadCrumb", "=", "arguments", ".", "getBoolean", "(", "EXTRA_NO_BREAD_CRUMBS", ",", "false", ")", ";", "adaptBreadCrumbVisibility", "(", "hideBreadCrumb", ")", ";", "}", "else", "{", "adaptBreadCrumbVisibility", "(", ")", ";", "}", "}" ]
Adapts the visibility of the toolbar, which is used to show the breadcrumb of the currently selected navigation preference, depending on the arguments of the currently selected navigation preference. @param arguments The arguments of the currently selected navigation preference as an instance of the class {@link Bundle} or null, if the navigation preference has no arguments
[ "Adapts", "the", "visibility", "of", "the", "toolbar", "which", "is", "used", "to", "show", "the", "breadcrumb", "of", "the", "currently", "selected", "navigation", "preference", "depending", "on", "the", "arguments", "of", "the", "currently", "selected", "navigation", "preference", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1496-L1503
4,779
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptBreadCrumbVisibility
private void adaptBreadCrumbVisibility(final boolean hideBreadCrumb) { if (isSplitScreen()) { if (breadCrumbToolbar != null && breadCrumbShadowView != null) { breadCrumbToolbar.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); breadCrumbShadowView.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); } } else { if (toolbar != null && toolbarShadowView != null) { toolbar.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); toolbarShadowView.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); } } }
java
private void adaptBreadCrumbVisibility(final boolean hideBreadCrumb) { if (isSplitScreen()) { if (breadCrumbToolbar != null && breadCrumbShadowView != null) { breadCrumbToolbar.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); breadCrumbShadowView.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); } } else { if (toolbar != null && toolbarShadowView != null) { toolbar.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); toolbarShadowView.setVisibility(hideBreadCrumb ? View.GONE : View.VISIBLE); } } }
[ "private", "void", "adaptBreadCrumbVisibility", "(", "final", "boolean", "hideBreadCrumb", ")", "{", "if", "(", "isSplitScreen", "(", ")", ")", "{", "if", "(", "breadCrumbToolbar", "!=", "null", "&&", "breadCrumbShadowView", "!=", "null", ")", "{", "breadCrumbToolbar", ".", "setVisibility", "(", "hideBreadCrumb", "?", "View", ".", "GONE", ":", "View", ".", "VISIBLE", ")", ";", "breadCrumbShadowView", ".", "setVisibility", "(", "hideBreadCrumb", "?", "View", ".", "GONE", ":", "View", ".", "VISIBLE", ")", ";", "}", "}", "else", "{", "if", "(", "toolbar", "!=", "null", "&&", "toolbarShadowView", "!=", "null", ")", "{", "toolbar", ".", "setVisibility", "(", "hideBreadCrumb", "?", "View", ".", "GONE", ":", "View", ".", "VISIBLE", ")", ";", "toolbarShadowView", ".", "setVisibility", "(", "hideBreadCrumb", "?", "View", ".", "GONE", ":", "View", ".", "VISIBLE", ")", ";", "}", "}", "}" ]
Adapts the visibility of the toolbar, which is used to show the breadcrumb of the currently selected navigation preference. @param hideBreadCrumb True, if the toolbar, which is used to show the bread crumb of the currently selected navigation preference, should be hidden, false otherwise
[ "Adapts", "the", "visibility", "of", "the", "toolbar", "which", "is", "used", "to", "show", "the", "breadcrumb", "of", "the", "currently", "selected", "navigation", "preference", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1521-L1533
4,780
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.adaptBreadCrumbBackgroundColor
private void adaptBreadCrumbBackgroundColor() { if (breadCrumbToolbar != null) { GradientDrawable background = (GradientDrawable) ContextCompat .getDrawable(this, R.drawable.breadcrumb_background); background.setColor(breadCrumbBackgroundColor); ViewUtil.setBackground(getBreadCrumbToolbar(), background); } }
java
private void adaptBreadCrumbBackgroundColor() { if (breadCrumbToolbar != null) { GradientDrawable background = (GradientDrawable) ContextCompat .getDrawable(this, R.drawable.breadcrumb_background); background.setColor(breadCrumbBackgroundColor); ViewUtil.setBackground(getBreadCrumbToolbar(), background); } }
[ "private", "void", "adaptBreadCrumbBackgroundColor", "(", ")", "{", "if", "(", "breadCrumbToolbar", "!=", "null", ")", "{", "GradientDrawable", "background", "=", "(", "GradientDrawable", ")", "ContextCompat", ".", "getDrawable", "(", "this", ",", "R", ".", "drawable", ".", "breadcrumb_background", ")", ";", "background", ".", "setColor", "(", "breadCrumbBackgroundColor", ")", ";", "ViewUtil", ".", "setBackground", "(", "getBreadCrumbToolbar", "(", ")", ",", "background", ")", ";", "}", "}" ]
Adapts the background color of the toolbar, which is used to show the bread crumb of the currently selected navigation preferences, when using the split screen layout.
[ "Adapts", "the", "background", "color", "of", "the", "toolbar", "which", "is", "used", "to", "show", "the", "bread", "crumb", "of", "the", "currently", "selected", "navigation", "preferences", "when", "using", "the", "split", "screen", "layout", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1587-L1594
4,781
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.createNextButtonListener
@NonNull private View.OnClickListener createNextButtonListener() { return new View.OnClickListener() { @Override public void onClick(final View v) { if (navigationFragment != null) { int currentIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (currentIndex < navigationFragment.getNavigationPreferenceCount() - 1) { Bundle params = notifyOnNextStep(); if (params != null) { navigationFragment.selectNavigationPreference(currentIndex + 1, params); } } } } }; }
java
@NonNull private View.OnClickListener createNextButtonListener() { return new View.OnClickListener() { @Override public void onClick(final View v) { if (navigationFragment != null) { int currentIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (currentIndex < navigationFragment.getNavigationPreferenceCount() - 1) { Bundle params = notifyOnNextStep(); if (params != null) { navigationFragment.selectNavigationPreference(currentIndex + 1, params); } } } } }; }
[ "@", "NonNull", "private", "View", ".", "OnClickListener", "createNextButtonListener", "(", ")", "{", "return", "new", "View", ".", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "View", "v", ")", "{", "if", "(", "navigationFragment", "!=", "null", ")", "{", "int", "currentIndex", "=", "navigationFragment", ".", "getSelectedNavigationPreferenceIndex", "(", ")", ";", "if", "(", "currentIndex", "<", "navigationFragment", ".", "getNavigationPreferenceCount", "(", ")", "-", "1", ")", "{", "Bundle", "params", "=", "notifyOnNextStep", "(", ")", ";", "if", "(", "params", "!=", "null", ")", "{", "navigationFragment", ".", "selectNavigationPreference", "(", "currentIndex", "+", "1", ",", "params", ")", ";", "}", "}", "}", "}", "}", ";", "}" ]
Returns a listener, which allows to proceed to the next step, when the activity is used as a wizard. @return The listener, which has been created, as an instance of the type {@link View.OnClickListener}. The listener may not be null
[ "Returns", "a", "listener", "which", "allows", "to", "proceed", "to", "the", "next", "step", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1648-L1668
4,782
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.createBackButtonListener
@NonNull private View.OnClickListener createBackButtonListener() { return new View.OnClickListener() { @Override public void onClick(final View v) { if (navigationFragment != null) { int currentIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (currentIndex > 0) { Bundle params = notifyOnPreviousStep(); if (params != null) { navigationFragment.selectNavigationPreference(currentIndex - 1, params); } } } } }; }
java
@NonNull private View.OnClickListener createBackButtonListener() { return new View.OnClickListener() { @Override public void onClick(final View v) { if (navigationFragment != null) { int currentIndex = navigationFragment.getSelectedNavigationPreferenceIndex(); if (currentIndex > 0) { Bundle params = notifyOnPreviousStep(); if (params != null) { navigationFragment.selectNavigationPreference(currentIndex - 1, params); } } } } }; }
[ "@", "NonNull", "private", "View", ".", "OnClickListener", "createBackButtonListener", "(", ")", "{", "return", "new", "View", ".", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "View", "v", ")", "{", "if", "(", "navigationFragment", "!=", "null", ")", "{", "int", "currentIndex", "=", "navigationFragment", ".", "getSelectedNavigationPreferenceIndex", "(", ")", ";", "if", "(", "currentIndex", ">", "0", ")", "{", "Bundle", "params", "=", "notifyOnPreviousStep", "(", ")", ";", "if", "(", "params", "!=", "null", ")", "{", "navigationFragment", ".", "selectNavigationPreference", "(", "currentIndex", "-", "1", ",", "params", ")", ";", "}", "}", "}", "}", "}", ";", "}" ]
Returns a listener, which allows to resume to the previous step, when the activity is used as a wizard. @return The listener, which has been created, as an instance of the type {@link View.OnClickListener}. The listener may not be null
[ "Returns", "a", "listener", "which", "allows", "to", "resume", "to", "the", "previous", "step", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1677-L1697
4,783
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.createFinishButtonListener
@NonNull private View.OnClickListener createFinishButtonListener() { return new View.OnClickListener() { @Override public void onClick(final View v) { notifyOnFinish(); } }; }
java
@NonNull private View.OnClickListener createFinishButtonListener() { return new View.OnClickListener() { @Override public void onClick(final View v) { notifyOnFinish(); } }; }
[ "@", "NonNull", "private", "View", ".", "OnClickListener", "createFinishButtonListener", "(", ")", "{", "return", "new", "View", ".", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "View", "v", ")", "{", "notifyOnFinish", "(", ")", ";", "}", "}", ";", "}" ]
Returns a listener, which allows to finish the last step, when the activity is used as a wizard. @return The listener, which has been created, as an instance of the type {@link View.OnClickListener}. The listener may not be null
[ "Returns", "a", "listener", "which", "allows", "to", "finish", "the", "last", "step", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1706-L1716
4,784
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnPreferenceFragmentShown
private void notifyOnPreferenceFragmentShown( @NonNull final NavigationPreference navigationPreference, @NonNull final Fragment fragment) { for (PreferenceFragmentListener listener : preferenceFragmentListeners) { listener.onPreferenceFragmentShown(navigationPreference, fragment); } }
java
private void notifyOnPreferenceFragmentShown( @NonNull final NavigationPreference navigationPreference, @NonNull final Fragment fragment) { for (PreferenceFragmentListener listener : preferenceFragmentListeners) { listener.onPreferenceFragmentShown(navigationPreference, fragment); } }
[ "private", "void", "notifyOnPreferenceFragmentShown", "(", "@", "NonNull", "final", "NavigationPreference", "navigationPreference", ",", "@", "NonNull", "final", "Fragment", "fragment", ")", "{", "for", "(", "PreferenceFragmentListener", "listener", ":", "preferenceFragmentListeners", ")", "{", "listener", ".", "onPreferenceFragmentShown", "(", "navigationPreference", ",", "fragment", ")", ";", "}", "}" ]
Notifies all registered listeners that a preference fragment has been shown. @param navigationPreference The navigation preference, the fragment, which has been shown, is associated with, as an instance of the class {@link NavigationPreference}. The navigation preference may not be null @param fragment The fragment, which has been shown, as an instance of the class Fragment. The fragment may not be null
[ "Notifies", "all", "registered", "listeners", "that", "a", "preference", "fragment", "has", "been", "shown", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1729-L1735
4,785
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnPreferenceFragmentHidden
private void notifyOnPreferenceFragmentHidden(@NonNull final Fragment fragment) { for (PreferenceFragmentListener listener : preferenceFragmentListeners) { listener.onPreferenceFragmentHidden(fragment); } }
java
private void notifyOnPreferenceFragmentHidden(@NonNull final Fragment fragment) { for (PreferenceFragmentListener listener : preferenceFragmentListeners) { listener.onPreferenceFragmentHidden(fragment); } }
[ "private", "void", "notifyOnPreferenceFragmentHidden", "(", "@", "NonNull", "final", "Fragment", "fragment", ")", "{", "for", "(", "PreferenceFragmentListener", "listener", ":", "preferenceFragmentListeners", ")", "{", "listener", ".", "onPreferenceFragmentHidden", "(", "fragment", ")", ";", "}", "}" ]
Notifies all registered listeners that a preference fragment has been hidden. @param fragment The fragment, which has been hidden, as an instance of the class Fragment. The fragment may not be null
[ "Notifies", "all", "registered", "listeners", "that", "a", "preference", "fragment", "has", "been", "hidden", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1744-L1748
4,786
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnNextStep
private Bundle notifyOnNextStep() { Bundle result = null; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { Bundle bundle = listener.onNextStep(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); if (bundle != null) { if (result == null) { result = new Bundle(); } result.putAll(bundle); } } } return result; }
java
private Bundle notifyOnNextStep() { Bundle result = null; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { Bundle bundle = listener.onNextStep(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); if (bundle != null) { if (result == null) { result = new Bundle(); } result.putAll(bundle); } } } return result; }
[ "private", "Bundle", "notifyOnNextStep", "(", ")", "{", "Bundle", "result", "=", "null", ";", "NavigationPreference", "selectedNavigationPreference", "=", "navigationFragment", ".", "getSelectedNavigationPreference", "(", ")", ";", "if", "(", "selectedNavigationPreference", "!=", "null", "&&", "preferenceFragment", "!=", "null", ")", "{", "for", "(", "WizardListener", "listener", ":", "wizardListeners", ")", "{", "Bundle", "bundle", "=", "listener", ".", "onNextStep", "(", "selectedNavigationPreference", ",", "preferenceFragment", ",", "selectedPreferenceFragmentArguments", ")", ";", "if", "(", "bundle", "!=", "null", ")", "{", "if", "(", "result", "==", "null", ")", "{", "result", "=", "new", "Bundle", "(", ")", ";", "}", "result", ".", "putAll", "(", "bundle", ")", ";", "}", "}", "}", "return", "result", ";", "}" ]
Notifies all registered listeners, that the user wants to navigate to the next step of the wizard. @return A bundle, which may contain key-value pairs, which have been acquired in the wizard, if navigating to the next step of the wizard should be allowed, as an instance of the class {@link Bundle}, null otherwise
[ "Notifies", "all", "registered", "listeners", "that", "the", "user", "wants", "to", "navigate", "to", "the", "next", "step", "of", "the", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1758-L1780
4,787
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnPreviousStep
private Bundle notifyOnPreviousStep() { Bundle result = null; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { Bundle bundle = listener.onPreviousStep(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); if (bundle != null) { if (result == null) { result = new Bundle(); } result.putAll(bundle); } } } return result; }
java
private Bundle notifyOnPreviousStep() { Bundle result = null; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { Bundle bundle = listener.onPreviousStep(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); if (bundle != null) { if (result == null) { result = new Bundle(); } result.putAll(bundle); } } } return result; }
[ "private", "Bundle", "notifyOnPreviousStep", "(", ")", "{", "Bundle", "result", "=", "null", ";", "NavigationPreference", "selectedNavigationPreference", "=", "navigationFragment", ".", "getSelectedNavigationPreference", "(", ")", ";", "if", "(", "selectedNavigationPreference", "!=", "null", "&&", "preferenceFragment", "!=", "null", ")", "{", "for", "(", "WizardListener", "listener", ":", "wizardListeners", ")", "{", "Bundle", "bundle", "=", "listener", ".", "onPreviousStep", "(", "selectedNavigationPreference", ",", "preferenceFragment", ",", "selectedPreferenceFragmentArguments", ")", ";", "if", "(", "bundle", "!=", "null", ")", "{", "if", "(", "result", "==", "null", ")", "{", "result", "=", "new", "Bundle", "(", ")", ";", "}", "result", ".", "putAll", "(", "bundle", ")", ";", "}", "}", "}", "return", "result", ";", "}" ]
Notifies all registered listeners that the user wants to navigate to the previous step of the wizard. @return A bundle, which may contain key-value pairs, which have been acquired in the wizard, if navigating to the previous step of the wizard should be allowed, as an instance of the class {@link Bundle}, null otherwise
[ "Notifies", "all", "registered", "listeners", "that", "the", "user", "wants", "to", "navigate", "to", "the", "previous", "step", "of", "the", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1790-L1812
4,788
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnFinish
private boolean notifyOnFinish() { boolean result = true; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { result &= listener.onFinish(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); } } return result; }
java
private boolean notifyOnFinish() { boolean result = true; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { result &= listener.onFinish(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); } } return result; }
[ "private", "boolean", "notifyOnFinish", "(", ")", "{", "boolean", "result", "=", "true", ";", "NavigationPreference", "selectedNavigationPreference", "=", "navigationFragment", ".", "getSelectedNavigationPreference", "(", ")", ";", "if", "(", "selectedNavigationPreference", "!=", "null", "&&", "preferenceFragment", "!=", "null", ")", "{", "for", "(", "WizardListener", "listener", ":", "wizardListeners", ")", "{", "result", "&=", "listener", ".", "onFinish", "(", "selectedNavigationPreference", ",", "preferenceFragment", ",", "selectedPreferenceFragmentArguments", ")", ";", "}", "}", "return", "result", ";", "}" ]
Notifies all registered listeners that the user wants to finish the last step of the wizard. @return True, if finishing the wizard should be allowed, false otherwise
[ "Notifies", "all", "registered", "listeners", "that", "the", "user", "wants", "to", "finish", "the", "last", "step", "of", "the", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1819-L1832
4,789
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnSkip
private boolean notifyOnSkip() { boolean result = true; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { result &= listener.onSkip(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); } } return result; }
java
private boolean notifyOnSkip() { boolean result = true; NavigationPreference selectedNavigationPreference = navigationFragment.getSelectedNavigationPreference(); if (selectedNavigationPreference != null && preferenceFragment != null) { for (WizardListener listener : wizardListeners) { result &= listener.onSkip(selectedNavigationPreference, preferenceFragment, selectedPreferenceFragmentArguments); } } return result; }
[ "private", "boolean", "notifyOnSkip", "(", ")", "{", "boolean", "result", "=", "true", ";", "NavigationPreference", "selectedNavigationPreference", "=", "navigationFragment", ".", "getSelectedNavigationPreference", "(", ")", ";", "if", "(", "selectedNavigationPreference", "!=", "null", "&&", "preferenceFragment", "!=", "null", ")", "{", "for", "(", "WizardListener", "listener", ":", "wizardListeners", ")", "{", "result", "&=", "listener", ".", "onSkip", "(", "selectedNavigationPreference", ",", "preferenceFragment", ",", "selectedPreferenceFragmentArguments", ")", ";", "}", "}", "return", "result", ";", "}" ]
Notifies all registered listeners that the user wants to skip the wizard. @return True, if skipping the wizard should be allowed, false otherwise
[ "Notifies", "all", "registered", "listeners", "that", "the", "user", "wants", "to", "skip", "the", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1839-L1852
4,790
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnNavigationPreferenceAdded
private void notifyOnNavigationPreferenceAdded( @NonNull final NavigationPreference navigationPreference) { for (NavigationListener listener : navigationListeners) { listener.onNavigationPreferenceAdded(navigationPreference); } }
java
private void notifyOnNavigationPreferenceAdded( @NonNull final NavigationPreference navigationPreference) { for (NavigationListener listener : navigationListeners) { listener.onNavigationPreferenceAdded(navigationPreference); } }
[ "private", "void", "notifyOnNavigationPreferenceAdded", "(", "@", "NonNull", "final", "NavigationPreference", "navigationPreference", ")", "{", "for", "(", "NavigationListener", "listener", ":", "navigationListeners", ")", "{", "listener", ".", "onNavigationPreferenceAdded", "(", "navigationPreference", ")", ";", "}", "}" ]
Notifies all registered listeners, that a navigation preference has been added to the activity. @param navigationPreference The navigation preference, which has been added, as an instance of the class {@link NavigationPreference}. The navigation preference may not be null
[ "Notifies", "all", "registered", "listeners", "that", "a", "navigation", "preference", "has", "been", "added", "to", "the", "activity", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1862-L1867
4,791
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.notifyOnNavigationPreferenceRemoved
private void notifyOnNavigationPreferenceRemoved( @NonNull final NavigationPreference navigationPreference) { for (NavigationListener listener : navigationListeners) { listener.onNavigationPreferenceRemoved(navigationPreference); } }
java
private void notifyOnNavigationPreferenceRemoved( @NonNull final NavigationPreference navigationPreference) { for (NavigationListener listener : navigationListeners) { listener.onNavigationPreferenceRemoved(navigationPreference); } }
[ "private", "void", "notifyOnNavigationPreferenceRemoved", "(", "@", "NonNull", "final", "NavigationPreference", "navigationPreference", ")", "{", "for", "(", "NavigationListener", "listener", ":", "navigationListeners", ")", "{", "listener", ".", "onNavigationPreferenceRemoved", "(", "navigationPreference", ")", ";", "}", "}" ]
Notifies all registered listeners, that a navigation preference has been removed from the activity. @param navigationPreference The navigation preference, which has been removed, as an instance of the class {@link NavigationPreference}. The navigation preference may not be null
[ "Notifies", "all", "registered", "listeners", "that", "a", "navigation", "preference", "has", "been", "removed", "from", "the", "activity", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1877-L1882
4,792
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.addPreferenceFragmentListener
public final void addPreferenceFragmentListener( @NonNull final PreferenceFragmentListener listener) { Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null"); preferenceFragmentListeners.add(listener); }
java
public final void addPreferenceFragmentListener( @NonNull final PreferenceFragmentListener listener) { Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null"); preferenceFragmentListeners.add(listener); }
[ "public", "final", "void", "addPreferenceFragmentListener", "(", "@", "NonNull", "final", "PreferenceFragmentListener", "listener", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "listener", ",", "\"The listener may not be null\"", ")", ";", "preferenceFragmentListeners", ".", "add", "(", "listener", ")", ";", "}" ]
Adds a new listener, which should be notified, when the currently shown preference fragment has been changed, to the activity. @param listener The listener, which should be added, as an instance of the type {@link PreferenceFragmentListener}. The listener may not be null
[ "Adds", "a", "new", "listener", "which", "should", "be", "notified", "when", "the", "currently", "shown", "preference", "fragment", "has", "been", "changed", "to", "the", "activity", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1892-L1896
4,793
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.removePreferenceFragmentListener
public final void removePreferenceFragmentListener( @NonNull final PreferenceFragmentListener listener) { Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null"); preferenceFragmentListeners.remove(listener); }
java
public final void removePreferenceFragmentListener( @NonNull final PreferenceFragmentListener listener) { Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null"); preferenceFragmentListeners.remove(listener); }
[ "public", "final", "void", "removePreferenceFragmentListener", "(", "@", "NonNull", "final", "PreferenceFragmentListener", "listener", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "listener", ",", "\"The listener may not be null\"", ")", ";", "preferenceFragmentListeners", ".", "remove", "(", "listener", ")", ";", "}" ]
Removes a specific listener, which should not be notified, when the currently shown preference fragment has been changed, anymore. @param listener The listener, which should be removed, as an instance of the type {@link PreferenceFragmentListener}. The listener may not be null
[ "Removes", "a", "specific", "listener", "which", "should", "not", "be", "notified", "when", "the", "currently", "shown", "preference", "fragment", "has", "been", "changed", "anymore", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1906-L1910
4,794
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.removeWizardListener
public final void removeWizardListener(@NonNull final WizardListener listener) { Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null"); wizardListeners.remove(listener); }
java
public final void removeWizardListener(@NonNull final WizardListener listener) { Condition.INSTANCE.ensureNotNull(listener, "The listener may not be null"); wizardListeners.remove(listener); }
[ "public", "final", "void", "removeWizardListener", "(", "@", "NonNull", "final", "WizardListener", "listener", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "listener", ",", "\"The listener may not be null\"", ")", ";", "wizardListeners", ".", "remove", "(", "listener", ")", ";", "}" ]
Removes a specific listener, which should not be notified, when the user navigates within the activity, if it is used as a wizard. @param listener The listener, which should be removed, as an instance of the type {@link WizardListener}. The listener may not be null
[ "Removes", "a", "specific", "listener", "which", "should", "not", "be", "notified", "when", "the", "user", "navigates", "within", "the", "activity", "if", "it", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L1933-L1936
4,795
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.setNavigationWidth
public final void setNavigationWidth(@Px final int width) { Condition.INSTANCE.ensureGreater(width, 0, "The width must be greater than 0"); this.navigationWidth = width; adaptNavigationWidth(); }
java
public final void setNavigationWidth(@Px final int width) { Condition.INSTANCE.ensureGreater(width, 0, "The width must be greater than 0"); this.navigationWidth = width; adaptNavigationWidth(); }
[ "public", "final", "void", "setNavigationWidth", "(", "@", "Px", "final", "int", "width", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureGreater", "(", "width", ",", "0", ",", "\"The width must be greater than 0\"", ")", ";", "this", ".", "navigationWidth", "=", "width", ";", "adaptNavigationWidth", "(", ")", ";", "}" ]
Sets the width of the navigation, when using the split screen layout. @param width The width, which should be set, in pixels as an {@link Integer} value. The width must be greater than 0
[ "Sets", "the", "width", "of", "the", "navigation", "when", "using", "the", "split", "screen", "layout", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L2113-L2117
4,796
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.setNextButtonText
public final void setNextButtonText(@NonNull final CharSequence text) { Condition.INSTANCE.ensureNotNull(text, "The text may not be null"); Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty"); this.nextButtonText = text; adaptNextButtonText(); }
java
public final void setNextButtonText(@NonNull final CharSequence text) { Condition.INSTANCE.ensureNotNull(text, "The text may not be null"); Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty"); this.nextButtonText = text; adaptNextButtonText(); }
[ "public", "final", "void", "setNextButtonText", "(", "@", "NonNull", "final", "CharSequence", "text", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "text", ",", "\"The text may not be null\"", ")", ";", "Condition", ".", "INSTANCE", ".", "ensureNotEmpty", "(", "text", ",", "\"The text may not be empty\"", ")", ";", "this", ".", "nextButtonText", "=", "text", ";", "adaptNextButtonText", "(", ")", ";", "}" ]
Sets the text of the next button, which is shown, when the activity is used as a wizard. @param text The text, which should be set, as an instance of the class {@link CharSequence}. The text may neither be null, nor empty
[ "Sets", "the", "text", "of", "the", "next", "button", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L2221-L2226
4,797
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.setBackButtonText
public final void setBackButtonText(@NonNull final CharSequence text) { Condition.INSTANCE.ensureNotNull(text, "The text may not be null"); Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty"); this.backButtonText = text; adaptBackButtonText(); }
java
public final void setBackButtonText(@NonNull final CharSequence text) { Condition.INSTANCE.ensureNotNull(text, "The text may not be null"); Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty"); this.backButtonText = text; adaptBackButtonText(); }
[ "public", "final", "void", "setBackButtonText", "(", "@", "NonNull", "final", "CharSequence", "text", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "text", ",", "\"The text may not be null\"", ")", ";", "Condition", ".", "INSTANCE", ".", "ensureNotEmpty", "(", "text", ",", "\"The text may not be empty\"", ")", ";", "this", ".", "backButtonText", "=", "text", ";", "adaptBackButtonText", "(", ")", ";", "}" ]
Sets the text of the back button, which is shown, when the activity is used as a wizard. @param text The text, which should be set, as an instance of the class {@link CharSequence}. The text may neither null, nor empty
[ "Sets", "the", "text", "of", "the", "back", "button", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L2257-L2262
4,798
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.setFinishButtonText
public final void setFinishButtonText(@NonNull final CharSequence text) { Condition.INSTANCE.ensureNotNull(text, "The text may not be null"); Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty"); this.finishButtonText = text; adaptFinishButtonText(); }
java
public final void setFinishButtonText(@NonNull final CharSequence text) { Condition.INSTANCE.ensureNotNull(text, "The text may not be null"); Condition.INSTANCE.ensureNotEmpty(text, "The text may not be empty"); this.finishButtonText = text; adaptFinishButtonText(); }
[ "public", "final", "void", "setFinishButtonText", "(", "@", "NonNull", "final", "CharSequence", "text", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "text", ",", "\"The text may not be null\"", ")", ";", "Condition", ".", "INSTANCE", ".", "ensureNotEmpty", "(", "text", ",", "\"The text may not be empty\"", ")", ";", "this", ".", "finishButtonText", "=", "text", ";", "adaptFinishButtonText", "(", ")", ";", "}" ]
Sets the text of the next button, which is shown, when the activity is used as a wizard and the last navigation preference is currently selected. @param text The text, which should be set, as an instance of the class {@link CharSequence}. The text may neither be null, nor empty
[ "Sets", "the", "text", "of", "the", "next", "button", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "and", "the", "last", "navigation", "preference", "is", "currently", "selected", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L2296-L2301
4,799
michael-rapp/AndroidPreferenceActivity
library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java
PreferenceActivity.setProgressFormat
public final void setProgressFormat(@NonNull final String progressFormat) { Condition.INSTANCE.ensureNotNull(progressFormat, "The progress format may not be null"); Condition.INSTANCE.ensureNotEmpty(progressFormat, "The progress format may not be empty"); this.progressFormat = progressFormat; adaptProgress(); }
java
public final void setProgressFormat(@NonNull final String progressFormat) { Condition.INSTANCE.ensureNotNull(progressFormat, "The progress format may not be null"); Condition.INSTANCE.ensureNotEmpty(progressFormat, "The progress format may not be empty"); this.progressFormat = progressFormat; adaptProgress(); }
[ "public", "final", "void", "setProgressFormat", "(", "@", "NonNull", "final", "String", "progressFormat", ")", "{", "Condition", ".", "INSTANCE", ".", "ensureNotNull", "(", "progressFormat", ",", "\"The progress format may not be null\"", ")", ";", "Condition", ".", "INSTANCE", ".", "ensureNotEmpty", "(", "progressFormat", ",", "\"The progress format may not be empty\"", ")", ";", "this", ".", "progressFormat", "=", "progressFormat", ";", "adaptProgress", "(", ")", ";", "}" ]
Sets the string, which should be used to format the progress, which is shown, when the activity is used as a wizard. @param progressFormat The string, which should be set, as a {@link String}. The string may neither be null, nor empty. It must be formatted according to the following syntax: "*%d*%d*%s*"
[ "Sets", "the", "string", "which", "should", "be", "used", "to", "format", "the", "progress", "which", "is", "shown", "when", "the", "activity", "is", "used", "as", "a", "wizard", "." ]
0fcde73815b4b3bf6bcb36acd3d5733e301bbba5
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java#L2358-L2363