Skip to content

Commit

Permalink
添加Item滑动监听事件
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellen2018 committed Jun 28, 2019
1 parent 1a2c30e commit e45214c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class TableView extends RelativeLayout {
private GridLayout gridLayoutY;
private GridLayout gridLayoutX;
private GridLayout gridLayoutXY;
private LinearLayout ll_table;
//用于列定位
private TableHorizontalScrollView horizontalScrollView;
private TableHorizontalScrollView horizontalScrollView_x;
Expand Down Expand Up @@ -454,6 +455,7 @@ private void initView() {
gridLayoutX = view.findViewById(R.id.grid_layout_x);
gridLayoutXY = view.findViewById(R.id.grid_layout_xy);
scrollView = view.findViewById(R.id.scrollView);
ll_table = view.findViewById(R.id.ll_table);
scrollView.setOnScrollChangeListener(new OnScrollChangeListener() {
@Override
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
Expand Down Expand Up @@ -591,7 +593,7 @@ public int getActualTableWidth(){
}

public int getTableWidth(){
return gridLayoutTable.getWidth();
return ll_table.getWidth();
}

/**
Expand Down
1 change: 1 addition & 0 deletions tableview/src/main/res/layout/layout_view_table.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
android:scrollbars="none">

<LinearLayout
android:id="@+id/ll_table"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand Down

0 comments on commit e45214c

Please sign in to comment.