Memory efficient android library for managing individual fragment backstack.

Last update: Feb 6, 2021

fragstack : Android library for managing individual fragment backstack.

Android Arsenal API

An Easy to use library for managing individual fragment back stack as Instagram and Youtube does. Easily pluggable with client code, not much code change needed.

To implement, client needs to implement StackableFragment of com.fragstack.contracts package on all fragments who wants to have their own backstack. Client needs to provide a unique name in getFragmentName() method.

Example :

Download via gradle

Step 1. Add the specific repository to your build file:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

Step 2. Add the dependency in your build file (do not forget to specify the correct qualifier, usually "aar"):

dependencies {
    compile 'com.github.abhishesh-srivastava:fragstack:' + $latest.version
}

Integration with BottomBar

If there are 4 tabs in BottomBar and each tab corresponds to different fragment and want to have individual stacks. Client should implement StackableFragment and provide implementation for getFragmentName() and onFragmentScroll() method.

Initialization inside onCreate() method of activity

mFragmentController = new FragmentController(getSupportFragmentManager(), R.id.frame_container, savedInstanceState, null);

here R.id.frame_container corresponds to id's on which fragments view are added/replaced.

To display a fragment, call

    FragmentTransactionOptions fragmentTransactionOptions = new FragmentTransactionOptions.Builder()
    			.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out).build();
    mFragmentController.displayFragment(fragment, fragmentTransactionOptions); // its not necessary to provide FragmentTransactionOptions, pass null if animation, transition or shared element animations are not required

Back Press Handling :

public void onBackPressed() {
    if (!mFragmentController.popBackStackImmediate())
        super.onBackPressed();
}

GitHub

https://github.com/abhishesh-srivastava/fragstack
You might also like...

Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.

Android ViewPagerIndicator Paging indicator widgets that are compatible with the ViewPager from the Android Support Library to improve discoverability

Aug 13, 2022

The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.

The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.

MaterialDrawer ... the flexible, easy to use, all in one drawer library for your Android project. What's included 🚀 • Setup 🛠️ • Migration Guide 🧬

Aug 11, 2022

A flexible, easy to use, unique drawer library for your Android project.

A flexible, easy to use, unique drawer library for your Android project.

Duo Navigation Drawer This Android library provides an easy way to create an alternative navigation drawer for android. Instead of a drawer that slide

Aug 9, 2022

Alligator is a modern Android navigation library that will help to organize your navigation code in clean and testable way.

Alligator Alligator is a modern Android navigation library that will help to organize your navigation code in clean and testable way. Features Any app

Jul 7, 2022

A sleek, out of the box, easy to understand and use, swipe gesture based Navigational Library for android.

A sleek, out of the box, easy to understand and use, swipe gesture based Navigational Library for android.

Facilis Swipe gesture based navigational library for Android. Watch Demo Video: Getting Started To get this project into your build: Gradle Add it in

Feb 15, 2022

A simple navigation library for Android 🗺️

Enro 🗺️ A simple navigation library for Android "The novices’ eyes followed the wriggling path up from the well as it swept a great meandering arc ar

Aug 4, 2022

🧛 Fragula is a swipe-to-dismiss extension for navigation component library for Android

🧛 Fragula is a swipe-to-dismiss extension for navigation component library for Android

Fragula is a swipe-to-dismiss extension for navigation component library for Android.

Aug 12, 2022

This library will help to show the polyline in dual color similar as Uber.

This library will help to show the polyline in dual color similar as Uber.

Dual-color-Polyline-Animation This library will help to show the polyline in dual color similar as Uber with animation in the demo. Demo Steps: Pass t

Jun 26, 2022

🛸Voyager is a pragmatic navigation library built for, and seamlessly integrated with, Jetpack Compose.

🛸Voyager is a pragmatic navigation library built for, and seamlessly integrated with, Jetpack Compose.

Voyager is a pragmatic navigation library built for, and seamlessly integrated with, Jetpack Compose.

