New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How add CardItemView dinamically #48
Comments
Yeah, it is possible to add CardItemView dinamically. Serveral month ago, CardSlidePanel has a public function called appendData(dataList). It is like this: /**
* add new cardlist
* this function is not tested
*/
public void appendData(List<CardDataItem> appendList) {
dataList.addAll(appendList);
int currentIndex = isShowing;
int num = viewList.size();
for (int i = 0; i < num; i++) {
CardItemView itemView = viewList.get(i);
itemView.setVisibility(View.VISIBLE);
itemView.fillData(dataList.get(currentIndex++));
}
} |
yep you are right,but i have indexof exception.This is my xml code ` <com.stone.card.CardSlidePanel
and my array has two elements ` private String imagePaths[] = {"assets://wall01.jpg",
` private void prepareDataList() {
can you tell me how i can solve my problem? I have error in this snippet ` public void fillData(List dataList) {
is it a possible to add CardSlidePanel View inside`CardSlidePanel in Xml file.I mean programmatically |
Since the logcat has told you everything about the error line, please fix it by yourself. |
I'll fix.Is it a possible to add CardSlidePanel view iniside CardSlidePanel programmatically? I think problem is that i must have same amount of elements in both sides.(in Arraylist and xml file,CardSlidePanel ) |
Not really. In the xml file, CardSlidePanel needs 4 CardItemView which has nothing to do with your datalist's size. |
thanks your attention .Can you help me and show me code snippet if array has bellow 4 elements.thanks |
No. You can adjust your code by yourself. Logcat has told you everything. |
:) thanks. i try it but i think it's impossibile |
Yeah. If problems still exists later, you can come to this issue again. |
I fixed indexof exception but maybe you library not working correct if array size is less 4 |
what does logcat say? |
I can share CardSlidePanel java source |
show me the log |
look.Array's size is 2.First time everything is perfect but i have like this result when swipe finished |
show me the error log!! |
maybe you did not understand me.I have not error.In log everything is okey ,but in my option main logic not working correct if array's length is less then 4 |
any suggestion? |
what's your email address? simply i send you the java code |
java code has sent to your email. |
This issue is not closed. Problem is still there when you have less than 4 items to be displayed. |
Hi
I'm using your library.I have one question.Is it a possible to add dinamically CardItemView view in CardSlidePanel.In this example you use static array,but i have json and different size array.
I tried to remove some elements in you arrayList ,but i have IndexOf exceplion
The text was updated successfully, but these errors were encountered: