Skip to content

Commit

Permalink
update state diff
Browse files Browse the repository at this point in the history
  • Loading branch information
KunMinX committed Sep 19, 2023
1 parent a51343a commit d175a49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
// 如这么说无体会,详见 https://xiaozhuanlan.com/topic/6017825943 & https://juejin.cn/post/7117498113983512589

PlayerManager.getInstance().getUiStates().observe(getViewLifecycleOwner(), uiStates -> {
mStates.musicId.set(uiStates.getMusicId(), onDiff -> mAdapter.notifyDataSetChanged());
mStates.musicId.set(uiStates.getMusicId(), changed -> mAdapter.notifyDataSetChanged());
});

//TODO tip 4:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void onPanelStateChanged(
PlayerManager.getInstance().getUiStates().observe(getViewLifecycleOwner(), uiStates -> {
mStates.title.set(uiStates.getTitle());
mStates.artist.set(uiStates.getSummary());
mStates.coverImg.set(uiStates.getImg(), onDiff -> {
mStates.coverImg.set(uiStates.getImg(), changed -> {
if (mListener != null) view.post(mListener::calculateTitleAndArtist);
});
mStates.isPlaying.set(!uiStates.isPaused());
Expand Down
6 changes: 3 additions & 3 deletions architecture/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ dependencies {
api 'com.github.KunMinX:MVI-Dispatcher:7.6.0'
api 'com.github.KunMinX:UnPeek-LiveData:7.8.0'
api 'com.github.KunMinX:Smooth-Navigation:v4.0.0'
api 'com.github.KunMinX.Strict-DataBinding:binding_state:6.1.0'
api 'com.github.KunMinX.Strict-DataBinding:strict_databinding:6.1.0'
api 'com.github.KunMinX.Strict-DataBinding:binding_recyclerview:6.1.0'
api 'com.github.KunMinX.Strict-DataBinding:binding_state:6.2.0'
api 'com.github.KunMinX.Strict-DataBinding:strict_databinding:6.2.0'
api 'com.github.KunMinX.Strict-DataBinding:binding_recyclerview:6.2.0'

//常用数据、媒体组件

Expand Down

0 comments on commit d175a49

Please sign in to comment.