Screenplay


Source link: https://github.com/weefbellington/screenplay

Questions or just want to say hello? Try our Gitter chat!   

Don't forget about the wiki. If you're coming from an older version, check out the CHANGELOG.

===================================================================================== ++++++ SCREENPLAY + A minimalist, View-based application framework for Android ++++++ ===================================================================================== 

####What is it?

Screenplay is a lightweight Android framework for building applications without the need for Fragments or multiple Activities. Its feature set is small by design: Screenplay is only concerned with swapping views on the screen and playing animations between them.

Screenplay provides the following toolkit:

  • the Screenplay object: a controller that automatically attaches and detaches Views from the screen in response to navigation events
  • the Stage interface: defines a screen. Stages can be configured to be full-screen or display above other screens (like a dialog)
  • the Stage.Rigger interface: applies animated transitions to a screen
  • the Stage.Component interface: used to apply behavior to screen on attach/detach events

Several implementations for the Stage, Stage.Rigger and Stage.Component are also provided out-of-the-box:

  • XMLStage: a stage that inflates views from an XML layout file
  • TweenRigger: animates screen transitions from an XML animation files
  • AnimatorRigger: animates screen transitions with an android.animation.Animator
  • InstanceStateComponent: saves view state when a screen is detached and restores it on reattach

Additionally, Screenplay provides plugin support. The current plugins are:

  • Flow plugin: provides a Flow.Dispatcher that allows screenplay to respond to Flow navigation events. See the wiki page for more info.

####Your best friend, the wiki

The main screenplay documentation has moved to the wiki. Start with the table of contents or core features.

####Show me the code!

Want to dive in?

The sample project is probably the easiest place to start. Here you will find a minimally complex Screenplay application which showcases some of its features.

Clicking too hard?

Good news! Here is some sample code you can just scroll through.

public class ExampleStage extends Stage {

private final ExampleApplication application;
  private final Rigger rigger;

public ExampleStage(ExampleApplication application) {

rigger = new CrossfadeRigger(application);

addComponents(new ClickBindingComponent());

  
}

@Override
  public int getLayoutId() {

return R.layout.example_scene;
  
}

@Override
  public Rigger getRigger() {

return rigger;
  
}

private class ClickBindingComponent implements Component {

@Override

public void afterSetUp(Stage stage, boolean isInitializing) {

 View parent = stage.getView();

 View nextButton = parent.findViewById(R.id.next);

 nextButton.setOnClickListener(showNextStage);

}

 @Override

public void beforeTearDown(Stage stage, boolean isFinishing) {

}

 private View.OnClickListener showNextStage = new View.OnClickListener() {

 @Override

 public void onClick(View v) {

  // add a new scene to the history and trigger a transition

  Flow flow = application.getMainFlow();

  flow.set(new NextStage(application));

 
}

}
;
  
}
 
}

####Downloads

Screenplay is available via Maven from the jcenter repo.

#####Main project download

Use Maven to add Screenplay to your project:

<dependency>
  <groupId>com.davidstemmer.screenplay</groupId>
  <artifactId>screenplay</artifactId>
  <version>1.0.2</version> </dependency>

or Gradle:

compile 'com.davidstemmer.screenplay:screenplay:1.0.2'

#####Flow plugin download

The flow-plugin provides a ScreenplayDispatcher that allows you to use Flow to manage the backstack. The version is pegged to the most recent version of Flow. Use maven to add it to your project:

<dependency>
  <groupId>com.davidstemmer.screenplay</groupId>
  <artifactId>flow-plugin</artifactId>
  <version>0.12</version> </dependency>

or Gradle:

compile 'com.davidstemmer.screenplay:flow-plugin:0.12'

####Contributing

Contributions are welcome! Please open an issue in the github issue tracker to discuss bugs and new feature requests. For simple questions, try our live chat on Gitter: https://gitter.im/weefbellington/screenplay.

####Acknowledgements

Many thanks to the team at Square for their support of the open-source community, without which this project wouldn't be possible. Thanks especially to the team at Square for creating Flow, which was the original inspiration for this project.

Thanks to the Android Arsenal to adding Screenplay to their tool library. If you like Screenplay, please feel free to the badge to your site. Ignore this directive if you hate badges.

Resources

Using Digits from source in production applications is not officially supported by Fabric. Please utilize the available binaries.

Android Library for exporting/managing data from the Sensor Manager Library.

Poetry is a persistence library that allows you to persist a JSON object tree (through Jackson) directly into an SQLite database (through OrmLite). Poetry enables you to write less code and persist data much faster.

Open Source framework for building cross-platform truly native iOS, Android and Windows mobile apps using JavaScript.

A demo application for the Poetry library.

Blaubot is a middleware to create small adhoc networks via P2P connections such as Bluetooth-RFCOMM, Adhoc-WiFi or simple socket connections. Blaubot takes care of device discovery and connection establishment with the goal to minimize a developer's boilerplate code to set up these small networks.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes