This repository was archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Prem edited this page Jan 9, 2015
·
3 revisions
####How it works:
//1 A book is the structure that hosts all the data used in playback
Book book = new Book();
//2 An Act is a visual element that draws attention to a feature of the app
Act act = new Act();
act.setGraphicResID(R.drawable.arrow_up);
act.setMessage("Step 1: Click here!!");
act.setAnimation(new UpDownAnimation());
act.setDisplacement(-.5, 1.5);
act.setTextColor(Color.RED);
//3 BaseChapters hold an Act and its duration
BaseChapter chapter = new BaseChapter();
chapter.setAct(act, 4000);
//4 Chapters are added to the Book
book.addChapter(chapter);
//5 A ChapterTransition is a special kind of Act that also has Chapter traits. It holds an action between regular acts such as view clicks or menu item clicks.
ChapterTransition transition = new ChapterTransition();
transition.clickViewWithId("mytextview");
transition.setTime(3000);
transition = new ChapterTransition();
transition.clickMenuItemWithId("action_settings");
//6 read() is the function that sets the playback in motion.
book.read();
//7 RecordingWindow is the main UI window that the user interacts with
RecorderWindow window = (RecorderWindow) LimeLight.createRecordingWindow(LimeLight.getActivity());
//8 Recorder is the system controller that interacts with RecorderWindow and Book to perform tasks
//task of creating a new Book and set as the current working Book
Recorder.startRecording();
//task of creating new ChapterTransition or BaseChapter along with new Act
Recorder.startChapter();
//task of setting current working chapter to selected chapter
Recorder.moveToChapter(Recorder.getCurrentChapter());
//sets up tracking on a Book's playthrough as well as setting RecorderWindow to update along with the playthrough
Recorder.play();
####Features:
If your app uses a NavigateDrawerFragment, you can hook your drawer's functions and items to LimeLight by following the example code in the setUp() method:
LimeLight.setDrawerAutomator(new com.fuzz.android.limelight.automate.DrawerAutomator() {
@Override
public void openDrawer() {
mDrawerLayout.openDrawer(mFragmentContainerView);
}
@Override
public void closeDrawer() {
mDrawerLayout.closeDrawer(mFragmentContainerView);
}
@Override
public boolean isOpen() {
return mDrawerLayout.isDrawerOpen(mFragmentContainerView);
}
@Override
public boolean isClosed() {
return !mDrawerLayout.isDrawerOpen(mFragmentContainerView);
}
@Override
public void clickItem(int position) {
mDrawerListView.performItemClick(mDrawerListView.getAdapter().getView(position, null, null),
position, mDrawerListView.getItemIdAtPosition(position));
}
});
LimeLight.setDrawerList(mDrawerListView);LimeLight requires tags be used for fragments. Just add this simple call whenever you are attributing tags to fragments.
LimeLight.addFragmentTag(tag);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.container, exampleFragment, "example");
LimeLight.addFragmentTag("example");
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
transaction.commit();