Giter VIP home page Giter VIP logo

tablefixheaders's Introduction

TableFixHeaders

[DISCONTINUED] This project it's not deprecated, it do what it must, but we don't have time to improve it or, even, answer issues.

What is it?

TableFixHeaders is an Android widget to display tables with headers.

Features

  • Adapter class to fill the table in an easy way.

  • Own scroll.

  • Impulse scroll.

  • Recycling of views.

  • Shadows when there is more info to scroll.

Technical information

  • Required minimum API level: 5

  • Supports all the screens sizes and density.

Sample

You can download the app test from here: http://bit.ly/13buAIq

QR

Screenshots

Screenshot 1

Screenshot 2

License

Copyright 2012-2013 InQBarna

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

   http://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.

tablefixheaders's People

Contributors

braisgabin avatar davidgarciaanton avatar k3b avatar kowunnako avatar msdx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tablefixheaders's Issues

Widget performance in large data sets

This is the most impressive, beautiful and functional implementation of the Android scrollable table grid I have come across !

I would like to ask a few questions:

  1. What is the expected performance (display speed) of this component, compared to a standard List view or Table view, when displaying large number of database records (1000+) ?
  2. Is it possible to implement click on data row listener (similar to onListItemClick) to select another activity, e.g. to edit the fields of the selected record in another frame ?
  3. Is it possible to implement click on column header listener, in order to sort the table data in ASC or DESC order ?
  4. How to prevent the text wrapping in a cell ?

Thank you in advance for tips and examples how to solve the questions 2, 3, and 4.
I am relatively new to Android programming and any assistance will be most appreciated.

Recycle views

Generate only the visibles views in the table. Generate the new visibles views on demand. Recycle the old views.

Scroll Impulse

When the user applies a pulse on the board this must follow scrolling after the ACTION_UP for a while.

Recycled view

Hi,
Your work helps a lot! But i got a problem here:

screenshot_2013-08-29-14-40-04

The second column in the image should be an ascending number from 1 to n, but it totally mess up when scrolling the table.
I remove the recycledView part in makeView function in TableFixHeader class and it works fine (with slower scrolling of course).
By far this happen only when using Nexus 7, running Android 4.3. I have another ASUS tablet running 4.0.3 which works like a charm.

Is something wrong with my getView in adapter?
Many thanks!

how to add pull to refresh loading

I want add an pull down to refresh loading header and pull up to load more loading footer. the loading header should between the first lock head and first data row, the loading footer should blow the last data row. Please give me a help.

Scrolling makes header customizations appear on lines

I don't know if there is a problem in my code, but when I scroll the table fast, some customizations that I did in my header (typeface, background ...) appear on some lines.

This is my code in getView, made using MatrixTable as example.

public View getView(int row, int column, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = new TextView(context);
            ((TextView) convertView).setGravity(Gravity.CENTER_VERTICAL);
            ((TextView) convertView).setPadding(5, 2, 0, 2);

        }
        ((TextView) convertView).setText(table[row + 1][column + 1].toString());

        if (row == -1) {
            ((TextView) convertView).setTypeface(Typeface.DEFAULT_BOLD);
        } else if (row % 2 == 0) {
            convertView.setBackgroundColor(context.getResources().getColor(
                    br.com.tsuharesu.gamedevstoryhelp.R.color.even_bgcolor));
        } else {
            convertView.setBackgroundColor(context.getResources().getColor(
                    br.com.tsuharesu.gamedevstoryhelp.R.color.odd_bgcolor));
        }

        return convertView;
    }

I think it's because of recycling, but I'm not really sure. Thanks!

IndexOutOfBoundsException: Invalid index 6, size is 4

Hey,
I dynamic set data in adapter,then have the issue was very frequent and random.

