Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
Removed abstract method. Now uses cast with supressed unchecck warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbenprimke committed Nov 3, 2015
1 parent 00f09b0 commit 6a00f7b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ dependencies {

compile 'com.android.support:recyclerview-v7:22.0.+'

// compile project(':library')
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.1'
compile project(':library')
// compile 'com.github.thorbenprimke:realm-recyclerview:0.9.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ public void onClick(View v) {
}
viewHolder.quoteTextView.setText(quoteModel.getQuote());
}

@Override
public ViewHolder convertViewHolder(RealmViewHolder viewHolder) {
return ViewHolder.class.cast(viewHolder);
}
}

private void asyncAddQuote() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ public void onClick(View v) {
}
);
}

@Override
public ViewHolder convertViewHolder(RealmViewHolder viewHolder) {
return ViewHolder.class.cast(viewHolder);
}
}

private void resetRealm() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ public RealmBasedRecyclerViewAdapter(

public abstract void onBindRealmViewHolder(VH holder, int position);

public abstract VH convertViewHolder(RealmViewHolder viewHolder);

/**
* DON'T OVERRIDE THIS METHOD. Implement onCreateRealmViewHolder instead.
*/
Expand All @@ -168,6 +166,7 @@ public RealmViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
* DON'T OVERRIDE THIS METHOD. Implement onBindRealmViewHolder instead.
*/
@Override
@SuppressWarnings("unchecked")
public void onBindViewHolder(RealmViewHolder holder, int position) {
if (getItemViewType(position) == LOAD_MORE_VIEW_TYPE) {
holder.loadMoreView.showSpinner();
Expand All @@ -186,7 +185,7 @@ public void onBindViewHolder(RealmViewHolder holder, int position) {
}
layoutParams.isHeader = true;
} else {
onBindRealmViewHolder(convertViewHolder(holder), position);
onBindRealmViewHolder((VH) holder, position);
}
layoutParams.setSlm(LinearSLM.ID);
if (header != null) {
Expand All @@ -196,7 +195,7 @@ public void onBindViewHolder(RealmViewHolder holder, int position) {
}
holder.itemView.setLayoutParams(layoutParams);
} else {
onBindRealmViewHolder(convertViewHolder(holder), position);
onBindRealmViewHolder((VH) holder, position);
}
}
}
Expand Down

0 comments on commit 6a00f7b

Please sign in to comment.