Giter Site home page Giter Site logo

android-multibackstack's Introduction

Android-MultiBackStack

Android Arsenal JitPack API TravisCI AndroidDev Digest

Implementation of the multiple back stacks. Using this library allows implementation of persistent bottom navigation like in instagram.

image

This library we use in our app Hotellook.

Compatibility

This library is compatible from API 9 (Android 2.3).

Download

Add it in your root build.gradle at the end of repositories:

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

Add the dependency

dependencies {
    compile 'com.github.jetradarmobile:multibackstack:1.2.1'
}

Usage

See sample project for understanding how it works.

License

Copyright 2016 JetRadar

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-multibackstack's People

Contributors

johnkil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-multibackstack's Issues

is not currently in the FragmentManager

Hello, I use 5 fragments. each fragmentte back stack works, but when you go back to the previous screen, the data disappears and the screen refreshes. Do you have a solution? It does not look like the old page as in Instagram.

@johnkil

Restore state of fragment on pop

So, the problem is each fragment is recreated after poping up from backstack.
Here is what I've used for pushing a fragment

((HomeActivity) context).showFragment(LikesFragment.newInstance(b), true);

onCreateView is called every time tab is switched

How can we prevent to lose the current status of the fragment?

I add more details: I'm building an app that has a tinder-like UI with cards. If user scrolls the cards deck, then change fragment, when it comes back the deck is re-load. I need to maintain the position, aka restore view status

call fragment again on back pressed

The problem is when I click back button on root fragment of a tab something calls onStart method and all fragment life cycle after that.

Handeling showing of Fragments not represented in the bottom navigation

Hello,

how would you recommand to show new fragments that are not represented in the bottom bar ?
Like, I have a general Fragment that I can put into different states. Out of a static Fragment from the Navigation Bar I am opening an instance of this general fragment.
But now I get problems with the back stack. Because I don't assign a tab id or anything as this isn't a static fragment I can't get your library to pop back to the state before.

Can't I just add another fragment to the backstack list in your library ?
Please help out

Thanks in advance

Get number of fragments in a tab

Hi,
I was wondering if you could add a method for the backStackManager that I can use to know how many fragments i got at one of the tabs / stacks?

something that can be used like this:
if (backStackManager.getCountOfFragments(tabIndex) == 1){
// tab have one fragment left in it.
}

Cheers,

Getting NullPointerException when trying to startActivityForResult from fragment

In my fragment I need to start activity for result but

 Process: com.magis.icbc, PID: 810
                  java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
                      at android.support.v4.app.BackStackRecord.doAddOp(BackStackRecord.java:392)
                      at android.support.v4.app.BackStackRecord.replace(BackStackRecord.java:439)
                      at android.support.v4.app.BackStackRecord.replace(BackStackRecord.java:430)
                      at com.magis.icbc.ui.components.activity.MainMenuActivity.replaceFragment(MainMenuActivity.java:428)

replace method gives NPE

private void replaceFragment(@NonNull Fragment fragment) {
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction tr = fm.beginTransaction();
    tr.replace(R.id.frame_container, fragment);
    tr.commitAllowingStateLoss();
    curFragment = fragment;
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.