Tweakr
Android Library for Remote Debugging, Autogenerating Settings/Preference UIs, and Wizard-of-Ozing
com.google.tweakr.Tweakr Class Reference

Static Public Member Functions

static synchronized TweakrRepo getRepo ()
 
static synchronized void setRepo (TweakrRepo repo)
 
static void register (Object target)
 
static void register (Object target, String namePrefix)
 
static void addListener (TweakrRepo.OnChangeListener listener)
 
static void removeListener (TweakrRepo.OnChangeListener listener)
 

Detailed Description

The main Tweakr manager.

Whenever you add com.google.tweakr.annotations.Tweak annotations to the members of an object, make sure to call register(Object) in the object's constructor so it can find the annotations and register each annotated member. For some Android objects you may want to call it during onCreate() instead of the constructor, so you can initialize any views or other fields before registering them.

Member Function Documentation

◆ addListener()

static void com.google.tweakr.Tweakr.addListener ( TweakrRepo.OnChangeListener  listener)
static

◆ getRepo()

static synchronized TweakrRepo com.google.tweakr.Tweakr.getRepo ( )
static

Returns the current repo used for this session.

◆ register() [1/2]

static void com.google.tweakr.Tweakr.register ( Object  target)
static

◆ register() [2/2]

static void com.google.tweakr.Tweakr.register ( Object  target,
String  namePrefix 
)
static

Registers all members of target that are annotated with com.google.tweakr.annotations.Tweak.

Any annotated fields with children must be non-null at the time of registration.

Parameters
targetthe object containing members to register.
namePrefixAn optional prefix for each Tweak. Use this if you want to differentiate multiple objects in the UI: instead of changing a value and changing all objects that share that member, you can add a unique namePrefix for each object (or group of objects) so that the changes only affect a subset of the targets.

◆ removeListener()

static void com.google.tweakr.Tweakr.removeListener ( TweakrRepo.OnChangeListener  listener)
static

◆ setRepo()

static synchronized void com.google.tweakr.Tweakr.setRepo ( TweakrRepo  repo)
static

Optionally sets the repo to be used for this session.

You must set this before any other calls to methods in this class (e.g. register(Object)). Best practice is to set it in your Application#onCreate()


The documentation for this class was generated from the following file: