fixed KeyNotFound bug, cosmetic changes
This commit is contained in:
@@ -47,11 +47,6 @@ public class SelectSignKeyAdapter extends KeyCursorAdapter<CursorAdapter.KeyCurs
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getIdFromCursor(KeyCursor keyCursor) {
|
||||
return keyCursor.getKeyId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position == getItemCount() -1 ?
|
||||
|
||||
@@ -52,6 +52,7 @@ public abstract class CursorAdapter<C extends CursorAdapter.AbstractCursor, VH e
|
||||
* @param context The context
|
||||
*/
|
||||
public CursorAdapter(Context context, C c) {
|
||||
setHasStableIds(true);
|
||||
init(context, c, FLAG_REGISTER_CONTENT_OBSERVER);
|
||||
}
|
||||
|
||||
@@ -64,6 +65,7 @@ public abstract class CursorAdapter<C extends CursorAdapter.AbstractCursor, VH e
|
||||
* @see #FLAG_REGISTER_CONTENT_OBSERVER
|
||||
*/
|
||||
public CursorAdapter(Context context, C c, int flags) {
|
||||
setHasStableIds(true);
|
||||
init(context, c, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@ public abstract class SectionCursorAdapter<C extends CursorAdapter.AbstractCurso
|
||||
|
||||
public SectionCursorAdapter(Context context, C cursor, int flags, Comparator<T> comparator) {
|
||||
super(context, cursor, flags);
|
||||
|
||||
setHasStableIds(false); // because we have additional section items
|
||||
setSectionComparator(comparator);
|
||||
}
|
||||
|
||||
|
||||
@@ -352,12 +352,14 @@ public class RecyclerFragment<A extends RecyclerView.Adapter> extends Fragment {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void ensureList() {
|
||||
if (listView != null)
|
||||
if (listView != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
View root = getView();
|
||||
if (root == null)
|
||||
if (root == null) {
|
||||
throw new IllegalStateException("Content view not yet created");
|
||||
}
|
||||
|
||||
if (root instanceof RecyclerView) {
|
||||
listView = (RecyclerView) root;
|
||||
|
||||
Reference in New Issue
Block a user