AppHead
Head View like Facebook Messenger for Android.
Gradle:
(Please replace x, y and z with the latest version numbers: )
Usage
The most simple usage
Or using builders (proper for Java)
All available options
Or using builders (proper for Java)
Components
AppHead has 3 main components
- [ ] HeadView: the draggable & dismissable view.
- [ ] DimissView: the view at the bottom that acts as bounds within which the HeadView can be dimissed.
- [ ] BadgeView(optinal): displays the number of notifications.
Customize Components Layouts
In addition to configuring all options of the components, you also can define full custom components layouts.
To customize HeadView
, DimissView
or BadgeView
you must define the rootview as HeadView
, DimissView
or BadgeView
Options & Default Values
Headview.Args
Option | Type | Default |
---|---|---|
layoutRes | Layout Res | R.layout.app_head |
imageViewId | ID Res | R.layout.ivHead |
drawableRes | Drawable Res | 0(REQUIRED |
alpha | Float | 1f |
allowBounce | Boolean | true |
preserveScreenLocation | Boolean | true |
dismissOnClick | Boolean | true |
setupImage | ((ImageView) -> Unit)? | null |
onFinishInflate | ((HeadView) -> Unit)? | null |
onClick | ((HeadView) -> Unit)? | null |
onLongClick | ((HeadView) -> Unit)? | null |
onDismiss | ((HeadView) -> Unit)? | null |
DismissView.Args
Option | Type | Default |
---|---|---|
layoutRes | Layout Res | R.layout.dismiss_view |
imageViewId | ID Res | R.layout.ivDismiss |
drawableRes | Drawable Res | R.drawable.ic_dismiss_apphead |
scaleRatio | Double | 1.5 |
alpha | Float | 1f |
setupImage | ((ImageView) -> Unit)? | null |
onFinishInflate | ((DismissView) -> Unit)? | null |
BadgeView.Args
Option | Type | Default |
---|---|---|
layoutRes | Layout Res | R.layout.badge_view |
count | String | "" |
countTextViewId | ID Res | R.id.tvCount |
position | BadgeView.Position | BadgeView.Position.TOP_END |