java.lang.IndexOutOfBoundsException: Invalid index 6, size is 4
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at com.scan.inventory.table.DisplayTableAdapter.getBody(DisplayTableAdapter.java:90)
at com.scan.inventory.table.DisplayTableAdapter.getView(DisplayTableAdapter.java:55)
at com.scan.inventory.table.TableFixHeaders.makeView(TableFixHeaders.java:771)
at com.scan.inventory.table.TableFixHeaders.addLeftOrRight(TableFixHeaders.java:422)
at com.scan.inventory.table.TableFixHeaders.addLeft(TableFixHeaders.java:399)
at com.scan.inventory.table.TableFixHeaders.scrollBy(TableFixHeaders.java:321)
at com.scan.inventory.table.TableFixHeaders.scrollTo(TableFixHeaders.java:270)
at com.scan.inventory.ui.QueryActivity.refreshTableFix(QueryActivity.java:221)
at com.scan.inventory.ui.QueryActivity.queryData(QueryActivity.java:211)
at com.scan.inventory.ui.QueryActivity.onClick(QueryActivity.java:148)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

Auto scroll to the last row

I have a requirement to automatically scroll the table to the last row on initial display (after all data have been added from cursor to the TableAdapter.)
I assume I cannot use the standard listview commands:
lv.setSelection(adapter.getCount() - 1);
or
lv.setStackFromBottom(true);

Would you be able to suggest how to achieve this requirement when using your TableFixHeaders library ?
I noticed that you have an empty method:
public void scrollBy(int x, int y)
still to be implemented.
Would that provide a solution ?

Thank you in advance for the assistance with this requirement.

Pull to refresh

I wanted to add a scrollview because I'd like to give it a pull to refresh(down - up). Would you suggest me any idea how I can do that? Thanks.

add Scrollview

Is there a way to add a scrollview without losing the header? thanks

add a scrollbar ?

There are lots of row and column,want to see "where am I".
vertical and horizontal add a scrollbar?

Row header above column header in cell -1, -1

Currently when there is no background set for Cell -1, -1, the column header is above the row header, is it possible to have the row header above the column header when they meet in the first cell (-1, -1)?

Thanks.

java.lang.NullPointerException

private void scrollBounds() {
    scrollX = scrollBounds(scrollX, firstColumn, widths, width);
    scrollY = scrollBounds(scrollY, firstRow, heights, height);
}

maybe widths is Null ?

java.lang.NullPointerException
at TableFixHeaders.scrollBounds(TableFixHeaders.java:712)
at TableFixHeaders.scrollBounds(TableFixHeaders.java:702)
at TableFixHeaders.scrollBy(TableFixHeaders.java:344)
at TableFixHeaders.onTouchEvent(TableFixHeaders.java:269)
at android.view.View.dispatchTouchEvent(View.java:3933)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:955)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1015)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1015)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1015)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1015)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1015)

Shadowing doesn't work on Nexus 7 tab

Neither the shadowing on the column/header scroll, or the shadow when there is more data to be seen work on the Nexus 7 tablet.

Model: Nexus 7
Android Version: 4.2.2

Top and left shadow

In a Nexus 4 and a Galaxy Nexus with Android 4.2.2 the left and top shadow doesn't apper.

Using with SearchView

Has anyone tried to use FixHeaders with a SearchView?

I'm trying to use but when the Activity is scrolled down and I search something, it gives me an ArrayOutOfBounds exception, maybe because of the scroll.

I'm using ActionBarSherlock and made a ListAdapter instead of a matrix.

About scroll

This controls is very cool, i have a few questions.

1.How to determine the scroll to the rightmost and leftmost.
2.How to add a fixed footer.

App crashing on scrollTo();

In TableFixHeaders in the MotionEvent.ACTION_MOVE in the onTouchEvent method, I have an if statement to check when scrolling has reached a certain X point, so I can run some code. If TableFixHeaders has not been scrolled vertically, only scrolled horizontally and when the certain X point has hit then the code that I have put in that If statement works fine, but If TableFixHeaders has been scrolled vertically then horizontally then the app crashes. I have checked LogCat and here is part of what is displayed:

