Code Monkey home page Code Monkey logo

adaptivetablelayout's Introduction

AdaptiveTableLayout Awesome

Header image

Welcome the new CSV Library AdaptiveTableLayout for Android by Cleveroad

Pay your attention to our new library that makes it possible to read, edit and write CSV files. If you use Android-based device, you can easily use our library for implementation of all aforementioned actions. In addition, you will be able to change rows and columns, display the picture via link, and align the required data. It will surely help you cope with your tasks faster and make your output higher. AdaptiveTableLayout library is at your disposal.

Demo image

Take a look at the animation of AdaptiveTableLayout for Android on YouTube in HD quality. For using this library in a valuable way, you can find our CSV Editor app on the Google Play Store or on Appetize.

AwesomeAwesomeAwesome

The main goal of the library is to apply all its functions in the process of working with CSV files. Moreover, it will give you a competitive edge over others.

Awesome

Setup and usage

Installation

by gradle :

dependencies {
    implementation "com.cleveroad:adaptivetablelayout:1.2.1"
}

Features

Library consists of three parts:

  • AdaptiveTableLayout (View)
  • LinkedAdaptiveTableAdapter (Adapter)
  • ViewHolderImpl (ViewHolder)

Usage

AdaptiveTableLayout

  <com.cleveroad.adaptivetablelayout.AdaptiveTableLayout
        android:id="@+id/tableLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"      
        app:cellMargin="1dp"
        app:fixedHeaders="true"
        app:solidRowHeaders="true"
        app:dragAndDropEnabled="true"/>
attribute name description
cellMargin margin between cards
fixedHeaders fixed headers mode. If enable, headers always will be displayed in the corners.
solidRowHeaders solid row headers mode. If enable, row header will change its position with dragging row.
dragAndDropEnabled drag and drop mode. If enable, column or row will change its position with dragging after long press on row or column header.
// Return fixed headers mode
boolean isHeaderFixed(); 

// Return solid row headers mode
boolean isSolidRowHeader()

// Return drag and drop mode
boolean isDragAndDropEnabled()

// Return true if layout direction is RightToLeft
boolean isRTL()

// Set fixed headers mode
void setHeaderFixed(boolean headerFixed)

// Set solid row headers mode
void setSolidRowHeader(boolean solidRowHeader)
1.2.0
// Set drag and drop mode
void setDragAndDrow(boolean enabled)

/**
 * Set adapter with IMMUTABLE data.
 * Create wrapper with links between layout rows, columns and data rows, columns.
 * On drag and drop event just change links but not change data in adapter.
 */
void setAdapter(@Nullable AdaptiveTableAdapter adapter)

/**
 * Set adapter with MUTABLE data.
 * You need to implement switch rows and columns methods.    
 * DO NOT USE WITH BIG DATA!!
 */
void setAdapter(@Nullable DataAdaptiveTableLayoutAdapter adapter)

// Notify any registered observers that the data set has changed.
void notifyDataSetChanged()

// Notify any registered observers that the item has changed.
void notifyItemChanged(int rowIndex, int columnIndex)

// Notify any registered observers that the row with rowIndex has changed.
void notifyRowChanged(int rowIndex)

// Notify any registered observers that the column with columnIndex has changed.
void notifyColumnChanged(int columnIndex)

Adapter

You could use adapter interfaces: AdaptiveTableAdapter and DataAdaptiveTableLayoutAdapter. But to simplify the usage, library contains base adapters: BaseDataAdaptiveTableLayoutAdapter and LinkedAdaptiveTableAdapter.

BaseDataAdaptiveTableLayoutAdapter - simple adapter which works with light data. WARNING! on each row/column switch, original data will be changed.

LinkedAdaptiveTableAdapter - adapter which works with heavy data. WARNING! This type of adapter doesn't change original data. It contains matrix with changed items with links on it. To get changed data you need use AdaptiveTableLayout.getLinkedAdapterRowsModifications() and AdaptiveTableLayout.getLinkedAdapterColumnsModifications(). Don't forget to check AdaptiveTableLayout.isSolidRowHeader() flag. If it's false, you need to ignore switching first elemet in each row.

For both adapters you need to know all rows/columns widths, heights and rows/columns count before set adapter to AdaptiveTableLayout.

Fragment/Activity usage

