Description
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.
fragstack alternatives and similar packages
Based on the "Navigation" category.
Alternatively, view fragstack alternatives based on common mentions on social networks and blogs.
-
Compose Destinations
Annotation processing library for type-safe Jetpack Compose navigation with no boilerplate. -
Bubble Navigation
๐ [Android Library] A light-weight library to easily make beautiful Navigation Bar with ton of ๐จ customization option. -
AnimatedBottomBar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges. -
Alligator
Alligator is Android navigation library that will help to organize your navigation code in clean and testable way. -
PagerSlidingTabStrip
An interactive indicator to navigate between the different pages of a ViewPager -
Okuki
Okuki is a simple, hierarchical navigation bus and back stack for Android, with optional Rx bindings, and Toothpick DI integration. -
Dual-color-Polyline-Animation
This library will help to show the polyline in dual color similar as Uber. -
Facilis
A sleek, out of the box, easy to understand and use, swipe gesture based Navigational Library for android. -
AndroidBriefActions
DISCONTINUED. 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.
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of fragstack or a related project?
README
fragstack : Android library for managing individual fragment backstack.
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();
}