{"id":17713519,"url":"https://github.com/jkasdbt/DataGridView","last_synced_at":"2025-04-21T03:32:33.819Z","repository":{"id":276786465,"uuid":"926029577","full_name":"jkasdbt/DataGridView","owner":"jkasdbt","description":"DataGridView is an Android library for displaying tabular data consisting of rows and columns.","archived":false,"fork":true,"pushed_at":"2024-12-13T01:41:03.000Z","size":31166,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-26T20:38:22.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hasanelfalakiy/DataGridView","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkasdbt.png","metadata":{},"created_at":"2025-02-02T11:28:59.000Z","updated_at":"2025-02-02T11:29:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jkasdbt/DataGridView","commit_stats":null,"previous_names":["jkasdbt/datagridview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkasdbt%2FDataGridView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkasdbt%2FDataGridView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkasdbt%2FDataGridView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkasdbt%2FDataGridView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkasdbt","download_url":"https://codeload.github.com/jkasdbt/DataGridView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249991170,"owners_count":21357215,"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","android-gridview","gridview","gridview-adapter"],"created_at":"2024-10-25T10:05:08.498Z","updated_at":"2025-04-21T03:32:33.812Z","avatar_url":"https://github.com/jkasdbt.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align =\"center\"\u003e\u003cimg width='149px%' height='149px' src='images/ic_grid.png'\u003e\u003c/p\u003e\n\u003ch1 align =\"center\"\u003eDataGridView\u003c/h1\u003e\n\n\n### Screenshots\n\n - basic style without color pattern\n\u003cp align =\"center\"\u003e\u003cimg src=\"images/grid1.jpg\" alt=\"GeneralAppearance\" width=\"76%\" align=\"bottom\" /\u003e\u003c/p\u003e\n\n - With color pattern and with vertical diviser only\n\u003cp align =\"center\"\u003e\u003cimg src=\"images/grid2.jpg\" alt=\"GeneralAppearance\" width=\"76%\" align=\"bottom\" /\u003e\u003c/p\u003e\n\n- With color pattern and with horizontal diviser only\n\u003cp align =\"center\"\u003e\u003cimg src=\"images/grid3.jpg\" alt=\"GeneralAppearance\" width=\"76%\" align=\"bottom\" /\u003e\u003c/p\u003e\n\n\n\u003cbr\u003e\u003cbr\u003e\n## Required \nIntegrate the DataGridVlew module into your project \n\n\u003cbr\u003e\u003cbr\u003e\n## Usage\n\ninclude the namespace in your xml layout file :\n```xml\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n```\n\n\u003cbr\u003e\u003cbr\u003e\n## DataGridVlew xml code\n```xml\n\u003cjkas.datagridview.DataGridView\n    android:id=\"@+id/data_grid_view\"\n    android:layout_height=\"match_parent\"\n    android:layout_width=\"match_parent\"\n    app:diviserSize=\"2dp\"\n    app:diviserColor=\"@color/backgroundColorHeader\"\n    app:diviserHeaderColor=\"@android:color/transparent\"\n    app:columnCount=\"5\"\n    app:columnHeaderTextColor=\"@color/textColorHeader\"\n    app:columnHeaderBackgroundColor=\"@color/backgroundColorHeader\"\n    app:columnHeaderHeight=\"43dp\"\n    app:showVerticalSeparator=\"true\"\n    app:showHorizontalSeparator=\"true\"\n    app:rowHeight=\"30dp\"\n    app:rowTextColor=\"@color/textColorRow\"\n    app:rowBackgroundColor=\"@color/backgroundColorRow\" /\u003e\n```\n\n\u003cbr\u003e\u003cbr\u003e\n## Implementation\n- To add data to the grid, you need to create an object of type `Row` from the DataGridView.\nfrom this new object created (`Row`), you would add new cells that will represent the data of the column. the object `Cell` can only be created from the line (object) `Row` that was created (`rowObject.newCell()`)\n\njava\n``` java\nDataGridView dataGV = binding.dataGridView; // get the DataGridVlew view via findViewById or DataBinding\nRow row = dataGV.newRow(); // create the new row from the DataGridVlew.\n// adding Cell in Row object\nrow.addCell(row.newCell().setTextContent(\"data cell 1\"));\nrow.addCell(row.newCell().setTextContent(\"data cell 2\"));\nrow.addCell(row.newCell().setTextContent(\"data cell 3\"));\nrow.addCell(row.newCell().setTextContent(\"data cell 4\"));\nrow.addCell(row.newCell().setTextContent(\"data cell 5\"));\n\n// adding Row line in DataGridVlew.\ndataGV.addRow(row);\n```\n\nkotlin\n```kotlin\nval dataGV = binding.dataGridView //get the DataGridVlew view via findViewById or DataBinding.\nval row = dataGV.newRow() // creating the record row (Row)\nrow.addCell(row.newCell().setTextContent(\"data cell 1\"))\nrow.addCell(row.newCell().setTextContent(\"data cell 2\"))\nrow.addCell(row.newCell().setTextContent(\"data cell 3\"))\nrow.addCell(row.newCell().setTextContent(\"data cell 4\"))\nrow.addCell(row.newCell().setTextContent(\"data cell 5\"))\n\n// adding Row line in DataGridVlew.\ndataGV.addRow(row)\n```\n\n\u003cbr\u003e\u003cbr\u003e\n- By default for all `Cell`s, the default generated view will be the `TextView`.\nyou can also customize your own views which are embedded in the `Cell`s.\n\njava\n```java\nView myCustomView = ...; // The view you prefer to use instead of the one that will be created by default.\nRow row = dataGV.newRow();\nRow.Cell cell = row.newCell();\ncell.setView(myCustomView);\nrow.addCell(cell);\n````\nkotlin\n```kotlin\nval myCustomView = ... // The view you prefer to use instead of the one that will be created by default.\nval row = dataGV.newRow()\nval cell = row.newCell()\ncell.setView(myCustomView)\nrow.addCell(cell)\n````\n\n\u003cbr\u003e\u003cbr\u003e\n- Creating the grid header always follows the same procedure which consists of creating a `Row` either via the `newRow()` method\n.\n\njava\n```java\nRow rowHeader = dataGV.newRow();\nrowHeader.addCell(...); // adding all necessary cells.\n// set or update header\ndataGV.setHeader(rowHeader);\n```\nkotlin\n```kotlin\nval rowHeader = dataGV.newRow()\nrowHeader.addCell(...) // adding all necessary cells.\n// set or update header\ndataGV.setHeader(rowHeader)\n```\n\n\u003cbr\u003e\u003cbr\u003e\n- For setting up color patterns (as in screenshots) it's pretty simple. you just need to get the object keeps the default settings of the DataGridView and change its values `DefaultSetting`.\n\njava\n```java\nDataGridVlew.DefaultSetting setting = dataGV.getDefaultSetting(); // getting the DefaultSetting object.\nsetting.usePattern = true;\n\n// for columns only.\nsetting.addColorInListColumn(Color.RED);\nsetting.addColorInListColumn(Color.GREEN);\n\n\n// for rows only\nsetting.addColorInListRow(Color.RED);\nsetting.addColorInListRow(Color.GREEN);\n//...\n```\n\nkotlin\n```kotlin\nval setting = dataGV.getDefaultSetting() // getting the DefaultSetting object.\nsetting.usePattern = true\n\n// for columns only.\nsetting.addColorInListColumn(Color.RED)\nsetting.addColorInListColumn(Color.GREEN)\n\n\n// for rows only\nsetting.addColorInListRow(Color.RED)\nsetting.addColorInListRow(Color.GREEN)\n//...\n```\nIf you want to use this multiple coloring of columns and/or rows, let the value of `usePattern` be `true`\n\n\u003cbr\u003e\u003cbr\u003e\n## Attributs\n| XML Attributs | Code Method | Description |\n|-------------|-------------|------------------------------------|\n| `app:diviserSize` | `setDiviserSize(int size)`| the size of the column and row divider |\n| `app:diviserColor` | `setDiviserColor(int color)`| The colors of the loaded data grid dividers  |\n| `app:diviserHeaderColor` | `setDiviserHeaderColor(int color)`| The color of the grid header dividers. |\n| `app:columnCount` | `setColumnCount(int counter)`| The maximum number of columns allowed  |\n| `app:columnHeaderTextColor` | `setColumnHeaderTextColor(int color)`| The header text color |\n| `app:columnHeaderBackgroundColor` | `setColumnHeaderBackgroundColor(int color)`| The header background color|\n| `app:columnHeaderHeight` | `setColumnHeaderHeight(float dimen)`| the height size of the header |\n| `app:showVerticalSeparator` | `showVerticalSeparator(boolean show)`| Show vertical divider  |\n| `app:showHorizontalSeparator` | `showHorizontalSeparator(boolean show)`| Show horizontal divider |\n| `app:rowHeight` | `setRowHeight(float dimen)`| the height size of the row |\n| `app:rowTextColor` | `setRowTextColor(int color)`| The row text color |\n| `app:rowBackgroundColor` | `setRowBackgroundColor(int color)`| The row background color |\n\n\u003cbr\u003e\u003cbr\u003e\n## Note\nIt is important to know this before loading data into the grid :\n- set `columnCount` before data loading, Otherwise an exception will be thrown.\n- the number of `Cell`s added must be equal to `columnCount` otherwise an exception will be thrown if the number of `Cell`s is greater than the limit `columnCount`.\n- if the number of `Cell`s is less than `columnCount`, `Cell`s will be added with default values `(none)` to fill the gaps.\n\n\u003cbr\u003e\u003cbr\u003e\n## Contact\n- Telegram: https://t.me/jkas_dbt\n- Gmail : jkas.dbt@gmail.com\n\n\u003cbr\u003e\u003cbr\u003e\n## Thanks to\n- Rosette Bikangu for Support\n- [Andi Hasan A](https://github.com/hasanelfalakiy)\n- [Akash Yadav](https://github.com/itsaky) for creating [AndroidIDE](https://github.com/AndroidIDEOfficial/AndroidIDE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkasdbt%2FDataGridView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkasdbt%2FDataGridView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkasdbt%2FDataGridView/lists"}