Showing preview only (574K chars total). Download the full file or copy to clipboard to get everything.
Repository: evrencoskun/TableView
Branch: master
Commit: cf9c7f66e764
Files: 144
Total size: 527.6 KB
Directory structure:
gitextract_wgk_y394/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── config.yml
│ │ └── feature_request.md
│ └── workflows/
│ └── validate_tableview.yml
├── .gitignore
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── evrencoskun/
│ │ └── tableviewsample/
│ │ ├── MainActivity.java
│ │ ├── MainFragment.java
│ │ └── tableview/
│ │ ├── TableViewAdapter.java
│ │ ├── TableViewListener.java
│ │ ├── TableViewModel.java
│ │ ├── holder/
│ │ │ ├── CellViewHolder.java
│ │ │ ├── ColumnHeaderViewHolder.java
│ │ │ ├── GenderCellViewHolder.java
│ │ │ ├── MoodCellViewHolder.java
│ │ │ └── RowHeaderViewHolder.java
│ │ ├── model/
│ │ │ ├── Cell.java
│ │ │ ├── ColumnHeader.java
│ │ │ └── RowHeader.java
│ │ └── popup/
│ │ ├── ColumnHeaderLongPressPopup.java
│ │ └── RowHeaderLongPressPopup.java
│ └── res/
│ ├── drawable/
│ │ ├── ic_down.xml
│ │ ├── ic_female.xml
│ │ ├── ic_happy.xml
│ │ ├── ic_male.xml
│ │ ├── ic_next.xml
│ │ ├── ic_previous.xml
│ │ ├── ic_sad.xml
│ │ └── ic_up.xml
│ ├── layout/
│ │ ├── activity_main.xml
│ │ ├── fragment_main.xml
│ │ ├── table_view_cell_layout.xml
│ │ ├── table_view_column_header_layout.xml
│ │ ├── table_view_corner_layout.xml
│ │ ├── table_view_image_cell_layout.xml
│ │ └── table_view_row_header_layout.xml
│ └── values/
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── tableview/
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src/
├── androidTest/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── evrencoskun/
│ │ └── tableview/
│ │ └── test/
│ │ ├── CornerLayoutTest.java
│ │ ├── CornerViewTest.java
│ │ ├── ReverseLayoutTest.java
│ │ ├── SimpleActivityTest.java
│ │ ├── TestActivity.java
│ │ ├── adapters/
│ │ │ ├── AbstractTableAdapterTest.java
│ │ │ ├── CornerTestAdapter.java
│ │ │ └── SimpleTestAdapter.java
│ │ ├── data/
│ │ │ └── SimpleData.java
│ │ ├── matchers/
│ │ │ └── ViewWidthMatcher.java
│ │ └── models/
│ │ ├── Cell.java
│ │ ├── ColumnHeader.java
│ │ └── RowHeader.java
│ └── res/
│ ├── layout/
│ │ ├── cell_layout.xml
│ │ ├── column_layout.xml
│ │ ├── corner_bottom_left.xml
│ │ ├── corner_bottom_right.xml
│ │ ├── corner_default.xml
│ │ ├── corner_layout.xml
│ │ ├── corner_top_left.xml
│ │ ├── corner_top_right.xml
│ │ ├── reverse_layout.xml
│ │ └── row_layout.xml
│ └── values/
│ ├── colors.xml
│ └── dimens.xml
└── main/
├── AndroidManifest.xml
├── java/
│ └── com/
│ └── evrencoskun/
│ └── tableview/
│ ├── ITableView.java
│ ├── TableView.java
│ ├── adapter/
│ │ ├── AbstractTableAdapter.java
│ │ ├── AdapterDataSetChangedListener.java
│ │ ├── ITableAdapter.java
│ │ └── recyclerview/
│ │ ├── AbstractRecyclerViewAdapter.java
│ │ ├── CellRecyclerView.java
│ │ ├── CellRecyclerViewAdapter.java
│ │ ├── CellRowRecyclerViewAdapter.java
│ │ ├── ColumnHeaderRecyclerViewAdapter.java
│ │ ├── RowHeaderRecyclerViewAdapter.java
│ │ └── holder/
│ │ ├── AbstractSorterViewHolder.java
│ │ └── AbstractViewHolder.java
│ ├── filter/
│ │ ├── Filter.java
│ │ ├── FilterChangedListener.java
│ │ ├── FilterItem.java
│ │ ├── FilterType.java
│ │ └── IFilterableModel.java
│ ├── handler/
│ │ ├── ColumnSortHandler.java
│ │ ├── ColumnWidthHandler.java
│ │ ├── FilterHandler.java
│ │ ├── PreferencesHandler.java
│ │ ├── ScrollHandler.java
│ │ ├── SelectionHandler.java
│ │ └── VisibilityHandler.java
│ ├── layoutmanager/
│ │ ├── CellLayoutManager.java
│ │ ├── ColumnHeaderLayoutManager.java
│ │ └── ColumnLayoutManager.java
│ ├── listener/
│ │ ├── ITableViewListener.java
│ │ ├── SimpleTableViewListener.java
│ │ ├── TableViewLayoutChangeListener.java
│ │ ├── itemclick/
│ │ │ ├── AbstractItemClickListener.java
│ │ │ ├── CellRecyclerViewItemClickListener.java
│ │ │ ├── ColumnHeaderRecyclerViewItemClickListener.java
│ │ │ └── RowHeaderRecyclerViewItemClickListener.java
│ │ └── scroll/
│ │ ├── HorizontalRecyclerViewListener.java
│ │ └── VerticalRecyclerViewListener.java
│ ├── pagination/
│ │ ├── IPagination.java
│ │ └── Pagination.java
│ ├── preference/
│ │ ├── Preferences.java
│ │ └── SavedState.java
│ ├── sort/
│ │ ├── AbstractSortComparator.java
│ │ ├── ColumnForRowHeaderSortComparator.java
│ │ ├── ColumnSortCallback.java
│ │ ├── ColumnSortComparator.java
│ │ ├── ColumnSortHelper.java
│ │ ├── ColumnSortStateChangedListener.java
│ │ ├── ISortableModel.java
│ │ ├── RowHeaderForCellSortComparator.java
│ │ ├── RowHeaderSortCallback.java
│ │ ├── RowHeaderSortComparator.java
│ │ ├── RowHeaderSortHelper.java
│ │ └── SortState.java
│ └── util/
│ └── TableViewUtils.java
└── res/
├── drawable/
│ └── cell_line_divider.xml
└── values/
├── attrs.xml
├── colors.xml
├── dimens.xml
├── ids.xml
└── integers.xml
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/CONTRIBUTING.md
================================================
# Contributing to `TableView`
## Table of contents
- [I need help/I have a question](#i-need-helpi-have-a-question)
- [Reporting a bug](#reporting-a-bug)
- [Suggest a new feature](#suggest-a-new-feature)
- [Contributing to the project](#contributing-to-the-project)
## I need help/I have a question
If you need help to integrate this library in your project, or if you have a generic question about it, please use [Stack Overflow](https://stackoverflow.com/questions/tagged/tableview+android), with the `TableView` and `Android` tags.
## Reporting a bug
If the library is not behaving as you would expect, please [open a new issue](https://github.com/evrencoskun/TableView/issues/new?labels=bug&template=bug_report.md), after checking that it hasn't been reported yet.
Don't forget to provide as much information as you can:
- What are you trying to do?
- What happened instead?
- In case of crash, include the stacktace.
- Which version of the library are you using?
- Which version of Android is this issue happening on?
## Suggest a new feature
If you would like a new feature to be added to the library, please [open a new issue](https://github.com/evrencoskun/TableView/issues/new?labels=enhancement&template=feature_request.md) to describe it.
## Contributing to the project
Every contribution is welcome to the library. Simply [open a new Pull Request](https://github.com/evrencoskun/TableView/compare) with your changes, so they can be reviewed and merged into the project, and eventually released to everyone.
Note that by making a contribution to this project you are agreeing to have your contributions governed by the [MIT License](https://github.com/evrencoskun/TableView/blob/master/LICENSE) copyright statement.
This means that to the extent possible under law, you transfer all copyright and related or neighbouring rights of the code or documents you contribute to the project itself. You also represent that you have the authority to perform the above waiver with respect to the entirety of you contributions.
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: evrencoskun # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
custom: ['https://www.paypal.me/evrencoshkun']
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Stacktrace**
If applicable, add the stacktrace you encountered.
**Tools:**
- `TableView` version: [e.g. 0.8.9.2]
- Android version: [e.g. 11]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
contact_links:
- name: Stack Overflow
url: https://stackoverflow.com/questions/tagged/tableview+android
about: Please ask your questions here, with the `TableView` and `Android` tags
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/workflows/validate_tableview.yml
================================================
name: Validate TableView
on:
push:
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: cache-gradle-
- name: Build
run: ./gradlew :tableview:assembleDebug --no-daemon
validate-sample:
name: Validate sample app
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: cache-gradle-
- name: Build
run: ./gradlew :app:assembleDebug --no-daemon
android-tests:
name: Android Tests
needs: build
# Using macos-latest to take advantage of the hardware acceleration
runs-on: macos-latest
strategy:
matrix:
api-level: [ 15, 29 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: cache-gradle-
- name: Android Test - API ${{ matrix.api-level }}
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
script: ./gradlew :tableview:connectedDebugAndroidTest --no-daemon
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_
# Mac
.DS_Store
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
*.idea/
# Keystore files
*.jks
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2017 Evren Coşkun
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
<div align="center">
<img src="https://raw.githubusercontent.com/evrencoskun/TableViewSample/master/art/Logo-5.png" >
<h2>TableView for Android</h2>
<p align="center">
<p>TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
TableView relies on a separate model object to hold and represent the data it displays. This repository also contains a sample app that is
designed to show you how to create your own TableView in your application.</p>
<a href="https://youtu.be/1DWFIqrqrPk">
<b> Full video »</b>
</a>
</p>
</div>
<p align="center">
<a href="https://youtu.be/1DWFIqrqrPk">
<img src="https://raw.githubusercontent.com/evrencoskun/TableViewSample/master/art/TableView-0_8_5_1_2.gif">
</a>
</p>
## Features
- [x] Each column width value can be calculated automatically considering the largest one.
- [x] Setting your own model class to be displayed in a table view easily.
- [x] `TableView` has an action listener interface to listen user touch interaction for each cell.
- [x] `TableView` columns can be sorted in ascending or descending order.
- [x] Hiding & showing the rows and columns is pretty easy.
- [x] Filtering by more than one data.
- [x] Pagination functionality.
## What's new
You can check new implementations of `TableView` on the [release page](https://github.com/evrencoskun/TableView/releases).
## Table of Contents
- [Installation](#installation)
- [Documentation](#documentation)
- [Sample Apps](#sample-apps)
- [Donations](#donations)
- [Contributors](#contributors)
- [License](#license)
## Installation
To use this library in your Android project, just add the following dependency into your module's `build.gradle`:
***Use Jitpack implementation***
1. Check Jitpack use :
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
2. Add implementation in project build :
```
implementation 'com.github.evrencoskun:TableView:v0.8.9.4'
```
## Documentation
Please check out the [project's wiki](https://github.com/evrencoskun/TableView/wiki).
## Sample Apps
- This repository has a [sample application](https://github.com/evrencoskun/TableView/tree/master/app) of `TableView`.
- [TableViewSample 2](https://github.com/evrencoskun/TableViewSample2)
- [Xently-UI](https://github.com/ajharry69/Xently-UI)
- [Price List Lite](https://pricelistlite.isolpro.in)
- [Database Client for MySQL and PostgreSQL](https://play.google.com/store/apps/details?id=dev.dhruv.databaseclient)
- ([Submit a Pull Request](https://github.com/evrencoskun/TableView/compare) to mention your app on this page)
## Donations
**This project needs you!** If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, **feel free to donate**. Your donation is highly appreciated (and I love food, coffee and beer). Thank you!
**PayPal**
- [**Donate 5 $**](https://www.paypal.me/evrencoshkun): Thank's for creating this project, here's a coffee (or some beer) for you!
- [**Donate 10 $**](https://www.paypal.me/evrencoshkun): Wow, I am stunned. Let me take you to the movies!
- [**Donate 15 $**](https://www.paypal.me/evrencoshkun): I really appreciate your work, let's grab some lunch!
- [**Donate 25 $**](https://www.paypal.me/evrencoshkun): That's some awesome stuff you did right there, dinner is on me!
- Or you can also [**choose what you want to donate**](https://www.paypal.me/evrencoshkun), all donations are awesome!
## Contributors
Contributions of any kind are welcome! I would like to thank all the [contributors](https://github.com/evrencoskun/TableView/graphs/contributors) for sharing code and
making `TableView` a better product.
If you wish to contribute to this project, please refer to our [contributing guide](.github/CONTRIBUTING.md).
## License
```
MIT License
Copyright (c) 2021 Evren Coşkun
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
apply plugin: 'com.android.application'
android {
compileSdkVersion compile_sdk_version
defaultConfig {
applicationId 'com.evrencoskun.tableviewsample'
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode 1
versionName '1.0'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = java_version
targetCompatibility = java_version
}
buildFeatures {
buildConfig = false
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation project(path: ':tableview')
implementation "androidx.annotation:annotation:$androidx_annotation_version"
implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
implementation "androidx.fragment:fragment:$androidx_fragment_version"
implementation "androidx.recyclerview:recyclerview:$androidx_recyclerview_version"
}
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/evrencoskun/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<manifest package="com.evrencoskun.tableviewsample"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/MainActivity.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
public MainActivity() {
super(R.layout.activity_main);
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/MainFragment.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.filter.Filter;
import com.evrencoskun.tableview.pagination.Pagination;
import com.evrencoskun.tableviewsample.tableview.TableViewAdapter;
import com.evrencoskun.tableviewsample.tableview.TableViewListener;
import com.evrencoskun.tableviewsample.tableview.TableViewModel;
/**
* A simple {@link Fragment} subclass.
*/
public class MainFragment extends Fragment {
private Spinner moodFilter, genderFilter;
private ImageButton previousButton, nextButton;
private TextView tablePaginationDetails;
private TableView mTableView;
@Nullable
private Filter mTableFilter; // This is used for filtering the table.
@Nullable
private Pagination mPagination; // This is used for paginating the table.
private boolean mPaginationEnabled = false;
public MainFragment() {
super(R.layout.fragment_main);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
EditText searchField = view.findViewById(R.id.query_string);
searchField.addTextChangedListener(mSearchTextWatcher);
moodFilter = view.findViewById(R.id.mood_spinner);
moodFilter.setOnItemSelectedListener(mItemSelectionListener);
genderFilter = view.findViewById(R.id.gender_spinner);
genderFilter.setOnItemSelectedListener(mItemSelectionListener);
Spinner itemsPerPage = view.findViewById(R.id.items_per_page_spinner);
View tableTestContainer = view.findViewById(R.id.table_test_container);
previousButton = view.findViewById(R.id.previous_button);
nextButton = view.findViewById(R.id.next_button);
EditText pageNumberField = view.findViewById(R.id.page_number_text);
tablePaginationDetails = view.findViewById(R.id.table_details);
if (mPaginationEnabled) {
tableTestContainer.setVisibility(View.VISIBLE);
itemsPerPage.setOnItemSelectedListener(onItemsPerPageSelectedListener);
previousButton.setOnClickListener(mClickListener);
nextButton.setOnClickListener(mClickListener);
pageNumberField.addTextChangedListener(onPageTextChanged);
} else {
tableTestContainer.setVisibility(View.GONE);
}
// Let's get TableView
mTableView = view.findViewById(R.id.tableview);
initializeTableView();
if (mPaginationEnabled) {
mTableFilter = new Filter(mTableView); // Create an instance of a Filter and pass the
// created TableView.
// Create an instance for the TableView pagination and pass the created TableView.
mPagination = new Pagination(mTableView);
// Sets the pagination listener of the TableView pagination to handle
// pagination actions. See onTableViewPageTurnedListener variable declaration below.
mPagination.setOnTableViewPageTurnedListener(onTableViewPageTurnedListener);
}
}
private void initializeTableView() {
// Create TableView View model class to group view models of TableView
TableViewModel tableViewModel = new TableViewModel();
// Create TableView Adapter
TableViewAdapter tableViewAdapter = new TableViewAdapter(tableViewModel);
mTableView.setAdapter(tableViewAdapter);
mTableView.setTableViewListener(new TableViewListener(mTableView));
// Create an instance of a Filter and pass the TableView.
//mTableFilter = new Filter(mTableView);
// Load the dummy data to the TableView
tableViewAdapter.setAllItems(tableViewModel.getColumnHeaderList(), tableViewModel
.getRowHeaderList(), tableViewModel.getCellList());
//mTableView.setHasFixedWidth(true);
/*for (int i = 0; i < mTableViewModel.getCellList().size(); i++) {
mTableView.setColumnWidth(i, 200);
}*)
//mTableView.setColumnWidth(0, -2);
//mTableView.setColumnWidth(1, -2);
/*mTableView.setColumnWidth(2, 200);
mTableView.setColumnWidth(3, 300);
mTableView.setColumnWidth(4, 400);
mTableView.setColumnWidth(5, 500);*/
}
public void filterTable(@NonNull String filter) {
// Sets a filter to the table, this will filter ALL the columns.
if (mTableFilter != null) {
mTableFilter.set(filter);
}
}
public void filterTableForMood(@NonNull String filter) {
// Sets a filter to the table, this will only filter a specific column.
// In the example data, this will filter the mood column.
if (mTableFilter != null) {
mTableFilter.set(TableViewModel.MOOD_COLUMN_INDEX, filter);
}
}
public void filterTableForGender(@NonNull String filter) {
// Sets a filter to the table, this will only filter a specific column.
// In the example data, this will filter the gender column.
if (mTableFilter != null) {
mTableFilter.set(TableViewModel.GENDER_COLUMN_INDEX, filter);
}
}
// The following four methods below: nextTablePage(), previousTablePage(),
// goToTablePage(int page) and setTableItemsPerPage(int itemsPerPage)
// are for controlling the TableView pagination.
public void nextTablePage() {
if (mPagination != null) {
mPagination.nextPage();
}
}
public void previousTablePage() {
if (mPagination != null) {
mPagination.previousPage();
}
}
public void goToTablePage(int page) {
if (mPagination != null) {
mPagination.goToPage(page);
}
}
public void setTableItemsPerPage(int itemsPerPage) {
if (mPagination != null) {
mPagination.setItemsPerPage(itemsPerPage);
}
}
// Handler for the changing of pages in the paginated TableView.
@NonNull
private final Pagination.OnTableViewPageTurnedListener onTableViewPageTurnedListener = new
Pagination.OnTableViewPageTurnedListener() {
@Override
public void onPageTurned(int numItems, int itemsStart, int itemsEnd) {
int currentPage = mPagination.getCurrentPage();
int pageCount = mPagination.getPageCount();
previousButton.setVisibility(View.VISIBLE);
nextButton.setVisibility(View.VISIBLE);
if (currentPage == 1 && pageCount == 1) {
previousButton.setVisibility(View.INVISIBLE);
nextButton.setVisibility(View.INVISIBLE);
}
if (currentPage == 1) {
previousButton.setVisibility(View.INVISIBLE);
}
if (currentPage == pageCount) {
nextButton.setVisibility(View.INVISIBLE);
}
tablePaginationDetails.setText(getString(R.string.table_pagination_details, String
.valueOf(currentPage), String.valueOf(itemsStart), String.valueOf(itemsEnd)));
}
};
@NonNull
private final AdapterView.OnItemSelectedListener mItemSelectionListener = new AdapterView
.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// 0. index is for empty item of spinner.
if (position > 0) {
String filter = Integer.toString(position);
if (parent == moodFilter) {
filterTableForMood(filter);
} else if (parent == genderFilter) {
filterTableForGender(filter);
}
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// Left empty intentionally.
}
};
@NonNull
private final TextWatcher mSearchTextWatcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
filterTable(String.valueOf(s));
}
@Override
public void afterTextChanged(Editable s) {
}
};
@NonNull
private final AdapterView.OnItemSelectedListener onItemsPerPageSelectedListener = new AdapterView
.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
int itemsPerPage;
if ("All".equals(parent.getItemAtPosition(position).toString())) {
itemsPerPage = 0;
} else {
itemsPerPage = Integer.parseInt(parent.getItemAtPosition(position).toString());
}
setTableItemsPerPage(itemsPerPage);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
@NonNull
private final View.OnClickListener mClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
if (v == previousButton) {
previousTablePage();
} else if (v == nextButton) {
nextTablePage();
}
}
};
@NonNull
private final TextWatcher onPageTextChanged = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
int page;
if (TextUtils.isEmpty(s)) {
page = 1;
} else {
page = Integer.parseInt(String.valueOf(s));
}
goToTablePage(page);
}
@Override
public void afterTextChanged(Editable s) {
}
};
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewAdapter.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.evrencoskun.tableview.adapter.AbstractTableAdapter;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.evrencoskun.tableview.sort.SortState;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.holder.CellViewHolder;
import com.evrencoskun.tableviewsample.tableview.holder.ColumnHeaderViewHolder;
import com.evrencoskun.tableviewsample.tableview.holder.GenderCellViewHolder;
import com.evrencoskun.tableviewsample.tableview.holder.MoodCellViewHolder;
import com.evrencoskun.tableviewsample.tableview.holder.RowHeaderViewHolder;
import com.evrencoskun.tableviewsample.tableview.model.Cell;
import com.evrencoskun.tableviewsample.tableview.model.ColumnHeader;
import com.evrencoskun.tableviewsample.tableview.model.RowHeader;
/**
* Created by evrencoskun on 11/06/2017.
* <p>
* This is a sample of custom TableView Adapter.
*/
public class TableViewAdapter extends AbstractTableAdapter<ColumnHeader, RowHeader, Cell> {
// Cell View Types by Column Position
private static final int MOOD_CELL_TYPE = 1;
private static final int GENDER_CELL_TYPE = 2;
// add new one if it necessary..
private static final String LOG_TAG = TableViewAdapter.class.getSimpleName();
@NonNull
private final TableViewModel mTableViewModel;
public TableViewAdapter(@NonNull TableViewModel tableViewModel) {
super();
this.mTableViewModel = tableViewModel;
}
/**
* This is where you create your custom Cell ViewHolder. This method is called when Cell
* RecyclerView of the TableView needs a new RecyclerView.ViewHolder of the given type to
* represent an item.
*
* @param viewType : This value comes from "getCellItemViewType" method to support different
* type of viewHolder as a Cell item.
* @see #getCellItemViewType(int);
*/
@NonNull
@Override
public AbstractViewHolder onCreateCellViewHolder(@NonNull ViewGroup parent, int viewType) {
//TODO check
Log.e(LOG_TAG, " onCreateCellViewHolder has been called");
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View layout;
switch (viewType) {
case MOOD_CELL_TYPE:
// Get image cell layout which has ImageView on the base instead of TextView.
layout = inflater.inflate(R.layout.table_view_image_cell_layout, parent, false);
return new MoodCellViewHolder(layout);
case GENDER_CELL_TYPE:
// Get image cell layout which has ImageView instead of TextView.
layout = inflater.inflate(R.layout.table_view_image_cell_layout, parent, false);
return new GenderCellViewHolder(layout);
default:
// For cells that display a text
layout = inflater.inflate(R.layout.table_view_cell_layout, parent, false);
// Create a Cell ViewHolder
return new CellViewHolder(layout);
}
}
/**
* That is where you set Cell View Model data to your custom Cell ViewHolder. This method is
* Called by Cell RecyclerView of the TableView to display the data at the specified position.
* This method gives you everything you need about a cell item.
*
* @param holder : This is one of your cell ViewHolders that was created on
* ```onCreateCellViewHolder``` method. In this example we have created
* "CellViewHolder" holder.
* @param cellItemModel : This is the cell view model located on this X and Y position. In this
* example, the model class is "Cell".
* @param columnPosition : This is the X (Column) position of the cell item.
* @param rowPosition : This is the Y (Row) position of the cell item.
* @see #onCreateCellViewHolder(ViewGroup, int) ;
*/
@Override
public void onBindCellViewHolder(@NonNull AbstractViewHolder holder, @Nullable Cell cellItemModel, int
columnPosition, int rowPosition) {
switch (holder.getItemViewType()) {
case MOOD_CELL_TYPE:
MoodCellViewHolder moodViewHolder = (MoodCellViewHolder) holder;
moodViewHolder.cell_image.setImageResource(mTableViewModel.getDrawable((int) cellItemModel
.getData(), false));
break;
case GENDER_CELL_TYPE:
GenderCellViewHolder genderViewHolder = (GenderCellViewHolder) holder;
genderViewHolder.cell_image.setImageResource(mTableViewModel.getDrawable((int)
cellItemModel.getData(), true));
break;
default:
// Get the holder to update cell item text
CellViewHolder viewHolder = (CellViewHolder) holder;
viewHolder.setCell(cellItemModel);
break;
}
}
/**
* This is where you create your custom Column Header ViewHolder. This method is called when
* Column Header RecyclerView of the TableView needs a new RecyclerView.ViewHolder of the given
* type to represent an item.
*
* @param viewType : This value comes from "getColumnHeaderItemViewType" method to support
* different type of viewHolder as a Column Header item.
* @see #getColumnHeaderItemViewType(int);
*/
@NonNull
@Override
public AbstractViewHolder onCreateColumnHeaderViewHolder(@NonNull ViewGroup parent, int viewType) {
// TODO: check
//Log.e(LOG_TAG, " onCreateColumnHeaderViewHolder has been called");
// Get Column Header xml Layout
View layout = LayoutInflater.from(parent.getContext())
.inflate(R.layout.table_view_column_header_layout, parent, false);
// Create a ColumnHeader ViewHolder
return new ColumnHeaderViewHolder(layout, getTableView());
}
/**
* That is where you set Column Header View Model data to your custom Column Header ViewHolder.
* This method is Called by ColumnHeader RecyclerView of the TableView to display the data at
* the specified position. This method gives you everything you need about a column header
* item.
*
* @param holder : This is one of your column header ViewHolders that was created
* on ```onCreateColumnHeaderViewHolder``` method. In this example
* we have created "ColumnHeaderViewHolder" holder.
* @param columnHeaderItemModel : This is the column header view model located on this X
* position. In this example, the model class is "ColumnHeader".
* @param columnPosition : This is the X (Column) position of the column header item.
* @see #onCreateColumnHeaderViewHolder(ViewGroup, int) ;
*/
@Override
public void onBindColumnHeaderViewHolder(@NonNull AbstractViewHolder holder, @Nullable ColumnHeader
columnHeaderItemModel, int columnPosition) {
// Get the holder to update cell item text
ColumnHeaderViewHolder columnHeaderViewHolder = (ColumnHeaderViewHolder) holder;
columnHeaderViewHolder.setColumnHeader(columnHeaderItemModel);
}
/**
* This is where you create your custom Row Header ViewHolder. This method is called when
* Row Header RecyclerView of the TableView needs a new RecyclerView.ViewHolder of the given
* type to represent an item.
*
* @param viewType : This value comes from "getRowHeaderItemViewType" method to support
* different type of viewHolder as a row Header item.
* @see #getRowHeaderItemViewType(int);
*/
@NonNull
@Override
public AbstractViewHolder onCreateRowHeaderViewHolder(@NonNull ViewGroup parent, int viewType) {
// Get Row Header xml Layout
View layout = LayoutInflater.from(parent.getContext())
.inflate(R.layout.table_view_row_header_layout, parent, false);
// Create a Row Header ViewHolder
return new RowHeaderViewHolder(layout);
}
/**
* That is where you set Row Header View Model data to your custom Row Header ViewHolder. This
* method is Called by RowHeader RecyclerView of the TableView to display the data at the
* specified position. This method gives you everything you need about a row header item.
*
* @param holder : This is one of your row header ViewHolders that was created on
* ```onCreateRowHeaderViewHolder``` method. In this example we have
* created "RowHeaderViewHolder" holder.
* @param rowHeaderItemModel : This is the row header view model located on this Y position. In
* this example, the model class is "RowHeader".
* @param rowPosition : This is the Y (row) position of the row header item.
* @see #onCreateRowHeaderViewHolder(ViewGroup, int) ;
*/
@Override
public void onBindRowHeaderViewHolder(@NonNull AbstractViewHolder holder, @Nullable RowHeader rowHeaderItemModel,
int rowPosition) {
// Get the holder to update row header item text
RowHeaderViewHolder rowHeaderViewHolder = (RowHeaderViewHolder) holder;
rowHeaderViewHolder.row_header_textview.setText(String.valueOf(rowHeaderItemModel.getData()));
}
@NonNull
@Override
public View onCreateCornerView(@NonNull ViewGroup parent) {
// Get Corner xml layout
View corner = LayoutInflater.from(parent.getContext())
.inflate(R.layout.table_view_corner_layout, parent, false);
corner.setOnClickListener(view -> {
SortState sortState = TableViewAdapter.this.getTableView()
.getRowHeaderSortingStatus();
if (sortState != SortState.ASCENDING) {
Log.d("TableViewAdapter", "Order Ascending");
TableViewAdapter.this.getTableView().sortRowHeader(SortState.ASCENDING);
} else {
Log.d("TableViewAdapter", "Order Descending");
TableViewAdapter.this.getTableView().sortRowHeader(SortState.DESCENDING);
}
});
return corner;
}
@Override
public int getColumnHeaderItemViewType(int position) {
// The unique ID for this type of column header item
// If you have different items for Cell View by X (Column) position,
// then you should fill this method to be able create different
// type of CellViewHolder on "onCreateCellViewHolder"
return 0;
}
@Override
public int getRowHeaderItemViewType(int position) {
// The unique ID for this type of row header item
// If you have different items for Row Header View by Y (Row) position,
// then you should fill this method to be able create different
// type of RowHeaderViewHolder on "onCreateRowHeaderViewHolder"
return 0;
}
@Override
public int getCellItemViewType(int column) {
// The unique ID for this type of cell item
// If you have different items for Cell View by X (Column) position,
// then you should fill this method to be able create different
// type of CellViewHolder on "onCreateCellViewHolder"
switch (column) {
case TableViewModel.MOOD_COLUMN_INDEX:
return MOOD_CELL_TYPE;
case TableViewModel.GENDER_COLUMN_INDEX:
return GENDER_CELL_TYPE;
default:
// Default view type
return 0;
}
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewListener.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview;
import android.content.Context;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.listener.ITableViewListener;
import com.evrencoskun.tableviewsample.tableview.holder.ColumnHeaderViewHolder;
import com.evrencoskun.tableviewsample.tableview.popup.ColumnHeaderLongPressPopup;
import com.evrencoskun.tableviewsample.tableview.popup.RowHeaderLongPressPopup;
/**
* Created by evrencoskun on 21/09/2017.
*/
public class TableViewListener implements ITableViewListener {
@NonNull
private final Context mContext;
@NonNull
private final TableView mTableView;
public TableViewListener(@NonNull TableView tableView) {
this.mContext = tableView.getContext();
this.mTableView = tableView;
}
/**
* Called when user click any cell item.
*
* @param cellView : Clicked Cell ViewHolder.
* @param column : X (Column) position of Clicked Cell item.
* @param row : Y (Row) position of Clicked Cell item.
*/
@Override
public void onCellClicked(@NonNull RecyclerView.ViewHolder cellView, int column, int row) {
// Do what you want.
showToast("Cell " + column + " " + row + " has been clicked.");
}
/**
* Called when user double click any cell item.
*
* @param cellView : Clicked Cell ViewHolder.
* @param column : X (Column) position of Clicked Cell item.
* @param row : Y (Row) position of Clicked Cell item.
*/
@Override
public void onCellDoubleClicked(@NonNull RecyclerView.ViewHolder cellView, int column, int row) {
// Do what you want.
showToast("Cell " + column + " " + row + " has been double clicked.");
}
/**
* Called when user long press any cell item.
*
* @param cellView : Long Pressed Cell ViewHolder.
* @param column : X (Column) position of Long Pressed Cell item.
* @param row : Y (Row) position of Long Pressed Cell item.
*/
@Override
public void onCellLongPressed(@NonNull RecyclerView.ViewHolder cellView, final int column,
int row) {
// Do What you want
showToast("Cell " + column + " " + row + " has been long pressed.");
}
/**
* Called when user click any column header item.
*
* @param columnHeaderView : Clicked Column Header ViewHolder.
* @param column : X (Column) position of Clicked Column Header item.
*/
@Override
public void onColumnHeaderClicked(@NonNull RecyclerView.ViewHolder columnHeaderView, int
column) {
// Do what you want.
showToast("Column header " + column + " has been clicked.");
}
/**
* Called when user double click any column header item.
*
* @param columnHeaderView : Clicked Column Header ViewHolder.
* @param column : X (Column) position of Clicked Column Header item.
*/
@Override
public void onColumnHeaderDoubleClicked(@NonNull RecyclerView.ViewHolder columnHeaderView, int column) {
// Do what you want.
showToast("Column header " + column + " has been double clicked.");
}
/**
* Called when user long press any column header item.
*
* @param columnHeaderView : Long Pressed Column Header ViewHolder.
* @param column : X (Column) position of Long Pressed Column Header item.
*/
@Override
public void onColumnHeaderLongPressed(@NonNull RecyclerView.ViewHolder columnHeaderView, int
column) {
if (columnHeaderView instanceof ColumnHeaderViewHolder) {
// Create Long Press Popup
ColumnHeaderLongPressPopup popup = new ColumnHeaderLongPressPopup(
(ColumnHeaderViewHolder) columnHeaderView, mTableView);
// Show
popup.show();
}
}
/**
* Called when user click any Row Header item.
*
* @param rowHeaderView : Clicked Row Header ViewHolder.
* @param row : Y (Row) position of Clicked Row Header item.
*/
@Override
public void onRowHeaderClicked(@NonNull RecyclerView.ViewHolder rowHeaderView, int row) {
// Do whatever you want.
showToast("Row header " + row + " has been clicked.");
}
/**
* Called when user double click any Row Header item.
*
* @param rowHeaderView : Clicked Row Header ViewHolder.
* @param row : Y (Row) position of Clicked Row Header item.
*/
@Override
public void onRowHeaderDoubleClicked(@NonNull RecyclerView.ViewHolder rowHeaderView, int row) {
// Do whatever you want.
showToast("Row header " + row + " has been double clicked.");
}
/**
* Called when user long press any row header item.
*
* @param rowHeaderView : Long Pressed Row Header ViewHolder.
* @param row : Y (Row) position of Long Pressed Row Header item.
*/
@Override
public void onRowHeaderLongPressed(@NonNull RecyclerView.ViewHolder rowHeaderView, int row) {
// Create Long Press Popup
RowHeaderLongPressPopup popup = new RowHeaderLongPressPopup(rowHeaderView, mTableView);
// Show
popup.show();
}
private void showToast(String p_strMessage) {
Toast.makeText(mContext, p_strMessage, Toast.LENGTH_SHORT).show();
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewModel.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.model.Cell;
import com.evrencoskun.tableviewsample.tableview.model.ColumnHeader;
import com.evrencoskun.tableviewsample.tableview.model.RowHeader;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Created by evrencoskun on 4.02.2018.
*/
public class TableViewModel {
// Columns indexes
public static final int MOOD_COLUMN_INDEX = 3;
public static final int GENDER_COLUMN_INDEX = 4;
// Constant values for icons
public static final int SAD = 1;
public static final int HAPPY = 2;
public static final int BOY = 1;
public static final int GIRL = 2;
// Constant size for dummy data sets
private static final int COLUMN_SIZE = 500;
private static final int ROW_SIZE = 500;
// Drawables
@DrawableRes
private final int mBoyDrawable;
@DrawableRes
private final int mGirlDrawable;
@DrawableRes
private final int mHappyDrawable;
@DrawableRes
private final int mSadDrawable;
public TableViewModel() {
// initialize drawables
mBoyDrawable = R.drawable.ic_male;
mGirlDrawable = R.drawable.ic_female;
mHappyDrawable = R.drawable.ic_happy;
mSadDrawable = R.drawable.ic_sad;
}
@NonNull
private List<RowHeader> getSimpleRowHeaderList() {
List<RowHeader> list = new ArrayList<>();
for (int i = 0; i < ROW_SIZE; i++) {
RowHeader header = new RowHeader(String.valueOf(i), "row " + i);
list.add(header);
}
return list;
}
/**
* This is a dummy model list test some cases.
*/
@NonNull
private List<ColumnHeader> getRandomColumnHeaderList() {
List<ColumnHeader> list = new ArrayList<>();
for (int i = 0; i < COLUMN_SIZE; i++) {
String title = "column " + i;
int nRandom = new Random().nextInt();
if (nRandom % 4 == 0 || nRandom % 3 == 0 || nRandom == i) {
title = "large column " + i;
}
ColumnHeader header = new ColumnHeader(String.valueOf(i), title);
list.add(header);
}
return list;
}
/**
* This is a dummy model list test some cases.
*/
@NonNull
private List<List<Cell>> getCellListForSortingTest() {
List<List<Cell>> list = new ArrayList<>();
for (int i = 0; i < ROW_SIZE; i++) {
List<Cell> cellList = new ArrayList<>();
for (int j = 0; j < COLUMN_SIZE; j++) {
Object text = "cell " + j + " " + i;
final int random = new Random().nextInt();
if (j == 0) {
text = i;
} else if (j == 1) {
text = random;
} else if (j == MOOD_COLUMN_INDEX) {
text = random % 2 == 0 ? HAPPY : SAD;
} else if (j == GENDER_COLUMN_INDEX) {
text = random % 2 == 0 ? BOY : GIRL;
}
// Create dummy id.
String id = j + "-" + i;
Cell cell;
if (j == 3) {
cell = new Cell(id, text);
} else if (j == 4) {
// NOTE female and male keywords for filter will have conflict since "female"
// contains "male"
cell = new Cell(id, text);
} else {
cell = new Cell(id, text);
}
cellList.add(cell);
}
list.add(cellList);
}
return list;
}
@DrawableRes
public int getDrawable(int value, boolean isGender) {
if (isGender) {
return value == BOY ? mBoyDrawable : mGirlDrawable;
} else {
return value == SAD ? mSadDrawable : mHappyDrawable;
}
}
@NonNull
public List<List<Cell>> getCellList() {
return getCellListForSortingTest();
}
@NonNull
public List<RowHeader> getRowHeaderList() {
return getSimpleRowHeaderList();
}
@NonNull
public List<ColumnHeader> getColumnHeaderList() {
return getRandomColumnHeaderList();
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/CellViewHolder.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.holder;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.model.Cell;
/**
* Created by evrencoskun on 23/10/2017.
*/
public class CellViewHolder extends AbstractViewHolder {
@NonNull
private final TextView cell_textview;
@NonNull
private final LinearLayout cell_container;
public CellViewHolder(@NonNull View itemView) {
super(itemView);
cell_textview = itemView.findViewById(R.id.cell_data);
cell_container = itemView.findViewById(R.id.cell_container);
}
public void setCell(@Nullable Cell cell) {
cell_textview.setText(String.valueOf(cell.getData()));
// If your TableView should have auto resize for cells & columns.
// Then you should consider the below lines. Otherwise, you can ignore them.
// It is necessary to remeasure itself.
cell_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
cell_textview.requestLayout();
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/ColumnHeaderViewHolder.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.holder;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.evrencoskun.tableview.ITableView;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractSorterViewHolder;
import com.evrencoskun.tableview.sort.SortState;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.model.ColumnHeader;
/**
* Created by evrencoskun on 23/10/2017.
*/
public class ColumnHeaderViewHolder extends AbstractSorterViewHolder {
private static final String LOG_TAG = ColumnHeaderViewHolder.class.getSimpleName();
@NonNull
private final LinearLayout column_header_container;
@NonNull
private final TextView column_header_textview;
@NonNull
private final ImageButton column_header_sortButton;
@Nullable
private final ITableView tableView;
public ColumnHeaderViewHolder(@NonNull View itemView, @Nullable ITableView tableView) {
super(itemView);
this.tableView = tableView;
column_header_textview = itemView.findViewById(R.id.column_header_textView);
column_header_container = itemView.findViewById(R.id.column_header_container);
column_header_sortButton = itemView.findViewById(R.id.column_header_sortButton);
// Set click listener to the sort button
column_header_sortButton.setOnClickListener(mSortButtonClickListener);
}
/**
* This method is calling from onBindColumnHeaderHolder on TableViewAdapter
*/
public void setColumnHeader(@Nullable ColumnHeader columnHeader) {
column_header_textview.setText(String.valueOf(columnHeader.getData()));
// If your TableView should have auto resize for cells & columns.
// Then you should consider the below lines. Otherwise, you can remove them.
// It is necessary to remeasure itself.
column_header_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
column_header_textview.requestLayout();
}
@NonNull
private final View.OnClickListener mSortButtonClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getSortState() == SortState.ASCENDING) {
tableView.sortColumn(getBindingAdapterPosition(), SortState.DESCENDING);
} else if (getSortState() == SortState.DESCENDING) {
tableView.sortColumn(getBindingAdapterPosition(), SortState.ASCENDING);
} else {
// Default one
tableView.sortColumn(getBindingAdapterPosition(), SortState.DESCENDING);
}
}
};
@Override
public void onSortingStatusChanged(@NonNull SortState sortState) {
Log.e(LOG_TAG, " + onSortingStatusChanged: x: " + getBindingAdapterPosition() + ", " +
"old state: " + getSortState() + ", current state: " + sortState + ", " +
"visibility: " + column_header_sortButton.getVisibility());
super.onSortingStatusChanged(sortState);
// It is necessary to remeasure itself.
column_header_container.getLayoutParams().width = LinearLayout.LayoutParams.WRAP_CONTENT;
controlSortState(sortState);
Log.e(LOG_TAG, " - onSortingStatusChanged: x: " + getBindingAdapterPosition() + ", " +
"old state: " + getSortState() + ", current state: " + sortState + ", " +
"visibility: " + column_header_sortButton.getVisibility());
column_header_textview.requestLayout();
column_header_sortButton.requestLayout();
column_header_container.requestLayout();
itemView.requestLayout();
}
private void controlSortState(@NonNull SortState sortState) {
if (sortState == SortState.ASCENDING) {
column_header_sortButton.setVisibility(View.VISIBLE);
column_header_sortButton.setImageResource(R.drawable.ic_down);
} else if (sortState == SortState.DESCENDING) {
column_header_sortButton.setVisibility(View.VISIBLE);
column_header_sortButton.setImageResource(R.drawable.ic_up);
} else {
column_header_sortButton.setVisibility(View.INVISIBLE);
}
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/GenderCellViewHolder.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.holder;
import android.view.View;
import androidx.annotation.NonNull;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.TableViewModel;
/**
* Created by evrencoskun on 4.02.2018.
*/
public class GenderCellViewHolder extends MoodCellViewHolder {
public GenderCellViewHolder(@NonNull View itemView) {
super(itemView);
}
@Override
public void setData(Object data) {
int gender = (int) data;
int genderDrawable = gender == TableViewModel.BOY ? R.drawable.ic_male : R.drawable.ic_female;
cell_image.setImageResource(genderDrawable);
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/MoodCellViewHolder.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.holder;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.TableViewModel;
/**
* Created by evrencoskun on 4.02.2018.
*/
public class MoodCellViewHolder extends AbstractViewHolder {
@NonNull
public final ImageView cell_image;
public MoodCellViewHolder(@NonNull View itemView) {
super(itemView);
cell_image = itemView.findViewById(R.id.cell_image);
}
public void setData(Object data) {
int mood = (int) data;
int moodDrawable = mood == TableViewModel.HAPPY ? R.drawable.ic_happy : R.drawable.ic_sad;
cell_image.setImageResource(moodDrawable);
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/RowHeaderViewHolder.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.holder;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.evrencoskun.tableview.adapter.recyclerview.holder.AbstractViewHolder;
import com.evrencoskun.tableviewsample.R;
/**
* Created by evrencoskun on 23/10/2017.
*/
public class RowHeaderViewHolder extends AbstractViewHolder {
@NonNull
public final TextView row_header_textview;
public RowHeaderViewHolder(@NonNull View itemView) {
super(itemView);
row_header_textview = itemView.findViewById(R.id.row_header_textview);
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/Cell.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.model;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.evrencoskun.tableview.filter.IFilterableModel;
import com.evrencoskun.tableview.sort.ISortableModel;
/**
* Created by evrencoskun on 11/06/2017.
*/
public class Cell implements ISortableModel, IFilterableModel {
@NonNull
private final String mId;
@Nullable
private final Object mData;
@NonNull
private final String mFilterKeyword;
public Cell(@NonNull String id, @Nullable Object data) {
this.mId = id;
this.mData = data;
this.mFilterKeyword = String.valueOf(data);
}
/**
* This is necessary for sorting process.
* See ISortableModel
*/
@NonNull
@Override
public String getId() {
return mId;
}
/**
* This is necessary for sorting process.
* See ISortableModel
*/
@Nullable
@Override
public Object getContent() {
return mData;
}
@Nullable
public Object getData() {
return mData;
}
@NonNull
@Override
public String getFilterableKeyword() {
return mFilterKeyword;
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/ColumnHeader.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.model;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* Created by evrencoskun on 11/06/2017.
*/
public class ColumnHeader extends Cell {
public ColumnHeader(@NonNull String id, @Nullable String data) {
super(id, data);
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/RowHeader.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.model;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* Created by evrencoskun on 11/06/2017.
*/
public class RowHeader extends Cell {
public RowHeader(@NonNull String id, @Nullable String data) {
super(id, data);
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/popup/ColumnHeaderLongPressPopup.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.popup;
import android.content.Context;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.PopupMenu;
import androidx.annotation.NonNull;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.sort.SortState;
import com.evrencoskun.tableviewsample.R;
import com.evrencoskun.tableviewsample.tableview.holder.ColumnHeaderViewHolder;
/**
* Created by evrencoskun on 24.12.2017.
*/
public class ColumnHeaderLongPressPopup extends PopupMenu implements PopupMenu
.OnMenuItemClickListener {
// Menu Item constants
private static final int ASCENDING = 1;
private static final int DESCENDING = 2;
private static final int HIDE_ROW = 3;
private static final int SHOW_ROW = 4;
private static final int SCROLL_ROW = 5;
@NonNull
private final TableView mTableView;
private final int mXPosition;
public ColumnHeaderLongPressPopup(@NonNull ColumnHeaderViewHolder viewHolder, @NonNull TableView tableView) {
super(viewHolder.itemView.getContext(), viewHolder.itemView);
this.mTableView = tableView;
this.mXPosition = viewHolder.getBindingAdapterPosition();
initialize();
}
private void initialize() {
createMenuItem();
changeMenuItemVisibility();
this.setOnMenuItemClickListener(this);
}
private void createMenuItem() {
Context context = mTableView.getContext();
this.getMenu().add(Menu.NONE, ASCENDING, 0, context.getString(R.string.sort_ascending));
this.getMenu().add(Menu.NONE, DESCENDING, 1, context.getString(R.string.sort_descending));
this.getMenu().add(Menu.NONE, HIDE_ROW, 2, context.getString(R.string.hiding_row_sample));
this.getMenu().add(Menu.NONE, SHOW_ROW, 3, context.getString(R.string.showing_row_sample));
this.getMenu().add(Menu.NONE, SCROLL_ROW, 4, context.getString(R.string.scroll_to_row_position));
this.getMenu().add(Menu.NONE, SCROLL_ROW, 0, "change width");
// add new one ...
}
private void changeMenuItemVisibility() {
// Determine which one shouldn't be visible
SortState sortState = mTableView.getSortingStatus(mXPosition);
if (sortState == SortState.UNSORTED) {
// Show others
} else if (sortState == SortState.DESCENDING) {
// Hide DESCENDING menu item
getMenu().getItem(1).setVisible(false);
} else if (sortState == SortState.ASCENDING) {
// Hide ASCENDING menu item
getMenu().getItem(0).setVisible(false);
}
}
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
// Note: item id is index of menu item..
switch (menuItem.getItemId()) {
case ASCENDING:
mTableView.sortColumn(mXPosition, SortState.ASCENDING);
break;
case DESCENDING:
mTableView.sortColumn(mXPosition, SortState.DESCENDING);
break;
case HIDE_ROW:
mTableView.hideRow(5);
break;
case SHOW_ROW:
mTableView.showRow(5);
break;
case SCROLL_ROW:
mTableView.scrollToRowPosition(5);
break;
}
return true;
}
}
================================================
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/popup/RowHeaderLongPressPopup.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableviewsample.tableview.popup;
import android.content.Context;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.PopupMenu;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableviewsample.R;
/**
* Created by evrencoskun on 21.01.2018.
*/
public class RowHeaderLongPressPopup extends PopupMenu implements PopupMenu
.OnMenuItemClickListener {
// Menu Item constants
private static final int SCROLL_COLUMN = 1;
private static final int SHOWHIDE_COLUMN = 2;
private static final int REMOVE_ROW = 3;
@NonNull
private final TableView mTableView;
private final int mRowPosition;
public RowHeaderLongPressPopup(@NonNull RecyclerView.ViewHolder viewHolder, @NonNull TableView tableView) {
super(viewHolder.itemView.getContext(), viewHolder.itemView);
this.mTableView = tableView;
this.mRowPosition = viewHolder.getBindingAdapterPosition();
initialize();
}
private void initialize() {
createMenuItem();
this.setOnMenuItemClickListener(this);
}
private void createMenuItem() {
Context context = mTableView.getContext();
this.getMenu().add(Menu.NONE, SCROLL_COLUMN, 0, context.getString(R.string
.scroll_to_column_position));
this.getMenu().add(Menu.NONE, SHOWHIDE_COLUMN, 1, context.getString(R.string
.show_hide_the_column));
this.getMenu().add(Menu.NONE, REMOVE_ROW, 2, "Remove " + mRowPosition + " position");
// add new one ...
}
@Override
public boolean onMenuItemClick(MenuItem menuItem) {
// Note: item id is index of menu item..
switch (menuItem.getItemId()) {
case SCROLL_COLUMN:
mTableView.scrollToColumnPosition(15);
break;
case SHOWHIDE_COLUMN:
int column = 1;
if (mTableView.isColumnVisible(column)) {
mTableView.hideColumn(column);
} else {
mTableView.showColumn(column);
}
break;
case REMOVE_ROW:
mTableView.getAdapter().removeRow(mRowPosition);
break;
}
return true;
}
}
================================================
FILE: app/src/main/res/drawable/ic_down.xml
================================================
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<vector android:height="24dp" android:viewportHeight="512.0"
android:viewportWidth="512.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M396.6,160l19.4,20.7l-160,171.3l-160,-171.3l19.3,-20.7l140.7,150.5z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_female.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFAA0099"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_happy.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF00FF00"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,17.5c2.33,0 4.31,-1.46 5.11,-3.5L6.89,14c0.8,2.04 2.78,3.5 5.11,3.5z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_male.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF5511FF"
android:pathData="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_next.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_previous.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M15.41,7.41L14,6l-6,6 6,6 1.41,-1.41L10.83,12z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_sad.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFF0000"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,14c-2.33,0 -4.31,1.46 -5.11,3.5h10.22c-0.8,-2.04 -2.78,-3.5 -5.11,-3.5z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_up.xml
================================================
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<vector android:height="24dp" android:viewportHeight="512.0"
android:viewportWidth="512.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M396.6,352l19.4,-20.7l-160,-171.3l-160,171.3l19.3,20.7l140.7,-150.5z"/>
</vector>
================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_main"
android:name="com.evrencoskun.tableviewsample.MainFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_main" />
================================================
FILE: app/src/main/res/layout/fragment_main.xml
================================================
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<RelativeLayout
android:id="@+id/fragment_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_line"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/table_test_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/search_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<EditText
android:id="@+id/query_string"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="40"
android:inputType="textNoSuggestions"/>
<Spinner
android:id="@+id/mood_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="30"
android:background="@android:color/transparent"
android:entries="@array/moods"/>
<Spinner
android:id="@+id/gender_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="30"
android:background="@android:color/transparent"
android:entries="@array/gender"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="100">
<ImageButton
android:id="@+id/previous_button"
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/ic_previous"/>
<EditText
android:id="@+id/page_number_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="20"
android:inputType="number"/>
<ImageButton
android:id="@+id/next_button"
android:layout_width="48dp"
android:layout_height="48dp"
app:srcCompat="@drawable/ic_next"/>
<TextView
android:id="@+id/table_details"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"/>
<Spinner
android:id="@+id/items_per_page_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="30"
android:background="@android:color/transparent"
android:entries="@array/items_per_page"/>
</LinearLayout>
</LinearLayout>
<com.evrencoskun.tableview.TableView
android:id="@+id/tableview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/table_test_container"
app:allow_click_inside_cell="true"
app:allow_click_inside_column_header="true"
app:allow_click_inside_row_header="true">
</com.evrencoskun.tableview.TableView>
</RelativeLayout>
================================================
FILE: app/src/main/res/layout/table_view_cell_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<LinearLayout android:id="@+id/cell_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="@dimen/cell_height"
android:background="@color/cell_background_color"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/cell_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/table_view_default_text_color"
android:textSize="@dimen/text_size"
android:visibility="visible"
tools:text="Cell Data"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/table_view_column_header_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<LinearLayout
android:id="@+id/column_header_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="@dimen/cell_height"
android:background="@color/cell_background_color"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/column_header_textView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="4"
android:gravity="center"
android:textColor="@color/table_view_default_text_color"
android:textSize="@dimen/text_size"
tools:text="Header Data"/>
<ImageButton
android:id="@+id/column_header_sortButton"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_gravity="end|center"
android:layout_marginLeft="4dp"
android:background="@android:color/transparent"
android:paddingRight="-5dp"
android:scaleType="fitXY"
android:visibility="gone"
app:srcCompat="@drawable/ic_down"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="@color/header_line_color"/>
</FrameLayout>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/table_view_corner_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/row_header_width"
android:layout_height="@dimen/cell_height"
android:background="@color/cell_background_color">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Corner"
android:textColor="@color/table_view_default_text_color"
android:textSize="@dimen/text_size"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/header_line_color"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/header_line_color"/>
</RelativeLayout>
================================================
FILE: app/src/main/res/layout/table_view_image_cell_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<LinearLayout android:id="@+id/cell_container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/cell_height"
android:background="@color/cell_background_color"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/cell_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:contentDescription="@string/app_name"
app:srcCompat="@drawable/ic_happy"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/table_view_row_header_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<RelativeLayout android:id="@+id/root"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/cell_background_color"
android:layout_width="@dimen/row_header_width"
android:layout_height="@dimen/cell_height">
<LinearLayout
android:id="@+id/row_header_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/row_header_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/table_view_default_text_color"
android:textSize="@dimen/text_size"
tools:text="Row Data"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/header_line_color"/>
</RelativeLayout>
================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="bg_line">#E7E7E7</color>
<color name="cell_background_color">#ffffff</color>
<color name="header_line_color">@android:color/holo_red_light</color>
<color name="table_view_default_text_color">#0a0a0a</color>
</resources>
================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<resources>
<dimen name="cell_height">40dp</dimen>
<dimen name="row_header_width">55dp</dimen>
<dimen name="text_size">12sp</dimen>
<!-- Overriding the default values of the tableView -->
<dimen name="default_row_header_width">55dp</dimen>
<dimen name="default_column_header_height">40dp</dimen>
</resources>
================================================
FILE: app/src/main/res/values/strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<resources>
<string name="app_name">TableViewSample</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="sort_ascending">Sort Ascending</string>
<string name="sort_descending">Sort Descending</string>
<string name="hiding_row_sample">Hiding 3. Row Sample</string>
<string name="showing_row_sample">Showing 3. Row Sample</string>
<string name="scroll_to_column_position">Scroll to 15. column position</string>
<string name="scroll_to_row_position">Scroll to 5. row position</string>
<string name="show_hide_the_column">Showing / Hiding 1. column</string>
<string name="table_pagination_details">Page %s, showing items %s - %s.</string>
<string-array name="moods">
<item />
<item>Happy</item>
<item>Sad</item>
</string-array>
<string-array name="gender">
<item />
<item>Male</item>
<item>Female</item>
</string-array>
<string-array name="items_per_page">
<item>10</item>
<item>20</item>
<item>25</item>
<item>50</item>
<item>All</item>
</string-array>
</resources>
================================================
FILE: app/src/main/res/values/styles.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ MIT License
~
~ Copyright (c) 2021 Evren Coşkun
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
================================================
FILE: build.gradle
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.android_gradle_plugin_version = '4.2.1'
ext.androidx_annotation_version = '1.2.0'
ext.androidx_appcompat_version = '1.3.0'
ext.androidx_core_version = '1.5.0'
ext.androidx_fragment_version = '1.3.5'
ext.androidx_recyclerview_version = '1.2.1'
ext.androidx_test_version = '1.3.0'
ext.androidx_test_espresso_version = '3.3.0'
ext.androidx_test_ext_version = '1.1.2'
ext.compile_sdk_version = 29
ext.java_version = '1.8'
ext.junit_version = '4.13.2'
ext.min_sdk_version = 14
ext.target_sdk_version = 29
repositories {
jcenter()
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$android_gradle_plugin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
if (project.getGradle().startParameter.taskNames.any{it.contains('bintrayUpload')} && project.name in ['tableview']) {
println project.name
apply plugin: 'maven'
gradle.taskGraph.whenReady { taskGraph ->
def pomTask = taskGraph.getAllTasks().find {
it.path == ":$project.name:generatePomFileForReleasePublication"
}
if (pomTask == null) println 'pomTask null'
if (pomTask == null) return
pomTask.doLast {
println 'Updating pom-file(s) with License info'
pomTask.outputs.files
.filter { File file ->
file.path.contains("publications") && file.name.matches("^pom-.+\\.xml\$")
}
.forEach { File file -> addLicense(file) }
}
}
}
}
static void addLicense(File pom) {
def licenseNode = new Node(null, "license")
licenseNode.append(new Node(null, "name", "MIT"))
licenseNode.append(new Node(null, "url", "https://github.com/evrencoskun/TableView/blob/master/LICENSE"))
def licensesNode = new Node(null, "licenses")
licensesNode.append(licenseNode)
def xml = new XmlParser().parse(pom)
xml.append(licensesNode)
def writer = new PrintWriter(new FileWriter(pom))
def printer = new XmlNodePrinter(writer)
printer.preserveWhitespace = true
printer.print(xml)
writer.close()
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#
# MIT License
#
# Copyright (c) 2021 Evren Coşkun
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
================================================
FILE: gradlew
================================================
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: settings.gradle
================================================
/*
* MIT License
*
* Copyright (c) 2021 Evren Coşkun
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
include ':app', ':tableview'
================================================
FILE: tableview/.gitignore
================================================
/build
================================================
FILE: tableview/build.gradle
================================================
apply plugin: 'com.android.library'
android {
compileSdkVersion compile_sdk_version
defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode 1
versionName '0.8.9.4'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled true
}
}
compileOptions {
sourceCompatibility = java_version
targetCompatibility = java_version
}
buildFeatures {
buildConfig = false
}
lintOptions {
abortOnError false
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
}
dependencies {
implementation "androidx.annotation:annotation:$androidx_annotation_version"
implementation "androidx.recyclerview:recyclerview:$androidx_recyclerview_version"
testImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
androidTestImplementation "androidx.test:rules:$androidx_test_version"
androidTestImplementation "androidx.test:runner:$androidx_test_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidx_test_espresso_version"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$androidx_test_espresso_version"
androidTestImplementation "androidx.test.ext:junit:$androidx_test_ext_version"
androidTestImplementation "junit:junit:$junit_version"
}
// Configure the publishing
apply plugin: 'maven-publish'
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
exclude '**/R.html', '**/R.*.html', '**/index.html'
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
archiveClassifier.set('javadoc')
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.evrencoskun.library'
artifactId = 'tableview'
version = android.defaultConfig.versionName
artifact androidJavadocsJar
artifact androidSourcesJar
pom {
name = 'TableView'
description = 'TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.'
url = 'https://github.com/evrencoskun/TableView'
}
}
}
repositories {
maven {
url = 'https://api.bintray.com/content/evrencoskun/artifact-sandbox/'
}
}
}
}
================================================
FILE: tableview/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/evrencoskun/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
================================================
FILE: tableview/src/androidTest/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.evrencoskun.tableview.test"
xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity android:name=".TestActivity">
</activity>
</application>
</manifest>
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/CornerLayoutTest.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Andrew Beck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableview.test;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyAbove;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyBelow;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyLeftOf;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyRightOf;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static androidx.test.espresso.matcher.ViewMatchers.withParentIndex;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import android.widget.RelativeLayout;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.evrencoskun.tableview.ITableView;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.test.adapters.CornerTestAdapter;
import com.evrencoskun.tableview.test.data.SimpleData;
import com.evrencoskun.tableview.test.matchers.ViewWidthMatcher;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class CornerLayoutTest {
@Rule
public ActivityScenarioRule<TestActivity> mActivityTestRule =
new ActivityScenarioRule<>(TestActivity.class);
@Test
public void testDefaultCorner() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_default);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyLeftOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyAbove(withId(R.id.RowHeaderRecyclerView)));
}
@Test
public void testTopLeftCorner() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_top_left);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyLeftOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyAbove(withId(R.id.RowHeaderRecyclerView)));
}
@Test
public void testBottomLeftCorner() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_bottom_left);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyLeftOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyBelow(withId(R.id.RowHeaderRecyclerView)));
}
@Test
public void testTopRightCorner() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_top_right);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyRightOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyAbove(withId(R.id.RowHeaderRecyclerView)));
}
@Test
public void testBottomRightCorner() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_bottom_right);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyRightOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyBelow(withId(R.id.RowHeaderRecyclerView)));
}
@Test
public void testCornerConstructor() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity, false);
// initialize was false so set properties and call initialize
tableView.setCornerViewLocation(ITableView.CornerViewLocation.BOTTOM_LEFT);
tableView.initialize();
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
activity.setContentView(rl);
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyLeftOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyBelow(withId(R.id.RowHeaderRecyclerView)));
}
@Test
public void testSetRowHeaderWidthLeft() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_top_left);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
// Set a new width on row header
tableView.setRowHeaderWidth(200);
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyLeftOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyAbove(withId(R.id.RowHeaderRecyclerView)));
// Check that the corner is new width
onView(withId(R.id.corner_view)).check(matches(new ViewWidthMatcher(200)));
// Check that the row header is new width
onView(withId(R.id.RowHeaderRecyclerView)).check(matches(new ViewWidthMatcher(200)));
}
@Test
public void testSetRowHeaderWidthRight() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_top_right);
TableView tableView = activity.findViewById(R.id.tableview);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
// Set a new width on row header
tableView.setRowHeaderWidth(200);
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that Corner to is to the right of the column headers
onView(withId(R.id.corner_view)).check(isCompletelyRightOf(withId(R.id.ColumnHeaderRecyclerView)));
// Check that Corner to is to the above of the row headers
onView(withId(R.id.corner_view)).check(isCompletelyAbove(withId(R.id.RowHeaderRecyclerView)));
// Check that the corner is new width
onView(withId(R.id.corner_view)).check(matches(new ViewWidthMatcher(200)));
// Check that the row header is new width
onView(withId(R.id.RowHeaderRecyclerView)).check(matches(new ViewWidthMatcher(200)));
}
}
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/CornerViewTest.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Andrew Beck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableview.test;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.Visibility;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import android.widget.RelativeLayout;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.test.adapters.SimpleTestAdapter;
import com.evrencoskun.tableview.test.data.SimpleData;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class CornerViewTest {
@Rule
public ActivityScenarioRule<TestActivity> mActivityTestRule =
new ActivityScenarioRule<>(TestActivity.class);
@Test
public void testEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is not created (therefore not shown)
Assert.assertNull(simpleTestAdapter.getCornerView());
});
}
@Test
public void testEmptyTableResetNonEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is not created (therefore not shown)
Assert.assertNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(2);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
// Check that the corner view is now created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view is now visible
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
onView(withId(R.id.corner_text))
.check(matches(withText("Corner")));
}
@Test
public void testEmptyTableResetEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is not created (therefore not shown)
Assert.assertNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
// Check that the corner view is still not created
Assert.assertNull(simpleTestAdapter.getCornerView());
});
}
@Test
public void testNonEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(1);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view is now visible
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
onView(withId(R.id.corner_text))
.check(matches(withText("Corner")));
}
@Test
public void testNonEmptyTableResetNonEmpty() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
tableView.setId(R.id.tableview);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(1);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is created before resetting to empty
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view is visible
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = activity.findViewById(R.id.tableview);
SimpleTestAdapter simpleTestAdapter = (SimpleTestAdapter) tableView.getAdapter();
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(2);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
// Check that the corner view is still created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view is still visible
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
onView(withId(R.id.corner_text))
.check(matches(withText("Corner")));
}
@Test
public void testNonEmptyTableResetEmpty() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(1);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
// Check that the corner view is created before resetting to empty
Assert.assertNotNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
activity.setContentView(rl);
// Check that the corner view is still created but visibility is gone
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view visibility is GONE
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.GONE)));
}
@Test
public void testColumnHeadersOnlyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
// Only want column headers
SimpleData simpleData = new SimpleData(5, 0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is not created
Assert.assertNull(simpleTestAdapter.getCornerView());
});
}
@Test
public void testColumnHeadersOnlyTableResetNonEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
// Only want column headers
SimpleData simpleData = new SimpleData(5, 0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
// Check that the corner view is not created
Assert.assertNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(5);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
activity.setContentView(rl);
// Check that the corner view is not created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view is now visible
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
onView(withId(R.id.corner_text))
.check(matches(withText("Corner")));
}
@Test
public void testColumnHeadersOnlyTableResetEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
// Only want column headers
SimpleData simpleData = new SimpleData(5, 0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
// Check that the corner view is not created
Assert.assertNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
activity.setContentView(rl);
// Check that the corner view is not created
Assert.assertNull(simpleTestAdapter.getCornerView());
});
}
@Test
public void testColumnHeadersOnlyTableShowCorner() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
// Set the option to show corner view when there is not row data
tableView.setShowCornerView(true);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
// Only want column headers
SimpleData simpleData = new SimpleData(5, 0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
activity.setContentView(rl);
// Check that the corner view is created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view is now visible
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
onView(withId(R.id.corner_text))
.check(matches(withText("Corner")));
}
@Test
public void testColumnHeadersOnlyTableShowCornerResetEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
// Set the option to show corner view when there is not row data
tableView.setShowCornerView(true);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
// Only want column headers
SimpleData simpleData = new SimpleData(5, 0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
// Check that the corner view is created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(0);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
activity.setContentView(rl);
// Check that the corner view is still created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view visibility is GONE
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.GONE)));
}
@Test
public void testColumnHeadersOnlyTableShowCornerResetNonEmptyTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
// Set the option to show corner view when there is not row data
tableView.setShowCornerView(true);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
// Only want column headers
SimpleData simpleData = new SimpleData(5, 0);
simpleTestAdapter.setAllItems(simpleData.getColumnHeaders(), simpleData.getRowHeaders(),
simpleData.getCells());
// Check that the corner view is created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
// Change the items of data to reset
SimpleData simpleDataReset = new SimpleData(2);
simpleTestAdapter.setAllItems(simpleDataReset.getColumnHeaders(), simpleDataReset.getRowHeaders(),
simpleDataReset.getCells());
activity.setContentView(rl);
// Check that the corner view is still created
Assert.assertNotNull(simpleTestAdapter.getCornerView());
});
// Check the corner view visibility is VISIBLE
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
}
}
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/ReverseLayoutTest.java
================================================
/*
* MIT License
*
* Copyright (c) 2020 Andrew Beck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableview.test;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyLeftOf;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyRightOf;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.Visibility;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static androidx.test.espresso.matcher.ViewMatchers.withParentIndex;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import android.widget.RelativeLayout;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.evrencoskun.tableview.ITableView;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.test.adapters.CornerTestAdapter;
import com.evrencoskun.tableview.test.data.SimpleData;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class ReverseLayoutTest {
@Rule
public ActivityScenarioRule<TestActivity> mActivityTestRule =
new ActivityScenarioRule<>(TestActivity.class);
@Test
public void testDefaultLayout() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.corner_default);
TableView tableView = activity.findViewById(R.id.tableview);
Assert.assertNotNull(tableView);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that column headers are ordered Left to Right
onView(withText("c:0")).check(isCompletelyLeftOf(withText("c:1")));
// Check that first cell data row are ordered Left to Right
onView(withText("r:0c:0")).check(isCompletelyLeftOf(withText("r:0c:1")));
}
@Test
public void testReverseLayout() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
activity.setContentView(R.layout.reverse_layout);
TableView tableView = activity.findViewById(R.id.tableview);
Assert.assertNotNull(tableView);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that column headers are ordered Right to Left
onView(withText("c:0")).check(isCompletelyRightOf(withText("c:1")));
// Check that first cell data row are ordered Right to Left
onView(withText("r:0c:0")).check(isCompletelyRightOf(withText("r:0c:1")));
}
@Test
public void testReverseConstructor() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity, false);
// initialize was false so set properties and call initialize
//Set CornerView to Top Right and ReverseLayout = true
tableView.setCornerViewLocation(ITableView.CornerViewLocation.TOP_RIGHT);
tableView.setReverseLayout(true);
tableView.initialize();
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
CornerTestAdapter cornerTestAdapter = new CornerTestAdapter();
tableView.setAdapter(cornerTestAdapter);
SimpleData simpleData = new SimpleData(5);
cornerTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
activity.setContentView(rl);
});
// Check that the corner view is created and visible
// The Corner view uses cell_layout which has RelativeLayout as top item
onView(withId(R.id.corner_view))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)));
// Check that it is the expected corner view by checking the text
// The first child of the RelativeLayout is a textView (index starts at zero)
onView(allOf(withParent(withId(R.id.corner_view)), withParentIndex(0)))
.check(matches(withText("Corner")));
// Check that column headers are ordered Right to Left
onView(withText("c:0")).check(isCompletelyRightOf(withText("c:1")));
// Check that first cell data row are ordered Right to Left
onView(withText("r:0c:0")).check(isCompletelyRightOf(withText("r:0c:1")));
}
}
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/SimpleActivityTest.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Andrew Beck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableview.test;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static androidx.test.espresso.matcher.ViewMatchers.withParentIndex;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.test.adapters.SimpleTestAdapter;
import com.evrencoskun.tableview.test.data.SimpleData;
import org.hamcrest.Matcher;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class SimpleActivityTest {
@Rule
public ActivityScenarioRule<TestActivity> mActivityTestRule =
new ActivityScenarioRule<>(TestActivity.class);
@Test
public void testDefaults() {
TableView tableView =
new TableView(InstrumentationRegistry.getInstrumentation().getTargetContext());
Assert.assertFalse(tableView.isAllowClickInsideCell());
Assert.assertTrue(tableView.isShowHorizontalSeparators());
Assert.assertTrue(tableView.isShowVerticalSeparators());
}
@Test
public void testSmallTable() {
mActivityTestRule.getScenario()
.onActivity(activity -> {
TableView tableView = new TableView(activity);
tableView.setId(R.id.tableview);
RelativeLayout rl = new RelativeLayout(activity);
rl.addView(tableView);
SimpleTestAdapter simpleTestAdapter = new SimpleTestAdapter();
tableView.setAdapter(simpleTestAdapter);
SimpleData simpleData = new SimpleData(5);
simpleTestAdapter.setAllItems(
simpleData.getColumnHeaders(), simpleData.getRowHeaders(), simpleData.getCells());
activity.setContentView(rl);
});
// Check that the row header was created as expected at 5th Row (index starts at zero)
// cell_layout has LinearLayout as top item
Matcher<View> rowHeaders = allOf(withParent(withId(R.id.tableview)), withParentIndex(1));
Matcher<View> rowHeader = allOf(withParent(rowHeaders), withParentIndex(4));
onView(allOf(withParent(rowHeader), withParentIndex(0)))
.check(matches(withText("r:4")));
// Check that the column header was created as expected at 5th Row (index starts at zero)
// cell_layout has LinearLayout as top item
Matcher<View> columnHeaders = allOf(withParent(withId(R.id.tableview)), withParentIndex(0));
Matcher<View> columnHeader = allOf(withParent(columnHeaders), withParentIndex(4));
onView(allOf(withParent(columnHeader), withParentIndex(0)))
.check(matches(withText("c:4")));
}
}
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/TestActivity.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Andrew Beck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.evrencoskun.tableview.test;
import android.app.Activity;
public class TestActivity extends Activity {
}
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/AbstractTableAdapterTest.java
================================================
package com.evrencoskun.tableview.test.adapters;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static java.util.Collections.emptyList;
import android.view.View;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import com.evrencoskun.tableview.TableView;
import com.evrencoskun.tableview.test.TestActivity;
import com.evrencoskun.tableview.test.data.SimpleData;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
public class AbstractTableAdapterTest {
@Rule
public ActivityScenarioRule<TestActivity> mActivityTestRule =
new ActivityScenarioRule<>(TestActivity.class);
private SimpleData mData;
private TableView mTableView;
private SimpleTestAdapter mAdapter;
@Before
public void before() {
mData = new SimpleData(5);
mTableView = new TableView(InstrumentationRegistry.getInstrumentation().getContext());
mAdapter = new SimpleTestAdapter();
mAdapter.setTableView(mTableView);
}
@Test
public void testCornerViewStateWithDisabledCorner() {
mTableView.setShowCornerView(false);
assertNull(mAdapter.getCornerView());
mAdapter.setAllItems(null, null, null);
assertNull(mAdapter.getCornerView());
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), mData.getCells());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(emptyList(), emptyList(), emptyList());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
}
@Test
public void testCornerViewStateWithEnabledCorners() {
mTableView.setShowCornerView(true);
assertNull(mAdapter.getCornerView());
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), mData.getCells());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(null, null, null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
// We set some data, that we then reset to empty
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), mData.getCells());
mAdapter.setAllItems(emptyList(), emptyList(), emptyList());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(mData.getColumnHeaders(), null, null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(null, mData.getRowHeaders(), null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
}
@Test
public void testCornerViewStateWithToggledCorners() {
mTableView.setShowCornerView(true);
assertNull(mAdapter.getCornerView());
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), mData.getCells());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
mTableView.setShowCornerView(false);
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), mData.getCells());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(null, null, null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
// We set some data, that we then reset to empty
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), mData.getCells());
mAdapter.setAllItems(emptyList(), emptyList(), emptyList());
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(mData.getColumnHeaders(), null, null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(null, mData.getRowHeaders(), null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.GONE, mAdapter.getCornerView().getVisibility());
mAdapter.setAllItems(mData.getColumnHeaders(), mData.getRowHeaders(), null);
assertNotNull(mAdapter.getCornerView());
assertEquals(View.VISIBLE, mAdapter.getCornerView().getVisibility());
}
}
================================================
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/CornerTestAdapter.java
================================================
/*
* MIT License
*
* Copyright (c) 2021 Andrew Beck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software i
gitextract_wgk_y394/
├── .github/
│ ├── CONTRIBUTING.md
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── config.yml
│ │ └── feature_request.md
│ └── workflows/
│ └── validate_tableview.yml
├── .gitignore
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── evrencoskun/
│ │ └── tableviewsample/
│ │ ├── MainActivity.java
│ │ ├── MainFragment.java
│ │ └── tableview/
│ │ ├── TableViewAdapter.java
│ │ ├── TableViewListener.java
│ │ ├── TableViewModel.java
│ │ ├── holder/
│ │ │ ├── CellViewHolder.java
│ │ │ ├── ColumnHeaderViewHolder.java
│ │ │ ├── GenderCellViewHolder.java
│ │ │ ├── MoodCellViewHolder.java
│ │ │ └── RowHeaderViewHolder.java
│ │ ├── model/
│ │ │ ├── Cell.java
│ │ │ ├── ColumnHeader.java
│ │ │ └── RowHeader.java
│ │ └── popup/
│ │ ├── ColumnHeaderLongPressPopup.java
│ │ └── RowHeaderLongPressPopup.java
│ └── res/
│ ├── drawable/
│ │ ├── ic_down.xml
│ │ ├── ic_female.xml
│ │ ├── ic_happy.xml
│ │ ├── ic_male.xml
│ │ ├── ic_next.xml
│ │ ├── ic_previous.xml
│ │ ├── ic_sad.xml
│ │ └── ic_up.xml
│ ├── layout/
│ │ ├── activity_main.xml
│ │ ├── fragment_main.xml
│ │ ├── table_view_cell_layout.xml
│ │ ├── table_view_column_header_layout.xml
│ │ ├── table_view_corner_layout.xml
│ │ ├── table_view_image_cell_layout.xml
│ │ └── table_view_row_header_layout.xml
│ └── values/
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── tableview/
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src/
├── androidTest/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── evrencoskun/
│ │ └── tableview/
│ │ └── test/
│ │ ├── CornerLayoutTest.java
│ │ ├── CornerViewTest.java
│ │ ├── ReverseLayoutTest.java
│ │ ├── SimpleActivityTest.java
│ │ ├── TestActivity.java
│ │ ├── adapters/
│ │ │ ├── AbstractTableAdapterTest.java
│ │ │ ├── CornerTestAdapter.java
│ │ │ └── SimpleTestAdapter.java
│ │ ├── data/
│ │ │ └── SimpleData.java
│ │ ├── matchers/
│ │ │ └── ViewWidthMatcher.java
│ │ └── models/
│ │ ├── Cell.java
│ │ ├── ColumnHeader.java
│ │ └── RowHeader.java
│ └── res/
│ ├── layout/
│ │ ├── cell_layout.xml
│ │ ├── column_layout.xml
│ │ ├── corner_bottom_left.xml
│ │ ├── corner_bottom_right.xml
│ │ ├── corner_default.xml
│ │ ├── corner_layout.xml
│ │ ├── corner_top_left.xml
│ │ ├── corner_top_right.xml
│ │ ├── reverse_layout.xml
│ │ └── row_layout.xml
│ └── values/
│ ├── colors.xml
│ └── dimens.xml
└── main/
├── AndroidManifest.xml
├── java/
│ └── com/
│ └── evrencoskun/
│ └── tableview/
│ ├── ITableView.java
│ ├── TableView.java
│ ├── adapter/
│ │ ├── AbstractTableAdapter.java
│ │ ├── AdapterDataSetChangedListener.java
│ │ ├── ITableAdapter.java
│ │ └── recyclerview/
│ │ ├── AbstractRecyclerViewAdapter.java
│ │ ├── CellRecyclerView.java
│ │ ├── CellRecyclerViewAdapter.java
│ │ ├── CellRowRecyclerViewAdapter.java
│ │ ├── ColumnHeaderRecyclerViewAdapter.java
│ │ ├── RowHeaderRecyclerViewAdapter.java
│ │ └── holder/
│ │ ├── AbstractSorterViewHolder.java
│ │ └── AbstractViewHolder.java
│ ├── filter/
│ │ ├── Filter.java
│ │ ├── FilterChangedListener.java
│ │ ├── FilterItem.java
│ │ ├── FilterType.java
│ │ └── IFilterableModel.java
│ ├── handler/
│ │ ├── ColumnSortHandler.java
│ │ ├── ColumnWidthHandler.java
│ │ ├── FilterHandler.java
│ │ ├── PreferencesHandler.java
│ │ ├── ScrollHandler.java
│ │ ├── SelectionHandler.java
│ │ └── VisibilityHandler.java
│ ├── layoutmanager/
│ │ ├── CellLayoutManager.java
│ │ ├── ColumnHeaderLayoutManager.java
│ │ └── ColumnLayoutManager.java
│ ├── listener/
│ │ ├── ITableViewListener.java
│ │ ├── SimpleTableViewListener.java
│ │ ├── TableViewLayoutChangeListener.java
│ │ ├── itemclick/
│ │ │ ├── AbstractItemClickListener.java
│ │ │ ├── CellRecyclerViewItemClickListener.java
│ │ │ ├── ColumnHeaderRecyclerViewItemClickListener.java
│ │ │ └── RowHeaderRecyclerViewItemClickListener.java
│ │ └── scroll/
│ │ ├── HorizontalRecyclerViewListener.java
│ │ └── VerticalRecyclerViewListener.java
│ ├── pagination/
│ │ ├── IPagination.java
│ │ └── Pagination.java
│ ├── preference/
│ │ ├── Preferences.java
│ │ └── SavedState.java
│ ├── sort/
│ │ ├── AbstractSortComparator.java
│ │ ├── ColumnForRowHeaderSortComparator.java
│ │ ├── ColumnSortCallback.java
│ │ ├── ColumnSortComparator.java
│ │ ├── ColumnSortHelper.java
│ │ ├── ColumnSortStateChangedListener.java
│ │ ├── ISortableModel.java
│ │ ├── RowHeaderForCellSortComparator.java
│ │ ├── RowHeaderSortCallback.java
│ │ ├── RowHeaderSortComparator.java
│ │ ├── RowHeaderSortHelper.java
│ │ └── SortState.java
│ └── util/
│ └── TableViewUtils.java
└── res/
├── drawable/
│ └── cell_line_divider.xml
└── values/
├── attrs.xml
├── colors.xml
├── dimens.xml
├── ids.xml
└── integers.xml
SYMBOL INDEX (812 symbols across 82 files)
FILE: app/src/main/java/com/evrencoskun/tableviewsample/MainActivity.java
class MainActivity (line 29) | public class MainActivity extends AppCompatActivity {
method MainActivity (line 30) | public MainActivity() {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/MainFragment.java
class MainFragment (line 52) | public class MainFragment extends Fragment {
method MainFragment (line 64) | public MainFragment() {
method onViewCreated (line 68) | @Override
method initializeTableView (line 117) | private void initializeTableView() {
method filterTable (line 150) | public void filterTable(@NonNull String filter) {
method filterTableForMood (line 157) | public void filterTableForMood(@NonNull String filter) {
method filterTableForGender (line 165) | public void filterTableForGender(@NonNull String filter) {
method nextTablePage (line 176) | public void nextTablePage() {
method previousTablePage (line 182) | public void previousTablePage() {
method goToTablePage (line 188) | public void goToTablePage(int page) {
method setTableItemsPerPage (line 194) | public void setTableItemsPerPage(int itemsPerPage) {
method onPageTurned (line 204) | @Override
method onItemSelected (line 233) | @Override
method onNothingSelected (line 248) | @Override
method beforeTextChanged (line 256) | @Override
method onTextChanged (line 260) | @Override
method afterTextChanged (line 265) | @Override
method onItemSelected (line 273) | @Override
method onNothingSelected (line 285) | @Override
method onClick (line 292) | @Override
method beforeTextChanged (line 304) | @Override
method onTextChanged (line 308) | @Override
method afterTextChanged (line 320) | @Override
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewAdapter.java
class TableViewAdapter (line 54) | public class TableViewAdapter extends AbstractTableAdapter<ColumnHeader,...
method TableViewAdapter (line 66) | public TableViewAdapter(@NonNull TableViewModel tableViewModel) {
method onCreateCellViewHolder (line 80) | @NonNull
method onBindCellViewHolder (line 122) | @Override
method onCreateColumnHeaderViewHolder (line 156) | @NonNull
method onBindColumnHeaderViewHolder (line 183) | @Override
method onCreateRowHeaderViewHolder (line 201) | @NonNull
method onBindRowHeaderViewHolder (line 226) | @Override
method onCreateCornerView (line 235) | @NonNull
method getColumnHeaderItemViewType (line 255) | @Override
method getRowHeaderItemViewType (line 264) | @Override
method getCellItemViewType (line 273) | @Override
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewListener.java
class TableViewListener (line 43) | public class TableViewListener implements ITableViewListener {
method TableViewListener (line 49) | public TableViewListener(@NonNull TableView tableView) {
method onCellClicked (line 61) | @Override
method onCellDoubleClicked (line 76) | @Override
method onCellLongPressed (line 89) | @Override
method onColumnHeaderClicked (line 102) | @Override
method onColumnHeaderDoubleClicked (line 115) | @Override
method onColumnHeaderLongPressed (line 127) | @Override
method onRowHeaderClicked (line 146) | @Override
method onRowHeaderDoubleClicked (line 158) | @Override
method onRowHeaderLongPressed (line 170) | @Override
method showToast (line 180) | private void showToast(String p_strMessage) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewModel.java
class TableViewModel (line 43) | public class TableViewModel {
method TableViewModel (line 69) | public TableViewModel() {
method getSimpleRowHeaderList (line 77) | @NonNull
method getRandomColumnHeaderList (line 91) | @NonNull
method getCellListForSortingTest (line 112) | @NonNull
method getDrawable (line 152) | @DrawableRes
method getCellList (line 161) | @NonNull
method getRowHeaderList (line 166) | @NonNull
method getColumnHeaderList (line 171) | @NonNull
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/CellViewHolder.java
class CellViewHolder (line 42) | public class CellViewHolder extends AbstractViewHolder {
method CellViewHolder (line 48) | public CellViewHolder(@NonNull View itemView) {
method setCell (line 54) | public void setCell(@Nullable Cell cell) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/ColumnHeaderViewHolder.java
class ColumnHeaderViewHolder (line 46) | public class ColumnHeaderViewHolder extends AbstractSorterViewHolder {
method ColumnHeaderViewHolder (line 59) | public ColumnHeaderViewHolder(@NonNull View itemView, @Nullable ITable...
method setColumnHeader (line 73) | public void setColumnHeader(@Nullable ColumnHeader columnHeader) {
method onClick (line 86) | @Override
method onSortingStatusChanged (line 100) | @Override
method controlSortState (line 123) | private void controlSortState(@NonNull SortState sortState) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/GenderCellViewHolder.java
class GenderCellViewHolder (line 38) | public class GenderCellViewHolder extends MoodCellViewHolder {
method GenderCellViewHolder (line 40) | public GenderCellViewHolder(@NonNull View itemView) {
method setData (line 44) | @Override
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/MoodCellViewHolder.java
class MoodCellViewHolder (line 40) | public class MoodCellViewHolder extends AbstractViewHolder {
method MoodCellViewHolder (line 44) | public MoodCellViewHolder(@NonNull View itemView) {
method setData (line 49) | public void setData(Object data) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/RowHeaderViewHolder.java
class RowHeaderViewHolder (line 39) | public class RowHeaderViewHolder extends AbstractViewHolder {
method RowHeaderViewHolder (line 43) | public RowHeaderViewHolder(@NonNull View itemView) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/Cell.java
class Cell (line 37) | public class Cell implements ISortableModel, IFilterableModel {
method Cell (line 45) | public Cell(@NonNull String id, @Nullable Object data) {
method getId (line 55) | @NonNull
method getContent (line 65) | @Nullable
method getData (line 71) | @Nullable
method getFilterableKeyword (line 76) | @NonNull
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/ColumnHeader.java
class ColumnHeader (line 34) | public class ColumnHeader extends Cell {
method ColumnHeader (line 35) | public ColumnHeader(@NonNull String id, @Nullable String data) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/RowHeader.java
class RowHeader (line 34) | public class RowHeader extends Cell {
method RowHeader (line 35) | public RowHeader(@NonNull String id, @Nullable String data) {
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/popup/ColumnHeaderLongPressPopup.java
class ColumnHeaderLongPressPopup (line 43) | public class ColumnHeaderLongPressPopup extends PopupMenu implements Pop...
method ColumnHeaderLongPressPopup (line 56) | public ColumnHeaderLongPressPopup(@NonNull ColumnHeaderViewHolder view...
method initialize (line 64) | private void initialize() {
method createMenuItem (line 71) | private void createMenuItem() {
method changeMenuItemVisibility (line 83) | private void changeMenuItemVisibility() {
method onMenuItemClick (line 97) | @Override
FILE: app/src/main/java/com/evrencoskun/tableviewsample/tableview/popup/RowHeaderLongPressPopup.java
class RowHeaderLongPressPopup (line 42) | public class RowHeaderLongPressPopup extends PopupMenu implements PopupMenu
method RowHeaderLongPressPopup (line 54) | public RowHeaderLongPressPopup(@NonNull RecyclerView.ViewHolder viewHo...
method initialize (line 63) | private void initialize() {
method createMenuItem (line 69) | private void createMenuItem() {
method onMenuItemClick (line 80) | @Override
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/CornerLayoutTest.java
class CornerLayoutTest (line 56) | @RunWith(AndroidJUnit4.class)
method testDefaultCorner (line 63) | @Test
method testTopLeftCorner (line 98) | @Test
method testBottomLeftCorner (line 133) | @Test
method testTopRightCorner (line 168) | @Test
method testBottomRightCorner (line 203) | @Test
method testCornerConstructor (line 238) | @Test
method testSetRowHeaderWidthLeft (line 280) | @Test
method testSetRowHeaderWidthRight (line 324) | @Test
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/CornerViewTest.java
class CornerViewTest (line 48) | @RunWith(AndroidJUnit4.class)
method testEmptyTable (line 55) | @Test
method testEmptyTableResetNonEmptyTable (line 80) | @Test
method testEmptyTableResetEmptyTable (line 122) | @Test
method testNonEmptyTable (line 156) | @Test
method testNonEmptyTableResetNonEmpty (line 189) | @Test
method testNonEmptyTableResetEmpty (line 243) | @Test
method testColumnHeadersOnlyTable (line 281) | @Test
method testColumnHeadersOnlyTableResetNonEmptyTable (line 307) | @Test
method testColumnHeadersOnlyTableResetEmptyTable (line 350) | @Test
method testColumnHeadersOnlyTableShowCorner (line 385) | @Test
method testColumnHeadersOnlyTableShowCornerResetEmptyTable (line 422) | @Test
method testColumnHeadersOnlyTableShowCornerResetNonEmptyTable (line 464) | @Test
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/ReverseLayoutTest.java
class ReverseLayoutTest (line 54) | @RunWith(AndroidJUnit4.class)
method testDefaultLayout (line 61) | @Test
method testReverseLayout (line 97) | @Test
method testReverseConstructor (line 133) | @Test
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/SimpleActivityTest.java
class SimpleActivityTest (line 52) | @RunWith(AndroidJUnit4.class)
method testDefaults (line 59) | @Test
method testSmallTable (line 68) | @Test
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/TestActivity.java
class TestActivity (line 29) | public class TestActivity extends Activity {
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/AbstractTableAdapterTest.java
class AbstractTableAdapterTest (line 23) | @RunWith(AndroidJUnit4.class)
method before (line 34) | @Before
method testCornerViewStateWithDisabledCorner (line 43) | @Test
method testCornerViewStateWithEnabledCorners (line 64) | @Test
method testCornerViewStateWithToggledCorners (line 103) | @Test
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/CornerTestAdapter.java
class CornerTestAdapter (line 42) | public class CornerTestAdapter extends AbstractTableAdapter<ColumnHeader...
class TestCellViewHolder (line 44) | static class TestCellViewHolder extends AbstractViewHolder {
method TestCellViewHolder (line 49) | TestCellViewHolder(View itemView) {
method onCreateCellViewHolder (line 56) | @NonNull
method onBindCellViewHolder (line 63) | public void onBindCellViewHolder(@NonNull AbstractViewHolder holder, C...
class TestColumnHeaderViewHolder (line 73) | static class TestColumnHeaderViewHolder extends AbstractViewHolder {
method TestColumnHeaderViewHolder (line 78) | public TestColumnHeaderViewHolder(View itemView) {
method onCreateColumnHeaderViewHolder (line 85) | @NonNull
method onBindColumnHeaderViewHolder (line 93) | public void onBindColumnHeaderViewHolder(@NonNull AbstractViewHolder h...
class TestRowHeaderViewHolder (line 105) | static class TestRowHeaderViewHolder extends AbstractViewHolder {
method TestRowHeaderViewHolder (line 109) | public TestRowHeaderViewHolder(View itemView) {
method onCreateRowHeaderViewHolder (line 115) | @NonNull
method onBindRowHeaderViewHolder (line 123) | public void onBindRowHeaderViewHolder(@NonNull AbstractViewHolder holder,
method onCreateCornerView (line 131) | @NonNull
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/SimpleTestAdapter.java
class SimpleTestAdapter (line 42) | public class SimpleTestAdapter extends AbstractTableAdapter<ColumnHeader...
class TestCellViewHolder (line 44) | static class TestCellViewHolder extends AbstractViewHolder {
method TestCellViewHolder (line 49) | TestCellViewHolder(View itemView) {
method onCreateCellViewHolder (line 56) | @NonNull
method onBindCellViewHolder (line 63) | public void onBindCellViewHolder(@NonNull AbstractViewHolder holder, C...
method onCreateColumnHeaderViewHolder (line 73) | @NonNull
method onBindColumnHeaderViewHolder (line 81) | public void onBindColumnHeaderViewHolder(@NonNull AbstractViewHolder h...
method onCreateRowHeaderViewHolder (line 92) | @NonNull
method onBindRowHeaderViewHolder (line 99) | public void onBindRowHeaderViewHolder(@NonNull AbstractViewHolder holder,
method onCreateCornerView (line 107) | @NonNull
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/data/SimpleData.java
class SimpleData (line 34) | public class SimpleData {
method SimpleData (line 39) | public SimpleData(int size){
method SimpleData (line 43) | public SimpleData(int columnSize, int rowSize) {
method init (line 47) | private void init(int columnSize, int rowSize) {
method getCells (line 69) | public List<List<Cell>> getCells() {
method setCells (line 73) | public void setCells(List<List<Cell>> cells) {
method getColumnHeaders (line 77) | public List<ColumnHeader> getColumnHeaders() {
method setColumnHeaders (line 81) | public void setColumnHeaders(List<ColumnHeader> columnHeaders) {
method getRowHeaders (line 85) | public List<RowHeader> getRowHeaders() {
method setRowHeaders (line 89) | public void setRowHeaders(List<RowHeader> rowHeaders) {
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/matchers/ViewWidthMatcher.java
class ViewWidthMatcher (line 32) | public class ViewWidthMatcher extends TypeSafeMatcher<View> {
method ViewWidthMatcher (line 35) | public ViewWidthMatcher(int expectedWidth) {
method matchesSafely (line 40) | @Override
method describeTo (line 47) | @Override
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/models/Cell.java
class Cell (line 33) | public class Cell implements ISortableModel, IFilterableModel {
method Cell (line 41) | public Cell(@NonNull String id, @Nullable Object data) {
method getId (line 51) | @NonNull
method getContent (line 61) | @Nullable
method getData (line 67) | @Nullable
method setData (line 72) | public void setData(@Nullable Object data) {
method getFilterableKeyword (line 76) | @NonNull
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/models/ColumnHeader.java
class ColumnHeader (line 31) | public class ColumnHeader extends Cell {
method ColumnHeader (line 32) | public ColumnHeader(@NonNull String id, @Nullable String data) {
FILE: tableview/src/androidTest/java/com/evrencoskun/tableview/test/models/RowHeader.java
class RowHeader (line 30) | public class RowHeader extends Cell {
method RowHeader (line 31) | public RowHeader(@NonNull String id, @Nullable String data) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/ITableView.java
type ITableView (line 55) | public interface ITableView {
method addView (line 57) | void addView(View child, ViewGroup.LayoutParams params);
method hasFixedWidth (line 59) | boolean hasFixedWidth();
method isIgnoreSelectionColors (line 61) | boolean isIgnoreSelectionColors();
method isShowHorizontalSeparators (line 63) | boolean isShowHorizontalSeparators();
method isShowVerticalSeparators (line 65) | boolean isShowVerticalSeparators();
method isAllowClickInsideCell (line 67) | boolean isAllowClickInsideCell();
method isSortable (line 69) | boolean isSortable();
method getContext (line 71) | @NonNull
method getCellRecyclerView (line 74) | @NonNull
method getColumnHeaderRecyclerView (line 77) | @NonNull
method getRowHeaderRecyclerView (line 80) | @NonNull
method getColumnHeaderLayoutManager (line 83) | @NonNull
method getCellLayoutManager (line 86) | @NonNull
method getRowHeaderLayoutManager (line 89) | @NonNull
method getHorizontalRecyclerViewListener (line 92) | @NonNull
method getVerticalRecyclerViewListener (line 95) | @NonNull
method getTableViewListener (line 98) | @Nullable
method getSelectionHandler (line 101) | @NonNull
method getColumnSortHandler (line 104) | @Nullable
method getVisibilityHandler (line 107) | @NonNull
method getHorizontalItemDecoration (line 110) | @NonNull
method getVerticalItemDecoration (line 113) | @NonNull
method getSortingStatus (line 116) | @NonNull
method getRowHeaderSortingStatus (line 119) | @Nullable
method scrollToColumnPosition (line 122) | void scrollToColumnPosition(int column);
method scrollToColumnPosition (line 124) | void scrollToColumnPosition(int column, int offset);
method scrollToRowPosition (line 126) | void scrollToRowPosition(int row);
method scrollToRowPosition (line 128) | void scrollToRowPosition(int row, int offset);
method showRow (line 130) | void showRow(int row);
method hideRow (line 132) | void hideRow(int row);
method isRowVisible (line 134) | boolean isRowVisible(int row);
method showAllHiddenRows (line 136) | void showAllHiddenRows();
method clearHiddenRowList (line 138) | void clearHiddenRowList();
method showColumn (line 140) | void showColumn(int column);
method hideColumn (line 142) | void hideColumn(int column);
method isColumnVisible (line 144) | boolean isColumnVisible(int column);
method showAllHiddenColumns (line 146) | void showAllHiddenColumns();
method clearHiddenColumnList (line 148) | void clearHiddenColumnList();
method getShadowColor (line 150) | int getShadowColor();
method getSelectedColor (line 152) | int getSelectedColor();
method getUnSelectedColor (line 154) | int getUnSelectedColor();
method getSeparatorColor (line 156) | int getSeparatorColor();
method sortColumn (line 158) | void sortColumn(int columnPosition, @NonNull SortState sortState);
method sortRowHeader (line 160) | void sortRowHeader(@NonNull SortState sortState);
method remeasureColumnWidth (line 162) | void remeasureColumnWidth(int column);
method getRowHeaderWidth (line 164) | int getRowHeaderWidth();
method setRowHeaderWidth (line 166) | void setRowHeaderWidth(int rowHeaderWidth);
method getShowCornerView (line 168) | boolean getShowCornerView();
type CornerViewLocation (line 170) | enum CornerViewLocation {
method CornerViewLocation (line 177) | CornerViewLocation(int id) {
method fromId (line 181) | static CornerViewLocation fromId(int id) {
method getCornerViewLocation (line 190) | CornerViewLocation getCornerViewLocation();
method setCornerViewLocation (line 192) | void setCornerViewLocation(CornerViewLocation cornerViewLocation);
method getGravity (line 194) | int getGravity();
method getReverseLayout (line 196) | boolean getReverseLayout();
method setReverseLayout (line 198) | void setReverseLayout(boolean reverseLayout);
method getAdapter (line 200) | @Nullable
method filter (line 208) | void filter(@NonNull Filter filter);
method getFilterHandler (line 215) | @Nullable
method getScrollHandler (line 223) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/TableView.java
class TableView (line 71) | public class TableView extends FrameLayout implements ITableView {
method TableView (line 133) | public TableView(@NonNull Context context) {
method TableView (line 139) | public TableView(@NonNull Context context, @Nullable AttributeSet attr...
method TableView (line 145) | public TableView(@NonNull Context context, @Nullable AttributeSet attr...
method TableView (line 163) | public TableView(@NonNull Context context, boolean initialize) {
method initialDefaultValues (line 169) | private void initialDefaultValues(@Nullable AttributeSet attrs) {
method initialize (line 240) | public void initialize() {
method initializeListeners (line 267) | protected void initializeListeners() {
method createColumnHeaderRecyclerView (line 311) | @NonNull
method createRowHeaderRecyclerView (line 338) | @NonNull
method createCellRecyclerView (line 364) | @NonNull
method setAdapter (line 399) | public <CH, RH, C> void setAdapter(@Nullable AbstractTableAdapter<CH, ...
method hasFixedWidth (line 419) | @Override
method setHasFixedWidth (line 424) | public void setHasFixedWidth(boolean hasFixedWidth) {
method isIgnoreSelectionColors (line 431) | @Override
method setIgnoreSelectionColors (line 436) | public void setIgnoreSelectionColors(boolean ignoreSelectionColor) {
method isShowHorizontalSeparators (line 440) | @Override
method isAllowClickInsideCell (line 445) | @Override
method isSortable (line 450) | @Override
method setShowHorizontalSeparators (line 455) | public void setShowHorizontalSeparators(boolean showSeparators) {
method isShowVerticalSeparators (line 459) | @Override
method setShowVerticalSeparators (line 464) | public void setShowVerticalSeparators(boolean showSeparators) {
method getCellRecyclerView (line 468) | @NonNull
method getColumnHeaderRecyclerView (line 474) | @NonNull
method getRowHeaderRecyclerView (line 480) | @NonNull
method getColumnHeaderLayoutManager (line 486) | @NonNull
method getCellLayoutManager (line 496) | @NonNull
method getRowHeaderLayoutManager (line 505) | @NonNull
method getHorizontalRecyclerViewListener (line 515) | @NonNull
method getVerticalRecyclerViewListener (line 521) | @NonNull
method getTableViewListener (line 527) | @Nullable
method setTableViewListener (line 533) | public void setTableViewListener(@Nullable ITableViewListener tableVie...
method sortColumn (line 537) | @Override
method sortRowHeader (line 543) | @Override
method remeasureColumnWidth (line 549) | @Override
method getAdapter (line 557) | @Nullable
method filter (line 563) | @Override
method getFilterHandler (line 568) | @Nullable
method getSortingStatus (line 574) | @NonNull
method getRowHeaderSortingStatus (line 580) | @Nullable
method scrollToColumnPosition (line 586) | @Override
method scrollToColumnPosition (line 591) | @Override
method scrollToRowPosition (line 596) | @Override
method scrollToRowPosition (line 601) | @Override
method getScrollHandler (line 606) | @NonNull
method showRow (line 611) | @Override
method hideRow (line 616) | @Override
method showAllHiddenRows (line 621) | @Override
method clearHiddenRowList (line 626) | @Override
method showColumn (line 631) | @Override
method hideColumn (line 636) | @Override
method isColumnVisible (line 641) | @Override
method showAllHiddenColumns (line 646) | @Override
method clearHiddenColumnList (line 651) | @Override
method isRowVisible (line 656) | @Override
method getSelectedRow (line 664) | public int getSelectedRow() {
method setSelectedRow (line 668) | public void setSelectedRow(int row) {
method getSelectedColumn (line 680) | public int getSelectedColumn() {
method setSelectedColumn (line 684) | public void setSelectedColumn(int column) {
method setSelectedCell (line 692) | public void setSelectedCell(int column, int row) {
method getSelectionHandler (line 699) | @NonNull
method getColumnSortHandler (line 705) | @Nullable
method getVisibilityHandler (line 711) | @NonNull
method getHorizontalItemDecoration (line 717) | @NonNull
method getVerticalItemDecoration (line 726) | @NonNull
method createItemDecoration (line 735) | @NonNull
method setSelectedColor (line 758) | public void setSelectedColor(@ColorInt int selectedColor) {
method getSelectedColor (line 762) | @ColorInt
method setSeparatorColor (line 768) | public void setSeparatorColor(@ColorInt int mSeparatorColor) {
method getSeparatorColor (line 772) | @ColorInt
method setUnSelectedColor (line 783) | public void setUnSelectedColor(@ColorInt int unSelectedColor) {
method getUnSelectedColor (line 787) | @ColorInt
method setShadowColor (line 793) | public void setShadowColor(@ColorInt int shadowColor) {
method getShadowColor (line 797) | @Override
method getRowHeaderWidth (line 808) | @Override
method setRowHeaderWidth (line 818) | @Override
method setColumnWidth (line 855) | public void setColumnWidth(int columnPosition, int width) {
method setShowCornerView (line 859) | public void setShowCornerView(boolean showCornerView){
method getShowCornerView (line 863) | public boolean getShowCornerView(){
method getCornerViewLocation (line 867) | public CornerViewLocation getCornerViewLocation() { return mCornerView...
method setCornerViewLocation (line 869) | @Override
method getGravity (line 874) | public int getGravity() {
method getReverseLayout (line 896) | public boolean getReverseLayout(){ return mReverseLayout;}
method setReverseLayout (line 898) | public void setReverseLayout(boolean reverseLayout) {
method onSaveInstanceState (line 902) | @Nullable
method onRestoreInstanceState (line 911) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/AbstractTableAdapter.java
class AbstractTableAdapter (line 47) | public abstract class AbstractTableAdapter<CH, RH, C> implements ITableA...
method setTableView (line 64) | public void setTableView(@NonNull ITableView tableView) {
method initialize (line 69) | private void initialize() {
method setColumnHeaderItems (line 84) | public void setColumnHeaderItems(@Nullable List<CH> columnHeaderItems) {
method setRowHeaderItems (line 98) | public void setRowHeaderItems(@Nullable List<RH> rowHeaderItems) {
method setCellItems (line 110) | public void setCellItems(@Nullable List<List<C>> cellItems) {
method setAllItems (line 124) | public void setAllItems(
method updateCornerViewState (line 138) | private void updateCornerViewState(
method getColumnHeaderItemViewType (line 179) | @Override
method getRowHeaderItemViewType (line 184) | @Override
method getCellItemViewType (line 189) | @Override
method getCornerView (line 194) | @Nullable
method getColumnHeaderRecyclerViewAdapter (line 200) | public ColumnHeaderRecyclerViewAdapter getColumnHeaderRecyclerViewAdap...
method getRowHeaderRecyclerViewAdapter (line 204) | public RowHeaderRecyclerViewAdapter getRowHeaderRecyclerViewAdapter() {
method getCellRecyclerViewAdapter (line 208) | public CellRecyclerViewAdapter getCellRecyclerViewAdapter() {
method setRowHeaderWidth (line 212) | public void setRowHeaderWidth(int rowHeaderWidth) {
method setColumnHeaderHeight (line 221) | public void setColumnHeaderHeight(int columnHeaderHeight) {
method getColumnHeaderItem (line 225) | @Nullable
method getRowHeaderItem (line 234) | @Nullable
method getCellItem (line 243) | @Nullable
method getCellRowItems (line 254) | @Nullable
method removeRow (line 259) | public void removeRow(int rowPosition) {
method removeRow (line 264) | public void removeRow(int rowPosition, boolean updateRowHeader) {
method removeRowRange (line 280) | public void removeRowRange(int rowPositionStart, int itemCount) {
method removeRowRange (line 285) | public void removeRowRange(int rowPositionStart, int itemCount, boolea...
method addRow (line 300) | public void addRow(int rowPosition, @Nullable RH rowHeaderItem, @Nulla...
method addRowRange (line 305) | public void addRowRange(int rowPositionStart, @Nullable List<RH> rowHe...
method changeRowHeaderItem (line 310) | public void changeRowHeaderItem(int rowPosition, @Nullable RH rowHeade...
method changeRowHeaderItemRange (line 314) | public void changeRowHeaderItemRange(int rowPositionStart, @Nullable L...
method changeCellItem (line 318) | public void changeCellItem(int columnPosition, int rowPosition, C cell...
method changeColumnHeader (line 328) | public void changeColumnHeader(int columnPosition, @Nullable CH column...
method changeColumnHeaderRange (line 332) | public void changeColumnHeaderRange(int columnPositionStart, @Nullable...
method getCellColumnItems (line 337) | @NonNull
method removeColumn (line 342) | public void removeColumn(int columnPosition) {
method addColumn (line 347) | public void addColumn(int columnPosition, @Nullable CH columnHeaderIte...
method notifyDataSetChanged (line 353) | public final void notifyDataSetChanged() {
method getTableView (line 359) | @Override
method dispatchColumnHeaderDataSetChangesToListeners (line 364) | private void dispatchColumnHeaderDataSetChangesToListeners(@NonNull Li...
method dispatchRowHeaderDataSetChangesToListeners (line 372) | private void dispatchRowHeaderDataSetChangesToListeners(@NonNull final...
method dispatchCellDataSetChangesToListeners (line 380) | private void dispatchCellDataSetChangesToListeners(@NonNull List<List<...
method addAdapterDataSetChangedListener (line 393) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/AdapterDataSetChangedListener.java
class AdapterDataSetChangedListener (line 31) | public abstract class AdapterDataSetChangedListener<CH, RH, C> {
method onColumnHeaderItemsChanged (line 38) | public void onColumnHeaderItemsChanged(@NonNull List<CH> columnHeaderI...
method onRowHeaderItemsChanged (line 46) | public void onRowHeaderItemsChanged(@NonNull List<RH> rowHeaderItems) {
method onCellItemsChanged (line 54) | public void onCellItemsChanged(@NonNull List<List<C>> cellItems) {
method onDataSetChanged (line 64) | public void onDataSetChanged(
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/ITableAdapter.java
type ITableAdapter (line 40) | public interface ITableAdapter<CH, RH, C> {
method getColumnHeaderItemViewType (line 42) | int getColumnHeaderItemViewType(int position);
method getRowHeaderItemViewType (line 44) | int getRowHeaderItemViewType(int position);
method getCellItemViewType (line 46) | int getCellItemViewType(int position);
method getCornerView (line 48) | View getCornerView();
method onCreateCellViewHolder (line 50) | @NonNull
method onBindCellViewHolder (line 53) | void onBindCellViewHolder(@NonNull AbstractViewHolder holder, @Nullabl...
method onCreateColumnHeaderViewHolder (line 55) | @NonNull
method onBindColumnHeaderViewHolder (line 58) | void onBindColumnHeaderViewHolder(@NonNull AbstractViewHolder holder, ...
method onCreateRowHeaderViewHolder (line 60) | @NonNull
method onBindRowHeaderViewHolder (line 63) | void onBindRowHeaderViewHolder(@NonNull AbstractViewHolder holder, @Nu...
method onCreateCornerView (line 65) | @NonNull
method getTableView (line 68) | ITableView getTableView();
method addAdapterDataSetChangedListener (line 75) | void addAdapterDataSetChangedListener(@NonNull AdapterDataSetChangedLi...
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/AbstractRecyclerViewAdapter.java
class AbstractRecyclerViewAdapter (line 42) | public abstract class AbstractRecyclerViewAdapter<T> extends RecyclerView
method AbstractRecyclerViewAdapter (line 51) | public AbstractRecyclerViewAdapter(@NonNull Context context) {
method AbstractRecyclerViewAdapter (line 55) | public AbstractRecyclerViewAdapter(@NonNull Context context, @Nullable...
method getItemCount (line 65) | @Override
method getItems (line 70) | @NonNull
method setItems (line 75) | public void setItems(@NonNull List<T> itemList) {
method setItems (line 81) | public void setItems(@NonNull List<T> itemList, boolean notifyDataSet) {
method getItem (line 89) | @Nullable
method deleteItem (line 97) | public void deleteItem(int position) {
method deleteItemRange (line 104) | public void deleteItemRange(int positionStart, int itemCount) {
method addItem (line 114) | public void addItem(int position, @Nullable T item) {
method addItemRange (line 121) | public void addItemRange(int positionStart, @Nullable List<T> items) {
method changeItem (line 131) | public void changeItem(int position, @Nullable T item) {
method changeItemRange (line 138) | public void changeItemRange(int positionStart, @Nullable List<T> items) {
method getItemViewType (line 147) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRecyclerView.java
class CellRecyclerView (line 42) | public class CellRecyclerView extends RecyclerView {
method CellRecyclerView (line 51) | public CellRecyclerView(@NonNull Context context) {
method onScrolled (line 64) | @Override
method getScrolledX (line 72) | public int getScrolledX() {
method clearScrolledX (line 76) | public void clearScrolledX() {
method getScrolledY (line 80) | public int getScrolledY() {
method addOnScrollListener (line 84) | @Override
method removeOnScrollListener (line 109) | @Override
method isHorizontalScrollListenerRemoved (line 134) | public boolean isHorizontalScrollListenerRemoved() {
method isScrollOthers (line 138) | public boolean isScrollOthers() {
method fling (line 154) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRecyclerViewAdapter.java
class CellRecyclerViewAdapter (line 51) | public class CellRecyclerViewAdapter<C> extends AbstractRecyclerViewAdap...
method CellRecyclerViewAdapter (line 61) | public CellRecyclerViewAdapter(@NonNull Context context, @Nullable Lis...
method onCreateViewHolder (line 71) | @NonNull
method onBindViewHolder (line 116) | @Override
method onViewAttachedToWindow (line 132) | @Override
method onViewDetachedFromWindow (line 167) | @Override
method onViewRecycled (line 176) | @Override
class CellRowViewHolder (line 187) | static class CellRowViewHolder extends AbstractViewHolder {
method CellRowViewHolder (line 190) | CellRowViewHolder(@NonNull View itemView) {
method notifyCellDataSetChanged (line 196) | public void notifyCellDataSetChanged() {
method getColumnItems (line 219) | @NonNull
method removeColumnItems (line 235) | public void removeColumnItems(int column) {
method addColumnItems (line 268) | public void addColumnItems(int column, @NonNull List<C> cellColumnItem...
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRowRecyclerViewAdapter.java
class CellRowRecyclerViewAdapter (line 41) | public class CellRowRecyclerViewAdapter<C> extends AbstractRecyclerViewA...
method CellRowRecyclerViewAdapter (line 49) | public CellRowRecyclerViewAdapter(@NonNull Context context, @NonNull I...
method onCreateViewHolder (line 55) | @NonNull
method onBindViewHolder (line 61) | @Override
method getYPosition (line 66) | public int getYPosition() {
method setYPosition (line 70) | public void setYPosition(int rowPosition) {
method getItemViewType (line 74) | @Override
method onViewAttachedToWindow (line 79) | @Override
method onFailedToRecycleView (line 101) | @Override
method onViewRecycled (line 106) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/ColumnHeaderRecyclerViewAdapter.java
class ColumnHeaderRecyclerViewAdapter (line 47) | public class ColumnHeaderRecyclerViewAdapter<CH> extends AbstractRecycle...
method ColumnHeaderRecyclerViewAdapter (line 53) | public ColumnHeaderRecyclerViewAdapter(@NonNull Context context, @Null...
method onCreateViewHolder (line 60) | @NonNull
method onBindViewHolder (line 66) | @Override
method getItemViewType (line 71) | @Override
method onViewAttachedToWindow (line 76) | @Override
method getColumnSortHelper (line 106) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/RowHeaderRecyclerViewAdapter.java
class RowHeaderRecyclerViewAdapter (line 45) | public class RowHeaderRecyclerViewAdapter<RH> extends AbstractRecyclerVi...
method RowHeaderRecyclerViewAdapter (line 51) | public RowHeaderRecyclerViewAdapter(@NonNull Context context, @Nullabl...
method onCreateViewHolder (line 58) | @NonNull
method onBindViewHolder (line 64) | @Override
method getItemViewType (line 69) | @Override
method onViewAttachedToWindow (line 74) | @Override
method getRowHeaderSortHelper (line 93) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/holder/AbstractSorterViewHolder.java
class AbstractSorterViewHolder (line 37) | public class AbstractSorterViewHolder extends AbstractViewHolder {
method AbstractSorterViewHolder (line 41) | public AbstractSorterViewHolder(@NonNull View itemView) {
method onSortingStatusChanged (line 45) | public void onSortingStatusChanged(@NonNull SortState pSortState) {
method getSortState (line 49) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/holder/AbstractViewHolder.java
class AbstractViewHolder (line 37) | public abstract class AbstractViewHolder extends RecyclerView.ViewHolder {
type SelectionState (line 38) | public enum SelectionState {SELECTED, UNSELECTED, SHADOWED}
method AbstractViewHolder (line 44) | public AbstractViewHolder(@NonNull View itemView) {
method setSelected (line 48) | public void setSelected(@NonNull SelectionState selectionState) {
method isSelected (line 58) | public boolean isSelected() {
method isShadowed (line 62) | public boolean isShadowed() {
method setBackgroundColor (line 66) | public void setBackgroundColor(@ColorInt int p_nColor) {
method onViewRecycled (line 70) | public void onViewRecycled() {
method onFailedToRecycleView (line 73) | public boolean onFailedToRecycleView() {
FILE: tableview/src/main/java/com/evrencoskun/tableview/filter/Filter.java
class Filter (line 38) | public class Filter {
method Filter (line 55) | public Filter(@NonNull ITableView tableView) {
method set (line 66) | public void set(@NonNull String filter) {
method set (line 77) | public void set(int column, @NonNull String filter) {
method add (line 100) | private void add(@NonNull FilterItem filterItem) {
method remove (line 111) | private void remove(int column, @NonNull FilterItem filterItem) {
method update (line 133) | private void update(int column, @NonNull FilterItem filterItem) {
method isAlreadyFiltering (line 156) | private boolean isAlreadyFiltering(int column, @NonNull FilterItem fil...
method getFilterItems (line 173) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/filter/FilterChangedListener.java
class FilterChangedListener (line 31) | public abstract class FilterChangedListener<T> {
method onFilterChanged (line 39) | public void onFilterChanged(@NonNull List<List<T>> filteredCellItems, ...
method onFilterCleared (line 48) | public void onFilterCleared(@NonNull List<List<T>> originalCellItems, ...
FILE: tableview/src/main/java/com/evrencoskun/tableview/filter/FilterItem.java
class FilterItem (line 29) | public class FilterItem {
method FilterItem (line 36) | public FilterItem(@NonNull FilterType type, int column, @NonNull Strin...
method getFilterType (line 42) | @NonNull
method getFilter (line 47) | @NonNull
method getColumn (line 52) | public int getColumn() {
FILE: tableview/src/main/java/com/evrencoskun/tableview/filter/FilterType.java
type FilterType (line 30) | public enum FilterType {
FILE: tableview/src/main/java/com/evrencoskun/tableview/filter/IFilterableModel.java
type IFilterableModel (line 29) | public interface IFilterableModel {
method getFilterableKeyword (line 36) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/ColumnSortHandler.java
class ColumnSortHandler (line 53) | public class ColumnSortHandler {
method isEnableAnimation (line 62) | public boolean isEnableAnimation() {
method setEnableAnimation (line 66) | public void setEnableAnimation(boolean mEnableAnimation) {
method ColumnSortHandler (line 70) | public ColumnSortHandler(@NonNull ITableView tableView) {
method sortByRowHeader (line 81) | public void sortByRowHeader(@NonNull final SortState sortState) {
method sort (line 108) | public void sort(int column, @NonNull SortState sortState) {
method swapItems (line 139) | private void swapItems(@NonNull List<ISortableModel> oldRowHeader,
method swapItems (line 163) | private void swapItems(@NonNull List<List<ISortableModel>> oldItems, @...
method swapItems (line 184) | public void swapItems(@NonNull List<List<ISortableModel>> newItems, in...
method getSortingStatus (line 202) | @NonNull
method getRowHeaderSortingStatus (line 207) | @Nullable
method addColumnSortStateChangedListener (line 217) | public void addColumnSortStateChangedListener(@NonNull ColumnSortState...
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/ColumnWidthHandler.java
class ColumnWidthHandler (line 35) | public class ColumnWidthHandler {
method ColumnWidthHandler (line 39) | public ColumnWidthHandler(@NonNull ITableView tableView) {
method setColumnWidth (line 43) | public void setColumnWidth(int columnPosition, int width) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/FilterHandler.java
class FilterHandler (line 42) | public class FilterHandler<T extends IFilterableModel> {
method FilterHandler (line 51) | public FilterHandler(@NonNull ITableView tableView) {
method filter (line 60) | public void filter(@NonNull Filter filter) {
method onRowHeaderItemsChanged (line 130) | @Override
method onCellItemsChanged (line 135) | @Override
method dispatchFilterChangedToListeners (line 141) | private void dispatchFilterChangedToListeners(
method dispatchFilterClearedToListeners (line 152) | private void dispatchFilterClearedToListeners(
method addFilterChangedListener (line 163) | public void addFilterChangedListener(@NonNull FilterChangedListener<T>...
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/PreferencesHandler.java
class PreferencesHandler (line 36) | public class PreferencesHandler {
method PreferencesHandler (line 42) | public PreferencesHandler(@NonNull TableView tableView) {
method savePreferences (line 47) | @NonNull
method loadPreferences (line 59) | public void loadPreferences(@NonNull Preferences preferences) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/ScrollHandler.java
class ScrollHandler (line 42) | public class ScrollHandler {
method ScrollHandler (line 52) | public ScrollHandler(@NonNull ITableView tableView) {
method scrollToColumnPosition (line 59) | public void scrollToColumnPosition(int columnPosition) {
method scrollToColumnPosition (line 71) | public void scrollToColumnPosition(int columnPosition, int offset) {
method scrollToRowPosition (line 84) | public void scrollToRowPosition(int rowPosition) {
method scrollToRowPosition (line 89) | public void scrollToRowPosition(int rowPosition, int offset) {
method scrollCellHorizontally (line 94) | private void scrollCellHorizontally(int columnPosition, int offset) {
method scrollColumnHeader (line 113) | private void scrollColumnHeader(int columnPosition, int offset) {
method getColumnPosition (line 118) | public int getColumnPosition() {
method getColumnPositionOffset (line 122) | public int getColumnPositionOffset() {
method getRowPosition (line 131) | public int getRowPosition() {
method getRowPositionOffset (line 135) | public int getRowPositionOffset() {
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/SelectionHandler.java
class SelectionHandler (line 42) | public class SelectionHandler {
method SelectionHandler (line 60) | public SelectionHandler(@NonNull ITableView tableView) {
method isShadowEnabled (line 67) | public boolean isShadowEnabled() {
method setShadowEnabled (line 71) | public void setShadowEnabled(boolean shadowEnabled) {
method setSelectedCellPositions (line 75) | public void setSelectedCellPositions(@Nullable AbstractViewHolder sele...
method setSelectedColumnPosition (line 87) | public void setSelectedColumnPosition(@Nullable AbstractViewHolder sel...
method getSelectedColumnPosition (line 98) | public int getSelectedColumnPosition() {
method setSelectedRowPosition (line 102) | public void setSelectedRowPosition(@Nullable AbstractViewHolder select...
method getSelectedRowPosition (line 113) | public int getSelectedRowPosition() {
method setPreviousSelectedView (line 117) | public void setPreviousSelectedView(@Nullable AbstractViewHolder viewH...
method restorePreviousSelectedView (line 145) | private void restorePreviousSelectedView() {
method selectedRowHeader (line 156) | private void selectedRowHeader() {
method unselectedRowHeader (line 167) | private void unselectedRowHeader() {
method selectedCellView (line 175) | private void selectedCellView() {
method unselectedCellView (line 205) | private void unselectedCellView() {
method selectedColumnHeader (line 234) | private void selectedColumnHeader() {
method unselectedColumnHeader (line 241) | private void unselectedColumnHeader() {
method isCellSelected (line 248) | public boolean isCellSelected(int column, int row) {
method getCellSelectionState (line 253) | @NonNull
method isColumnSelected (line 261) | public boolean isColumnSelected(int column) {
method isColumnShadowed (line 266) | public boolean isColumnShadowed(int column) {
method isAnyColumnSelected (line 272) | public boolean isAnyColumnSelected() {
method getColumnSelectionState (line 277) | @NonNull
method isRowSelected (line 291) | public boolean isRowSelected(int row) {
method isRowShadowed (line 296) | public boolean isRowShadowed(int row) {
method getRowSelectionState (line 302) | @NonNull
method changeVisibleCellViewsBackgroundForRow (line 316) | private void changeVisibleCellViewsBackgroundForRow(int row, boolean i...
method changeVisibleCellViewsBackgroundForColumn (line 335) | private void changeVisibleCellViewsBackgroundForColumn(int column, boo...
method changeRowBackgroundColorBySelectionStatus (line 365) | public void changeRowBackgroundColorBySelectionStatus(@NonNull Abstrac...
method changeColumnBackgroundColorBySelectionStatus (line 378) | public void changeColumnBackgroundColorBySelectionStatus(@NonNull Abst...
method changeSelectionOfRecyclerView (line 391) | public void changeSelectionOfRecyclerView(CellRecyclerView recyclerVie...
method clearSelection (line 415) | public void clearSelection() {
method setSelectedRowPosition (line 421) | public void setSelectedRowPosition(int row) {
method setSelectedColumnPosition (line 425) | public void setSelectedColumnPosition(int column) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/handler/VisibilityHandler.java
class VisibilityHandler (line 41) | public class VisibilityHandler {
method VisibilityHandler (line 51) | public VisibilityHandler(@NonNull ITableView tableView) {
method hideRow (line 55) | public void hideRow(int row) {
method showRow (line 69) | public void showRow(int row) {
method showRow (line 73) | private void showRow(int row, boolean removeFromList) {
method clearHideRowList (line 89) | public void clearHideRowList() {
method showAllHiddenRows (line 93) | public void showAllHiddenRows() {
method isRowVisible (line 102) | public boolean isRowVisible(int row) {
method hideColumn (line 106) | public void hideColumn(int column) {
method showColumn (line 120) | public void showColumn(int column) {
method showColumn (line 124) | private void showColumn(int column, boolean removeFromList) {
method clearHideColumnList (line 140) | public void clearHideColumnList() {
method showAllHiddenColumns (line 144) | public void showAllHiddenColumns() {
method isColumnVisible (line 153) | public boolean isColumnVisible(int column) {
method getSmallerHiddenCount (line 165) | private <T> int getSmallerHiddenCount(int index, SparseArray<T> list) {
method convertIndexToViewIndex (line 179) | private <T> int convertIndexToViewIndex(int index, SparseArray<T> list) {
class Row (line 183) | static class Row {
method Row (line 190) | public Row(int row, @Nullable Object rowHeaderModel, @Nullable List<...
method getYPosition (line 196) | public int getYPosition() {
method getRowHeaderModel (line 200) | @Nullable
method getCellModelList (line 205) | @Nullable
class Column (line 212) | static class Column {
method Column (line 219) | public Column(int yPosition, @Nullable Object columnHeaderModel,
method getYPosition (line 226) | public int getYPosition() {
method getColumnHeaderModel (line 230) | @Nullable
method getCellModelList (line 235) | @NonNull
method getRowValueFromPosition (line 242) | @NonNull
method getColumnValueFromPosition (line 251) | @NonNull
method getHideRowList (line 260) | @NonNull
method getHideColumnList (line 265) | @NonNull
method setHideRowList (line 270) | public void setHideRowList(@NonNull SparseArray<Row> rowList) {
method setHideColumnList (line 274) | public void setHideColumnList(@NonNull SparseArray<Column> columnList) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/CellLayoutManager.java
class CellLayoutManager (line 51) | public class CellLayoutManager extends LinearLayoutManager {
method CellLayoutManager (line 73) | public CellLayoutManager(@NonNull Context context, @NonNull ITableView...
method initialize (line 82) | private void initialize() {
method onAttachedToWindow (line 87) | @Override
method scrollVerticallyBy (line 97) | @Override
method onScrollStateChanged (line 114) | @Override
method fitWidthSize (line 127) | public void fitWidthSize(boolean scrollingUp) {
method fitWidthSize (line 141) | public void fitWidthSize(int position, boolean scrollingLeft) {
method fitSize (line 151) | private int fitSize(int position, int left, boolean scrollingUp) {
method fit (line 180) | private int fit(int xPosition, int yPosition, int left, int right, int...
method fitWidthSize2 (line 254) | public void fitWidthSize2(boolean scrollingLeft) {
method fitWidthSize2 (line 280) | public void fitWidthSize2(int position, boolean scrollingLeft) {
method fitSize2 (line 299) | private void fitSize2(int position, boolean scrollingLeft, int columnH...
method fit2 (line 334) | private void fit2(int xPosition, int yPosition, int columnCachedWidth,...
method shouldFitColumns (line 370) | public boolean shouldFitColumns(int yPosition) {
method measureChildWithMargins (line 391) | @Override
method getVisibleCellViewsByColumnPosition (line 451) | @NonNull
method getCellViewHolder (line 469) | @Nullable
method remeasureAllChild (line 480) | public void remeasureAllChild() {
method setCacheWidth (line 494) | public void setCacheWidth(int row, int column, int width) {
method setCacheWidth (line 507) | public void setCacheWidth(int column, int width) {
method getCacheWidth (line 514) | public int getCacheWidth(int row, int column) {
method clearCachedWidths (line 525) | public void clearCachedWidths() {
method getVisibleCellRowRecyclerViews (line 529) | @NonNull
method getCellRecyclerViewScrollState (line 543) | private int getCellRecyclerViewScrollState() {
FILE: tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/ColumnHeaderLayoutManager.java
class ColumnHeaderLayoutManager (line 43) | public class ColumnHeaderLayoutManager extends LinearLayoutManager {
method ColumnHeaderLayoutManager (line 50) | public ColumnHeaderLayoutManager(@NonNull Context context, @NonNull IT...
method measureChildWithMargins (line 57) | @Override
method measureChild (line 69) | @Override
method setCacheWidth (line 88) | public void setCacheWidth(int position, int width) {
method getCacheWidth (line 92) | public int getCacheWidth(int position) {
method getFirstItemLeft (line 96) | public int getFirstItemLeft() {
method removeCachedWidth (line 104) | public void removeCachedWidth(int position) {
method clearCachedWidths (line 111) | public void clearCachedWidths() {
method customRequestLayout (line 115) | public void customRequestLayout() {
method getVisibleViewHolders (line 135) | @NonNull
method getViewHolder (line 151) | @Nullable
FILE: tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/ColumnLayoutManager.java
class ColumnLayoutManager (line 44) | public class ColumnLayoutManager extends LinearLayoutManager {
method ColumnLayoutManager (line 61) | public ColumnLayoutManager(@NonNull Context context, @NonNull ITableVi...
method onAttachedToWindow (line 76) | @Override
method measureChildWithMargins (line 83) | @Override
method measureChild (line 95) | @Override
method fitWidthSize (line 139) | private void fitWidthSize(@NonNull View child, int row, int column, in...
method shouldFitColumns (line 178) | private boolean shouldFitColumns(int xPosition, int yPosition) {
method scrollHorizontallyBy (line 196) | @Override
method getRowPosition (line 214) | private int getRowPosition() {
method getLastDx (line 218) | public int getLastDx() {
method isNeedFit (line 222) | public boolean isNeedFit() {
method clearNeedFit (line 226) | public void clearNeedFit() {
method getVisibleViewHolders (line 230) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/ITableViewListener.java
type ITableViewListener (line 34) | public interface ITableViewListener {
method onCellClicked (line 36) | void onCellClicked(@NonNull RecyclerView.ViewHolder cellView, int colu...
method onCellDoubleClicked (line 39) | void onCellDoubleClicked(@NonNull RecyclerView.ViewHolder cellView, in...
method onCellLongPressed (line 42) | void onCellLongPressed(@NonNull RecyclerView.ViewHolder cellView, int ...
method onColumnHeaderClicked (line 45) | void onColumnHeaderClicked(@NonNull RecyclerView.ViewHolder columnHead...
method onColumnHeaderDoubleClicked (line 48) | void onColumnHeaderDoubleClicked(@NonNull RecyclerView.ViewHolder colu...
method onColumnHeaderLongPressed (line 51) | void onColumnHeaderLongPressed(@NonNull RecyclerView.ViewHolder column...
method onRowHeaderClicked (line 54) | void onRowHeaderClicked(@NonNull RecyclerView.ViewHolder rowHeaderView...
method onRowHeaderDoubleClicked (line 56) | void onRowHeaderDoubleClicked(@NonNull RecyclerView.ViewHolder rowHead...
method onRowHeaderLongPressed (line 58) | void onRowHeaderLongPressed(@NonNull RecyclerView.ViewHolder rowHeader...
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/SimpleTableViewListener.java
class SimpleTableViewListener (line 33) | public abstract class SimpleTableViewListener implements ITableViewListe...
method onCellClicked (line 34) | @Override
method onCellDoubleClicked (line 38) | @Override
method onCellLongPressed (line 42) | @Override
method onColumnHeaderClicked (line 46) | @Override
method onColumnHeaderDoubleClicked (line 50) | @Override
method onColumnHeaderLongPressed (line 54) | @Override
method onRowHeaderClicked (line 58) | @Override
method onRowHeaderDoubleClicked (line 62) | @Override
method onRowHeaderLongPressed (line 66) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/TableViewLayoutChangeListener.java
class TableViewLayoutChangeListener (line 41) | public class TableViewLayoutChangeListener implements View.OnLayoutChang...
method TableViewLayoutChangeListener (line 49) | public TableViewLayoutChangeListener(@NonNull ITableView tableView) {
method onLayoutChange (line 55) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/AbstractItemClickListener.java
class AbstractItemClickListener (line 43) | public abstract class AbstractItemClickListener implements RecyclerView....
method AbstractItemClickListener (line 54) | public AbstractItemClickListener(@NonNull CellRecyclerView recyclerVie...
method onInterceptTouchEvent (line 97) | @Override
method onTouchEvent (line 104) | @Override
method onRequestDisallowInterceptTouchEvent (line 108) | @Override
method getTableViewListener (line 112) | @NonNull
method clickAction (line 120) | abstract protected boolean clickAction(@NonNull RecyclerView view, @No...
method longPressAction (line 122) | abstract protected void longPressAction(@NonNull MotionEvent e);
method doubleClickAction (line 124) | abstract protected boolean doubleClickAction(@NonNull MotionEvent e);
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/CellRecyclerViewItemClickListener.java
class CellRecyclerViewItemClickListener (line 42) | public class CellRecyclerViewItemClickListener extends AbstractItemClick...
method CellRecyclerViewItemClickListener (line 46) | public CellRecyclerViewItemClickListener(@NonNull CellRecyclerView rec...
method clickAction (line 51) | @Override
method longPressAction (line 81) | @Override
method doubleClickAction (line 107) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/ColumnHeaderRecyclerViewItemClickListener.java
class ColumnHeaderRecyclerViewItemClickListener (line 41) | public class ColumnHeaderRecyclerViewItemClickListener extends AbstractI...
method ColumnHeaderRecyclerViewItemClickListener (line 43) | public ColumnHeaderRecyclerViewItemClickListener(@NonNull CellRecycler...
method clickAction (line 49) | @Override
method longPressAction (line 74) | protected void longPressAction(@NonNull MotionEvent e) {
method doubleClickAction (line 92) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/RowHeaderRecyclerViewItemClickListener.java
class RowHeaderRecyclerViewItemClickListener (line 41) | public class RowHeaderRecyclerViewItemClickListener extends AbstractItem...
method RowHeaderRecyclerViewItemClickListener (line 43) | public RowHeaderRecyclerViewItemClickListener(@NonNull CellRecyclerVie...
method clickAction (line 48) | @Override
method longPressAction (line 72) | protected void longPressAction(@NonNull MotionEvent e) {
method doubleClickAction (line 90) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/scroll/HorizontalRecyclerViewListener.java
class HorizontalRecyclerViewListener (line 42) | public class HorizontalRecyclerViewListener extends RecyclerView.OnScrol...
method HorizontalRecyclerViewListener (line 67) | public HorizontalRecyclerViewListener(@NonNull ITableView tableView) {
method onInterceptTouchEvent (line 73) | @Override
method onTouchEvent (line 172) | @Override
method onRequestDisallowInterceptTouchEvent (line 176) | @Override
method onScrolled (line 180) | @Override
method onScrollStateChanged (line 211) | @Override
method getIndex (line 233) | private int getIndex(@NonNull RecyclerView rv) {
method renewScrollPosition (line 249) | private void renewScrollPosition(@NonNull RecyclerView recyclerView) {
method getScrollPosition (line 278) | public int getScrollPosition() {
method getScrollPositionOffset (line 289) | public int getScrollPositionOffset() {
method setScrollPositionOffset (line 293) | public void setScrollPositionOffset(int offset) {
method setScrollPosition (line 300) | public void setScrollPosition(int position) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/listener/scroll/VerticalRecyclerViewListener.java
class VerticalRecyclerViewListener (line 41) | public class VerticalRecyclerViewListener extends RecyclerView.OnScrollL...
method VerticalRecyclerViewListener (line 57) | public VerticalRecyclerViewListener(@NonNull ITableView tableView) {
method verticalDirection (line 70) | private boolean verticalDirection(@NonNull MotionEvent ev) {
method onInterceptTouchEvent (line 90) | @Override
method onTouchEvent (line 158) | @Override
method onRequestDisallowInterceptTouchEvent (line 162) | @Override
method onScrolled (line 166) | @Override
method onScrollStateChanged (line 183) | @Override
method removeLastTouchedRecyclerViewScrollListener (line 210) | public void removeLastTouchedRecyclerViewScrollListener(boolean isNeed...
FILE: tableview/src/main/java/com/evrencoskun/tableview/pagination/IPagination.java
type IPagination (line 29) | public interface IPagination {
method nextPage (line 34) | void nextPage();
method previousPage (line 39) | void previousPage();
method goToPage (line 46) | void goToPage(int page);
method setItemsPerPage (line 53) | void setItemsPerPage(int numItems);
method setOnTableViewPageTurnedListener (line 60) | void setOnTableViewPageTurnedListener(@Nullable Pagination.OnTableView...
method removeOnTableViewPageTurnedListener (line 65) | void removeOnTableViewPageTurnedListener();
method getCurrentPage (line 70) | int getCurrentPage();
method getItemsPerPage (line 75) | int getItemsPerPage();
method getPageCount (line 80) | int getPageCount();
method isPaginated (line 85) | boolean isPaginated();
FILE: tableview/src/main/java/com/evrencoskun/tableview/pagination/Pagination.java
class Pagination (line 47) | public class Pagination implements IPagination {
method Pagination (line 69) | public Pagination(@NonNull ITableView tableView) {
method Pagination (line 79) | public Pagination(@NonNull ITableView tableView, int itemsPerPage) {
method Pagination (line 91) | public Pagination(@NonNull ITableView tableView, int itemsPerPage, @Nu...
method initialize (line 95) | @SuppressWarnings("unchecked")
method reloadPages (line 112) | private void reloadPages() {
method paginateData (line 117) | private void paginateData() {
method nextPage (line 153) | @Override
method previousPage (line 159) | @Override
method goToPage (line 165) | @Override
method setItemsPerPage (line 171) | @Override
method setOnTableViewPageTurnedListener (line 178) | @Override
method removeOnTableViewPageTurnedListener (line 183) | @Override
method getCurrentPage (line 188) | @Override
method getItemsPerPage (line 193) | @Override
method getPageCount (line 198) | @Override
method isPaginated (line 203) | @Override
method onRowHeaderItemsChanged (line 212) | @Override
method onCellItemsChanged (line 218) | @Override
method onFilterChanged (line 228) | @Override
method onFilterCleared (line 235) | @Override
method onColumnSortStatusChanged (line 246) | @Override
method onRowHeaderSortStatusChanged (line 251) | @Override
method paginateOnColumnSort (line 257) | private void paginateOnColumnSort(int column, @NonNull SortState sortS...
type OnTableViewPageTurnedListener (line 293) | public interface OnTableViewPageTurnedListener {
method onPageTurned (line 302) | void onPageTurned(int numItems, int itemsStart, int itemsEnd);
FILE: tableview/src/main/java/com/evrencoskun/tableview/preference/Preferences.java
class Preferences (line 36) | public class Preferences implements Parcelable {
method Preferences (line 45) | public Preferences() {
method Preferences (line 48) | protected Preferences(Parcel in) {
method createFromParcel (line 59) | @NonNull
method newArray (line 65) | @NonNull
method describeContents (line 83) | @Override
method writeToParcel (line 95) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/preference/SavedState.java
class SavedState (line 37) | public class SavedState extends View.BaseSavedState {
method SavedState (line 41) | public SavedState(Parcelable superState) {
method SavedState (line 45) | private SavedState(Parcel in) {
method writeToParcel (line 50) | @Override
method createFromParcel (line 59) | @NonNull
method newArray (line 64) | @NonNull
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/AbstractSortComparator.java
class AbstractSortComparator (line 36) | public abstract class AbstractSortComparator {
method compareContent (line 40) | protected int compareContent(@Nullable Object o1, @Nullable Object o2) {
method compare (line 65) | public int compare(Number o1, Number o2) {
method compare (line 72) | public int compare(Date o1, Date o2) {
method compare (line 79) | public int compare(Boolean o1, Boolean o2) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnForRowHeaderSortComparator.java
class ColumnForRowHeaderSortComparator (line 40) | public class ColumnForRowHeaderSortComparator implements Comparator<ISor...
method ColumnForRowHeaderSortComparator (line 51) | public ColumnForRowHeaderSortComparator(@NonNull List<ISortableModel> ...
method compare (line 62) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortCallback.java
class ColumnSortCallback (line 37) | public class ColumnSortCallback extends DiffUtil.Callback {
method ColumnSortCallback (line 44) | public ColumnSortCallback(@NonNull List<List<ISortableModel>> oldCellI...
method getOldListSize (line 51) | @Override
method getNewListSize (line 56) | @Override
method areItemsTheSame (line 61) | @Override
method areContentsTheSame (line 76) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortComparator.java
class ColumnSortComparator (line 36) | public class ColumnSortComparator extends AbstractSortComparator impleme...
method ColumnSortComparator (line 40) | public ColumnSortComparator(int xPosition, @NonNull SortState sortStat...
method compare (line 45) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortHelper.java
class ColumnSortHelper (line 40) | public class ColumnSortHelper {
method ColumnSortHelper (line 46) | public ColumnSortHelper(@NonNull ColumnHeaderLayoutManager columnHeade...
method sortingStatusChanged (line 50) | private void sortingStatusChanged(int column, @NonNull SortState sortS...
method setSortingStatus (line 64) | public void setSortingStatus(int column, @NonNull SortState status) {
method clearSortingStatus (line 76) | public void clearSortingStatus() {
method isSorting (line 80) | public boolean isSorting() {
method getSortingStatus (line 84) | @NonNull
method getDirective (line 89) | @NonNull
class Directive (line 100) | private static class Directive {
method Directive (line 105) | Directive(int column, @NonNull SortState direction) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortStateChangedListener.java
class ColumnSortStateChangedListener (line 29) | public abstract class ColumnSortStateChangedListener {
method onColumnSortStatusChanged (line 37) | public void onColumnSortStatusChanged(int column, @NonNull SortState s...
method onRowHeaderSortStatusChanged (line 45) | public void onRowHeaderSortStatusChanged(@NonNull SortState sortState) {
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/ISortableModel.java
type ISortableModel (line 34) | public interface ISortableModel {
method getId (line 35) | @NonNull
method getContent (line 38) | @Nullable
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderForCellSortComparator.java
class RowHeaderForCellSortComparator (line 36) | public class RowHeaderForCellSortComparator implements Comparator<List<I...
method RowHeaderForCellSortComparator (line 46) | public RowHeaderForCellSortComparator(@NonNull List<ISortableModel> re...
method compare (line 55) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderSortCallback.java
class RowHeaderSortCallback (line 36) | public class RowHeaderSortCallback extends DiffUtil.Callback {
method RowHeaderSortCallback (line 42) | public RowHeaderSortCallback(@NonNull List<ISortableModel> oldCellItem...
method getOldListSize (line 48) | @Override
method getNewListSize (line 53) | @Override
method areItemsTheSame (line 58) | @Override
method areContentsTheSame (line 70) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderSortComparator.java
class RowHeaderSortComparator (line 35) | public class RowHeaderSortComparator extends AbstractSortComparator impl...
method RowHeaderSortComparator (line 37) | public RowHeaderSortComparator(@NonNull SortState sortState) {
method compare (line 41) | @Override
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderSortHelper.java
class RowHeaderSortHelper (line 33) | public class RowHeaderSortHelper {
method RowHeaderSortHelper (line 37) | public RowHeaderSortHelper() {
method sortingStatusChanged (line 40) | private void sortingStatusChanged(@Nullable SortState sortState) {
method setSortingStatus (line 45) | public void setSortingStatus(@Nullable SortState status) {
method clearSortingStatus (line 50) | public void clearSortingStatus() {
method isSorting (line 54) | public boolean isSorting() {
method getSortingStatus (line 58) | @Nullable
FILE: tableview/src/main/java/com/evrencoskun/tableview/sort/SortState.java
type SortState (line 31) | public enum SortState {
FILE: tableview/src/main/java/com/evrencoskun/tableview/util/TableViewUtils.java
class TableViewUtils (line 36) | public class TableViewUtils {
method setWidth (line 41) | public static void setWidth(@NonNull View view, int width) {
Condensed preview — 144 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (570K chars).
[
{
"path": ".github/CONTRIBUTING.md",
"chars": 2040,
"preview": "# Contributing to `TableView`\n\n## Table of contents\n\n- [I need help/I have a question](#i-need-helpi-have-a-question)\n- "
},
{
"path": ".github/FUNDING.yml",
"chars": 532,
"preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 684,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Describe the "
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 193,
"preview": "contact_links:\n - name: Stack Overflow\n url: https://stackoverflow.com/questions/tagged/tableview+android\n about:"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 604,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: enhancement\nassignees: ''\n\n---\n\n**Is"
},
{
"path": ".github/workflows/validate_tableview.yml",
"chars": 2194,
"preview": "name: Validate TableView\n\non:\n push:\n pull_request:\n\njobs:\n build:\n name: Build\n runs-on: ubuntu-latest\n\n st"
},
{
"path": ".gitignore",
"chars": 698,
"preview": "# Built application files\n*.apk\n*.ap_\n\n# Mac\n.DS_Store\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n"
},
{
"path": "LICENSE",
"chars": 1069,
"preview": "MIT License\n\nCopyright (c) 2017 Evren Coşkun\n\nPermission is hereby granted, free of charge, to any person obtaining a co"
},
{
"path": "README.md",
"chars": 5094,
"preview": "<div align=\"center\">\n <img src=\"https://raw.githubusercontent.com/evrencoskun/TableViewSample/master/art/Logo-5.png\" "
},
{
"path": "app/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "app/build.gradle",
"chars": 2356,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/proguard-rules.pro",
"chars": 940,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 1868,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/MainActivity.java",
"chars": 1357,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/MainFragment.java",
"chars": 11731,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewAdapter.java",
"chars": 13228,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewListener.java",
"chars": 6691,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/TableViewModel.java",
"chars": 5550,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/CellViewHolder.java",
"chars": 2443,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/ColumnHeaderViewHolder.java",
"chars": 5572,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/GenderCellViewHolder.java",
"chars": 1821,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/MoodCellViewHolder.java",
"chars": 2021,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/holder/RowHeaderViewHolder.java",
"chars": 1757,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/Cell.java",
"chars": 2339,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/ColumnHeader.java",
"chars": 1461,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/model/RowHeader.java",
"chars": 1455,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/popup/ColumnHeaderLongPressPopup.java",
"chars": 4514,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/java/com/evrencoskun/tableviewsample/tableview/popup/RowHeaderLongPressPopup.java",
"chars": 3535,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "app/src/main/res/drawable/ic_down.xml",
"chars": 1454,
"preview": "<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is hereby granted, free of charge, to any per"
},
{
"path": "app/src/main/res/drawable/ic_female.xml",
"chars": 325,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_happy.xml",
"chars": 670,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_male.xml",
"chars": 351,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_next.xml",
"chars": 337,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_previous.xml",
"chars": 336,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_sad.xml",
"chars": 673,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\""
},
{
"path": "app/src/main/res/drawable/ic_up.xml",
"chars": 1455,
"preview": "<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is hereby granted, free of charge, to any per"
},
{
"path": "app/src/main/res/layout/activity_main.xml",
"chars": 420,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.fragment.app.FragmentContainerView xmlns:android=\"http://schemas.androi"
},
{
"path": "app/src/main/res/layout/fragment_main.xml",
"chars": 4866,
"preview": "<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is hereby granted, free of charge, to any per"
},
{
"path": "app/src/main/res/layout/table_view_cell_layout.xml",
"chars": 2146,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/layout/table_view_column_header_layout.xml",
"chars": 3303,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/layout/table_view_corner_layout.xml",
"chars": 2186,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/layout/table_view_image_cell_layout.xml",
"chars": 1863,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/layout/table_view_row_header_layout.xml",
"chars": 2438,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 1585,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/values/dimens.xml",
"chars": 1512,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 2321,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 1514,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "build.gradle",
"chars": 3745,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 1311,
"preview": "#\n# MIT License\n#\n# Copyright (c) 2021 Evren Coşkun\n#\n# Permission is hereby granted, free of charge, to any person obta"
},
{
"path": "gradle.properties",
"chars": 755,
"preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
},
{
"path": "gradlew",
"chars": 5766,
"preview": "#!/usr/bin/env sh\n\n#\n# Copyright 2015 the original author or authors.\n#\n# Licensed under the Apache License, Version 2.0"
},
{
"path": "gradlew.bat",
"chars": 2674,
"preview": "@rem\n@rem Copyright 2015 the original author or authors.\n@rem\n@rem Licensed under the Apache License, Version 2.0 (the \""
},
{
"path": "settings.gradle",
"chars": 1165,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "tableview/build.gradle",
"chars": 3573,
"preview": "apply plugin: 'com.android.library'\n\nandroid {\n compileSdkVersion compile_sdk_version\n\n defaultConfig {\n mi"
},
{
"path": "tableview/proguard-rules.pro",
"chars": 940,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "tableview/src/androidTest/AndroidManifest.xml",
"chars": 278,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"com.evrencoskun.tableview.test\"\n xmlns:android=\"http:"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/CornerLayoutTest.java",
"chars": 16736,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/CornerViewTest.java",
"chars": 20352,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/ReverseLayoutTest.java",
"chars": 7759,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2020 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/SimpleActivityTest.java",
"chars": 4457,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/TestActivity.java",
"chars": 1253,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/AbstractTableAdapterTest.java",
"chars": 5253,
"preview": "package com.evrencoskun.tableview.test.adapters;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.A"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/CornerTestAdapter.java",
"chars": 5478,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/adapters/SimpleTestAdapter.java",
"chars": 4697,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/data/SimpleData.java",
"chars": 3015,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/matchers/ViewWidthMatcher.java",
"chars": 1852,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/models/Cell.java",
"chars": 2337,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/models/ColumnHeader.java",
"chars": 1401,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/java/com/evrencoskun/tableview/test/models/RowHeader.java",
"chars": 1394,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Andrew Beck\n *\n * Permission is hereby granted, free of charge, to any person"
},
{
"path": "tableview/src/androidTest/res/layout/cell_layout.xml",
"chars": 1892,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission i"
},
{
"path": "tableview/src/androidTest/res/layout/column_layout.xml",
"chars": 2763,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/corner_bottom_left.xml",
"chars": 1692,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/corner_bottom_right.xml",
"chars": 1693,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/corner_default.xml",
"chars": 1589,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/corner_layout.xml",
"chars": 2245,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/corner_top_left.xml",
"chars": 1689,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/corner_top_right.xml",
"chars": 1690,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/layout/reverse_layout.xml",
"chars": 565,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "tableview/src/androidTest/res/layout/row_layout.xml",
"chars": 2451,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/values/colors.xml",
"chars": 1395,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/androidTest/res/values/dimens.xml",
"chars": 1484,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is"
},
{
"path": "tableview/src/main/AndroidManifest.xml",
"chars": 1188,
"preview": "<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is hereby granted, free of charge, to any per"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/ITableView.java",
"chars": 6049,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/TableView.java",
"chars": 31953,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/AbstractTableAdapter.java",
"chars": 14664,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/AdapterDataSetChangedListener.java",
"chars": 2411,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/ITableAdapter.java",
"chars": 2776,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/AbstractRecyclerViewAdapter.java",
"chars": 4600,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRecyclerView.java",
"chars": 6113,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRecyclerViewAdapter.java",
"chars": 11880,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/CellRowRecyclerViewAdapter.java",
"chars": 3927,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/ColumnHeaderRecyclerViewAdapter.java",
"chars": 4517,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/RowHeaderRecyclerViewAdapter.java",
"chars": 3817,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/holder/AbstractSorterViewHolder.java",
"chars": 1797,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/adapter/recyclerview/holder/AbstractViewHolder.java",
"chars": 2475,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/filter/Filter.java",
"chars": 6306,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/filter/FilterChangedListener.java",
"chars": 1961,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/filter/FilterItem.java",
"chars": 1779,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/filter/FilterType.java",
"chars": 1394,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/filter/IFilterableModel.java",
"chars": 1443,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/ColumnSortHandler.java",
"chars": 9905,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/ColumnWidthHandler.java",
"chars": 1871,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/FilterHandler.java",
"chars": 7490,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/PreferencesHandler.java",
"chars": 2795,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/ScrollHandler.java",
"chars": 5576,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/SelectionHandler.java",
"chars": 15924,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/handler/VisibilityHandler.java",
"chars": 8429,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/CellLayoutManager.java",
"chars": 21919,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/ColumnHeaderLayoutManager.java",
"chars": 5500,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/layoutmanager/ColumnLayoutManager.java",
"chars": 9489,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/ITableViewListener.java",
"chars": 2289,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/SimpleTableViewListener.java",
"chars": 2485,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/TableViewLayoutChangeListener.java",
"chars": 2944,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/AbstractItemClickListener.java",
"chars": 4341,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/CellRecyclerViewItemClickListener.java",
"chars": 5307,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/ColumnHeaderRecyclerViewItemClickListener.java",
"chars": 4320,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/itemclick/RowHeaderRecyclerViewItemClickListener.java",
"chars": 4278,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/scroll/HorizontalRecyclerViewListener.java",
"chars": 12930,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/listener/scroll/VerticalRecyclerViewListener.java",
"chars": 8835,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/pagination/IPagination.java",
"chars": 2668,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/pagination/Pagination.java",
"chars": 12334,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/preference/Preferences.java",
"chars": 3475,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/preference/SavedState.java",
"chars": 2209,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/AbstractSortComparator.java",
"chars": 2808,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnForRowHeaderSortComparator.java",
"chars": 3036,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortCallback.java",
"chars": 3671,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortComparator.java",
"chars": 2044,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortHelper.java",
"chars": 3871,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/ColumnSortStateChangedListener.java",
"chars": 1794,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/ISortableModel.java",
"chars": 1410,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderForCellSortComparator.java",
"chars": 2611,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderSortCallback.java",
"chars": 3027,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderSortComparator.java",
"chars": 1810,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/RowHeaderSortHelper.java",
"chars": 1995,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/sort/SortState.java",
"chars": 1919,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/java/com/evrencoskun/tableview/util/TableViewUtils.java",
"chars": 1982,
"preview": "/*\n * MIT License\n *\n * Copyright (c) 2021 Evren Coşkun\n *\n * Permission is hereby granted, free of charge, to any perso"
},
{
"path": "tableview/src/main/res/drawable/cell_line_divider.xml",
"chars": 1428,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "tableview/src/main/res/values/attrs.xml",
"chars": 2252,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "tableview/src/main/res/values/colors.xml",
"chars": 1510,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "tableview/src/main/res/values/dimens.xml",
"chars": 1320,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
},
{
"path": "tableview/src/main/res/values/ids.xml",
"chars": 1336,
"preview": "<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Andrew Beck\n ~\n ~ Permission is hereby granted, free of charge, to any"
},
{
"path": "tableview/src/main/res/values/integers.xml",
"chars": 1261,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ MIT License\n ~\n ~ Copyright (c) 2021 Evren Coşkun\n ~\n ~ Permission is her"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the evrencoskun/TableView GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 144 files (527.6 KB), approximately 121.6k tokens, and a symbol index with 812 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.