https://github.com/emartech/android-mobile-inbox
https://github.com/emartech/android-mobile-inbox
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/emartech/android-mobile-inbox
- Owner: emartech
- License: apache-2.0
- Created: 2020-06-15T14:54:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T06:51:02.000Z (almost 2 years ago)
- Last Synced: 2025-02-09T18:35:45.962Z (over 1 year ago)
- Language: Kotlin
- Size: 243 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# android-mobile-inbox
[](https://api.reuse.software/info/github.com/emartech/android-mobile-inbox)
With [Emarsys SDK](https://github.com/emartech/android-emarsys-sdk), you can [fetch inbox messages](https://github.com/emartech/android-emarsys-sdk/wiki#7-messageinbox) for a user.
This library is a plug and play inbox, that you can reuse and customise to your own branding.
Setup
-----
Make sure to already have the Android [Emarsys SDK](https://github.com/emartech/android-emarsys-sdk) added as a dependency in your Gradle file, and configured by calling `Emarsys.setup()` in your Application class, then add the `emarsys-mobile-inbox` module to your project.
The project provides different components to suit a variety of use-cases:
- `EmarsysInboxActivity` - An Activity that manages its own Fragments and lifecycles. Minimum setup required. Add it to your `AndroidManifest.xml` file and use an Intent to launch it.
- `EmarsysInboxFragment` - A Fragment that manages the navigation between `EmarsysInboxListFragment` and `EmarsysInboxDetailFragment`. Can be embedded in any Activity as the [primary navigation fragment](https://developer.android.com/guide/navigation/navigation-programmatic).
- `EmarsysInboxListFragment` - A Fragment that shows a list of messages in the user's inbox. Can be embedded in any Activity and will use `EmarsysInboxViewModel` to notify it about any events, such as a message being selected. The Activity can then choose to either handle the selected Message itself, or transition to a `EmarsysInboxDetailFragment`.
- `EmarsysInboxViewModel` - A ViewModel that can be used to easily extend your own Activities and Fragments with the Emarsys Messaging Inbox functionality.
Requirements
----
- The minimum Android version should be at least API level 24.
- Requires compileSdkVersion 31 or higher.
- Emarsys SDK is using AndroidX.
## Configurable variables
----
```kotlin
EmarsysInboxConfig.headerView = { context ->
createHeaderView(context)
}
EmarsysInboxConfig.headerBackgroundColor =
EmarsysInboxConfig.headerForegroundColor =
EmarsysInboxConfig.bodyBackgroundColor =
EmarsysInboxConfig.bodyForegroundColor =
EmarsysInboxConfig.bodyTintColor =
EmarsysInboxConfig.bodyHighlightTintColor =
EmarsysInboxConfig.activityIndicatorColor =
EmarsysInboxConfig.notOpenedViewColor =
EmarsysInboxConfig.imageCellBackgroundColor =
EmarsysInboxConfig.favImageOff =
EmarsysInboxConfig.favImageOn =
EmarsysInboxConfig.defaultImage =
EmarsysInboxConfig.highPriorityImage =
EmarsysInboxConfig.actionEventHandler = { context, eventName, payload ->
}
EmarsysInboxConfig.actionButtonStyler = { button ->
button.setTextColor(Color.WHITE)
button.cornerRadius = 10
}
```
TODO
----
- Distribution with AAR/Maven.
Submodules
-----
If you want to add this repository as a submodule of your project, so that you can pull new changes directly to your project and not have the inbox as a part of it:
- In terminal, run:
`git submodule add https://github.com/emartech/android-mobile-inbox ` and `git submodule update --init --recursive`
- settings.gradle should look like this:
```
include ':'
include ':app'
rootProject.name = ""
project(':').projectDir = new File('/emarsys-mobile-inbox')
```
- build.gradle (:app) should include:
`implementation project(':')`
- If, at any moment, the inbox folder appears empty, run `git submodule update --init --recursive` . If it doesn't appear at all, run `git submodule add --force https://github.com/emartech/android-mobile-inbox `
Contributing
----
Should you have any suggestions or bug reports, please raise an [Emarsys support request](https://help.emarsys.com/hc/en-us/articles/360012853058-Support-at-Emarsys-Raising-a-support-request).
Code of Conduct
----
Please see our [Code of Conduct](https://github.com/emartech/.github/blob/main/CODE_OF_CONDUCT.md) for detail.
Licensing
----
Please see our [LICENSE](https://github.com/emartech/android-mobile-inbox/blob/master/LICENSE) for copyright and license information.