mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
更新条件を修正
This commit is contained in:
parent
5f89955d80
commit
ce1686a1d7
|
@ -88,18 +88,18 @@ public class LacertaSelectDirDialog extends DialogFragment {
|
|||
getActivity().runOnUiThread(() -> {
|
||||
int currentCount = adapter.getItemCount();
|
||||
String currentDirId = adapter.getCurrentId();
|
||||
if (currentDirId == null && libraryItemPage.getPageId() != null) {
|
||||
// Rootから推移してきた場合
|
||||
if (currentDirId == null) {
|
||||
// Rootが関わる推移 (Rootからの推移)
|
||||
adapter.setListItems(libraryItemPage);
|
||||
adapter.notifyItemRangeRemoved(0, currentCount);
|
||||
adapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size());
|
||||
} else if (libraryItemPage.getPageId() == null) {
|
||||
// Rootに推移した場合
|
||||
// Rootが関わる推移 (Rootへの推移)
|
||||
adapter.setListItems(libraryItemPage);
|
||||
adapter.notifyItemRangeRemoved(0, currentCount);
|
||||
adapter.notifyItemRangeInserted(0, libraryItemPage.getListItems().size());
|
||||
} else if (currentDirId != null && libraryItemPage.getPageId() != null) {
|
||||
// 通常の遷移
|
||||
} else if (libraryItemPage.getPageId() != null) {
|
||||
// Rootが関わらない推移
|
||||
adapter.setListItems(libraryItemPage);
|
||||
adapter.notifyItemRangeRemoved(1, currentCount);
|
||||
adapter.notifyItemRangeInserted(1, libraryItemPage.getListItems().size());
|
||||
|
|
|
@ -59,7 +59,15 @@ public class SelectDirDialogItemAdapter extends RecyclerView.Adapter<SelectDirDi
|
|||
}
|
||||
|
||||
public String getCurrentId() {
|
||||
return this.libraryItemPage == null ? null : this.libraryItemPage.getPageId();
|
||||
if (this.libraryItemPage == null) {
|
||||
return null;
|
||||
} else {
|
||||
if (this.libraryItemPage.getPageId() == null) {
|
||||
return null;
|
||||
} else {
|
||||
return this.libraryItemPage.getPageId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SelectDirDialogItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
|
Loading…
Reference in New Issue
Block a user