Skip to content

Commit

Permalink
Fix the use of List interface instead of ArrayList implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ema987 committed Aug 10, 2015
1 parent 40a0c90 commit 9785ab4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The usage is pretty straightforward. Add the tag into the XML layout, then use t

```sh
NiceSpinner niceSpinner = (NiceSpinner) findViewById(R.id.nice_spinner);
ArrayList<String> dataset = new ArrayList<>(Arrays.asList("One", "Two", "Three", "Four", "Five"));
List<String> dataset = new LinkedList<>(Arrays.asList("One", "Two", "Three", "Four", "Five"));
niceSpinner.attachDataSource(dataset);
```

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/angmarch/views/NiceSpinner.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import android.widget.PopupWindow;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

/**
* @author angelo.marchesin
Expand Down Expand Up @@ -197,7 +197,7 @@ public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener onItemS
mOnItemSelectedListener = onItemSelectedListener;
}

public <T> void attachDataSource(@NonNull ArrayList<T> dataset) {
public <T> void attachDataSource(@NonNull List<T> dataset) {
mAdapter = new NiceSpinnerAdapter<>(getContext(), dataset);
setAdapterInternal();
}
Expand Down

0 comments on commit 9785ab4

Please sign in to comment.