NavUtils

Additional

Language
Kotlin
Version
4.0.0.alpha8 (Sep 23, 2019)
Created
Jun 20, 2017
Updated
Sep 23, 2019
Owner
Raphaël Bussa (raphaelbussa)
Contributor
Raphaël Bussa (raphaelbussa)
1
Activity
Badge
Generate
Download
Source code

Announcement

Nav Utils

Easy manage commit Fragment and Activity, with some little extra

Import

At the moment the library is in my personal maven repo

repositories {
    maven {
        url 'http://dl.bintray.com/raphaelbussa/maven'
    }
}
dependencies {
    implementation 'com.raphaelbussa:navutils:4.0.0.alpha8'
}

How to use

Activity

The library provide several methods to commit a new activity, in Fragment and Activity you can use extentions

pushActivity(ResultActivity::class) {
    //remove all activity from current stack 
    clearStack(true)
    //add arguments 
    arguments(Bundle.EMPTY)
    //add standard animation
    animationType(NavUtils.Anim.HORIZONTAL_RIGHT)
    //add custom animation
    customAnimation(R.anim.popup_enter, R.anim.popup_exit)
    //add scene transition
    sceneTransition(view)     
}.commit()

For commit an Activty with result

.commit(requestCode = 9000)

Fragment

The library provide several methods to commit a new fragment, in Fragment and Activity you can use extentions

pushFragment(ResultFragment::class) {
    //add standard animation
    animationType(animationType)
    //remove start animation
    noEnterAnimations(true)
    //remove exit animation
    noExitAnimations(true)
    //add arguments 
    arguments(Bundle.EMPTY)
    //add custom animation
    customAnimation(R.anim.popup_enter, R.anim.popup_exit, R.anim.popup_enter, R.anim.popup_exit)
    //add fragment to backstack
    addToBackStack()
    //set custom tag
    tag("custom tag")
}.replace(R.id.container)

If you want to add

.add(R.id.container)

That's all folks!

Sample

Browse the sample code here

Kotlin doc

Browse Kotlin doc here

App using Nav Utils

If you use this lib contact me and I will add it to the list below:

Developed By

Raphaël Bussa - raphaelbussa@gmail.com

License

The MIT License (MIT)

Copyright (c) 2017-2019 Raphaël Bussa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.