├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── FragNavDemo.gif ├── README.md ├── UniqueHistory.gif ├── UnlimitedHistory.gif ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ncapdevi │ │ │ └── sample │ │ │ ├── activities │ │ │ ├── BottomTabsActivity.kt │ │ │ ├── MainActivity.kt │ │ │ └── NavDrawerActivity.kt │ │ │ └── fragments │ │ │ ├── BaseFragment.kt │ │ │ ├── FavoritesFragment.kt │ │ │ ├── FoodFragment.kt │ │ │ ├── FriendsFragment.kt │ │ │ ├── NearbyFragment.kt │ │ │ └── RecentsFragment.kt │ └── res │ │ ├── anim │ │ ├── slide_in_from_left.xml │ │ ├── slide_in_from_right.xml │ │ ├── slide_out_to_left.xml │ │ └── slide_out_to_right.xml │ │ ├── drawable-hdpi │ │ ├── ic_favorites.png │ │ ├── ic_friends.png │ │ ├── ic_nearby.png │ │ ├── ic_recents.png │ │ └── ic_restaurants.png │ │ ├── drawable-mdpi │ │ ├── ic_favorites.png │ │ ├── ic_friends.png │ │ ├── ic_nearby.png │ │ ├── ic_recents.png │ │ └── ic_restaurants.png │ │ ├── drawable-xhdpi │ │ ├── ic_favorites.png │ │ ├── ic_friends.png │ │ ├── ic_nearby.png │ │ ├── ic_recents.png │ │ └── ic_restaurants.png │ │ ├── drawable-xxhdpi │ │ ├── ic_favorites.png │ │ ├── ic_friends.png │ │ ├── ic_nearby.png │ │ ├── ic_recents.png │ │ └── ic_restaurants.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_favorites.png │ │ ├── ic_friends.png │ │ ├── ic_nearby.png │ │ ├── ic_recents.png │ │ └── ic_restaurants.png │ │ ├── drawable │ │ └── side_nav_bar.xml │ │ ├── layout │ │ ├── activity_bottom_tabs.xml │ │ ├── activity_main.xml │ │ ├── activity_nav_drawer.xml │ │ ├── app_bar_nav_drawer.xml │ │ ├── content_nav_drawer.xml │ │ ├── fragment_main.xml │ │ └── nav_header_nav_drawer.xml │ │ ├── menu │ │ └── activity_nav_drawer_drawer.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── menu_bottombar.xml │ └── test │ └── java │ └── com │ └── ncapdevi │ └── sample │ └── AppUnitTests.java ├── build.gradle ├── frag-nav ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ncapdevi │ │ │ └── fragnav │ │ │ ├── FragNavController.kt │ │ │ ├── FragNavLogger.kt │ │ │ ├── FragNavPopController.kt │ │ │ ├── FragNavSwitchController.kt │ │ │ ├── FragNavTransactionOptions.kt │ │ │ └── tabhistory │ │ │ ├── BaseFragNavTabHistoryController.kt │ │ │ ├── CollectionFragNavTabHistoryController.kt │ │ │ ├── CurrentTabHistoryController.kt │ │ │ ├── FragNavTabHistoryController.kt │ │ │ ├── NavigationStrategy.kt │ │ │ ├── UniqueTabHistoryController.kt │ │ │ └── UnlimitedTabHistoryController.kt │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ ├── java │ └── com │ │ └── ncapdevi │ │ └── fragnav │ │ ├── FragNavControllerRaceConditionSpec.kt │ │ ├── FragNavControllerTest.kt │ │ ├── FragNavTransactionOptionsTest.kt │ │ └── tabhistory │ │ ├── CurrentTabHistoryControllerTest.kt │ │ ├── UniqueTabHistoryControllerTest.kt │ │ └── UnlimitedTabHistoryControllerTest.kt │ └── resources │ └── mockito-extensions │ └── org.mockito.plugins.MockMaker ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .DS_Store 5 | /build 6 | /captures 7 | .idea 8 | 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | before_cache: 3 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 4 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ 5 | cache: 6 | directories: 7 | - $HOME/.gradle/caches/ 8 | - $HOME/.gradle/wrapper/ 9 | - $HOME/.android/build-cache 10 | 11 | android: 12 | components: 13 | # use the latest revision of Android SDK Tools 14 | - tools 15 | - platform-tools 16 | - tools 17 | # The BuildTools version used by your project 18 | - build-tools-27.0.3 19 | # The SDK version used to compile your project 20 | - android-27 21 | # Additional components 22 | - extra-google-m2repository 23 | - extra-android-m2repository 24 | - extra-android-support 25 | 26 | licenses: 27 | - 'android-sdk-preview-license-.+' 28 | - 'android-sdk-license-.+' 29 | - 'google-gdk-license-.+' 30 | 31 | jdk: 32 | - oraclejdk8 33 | 34 | notifications: 35 | email: false 36 | 37 | install: 38 | # List and delete unnecessary components to free space 39 | - sdkmanager --list || true 40 | - sdkmanager --uninstall "system-images;android-15;default;armeabi-v7a" 41 | - sdkmanager --uninstall "system-images;android-16;default;armeabi-v7a" 42 | - sdkmanager --uninstall "system-images;android-17;default;armeabi-v7a" 43 | - sdkmanager --uninstall "system-images;android-18;default;armeabi-v7a" 44 | - sdkmanager --uninstall "system-images;android-19;default;armeabi-v7a" 45 | - sdkmanager --uninstall "system-images;android-21;default;armeabi-v7a" 46 | - sdkmanager --uninstall "extras;google;google_play_services" 47 | - sdkmanager --uninstall "extras;android;support" 48 | - sdkmanager --uninstall "platforms;android-10" 49 | - sdkmanager --uninstall "platforms;android-15" 50 | - sdkmanager --uninstall "platforms;android-16" 51 | - sdkmanager --uninstall "platforms;android-17" 52 | - sdkmanager --uninstall "platforms;android-18" 53 | - sdkmanager --uninstall "platforms;android-19" 54 | - sdkmanager --uninstall "platforms;android-20" 55 | - sdkmanager --uninstall "platforms;android-21" 56 | - sdkmanager --uninstall "platforms;android-22" 57 | - sdkmanager --uninstall "platforms;android-23" 58 | - sdkmanager --uninstall "platforms;android-24" 59 | - sdkmanager --uninstall "platforms;android-25" 60 | - sdkmanager --uninstall "platforms;android-26" 61 | - sdkmanager --uninstall "build-tools;25.0.2" 62 | # Update sdk tools to latest version and install/update components 63 | - echo yes | sdkmanager "tools" 64 | - echo yes | sdkmanager "platforms;android-27" # Latest platform required by SDK tools 65 | - echo yes | sdkmanager "extras;android;m2repository" 66 | - echo yes | sdkmanager "extras;google;m2repository" 67 | 68 | script: 69 | - ./gradlew jacocoTestReportDebug coveralls -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | All changelogs are in the release section 2 | 3 | https://github.com/ncapdevi/FragNav/releases 4 | -------------------------------------------------------------------------------- /FragNavDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/FragNavDemo.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/ncapdevi/FragNav.svg?branch=master)](https://travis-ci.org/ncapdevi/FragNav) 2 | 3 | # FragNav 4 | Android library for managing multiple stacks of fragments (e.g., [Bottom Navigation ](https://www.google.com/design/spec/components/bottom-navigation.html), [Navigation Drawer](https://www.google.com/design/spec/patterns/navigation-drawer.html)). This library does NOT include the UI for bottom tab bar layout. For that, I recommend either [BottomBar](https://github.com/roughike/BottomBar) (which is the library shown in the demo) or [AHBottomNavigation](https://github.com/aurelhubert/ahbottomnavigation). This library helps maintain order after pushing onto and popping from multiple stacks(tabs). It also helps with switching between desired tabs and clearing the stacks. 5 | 6 | 7 | 8 | 9 | ## Donations 10 | Did I help you out, save you some time, make your life easier? Oh, cool. Want to say thanks, buy me a coffee or a beer? HEY THANKS! I appreciate it. 11 | 12 | [Cash App](https://cash.me/$NicCapdevila) 13 | 14 | [Paypal](https://paypal.me/ncapdevi) 15 | 16 | [Venmo](http://www.venmo.com/code?user_id=1774909453762560167) 17 | 18 | ## Restrictions 19 | Fragments are maintained in a stack per Android's guideline https://developer.android.com/guide/navigation/navigation-principles#navigation_state_is_represented_as_a_stack_of_destinations . A lot of questions get asked about how to maintain only one instance of a fragment, or to pull out a fragment in the middle of the stack. That is outside Android navigation guidelines, and also this library. You may want to rethink your UX. 20 | 21 | 22 | ## Sample 23 | With [Material Design Bottom Navigation pattern](https://www.google.com/design/spec/components/bottom-navigation.html), and other tabbed navigation, managing multiple stacks of fragments can be a real headache. The example file shows best practice for navigating deep within a tab stack. 24 | 25 | ## Gradle 26 | 27 | ```groovy 28 | implementation 'com.ncapdevi:frag-nav:3.2.0' //or or `compile` if on older gradle version 29 | ``` 30 | 31 | ## How do I implement it? 32 | 33 | ### Initialize using a builder and one of two methods 34 | ```kotlin 35 | private val fragNavController: FragNavController = FragNavController(supportFragmentManager, R.id.container) 36 | ``` 37 | #### 1. 38 | Create a list of fragments and pass them in 39 | ```kotlin 40 | val fragments = listOf( 41 | RecentsFragment.newInstance(0), 42 | FavoritesFragment.newInstance(0), 43 | NearbyFragment.newInstance(0), 44 | FriendsFragment.newInstance(0), 45 | FoodFragment.newInstance(0), 46 | RecentsFragment.newInstance(0), 47 | FavoritesFragment.newInstance(0), 48 | NearbyFragment.newInstance(0), 49 | FriendsFragment.newInstance(0), 50 | FoodFragment.newInstance(0), 51 | RecentsFragment.newInstance(0), 52 | FavoritesFragment.newInstance(0)) 53 | 54 | fragNavController.rootFragments = fragments 55 | ``` 56 | 57 | #### 2. 58 | 59 | 60 | Allow for dynamically creating the base class by implementing the NavListener in your class and overriding the getRootFragment method 61 | 62 | ```java 63 | public class YourActivity extends AppCompatActivity implements FragNavController.RootFragmentListener { 64 | ``` 65 | 66 | ```java 67 | fragNavController.rootFragmentListener = this 68 | ``` 69 | 70 | ```kotlin 71 | 72 | override val numberOfRootFragments: Int = 5 73 | 74 | override fun getRootFragment(index: Int): Fragment { 75 | when (index) { 76 | INDEX_RECENTS -> return RecentsFragment.newInstance(0) 77 | INDEX_FAVORITES -> return FavoritesFragment.newInstance(0) 78 | INDEX_NEARBY -> return NearbyFragment.newInstance(0) 79 | INDEX_FRIENDS -> return FriendsFragment.newInstance(0) 80 | INDEX_FOOD -> return FoodFragment.newInstance(0) 81 | } 82 | throw IllegalStateException("Need to send an index that we know") 83 | } 84 | 85 | ``` 86 | 87 | #### 3. 88 | ```java 89 | fragNavController.initialize(FragNavController.TAB3, savedInstanceState) 90 | ``` 91 | 92 | ### SaveInstanceState 93 | 94 | Send in the supportFragment Manager, a list of base fragments, the container that you'll be using to display fragments. 95 | After that, you have four main functions that you can use 96 | In your activity, you'll also want to override your onSaveInstanceState like so 97 | 98 | ```kotlin 99 | override fun onSaveInstanceState(outState: Bundle?) { 100 | super.onSaveInstanceState(outState) 101 | fragNavController.onSaveInstanceState(outState!!) 102 | 103 | } 104 | ``` 105 | 106 | ### Switch tabs 107 | Tab switching is indexed to try to prevent you from sending in wrong indices. It also will throw an error if you try to switch to a tab you haven't defined a base fragment for. 108 | 109 | ```java 110 | fragNavController.switchTab(NavController.TAB1); 111 | ``` 112 | 113 | ### Push a fragment 114 | You can only push onto the currently selected index 115 | ```java 116 | fragNavController.pushFragment(FoodFragment.newInstance()) 117 | ``` 118 | 119 | ### Pop a fragment 120 | You can only pop from the currently selected index. This can throw an UnsupportedOperationException if trying to pop the root fragment 121 | ```java 122 | fragNavController.popFragment(); 123 | ``` 124 | ### Pop multiple fragments 125 | You can pop multiple fragments at once, with the same rules as above applying. If the pop depth is deeper than possible, it will stop when it gets to the root fragment 126 | ```java 127 | fragNavController.popFragments(3); 128 | ``` 129 | ### Replacing a fragment 130 | You can only replace onto the currently selected index 131 | ```java 132 | fragNavController.replaceFragment(Fragment fragment); 133 | ``` 134 | ### You can also clear the stack to bring you back to the base fragment 135 | ```java 136 | fragNavController.clearStack(); 137 | ``` 138 | ### You can also navigate your DialogFragments using 139 | ```java 140 | showDialogFragment(dialogFragment); 141 | clearDialogFragment(); 142 | getCurrentDialogFrag() 143 | ``` 144 | 145 | ### Transaction Options 146 | All of the above transactions can also be done with defined transaction options. 147 | The FragNavTransactionOptions have a builder that can be used. 148 | ```kotlin 149 | class FragNavTransactionOptions private constructor(builder: Builder) { 150 | val sharedElements: List> = builder.sharedElements 151 | @FragNavController.Transit 152 | val transition = builder.transition 153 | @AnimRes 154 | val enterAnimation = builder.enterAnimation 155 | @AnimRes 156 | val exitAnimation = builder.exitAnimation 157 | @AnimRes 158 | val popEnterAnimation = builder.popEnterAnimation 159 | @AnimRes 160 | val popExitAnimation = builder.popExitAnimation 161 | @StyleRes 162 | val transitionStyle = builder.transitionStyle 163 | val breadCrumbTitle: String? = builder.breadCrumbTitle 164 | val breadCrumbShortTitle: String? = builder.breadCrumbShortTitle 165 | val allowStateLoss: Boolean = builder.allowStateLoss 166 | 167 | ``` 168 | 169 | ### Get informed of fragment transactions 170 | Have your activity implement FragNavController.TransactionListener 171 | and you will have methods that inform you of tab switches or fragment transactions 172 | 173 | A sample application is in the repo if you need to see how it works. 174 | 175 | ### Fragment Transitions 176 | 177 | Can be set using the transactionOptions 178 | 179 | 180 | 181 | ## Restoring Fragment State 182 | Fragments transitions in this library use attach()/detch() (http://daniel-codes.blogspot.com/2012/06/fragment-transactions-reference.html). This is a delibrate choice in order to maintain the fragment's lifecycle, as well as being optimal for memory. This means that fragments will go through their proper lifecycle https://developer.android.com/guide/components/fragments.html#Lifecycle . This lifecycle includes going through `OnCreateView` which means that if you want to maintain view states, that is outside the scope of this library, and is up to the indiviudal fragment. There are plenty of resources out there that will help you design your fragments in such a way that their view state can be restored https://inthecheesefactory.com/blog/fragment-state-saving-best-practices/en and there are libraries that can help restore other states https://github.com/frankiesardo/icepick 183 | 184 | ## Special Use Cases 185 | 186 | ### History & Back navigation between tabs 187 | 188 | The reason behind this feature is that many of the "big" apps out there has a fairly similar approach for handling back navigation. When the user starts to tap the back button the current tab's fragments are being thrown away (FragNav default configuration does this too). The more interesting part comes when the user reaches the "root" fragment of the current tab. At this point there are several approaches that we can choose: 189 | 190 | - Nothing happens on further back button taps - **This is the default** 191 | - FragNav tracks "Tab History" and send a tab switch signal and we navigate back in history to the previous tab. 192 | 193 | To use the history keeping mode you'll have to add extra parameters to the builder: 194 | 195 | ```java 196 | mNavController = FragNavController.newBuilder(...) 197 | ... 198 | .switchController(FragNavTabHistoryController.UNLIMITED_TAB_HISTORY, new FragNavSwitchController() { 199 | @Override 200 | public void switchTab(int index, @Nullable FragNavTransactionOptions transactionOptions) { 201 | bottomBar.selectTabAtPosition(index); 202 | } 203 | }) 204 | .build(); 205 | ``` 206 | 207 | Here first we have to choose between two flavors (see below for details), then we'll have to provide a callback that handles the tab switch trigger (This is required so that our UI element that also contain the state of the selected tab can update itself - aka switching the tabs always triggered by the application never by FragNav). 208 | 209 | | UNLIMITED_TAB_HISTORY | UNIQUE_TAB_HISTORY | 210 | | :--------------------------------------: | :----------------------------------: | 211 | | ![Unlimited History](UnlimitedHistory.gif) | ![Unique History](UniqueHistory.gif) | 212 | 213 | ### Show & Hide modes for fragment "replacement" 214 | 215 | While having a good architecture and caching most of the data that is presented on a page makes attaching / detaching the fragments when switching pretty seamless there may be some cases where even a small glitch or slowdown can be bothering for the user. Let's assume a virtualized list with couple of hundred items, even if the attach is pretty fast and the data is available rebuilding all the cell items for the list is not immediate and user might see some loading / white screen. To optimize the experience we introduced 3 different possibility: 216 | 217 | - Using attach and detach for both opening new fragments on the current stack and switching between tabs - **This is the default** - *DETACH* 218 | 219 | - Using attach and detach for opening new fragments on the current stack and using show and hide for switching between tabs - *DETACH_ON_NAVIGATE_HIDE_ON_SWITCH* 220 | 221 | Having this setting we have a good balance between memory consumption and user experience. (we have at most as many fragment UI in the memory as the number of our tabs) 222 | 223 | - Using Fragment show and hide for both opening new fragments on the current stack and switching between tabs - *HIDE* 224 | 225 | This gives the best performance keeping all fragments in the memory so we won't have to wait for the rebuilding of them. However with many tabs and deep navigation stacks this can lead easily to memory consumption issues. 226 | 227 | **WARNING** - Keep in mind that using **show and hide does not trigger the usual lifecycle events** of the fragments so app developer has to manually take care of handling state which is usually done in the Fragment onPause/Stop and onResume/Start methods. 228 | 229 | ```java 230 | mNavController = FragNavController.newBuilder(...) 231 | ... 232 | .fragmentHideStrategy(FragNavController.DETACH_ON_NAVIGATE_HIDE_ON_SWITCH) 233 | .eager(true) 234 | .build(); 235 | ``` 236 | 237 | There is also a possibility to automatically add and inflate all the root fragments right after creation (This makes sense only using *HIDE* and *DETACH_ON_NAVIGATE_HIDE_ON_SWITCH* modes). To have this you should set "eager" mode to true on the builder (Default is false). 238 | 239 | ## Apps Using FragNav 240 | 241 | Feel free to send me a pull request with your app and I'll link you here: 242 | 243 | | Logo | Name | Play Store | 244 | | ---------------------------------------- | ---------- | ---------------------------------------- | 245 | | RockbotDJ | Rockbot DJ | Get it on Google Play | 246 | | RockbotRemote | Rockbot Remote | Get it on Google Play | 247 | | Skyscanner | Skyscanner | Get it on Google Play | 248 | | Fonic | Fonic / Fonic Mobile | Get it on Google Play | 249 | | Just Expenses | Just Expenses | Get it on Google Play | 250 | 251 | ## Contributions 252 | If you have any problems, feel free to create an issue or pull request. 253 | 254 | The sample app in the repository uses [BottomBar](https://github.com/roughike/BottomBar) library. 255 | 256 | 257 | 258 | ## License 259 | 260 | ``` 261 | FragNav Android Fragment Navigation Library 262 | Copyright (c) 2016 Nic Capdevila (http://github.com/ncapdevi). 263 | 264 | Licensed under the Apache License, Version 2.0 (the "License"); 265 | you may not use this file except in compliance with the License. 266 | You may obtain a copy of the License at 267 | 268 | http://www.apache.org/licenses/LICENSE-2.0 269 | 270 | Unless required by applicable law or agreed to in writing, software 271 | distributed under the License is distributed on an "AS IS" BASIS, 272 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 273 | See the License for the specific language governing permissions and 274 | limitations under the License. 275 | ``` 276 | -------------------------------------------------------------------------------- /UniqueHistory.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/UniqueHistory.gif -------------------------------------------------------------------------------- /UnlimitedHistory.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/UnlimitedHistory.gif -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion rootProject.ext.compileSdkVersion 6 | buildToolsVersion rootProject.ext.buildToolsVersion 7 | lintOptions { 8 | abortOnError false 9 | } 10 | defaultConfig { 11 | applicationId "com.ncapdevi.sample" 12 | minSdkVersion rootProject.ext.minSdkVersion 13 | targetSdkVersion rootProject.ext.compileSdkVersion 14 | versionCode 1 15 | versionName "1.0" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | repositories { 25 | jcenter() 26 | } 27 | 28 | dependencies { 29 | implementation project(':frag-nav') 30 | implementation "com.google.android.material:material:1.0.0" 31 | implementation "androidx.appcompat:appcompat:1.0.2" 32 | implementation "com.roughike:bottom-bar:2.3.1" 33 | testImplementation "junit:junit:$rootProject.ext.junitVersion" 34 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 35 | } 36 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/niccapdevila/.android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/activities/BottomTabsActivity.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.activities 2 | 3 | import android.os.Bundle 4 | import androidx.fragment.app.Fragment 5 | import androidx.appcompat.app.AppCompatActivity 6 | import android.util.Log 7 | import android.view.MenuItem 8 | import android.view.View 9 | import com.ncapdevi.fragnav.FragNavController 10 | import com.ncapdevi.fragnav.FragNavLogger 11 | import com.ncapdevi.fragnav.FragNavSwitchController 12 | import com.ncapdevi.fragnav.FragNavTransactionOptions 13 | import com.ncapdevi.fragnav.tabhistory.UniqueTabHistoryStrategy 14 | import com.ncapdevi.sample.R 15 | import com.ncapdevi.sample.fragments.* 16 | import com.roughike.bottombar.BottomBar 17 | 18 | class BottomTabsActivity : AppCompatActivity(), BaseFragment.FragmentNavigation, FragNavController.TransactionListener, FragNavController.RootFragmentListener { 19 | override val numberOfRootFragments: Int = 5 20 | 21 | private val fragNavController: FragNavController = FragNavController(supportFragmentManager, R.id.container) 22 | 23 | private lateinit var bottomBar: BottomBar 24 | 25 | override fun onCreate(savedInstanceState: Bundle?) { 26 | super.onCreate(savedInstanceState) 27 | setContentView(R.layout.activity_bottom_tabs) 28 | 29 | bottomBar = findViewById(R.id.bottomBar) 30 | 31 | fragNavController.apply { 32 | transactionListener = this@BottomTabsActivity 33 | rootFragmentListener = this@BottomTabsActivity 34 | createEager = true 35 | fragNavLogger = object : FragNavLogger { 36 | override fun error(message: String, throwable: Throwable) { 37 | Log.e(TAG, message, throwable) 38 | } 39 | } 40 | 41 | defaultTransactionOptions = FragNavTransactionOptions.newBuilder().customAnimations(R.anim.slide_in_from_right, R.anim.slide_out_to_left, R.anim.slide_in_from_left, R.anim.slide_out_to_right).build() 42 | fragmentHideStrategy = FragNavController.DETACH_ON_NAVIGATE_HIDE_ON_SWITCH 43 | 44 | navigationStrategy = UniqueTabHistoryStrategy(object : FragNavSwitchController { 45 | override fun switchTab(index: Int, transactionOptions: FragNavTransactionOptions?) { 46 | bottomBar.selectTabAtPosition(index) 47 | } 48 | }) 49 | } 50 | 51 | fragNavController.initialize(INDEX_NEARBY, savedInstanceState) 52 | 53 | val initial = savedInstanceState == null 54 | if (initial) { 55 | bottomBar.selectTabAtPosition(INDEX_NEARBY) 56 | } 57 | 58 | bottomBar.setOnTabSelectListener({ tabId -> 59 | when (tabId) { 60 | R.id.bb_menu_recents -> fragNavController.switchTab(INDEX_RECENTS) 61 | R.id.bb_menu_favorites -> fragNavController.switchTab(INDEX_FAVORITES) 62 | R.id.bb_menu_nearby -> fragNavController.switchTab(INDEX_NEARBY) 63 | R.id.bb_menu_friends -> fragNavController.switchTab(INDEX_FRIENDS) 64 | R.id.bb_menu_food -> fragNavController.switchTab(INDEX_FOOD) 65 | } 66 | }, initial) 67 | 68 | bottomBar.setOnTabReselectListener { fragNavController.clearStack() } 69 | } 70 | 71 | override fun onBackPressed() { 72 | if (fragNavController.popFragment().not()) { 73 | super.onBackPressed() 74 | } 75 | } 76 | 77 | override fun onSaveInstanceState(outState: Bundle?) { 78 | super.onSaveInstanceState(outState) 79 | fragNavController.onSaveInstanceState(outState!!) 80 | 81 | } 82 | 83 | override fun pushFragment(fragment: Fragment, sharedElementList: List>?) { 84 | val options = FragNavTransactionOptions.newBuilder() 85 | options.reordering = true 86 | sharedElementList?.let { 87 | it.forEach { pair -> 88 | options.addSharedElement(pair) 89 | } 90 | } 91 | fragNavController.pushFragment(fragment, options.build()) 92 | 93 | } 94 | 95 | override fun onTabTransaction(fragment: Fragment?, index: Int) { 96 | // If we have a backstack, show the back button 97 | supportActionBar?.setDisplayHomeAsUpEnabled(fragNavController.isRootFragment.not()) 98 | 99 | } 100 | 101 | 102 | override fun onFragmentTransaction(fragment: Fragment?, transactionType: FragNavController.TransactionType) { 103 | //do fragmentty stuff. Maybe change title, I'm not going to tell you how to live your life 104 | // If we have a backstack, show the back button 105 | supportActionBar?.setDisplayHomeAsUpEnabled(fragNavController.isRootFragment.not()) 106 | 107 | } 108 | 109 | override fun getRootFragment(index: Int): Fragment { 110 | when (index) { 111 | INDEX_RECENTS -> return RecentsFragment.newInstance(0) 112 | INDEX_FAVORITES -> return FavoritesFragment.newInstance(0) 113 | INDEX_NEARBY -> return NearbyFragment.newInstance(0) 114 | INDEX_FRIENDS -> return FriendsFragment.newInstance(0) 115 | INDEX_FOOD -> return FoodFragment.newInstance(0) 116 | } 117 | throw IllegalStateException("Need to send an index that we know") 118 | } 119 | 120 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 121 | when (item.itemId) { 122 | android.R.id.home -> fragNavController.popFragment() 123 | } 124 | return true 125 | } 126 | 127 | companion object { 128 | private val TAG = BottomTabsActivity::class.java.simpleName 129 | } 130 | } 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/activities/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.activities 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import androidx.appcompat.app.AppCompatActivity 6 | import android.view.View 7 | import android.widget.Button 8 | import com.ncapdevi.fragnav.FragNavController 9 | 10 | import com.ncapdevi.sample.R 11 | 12 | 13 | //Better convention to properly name the indices what they are in your app 14 | const val INDEX_RECENTS = FragNavController.TAB1 15 | const val INDEX_FAVORITES = FragNavController.TAB2 16 | const val INDEX_NEARBY = FragNavController.TAB3 17 | const val INDEX_FRIENDS = FragNavController.TAB4 18 | const val INDEX_FOOD = FragNavController.TAB5 19 | const val INDEX_RECENTS2 = FragNavController.TAB6 20 | const val INDEX_FAVORITES2 = FragNavController.TAB7 21 | const val INDEX_NEARBY2 = FragNavController.TAB8 22 | const val INDEX_FRIENDS2 = FragNavController.TAB9 23 | const val INDEX_FOOD2 = FragNavController.TAB10 24 | const val INDEX_RECENTS3 = FragNavController.TAB11 25 | const val INDEX_FAVORITES3 = FragNavController.TAB12 26 | 27 | class MainActivity : AppCompatActivity() { 28 | 29 | 30 | override fun onCreate(savedInstanceState: Bundle?) { 31 | super.onCreate(savedInstanceState) 32 | setContentView(com.ncapdevi.sample.R.layout.activity_main) 33 | 34 | val btnBottomTabs = findViewById(R.id.btnBottomTabs) as Button 35 | btnBottomTabs.setOnClickListener { startActivity(Intent(this@MainActivity, BottomTabsActivity::class.java)) } 36 | 37 | val btnNavDrawer = findViewById(R.id.btnNavDrawer) as Button 38 | btnNavDrawer.setOnClickListener { startActivity(Intent(this@MainActivity, NavDrawerActivity::class.java)) } 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/activities/NavDrawerActivity.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.activities 2 | 3 | import android.os.Bundle 4 | import com.google.android.material.navigation.NavigationView 5 | import androidx.fragment.app.Fragment 6 | import androidx.core.view.GravityCompat 7 | import androidx.drawerlayout.widget.DrawerLayout 8 | import androidx.appcompat.app.ActionBarDrawerToggle 9 | import androidx.appcompat.app.AppCompatActivity 10 | import androidx.appcompat.widget.Toolbar 11 | import android.view.MenuItem 12 | import android.view.View 13 | import com.ncapdevi.fragnav.FragNavController 14 | import com.ncapdevi.fragnav.FragNavTransactionOptions 15 | import com.ncapdevi.sample.R 16 | import com.ncapdevi.sample.fragments.* 17 | 18 | 19 | class NavDrawerActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener, BaseFragment.FragmentNavigation { 20 | //Better convention to properly name the indices what they are in your app 21 | 22 | 23 | private var fragNavController: FragNavController = FragNavController(supportFragmentManager, R.id.container) 24 | 25 | override fun onCreate(savedInstanceState: Bundle?) { 26 | super.onCreate(savedInstanceState) 27 | setContentView(R.layout.activity_nav_drawer) 28 | val toolbar = findViewById(R.id.toolbar) 29 | setSupportActionBar(toolbar) 30 | 31 | val drawer = findViewById(R.id.drawer_layout) 32 | val toggle = ActionBarDrawerToggle( 33 | this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) 34 | drawer.addDrawerListener(toggle) 35 | 36 | toggle.syncState() 37 | 38 | val navigationView = findViewById(R.id.nav_view) 39 | navigationView.setNavigationItemSelectedListener(this) 40 | 41 | val fragments = listOf( 42 | RecentsFragment.newInstance(0), 43 | FavoritesFragment.newInstance(0), 44 | NearbyFragment.newInstance(0), 45 | FriendsFragment.newInstance(0), 46 | FoodFragment.newInstance(0), 47 | RecentsFragment.newInstance(0), 48 | FavoritesFragment.newInstance(0), 49 | NearbyFragment.newInstance(0), 50 | FriendsFragment.newInstance(0), 51 | FoodFragment.newInstance(0), 52 | RecentsFragment.newInstance(0), 53 | FavoritesFragment.newInstance(0)) 54 | 55 | fragNavController.apply { 56 | rootFragments = fragments 57 | defaultTransactionOptions = FragNavTransactionOptions.newBuilder().customAnimations(R.anim.slide_in_from_right, R.anim.slide_out_to_left, R.anim.slide_in_from_left, R.anim.slide_out_to_right).build() 58 | } 59 | 60 | fragNavController.initialize(INDEX_RECENTS,savedInstanceState) 61 | 62 | 63 | } 64 | 65 | override fun onBackPressed() { 66 | val drawer = findViewById(R.id.drawer_layout) 67 | when { 68 | drawer.isDrawerOpen(GravityCompat.START) -> drawer.closeDrawer(GravityCompat.START) 69 | fragNavController.isRootFragment.not() -> fragNavController.popFragment() 70 | else -> super.onBackPressed() 71 | } 72 | } 73 | 74 | override fun onSaveInstanceState(outState: Bundle?) { 75 | super.onSaveInstanceState(outState) 76 | fragNavController.onSaveInstanceState(outState) 77 | } 78 | 79 | override fun onNavigationItemSelected(item: MenuItem): Boolean { 80 | when (item.itemId) { 81 | R.id.bb_menu_recents -> fragNavController.switchTab(INDEX_RECENTS) 82 | R.id.bb_menu_favorites -> fragNavController.switchTab(INDEX_FAVORITES) 83 | R.id.bb_menu_nearby -> fragNavController.switchTab(INDEX_NEARBY) 84 | R.id.bb_menu_friends -> fragNavController.switchTab(INDEX_FRIENDS) 85 | R.id.bb_menu_food -> fragNavController.switchTab(INDEX_FOOD) 86 | R.id.bb_menu_recents2 -> fragNavController.switchTab(INDEX_RECENTS2) 87 | R.id.bb_menu_favorites2 -> fragNavController.switchTab(INDEX_FAVORITES2) 88 | R.id.bb_menu_nearby2 -> fragNavController.switchTab(INDEX_NEARBY2) 89 | R.id.bb_menu_friends2 -> fragNavController.switchTab(INDEX_FRIENDS2) 90 | R.id.bb_menu_food2 -> fragNavController.switchTab(INDEX_FOOD2) 91 | R.id.bb_menu_recents3 -> fragNavController.switchTab(INDEX_RECENTS3) 92 | R.id.bb_menu_favorites3 -> fragNavController.switchTab(INDEX_FAVORITES3) 93 | } 94 | val drawer = findViewById(R.id.drawer_layout) 95 | drawer.closeDrawer(GravityCompat.START) 96 | return true 97 | } 98 | 99 | override fun pushFragment(fragment: Fragment, sharedList: List>?) { 100 | fragNavController.pushFragment(fragment) 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/fragments/BaseFragment.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.fragments 2 | 3 | import android.content.Context 4 | import android.os.Bundle 5 | import androidx.fragment.app.Fragment 6 | import android.view.LayoutInflater 7 | import android.view.View 8 | import android.view.ViewGroup 9 | import android.widget.Button 10 | 11 | import com.ncapdevi.sample.R 12 | 13 | /** 14 | * Created by niccapdevila on 3/26/16. 15 | */ 16 | open class BaseFragment : Fragment() { 17 | 18 | lateinit var btn: Button 19 | lateinit var mFragmentNavigation: FragmentNavigation 20 | internal var mInt = 0 21 | 22 | override fun onCreate(savedInstanceState: Bundle?) { 23 | super.onCreate(savedInstanceState) 24 | val args = arguments 25 | if (args != null) { 26 | mInt = args.getInt(ARGS_INSTANCE) 27 | } 28 | } 29 | 30 | 31 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 32 | return inflater.inflate(R.layout.fragment_main, container, false)?.apply { 33 | btn = findViewById(R.id.button) 34 | } 35 | } 36 | 37 | override fun onAttach(context: Context?) { 38 | super.onAttach(context) 39 | if (context is FragmentNavigation) { 40 | mFragmentNavigation = context 41 | } 42 | } 43 | 44 | interface FragmentNavigation { 45 | fun pushFragment(fragment: Fragment, sharedElementList: List>?= null) 46 | } 47 | 48 | companion object { 49 | const val ARGS_INSTANCE = "com.ncapdevi.sample.argsInstance" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/fragments/FavoritesFragment.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.fragments 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Build 5 | import android.os.Bundle 6 | import android.transition.TransitionInflater 7 | import android.view.View 8 | import android.widget.CheckBox 9 | import android.widget.EditText 10 | import com.ncapdevi.sample.R 11 | 12 | /** 13 | * Created by niccapdevila on 3/26/16. 14 | */ 15 | class FavoritesFragment : BaseFragment() { 16 | 17 | @SuppressLint("SetTextI18n") 18 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 19 | super.onViewCreated(view, savedInstanceState) 20 | 21 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 22 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 23 | sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition( 24 | android.R.transition.fade 25 | ) 26 | } 27 | } 28 | 29 | val et = view.findViewById(R.id.edit_text) 30 | val cb = view.findViewById(R.id.checkbox) 31 | 32 | val list = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 33 | listOf>( 34 | Pair(et, et.transitionName), 35 | Pair(cb, cb.transitionName) 36 | ) 37 | } else { 38 | listOf() 39 | } 40 | 41 | btn.setOnClickListener { 42 | mFragmentNavigation.pushFragment(newInstance(mInt + 1), list) 43 | } 44 | btn.text = """${javaClass.simpleName} $mInt""" 45 | } 46 | 47 | companion object { 48 | 49 | fun newInstance(instance: Int): FavoritesFragment { 50 | val args = Bundle() 51 | args.putInt(BaseFragment.ARGS_INSTANCE, instance) 52 | val fragment = FavoritesFragment() 53 | fragment.arguments = args 54 | return fragment 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/fragments/FoodFragment.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.fragments 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Bundle 5 | import android.view.View 6 | 7 | /** 8 | * Created by niccapdevila on 3/26/16. 9 | */ 10 | class FoodFragment : BaseFragment() { 11 | 12 | @SuppressLint("SetTextI18n") 13 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 14 | super.onViewCreated(view, savedInstanceState) 15 | btn.setOnClickListener { 16 | mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt + 1)) 17 | } 18 | btn.text = """${javaClass.simpleName} $mInt""" 19 | } 20 | 21 | companion object { 22 | 23 | fun newInstance(instance: Int): FoodFragment { 24 | val args = Bundle() 25 | args.putInt(BaseFragment.ARGS_INSTANCE, instance) 26 | val fragment = FoodFragment() 27 | fragment.arguments = args 28 | return fragment 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/fragments/FriendsFragment.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.fragments 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Bundle 5 | import android.view.View 6 | 7 | /** 8 | * Created by niccapdevila on 3/26/16. 9 | */ 10 | class FriendsFragment : BaseFragment() { 11 | 12 | 13 | @SuppressLint("SetTextI18n") 14 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 15 | super.onViewCreated(view, savedInstanceState) 16 | btn.setOnClickListener { 17 | mFragmentNavigation.pushFragment(FriendsFragment.newInstance(mInt + 1)) 18 | } 19 | btn.text = """${javaClass.simpleName} $mInt""" 20 | } 21 | 22 | companion object { 23 | 24 | fun newInstance(instance: Int): FriendsFragment { 25 | val args = Bundle() 26 | args.putInt(BaseFragment.ARGS_INSTANCE, instance) 27 | val fragment = FriendsFragment() 28 | fragment.arguments = args 29 | return fragment 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/fragments/NearbyFragment.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.fragments 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Bundle 5 | import android.view.View 6 | 7 | /** 8 | * Created by niccapdevila on 3/26/16. 9 | */ 10 | class NearbyFragment : BaseFragment() { 11 | 12 | @SuppressLint("SetTextI18n") 13 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 14 | super.onViewCreated(view, savedInstanceState) 15 | btn.setOnClickListener { 16 | mFragmentNavigation.pushFragment(NearbyFragment.newInstance(mInt + 1)) 17 | } 18 | btn.text = """${javaClass.simpleName} $mInt""" 19 | } 20 | 21 | companion object { 22 | 23 | fun newInstance(instance: Int): NearbyFragment { 24 | val args = Bundle() 25 | args.putInt(BaseFragment.ARGS_INSTANCE, instance) 26 | val fragment = NearbyFragment() 27 | fragment.arguments = args 28 | return fragment 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/ncapdevi/sample/fragments/RecentsFragment.kt: -------------------------------------------------------------------------------- 1 | package com.ncapdevi.sample.fragments 2 | 3 | import android.annotation.SuppressLint 4 | import android.os.Bundle 5 | import android.view.View 6 | 7 | /** 8 | * Created by niccapdevila on 3/26/16. 9 | */ 10 | class RecentsFragment : BaseFragment() { 11 | 12 | 13 | @SuppressLint("SetTextI18n") 14 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 15 | super.onViewCreated(view, savedInstanceState) 16 | btn.setOnClickListener { 17 | mFragmentNavigation.pushFragment(RecentsFragment.newInstance(mInt + 1)) 18 | } 19 | btn.text = """${javaClass.simpleName} $mInt""" 20 | } 21 | 22 | companion object { 23 | 24 | fun newInstance(instance: Int): RecentsFragment { 25 | val args = Bundle() 26 | args.putInt(BaseFragment.ARGS_INSTANCE, instance) 27 | val fragment = RecentsFragment() 28 | fragment.arguments = args 29 | return fragment 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_from_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_from_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_to_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_to_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-hdpi/ic_favorites.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-hdpi/ic_friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_nearby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-hdpi/ic_nearby.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-hdpi/ic_recents.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_restaurants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-hdpi/ic_restaurants.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-mdpi/ic_favorites.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-mdpi/ic_friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_nearby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-mdpi/ic_nearby.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-mdpi/ic_recents.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_restaurants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-mdpi/ic_restaurants.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xhdpi/ic_favorites.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xhdpi/ic_friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_nearby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xhdpi/ic_nearby.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xhdpi/ic_recents.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_restaurants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xhdpi/ic_restaurants.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxhdpi/ic_favorites.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxhdpi/ic_friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_nearby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxhdpi/ic_nearby.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxhdpi/ic_recents.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_restaurants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxhdpi/ic_restaurants.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxxhdpi/ic_favorites.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxxhdpi/ic_friends.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_nearby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxxhdpi/ic_nearby.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxxhdpi/ic_recents.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_restaurants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ncapdevi/FragNav/498317c96c4436edd219f2bc10aa9e4ec3a94720/app/src/main/res/drawable-xxxhdpi/ic_restaurants.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_bottom_tabs.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 |