Open Charith424 opened 3 years ago
Not a Bug, TableView does not have this feature
As a user experience, how does a user know a table has more columns horizontally and more rows vertically?
Yes a useful feature, but this should be a feature request to try and get it added.
Due to the structure to the Table I don't think it would be easy to get scrollbars in those locations.
A quick hack to the library can add scrollbars in the headers to indicate the table is scrollable
e.g. (scrollbars circled in red)
It will take a bit more work to expose this capability to the App using TableView BUT as lots of new functionality has been added to TableView BUT no release has been made with this new functionality you are probably going to custom built the library yourself for the App to get any new functionality.
Note these can be styled like a standard recyclerview scrollbar
I have tried wrapping table view by HorizontalScrollView It is working partially showing horizontal bar but If the table has more columns horizontally than screen size those columns are hiding
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.evrencoskun.tableview.TableView
android:id="@+id/my_TableView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scrollbars="vertical|horizontal"
android:scrollbarThumbVertical="@android:color/darker_gray"
android:scrollbarSize="5dp"
app:column_header_height="@dimen/table_view_cell_height"
app:row_header_width="@dimen/table_view_row_header_width"
app:selected_color="@color/selected_background_color"
app:shadow_color="@color/shadow_background_color"
app:unselected_color="@color/unselected_background_color"
app:separator_color="@color/separator_color"
/></HorizontalScrollView>
create a xml file cellrecycleview.xml
<?xml version="1.0" encoding="utf-8"?>
<com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="vertical"/>
in class CellRecyclerView create a new constructer
public CellRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
// These are necessary.
this.setHasFixedSize(false);
this.setNestedScrollingEnabled(false);
// These are for better scrolling process.
this.setItemViewCacheSize(context.getResources().getInteger(R.integer
.default_item_cache_size));
this.setDrawingCacheEnabled(true);
this.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
}
in TableView.createCellRecyclerView() functrion
delete
CellRecyclerView recyclerView = new CellRecyclerView(getContext());
add
CellRecyclerView recyclerView = (CellRecyclerView) LayoutInflater.from(getContext()).inflate(R.layout.cellrecycleview, null);
Is there a way to implement horizontal scrollview indicator for the content
I have tried wrapping table view by HorizontalScrollView It is working partially showing horizontal bar but If the table has more columns horizontally than screen size those columns are hiding
<HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content" > <com.evrencoskun.tableview.TableView android:id="@+id/my_TableView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:scrollbars="vertical|horizontal" android:scrollbarThumbVertical="@android:color/darker_gray" android:scrollbarSize="5dp" app:column_header_height="@dimen/table_view_cell_height" app:row_header_width="@dimen/table_view_row_header_width" app:selected_color="@color/selected_background_color" app:shadow_color="@color/shadow_background_color" app:unselected_color="@color/unselected_background_color" app:separator_color="@color/separator_color" /></HorizontalScrollView>
Did you got any solution to add horizondal scroll indicator
Hi guys, I might have found something that we can use to enable scrollbars and if you want to change the default scrollbar drawable it will be possible on Android Q.....without importing Library.
/*Column ScrollBar*/ CellRecyclerView columnRecyclerView = tableView.getColumnHeaderRecyclerView(); columnRecyclerView.setHorizontalScrollBarEnabled(true); columnRecyclerView.setScrollbarFadingEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { columnRecyclerView.setHorizontalScrollbarThumbDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_thumb_drawable)); columnRecyclerView.setHorizontalScrollbarTrackDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_track_drawable)); } columnRecyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); /*Row ScrollBar*/ CellRecyclerView rowRecyclerView = tableView.getRowHeaderRecyclerView(); rowRecyclerView.setVerticalScrollBarEnabled(true); rowRecyclerView.setScrollbarFadingEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { rowRecyclerView.setVerticalScrollbarThumbDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_thumb_drawable)); rowRecyclerView .setVerticalScrollbarTrackDrawable(AppCompatResources.getDrawable(context, R.drawable.table_scroll_bar_track_drawable)); } rowRecyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
Well I am still looking to enable drag but not yet found. Please help if any one got it enabled or else I might need to import.
I haven't thought of a better way to implement it yet. The way I implement it is
recyclerview_horizontal.xml
<?xml version="1.0" encoding="utf-8"?>
<com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="horizontal"
android:scrollbarSize="@dimen/scrollbar_windth2"
android:scrollbarStyle="insideOverlay"
android:scrollbarThumbHorizontal="@drawable/thumb"
android:scrollbarTrackHorizontal="@drawable/track"/>
嗨,大家好,我可能已经找到了一些我们可以用来启用滚动条的东西,如果您想更改默认的滚动条可绘制对象,可以在 Android Q 上使用.....无需导入库。
/*Column ScrollBar*/ CellRecyclerView columnRecyclerView = tableView.getColumnHeaderRecyclerView(); columnRecyclerView.setHorizontalScrollBarEnabled(true); columnRecyclerView.setScrollbarFadingEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { columnRecyclerView.setHorizontalScrollbarThumbDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_thumb_drawable)); columnRecyclerView.setHorizontalScrollbarTrackDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_track_drawable)); } columnRecyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); /*Row ScrollBar*/ CellRecyclerView rowRecyclerView = tableView.getRowHeaderRecyclerView(); rowRecyclerView.setVerticalScrollBarEnabled(true); rowRecyclerView.setScrollbarFadingEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { rowRecyclerView.setVerticalScrollbarThumbDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_thumb_drawable)); rowRecyclerView .setVerticalScrollbarTrackDrawable(AppCompatResources.getDrawable(context, R.drawable.table_scroll_bar_track_drawable)); } rowRecyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
好吧,我仍在寻找启用拖动,但尚未找到。如果有人启用了它,请提供帮助,否则我可能需要导入。
Hi guys, I might have found something that we can use to enable scrollbars and if you want to change the default scrollbar drawable it will be possible on Android Q.....without importing Library.
/*Column ScrollBar*/ CellRecyclerView columnRecyclerView = tableView.getColumnHeaderRecyclerView(); columnRecyclerView.setHorizontalScrollBarEnabled(true); columnRecyclerView.setScrollbarFadingEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { columnRecyclerView.setHorizontalScrollbarThumbDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_thumb_drawable)); columnRecyclerView.setHorizontalScrollbarTrackDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_track_drawable)); } columnRecyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); /*Row ScrollBar*/ CellRecyclerView rowRecyclerView = tableView.getRowHeaderRecyclerView(); rowRecyclerView.setVerticalScrollBarEnabled(true); rowRecyclerView.setScrollbarFadingEnabled(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { rowRecyclerView.setVerticalScrollbarThumbDrawable(AppCompatResources .getDrawable(context, R.drawable.table_scroll_bar_thumb_drawable)); rowRecyclerView .setVerticalScrollbarTrackDrawable(AppCompatResources.getDrawable(context, R.drawable.table_scroll_bar_track_drawable)); } rowRecyclerView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
Well I am still looking to enable drag but not yet found. Please help if any one got it enabled or else I might need to import.
You can use a third-party library to implement a draggable scrollbar, but cellRecyclerView and rowRecyclerView will not scroll synchronously, so this problem needs to be solved
Vertical and horizontal scroll bars are not showing in table view
I have pull "TableViewSampleApp" and tried to add horizontal and vertical scroll bars but those two bars are not showing up in table view.
To Reproduce Steps to reproduce the behavior:
Code
I have newly added below lines to table view for enable scroll bars
Expected behavior Scroll bars should be visible.It will help user to look and feel table can scroll to horizontally or vertically.
Screenshots![IssuCapture](https://user-images.githubusercontent.com/34487833/109918985-eb2acf00-7cdd-11eb-9cfe-217929c518f9.PNG)
Tools:
TableView
version: [e.g. 0.8.9.2]