{"id":21130273,"url":"https://github.com/vcaen/AndroidAutoHideHeader","last_synced_at":"2025-07-09T01:33:03.374Z","repository":{"id":35888527,"uuid":"40174626","full_name":"vcaen/AndroidAutoHideHeader","owner":"vcaen","description":"A layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up","archived":false,"fork":false,"pushed_at":"2015-08-13T13:22:02.000Z","size":14220,"stargazers_count":48,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-18T03:00:45.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vcaen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-04T09:10:05.000Z","updated_at":"2022-04-22T16:38:50.000Z","dependencies_parsed_at":"2022-08-30T13:11:20.827Z","dependency_job_id":null,"html_url":"https://github.com/vcaen/AndroidAutoHideHeader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaen%2FAndroidAutoHideHeader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaen%2FAndroidAutoHideHeader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaen%2FAndroidAutoHideHeader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vcaen%2FAndroidAutoHideHeader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vcaen","download_url":"https://codeload.github.com/vcaen/AndroidAutoHideHeader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476370,"owners_count":17480215,"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":[],"created_at":"2024-11-20T05:32:30.390Z","updated_at":"2024-11-20T05:32:40.710Z","avatar_url":"https://github.com/vcaen.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"# AndroidAutoHideHeader\n[ ![Download](https://api.bintray.com/packages/vcaen/maven/androidautohideheader/images/download.svg) ](https://bintray.com/vcaen/maven/androidautohideheader/_latestVersion)\n[ ![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AndroidAutoHideHeader-blue.svg?style=flat)](http://android-arsenal.com/details/1/2285)\n\nA layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up\n\n## Demo\n\n![Demo gif](https://raw.githubusercontent.com/vcaen/AndroidAutoHideHeader/master/example.gif)\n\n\n## Import it !\n\n\nIn your gradle \"app\" :\n\n```\ndependencies {\n    compile 'com.vcaen:androidautohideheader:1.2'\n}\n```\n\n\n## Usage\n\n### Basics\n\n#### Programmatically\nIn you xml, add the '''AutoHideHeaderLayout''' : \n\n```xml\n    \u003ccom.vcaen.androidautohideheader.AutoHideHeaderLayout\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/autohideview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:fixedIfChildSmall=\"false\"\n        app:fixed=\"false\"/\u003e\n``` \n\nThen in your java code : \n ```java\n    AutoHideHeaderLayout view  = (AutoHideHeaderLayout) findViewById(R.id.autohideview);\n    ListView listView = new ListView(this);\n    view.setHeader(R.layout.header); // You can also set the View object\n    view.setBodyView(listView);\n```\n\n#### XML Only\n\nYou can add the children directly into the XML by adding them inside the ```AutoHideHeaderLayout``` :\n```xml\n\u003cRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                xmlns:tools=\"http://schemas.android.com/tools\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                tools:context=\".MainActivity\"\u003e\n\n    \u003ccom.vcaen.androidautohideheader.AutoHideHeaderLayout\n        android:id=\"@+id/autohideview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\u003e\n\n        \u003cRelativeLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"100dp\"\u003e\n\n            \u003cImageView\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:scaleType=\"centerCrop\"\n                android:src=\"@drawable/bg\"/\u003e\n\n        \u003c/RelativeLayout\u003e\n\n        \u003cScrollView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\u003e\n\n            \u003cLinearLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"vertical\"\u003e\n\n            \u003c/LinearLayout\u003e\n        \u003c/ScrollView\u003e\n    \u003c/com.vcaen.androidautohideheader.AutoHideHeaderLayout\u003e\n\n\u003c/RelativeLayout\u003e\n```\n### Options :\n\nThe following options are available :\n\n  * Fix the header\n\n    *Java*\n    ```java\n        autoHideHeaderLayout.setFixed(Boolean)\n    ```\n\n    *XML*\n    ```xml\n        app:fixed=\"true\"\n    ```\n\n\n  * Fix the header if the child is smaller than the view. Only works if the child has height set at ```wrap_content```\n\n    *Java*\n    ```java\n        autoHideHeaderLayout.setFixedIfChildSmall(Boolean)\n    ```\n\n    *XML*\n    ```xml\n        app:fixedIfChildSmall=\"true\"\n    ```\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Vadim Caen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvcaen%2FAndroidAutoHideHeader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvcaen%2FAndroidAutoHideHeader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvcaen%2FAndroidAutoHideHeader/lists"}