{"id":17964839,"url":"https://github.com/faltenreich/textinputview","last_synced_at":"2025-03-25T06:31:05.067Z","repository":{"id":128645785,"uuid":"118363094","full_name":"Faltenreich/TextInputView","owner":"Faltenreich","description":"Permanent hint for EditText","archived":false,"fork":false,"pushed_at":"2021-07-29T15:44:52.000Z","size":1574,"stargazers_count":29,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T09:40:40.208Z","etag":null,"topics":["android","edittext","hint","textinputlayout"],"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/Faltenreich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-01-21T18:45:16.000Z","updated_at":"2023-04-04T04:29:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"51ef3ebb-2f03-4e5c-8366-9a0094d0458c","html_url":"https://github.com/Faltenreich/TextInputView","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Faltenreich%2FTextInputView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Faltenreich%2FTextInputView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Faltenreich%2FTextInputView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Faltenreich%2FTextInputView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Faltenreich","download_url":"https://codeload.github.com/Faltenreich/TextInputView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245413651,"owners_count":20611351,"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","edittext","hint","textinputlayout"],"created_at":"2024-10-29T12:09:06.067Z","updated_at":"2025-03-25T06:31:05.060Z","avatar_url":"https://github.com/Faltenreich.png","language":"Kotlin","readme":"# TextInputView\n\n[![MavenCentral](https://maven-badges.herokuapp.com/maven-central/com.faltenreich/textinputview/badge.svg?style=flat)](https://mvnrepository.com/artifact/com.faltenreich/textinputview)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-TextInputView-green.svg?style=flat)](https://android-arsenal.com/details/1/6981)\n\n*A different approach to the [TextInputLayout](https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html)*\n\n\u003cimg src=\"./images/preview.gif\" width=\"250\"\u003e\n\nInstead of preserving extra space for repositioning its hint, the TextInputView will place it into the embedded EditText.\nThe Material Design Guidelines are being respected by adapting primary- and accent colors as well as the style of the target hint.\n\n## Preview\n\n\u003cimg src=\"./images/preview_unfocused.png\" width=\"200\"\u003e\n\n\u003cimg src=\"./images/preview_focused.png\" width=\"200\"\u003e\n\n\u003cimg src=\"./images/preview_overlap.png\" width=\"200\"\u003e\n\n## Features\n- **More space for you:** Reduce the extra space for a permanent hint to an absolute minimum\n- **Customization:** Adjust textSize, textColor, padding and overlap action of the hint\n- **Gravity:** Support for Gravity.START (Gravity.LEFT), Gravity.END (Gravity.RIGHT) - and even Gravity.CENTER\n- **Compound drawables:** Support for setError() and other compound drawables\n- **RTL:** Support for right-to-left configurations\n- **Minimum footprint:** No dependencies *(other than org.jetbrains.kotlin:kotlin-stdlib-jre7)*\n\n### Getting Started\n\n##### Gradle\n```gradle\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n}\n```gradle\ndependencies {\n    implementation 'com.faltenreich:textinputview:\u003cversion\u003e'\n}\n```\n\n##### XML\n```xml\n\u003ccom.faltenreich.textinputview.TextInputView\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    app:overlapAction=\"push\"\u003e\n    \n    \u003cEditText\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:hint=\"Every pixel counts\"/\u003e\n        \n\u003c/com.faltenreich.textinputview.TextInputView\u003e\n```\n\n##### Java\n```java\npublic class MainActivity extends AppCompatActivity {\n\n    public MainActivity {\n        super(R.layout.activity_main);\n    }\n    \n    @Override\n    public void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        TextInputView textInputView = new TextInputView(editText);\n    }\n}\n\n```\n\n##### Kotlin\n```kotlin\nclass MainActivity : AppCompatActivity(R.layout.activity_main) {\n    \n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        val textInputView = TextInputView(editText)\n    }\n}\n```\n\n### Configuration\n\nProperty | Type | Description\n--- | --- | ---\nandroid:textColor | color | Applied when the embedded EditText loses focus (defaults to textColor of the hint)\nandroid:textSize | dimension | Text size of the hint (defaults to textSize of the hint)\nandroid:tint | color | Applied when the embedded EditText gets focused (defaults to tint of the hint)\noverlapAction | enum | Applied when the input of the embedded EditText overlaps the hint (options: push, toggle) (defaults to toggle)\n\n### FAQ\n\n**Why this library?**\n\nI adore the Material Design Guidelines. For me they are an incredible source of wisdom for non-designers.\nNo longer do I have to spent dozens of hours for the fine details of my user interfaces.\nNow I have more time to do the thing I love the most: developing sourcecode that keeps everything together.\n\nThe InputTextLayout is one of the many fine Material Design Components.\nIt helps users navigating a form by providing a permanent hint.\nOne particular problem with the InputTextLayout is the additional screen space it preserves for positioning its hint.\nNot only does this lead to vertically larger user interfaces, \nbut the preserved space stays completely empty until a user input has been given - and is therefor temporarily useless.\n\n**How does the TextInputView work?**\n\nThe TextInputLayout wraps a given EditText and replaces its hint with a TextView that stays within the bounds of the original view.\nTherefor it does not preserve additional screen space and stays there as long as it fits into the original EditText alongside the user input - \notherwise it will be pushed to the side (or optionally be hidden immediately).\nThe latter should rarely occur as the user input of most forms stays relatively short.\n\n**What about gravity?**\n\nThe gravity of the embedded EditText may be set to Gravity.START, Gravity.END, Gravity.CENTER -\nor to the obsolete Gravity.LEFT and Gravity.RIGHT, if you insist.\nThe hint of the TextInputView will adjust accordingly and either be moved to the left or right to make place for the user input.\n\n**What about EditText.setError() or other compound drawables?**\n\nThe hint of the TextInputView will be positioned right before (drawableEnd) or after (drawableStart) a compound drawable, \nincluding its compoundDrawablePadding.\n\n**What about RTL?**\n\nRight-to-left input is supported throughout using the Android resource system (res/values-ldrtl).\nThe calculations are flipped in order to respect the inverted alignments.\n\n### Third-party licenses\n\nThis software uses following technologies with great appreciation:\n\n* [AndroidX](https://developer.android.com/jetpack/androidx)\n* [gradle-maven-publish-plugin](https://github.com/vanniktech/gradle-maven-publish-plugin)\n* [Material Components for Android](https://material.io/components)\n\n### License\n\nCopyright 2021 Philipp Fahlteich\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.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaltenreich%2Ftextinputview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaltenreich%2Ftextinputview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaltenreich%2Ftextinputview/lists"}