/FragmentOrientedApplication

A demo application to demonstrate basic Single Activity Architecture

Primary LanguageJava

Fragment Oriented Application

A blueprint application to demonstrate the use of Fragments and few related concepts and techniques.

Application Structure

This application has following notable components:

  • Home - This is the only activity, hosts a navigation drawer, which is the global UI for the app, and a FrameLayout that hosts fragments. Integrates facebook session. Implements HomeInterface.
  • HomeInterface - This is a clubbed interface that extends all the interfaces that needs to be implemented in Home by various fragments (related to inter-fragment communication).
  • BaseFragment -Its an abstract base class for all the fragments. This class does a lot of backing jobs, like provisioning for back press handling.
  • DrawerItemBaseFragment -Its an abstract base class for all drawer fragments. It extends BaseFragment. Fragments extending this would correspond to a section in Navigation Drawer.
In Home, we always have a reference to currently visible fragment and current drawer fragment, which is being revised respectively from these two abstract classes. Following references do this:
BaseFragment selectedFragment;
DrawerItemBaseFragment selectedDrawerItemFragment;