mTableLayout = (AdaptiveTableLayout) view.findViewById(R.id.tableLayout);
...
mTableAdapter = new SampleLinkedTableAdapter(getContext(), mCsvFileDataSource);
mTableAdapter.setOnItemClickListener(...);
mTableAdapter.setOnItemLongClickListener(...);
mTableLayout.setAdapter(mTableAdapter);
...
mTableLayout.setHeaderFixed(true);
mTableLayout.setSolidRowHeader(true);
mTableAdapter.notifyDataSetChanged();

XML usage

 <com.cleveroad.adaptivetablelayout.AdaptiveTableLayout
        android:id="@+id/tableLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar"
        app:cellMargin="1dp"
        app:fixedHeaders="true"
        app:solidRowHeaders="true"
        app:dragAndDropEnabled="true"/>

Adapter usage

Adapter sample

Changelog

See changelog history.

Support

If you have any questions, issues or propositions, please create a new issue in this repository.

If you want to hire us, send an email to [email protected] or fill the form on contact page

Follow us:

Awesome Awesome Awesome Awesome Awesome

License


The MIT License (MIT)

Copyright (c) 2016 Cleveroad Inc.

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.

adaptivetablelayout's People

Contributors

ilchenko-peter avatar jekaua avatar vadimhalimendikcr avatar yarovoiag avatar yarovoiag-cr 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  avatar  avatar  avatar  avatar  avatar  avatar

adaptivetablelayout's Issues

read from excel file

can u help me to read from xls file and display using your adaptive able by the way i can get cellule by cellule from my excel using Jecxel API (student project mobile application in android studio still beginner)

how to Right To Left this Table

hello thanks for your useful lib, i try to use this lib for an persian app and i need use Right to left of this table , i don't idea

Is it possible to remove row headers shadow?

I want to know if it's possible to somehow remove row headers shadow.
I want to hide row headers, I just set their width to 0, but I still can see their shadow.
Can somebody help with that?

Thanks

Update to API Level 29

AdaptiveTableLayout is compiled to API Level 28. This should be updated to API Level 29, the last one at current time.

java.lang.IllegalAccessError

If I use adapter on kotlin I'm getting java.lang.IllegalAccessError: Illegal class access: 'me class' attempting to access 'com.cleveroad.adaptivetablelayout.ViewHolderImpl' (declaration of 'me class' appears in ...). If I use adapter on java I don't have this problem.

After researching, I found this to be a known issue using Java libraries with Kotlin because of the following:
Java allows accessing protected members from other classes in the same package and Kotlin doesn’t, so Java classes will have broader access to the code.

Do you plan to support Kotlin?

Column resizing

Is it possible to resize columns (auto and manuel) according to their contents?

notifyDataSetChanged() do not call onBindLeftTopHeaderViewHolder but does to every other header

I am implementing a sort action when clicking on any column header. What also concerns top left corner header.

Table is sorted by top left corner header by default. If user clicks on any other column header, table becomes sorted by that column. I maintain the visibility of a drawable on headers to show if it is sorting ascending or descending

When playing between column headers everything works correctly. This is, if I click on any column header onBindHeaderColumnViewHolder is called and this drawable is removed from previous column and turns visible on new column header. But drawable is never removed from top left corner header as onBindLeftTopHeaderViewHolder is never called too.

Getting IllegalStateException; Please Help

I am trying to load data from my server. I am fetching the data from the server and feeding it to the table, but it takes around 260ms to get server response and in the meantime if I try to touch and move my finger in the empty section in the table it shows this exception.

Getting error as
AndroidRuntime: FATAL EXCEPTION: main
Process: com.stocksarena.algofox, PID: 11552
java.lang.IllegalStateException: You need to init matrix before work!

Custom Footer View?

Is there a way to add a custom footer view (such as a "load more" cell) to the end of the list in certain situations?

