FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

Overview

Fixed Header Table Layout for Android

FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with multi direction scrolling and zooming.

This repository also contains a sample app that is designed to show you how to create your own FixedHeaderTableLayout in your application.

FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

Note

This Library is current in development and is considered in an Alpha state

Features

  • 1 to X number of rows can be fixed as column headers at the top of the table
  • 1 to X number of rows can be fixed as row headers at the left of the table
  • Multi direction scrolling is available if the table is larger than the screen
  • Pinch Zoom is available
  • Standard scrollbars are available
  • Each column width value will be automatically adjusted to fit the largest cell in the column.
  • Each row height value will be automatically adjusted to fit the largest cell in the row.
  • Support for API 16 upwards

Feature TODO list

  • Nothing is clickable in the table yet.
  • Scale around pinch center.
  • Corner layout location and layout direction to support Right to Left Languages
  • Some type of column span (Nested Tables) support
  • Making the fixed headers optional (at least one of each is required at the moment)
  • Documentation
  • Automated Tests
  • Probably lots more

Limitations

  • As per Android's TableLayout constructing/drawing very large tables takes some time.

What's new

You can check new implementations of TableView on the release page.

Installation

To use this library in your Android project

Add Maven Central to the project's build.gradle :

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

Add the following dependency into your module's build.gradle:

dependencies {
    implementation 'com.github.Zardozz:fixedheadertablelayout:0.0.0.2'
}

Documentation

Please check out the project's wiki.

Contributors

Contributions of any kind are welcome!

If you wish to contribute to this project, please refer to our contributing guide.