It looks to me like it is trying to remove a View from the ArrayList which is not there?:

FATAL EXCEPTION: main
java.lang.ArrayIndexOutOfBoundsException
at java.util.ArrayList.remove(ArrayList.java:408)
at com.inqbarna.tablefixheaders.TableFixHeaders.removeTopOrBottom(TableFixHeaders.java:425)
at com.inqbarna.tablefixheaders.TableFixHeaders.removeBottom(TableFixHeaders.java:413)
at com.inqbarna.tablefixheaders.TableFixHeaders.scrollBy(TableFixHeaders.java:319)
at com.inqbarna.tablefixheaders.TableFixHeaders.scrollTo(TableFixHeaders.java:258)
at com.inqbarna.tablefixheaders.TableFixHeaders.onTouchEvent(TableFixHeaders.java:220)

How to manipulate the data containers

Hi BraisGabrin,

First of all, I would to say thanks to your library. Since I was using it to my project.
In my project, I wanna create dynamic data to layout in row 0 && column 1 and row 1 && column 1. I had created the original data. When I open table, the data is displaying in layout. I have checkbox. When I was clicked, it'll saving the original data. I've compare button too. When I was clicked, it'll remove display original data currently. So, the saving data will displaying in layout.

I wanna asking you about this issues. Is there any function to solve this issues ?
Please help me.

Thanks

Create a Maven release

It would be great if you added a Maven build file for this and maybe deployed it to a public maven repository.

Horizontal scrolling of very wide column causes it to disappear

While you are working with the code this weekend, could you also please try to replicate and fix the following problem:
In one of the tables, I need to use a very wide column (with lots of text in each cell).
The fixed column widths for this table are as follows:

    private final int[] widths = {      
            93,
            30,
            85,
           550,             
             0,  // ts column set to 0, made invisible
             0,  // eventkey column set to 0, made invisible
             0,  // eventtype column set to 0, made invisible
    };      

The very wide column (550) is the last visible column in that table (it is only partially visible in portrait mode, when the table is initially created).
The last 3 columns are set to 0 width (made invisible). They hold internal record keys required as a reference, when user clicks on the table row.

When I swipe slightly to the left and then rapidly swipe the table horizontally to the right, the very wide column disappears completely. It becomes visible again if I swipe to the left again.
This is not a very critical issue, but if you were able to fix it, it would be great.

App crashing on device

Hey,

I just imported your library into eclipse and tried running the sample you have but it gets to the screen where you select the adapters (Simple, Style or Family), and I select either one and the app crashes? Before trying the sample out I had downloaded the test app (.apk) and tried it and it worked fine?

I tried debugging it and seems to me that the startActivity line is where the problem is starting to occur:

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    startActivity(new Intent(this, ((B) l.getItemAtPosition(position)).class1));
}

I have not changed any code, maybe it is the way that I am importing the project? Thanks for any help.

issue in table row

Hi

please share the code for first row should be fixed when the table is scrolled horizontally and vertically,please share code how to fix that issue

About column width

In these three examples, the column widths are defined. It can automatically adjust column widths based on the width of the data?

A strange thing about use theme dialog

When I use a pop up dialog theme with table(example FamilyTable), there like existing a half transparent view on the screen, looks live shadow. I know it, because android when theme popup, the default text color is white .

How to change table font size globally

I would like to allow users to change the default font size used in the TableFixHeaders through the user-defined application Settings (Preferences).

What would be the best, most efficient, recommended method to apply this user-defined setting globally to all table cells in your library ?
I am looking for a solution similar to the already available global GetWidth and getHeight settings, which can be easily controlled from the application preferences (in combination with density).

Would you consider adding a similar font size global control switch to your library ?
This would dramatically improve the visual display and functionality of your excellent library.

Regards
Mariusz

ArrayIndexOutOfBoundsException

