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
,popFromStack
to 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
getFragmentInfos
to 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
ListItem
with search capability. - ListSelectableItem : Defines a
ListItem
that could be selected. - BaseListFragment : Uses
ListItem
to create list. OverrideloadListItemsInBackground
,onItemClicked
to get started. - BaseMutableListFragment : An extension of
BaseListFragment
with support for pagination, pull-to-refresh - BaseListSearchFragment : Allows you to create a list with search capabilities. Use
ListSearchableItem
with the same. - BaseListSelectionFragment : Allows you to create a list with ability to select items. Use
ListSelectableItem
with the same.
- CruxTextView, CruxEditText, CruxButton : Uses font passed in configuration by default. Override font using
font
attribute in XML orsetFont
method. - 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