A bootstrap library for Android that takes care of all the heavy lifting
- Add the following to top-level build.gradle:
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
- In your app-level build.gradle, add:
compile 'com.github.gauravsapiens:crux:v0.1'
- Extend your application class and call
Crux.initialize(Context)orCrux.initialize(Context, Configuration)ononCreate()
- Activity - SingleStackActivity, DrawerActivity, PagerActivity
- Fragment - BaseListFragment, BaseMutableListFragment, BaseListSearchFragment, BaseListSelectableFragment
- View - CruxTextView, CruxEditText, CruxImageView, CruxButton, CruxImageButton
- Database - BaseDao, DataDump
- Utils - ClassUtils, CollectionUtils, FragmentUtil, IOUtils, MapUtils, PreConditions, ResourceUtils, StringUtils, ToastUtils, ViewUtils
- SingleStackActivity : Allows you to create an activity with single stack. Use
pushToStack,popFromStackto push/pop fragment - DrawerActivity : Gives you an option to enable/disable drawer & configure navigation drawer. Override
isNavDrawerEnabled&getDrawerMenu - PagerActivity : Allows you to create an activity with ViewPager. Override
getFragmentInfosto get started.
- ListItem : Defines an item used for constructing list. Implement this for defining any view you wish to use in list.
- ListSearchableItem : Defines a
ListItemwith search capability. - ListSelectableItem : Defines a
ListItemthat could be selected. - BaseListFragment : Uses
ListItemto create list. OverrideloadListItemsInBackground,onItemClickedto get started. - BaseMutableListFragment : An extension of
BaseListFragmentwith support for pagination, pull-to-refresh - BaseListSearchFragment : Allows you to create a list with search capabilities. Use
ListSearchableItemwith the same. - BaseListSelectionFragment : Allows you to create a list with ability to select items. Use
ListSelectableItemwith the same.
- CruxTextView, CruxEditText, CruxButton : Uses font passed in configuration by default. Override font using
fontattribute in XML orsetFontmethod. - CruxImageView : Provides API to load image from network and bundled resources.
- BaseDao : Use this for any CRUD operation in local database. Uses SQLite as database & ActiveAndroid as ORM
- DataDump : Use this to dump any data in local file system.
The repository includes a sample project built using crux called HappyShop. Please refer to it for reference.
Please fork this repository and contribute back using pull requests. Any contributions would be greatly appreciated