I need to add a full width cell (that doesn't scroll horizontally with the rest of the table) when more data needs to be loaded in and cant figure out how to add this in.

Any help would be appreciated.
Thanks

AdaptiveTableLayout crashes when loading an empty CSV

I get following exception when trying to use AdaptiveTableLayout when loading an adapter with no data. Same happens on sample if loaded an empty CSV:

java.lang.NegativeArraySizeException: -1
at com.cleveroad.adaptivetablelayout.AdaptiveTableManager.init(AdaptiveTableManager.java:59)
at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.initItems(AdaptiveTableLayout.java:253)
at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.setAdapter(AdaptiveTableLayout.java:312)
at com.cleveroad.sample.ui.TableLayoutFragment.initAdapter(TableLayoutFragment.java:316)
at com.cleveroad.sample.ui.TableLayoutFragment.onCreateView(TableLayoutFragment.java:134)

java.lang.IllegalStateException:You need to init matrix before work!

When I reload a Activity contains a AdaptiveTableLayout ,sometimes it produce a IllegalStateException, but sometimes not.

java.lang.IllegalStateException: You need to init matrix before work!
                        at com.cleveroad.adaptivetablelayout.AdaptiveTableManager.checkForInit(AdaptiveTableManager.java:66)
                        at com.cleveroad.adaptivetablelayout.AdaptiveTableManager.getColumnByXWithShift(AdaptiveTableManager.java:226)
                        at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.addViewHolders(AdaptiveTableLayout.java:790)
                        at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.notifyDataSetChanged(AdaptiveTableLayout.java:1519)
                        at com.alphagao.youda.ui.activity.StadiumActivity$3.run(StadiumActivity.java:276)

Refactoring

In class BaseDataAdaptiveTableLayoutAdapter in switchTwoRows method on line 72 please change for (int i = 0; i < getItems().length; i++) to for (int i = 0; i < getColumnCount() - 1; i++)

Thanks

AdaptiveTableLayout unnecesary sets allowBackup attribute

Setting allowBackup attribute on my own application element at AndroidManifest makes an error with AdaptiveTableLayout, as its library Manifest already sets its own value for this attribute. Therefore is required to also set tools:replace="android:allowBackup in order to replace this value.

Error:Attribute application@allowBackup value=(false) from AndroidManifest.xml:10:9-36 is also present at [com.cleveroad:adaptivetablelayout:1.2.1] AndroidManifest.xml:12:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:8:5-24:19 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Fixed row and column?

Hi,
Thanks a lot for this library.
Is it possible to fix a certain column at the top where the header is or below it so it doesn't leave screen while scrolling down? Also, same goes for row, whereas, I would like to pin certain column there instead of the row header?
@yarovoiag-cr @ilchenko-peter

java.lang.NegativeArraySizeException: -1

Anyone else getting this issue? I'm only running the sample with the demo CSV file.

04-24 11:40:54.124 487-487/com.cleveroad.tablelayout E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cleveroad.tablelayout, PID: 487
java.lang.NegativeArraySizeException: -1
at com.cleveroad.adaptivetablelayout.AdaptiveTableManager.init(AdaptiveTableManager.java:59)
at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.initItems(AdaptiveTableLayout.java:224)
at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.onLayout(AdaptiveTableLayout.java:143)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344)
at android.widget.FrameLayout.onLayout(FrameLayout.java:281)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:3193)
at android.view.View.layout(View.java:17938)
at android.view.ViewGroup.layout(ViewGroup.java:5814)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2666)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2367)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:695)
at android.view.Choreographer.doFrame(Choreographer.java:631)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Drag and drop

How to drag and drop multiple elements at the same time?

Feature: only view mode

Could you please implement an only view mode, so thats not possible to edit the cells?
I would like to use your library only for viewing a table.

RTL Support

Hi.
Hello, can you please give me some solution for RTL support.
setLayoutDirection didn't solve it.
Thank you.

Is possible to merge two cells vertically?

First of all, your lib is awesome!

But I din't find anything that could tell me if is possible to merge the cells of the AdaptiveTableLayout.

I need to do this:
agh20ovasuawoybqvpo5_full_exibicao_formulario

It is possible? If yes, how?

may onActionUp be optimized?

The method onActionUp of AdaptiveTableLayout will be triggered whenever touchUp happens. May the method content be wrapped with 'if(mState.isDragging())'?
code line 1383,like

@Override
public boolean onActionUp(MotionEvent e) {
        if(mState.isDragging()){
              // remove shadows from dragging views
             mShadowHelper.removeAllDragAndDropShadows(this);

             // stop smooth scrolling
            if (!mScrollerDragAndDropRunnable.isFinished()) {
                mScrollerDragAndDropRunnable.stop();
            }
        
              ........
        }

        return true;
}

Crash while switching rows using the adapter which subcalsses BaseDataAdaptiveTableLayoutAdapter

My code is as follows.

static class MyAdapter extends
        BaseDataAdaptiveTableLayoutAdapter<MyAdapter.ViewHolder> {
    @Override
    protected Object[][] getItems() {
        return cells;
    }

    @Override
    public void onBindViewHolder(ViewHolder viewHolder, int row, int column) {
        viewHolder.text.setText(cells[row][column]);
    }

    // other codes...
}

It works well when dragging is not involved.
When switching columns, the app doesn't crash.
But if rows are switched, it crashes!

I found the following code in the library:

