{"id":21147608,"url":"https://github.com/malekkamel/apphead","last_synced_at":"2025-08-23T03:42:21.338Z","repository":{"id":90820829,"uuid":"220487015","full_name":"MalekKamel/AppHead","owner":"MalekKamel","description":"Head View like Facebook Messenger for Android.","archived":false,"fork":false,"pushed_at":"2020-02-23T20:04:00.000Z","size":17731,"stargazers_count":72,"open_issues_count":2,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-09T11:04:32.966Z","etag":null,"topics":["android","facebook","facebookmessenger","java","java-8","kotlin","kotlin-android","kotlin-language","kotlin-library","view"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MalekKamel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-08T14:47:20.000Z","updated_at":"2024-07-22T16:36:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"99392834-a52e-4bf3-a3e2-185ebdfd612c","html_url":"https://github.com/MalekKamel/AppHead","commit_stats":null,"previous_names":["malekkamel/apphead"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FAppHead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FAppHead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FAppHead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FAppHead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MalekKamel","download_url":"https://codeload.github.com/MalekKamel/AppHead/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225506368,"owners_count":17483515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","facebook","facebookmessenger","java","java-8","kotlin","kotlin-android","kotlin-language","kotlin-library","view"],"created_at":"2024-11-20T09:17:37.043Z","updated_at":"2024-11-20T09:17:37.915Z","avatar_url":"https://github.com/MalekKamel.png","language":"Kotlin","readme":"AppHead\n===========\n\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-AppHead-green.svg?style=flat )]( https://android-arsenal.com/details/1/7974 )\n\nHead View like Facebook Messenger for Android.\n\n\u003cimg src=\"https://github.com/ShabanKamell/AppHead/blob/master/blob/raw/demo_new.gif\" height=\"400\"\u003e\n\n#### Gradle:\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\ndependencies {\n     implementation 'com.github.ShabanKamell:AppHead:x.y.z'\n}\n```\n(Please replace x, y and z with the latest version numbers:  [![](https://jitpack.io/v/ShabanKamell/AppHead.svg)](https://jitpack.io/#ShabanKamell/AppHead))\n\n### Usage\nThe most simple usage\n\n``` kotlin\nAppHead.create(R.drawable.ic_messenger) {\n     headView { onClick {..} }\n }.show(activity)\n```\n\nOr using builders (proper for Java)\n\n``` kotlin\n builder = Head.Builder(R.drawable.icon).headView(HeadView.Args().onClick {..})\n AppHead(builder).show(activity)\n```\n\nAll available options\n``` kotlin\nAppHead.create(R.drawable.ic_messenger_red) {\n    headView {\n        layoutRes(R.layout.app_head_red, R.id.headImageView)\n        onClick {..}\n        onLongClick {..}\n        alpha(0.9f)\n        allowBounce(false)\n        onFinishInflate {..}\n        setupImage {..}\n        onDismiss {..}\n        dismissOnClick(false)\n        preserveScreenLocation(false)\n    }\n    badgeView {\n        count(\"100\")\n        position(BadgeView.Position.TOP_END)\n    }\n    dismissView {\n        alpha(0.5f)\n        scaleRatio(1.0)\n        drawableRes(R.drawable.ic_dismiss)\n        onFinishInflate {..}\n        setupImage {..}\n    }\n}.show(this)\n```\n\nOr using builders (proper for Java)\n\n``` kotlin\n// build HeadView\nval headViewArgs = HeadView.Args()\n        .layoutRes(R.layout.app_head_red, R.id.headImageView)\n        .onClick {..}\n        .onLongClick {..}\n        .alpha(0.8f)\n        .allowBounce(false)\n        .onFinishInflate {..}\n        .setupImage {..}\n        .onDismiss {..}\n        .dismissOnClick(false)\n        .preserveScreenLocation(false)\n\n// build DismissView\nval dismissViewArgs = DismissView.Args()\n        .alpha(0.5f)\n        .scaleRatio(1.0)\n        .drawableRes(R.drawable.ic_dismiss)\n        .onFinishInflate {..}\n        .setupImage {..}\n\n// build BadgeView\nval badgeViewArgs = BadgeView.Args()\n        .layoutRes(R.layout.badge_view, R.id.tvCount)\n        .position(BadgeView.Position.TOP_END)\n        .count(\"3333\")\n\nval builder = Head.Builder(R.drawable.ic_messenger_red)\n        .headView(headViewArgs)\n        .dismissView(dismissViewArgs)\n        .badgeView(badgeViewArgs)\n\nAppHead(builder).show(activity)\n```\n### Components\nAppHead has 3 main components\n- [ ] **HeadView**: the draggable \u0026 dismissable view.\n- [ ] **DimissView**: the view at the bottom that acts as bounds within which the **HeadView** can be dimissed.\n- [ ] **BadgeView**(optinal): displays the number of notifications.\n\n### Customize Components Layouts\nIn addition to configuring all options of the components, you also can define full custom components layouts.\nTo customize `HeadView`, `DimissView` or `BadgeView` \nyou must define the rootview as `HeadView`, `DimissView` or `BadgeView`\n\n``` xml\n\u003ccom.sha.apphead.HeadView \n    ..\u003e\n    \u003cImageView\n        android:id=\"@+id/headImageView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:srcCompat=\"@drawable/ic_messenger\"\n        android:layout_margin=\"4dp\"\n        /\u003e\n\u003c/com.sha.apphead.HeadView\u003e\n\n```\n\n``` xml\n\u003ccom.sha.apphead.DismissView \n   ..\u003e\n    \u003cImageView\n        android:id=\"@+id/dimissImageView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:srcCompat=\"@drawable/ic_dimiss\"\n        android:layout_margin=\"4dp\"\n        /\u003e\n\u003c/com.sha.apphead.DismissView\u003e\n```\n\n``` xml\n\u003ccom.sha.apphead.BadgeView\n    ..\u003e\n    \u003cTextView\n        android:id=\"@+id/tvCount\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        /\u003e\n\u003c/com.sha.apphead.BadgeView\u003e\n```\n\n### Options \u0026 Default Values\n#### Headview.Args\n\n|          **Option**                       | **Type**                | **Default** |\n| ------------------------------ | --------------------------- | ----------------------------- |\n| **layoutRes**                  |    Layout Res               | R.layout.app_head             |\n| **imageViewId**                |    ID Res                   | R.layout.ivHead               |\n| **drawableRes**                |    Drawable Res             | 0(REQUIRED                    |\n| **alpha**                      |    Float                    | 1f                            |\n| **allowBounce**                |    Boolean                  | true                          |\n| **preserveScreenLocation**     |    Boolean                  | true                          |\n| **dismissOnClick**             |    Boolean                  | true                          |\n| **setupImage**                 |    ((ImageView) -\u003e Unit)?   | null                          |\n| **onFinishInflate**            |    ((HeadView) -\u003e Unit)?    | null                          |\n| **onClick**                    |    ((HeadView) -\u003e Unit)?    | null                          |\n| **onLongClick**                |    ((HeadView) -\u003e Unit)?    | null                          |\n| **onDismiss**                  |    ((HeadView) -\u003e Unit)?    | null                          |\n\n#### DismissView.Args\n|          **Option**                       | **Type**                | **Default** |\n| ------------------------------ | --------------------------- | ----------------------------- |\n| **layoutRes**                  |    Layout Res               | R.layout.dismiss_view         |\n| **imageViewId**                |    ID Res                   | R.layout.ivDismiss            |\n| **drawableRes**                |    Drawable Res             | R.drawable.ic_dismiss_apphead |\n| **scaleRatio**                 |    Double                   | 1.5                           |\n| **alpha**                      |    Float                    | 1f                            |\n| **setupImage**                 |    ((ImageView) -\u003e Unit)?   | null                          |\n| **onFinishInflate**            |    ((DismissView) -\u003e Unit)? | null                          |\n\n#### BadgeView.Args\n|          **Option**                       | **Type**                | **Default** |\n| ------------------------------ | --------------------------- | ----------------------------- |\n| **layoutRes**                  |    Layout Res               | R.layout.badge_view           |\n| **count**                      |    String                   | \"\"                            |\n| **countTextViewId**            |    ID Res                   | R.id.tvCount                  |\n| **position**                   |    BadgeView.Position       | BadgeView.Position.TOP_END    |\n\n#### Look at 'sample' module for the full code. For more advanced example.\n\n## Credit\n[henrychuangtw/Android-ChatHead](https://github.com/henrychuangtw/Android-ChatHead)\n\n### 🛡 License\n\u003cdetails\u003e\n    \u003csummary\u003e\n        click to reveal License\n    \u003c/summary\u003e\n    \n```\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n\u003c/details\u003e\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalekkamel%2Fapphead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalekkamel%2Fapphead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalekkamel%2Fapphead/lists"}