forked from YoKeyword/IndexableRecyclerView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 增加IndexBarDataObservable、IndexBarDataObserver,通知IndexBar数据更新
2. 虽然可以通过HeaderFooterDataObserver#onChanged()方法来通知IndexBar数据更新,最后还是选择方法1
- Loading branch information
sunguodong
committed
Mar 3, 2017
1 parent
3ca9c42
commit 593c662
Showing
7 changed files
with
88 additions
and
1 deletion.
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
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
18 changes: 18 additions & 0 deletions
18
...erecyclerview/src/main/java/me/yokeyword/indexablerv/database/IndexBarDataObservable.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,18 @@ | ||
package me.yokeyword.indexablerv.database; | ||
|
||
import android.database.Observable; | ||
|
||
/** | ||
* Created by Sun on 16/10/13. | ||
*/ | ||
public class IndexBarDataObservable extends Observable<IndexBarDataObserver> { | ||
|
||
public void notifyChanged() { | ||
synchronized (mObservers) { | ||
for (int i = mObservers.size() - 1; i >= 0; i--) { | ||
mObservers.get(i).onChanged(); | ||
} | ||
} | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
...blerecyclerview/src/main/java/me/yokeyword/indexablerv/database/IndexBarDataObserver.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,16 @@ | ||
package me.yokeyword.indexablerv.database; | ||
|
||
/** | ||
* Created by Sun on 16/10/13. | ||
*/ | ||
public class IndexBarDataObserver { | ||
|
||
/** | ||
* This method is called when the entire data set has changed, | ||
* refresh UI | ||
*/ | ||
public void onChanged() { | ||
// Do nothing | ||
} | ||
|
||
} |
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