evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.13k stars 451 forks source link

Forcing sticky column header #400

Open bobbyirawan09 opened 2 years ago

bobbyirawan09 commented 2 years ago

Hi, I had an issue with the sticky column header, it does not work if I put it inside a complex fragment layout. But if I put it directly, like in Activity, the sticky does work

Nested complex layout

The nested complex layout (Activity)

<?xml version="1.0" encoding="UTF-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout>
   <com.google.android.material.appbar.AppBarLayout>
      <com.google.android.material.appbar.CollapsingToolbarLayout>
         <androidx.appcompat.widget.Toolbar>
            <LinearLayout />
         </androidx.appcompat.widget.Toolbar>
      </com.google.android.material.appbar.CollapsingToolbarLayout>
      <com.google.android.material.tabs.TabLayout />
   </com.google.android.material.appbar.AppBarLayout>
   <FrameLayout>
      <ViewPager />
      <!-- The fragment is added inside view page -->
      <androidx.core.widget.ContentLoadingProgressBar />
   </FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

The nested complex layout (Fragment)

<RelativeLayout>
   <com.google.android.material.appbar.AppBarLayout>
      <include />
   </com.google.android.material.appbar.AppBarLayout>
   <include />
   <ViewFlipper>
      <LinearLayout>
         <com.evrencoskun.tableview.TableView />
      </LinearLayout>
   </ViewFlipper>
</RelativeLayout>

The simple layout

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout>
   <com.google.android.material.appbar.AppBarLayout>
      <include />
   </com.google.android.material.appbar.AppBarLayout>
   <include />
   <ViewFlipper>
      <LinearLayout>
         <com.evrencoskun.tableview.TableView />
         <include />
      </LinearLayout>
   </ViewFlipper>
</RelativeLayout>

Is there some kind of a way to force it sticky, either programmatically or through XML? If it's through XML, how to do it? Since the XML itself had so many layers. Thanks

kurniawanrizzki commented 2 weeks ago

I face same issue, did you solve it?