-
-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parent RecyclerView of Cell Row Recyclerview didn't use to remeasure …
…itself when it is necessary. This problem has been resolved. #24 issue has been fixed.
- Loading branch information
1 parent
06edc9f
commit 1c1723e
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...ew/src/main/java/com/evrencoskun/tableview/listener/ColumnHeaderLayoutChangeListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.evrencoskun.tableview.listener; | ||
|
||
import android.view.View; | ||
|
||
import com.evrencoskun.tableview.ITableView; | ||
import com.evrencoskun.tableview.adapter.recyclerview.CellRecyclerView; | ||
import com.evrencoskun.tableview.layoutmanager.CellLayoutManager; | ||
|
||
/** | ||
* Created by evrencoskun on 21.01.2018. | ||
*/ | ||
|
||
public class ColumnHeaderLayoutChangeListener implements View.OnLayoutChangeListener { | ||
|
||
private CellRecyclerView mCellRecyclerView; | ||
private CellRecyclerView mColumnHeaderRecyclerView; | ||
private CellLayoutManager mCellLayoutManager; | ||
|
||
public ColumnHeaderLayoutChangeListener(ITableView tableView) { | ||
this.mCellRecyclerView = tableView.getCellRecyclerView(); | ||
this.mColumnHeaderRecyclerView = tableView.getColumnHeaderRecyclerView(); | ||
this.mCellLayoutManager = tableView.getCellLayoutManager(); | ||
} | ||
|
||
@Override | ||
public void onLayoutChange(View view, int i, int i1, int i2, int i3, int i4, int i5, int i6, | ||
int i7) { | ||
if (mCellRecyclerView.isShown() && mColumnHeaderRecyclerView.getWidth() > | ||
mCellRecyclerView.getWidth()) { | ||
|
||
// Remeasure all nested CellRow recyclerViews | ||
mCellLayoutManager.remeasureAllChild(); | ||
} | ||
} | ||
} |