Aug 9, 2022
Comments
  • 1. v2.0.0 not found

    When I import this as suggested, using v2.0.0 I get the following:

    Execution failed for task ':app:checkTstDebugAarMetadata'.
    > Could not resolve all files for configuration ':app:tstDebugRuntimeClasspath'.
       > Could not find com.github.abhishesh-srivastava:fragstack:v2.0.0.
         Searched in the following locations:
           - https://dl.google.com/dl/android/maven2/com/github/abhishesh-srivastava/fragstack/v2.0.0/fragstack-v2.0.0.pom
           - https://jcenter.bintray.com/com/github/abhishesh-srivastava/fragstack/v2.0.0/fragstack-v2.0.0.pom
           - https://repo.maven.apache.org/maven2/com/github/abhishesh-srivastava/fragstack/v2.0.0/fragstack-v2.0.0.pom
           - https://jitpack.io/com/github/abhishesh-srivastava/fragstack/v2.0.0/fragstack-v2.0.0.pom
         Required by:
             project :app
    
    Possible solution:
     - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
    
    

    However, using implementation 'com.github.abhishesh-srivastava:fragstack:1.1.0' seems to work

    Reviewed by Fifteen15Studios at 2021-02-06 19:09
  • 2. mFragmentController doesn't persist through screen rotation

    After following the instructions given on how to use this, mFragmentController is recreated when a screen rotation happens, and therefore the stack of fragments is lost. I tired to handle this myself, in the onSaveInstanceState method, but the FragmentController class does not extend Serializable so it cannot be saved.

    The only solution that I can think of is to make it a static variable, and then check if the variable is null before assigning it in the onCreate method, but that didn't seem to work either.

    Reviewed by Fifteen15Studios at 2020-03-21 21:49
[ACTIVE] Simple Stack, a backstack library / navigation framework for simpler navigation and state management (for fragments, views, or whatevers).
[ACTIVE] Simple Stack, a backstack library / navigation framework for simpler navigation and state management (for fragments, views, or whatevers).

Simple Stack Why do I want this? To make navigation to another screen as simple as backstack.goTo(SomeScreen()), and going back as simple as backstack

Aug 12, 2022
A small navigation library for Jetpack Compose with state saving, backstack and animations support.

A small navigation library for Jetpack Compose with state saving, backstack and animations support.

Jul 24, 2022
An Android library for managing multiple stacks of fragments
An Android library for managing multiple stacks of fragments

FragNav Android library for managing multiple stacks of fragments (e.g., Bottom Navigation , Navigation Drawer). This library does NOT include the UI

Aug 15, 2022
AndroidBriefActions - Android library for sending and observing non persistent actions such as showing a message; nice readable way to call navigation actions from ViewModel or Activity/Fragment.

implementation "com.vladmarkovic.briefactions:briefactions:$briefActionsVersion" Benefits Why use brief-actions library pattern: Prevent short-term ac

Jul 25, 2021
An efficient TabLayout library implemented with RecyclerView.
An efficient TabLayout library implemented with RecyclerView.

RecyclerTabLayout An efficient TabLayout library implemented with RecyclerView. Features Efficient when having many tabs Easy setup with ViewPager (sa

Aug 8, 2022
Use Fragment like Activity
Use Fragment like Activity

Fragivity : Use Fragment like Activity English | 中文文档 Fragivity is a library used to build APP with "Single Activity + Multi-Fragments" Architecture R

Aug 5, 2022
Tugas Fragment Codelab Navigation Pemrograman Mobile

AndroidTrivia - starter code Starter code for Android Kotlin Fundamentals codelab 3.1: Create and add a fragment. Introduction The AndroidTrivia app a

Nov 3, 2021
🎉 [Android Library] A light-weight library to easily make beautiful Navigation Bar with ton of 🎨 customization option.
🎉 [Android Library] A light-weight library to easily make beautiful Navigation Bar with ton of 🎨 customization option.

Bubble Navigation ?? A light-weight library to easily make beautiful Navigation Bars with a ton of ?? customization options. Demos FloatingTopBarActiv

Aug 10, 2022
An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

SlidingMenu (Play Store Demo) SlidingMenu is an Open Source Android library that allows developers to easily create applications with sliding menus li

Aug 17, 2022
Android Library for making animated tutorials inside your app
Android Library for making animated tutorials inside your app

##SlidingTutorial Cleveroad introduces Sliding Tutorial Library for Android Hey guys, hope you haven’t started developing a tutorial for your Android

Aug 17, 2022