fix no response for toggle view type at first time

This commit is contained in:
houxg
2017-02-17 15:57:16 +08:00
parent 9147d1a4fe
commit f616101010

View File

@@ -57,6 +57,7 @@ public class NoteList {
}
private void setType(int type) {
mCurrentType = type;
mAdapter.setType(type);
mNoteListView.removeItemDecoration(mItemDecoration);
if (type == TYPE_DETAIL) {
@@ -66,8 +67,8 @@ public class NoteList {
}
public void toggleType() {
mCurrentType = mCurrentType == TYPE_SIMPLE ? TYPE_DETAIL : TYPE_SIMPLE;
setType(mCurrentType);
int newType = mCurrentType == TYPE_SIMPLE ? TYPE_DETAIL : TYPE_SIMPLE;
setType(newType);
}
public String getType() {