public class Scoop
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Scoop.Builder
Initialization Builder
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(android.app.Activity activity)
Apply the current
Flavor to the given activity based on the user's selected preference. |
void |
apply(android.content.Context context,
android.view.Menu menu)
Apply the attributed menu item tint to all the icons if the attribute
R.attr#toolbarItemTint |
void |
applyDialog(android.app.Activity activity)
Apply the current
Flavors Dialog theme to the activity to give it a Dialog like
appearance based on the user selected preference |
void |
bind(android.app.Activity activity)
Bind all the annotated elements to a given activity
|
Scoop |
bind(java.lang.Object obj,
int toppingId,
IBinding binding)
Provide a custom binding to a certain topping id on a given object.
|
Scoop |
bind(java.lang.Object obj,
int toppingId,
android.view.View view)
Bind a view to a topping on a given object
|
Scoop |
bind(java.lang.Object obj,
int toppingId,
android.view.View view,
ColorAdapter colorAdapter)
Bind a view to a topping on a given object with a specified color adapter
|
Scoop |
bind(java.lang.Object obj,
int toppingId,
android.view.View view,
ColorAdapter colorAdapter,
android.view.animation.Interpolator interpolator)
Bind a view to a topping on a given object with a specified color adapter and change animation
interpolator
|
Scoop |
bindStatusBar(android.app.Activity activity,
int toppingId)
Bind the status bar of an activity to a topping so that it's color is updated when the
user/developer updates the color for that topping id
|
Scoop |
bindStatusBar(android.app.Activity activity,
int toppingId,
android.view.animation.Interpolator interpolator)
Bind the status bar of an activity to a topping so that it's color is updated when the
user/developer updates the color for that topping id and animation it's color change using
the provided interpolator
|
void |
choose(Flavor item)
Choose a given flavor
|
void |
chooseDayNightMode(int mode)
Choose the DayNight mode you want to use for selected day/night mode themes
|
Flavor |
getCurrentFlavor()
Get the current flavor to apply
|
int |
getDayNightMode()
Get the selected day night mode to use with certain themes
|
java.util.List<Flavor> |
getFlavors()
Get the list of available flavors that you can scoop from
|
static Scoop |
getInstance() |
static void |
setDebug(boolean flag)
Enable debug logging
|
static SugarCone |
sugarCone()
Deprecated.
Please just use the
getInstance() method of Scoop to access
the bind methods |
void |
unbind(java.lang.Object obj)
Unbind all bindings on a certain class
|
Scoop |
update(int toppingId,
int color)
Update a topping, i.e.
|
static Scoop.Builder |
waffleCone()
Create a builder instance for this class to initialize the library
|
public static Scoop getInstance()
public static Scoop.Builder waffleCone()
@Deprecated public static SugarCone sugarCone()
getInstance() method of Scoop to access
the bind methodspublic static void setDebug(boolean flag)
public int getDayNightMode()
public java.util.List<Flavor> getFlavors()
public Flavor getCurrentFlavor()
public void apply(android.app.Activity activity)
Flavor to the given activity based on the user's selected preference.activity - the activity to apply the selected theme configuration topublic void applyDialog(android.app.Activity activity)
Flavors Dialog theme to the activity to give it a Dialog like
appearance based on the user selected preferenceactivity - the activity to apply the dialog theme topublic void apply(android.content.Context context,
android.view.Menu menu)
R.attr#toolbarItemTintcontext - the application context to derive the attr color frommenu - the menu to apply topublic void choose(Flavor item)
item - the flavor to scooppublic void chooseDayNightMode(int mode)
mode - the daynight mode you wish to usepublic void bind(android.app.Activity activity)
activity - the activity to bind toBindTopping,
BindToppingStatuspublic Scoop bind(java.lang.Object obj, int toppingId, android.view.View view)
obj - the class the view belongs totoppingId - the id of the topping to bind toview - the view to bindpublic Scoop bind(java.lang.Object obj, int toppingId, android.view.View view, ColorAdapter colorAdapter)
obj - the classs the view belongs totoppingId - the id of the toppingview - the view to bindcolorAdapter - the color adapter to bind withpublic Scoop bind(java.lang.Object obj, int toppingId, android.view.View view, ColorAdapter colorAdapter, android.view.animation.Interpolator interpolator)
obj - the class the view belongs totoppingId - the id of the toppingview - the view to bindcolorAdapter - the color adapter to bind withinterpolator - the interpolator to use when switching colorspublic Scoop bindStatusBar(android.app.Activity activity, int toppingId)
activity - the activity whoes status bar to bind totoppingId - the id of the topping to bind withpublic Scoop bindStatusBar(android.app.Activity activity, int toppingId, android.view.animation.Interpolator interpolator)
activity - the activity whoes status bar to bind totoppingId - the id of the topping to bind withinterpolator - the interpolator that defines how the animation for the color change will runpublic Scoop bind(java.lang.Object obj, int toppingId, IBinding binding)
obj - the object to bind ontoppingId - the topping id to bind tobinding - the binding that defines how your custom properties are updatedpublic void unbind(java.lang.Object obj)
obj - the class/object that you previously made bindings to (i.e. an Activity, or Fragment)public Scoop update(int toppingId, int color)
toppingId - the id of the topping you wish to updatecolor - the updated color to update to