void switchTwoRows(int rowIndex, int rowToIndex) {
    for (int i = 0; i < getItems().length; i++) {
        Object cellData = getItems()[rowToIndex][i];
        getItems()[rowToIndex][i] = getItems()[rowIndex][i];
        getItems()[rowIndex][i] = cellData;
    }
}

I think getItems().length should not be used here. It just gives number of rows of my data...
It should be something like getColumnCount() - 1.
Is it my misunderstanding?
Any comment is appreciate.

Not able to click on view

Kindly check my code below:

I am not able to find click listener

+++++++++++++++++++

private static class TestHeaderColumnViewHolder extends ViewHolderImpl {

    TextView tvTitle, tvAddToCartCompare;
    ImageView ivProduct, ivRemove;


    private TestHeaderColumnViewHolder(@NonNull View itemView) {
        super(itemView);
        tvTitle = itemView.findViewById(R.id.tvTitle);
        tvAddToCartCompare = itemView.findViewById(R.id.tvAddToCartCompare);
        ivProduct = itemView.findViewById(R.id.ivProduct);
        ivRemove = itemView.findViewById(R.id.ivRemove);

    }

    public void bind(TestHeaderColumnViewHolder vh, int column) {
        tvTitle.setText(arrayListOfItem.get(column - 1).getProduct_name());
        Glide.with(getItemView().getContext()).load(arrayListOfItem.get(column - 1).getProduct_image()).into(ivProduct);
        **tvAddToCartCompare.setOnClickListener(view -> {


                assert addtocartClickListner != null;
                addtocartClickListner.addToCart(view, arrayListOfItem.get(column - 1), arrayListOfItem.get(column - 1).get_id());

        });**
        **ivRemove.setOnClickListener(view -> {

                assert removeCompareClickLisner != null;
                removeCompareClickLisner.removeFromCart(view, arrayListOfItem.get(column - 1), arrayListOfItem.get(column - 1).get_id());

        });**
    }
}

+++++++++++++++++++

Kindly help me with solution

Thanks

其它点击事件问题

例如布局有两个控件A和B,我想给控件A设置点击事件,在SampleLinkedTableAdapter里设置但是没效果,
adapter设置代码如下:
@OverRide
public void onBindHeaderRowViewHolder(@nonnull ViewHolderImpl viewHolder, int row) {
TestHeaderRowViewHolder vh = (TestHeaderRowViewHolder) viewHolder;
vh.tvText.setText(mTableDataSource.getItemData(row, 0));
vh.img.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
Log.e("data", "点击事件");
}
});
}

java.lang.NegativeArraySizeException: -1

when run app in persian-fa language get this error
AndroidRuntime: FATAL EXCEPTION: main Process: com.develotter.adaptivetablelayouttest, PID: 27698 java.lang.NegativeArraySizeException: -1 at com.cleveroad.adaptivetablelayout.AdaptiveTableManager.init(AdaptiveTableManager.java:59) at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.initItems(AdaptiveTableLayout.java:224) at com.cleveroad.adaptivetablelayout.AdaptiveTableLayout.onLayout(AdaptiveTableLayout.java:143) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344) at android.widget.FrameLayout.onLayout(FrameLayout.java:281) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344) at android.widget.FrameLayout.onLayout(FrameLayout.java:281) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344) at android.widget.FrameLayout.onLayout(FrameLayout.java:281) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1742) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:344) at android.widget.FrameLayout.onLayout(FrameLayout.java:281) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:3145) at android.view.View.layout(View.java:17993) at android.view.ViewGroup.layout(ViewGroup.java:5817) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2755) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2456) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1524) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7520) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:622) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7303) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Kotlin crash

I can't use Kotlin.
I use thos code in java works but in kotlin crash..

mCsvFileDataSource = CsvFileDataSourceImpl(this, null) tlPipeline = findViewById<AdaptiveTableLayout>(R.id.tlPipeline) mTableAdapter = SampleLinkedTableAdapter(this, mCsvFileDataSource) tlPipeline.setAdapter(mTableAdapter)

Behavior with AppBarLayout

Trying to use this lib together with AppBarLayout, to scroll Toolbar up before scrolling view itself. For this, i wrapped table containing layout to NestedScrollView, but can't achieve proper work - looks like TableLayout does not support such behavior. Could you please take a look?

Refactor to AndroidX

AdaptiveTableLayout is still using Android support libraries. This blocks issue #42 among others. This is the library can't be updated to newer API Levels.

To solve this a refactor to Android X is required.

Table not updating with multiple textviews in item_card

