|
6 | 6 | * Data observer which notifies {@link OverflowPagerIndicator} of changed data |
7 | 7 | * |
8 | 8 | * @author Petr Introvic <introvic.petr@gmail.com> |
9 | | - * created 03.10.2017. |
| 9 | + * created 03.10.2017. |
10 | 10 | */ |
11 | 11 |
|
12 | 12 | class OverflowDataObserver extends RecyclerView.AdapterDataObserver { |
13 | 13 |
|
14 | | - private OverflowPagerIndicator mOverflowPagerIndicator; |
15 | | - |
16 | | - OverflowDataObserver(OverflowPagerIndicator overflowPagerIndicator) { |
17 | | - mOverflowPagerIndicator = overflowPagerIndicator; |
18 | | - } |
19 | | - |
20 | | - @Override |
21 | | - public void onChanged() { |
22 | | - mOverflowPagerIndicator.updateIndicatorsCount(); |
23 | | - } |
24 | | - |
25 | | - @Override |
26 | | - public void onItemRangeInserted(int positionStart, int itemCount) { |
27 | | - mOverflowPagerIndicator.updateIndicatorsCount(); |
28 | | - } |
29 | | - |
30 | | - @Override |
31 | | - public void onItemRangeChanged(int positionStart, int itemCount) { |
32 | | - mOverflowPagerIndicator.updateIndicatorsCount(); |
33 | | - } |
34 | | - |
35 | | - @Override |
36 | | - public void onItemRangeChanged(int positionStart, int itemCount, Object payload) { |
37 | | - mOverflowPagerIndicator.updateIndicatorsCount(); |
38 | | - } |
39 | | - |
40 | | - @Override |
41 | | - public void onItemRangeRemoved(int positionStart, int itemCount) { |
42 | | - mOverflowPagerIndicator.updateIndicatorsCount(); |
43 | | - } |
44 | | - |
45 | | - @Override |
46 | | - public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) { |
47 | | - mOverflowPagerIndicator.updateIndicatorsCount(); |
48 | | - } |
| 14 | + private OverflowPagerIndicator mOverflowPagerIndicator; |
| 15 | + |
| 16 | + OverflowDataObserver(OverflowPagerIndicator overflowPagerIndicator) { |
| 17 | + mOverflowPagerIndicator = overflowPagerIndicator; |
| 18 | + } |
| 19 | + |
| 20 | + @Override |
| 21 | + public void onChanged() { |
| 22 | + mOverflowPagerIndicator.updateIndicatorsCount(); |
| 23 | + } |
| 24 | + |
| 25 | + @Override |
| 26 | + public void onItemRangeInserted(int positionStart, int itemCount) { |
| 27 | + mOverflowPagerIndicator.updateIndicatorsCount(); |
| 28 | + } |
| 29 | + |
| 30 | + @Override |
| 31 | + public void onItemRangeChanged(int positionStart, int itemCount) { |
| 32 | + mOverflowPagerIndicator.updateIndicatorsCount(); |
| 33 | + } |
| 34 | + |
| 35 | + @Override |
| 36 | + public void onItemRangeChanged(int positionStart, int itemCount, Object payload) { |
| 37 | + mOverflowPagerIndicator.updateIndicatorsCount(); |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + public void onItemRangeRemoved(int positionStart, int itemCount) { |
| 42 | + mOverflowPagerIndicator.updateIndicatorsCount(); |
| 43 | + } |
| 44 | + |
| 45 | + @Override |
| 46 | + public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) { |
| 47 | + mOverflowPagerIndicator.updateIndicatorsCount(); |
| 48 | + } |
49 | 49 | } |
0 commit comments