Use conductor instead Gergely Szőke | Wanari

Slides:



Advertisements
Similar presentations
Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dellInformazione Università di Bologna.
Advertisements

Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
COM vs. CORBA.
Fragments: Introduction Fragments were introduced in Android 3.0 to support flexible and dynamic UI designs represent portions of an application’s user.
Android 02: Activities David Meredith
Android Fragments.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
Tutorial 16 Working with Dynamic Content and Styles.
More on User Interface Android Applications. Layouts Linear Layout Relative Layout Table Layout Grid View Tab Layout List View.
Programming with Android: Android Fragments Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
JQuery CS 268. What is jQuery? From their web site:
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
ANDROID UI – FRAGMENTS. Fragment  An activity is a container for views  When you have a larger screen device than a phone –like a tablet it can look.
Managing Changing Requirements: Structure the Use Case Model PowerPoint Presentation derived from IBM/Rational course Mastering Requirements Management.
WaveMaker Visual AJAX Studio 4.0 Training Authentication.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
JQuery Adding behaviour…. Lecture Plan Review of last lesson Adding behaviour –click, mouseover Animation –fade, slideDown Navigation –parent, find, next.
Software Engineering 1 Object-oriented Analysis and Design Chap 29 UML State Machine Diagrams and Modeling.
Polymorphism, Inheritance Pt. 1 COMP 401, Fall 2014 Lecture 7 9/9/2014.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
1 IBM Software Group ® Mastering Requirements Management with Use Cases Module 10: Structure the Use-Case Model.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Create Navigation Drawer Team 2 Zhong Wang Jiaming Dong Philip Wu Lingduo Kong.
Android – Fragments L. Grewe.
Windows Forms Navigating database with windows forms.
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
What to remember from Chap 13 (Logical architecture)
CSCI-383 Object-Oriented Programming & Design Lecture 10.
JavaScript, Fourth Edition Chapter 4 Manipulating the Browser Object Model.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Pearson Webcast Series
The Prototype Pattern (Creational) ©SoftMoore ConsultingSlide 1.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
MVC COMP 401 Fall 2014 Lecture 19 10/30/2014. Classic MVC 2
1 C# - Inheritance and Polymorphism. 2 1.Inheritance 2.Implementing Inheritance in C# 3.Constructor calls in Inheritance 4.Protected Access Modifier 5.The.
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
Class on Fragments & threads. Fragments fragment is a modular section of an activity, which has its own lifecycle, receives its own input events, and.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
Android Fragments. Slide 2 Lecture Overview Getting resources and configuration information Conceptualizing the Back Stack Introduction to fragments.
Modern Programming Tools And Techniques-I
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Activity and Fragment.
Fragments: Introduction
Mobile Application Development BSCS-7 Lecture # 6
Working with Collections of Data
Extensions, System Outline and Correlation Modes and
Mobile Applications (Android Programming)
Java Programming: Guided Learning with Early Objects
Activities and Intents
Widgets & Fragments Kalin Kadiev Astea Solutions AD.
Problems with Linked List (as we’ve seen so far…)
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Chapter 5 Conclusion CIS 61.
XAML User Interface Creation in C#
Introduction to Events
Android – Fragments L. Grewe.
ANDROID UI – FRAGMENTS UNIT II.
JavaScript and Events.
Intelligent Agents Chapter 2.
CS2102: Lecture on Abstract Classes and Inheritance
SAP - CRM. SAP - CRM Course Content Introduction to SAP CRM Basics and Architecture Sap CRM Functional Overview Business Partner Organizational Management.
Object Oriented Analysis and Design
Paul Ammann & Jeff Offutt
Data Communications and Networking
1/10/2019 JavaFX Events COSC 330.
CS 350 – Software Design Singleton – Chapter 21
Using Templates and Library Items
Mobile Programming Dr. Mohsin Ali Memon.
Activities and Fragments
Presentation transcript:

Use conductor instead Gergely Szőke | Wanari Get rid of Fragments Use conductor instead Gergely Szőke | Wanari

Fragments Problems Support or not Transaction is complicated Backstack management is complicated

Conductor can be the solution View-based Provides wrapper around views Works almost the same as Fragments Easier lifecycle It has 4 main parts: Controller Router ControllerChangeHandler ControllerTransaction

Controller The Controller is the View wrapper that will give you all of your lifecycle management features. Think of it as a lighter-weight and more predictable Fragment alternative with an easier to manage lifecycle.

Router A Router implements navigation and backstack handling for Controllers. Router objects are attached to Activity/containing ViewGroup pairs. Routers do not directly render or push Views to the container ViewGroup, but instead defer this responsibility to the ControllerChangeHandler specified in a given transaction. It has several methods to work with the backstack (changehandlers also can added): popToRoot popToTag (RouterTransaction can be tagged) popCurrent setBackStack(!)

ControllerChangeHandler ControllerChangeHandlers are responsible for swapping the View for one Controller to the View of another. They can be useful for performing animations and transitions between Controllers. Several default ControllerChangeHandlers are included. You just have to add push-, and popChangeHandlers to the router

ControllerTransaction Transactions are used to define data about adding Controllers. RouterControllerTransactions are used to push a Controller to a Router with specified ControllerChangeHandlers, while ChildControllerTransactions are used to add child Controllers.

LifeCycle

In action

Activity Works the same as usual You have to create a Router instance providing a container ViewGroup (same as the previous fragmentContainer FrameLayout) Set a root Controller to the router Pass onBackPressed events to the router if it returns false, then leave it to super

Controller You have to implement only the onCreateView method But you have several others like Fragments does Worth to mention: onChangeStarted, onChangeEnded You can handle the the UI during transactions (for example disable, and reenable buttons) You can also handle the optionsMenu from a controller From a controller you can get the activity’s router, to navigate

Nested Controllers Controllers can be nested with ChildRouters It needs a container too There is an optional setting, setPopLastView (default false) If you set it to true, then the child root itself can be popped separately, othervise it pops with the parent controller If you would like to connect two controllers like „onResult” you can setTargetController to the specified controller (the target controller is retained)

About memory things There are two options for controllers, to handle destructive lifecycle events, when to release: ReleaseDetach (default): releases when Detach happens RetainDetach: retains on Detach, but still release on config change Example: If you set on your rootController the RetainDetach mode, then if you navigate back to it, this won’t be recreated

Mosby There is a mosby extension for Conductor, therefore you can use the classic MVP architecture Only one thing to mention, Presenter is instantiated before onAttach, so this is the first place where you can use it

Keep in touch! https://twitter.com/TeamWanari https://www.facebook.com/TeamWanari/

Resources https://github.com/bluelinelabs/Conductor https://github.com/sockeqwe/mosby-conductor