Search in sources :

Example 1 with TinyCoach

use of com.codemonkeylabs.fpslibrary.ui.TinyCoach in project TinyDancer by friendlyrobotnyc.

the class TinyDancerBuilder method show.

// PUBLIC BUILDER METHODS
/**
     * show fps meter, this regisers the frame callback that
     * collects the fps info and pushes it to the ui
     * @param context
     */
public void show(Context context) {
    if (overlayPermRequest(context)) {
        //once permission is granted then you must call show() again
        return;
    }
    //are we running?  if so, call tinyCoach.show() and return
    if (tinyCoach != null) {
        tinyCoach.show();
        return;
    }
    // set device's frame rate info into the config
    setFrameRate(context);
    // create the presenter that updates the view
    tinyCoach = new TinyCoach((Application) context.getApplicationContext(), fpsConfig);
    // create our choreographer callback and register it
    fpsFrameCallback = new FPSFrameCallback(fpsConfig, tinyCoach);
    Choreographer.getInstance().postFrameCallback(fpsFrameCallback);
    //set activity background/foreground listener
    Foreground.init((Application) context.getApplicationContext()).addListener(foregroundListener);
}
Also used : TinyCoach(com.codemonkeylabs.fpslibrary.ui.TinyCoach) Application(android.app.Application)

Aggregations

Application (android.app.Application)1 TinyCoach (com.codemonkeylabs.fpslibrary.ui.TinyCoach)1