{"id":13645100,"url":"https://github.com/Cleveroad/AdaptiveTableLayout","last_synced_at":"2025-04-21T13:31:45.496Z","repository":{"id":18070204,"uuid":"82663956","full_name":"Cleveroad/AdaptiveTableLayout","owner":"Cleveroad","description":"Library that makes it possible to read, edit and write CSV files","archived":false,"fork":false,"pushed_at":"2024-04-01T13:50:38.000Z","size":8453,"stargazers_count":1901,"open_issues_count":20,"forks_count":237,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-04-14T13:03:18.091Z","etag":null,"topics":["android-library","awesome-list","csv","csv-files","csv-format","csv-reader"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Cleveroad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-02-21T09:56:26.000Z","updated_at":"2025-04-12T12:33:57.000Z","dependencies_parsed_at":"2024-04-07T20:00:29.352Z","dependency_job_id":"0a20d877-da24-4a81-9c9f-b9e4cf24c521","html_url":"https://github.com/Cleveroad/AdaptiveTableLayout","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/Cleveroad%2FAdaptiveTableLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FAdaptiveTableLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FAdaptiveTableLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cleveroad%2FAdaptiveTableLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cleveroad","download_url":"https://codeload.github.com/Cleveroad/AdaptiveTableLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249327998,"owners_count":21251977,"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-library","awesome-list","csv","csv-files","csv-format","csv-reader"],"created_at":"2024-08-02T01:02:26.914Z","updated_at":"2025-04-21T13:31:44.513Z","avatar_url":"https://github.com/Cleveroad.png","language":"Java","readme":"# AdaptiveTableLayout [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) \u003cimg src=\"https://www.cleveroad.com/public/comercial/label-android.svg\" height=\"19\"\u003e \u003ca href=\"https://www.cleveroad.com/?utm_source=github\u0026utm_medium=label\u0026utm_campaign=contacts\"\u003e\u003cimg src=\"https://www.cleveroad.com/public/comercial/label-cleveroad.svg\" height=\"19\"\u003e\u003c/a\u003e\n![Header image](/images/header.png)\n\n## Welcome the new CSV Library AdaptiveTableLayout for Android by Cleveroad\n\nPay your attention to our new library that makes it possible to read, edit and write CSV files. If you use Android-based device, you can easily use our library for implementation of all aforementioned actions. In addition, you will be able to change rows and columns, display the picture via link, and align the required data. It will surely help you cope with your tasks faster and make your output higher. AdaptiveTableLayout library is at your disposal.\n\n![Demo image](/images/demo.gif)\n\n#### Take a look at the animation of \u003cstrong\u003e\u003ca target=\"_blank\" href=\"https://www.youtube.com/watch?v=YTwpEPIlhuE\"\u003eAdaptiveTableLayout for Android on YouTube\u003c/a\u003e\u003c/strong\u003e in HD quality. For using this library in a valuable way, you can find our CSV Editor app on the \u003ca target=\"_blank\"  href=\"https://play.google.com/store/apps/details?id=com.cleveroad.tablelayout\"\u003eGoogle Play Store\u003c/a\u003e or on \u003ca target=\"_blank\"  href=\"https://appetize.io/app/wgacjavwr57fec241bq802gzcg?device=nexus5\u0026scale=75\u0026orientation=portrait\u0026osVersion=7.0\"\u003eAppetize\u003c/a\u003e.\n[![Awesome](/images/youtube.png)](https://www.youtube.com/watch?v=YTwpEPIlhuE)[![Awesome](/images/google-play.png)](https://play.google.com/store/apps/details?id=com.cleveroad.tablelayout)[![Awesome](/images/appertize.png)](https://appetize.io/app/wgacjavwr57fec241bq802gzcg?device=nexus5\u0026scale=75\u0026orientation=portrait\u0026osVersion=7.0)\n\nThe main goal of the library is to apply all its functions in the process of working with CSV files. Moreover, it will give you a competitive edge over others. \n\n[![Awesome](/images/logo-footer.png)](https://www.cleveroad.com/?utm_source=github\u0026utm_medium=label\u0026utm_campaign=contacts)\n\u003cbr/\u003e\n## Setup and usage\n### Installation\nby gradle : \n```groovy\ndependencies {\n    implementation \"com.cleveroad:adaptivetablelayout:1.2.1\"\n}\n```\n### Features ###\nLibrary consists of three parts:\n- AdaptiveTableLayout (View)\n- LinkedAdaptiveTableAdapter (Adapter)\n- ViewHolderImpl (ViewHolder)\n\n### Usage ###\n#### AdaptiveTableLayout ####\n```XML\n  \u003ccom.cleveroad.adaptivetablelayout.AdaptiveTableLayout\n        android:id=\"@+id/tableLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"      \n        app:cellMargin=\"1dp\"\n        app:fixedHeaders=\"true\"\n        app:solidRowHeaders=\"true\"\n        app:dragAndDropEnabled=\"true\"/\u003e\n```\n|  attribute name | description |\n|---|---|\n| cellMargin  | margin between cards |\n| fixedHeaders  | fixed headers mode. If enable, headers always will be displayed in the corners. |\n| solidRowHeaders  | solid row headers mode. If enable, row header will change its position with dragging row. |\n| dragAndDropEnabled | drag and drop mode. If enable, column or row will change its position with dragging after long press on row or column header. |\n\n```groovy\n// Return fixed headers mode\nboolean isHeaderFixed(); \n\n// Return solid row headers mode\nboolean isSolidRowHeader()\n\n// Return drag and drop mode\nboolean isDragAndDropEnabled()\n\n// Return true if layout direction is RightToLeft\nboolean isRTL()\n\n// Set fixed headers mode\nvoid setHeaderFixed(boolean headerFixed)\n\n// Set solid row headers mode\nvoid setSolidRowHeader(boolean solidRowHeader)\n1.2.0\n// Set drag and drop mode\nvoid setDragAndDrow(boolean enabled)\n\n/**\n * Set adapter with IMMUTABLE data.\n * Create wrapper with links between layout rows, columns and data rows, columns.\n * On drag and drop event just change links but not change data in adapter.\n */\nvoid setAdapter(@Nullable AdaptiveTableAdapter adapter)\n\n/**\n * Set adapter with MUTABLE data.\n * You need to implement switch rows and columns methods.    \n * DO NOT USE WITH BIG DATA!!\n */\nvoid setAdapter(@Nullable DataAdaptiveTableLayoutAdapter adapter)\n\n// Notify any registered observers that the data set has changed.\nvoid notifyDataSetChanged()\n\n// Notify any registered observers that the item has changed.\nvoid notifyItemChanged(int rowIndex, int columnIndex)\n\n// Notify any registered observers that the row with rowIndex has changed.\nvoid notifyRowChanged(int rowIndex)\n\n// Notify any registered observers that the column with columnIndex has changed.\nvoid notifyColumnChanged(int columnIndex)\n```\n#### Adapter ####\nYou could use adapter interfaces: AdaptiveTableAdapter and DataAdaptiveTableLayoutAdapter. But to simplify the usage, library contains base adapters: \u003cb\u003eBaseDataAdaptiveTableLayoutAdapter\u003c/b\u003e and \u003cb\u003eLinkedAdaptiveTableAdapter\u003c/b\u003e.\n\n\u003cb\u003eBaseDataAdaptiveTableLayoutAdapter\u003c/b\u003e - simple adapter which works with light data. WARNING! on each row/column switch, original data will be changed. \n\n\u003cb\u003eLinkedAdaptiveTableAdapter\u003c/b\u003e - adapter which works with heavy data. WARNING! This type of adapter doesn't change original data. It contains matrix with changed items with links on it. To get changed data you need use AdaptiveTableLayout.getLinkedAdapterRowsModifications() and AdaptiveTableLayout.getLinkedAdapterColumnsModifications().\nDon't forget to check AdaptiveTableLayout.isSolidRowHeader() flag. If it's false, you need to ignore switching first elemet in each row.\n\n\u003cb\u003eFor both adapters you need to know all rows/columns widths, heights and rows/columns count before set adapter to AdaptiveTableLayout.\u003c/b\u003e\n#### Fragment/Activity usage ####\n```groovy\nmTableLayout = (AdaptiveTableLayout) view.findViewById(R.id.tableLayout);\n...\nmTableAdapter = new SampleLinkedTableAdapter(getContext(), mCsvFileDataSource);\nmTableAdapter.setOnItemClickListener(...);\nmTableAdapter.setOnItemLongClickListener(...);\nmTableLayout.setAdapter(mTableAdapter);\n...\nmTableLayout.setHeaderFixed(true);\nmTableLayout.setSolidRowHeader(true);\nmTableAdapter.notifyDataSetChanged();\n```\n#### XML usage ####\n```groovy\n \u003ccom.cleveroad.adaptivetablelayout.AdaptiveTableLayout\n        android:id=\"@+id/tableLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_below=\"@+id/toolbar\"\n        app:cellMargin=\"1dp\"\n        app:fixedHeaders=\"true\"\n        app:solidRowHeaders=\"true\"\n        app:dragAndDropEnabled=\"true\"/\u003e\n```\n#### Adapter usage ####\n\u003ca href=\"sample/src/main/java/com/cleveroad/sample/adapter/SampleLinkedTableAdapter.java\"\u003e Adapter sample \u003c/a\u003e\n\n## Changelog\nSee [changelog history].\n\n### Support ###\nIf you have any questions, issues or propositions, please create a \u003ca href=\"../../issues/new\"\u003enew issue\u003c/a\u003e in this repository.\n\nIf you want to hire us, send an email to sales@cleveroad.com or fill the form on \u003ca href=\"https://www.cleveroad.com/contact\"\u003econtact page\u003c/a\u003e\n\nFollow us:\n\n[![Awesome](/images/social/facebook.png)](https://www.facebook.com/cleveroadinc/)   [![Awesome](/images/social/twitter.png)](https://twitter.com/cleveroadinc)   [![Awesome](/images/social/google.png)](https://plus.google.com/+CleveroadInc)   [![Awesome](/images/social/linkedin.png)](https://www.linkedin.com/company/cleveroad-inc-)   [![Awesome](/images/social/youtube.png)](https://www.youtube.com/channel/UCFNHnq1sEtLiy0YCRHG2Vaw)\n\u003cbr/\u003e\n### License ###\n* * *\n    The MIT License (MIT)\n    \n    Copyright (c) 2016 Cleveroad Inc.\n    \n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n    \n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n\n[changelog history]: /CHANGELOG.md\n","funding_links":[],"categories":["表格(Table)","[Java](#java)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCleveroad%2FAdaptiveTableLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCleveroad%2FAdaptiveTableLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCleveroad%2FAdaptiveTableLayout/lists"}