Hello,
I've wanted to display a table with 4 TextViews per item, but the table isn't getting updated when I use my modified version of EditItemDialog(to support the 4 TVs I mentioned above).
The data in the csv gets updated immediately, also if I switch to another fragment and back to the table-fragment, the data's displayed correctly!

How can I fix that?

Code handling EditItemDialog response(GH is bugging...):

`

@OverRide
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == EditItemDialog.REQUEST_CODE_EDIT_ITEM && resultCode == Activity.RESULT_OK && data != null) {
int columnIndex = data.getIntExtra(EditItemDialog.EXTRA_COLUMN_NUMBER, 0);
int rowIndex = data.getIntExtra(EditItemDialog.EXTRA_ROW_NUMBER, 0);
String s = data.getStringExtra(EditItemDialog.EXTRA_SUBJECT);
String t = data.getStringExtra(EditItemDialog.EXTRA_TEACHER);
String r = data.getStringExtra(EditItemDialog.EXTRA_ROOM);

        // My attempts to update the layout: 
        mCsvFileDataSource.updateItem(rowIndex, columnIndex,
                CsvFileDataSourceImpl.prepItem(s, t, r));
        mTableAdapter.notifyItemChanged(rowIndex, columnIndex);
        mTableLayout.notifyItemChanged(rowIndex, columnIndex);
        mCsvFileDataSource.applyChanges(getLoaderManager(),
                mTableLayout.getLinkedAdapterRowsModifications(),
                mTableLayout.getLinkedAdapterColumnsModifications(),
                mTableLayout.isSolidRowHeader(),
                ScheduleFragment.this);
        mTableLayout.setVisibility(View.GONE);
        mTableLayout.setVisibility(View.VISIBLE);
        //mTableLayout.invalidate();
        onFileUpdated(StorageUtils.getScheduleFile(getActivity()).getAbsolutePath(), true); // .getScheduleFile() returns File object
    }
}

`

`

public static String prepItem(String s, String t, String r) {
    return s + ";" + t + ";" + r;
}

//...

public String getItemData(int rowIndex, int columnIndex, int position) { // helper method for schedule, splits item and returns data at position's index
    try {
        List<String> rowList = getRow(rowIndex);
        return (rowList == null ? "" : rowList.get(columnIndex)).split(";")[position];
    } catch (Exception e) {
        Log.e(TAG, "get rowIndex=" + rowIndex + "; colIndex=" + columnIndex + "; position:" + position + "\ncache = " +
                mItemsCache.toString(), e);
        return null;
    }
}

`

Best regards,
Felipe

PS: Except for above issue, it works like a charm!

Is it possible to have Pull Down refresh functionality for AdaptiveTableLayout ?

pull_down_activity.txt
First of all, Let me thank you for providing this library. I have used AdaptiveTableLayout to show data in table layout form and it is working perfectly fine.
Further, I want to implement the Pull-Down refresh functionality to load latest data into AdaptiveTableLayout view. For this, I have put AdaptiveTableLayout inside SwipeRefreshLayout. But unfortunately, it is not working. All the time when I try to scroll AdaptiveTableLayout to top (i.e. First position), It stops scrolling and swipe refresh layout is triggered instead of reaching to the first position.
It will be so helpful if AdaptiveTableLayout work with SwipeRefeshLayout just like ListView or RecyclerView.
If it's not compatible with SwipeRefeshLayout then, Then to know whether AdaptiveTableLayout scroll reaches to the top (i.e First position), This will also helpful. So that I can trigger SwipeRefreshLayout manually.

Please refer attached layout file for more information.

Help Appreciated, Thanks.

Scroll flicker when content does not fill the screen

I construct an adapter with small views that do not fill the entire width or height of the screen. When I try to scroll now, the content flickers between the top and bottom of the AdaptiveTableLayout. When I make the cells large enough everything is fine, though.

Spammy advertising

I just received a spam email from [email protected] advertising this repository. It seems I've been added to some sort of mailing list also, since there's an unsubscribe link. I have expressed no interest in this and have not agreed to receive any notifications.


screen shot 2017-07-11 at 11 58 46 am


This violates the GitHub terms of service, which states:

While using GitHub, you agree that you will not under any circumstances... use our servers for any form of excessive automated bulk activity (for example, spamming), or relay any other form of unsolicited advertising or solicitation through our servers

You may not scrape GitHub for spamming purposes

If you collect any GitHub User's Personal Information from GitHub, you agree that you will only use the Personal Information you gather for the purpose for which our User has authorized it

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.