Android Library that can easily load any fragment in a provided container. library encourage us to use maximum fragments which reducing application size. With holdy you can easily deal with many fragments.
1. Reduce application size with holdy
2. Deal with fragments easily with holdy
3. Highly customisable
This library is using androidx, If you face any problems related to AppCompat library make sure you project is updated with androidx.
This library is available in jitPack which is the default Maven repository used in Android Studio.
Step 1. Add it in your root build.gradle at the end of repositories
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency in your apps module build.gradle
dependencies {
implementation 'com.github.manojbhadane:Holdy:v1.6.4'
}
This Mandatory style, configure once in application class. you can create your own style for each holder but parent for each style should be 'Theme.AppCompat.Light.NoActionBar'
<style name="HoldyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Set style for all holders
Holdy.init(R.style.HoldyTheme);
or
Holdy.init(R.style.HoldyTheme, typefaceHere);
Holdy.Builder(this)
.setFragment(LoginFragment.class.getCanonicalName())
.build();
Holdy.Builder(this)
.setTitle("Home")
.setShowToolbar(true)
.setBundle(new Bundle())
.setToolbarBackBtn(true)
.setOrientationToPortrait()
.setTheme(R.style.HomeTheme)
.setSoftInputMode(windowSoftInputMode)
.setFragment(LoginFragment.class.getCanonicalName())
.build();
There are several customization options available which you can use to completely change the look-and-feel and functionality of this view to match your needs.
You can also programatically change the properties of the view, thereby having more control over it.
1. Title for fragment
setTitle("Home")
2. Toolbar visibility for fragment
setShowToolbar(true)
3. Send bundle to fragment
setBundle(new Bundle())
4. Toolbar Back button visibility for fragment
setToolbarBackBtn(true)
5. Custom theme for fragment
setTheme(R.style.HomeTheme)
6. Fragment that needs to be load
setFragment(LoginFragment.class.getCanonicalName())
7. Set window soft input mode
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
8. setOrientationToPortrait
- Fincal : You can download the app from Google Play:
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.
Android & Backend Developer.
MIT License
Copyright (c) 2019 Manoj Bhadane
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.