private int sumArray(int array[], int firstIndex, int count) {
    int sum = 0;
    count += firstIndex;
    for (int i = firstIndex; i < count; i++) {
        sum += array[i]; // Error ArrayIndexOutOfBoundsException here 
    }
    return sum;
}

I suppose you mean:

private int sumArray(int array[], int firstIndex, int count) {
    int sum = 0;
    count += firstIndex;
    for (int i = firstIndex; i < Math.min(array.length, count); i++) {
        sum += array[i];
    }
    return sum;
}

Orientation changes support

Hello,

Thanks for sharing this cool library. I'm interested in using your library for my app that supports both orientations. When I execute the example and select the "Family adapter" option I experience a weird behavior. The steps to reproduce are:

  • Run example app.
  • Select the Family adapter option
  • In portrait mode scroll until the maximum X position
  • Rotate the screen
  • After rotation, in landscape mode scroll in the Y axis

Result: Cells are displayed wrong, after scrolling some of them are resized to its original size, however some cells in the column header row never restore their original size.

Many thanks.

How to remove the family view row?

Hi,

I'm having trouble trying to remove the row that returns from getView() under

case 4:
view = getFamilyView(row, column, convertView, parent);

This is in the FamilyTable.java example and is the row right after the fixed header.

Thank you.

TableFixHeaders With EditText

Hi,

I am inflating EditText as a child in TableFixHeaders. Is it possible to adjust the whole TableView when SoftKeyboard appears at bottom.

Situation: At end of the list if I touch any cell, SoftKeyboard opens but it hides bottom cell(s).

  1. When touch to Obfuscation Cell

question

  1. After SoftKeyboard Opened

question_2

Any idea how to handle this kind of situation.

Update
I tried with ScollView but having issue with TableFixHeaders.

Selection highligt and selected row

I've two little question.
1- Is there a way to highlight touched row like in listview?
2- How can I get selected row number? (not x or y in pixels)

Thanx

How to make a FixColumn(First Column) in right side of the page in TableFixHeader?

I want to show first column in table at right side of the page(for Persian, Arabic languages and etc.) but I can not. Moreover, in current version of library when I want to see the other columns in the first time (For example in FamilyTable), I have to touch the screen and move my finger from right side to left side but I want to action vice versa(uses for RTL languages).Please look at the image from this link http://i.stack.imgur.com/fwgLP.png .this is an illustration of what I want to do it. Thank you in advance.

How to detect touched row position / row number ?

I need to detect which table row was touched, in order to re-select that same row after returning to this table from another activity/view.
Currently, when the table row is touched, the view changes automatically to another activity. Depending on user interaction, that activity then changes the table row data and the background colour of the previously touched table row cell (within the getLayoutResource).
This requires re-setting the tableAdapter to null and re-querying the data, in order to populate and re-draw the table with the newly coloured cell. As the result of this re-draw, the first row in the table is always re-selected.
The requirement is to re-select (go to) the same row, which was originally touched.
I have noticed that the onInterceptTouchEvent library method obtains the currentY of the touched row.
However I don't know how to get that currentY value from within my application and then how to apply that Y value to scrollBy the table down to the previously touched row level, and to have this row visible and in focus.

Please suggest the code method how to achieve the above requirement.
Many thanks.

Column Width different sizes.

I have found a way to change the column width, my question is: Is there a way to have the table cells (Cells >-1) not including the headers to have different column widths than to the row header?

Lag in scrolling

When i add gravity in textview through code there is a significant lag in scrolling. I have a quite large dataset(around 4000 rows). When i remove gravity the whole view scrolls smoothly. Any idea? Thanks in advance!

Don't make first collumn a header

Hello, I'm looking to use your lib but I can't understand how it work (sorry hehehe). How can I make a collumn to not behave as a header? I just want the first row to be fixed, not the first collumn. I understand that the index to be a header is -1, but I didn't get where this index go.

Plus... is there any chance to make a Wiki? Or to explain how can we use an XML to populate the table?

Thx in advance :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.