License

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.
Comments
  • Not getting click event after scroll

    Not getting click event after scroll

    Describe the bug I want to handle click event of every row but after scroll i am not gettiing position

    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.

    Code for a Minimum Reproducible example To assist investigation a Minimum Reproducible example App should be included.

    Tools:

    • FixedHeaderTableLayout version: [e.g. 0.0.0.1]
    • Android version: [e.g. 11]

    Additional context Add any other context about the problem here.

    enhancement 
    opened by desaibijal 10
  • Scroll to botom

    Scroll to botom

    Hi Gents, Thank you for the great table which is very useful. I implemented this table as I needed the fixed headers (row, column, and corner). Since I have almost 800 rows in main table (or row header table), i want to scroll to end/bottom after the table is populated. I tried several ways of doing it by setting the scrollTo(0,maintable.getBottom) and aso tried doing it in post runnable.

    Could you please provide a working solution for me.

    Edit: I just want the main table (with row header table) to scroll vertically to bottom.

    Thanks, Tony

    enhancement 
    opened by tonydsouza1987 4
  • The table is not scrolled up when inside SwipeRefreshLayout

    The table is not scrolled up when inside SwipeRefreshLayout

    When the widget is inside a SwipeRefreshLayout and you pull the screen down, it won't scroll, but trigger the swipe refresh instead. You have to first pull the screen up and then down to make it scroll.

    bug 
    opened by yaugenka 2
  • Non unique attribute names cause build failures

    Non unique attribute names cause build failures

    It seems that it is bad form to not prefix your custom attribute names with name unique for your library

    ....\jetified-tableview-0.8.9.4\res\values\values.xml:12:4: Duplicate value for resource 'attr/corner_view_location' with config 'DEFAULT' and product ''. Resource was previously defined here: ....\jetified-fixedheadertablelayout-0.0.0.4\res\values\values.xml:6:4: .

    To Reproduce Include both tableview and fixedheadertablelayout libraries in an App

    Expected behavior Not to have build failures

    Tools:

    • FixedHeaderTableLayout version: 0.0.0.4
    • tableview version: 0.8.9.4

    Additional context As I contributed that to the tableview library, it's easier for me to change it in this library

    bug 
    opened by Zardozz 1
  • I get a null object reference while trying to use FixedHeaderTableLayout with retrofit

    I get a null object reference while trying to use FixedHeaderTableLayout with retrofit

    Am trying to create fixed header table layout using FixedHeaderTableLayout. I have some users which I retrieve from the server using retrofit. Below is the code. However If I run the app in debug mode and set the breaking points on for (int i = 1; i <=userNames.size(); i++) { it runs perfect! I guess the problem is with retrofit not returning the results faster.

    int daysInMonth = 29
        private List<AttendanceModel> userNames = new ArrayList<>();
    
        protected void onCreate(Bundle savedInstanceState) {
            ............................
        ........................................
        ....................................
        //request to get the number of Users from the server using retrofit
            ApiInterface api = ApiClient.getRetrofit().create(ApiInterface.class);
            Call<ListUsers> products = api.get_attendance();
            products.enqueue(new Callback<ListUsers>() {
                @Override
                public void onResponse(Call<ListUsers> call, Response<ListUsers> response) {
                    if(response.body()!=null){
                        userNames = response.body().getNames();
    
                      ..............................
        ............................................
        });
    
            // Really this should be done in the background as generating such a big layout takes time
            GenerateTables generateTables = new GenerateTables(this);
            generateTables.execute();
    
    
        }
    
    @SuppressLint("SetTextI18n")
        private void createTable(Context mContext){
            // Create our 4 Sub Tables
            mainTable = new FixedHeaderSubTableLayout(mContext);  
            // 25 x 5 in size
            float textSize = 20.0f;
            for (int i = 1; i <=userNames.size(); i++) { // userNames = 7
                FixedHeaderTableRow tableRowData = new FixedHeaderTableRow(mContext);
                // Add some data
                for (int j = 1; j <= daysInMonth; j++) { // daysInMonth = 29
                    // Add a Textview
                    TextView textView = new TextView(mContext);
                    textView.setGravity(Gravity.CENTER);
                    textView.setText(String.format(Locale.ROOT,"C%d:R%d", j, i)); 
    
                    textView.setBackgroundResource(R.drawable.list_border);
                    textView.setPadding(5 ,5,5,5);
                    textView.setTextSize(textSize * 1.5f);
                    textView.setTextColor(getResources().getColor(R.color.colorText));
                    tableRowData.addView(textView);
                }
                mainTable.addView(tableRowData);
            }
    .........
    ..............................
    ...............................
    
    

    Whenever I run the code I get error as follow;

    E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.example.distance, PID: 7096 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$4.done(AsyncTask.java:415) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) at java.util.concurrent.FutureTask.setException(FutureTask.java:252) at java.util.concurrent.FutureTask.run(FutureTask.java:271) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923)

    Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference at com.github.zardozz.fixedheadertablelayoutsample.MainActivity.createTable(MainActivity.java:192) at com.github.zardozz.fixedheadertablelayoutsample.MainActivity.access$200(MainActivity.java:59) at com.github.zardozz.fixedheadertablelayoutsample.MainActivity$GenerateTables.doInBackground(MainActivity.java:153) at com.github.zardozz.fixedheadertablelayoutsample.MainActivity$GenerateTables.doInBackground(MainActivity.java:128) at android.os.AsyncTask$3.call(AsyncTask.java:394) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923)

    opened by wissedenis 1
Releases(0.0.0.5)
  • 0.0.0.5(Jan 19, 2022)

    Fixed clash of attribute names #6 by adding a library specific prefix (breaking change) and removing some unused attributes Fixed some Typos in docs Updated some library versions Fixed release signing Typo Updated sdk version as required by some libraries

    Source code(tar.gz)
    Source code(zip)
  • 0.0.0.4(Jan 10, 2022)

    Updated Example App to allow adding multiple different examples. Add example of using FixedHeaderSubTableLayout directly for modular multiple tables. Created a Utils Class for width aligning methods, so they can be used independently.

    Source code(tar.gz)
    Source code(zip)
  • 0.0.0.3(Dec 17, 2021)

  • 0.0.0.2(Mar 19, 2021)

  • 0.0.0.1(Mar 18, 2021)

Owner
null
null 2.4k Dec 30, 2022
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page

Google Plus Layout Google Plus Layout is a custom layout that support playing animation on child view(s) in a serialize manner like the the main

Ahmed Nammari 224 Nov 25, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Jan 5, 2023
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.

Please switch to DragView, for the best support, thank you DraggablePanel Download allprojects { repositories { ... maven { url 'https://jitp

Hoàng Anh Tuấn 103 Oct 12, 2022
A custom ViewPager title strip which gives continuous feedback to the user when scrolling

SmartTabLayout A custom ViewPager title strip which gives continuous feedback to the user when scrolling. This library has been added some features an

ogaclejapan 7k Jan 7, 2023
TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.

This project isn't maintained anymore. It is now recommended to use https://github.com/peterLaurence/MapView. MapView is maintained by Peter, one of o

Mike Dunn 1.5k Nov 21, 2022
Easy, flexible and powerful Swipe Layout for Android

SwipeRevealLayout A layout that you can swipe/slide to show another layout. Demo Overview Drag mode Drag mode normal: Drag mode same_level: Features F

Chau Thai 1.5k Jan 4, 2023
The Most Powerful Swipe Layout!

Android Swipe Layout ![Gitter](https://badges.gitter.im/Join Chat.svg) This is the brother of AndroidViewHover. One year ago, I started to make an app

代码家 12.3k Dec 28, 2022
It's an Android library that allows you to use Layout as RadioButton or CheckBox.

Android - CompoundLayout It's an Android library that allows you to use Layout as RadioButton or CheckBox. The librarie is Android 14+ compatible. Gra

null 483 Nov 25, 2022
A 3D Layout for Android,When you use it warp other view,it can became a 3D view,一秒让你的view拥有3D效果!

ThreeDLayout A 3D Layout,When you use it warp other view,it can became a 3D view 中文文档 preview USAGE 1.compile library allprojects { repositories {

androidwing 490 Oct 27, 2022
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Umano: News Read To You 9.4k Dec 31, 2022
An Android library that help you to build app with swipe back gesture.

SwipeBackLayout An Android library that help you to build app with swipe back gesture. Demo Apk GooglePlay Requirement The latest android-support-v4.j

ike_w0ng 6.1k Dec 29, 2022
SwipeBack is an android library that can finish a activity by using gesture.

SwipeBack SwipeBack is a android library that can finish a activity by using gesture. You can set the swipe direction,such as left,top,right and botto

Eric 1.7k Nov 21, 2022
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

ogaclejapan 1.4k Dec 26, 2022
A floating menu library for Android.

Hover Hover is a floating menu implementation for Android. Goals The goals of Hover are to: Provide an easy-to-use, out-of-the-box floating menu imple

Google 2.7k Dec 27, 2022
Simple android library to present an animated ferris wheel

Ferris Wheel View Overview An Android Library used to implement an animated Ferris Wheel in android. API SDK 15+ Written in Kotlin Supports landscape

Igor Lashkov 318 Dec 7, 2022
Android Library that lights items for tutorials or walk-throughs etc...

Spotlight Gradle dependencies { implementation 'com.github.takusemba:spotlight:x.x.x' } Usage val spotlight = Spotlight.Builder(this) .setTarg

TakuSemba 3.4k Dec 23, 2022
An Android library that help you to build app with swipe back gesture.

SwipeBackLayout An Android library that help you to build app with swipe back gesture. Demo Apk GooglePlay Requirement The latest android-support-v4.j

ike_w0ng 6.1k Jan 3, 2023