{"id":23431153,"url":"https://github.com/akamud/autofittextview-xamarin.android","last_synced_at":"2025-04-12T23:33:06.469Z","repository":{"id":142257244,"uuid":"44455002","full_name":"akamud/AutoFitTextView-Xamarin.Android","owner":"akamud","description":"Xamarin bindings for android-autofittextview by @grantland","archived":false,"fork":false,"pushed_at":"2015-11-17T22:10:03.000Z","size":650,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T17:42:12.705Z","etag":null,"topics":["xamarin","xamarin-android","xamarin-bindings","xamarin-components","xamarin-plugin"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akamud.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}},"created_at":"2015-10-17T21:17:59.000Z","updated_at":"2023-11-19T02:31:52.000Z","dependencies_parsed_at":"2023-03-13T18:37:28.289Z","dependency_job_id":null,"html_url":"https://github.com/akamud/AutoFitTextView-Xamarin.Android","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/akamud%2FAutoFitTextView-Xamarin.Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamud%2FAutoFitTextView-Xamarin.Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamud%2FAutoFitTextView-Xamarin.Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamud%2FAutoFitTextView-Xamarin.Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akamud","download_url":"https://codeload.github.com/akamud/AutoFitTextView-Xamarin.Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647259,"owners_count":21139081,"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":["xamarin","xamarin-android","xamarin-bindings","xamarin-components","xamarin-plugin"],"created_at":"2024-12-23T09:53:40.146Z","updated_at":"2025-04-12T23:33:06.443Z","avatar_url":"https://github.com/akamud.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoFitTextView-Xamarin.Android\n![](https://raw.githubusercontent.com/akamud/AutoFitTextView-Xamarin.Android/master/art/Icon.png)  \nXamarin bindings for [android-autofittextview](https://github.com/grantland/android-autofittextview) by [@grantland](https://github.com/grantland)\n\nA TextView that automatically resizes text to fit perfectly within its bounds.\n\n## Installing\n![](https://img.shields.io/nuget/v/AutoFitTextView-Xamarin.Android.svg?style=flat)  \n[NuGet package](https://www.nuget.org/packages/AutoFitTextView-Xamarin.Android/) available:\n```\nPM\u003e Install-Package AutoFitTextView-Xamarin.Android\n```\n\n## Gif example\n\n![](https://raw.githubusercontent.com/akamud/AutoFitTextView-Xamarin.Android/master/autofit.gif)\n\n## Using\nYou can use the defined AutofitTextView widget:\n```XML\n\u003cme.grantland.widget.AutofitTextView\n    android:id=\"@+id/output_autofit\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:text=\"@string/example\"\n    android:textSize=\"50sp\"\n    android:gravity=\"center\"\n    android:singleLine=\"true\" /\u003e\n```\n\nYou can also enable any component that has a TextView to act like a AutofitTextView using the `AutofitLayout`:\n```XML\n\u003cme.grantland.widget.AutofitLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\u003e\n    \u003cButton\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:singleLine=\"true\"\n        android:text=\"This is a really long string that will be automatically resized to fit in a single line\"/\u003e\n\u003c/me.grantland.widget.AutofitLayout\u003e\n```\n\nIf you need to set it programmatically:\n```C#\nAutofitHelper.Create(textview):\n```\n\nYou can customize AutofitTextView attributes, just declare the `res-auto` namespace:\n```XML\nxmlns:autofit=\"http://schemas.android.com/apk/res-auto\"\n```\n\nThen you can set these attributes:\n\nAttribute | Description  \n:----: | :-------:  \nminTextSize | Sets the minimum size the text will have, even when resizing to fit   \nprecision | Amount of precision used to calculate the correct text size to fit within its bounds. Lower precision is more precise and takes more time  \nsizeToFit | Defines whether to automatically resize text to fit to the view's bounds. If set to `false` the widget will act like a normal TextView\n\n## License\n[MIT License](https://github.com/akamud/AutoFitTextView-Xamarin/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamud%2Fautofittextview-xamarin.android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakamud%2Fautofittextview-xamarin.android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamud%2Fautofittextview-xamarin.android/lists"}